skycat-3.1.2-starlink-1b/000077500000000000000000000000001215713201500151355ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/.gitignore000066400000000000000000000005341215713201500171270ustar00rootroot00000000000000*.a *.o *.so *~ Makefile astrotclConfig.sh autom4te.cache catConfig.sh cat_version.tcl config.* configure.lineno pkgIndex.tcl rtd/rtd rtdClient rtdConfig.sh rtdCubeDisplay rtdServer rtd_version.tcl skycat-star skycat/linux/skycat.spec skycatConfig.sh skycat_version.tcl tRtd tclIndex tclutil.sh tclutilConfig.sh tclutil_version.tcl *.dSYM *.dylib skycat-3.1.2-starlink-1b/CHANGES000066400000000000000000001404651215713201500161420ustar00rootroot00000000000000CHANGES to Skycat Release ------------------------- This file contains a list of overall changes to the Skycat software and user interface. The latest changes are at the top. See also the CHANGES files in the tclutil, astrotcl, rtd, cat and skycat directories for changes specific to those packages. --------------- 17.10.08 released skycat-3.1.1 ----------------- * Fixed: HDU images display for VISTA data --------------- 17.10.08 released skycat-3.1.0 ----------------- * Updated cfitsio and wcstools packages (astrotcl) to newer versions. * Added support for ZPN projection. * Added support for tiled-image compressed files. * Added support for data types double and long long int. * Fixes for gcc version 4.2.4. --------------- 10.09.07 released skycat-3.0.2 ----------------- * Increased maximum number of views of an image from 8 to 64 --------------- 26.03.06 released skycat-3.0.1 ----------------- * Added patches from Sergio Gelato : Replaced calls to free() with Tcl_Free() for Tcl lists accessed from C code, as well as other minor bugs that showed up under Debian GNU/Linux 3.1. --------------- 03.02.06 released skycat-3.0 ------------------- * Rewrote makefiles and configure scripts using the Tcl TEA standard, Simplified source directory structure (There is now only one Makefile per package) * Rewrote skycat and rtd start scripts to be relocatable and set the correct environment variables on each platform. * All Tcl packages are now dynamically loaded (There is no skycat binary: just standard wish8.4 and a script that does a "package require Skycat") * Updated cfitsio and wcstools packages (astrotcl) to the latest versions * Merged in changes made by Peter Biereichel and Carlos Guirao at ESO * Removed dependency on the Tix package, replaced with BLT widgets and tkimg * Added tkimg (Img1.3) package (by request, also used for displaying some images) * Added Mac OS X support and a Skycat.dmg binary package * Binary versions are now available for Solaris9 (sparc), HP-UX, Redhat9, Fedora3, Fedora4, SuSE-10, Mac OS X. (Source RPMs can be used to make RPMs for other Linux versions) * Single binary (TclPro) version is no longer supported. Instead, RPMs and tar files are provided. (TclKit would not work as a replacement for TclPro, due to BLT package/linking issues.) * Added fix from awicenec@eso.org for WorldCoords.dispos() (calculates distance between two WCS positions) --------------- 04.04.05 released skycat-2.7.4 ----------------- * Merged in RTD changes from Peter Biereichel * Minor bug fixes and testing with latest compilers --------------- 20.01.03 released skycat-2.7.3 ----------------- * Ported to gcc-3.2.1 and Tcl-8.4.1: Changed the syntax for standard #include files from: to (for C++) and for C. For example: changed to and change to . The Standard C++ Header files are: algorithm bitset complex deque exception fstream functional iomanip ios iosfwd iostream istream iterator limits list locale map memory new numeric ostream queue set sstream stack stdexcept streambuf typeinfo utility valarray vector The Standard C Header files are: assert ctype errno float iso646 limits locale math setjmp signal stdarg stddef stdio stdlib string time * Added std:: namespace prefix to all standard C++ names. (For example: std::iostream, std::string, std::list, std::endl). --------------- 27.02.02 released skycat-2.7.2 ----------------- * Fixed problem with temporary downloaded image files being deleted too soon. (Now they are only deleted after they are loaded, so that the OS can delete them later on.) --------------- 13.12.01 released skycat-2.7.1 ----------------- * Enabled WCS coordinate conversion outside of the image area (by request). * fixed problem with equinox syntax reported by David Terrett. --------------- 27.08.01 released skycat-2.7 ----------------- * Merged in rtd and catalog changes from Peter Biereichel. * Fixed the -float_panel and -panel_orient options as well as the show/hide control panel menu item. * Included IWidgets in the skycat single binary version (used by the new FITS header viewer). --------------- 22.08.01 released skycat-2.6.10 ----------------- * Fixed a bug that caused skycat to access data outside the image array for some (very small) images, which could cause the application to crash or display incorrect values. --------------- 30.07.01 released skycat-2.6.9 ----------------- * Fixed problem with X shared memory, ssh and X11 forwarding: (X shm areas are not freed, so don't use them in this case) --------------- 20.06.01 released skycat-2.6.8 ----------------- * Fixed problem selecting catalog symbols in tk8.3.x --------------- 18.05.01 released skycat-2.6.7 ----------------- * Ported to tcl8.3.3 (still compatible with earlier versions). --------------- 11.05.01 released skycat-2.6.6 ----------------- * Fix for displaying multi-extension FITS images (see rtd/CHANGES) --------------- 17.02.01 released skycat-2.6.5 ----------------- * Fixed a bug converting coordinates between deg and wcs using the rtd tcl subcommand "convert". * Fixed a minor bug that occurred when a catalog config entry had a copyright field but no x,y or ra,dec columns defined. --------------- 09.11.00 released skycat-2.6.4 ----------------- * Fixed a bug that occurred when attempting to load an image file that was a relative path to a relative symbolic link. (For example: skycat ../x.fits, where x.fits is a link to y.fits). --------------- 20.09.00 released skycat-2.6.3 ----------------- * Fixed a bug in the display of galactic and ecliptic coordinates: RA was being displayed in hours and the equinox was displayed as 2000. Now RA is displayed in degrees in those cases and the equinox field displays "GALACTIC" or "ECLIPTIC". * Upgraded the WCS library to wcssubs-2.8.3. --------------- 25.05.00 released skycat-2.6.2 ----------------- * Added the procedure "display_catalog {catalogName}" to the SkyCat itcl class, for use via the remote interface. Now you can send this command to open a catalog window to display a catalog (name from the skycat config file) or a local catalog file (path name). * Note: the Solaris and HP single binary versions are now built with the same gcc compiler used to build the VLT software (There were previously some subtle incompatibilities). * Removed an error message that caused problems when the image header and data were in separate files. * Minor layout changes. --------------- 21.03.00 released skycat-2.6.1 ----------------- * Tested compiling with Sun-CC 4.2 and fixed a number of incompatibilities. --------------- 02.03.00 released skycat-2.6 ----------------- * Added support for displaying WFI type images, which contain multiple image extensions, as a single image, based on the CRPIX values in the extensions. The default bahavoir is as before, except that there is a new button in the HDU window "Display as one Image". * Added a new button in the HDU window: "Use Settings from Main Image" that sets the colormap, color scaling options and cut levels for the preview images from the main image. This is needed, since the preview images often appear black when they have not been not prescaled. * Merged the Skycat and RTD versions of the HDU window. Now the Skycat version is a subclass of the RTD version. * Tested Skycat build with Tcl8.2/Tk8.2 and Scriptics TclPro-1.3 and made minor changes in the Skycat configure script to support this. See ./INSTALL for details. * Added a new Skycat/RTD option: -panel_orient horizontal|vertical and added code to support having the main info panel on the left with a vertical orientation. The default for RTD is horizontal, as before. * Changed the default layout of the Skycat main panel to be on the left instead of the top (use "skycat -panel_orient horizontal" to get the old behavior). * Added code to check for valid command line options (The previous version sometimes crashed when passed invalid options). --------------- 27.12.99 released skycat-2.5.3 ----------------- * Minor bug fixes for the pick object window (to handle transformations correctly). --------------- 15.12.99 released skycat-2.5.2 ----------------- * Merged in RTD changes made by Peter Biereichel (see rtd/CHANGES) * Fixed minor bug in pick object window (rectangle was not being displayed in the center of the image). --------------- 02.11.99 released skycat-2.5.1 ----------------- * Fixed a bug dealing with leading zeros in formatting the seconds of RA (Could lead to incorrect plots and/or displayed values for RA). --------------- 25.10.99 released skycat-2.5 -------------------- * Merged in changes made by Peter Biereichel --------------- 09.9.99 released skycat-2.4.7 ------------------- * Fixed a bug in the formatting/printing of RA values (sometimes the fractional part of the seconds was incorrect). * Updated for egcs/gcc-2.95 (This compiler version is stricter for C++ code and even fails the solaris X11 header files, unless told to ignore the errors...). --------------- 22.7.99 released skycat-2.4.6 ------------------- * TCS catalogs: fixed a bug dealing with TCS catalogs (error message was "empty TCS result"). * Fixed problem with catalog directory hierarchies. Previously, catalog names had to be unique in the entire catalog hierarchy. Now, the interface has been changed slightly to fix this (see cat/CHANGES). --------------- 14.7.99 released skycat-2.4.5 ------------------- * Fixed a bug in the FITS I/O that caused problems under HP-UX when loading FITS tables. * TCS catalogs: fixed a bug dealing with TCS catalogs (error message was "empty TCS result"). --------------- 21.6.99 released skycat-2.4.4 ------------------- * catalogs: allow empty RA and DEC columns in query results where ra_col and dec_col are defined (previously an error mesage was generated: "error in RA value, expected HH:MM:SS"). * Fixed problem with double-click in FileSelect widget. --------------- 16.15.99 released skycat-2.4.3 ------------------- * HDU Display: Reversed the row order for displaying image extensions when sorting by CRPIX values (The order was previously incorrect). * Fits I/O: For image files with multiple image extensions: Now each header is merged with the primary HDU header when checking for WCS keywords. Keywords in the extension header override the same keywords in the primary header. * Fixed a number of RTD related bugs (see rtd/CHANGES). --------------- 02.04.99 released skycat-2.4.2 ------------------- * Added changes from Peter Biereichel: new rtdimage subcommand 'biasimage' and widget 'RtdImageBias' for on-the-fly bias image subtraction. The widget can be called from the real-time menu (See rtd/CHANGES). * Fixed from HP-UX related bugs dealing with dynamic loading (see tclutil/CHANGES). --------------- 25.03.99 released skycat-2.4.1 ------------------- * Added a check when saving catalog data to a compressed image, since this is not implemented. * Fixed the Exit menu item to really exit and not just close the window, in the case where there is more than one main window. * Fixed bug in startup when creating history catalog. * In the skycatgaia binary release, there was a problem with the ardmask binary (The release contained an older version). * Fixed problems with BLT graphs and zooming. --------------- 22.03.99 released skycat-2.4 --------------------- * Tested with SuSE-Linux-6.0 (gnulibc), TclPro-1.2, tcl8.0.5, the egcs-1.1.1 compiler and fixed a number of bugs that turned up there. * The single binary skycat release is now created using Scriptics TclPro-1.2 (tcl8.0.5). You can still create Tcl7.6 versions using the older "ET" utility. The ET version does not work with tcl8.x. * Changed the GAIA binary release to use Scriptics TclPro to generate a binary including all of the necessary scripts and extensions. Now "skycatgaia" is just a large binary. The release also includes a large number of STARLINK and PPM binaries that are used to convert between various image formats. (Note: skycatgaia is released as a separate package: see the skycat ftp site: ftp://ftp.archive.eso.org/pub/skycat/README.html). * Added scrollbars to the catalog entry widget. * RTD remote interface: Fixed socket error check in rtdrmt/src/rtdRemote.c. * Rtd: Coordinates/Zoom window: Fixed an "off by one" bug that caused the wrong coordinates to be displayed for pixels when the image was rotated and/or flipped at zoom 1. * Merged in changes from Peter W. Draper (Starlink) to support 16 and 24 bit color. Skycat now supports 16 and 24 bit color displays! Thanks to Peter Draper (P.W.Draper@durham.ac.uk) for providing the necessary changes! * Fixed a bug in the handling of local catalogs and "mmap" that could cause a core dump in certain cases. * Added a work around to Tk's limit on canvas coordinates to short range. Now the canvas (and image) coordinates do not have to be clipped to short range. This limit previously caused problems when zooming in large images. --------------- 4.02.99 released skycat-2.3.2 ---------------------- * Ported the GAIA plugin to tcl8.0.3 and changed the release structure to make it easier to install and start. Now you can just unpack the tar file in a directory and start the script "skycatgaia". * Removed redundant calls to Rtd_Init and Cat_Init in the skycat tkAppInit.C file. --------------- 14.01.99 released skycat-2.3.1 --------------------- * Upgraded the cfitsio sources to version cfitsio2027 (includes ESO HIERARCH keyword support). --------------- 29.12.98 released skycat-2.3 ----------------------- * The Skycat Tcl package and shared library now "contains" the Rtd and Cat packages. Previously it was dependent on them. This means that you should no longer load and/or link the Rtd and Cat libraries. Only the Skycat library is now required. This change was necessary, to avoid problems with static variables in shared libraries, since both the Cat and Rtd libraries contain some of the same object files (For backward compatibility reasons, both the Rtd and Cat libraries contain the contents of the Astrotcl and Tclutil packages). --------------- 28.12.98 released skycat-2.2.2 ----------------------- * Removed dialog asking if you want to save a temporary image, for example from an image server, since it sometimes caused problems. Now, if you save the temporary image, it will be added to the history catalog and menu. otherwise not. * Fixed a bug in opening the image server window (error complains about the "Add to..." menu item not being found). * Tested with Sunpro CC-2.4 and Solaris-2.6 and fixed minor compilation and linking problems. * HDU window: Allow different NAXIS[12] values and try to determine correct row,col indexes anyway. If images overlap, the display order will be the oder of the HDUs as they are found in the file. * HDU window: Show the selected HDU. The line in the table is now highlighted and the selected image HDU is displayed with a sunken relief. --------------- 03.12.98 released skycat-2.2.1 ----------------------- * Added a new item to the catalog window File menu: "Save with image", for saving catalogs as FITS binary tables and reloading them again. Now you can save local catalogs with the image, including plot symbol information. Catalog configuration information is stored in the CATINFO table, which contains one row for each FITS table created from a catalog. * Added a menu item to the Graphics menu: "Save graphics with image". Selecting this item adds a FITS table to the current image containing descriptions of all of the line graphics objects in the image. When you load the image again later, the graphics are restored automatically. The name of the FITS table is based on the name (EXTNAME) of the current FITS image extension, so you can save different graphics with each image extension. * Changed the "-remote" option to use the RTD remote socket interface, if "Tk send" does not work. "Tk send" only works when you use X-Auth style X security. --------------- 16.11.98 released skycat-2.2 ----------------------- * Added support for multiple FITS HDUs. Now, when you open a FITS file with multiple HDUs, a window is displayed where you can choose which parts to display. FITS tables are displayed as local catalogs. Small versions of the images are displayed in a table, in the correct orientation, if posible, using the values of the CRPIX* keywords. Clicking on an image displays it in the main window. * Modified the CFITSIO sources files to handle ESO HIERARCH keywords. * Ported Skycat to tcl8.0.3/BLT2.4f/Scriptics TclPro (But still compatible with tcl7.6/tk4.2/BLT2.1) - Updated namespace syntax - Updated BLT references where needed (for BLT-2.1 or 2.4f) - Added a "tclpro" directory that replaces the "et" directory when building a single binary version for Tcl8. The Et code doesn't work with Tcl8, so the Tclpro product from Scripts is used instead, if it is available (and in your shell $PATH). * SkySearch.tcl: Fixed a problem linking catalog objects to line numbers when sorting was turned on. * SkyCat.tcl: force full path names by -catalog option for local catalogs, to avoid confusion over local catalog names. * Catalog window: Fixed a problem linking catalog objects to line numbers when sorting was turned on. --------------- 30.9.98 released skycat-2.1.3 ----------------------- * Upgraded wcslib to (Doug Mink's) wcssubs-2.5b, which fixes some problems with COE projections and includes other bug fixes. * Changed the release structure of the rtd, cat and astrotcl packages to include the necessary utility packages. Now the rtd and cat tarfiles also contain the astrotcl and tclutil packages. The top level Makefile and configure script automatically determine which packages to make. This does not affect the skycat release itself, since it always included the other packages. * Rtd: Fixed a bug in the "Save region..." implementation, where FITS keywords were not updated correctly in some cases. * Skycat, Catlib: fixed a bug in the handling of temporary image files (from image servers or when decompressing). * Added an image history feature, for quick access to previously loaded images. This includes a "Go" menu, for quick access, and a "History" catalog menu item under Data-Servers. Images from image servers need to be saved to a file in order to be put in the history (see below). The history catalog is also used to save information about each file, such as the colormap and cut level settings. * Added a dialog to ask the user if an image from an image server should be saved to a file before loading another image, so that file can be put in the image history list. * Skycat now automatically saves and restores the main window size and position between sessions. --------------- 23.8.98 released skycat-2.1.2 ----------------------- * Catlib: image servers: Fixed a bug introduced in the previous version that caused problems when displaying images from an image server. * Also made a number of minor bug fixes. --------------- 7.8.98 released skycat-2.1.1 ------------------------ * Skycat command line options: Changed -remote option to reuse the same image window and interpret only image and catalog arguments. This makes it easier to use skycat as a netscape application, for example: "skycat -remote 1 %s". For catalogs, you can also do: "skycat -remote 1 -catalog %s". * Catalogs: The "Select Area" button no longer pops up a message window telling you to drag out a region. It simply sets the mouse cursor (for convenience). * Fixed a bug dealing with catalog name servers (SIMBAD, NED) introduced in the previous version. * Removed default for limit on number of rows returned from a catalog query (%n in URL). * Merged the image server interfaces with the catalog interfaces. The AstroImage and TclAstroImage classes, and the astroimage Tcl command are still available for backward compatibility, but are now obsolete and should no longer be used. The AstroCatalog and TclAstroCat classes, and the astrocat Tcl command now handle image servers as well as catalogs. The "getimage" methods/subcommands are now part of the catalog classes. The merge was made to avoid duplicating large chunks of code, since there are many similarities in the two interfaces. * Now it is possible to generate image server windows with custom search labels and without the default search widgets (name, ra, dec, radius). This was previously only supported for catalogs. In both cases, if you don't want the default search widgets, add these lines to the config entry: ra_col: -1 dec_col: -1 x_col: -1 y_col: -1 For catalogs, this means that there are no searchable ra,dec or x,y columns. For image servers, it means that you can't search by these values, so they are not displayed. * Catalog config file: Allow search columns with only one value (previously only min and max values were allowed). This feature is enabled if the second label is missing in the "search_cols: " keyword in the catalog config file. For example, in an image server: search_cols: patch Patch will display a "Patch:" label and entry in the user interface. In the URL for the image server, "%cond" will then be replaced by "patch=22", if the user typed in 22. * Fixed the handling of the "maxRows" field for searching catalogs, so that, if it is left blank or zero, there is no limit (previous versions had a default limit). * Updated to wcssubs-2.4 (Doug Mink's wcslib, on which the SAOWCS C++ class is based). This fixes some bugs in the handling of world coordinates rotation. --------------- 5.8.98 released skycat-2.1 -------------------------- * Added a top level configure script that runs configure in the subdirectories. This way you can just run "configure..." in place of "make World...". A "Makefile.in" was also added. A top level Makefile is still included in the release for backward compatibility. * Changed the name of the top level directory in the source release tar files to include the version number (for example: skycat-2.0.19/). This is more standard and avoids problems updating old directories. * Image previews, image servers: Added code to check the the HTTP Content-Encoding of image files (instead of only the Content-type), to help recognize compression types. * Added HTTP password authorization suport. If an HTTP server returns the error "Authorization Required", skycat now opens a dialog box and asks for the username and password. The information is cached for later use. * Added support for backup URLs for image servers (was previously only supported for catalogs). This is activated by using the "backup1" and "backup2" keywords in the catalog config file. * "Reload Config File" now works recursively and reloads the information in any remote catalog directories that were open. Previously, only the top level catalogs were reloaded. * Added the X11 library directory to shared lib path in startup script. * catlib: Fixed a bug where the "id" column was still assumed to be always 0 (The id column index is now always taken from catalog config file). * catlib: Changed the way that rows are inserted into local catalogs. They were previously appended to the end of the file after removing duplicates. Now the original row position is kept and the row is updated if it already exists (same id) and appended otherwise. * Color scaling: Added new command line option "-color_scale" to set the color scaling on startup. The option takes a value: one of linear, log, sqrt, histeq. Also made changes so that the color scaling setting is remembered between images and reapplied. * Coordinates: Added new coordinate type: "chip", for detector chip or CCD coordinates, that takes into account the origin of the chip and binning. X,Y coordinates in the user interface are now displayed in chip coordinates, which are the same as image coordinates, unless the FITS keywords "HIERARCH ESO DET WIN STRX" and "...STRY" are defined or special fields in the real-time image event struct are set. Also added two new fields to the RTD real-time image event struct in rtdImageEvent.h: startX and startY, with the same meaning as the FITS keywords above. * RTD now reads cut level values from the real-time image events and sets the image cut levels, unless the user set them already by hand. User values override real-time event cut level values. * Implemented "histogram equalization" color scaling and added it to the list of choices in the Rtd "Colors" popup window (based on saoimage source code). * Added code to handle NAN values for image pixels. They are now treated as blank pixels. * Updated to wcssubs-2.3.2 (Doug Mink's wcslib, on which the SAOWCS C++ class is based). This fixes a number of bugs in the handling of world coordinates. * Error and info dialogs: Added code to truncate messages with too many lines to be displayed and also made the dialog windows wider. * Top level windows: Fixed minor bug that prevented the code from remembering the locations of top level widgets. Now, if you place a window somewhere, it comes up there the next time the window is created in that session. * The catalog and image server windows were using up too many file descriptors. Now the files are only opened as needed and then closed again immediately. --------------- 07.7.98 released skycat-2.0.18 -------------------------- * catlib: allow local catalog search without ra,dec columns, fixed handling of default column positions for ra and dec, to allow catalogs with no ra,dec or x,y columns. * Image I/O: Changed location of the temp file used when compressing or decompressing an image from "file.tmp" to /tmp/fitsioXXXXXX, since the directory that file is in may not be writable or might be on a CD. * class HTTP: added suport for HTTP POST: new methods: HTTP::post(url, data) and HTTP::post(url, data, ostream). * Other minor changes (see */CHANGES files). --------------- 26.6.98 released skycat-2.0.17 -------------------------- * Skycat, single binary version: Added check for correct prolog.ps file in ~/.skycat dir (many users have an outdated version of this file in the ~/.skycat dir, created by an earlier skycat release). * Rtd: Changed footers in postscript output to include object name, file name and center position. * Tested compiling with egcs-1.0.3 (based on gcc-2.8.x) and fixed minor errors and warnings that were reported by the new compiler. * Added support for HTTP proxy servers (thanks to Peter Draper for implementing this). * Catalog window: added a menu (under Options) and dialog window for setting a proxy server for HTTP catalog access from behind a firewall. --------------- 19.6.98 released skycat-2.0.16 -------------------------- * Catalog window: Minor change in the way query coordinates are interpreted. If the RA value is an integer, it is assumed to be in hours (as before), but if it is a decimal number (3.2, for example), it is assumed to be in degrees. * Catalog window: fixed bug in the handling of the MORE URL (mostly used for HST catalogs). The "M=" part before the URL was not being recognized. * Rtd: Printing Images now outputs better postscript, since it no longer does a screen dump, but generates postscript directly from the image and graphics information (see also rtd/CHANGES). * Rtd: changed focus policy to fix problems with mouse pointer warping (moving mouse with arrow keys). The previous version included some code to avoid obscure problems with the CDE window manager, with the "click to focus" setting. If anyone has problems with the new version, please let me know. --------------- 28.5.98 released skycat-2.0.15 -------------------------- * Added support for HTTP redirect "Location: ..." to HTTP class * Catalogs: MORE and PREVIEW fields can now be commands. No special check is made for "http://" or "file://" as before. For PREVIEW data, the stdout of the command is assumed to be a FITS file, if it starts with "SIMPLE", and otherwise catalog data to plot. * FitsIO::blankImage(...), Changed generated blank images to use the normal colormap colors instead of all blank pixels, so that you can change the background color of a generated image by manipulating the colormap. * Catalog window: "Data-Servers/Local catalogs" menu: Added check for local catalogs, to see if the file exists. If not, you are asked if you want to specify a new name or remove the catalog from the menu. * Image Server window: added "Select Area..." button to to select the * area of the image to fetch (as with the catalog window). --------------- 13.5.98 released skycat-2.0.14 -------------------------- * Catalogs: Added a "help" field to the catalog config file, which may optionally contain a URL pointing to information about the catalog. If the "help" URL is specified, a "Help" button appears in the user interface, which displays the URL in netscape (using the remote interface, if netscape is already running). * Catalogs: Fixed problem with "Preview" images that was caused by using the same temporary file to hold the image each time (now uses a new file each time and deletes the old one). * SkyCat.tcl: remote interface proc: pick_object: fixed a minor bug that reported an unknown Tcl variable. --------------- 4.5.98 released skycat-2.0.13 ----------------------------- * Fixed a recently introduced bug in coordinate conversion that caused problems plotting catalog symbols for images with equinox != 2000. * Catalog window: Fixed "Reload Config File" menu item to remove "dead" catalog entries (entries that were removed from the config file since the last time it was read). * Other minor changes. --------------- 28.4.98 released skycat-2.0.12 ----------------------------- * Pick Object window: Merged in Peter Biereichel's changes, which include using a "zoom window" for the image. This lets you zoom in and out to get the correct resolution. Also changed the default layout of the window to save space. You can get the old layout by specifying the command line option "-pickobjectorient horizontal". * The single binary version of skycat is now linked with the shared X libraries. This is necessary in order to be able to dynamically load shared libraries for skycat plugins at runtime. If this causes any problems, check out ftp://ftp.archive.eso.org/pub/skycat/, where we will provide tar files with the necessary libraries. * Various minor bug fixes. --------------- 15.4.98 released skycat-2.0.11 ------------------------------ * Allow additional suffixes for automatic compression and decompression of FITS files: ".gz" for gzip, ".Z" for UNIX compression (i.e.: file.fits.Z, file.fits.gz). * Added "public", "private", and "protected" keywords in the Itcl source as well as some comments to help identify the public interface, for use by skycat plugins and extensions. * Updated the man pages for all of the Itcl classes to include the Itk components and standard options used. * Minor changes in configure script and top level makefile for shared libraries * Fixed a bug in image pixel coordinate conversion that caused the world coordinates to be slightly shifted in images created with the "File => Save region as..." menu item. * Various minor bug fixes. --------------- 31.03.98 released skycat 2.0.10 ----------------------- * Updated man pages and documentation * Fixed the -shm_data and -shm_header options, which were no longer working after earlier changes. --------------- 25.03.98 released skycat 2.0.9 ----------------------- * This release contains a number of minor changes to make it easier for plugins and subclasses to override the default behavior. See the */CHANGES files for details. * Added "clone" number to window headers, to help identify related windows when there is more than one main window. * Change keyboard accelerators for menu items to use instead of , since is used in Tk for popping up a menu with the keyboard (see -underline option in menubutton(n)). * Added -float_panel option to allow info panel to be in a popup window (default is off, no change), usage: rtd ... -float_panel 1, to enable. * Added -panel_layout option to allow changing the order of the zoom and pan windows in the layout (default is the same as before, no change). Usage: rtd ... -panel_layout $value, where value is one of {saoimage reverse default}, for an saoimage type layout, reverse or default. * Compress: Upgraded to new "press" library routines to fix bug found in H-compress code (Bug was only in decompression). --------------- 05.03.98 released skycat 2.0.8 ----------------------- * Added a -remote option to skycat: usage: "skycat -remote 1 file ..." When "-remote 1" is specified and a skycat application is already running on the same display, the existing skycat application opens a new main window to display the image. In this way, you only need to have one skycat application running at a time, which saves memory and colors in the colormap. Note that this feature uses "Tcl send", which has a special X security check and so won't work if you use the "XHOST" style X security. Unless X security is disabled in the binary, you need to use XAUTH style security. See the "Tcl/Tk Tools" book for a good explanation of this. * For backward compatibility: Removed dependence on the Tix package (now part of tclutil package). * For backward compatibility: Removed application dependence on the tclutil and astrotcl packages by merging these into the rtd and cat libraries in the installation (i.e.: the object files from astrotcl and tclutil are included in the master rtd and cat libraries and the include files are copied to the rtd and cat include dirs. * Implemented rotation for canvas graphics. Since Tk doesn't support this directly, it is done now in Tcl code. Polygons are now used in place of rectangles, to make it posible to rotate a rectangle. (The appearance and funtionality is the same). You still can't rotate ovals, but you can rotate a smooth rectangle, which is similar (see below). * Added a "Smooth" option in the graphics window (CanvasDraw), so you can make smooth (rounded) rectangles, polygons or polylines. * Made it possible to "select" a catalog symbol in the image, even if it is hidden by another symbol on top of it. If one symbol is hidden behind another, just click again to select it. You can "cycle" through a stack of symbols by clicking multiple times. Use -1 to toggle the selection of a symbol. * Added a "Filter" button to the catalog display widget to filter out objects that are not visible in the query result list. This is needed because the query is circular, while the image is rectangular, leaving some objects in the listing that can not be plotted in the image. * Added a new command line option: "-catalog $catalogName". Now you can have a catalog window (local or other) opened automatically when skycat starts. i.e.: "skycat file.fits -catalog file.cat". * Plugins: The SKYCAT_PLUGIN environment variable may now contain a colon separated list of plugin files or directories. For directories, teh default file name for a skycat plugin is SkyCat_plugin.tcl, which defines the Tcl proc SkyCat_plugin. --------------- 13.2.98 released skycat 2.0.7 ----------------------- * Moved the catalog symbol plotting code from Tcl to C++ to improve the performace of plotting 1000's of objects on large images. (In one test, the time required to plot a large catalog was reduced from about 60 secs to about 3 seconds). * Removed the "unexec" directories (replaced by "et" - Embedded Tk). The "unexec" code was previously used to create a single binary and has been replaced by "et" now. --------------- 9.2.98 released skycat 2.0.6 -------------------------------- * Fixed problems with floating point precision when converting world coordinates (raised from default of 6 digits to max 17 digits.) * Fixed bug in introduced in the last version that could cause a core dump when setting the cut levels. --------------- 3.2.98 released skycat 2.0.5 -------------------------------- * Added a selection mechanism to select a region of the image or canvas. The graphics toolbox now contains a "region" item that can be used to select a region of the image. Also added binding as a shortcut to select a region. * Improved selection of catalog plot symbols in the image and listbox. Plot symbols are now selected in the image with mouse button 1. If the shift or control key are also down, multiple objects may be selected. Objects may be selected in either the image window or the table listing, with the same effect. The selected objects may be added to a local catalog, etc... * Added a menu item to the "Real-Time ==> Rapid Frame menu": "Delete Rapid Frame", to delete the current rapid frame. * Added a new rtdimage subcommand: "mmap", which has a similar syntax to the "shm" subcommand. The rtd "shm" subcommand is used to manipulate sysV shared memory areas containing the image and header data. The rtd "mmap" subcommand does the same, but with "mmap" memory, which is the default, since rtd uses mmap to read image files. * Rtd now checks the value of the FITS "BLANK" or "BADPIXEL" keywords and ignores these pixels when setting cutlevels or doing any calculations. The blank pixels are displayed black by default. --------------- 26.1.98 released skycat 2.0.4 ------------------------------- * Added support for Tcl plugins for all top level widget classes and added documentation and examples in the Skycat documentation (see ftp://ftp.archive.eso.org/pub/skycat/doc/skycat.ps.gz) * Updated comments in Itcl sources for automatic generation of man pages. (There are now man pages for all Itcl classes). * Added postscript (framemaker) documentation for all packages (tclutil, astritcl, rtd, cat, skycat), see: ftp://ftp.archive.eso.org/pub/skycat/doc * Add menu accelerators (keyboard shortcuts) in Skycat, Rtd and Cat menus * Split the "top level" AstroCat class into different "frame" classes, by request. Now the AstroCat class is made up of an AstroQuery class (defines the panel with the search entries) and the QueryResult class (defines the table for displaying the query results). None of these classes knows about images. For image support, see the Skycat package, which contains classes that are derived from these and add image support. --------------- released skycat 2.0.2 ------------------------------- * Compilied sources with the SunPRO C++ compiler and fixed problems that showed up there and not with gcc. * Replaced "unexec" package with "ET" (Embedded Tk), for creating a single binary of skycat, including Tcl sources and colormaps, etc. (The unexec version is still included, but not used by default). * Reorganized sources to include 2 new packages: The "Tclutil" package was created by gathering "generic" Tcl and C++ code from various applications into a single generic Tcl package. The "Astrotcl" package was created by gathering general astronomy related Tcl and C++ code from other packages into a single, reusable package. Note: if you were using the Rtd or Cat packages in another application, there are some minor changes to be made to the initialization code to initialize the new packages. * Moved catalog widgets to the Cat package. * changes in skycat user interface: - There is a new catalog menu layout. - added support for a hierarchy of catalog directories. There is a new type of catalog called "directory" that has a URL that points to other catalog config files, possibly on other hosts. - Added a new popup window for displaying and browsing the catalog directory tree. You can select catalogs from various catalog servers and save them in your own personal config file. The changes appear immediately in the catalog menu. - Added a menu item to reload the catalog config file after you have edited it by hand. - The layout of the catalog window is now dependent on the information in the catalog config file (search columns). - Added support for editing the catalog config file. There are now menu items for setting the sort columns and sort order, search columns, column display order, columns to show or hide, plot symbol info (see the "Options" menu - changes are automatically saved in ~/.skycat/skycat.cfg) - Added more support for plot symbols: Now you can configure the color, shape, angle, size and units of the symbols to be displayed in the image for a star or other object. There is a window interface for editing the settings (see the Options menu). --------------- 17 Jun 97 released skycat 1.1 ------------------------ * Rtd, Skycat, Catlib: added support for shared libraries, itcl2.2, tk4.2, tcl7.6. blt-2.1, loadable modules, packages. Use: "configure --enable-shared ..." (see INSTALL file). * The Rtd configure script now gets information from the Tcl/Tk config files (tclConfig.sh, tkConfig.sh, etc...) and generates its own rtdConfig.sh file, which is used by the catlib and skycat configure scripts. This makes running configure faster and hopefully more portable. * added a make target "release_bin" that generates a binary/interpreted release of skycat. This can be used in place of the single binary "unexec" version on systems where that doesn't work. * various bug fixes in rtd and catlib (see rtd/CHANGES and cat/CHANGES) --------------- 13 Feb 97 released skycat 1.0.6 --------------------- * various bug fixes (see rtd/CHANGES, cat/CHANGES) --------------- 30 Jan 97 released skycat 1.0.5 --------------------- * (Catlib) added support for backup catalog servers and local catalog config files. * Skycat catalog windows: The default catalog/archive/image server is now taken as the first one in the config file and no longer hard coded to names such as "Guide Star Catalog at ESO". * Added World Coordinates support to the real-time image events by extending the structure used to pass images to the RTD via the rtdServer. *** (NOTE: incompatible change: clients must at least be recompiled!) --------------- 21 Nov 96 released skycat 1.0.3 --------------------- * Fixed byte-swap problems in FITS files and made Linux compatible. Skycat should now work on machines that have a byte order that is different from network byte-order (such as PCs). Thanks to Sidik Isani for supplying the patches for this. * The "Pick Object" feature (View Menu) now also works for images that do not support world coordinates. * (Rtd) Local file URLs are now supported, i.e., file:/path/name... Now you can specify the URL for the catalog config file using file:/... * (Catlib) It is now possible to search GSC by Id. --------------- 14 Nov 96 released skycat 1.0.2 --------------------- * Changed configure scripts and makefiles so that skycat can be used as a separate package, assuming the correct Rtd and Catlib versions have already been installed. --------------- 8 Nov 96 released skycat 1.0.1 ---------------------- * (Rtd) Fixed compass to display East correctly (was reversed...) * (Skycat, Catlib) Added copyright field to catalog config file and added item to the user interface to display the copyright info for the current catalog or image server. --------------- 7 Nov 96 released skycat 1.0 ---------------------- * (WCS lib) Major improvements in the World Coordinates handling. The WCS information for HST images should be handled correctly now, so you can plot guide stars, etc. This previously worked correctly only for some images (such as those from DSS). Many thanks to Doug Mink (dmink@cfa.harvard.edu) for supplying the WCS library and bug fixes. * (Rtd) added a new "Grid" feature (see View menu) that displays a world coordinates based grid over the image. You can also control the grid size (distance in arcsecs between grid lines) in a new entry in the main panel. * (Rtd) The compass widget (N-E display in panel) was removed and replaced with a more correct display in the Pan window. The Pan window now displays 2 arrows indicating the real north and east for the image, based on the world coordinate information. * (Rtd) fixed bug in "measure band" display that caused incorrect distances to be displayed for the width and height lines (the diagonal was ok). * (Rtd) Added bindings to measure band so that arrow keys can be used to position it. --------------- 23 Oct 96 released skycat 1.0b16 ---------------------- * (skycat) fixed the single binary problem related to the tclEnv patch (see below), since the original fix did not work. The tclEnv patch is still the same. --------------- 22 Oct 96 released skycat 1.0b15 ---------------------- * (skycat) fixed a problem that only showed up in the single binary version of skycat: under certain circumstances, skycat would crash immediately on start up. I had to patch a a Tcl source file (tclEnv.c) to fix this (see skycat/CHANGES and patches/tclEnv.patch). * (Rtd) fixed bug setting cut levels (was a result of changing the way the min/max pixel value is set). * (catlib) Fixed bug when saving local catalogs for images that are not J2000. (The catalog was saved as B1950, for example and later treated as J2000 when loaded). Now all local catalogs are saved (the ra,dec columns) in equinox J2000 and are expected to be in J2000 when opened. * (Rtd) changed the bindings on the "measure band" so that it acts more like a menu or the line graphics: it will stay up if you click <3>, release and then drag. Clicking <3> again makes it go away. now makes it "freeze" so you can keep it where it is. (or ) displays just the single line mband. * (Rtd) Changed the way image cut levels are set by default. In the previous version, cut levels were not changed at all when a new image was loaded, which meant that you usually had to press the "Auto Set Cut Levels" button to make the image visible. Now this has been changed as follows: If you set the cut levels explicitly by typing in a number or moving a slider bar, etc., they will not be changed, even if a new image is loaded. However, if you have the cut levels calculated automatically by pressing the "Auto Set Cut Levels" button or the "Median Filter" button, etc., then it is assumed that new cut levels can be set automatically when a new image is loaded. (We would be interested to hear any comments on this. Maybe we should make this behavior optional ny adding a checkbutton somewhere...) * (Rtd) Made a number of changes designed to improve performance on very large images (got test image from Kim Gillies: 170 MB, 8192 x 5464 floats): * the zoom window is no longer updated from the pan window, since that can cause a lot of disk activity on large images (the mouse easily crosses the entire pan image, which would have to be displayed in the zoom window). * auto set cut levels, median filter, finding min/max pixel, etc. now are only calculated for the visible part of the image and (for speed) don't examine all image pixels. * (skycat) added confirmation dialogs for entering, updating and deleting local catalog entries. * (catlib) The catalog config file entry is now written to local catalogs (in the header) so that the same plot symbol is used when the file is reloaded. --------------- 1 Oct 96 released skycat 1.0b12 ---------------------- * added new View menu item: "WCS Info" for setting/displaying basic world coordinate information. --------------- 20 Sep 96 released skycat 1.0b11 ------------------ * loading of very large images should be faster now, since "mmap(2)" is used to map files to memory rather than reading them. Also, the alogorithm used to get the min and max pixel values has been changed to not look at every pixel (see rtd/CHANGES). * now using new SAO wcs library (wcssubs-1.0). * made improvements to the colormap handling code to avoid color flashing when using a private colormap (see rtd/CHANGES). * split the "./cat" directory into "./cat" (catalog libraries only) and "./skycat" (skycat application, interpreted and single binary versions), by request. ---- see also: rtd/CHANGES, cat/CHANGES, skycat/CHANGES ------------------- skycat-3.1.2-starlink-1b/CHANGES_DOUBLE000066400000000000000000000011231215713201500171570ustar00rootroot00000000000000Double precision image support. ------------------------------- I modified the following files to add a double precision image type (bitpix -64): --- astrotcl/imageio/include/ImageIO.h astrotcl/imageio/src/FitsIO.C rtd/rtdimg/src/RtdCamera.C rtd/rtdimg/src/RtdImage.C rtd/rtilib/include/NativeImageData.h rtd/rtilib/src/ImageData.C rtd/rtilib/src/ImageTemplates.C rtd/rtilib/src/Makefile.in rtd/rtilib/src/NativeImageData.C --- and created the following files: --- rtd/rtilib/include/DoubleImageData.h rtd/rtilib/src/DoubleImageData.C Peter W. Draper (p.w.draper@durham.ac.uk) 31st May 2001. skycat-3.1.2-starlink-1b/COPYING000066400000000000000000000023611215713201500161720ustar00rootroot00000000000000Copyright (C) 1995-2001, European Southern Observatory (E.S.O.) Karl-Schwarzschild-Str.2, 85748 GARCHING, GERMANY Skycat is a copyright protected software product of the European Southern Observatory, and provides a general tool for image display and astronomical catalog access. Skycat is available under the GNU General Public License. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU General Public License text is included in the file GNU_PUBLIC_LICENSE in this directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Correspondance concerning VLT-RTD should be addressed as follows: Internet e-mail: pbiereic@eso.org Postal address: European Southern Observatory VLT Software Group Karl-Schwarzschild-Strasse 2 D-85748 Garching near Munich GERMANY skycat-3.1.2-starlink-1b/INSTALL000066400000000000000000000075261215713201500162000ustar00rootroot00000000000000Installing the Skycat Software ------------------------------ Binary Installation ------------------- Precompiled versions of Skycat are available from the Skycat ftp site: ftp://ftp.eso.org/pub/archive/skycat Due to technical reasons, there is no longer a single binary version of Skycat. Instead, the installation method depends on the OS: Mac OS X -------- The skycat ftp site contains a disk image that you can download and mount in the usual way. Just click on the image and drag the skycat icon to your desktop or Applications folder. Make sure you have the optional X11 package installed. The skycat start script will try to start X11, if it is not already running. This version was compiled on a Powerbook running Mac OS X 10.4.4. All of the required Tcl/Tk extensions are included in the Skycat application directory (neither Fink nor DarwinPorts had all of the ones we need). Linux ----- RPM Install ----------- For Linux (Redhat9, Fedora3, Fedora4, Scientific Linux 4.1, SuSE-10), install the RPMs for tcl, tk, (tcl-devel, tk-devel), itcl, tclx, BLT, tkimg, and skycat. For example, first install the standard tcl/tk packages for the system in the usual way, using yum (Fedora), or yast (SuSE): yum install tcl yum install tk yum install itcl ... Only SuSE-10 comes with all of the required Tcl extensions, however you can get the missing rpms (for itcl, BLT, tclx, tkimg) from the skycat ftp site and install them with: rpm -i ... Tarball Install ---------------- If you don't have the root password for the machine, you won't be able to install the RPMs. In that case, you can download a tar file containing the skycat and tcltk installation directory compiled for the given OS. You can put this directory anywhere and include the $skycat/bin dir in your shell path. Then you can start skycat with the command "skycat&". Solaris9 and HP-UX10 -------------------- You can download a tar file from the skycat ftp site that contains the complete skycat/tcltk installation in a relocatable directory. Just untar the file somewhere and include the bin directory in your shell path. Building Skycat from the Sources -------------------------------- Requirements ------------ The following Tcl environment should be installed: Tcl8.4.* - Tcl Shell (8.4.11, earlier versions may also work) Tk8.4.* - Tk Toolkit (8.4.11, earlier versions may also work) itcl3.3 - [Incr Tcl] object system BLT2.4z - BLT toolkit, graphs and other widgets tclX8.4 - Extended Tcl (8.3 should also work) TkImg1.3 - Tk Image extensions You can download a tar file containing the sources for all of the above packages from: ftp://ftp.eso.org/pub/archive/skycat/tcltk-8.4.tar.gz You can also build skycat against the Linux system Tcl libraries (installed under /usr/lib). The only system I know of that comes with all of the required packages is SuSE-10, however I recompiled the missing rpms for Redhat9, Fedora3, Fedora4, and ScientificLinux-4.1 and put them under ftp://ftp.eso.org/pub/archive/skycat. Building the Software --------------------- To build the software, run these commands: % configure --prefix=$INSTALLDIR % make all install There are a number of options you can pass to configure: --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) --with-blt=DIR link with BLT library installed in DIR --enable-merge merge the contents of compile-time dependent packages into master rtd, cat and skycat libraries (for backward compatibility) "configure --help" prints a list of available options. As an alternative to specifying --with-tcl, you can also set the TCLTK_ROOT environment variable to point to the top of the Tcl/Tk installation. -- Please report any problems to me: Allan Brighton abrighto@eso.org skycat-3.1.2-starlink-1b/Makefile.in000066400000000000000000000040241215713201500172020ustar00rootroot00000000000000# Makefile # change these to the install prefix and exec-prefix values prefix = @prefix@ exec_prefix = @exec_prefix@ # directories in which to run make subdirs = tclutil astrotcl rtd cat skycat # Note: add --enable-merge if you want to merge object files into the # skycat, rtd and cat shared libraries (for backward compatibility) CONFIGURE = configure --prefix=$(prefix) --exec_prefix=$(exec_prefix) all install clean: FORCE @set -x; for i in $(subdirs); do (cd $$i && $(MAKE) $@ || exit 1) done # Run "configure" and "make all install" in the subdirectories All: $(subdirs) release: FORCE (cd skycat; $(MAKE) release) distclean: FORCE @set -x; for i in $(subdirs) ; do (cd $$i && $(MAKE) distclean) ; done rm -rf autom4te.cache config.status config.log configure */configure Makefile # run configure and make in individual dirs tclutil: tclutil/configure FORCE (cd tclutil && $(CONFIGURE) && $(MAKE) && $(MAKE) install) astrotcl: astrotcl/configure FORCE (cd astrotcl && $(CONFIGURE) && $(MAKE) && $(MAKE) install) cat: cat/configure FORCE (cd cat && $(CONFIGURE) && $(MAKE) && $(MAKE) install) rtd: rtd/configure FORCE (cd rtd && $(CONFIGURE) && $(MAKE) && $(MAKE) install) skycat: skycat/configure FORCE (cd skycat && $(CONFIGURE) && $(MAKE) && $(MAKE) install) # run autoconf autoconf: configure tclutil/configure astrotcl/configure rtd/configure cat/configure skycat/configure # run autoconf and configure config: configure tclutil/configure astrotcl/configure rtd/configure cat/configure skycat/configure $(CONFIGURE) configure: configure.in autoconf tclutil/configure: tclutil/configure.in tclutil/aclocal.m4 tclconfig/tcl.m4 (cd tclutil; autoconf) astrotcl/configure: astrotcl/configure.in astrotcl/aclocal.m4 tclconfig/tcl.m4 (cd astrotcl; autoconf) rtd/configure: rtd/configure.in rtd/aclocal.m4 tclconfig/tcl.m4 (cd rtd; autoconf) cat/configure: cat/configure.in cat/aclocal.m4 tclconfig/tcl.m4 (cd cat; autoconf) skycat/configure: skycat/configure.in skycat/aclocal.m4 tclconfig/tcl.m4 (cd skycat; autoconf) FORCE: skycat-3.1.2-starlink-1b/README000066400000000000000000000033311215713201500160150ustar00rootroot00000000000000 Skycat Source Distribution -------------------------- Skycat is a tool that combines visualization of images with access to catalogs and archive data for astronomy. It is based on the Real Time Display (rtd) and catalog library (cat), which may also be used separately. The following URLs may also be of interest: Skycat home page: http://archive.eso.org/skycat/ Sources and binaries: ftp://ftp.eso.org/pub/archive/skycat/ (see README.html) Postscript, PDF, and FrameMaker Documentation: ftp://ftp.eso.org/pub/archive/skycat/doc HTML Docs: http://archive.eso.org/skycat/docs/skycat-man.html Installation ------------ For installation instructions, see the file INSTALL in this directory. See the CHANGES files in this directory and in the subdirectories for a list of recent changes. The Skycat application is based on the following packages: * Tclutil - Tcl and C++ Utilities * Astrotcl - Astronomical Tcl and C++ Utilities * Rtd - Real-Time Display * Cat - Catalog library * Skycat - The ESO Skycat Tool In addition, the Astrotcl package includes the sources for these C libraries: * Cfitsio - C routines for reading and writing FITS files (cfitsio-3.0.0.4: William D. Pence, HEASARC, NASA/GSFC) * Libwcs - C routines for handling world coordinates (wcstools-3.6.2, Doug Mink, Smithsonian Astrophysical Observatory) See the documentation for the above packages for more information. ------------------------------------------------------------------ Contact: Allan Brighton (abrighto@eso.org) Andreas Wicenec (awicenec@eso.org) Peter Biereichel (pbiereic@eso.org) (RTD issues) ESO - European Southern Observatory ------------------------------------------------------------------ skycat-3.1.2-starlink-1b/README.Starlink000066400000000000000000000005561215713201500176110ustar00rootroot00000000000000This is the ESO Skycat distribution imported into the ESO thirdparty vendor branch. Note none of the build mechanism is used at this level, see the directory above. Also note that this is not Skycat official and various small-level changes have been made that support GAIA, if you want the official Skycat go to the ESO download site. Peter W. Draper 25-APR-2007. skycat-3.1.2-starlink-1b/VERSION000066400000000000000000000000151215713201500162010ustar00rootroot00000000000000skycat-3.1.1 skycat-3.1.2-starlink-1b/astrotcl/000077500000000000000000000000001215713201500167705ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/astrotcl/CHANGES000066400000000000000000000314251215713201500177700ustar00rootroot00000000000000CHANGES to Astrotcl ------------------- This file contains a list of changes to the Astrotcl software. The latest changes are at the top. --------------- 16.10.08 released astrotcl-2.1.0 ---------------- * Upgraded to cfitsio version 3.0.4 (32-bit signed integer, BITPIX=32). * Upgraded to wcslib version 4.3.0 (July 25, 2007). Needed for ZPN projection. * Added support for data types double and long long int. * Added support for tiled-image compressed files. --------------- 03.02.06 released astrtcl-2.0 ------------------- * Major update: see top level CHANGES file. * Added fix from awicenec@eso.org for WorldCoords.dispos() (calculates distance between two WCS positions) * Increased NIOBUF in fitsio2.h from 25 to 128 for OmegaCam --------------- 04.04.05 released astrotcl-1.4.9 ----------------- * Generally 'using namespace std' instead of specifying ::std * Fixed compiler warning in wcs.c --------------- 20.01.03 released astrotcl-1.4.8 ----------------- * Ported to gcc-3.2.1 and Tcl-8.4.1 * Fixed bug in wcslib/src/hget.c, routine ksearch, that could cause skycat to core dump on some FITS files. (The routine called strlen() on the FITS header, which was mmap'ed and might not contain a null char). --------------- 13.12.01 released astrotcl-1.4.7 ----------------- * Enabled WCS coordinate conversion outside of the image area (by request). --------------- 27.08.01 released astrotcl-1.4.6 ----------------- * Merged in minor changes from Peter Biereichel (added some #include files). --------------- 23.08.01 released astrotcl-1.4.5 ----------------- * Fixed problem with boolean declaration in press.c (caused problems with latest linux/gcc version). --------------- 20.09.00 released astrotcl-1.4.4 ----------------- * Removed outdated wcslib source files from astrotcl/wcslib (fitsio.[ch], imhio.[ch]). --------------- 20.09.00 released astrotcl-1.4.3 ----------------- * SAOWCS.C: Fixed a bug in the display of galactic coordinates: RA was being displayed in hours and the equinox was displayed as 2000. Now RA is displayed in degrees and the equinox is displayed as "GALACTIC". * Upgraded the WCS library to wcssubs-2.8.3. * Made changes to class WorldCoords to support non-equatorial coordinates, such as GALACTIC and ECLIPTIC. Now, instead of an equinox value, you can pass in an equinox string, which may be a number (2000, 1950, etc.) or a name ("J2000", "B1950", "FK5", "FK4", "ECLIPTIC", "GALACTIC", ...). The case is not important and abbreviations are allowed (based on the wcscon routine in the wcssubs package). --------------- 02.03.00 released astrotcl-1.4.2 ----------------- * Added a check for a null coordinate string in HMS.C. --------------- 15.12.99 released astrotcl-1.4.1 ----------------- * Merged in changes made by Peter Biereichel (classes WCS, SAOWCS). --------------- 02.11.99 released astrotcl-1.4 -------------------- * Fixed a bug in HMS.C dealing with leading zeros in formatting the seconds of RA (The previous fix was incorrect). --------------- 25.10.99 released astrotcl-1.3 -------------------- * Merged in changes made by Peter Biereichel --------------- 09.09.99 released astrotcl-1.2.8 ------------------------- * Updated for egcs/gcc-2.95 --------------- 27.07.99 released astrotcl-1.2.7 ------------------------- * wcs.c, wcspix(): added "int wcsset()" declaration * wcs.c, wcsxinit(): temporary fix * wcslib/src/Makefile.in: use of 'trigod' --------------- 14.07.99 released astrotcl-1.2.7 ------------------------- * Fixed a bug in FitsIO.C that caused problems under HP-UX when loading FITS tables (was bad null value parameter for a cfitsio routine). --------------- 21.06.99 released astrotcl-1.2.6 ------------------------- * WorldCoords.C: removed error message generated when null ra or dec is passed to constructor. Now only the status is set (to avoid unwanted error messages when the ra or dec field is blank). --------------- 16.05.99 released astrotcl-1.2.5 ------------------------- * FitsIO: Merge primary header with extension header when checking for WCS keywords. --------------- 22.03.99 released astrotcl-1.2.4 ------------------------- * Replaced itclsh2.2 with itclsh@ITCL_VERSION@ in Makefile.in. * compress: Moved some global declarations from gzip.h to gzip.c to avoid linker warnings. --------------- 14.01.99 released astrotcl-1.2.3 ------------------------- * Upgraded the cfitsio sources to version cfitsio2027 (includes ESO HIERARCH keyword support). --------------- 29.12.98 released astrotcl-1.2.2 ------------------------- * FitsIO.C: bug fix: set fits_ member variable in flush(). --------------- 28.12.98 released astrotcl-1.2.1 ------------------------- * Rebuild tclIndex file whenever configure is run, since Tcl8 version is not compatible with tcl7 version (see makelinks script). * wcslib/src/iraf2fits.c: fixed undefined ref: calloc_errchk() * imageio/src/FitsIO.h: added #include "fitsio.h" to avoid sunpro compiler error message. * Removed -Xc option from configure.in (should not have been there). --------------- 03.12.98 released astrotcl-1.2 ------------------------- * Made some corrections to the "ESO HIERARCH" changes in the cfitsio sources (removed the 29 char keyword limit). * Changed cfitsio to allow lower case letters in FITS keywords (since we had some files that contained these). * Added a number of new FitsIO methods for working with HDUs and FITS tables. * Added a "realloc" method for use with cfitsio that extends the size of an image file when needed for inserting a new FITS block. --------------- 16.11.98 released astrotcl-1.1 ------------------------- * The FitsIO C++ class is now based on the CFITSIO package (URL: http://legacy.gsfc.nasa.gov/docs/software/fitsio). The public interface is backward compatible. A number of new methods are now available for accessing multiple HDUs and FITS tables. The only incompatible change is that some invalid FITS files that were previously allowed may cause an error message now (For example when keywords contain illegal characters). * Modified the CFITSIO sources files fitscore.c and getkey.c to handle ESO HIERARCH keywords. Also added "static" to some global variables in compress.c to avoid name conflicts. * Ported to Tcl8.0.3 (minor namespace changes, still compatible with Tcl7.6/Tk4.2/itcl2.2). * Changed the names of 2 global variables in the compress/gzip code, since the same code is being used by both cfitsio and tclpro, in variously hacked versions. See gzip.h for details. --------------- 30.9.98 released astrotcl-1.0.16 ------------------------- * Fixed some bugs in FitsIO.C and hput.c dealing with FITS keyword insertion. * Upgraded wcslib to (Doug Mink's) wcssubs-2.5b, which fixes some problems with COE projections and includes other bug fixes. * Changed the release structure of the astrotcl package to include the tclutil package. The top level Makefile and configure script automatically determine which packages to make. --------------- 7.9.98 released astrotcl-1.0.15 ------------------------- * HMS.C: Fixed a bug in the formatting/printing of RA values (sometimes the fractional part of the seconds was incorrect). * Updated to wcssubs-2.4 (Doug Mink's wcslib, on which the SAOWCS C++ class is based). This fixes some bugs in the handling of world coordinates rotation. --------------- 5.8.98 released astrotcl-1.0.14 ------------------------- * Added the X11 library directory to shared lib path in startup script. * Updated to wcssubs-2.3.2 (Doug Mink's wcslib, on which the SAOWCS C++ class is based). This fixes a number of bugs in the handling of world coordinates. The FitsIO class was also updated, since it uses the FITS header routines in hget.c and hput.c. * Added COE projection to wcssubs (in worldpos.c), based on previous patches from Andreas Wicenec. --------------- 07.07.98 released astrotcl-1.0.13 ------------------------- * Increased buf size for print method in util/src/HMS.C to avoid potential overflow when given bad data. * FitsIO.[Ch]: added new static method: "FitsIO::check_compress" (was not a member before) so that it can be used from outside the class. * FitsIO.C: Changed location of the temp file used when compressing or decompressing an image from "file.tmp" to /tmp/fitsioXXXXXX, since the directory that file is in may not be writable or might be on a CD. --------------- 19.6.98 released astrotcl-1.0.12 ------------------------- * HMS.C: When interpreting the RA value for world coordinates, assume decimal numbers to be in degrees and integer values to be hours. --------------- 28.5.98 released astrotcl-1.0.11 ------------------------- * FitsIO::blankImage(...), Changed generated blank images to use the normal colormap colors instead of all blank pixels, so that you can change the background color of a generated image by manipulating the colormap. * ImageIO: added methods: byteSwapData() and isclear(). --------------- 4.5.98 released astrotcl-1.0.10 ------------------------- * HMS.C: print 3 digits after the decimal point for seconds for RA values. --------------- 28.4.98 released astrotcl-1.0.9 ------------------------- * HMS.C (used by class WorldCoords): changed printing of seconds to always include leading zero i.e.: (42::12:03.51 instead of 42:12:3.51 as before). --------------- 15.4.98 released astrotcl-1.0.8 ------------------------- * FitsIO.C: Added additional suffixes for automatic compression and decompression: ".gz" for gzip, ".Z" for UNIX compression (i.e.: file.fits.Z, file.fits.gz). * Minor changes in configure script and top level makefile for shared libraries * Fixed possible bug in reference counted classes (WCS, ImageIO, Mem) by adding check for null rep_ pointer. The pointer can be null in some cases (WCS, for example, when there is no WCS information). --------------- 31.03.98 released astrotcl-1.0.7 ------------------------- * Updated man pages and documentation --------------- 25.03.98 released astrotcl-1.0.6 ------------------------- * The following changes were made to make it easier to add new image types and new WCS functionality in derived classes and should not cause any change in the external interfaces: * Class ImageIO: removed direct dependency on FitsIO class to make it possible to define new image types (by deriving a subclass of class ImageIORep). * Added a WCS object to the ImageIORep class. This can be used to optionally add world coordinates support to an image. Since WCS is a reference counted class, it is possible to replace the WCS implementation with a new one by defining a subclass of WCSRep (the internal class) that has the required interface (see below). * Renamed the WCSRep class to SAOWCS. The new WCSRep class is now an abstract base class, of which SAOWCS is a subclass. The external interfaces are the same. The change just makes it possible to add new WCS implementations in subclasses. * Compress: Upgraded to new "press" library routines to fix bug found in H-compress code (Bug was only in decompression). --------------- 05.03.98 released astrotcl-1.0.5 ------------------------- * Added static method: "set_options" to class Compress, so that you can specify scale and smoothing options for H_COMPRESS. --------------- 13.2.98 released astrotcl-1.0.4 ------------------------- * Minor changes/fixes in wcslib. --------------- 9.2.98 released astrotcl-1.0.3 ------------------------- * Fixed accuracy problems converting pixel to wcs distance. * Fixed problems with floating point precision when converting world coordinates (raised from default of 6 digits to max 17 digits.) --------------- 3.2.98 released astrotcl-1.0.2 -------------------------- * added "long int" versions of the ImageIO and FitsIO class "get" and "put" methods for reading and writing keywords. * added option to Tcl wcs command to support converting a single hh:mm:ss value to floating point and back (previous version required ra and dec, new version will also convert a single value, so that it can more easily be used in expressions). --------------- 26.01.98 released astrotcl-1.0.1 ------------------------ * WCS: There was a problem converting a WCS distance to a pixel distance on certain images (HST, for example), since the CDELT1 and CDELT2 keywords were not always defined. This has been changed now to use wcsWidth/pixWidth, which is known. --------------- released astrotcl-1.0 ----------------------------------- * Compress: Fixed bug in h_comp.h (H_COMPRESS), so that it now works on Linux (inserted calls to htonl and ntohl where needed to make it portable). * Created new package "Astrotcl" by gathering general astronomy related Tcl and C++ code from other packages into a single, reusable package. ----------- Nov 21, 1997: begin change log for Astrotcl ---------------- skycat-3.1.2-starlink-1b/astrotcl/Makefile.in000077500000000000000000000372411215713201500210470ustar00rootroot00000000000000# Makefile.in -- # # This file is a Makefile for Sample TEA Extension. If it has the name # "Makefile.in" then it is a template for a Makefile; to generate the # actual Makefile, run "./configure", which is a configuration script # generated by the "autoconf" program (constructs like "@foo@" will get # replaced in the actual Makefile). # # Copyright (c) 1999 Scriptics Corporation. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: Makefile.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that # have been added in a customized configure script. #======================================================================== #SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@ TEST_APPS = tCompress tFitsIO tHMS tImageCoords tWorldCoords tWorldOrImageCoords TEST_LIBS = @astrotcl_LIB_SPEC@ @tclutil_LIB_SPEC@ @TCL_LIB_SPEC@ @TK_LIB_SPEC@ #======================================================================== # Nothing of the variables below this line should need to be changed. # Please check the TARGETS section below to make sure the make targets # are correct. #======================================================================== #======================================================================== # The names of the source files is defined in the configure script. # The object files are used for linking into the final library. # This will be used when a dist target is added to the Makefile. # It is not important to specify the directory, as long as it is the # $(srcdir) or in the generic, win or unix subdirectory. #======================================================================== PKG_SOURCES = @PKG_SOURCES@ PKG_OBJECTS = @PKG_OBJECTS@ PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ #======================================================================== # PKG_TCL_SOURCES identifies Tcl runtime files that are associated with # this package that need to be installed, if any. #======================================================================== PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ #======================================================================== # This is a list of public header files to be installed, if any. #======================================================================== PKG_HEADERS = @PKG_HEADERS@ #======================================================================== # "PKG_LIB_FILE" refers to the library (dynamic or static as per # configuration options) composed of the named objects. #======================================================================== PKG_LIB_FILE = @PKG_LIB_FILE@ PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ PKG_BIN_FILE = bin_BINARIES = $(PKG_BIN_FILE) lib_BINARIES = $(PKG_LIB_FILE) BINARIES = $(lib_BINARIES) $(bin_BINARIES) SHELL = @SHELL@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ mandir = @mandir@ includedir = @includedir@ DESTDIR = PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) pkgdatadir = $(datadir)/$(PKG_DIR) pkglibdir = $(libdir)/$(PKG_DIR) pkgincludedir = $(includedir)/$(PACKAGE_NAME) top_builddir = . INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ CC = @CC@ CXX = @CXX@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ #CFLAGS_WARNING = @CFLAGS_WARNING@ CLEANFILES = @CLEANFILES@ $(TEST_APPS) *.result test.fits* tmp.fits *.tmp *.o tests/*.o EXEEXT = @EXEEXT@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ MAKE_LIB = @MAKE_LIB@ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ OBJEXT = @OBJEXT@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @PKG_LIBS@ @SHLIB_LD_LIBS@ @SHLIB_LD_CXX_LIBS@ STLIB_LD = @STLIB_LD@ #TCL_DEFS = @TCL_DEFS@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_SRC_DIR = @TCL_SRC_DIR@ #TK_BIN_DIR = @TK_BIN_DIR@ #TK_SRC_DIR = @TK_SRC_DIR@ # Not used, but retained for reference of what libs Tcl required #TCL_LIBS = @TCL_LIBS@ #======================================================================== # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our # package without installing. The other environment variables allow us # to test against an uninstalled Tcl. Add special env vars that you # require for testing here (like TCLX_LIBRARY). #======================================================================== EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) #EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) TCLLIBPATH = $(top_builddir) TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ PATH="$(EXTRA_PATH):$(PATH)" \ TCLLIBPATH="$(TCLLIBPATH)" # TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` TCLSH_PROG = @TCLSH_PROG@ TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) #WISH_PROG = @WISH_PROG@ #WISH = $(TCLSH_ENV) $(WISH_PROG) SHARED_BUILD = @SHARED_BUILD@ #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ PKG_CFLAGS = @PKG_CFLAGS@ # TCL_DEFS is not strictly need here, but if you remove it, then you # must make sure that configure.in checks for the necessary components # that your library may use. TCL_DEFS can actually be a problem if # you do not compile with a similar machine setup as the Tcl core was # compiled with. #DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) DEFS = @DEFS@ $(PKG_CFLAGS) CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl ${PACKAGE_NAME}Config.sh ${PACKAGE_NAME}.sh ${PACKAGE_NAME}_version.tcl CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ AR = @AR@ CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CXXFLAGS) #======================================================================== # Start of user-definable TARGETS section #======================================================================== #======================================================================== # TEA TARGETS. Please note that the "libraries:" target refers to platform # independent files, and the "binaries:" target inclues executable programs and # platform-dependent libraries. Modify these targets so that they install # the various pieces of your package. The make and install rules # for the BINARIES that you specified above have already been done. #======================================================================== all: binaries libraries doc tclIndex #======================================================================== # The binaries target builds executable programs, Windows .dll's, unix # shared/static libraries, and any other platform-dependent files. # The list of targets to build for "binaries:" is specified at the top # of the Makefile, in the "BINARIES" variable. #======================================================================== binaries: $(BINARIES) libraries: tclIndex: (cd $(srcdir)/library; $(TCLSH_PROG) mkIndex.tcl) #======================================================================== # Your doc target should differentiate from doc builds (by the developer) # and doc installs (see install-doc), which just install the docs on the # end user machine when building from source. #======================================================================== doc: # generate man pages for itcl classes gendoc: (cd $(srcdir)/library; $(TCLSH) itcldoc [A-Z]*.tcl) # remove generated man pages cleandoc: rm -f $(srcdir)/man/[A-Z]*.mann install: all install-binaries install-libraries install-doc install-binaries: binaries install-lib-binaries install-bin-binaries #======================================================================== # This rule installs platform-independent files, such as header files. # The list=...; for p in $$list handles the empty list case x-platform. #======================================================================== install-libraries: libraries @test -d $(DESTDIR)$(pkgincludedir) || mkdir -p $(DESTDIR)$(pkgincludedir) @echo "Installing header files in $(DESTDIR)$(pkgincludedir)" @list='$(PKG_HEADERS)'; for i in $$list; do \ echo "Installing $(srcdir)/$$i" ; \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(pkgincludedir) ; \ done; #======================================================================== # Install documentation. Unix manpages should go in the $(mandir) # directory. #======================================================================== install-doc: #install-doc: doc # @mkdir -p $(DESTDIR)$(mandir)/mann # @echo "Installing documentation in $(DESTDIR)$(mandir)" # @list='$(srcdir)/doc/*.n'; for i in $$list; do \ # echo "Installing $$i"; \ # rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ # $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ # done shell: binaries libraries @$(TCLSH) $(SCRIPT) gdb: $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) depend: #======================================================================== # $(PKG_LIB_FILE) should be listed as part of the BINARIES variable # mentioned above. That will ensure that this target is built when you # run "make binaries". # # The $(PKG_OBJECTS) objects are created and linked into the final # library. In most cases these object files will correspond to the # source files above. #======================================================================== $(PKG_LIB_FILE): $(PKG_OBJECTS) -rm -f $(PKG_LIB_FILE) ${MAKE_LIB} $(RANLIB) $(PKG_LIB_FILE) #$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) # -rm -f $(PKG_STUB_LIB_FILE) # ${MAKE_STUB_LIB} # $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) #======================================================================== # We need to enumerate the list of .c to .o lines here. # # In the following lines, $(srcdir) refers to the toplevel directory # containing your extension. If your sources are in a subdirectory, # you will have to modify the paths to reflect this: # # sample.$(OBJEXT): $(srcdir)/generic/sample.c # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@ # # Setting the VPATH variable to a list of paths will cause the makefile # to look into these paths when resolving .c to .obj dependencies. # As necessary, add $(srcdir):$(srcdir)/compat:.... #======================================================================== VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/press:$(srcdir)/libwcs .c.@OBJEXT@: $(COMPILE) -c `@CYGPATH@ $<` -o $@ .C.@OBJEXT@: $(CXXCOMPILE) -c `@CYGPATH@ $<` -o $@ #======================================================================== # End of user-definable section #======================================================================== #======================================================================== # Don't modify the file to clean here. Instead, set the "CLEANFILES" # variable in configure.in #======================================================================== clean: -test -z "$(BINARIES)" || rm -f $(BINARIES) -rm -f *.$(OBJEXT) core *.core -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean: clean -rm -f *.tab.c -rm -f $(CONFIG_CLEAN_FILES) -rm -rf config.cache config.log config.status autom4te.cache #======================================================================== # Install binary object libraries. On Windows this includes both .dll and # .lib files. Because the .lib files are not explicitly listed anywhere, # we need to deduce their existence from the .dll file of the same name. # Library files go into the lib directory. # In addition, this will generate the pkgIndex.tcl # file in the install location (assuming it can find a usable tclsh shell) # # You should not have to modify this target. #======================================================================== install-lib-binaries: binaries @test -d $(DESTDIR)$(pkglibdir) || mkdir -p $(DESTDIR)$(pkglibdir) @list='$(lib_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p; \ stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ if test "x$$stub" = "xstub"; then \ echo " $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p"; \ $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p; \ else \ echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \ $(RANLIB) $(DESTDIR)$(libdir)/$$p; \ fi; \ ext=`echo $$p|sed -e "s/.*\.//"`; \ if test "x$$ext" = "xdll"; then \ lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ if test -f $$lib; then \ echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib"; \ $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \ fi; \ fi; \ fi; \ done @echo " Install $(PACKAGE_NAME)Config.sh $(DESTDIR)$(libdir)" @$(INSTALL_DATA) $(PACKAGE_NAME)Config.sh $(DESTDIR)$(libdir); @list='$(PKG_TCL_SOURCES) library/tclIndex'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ destp=`basename $$p`; \ echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ fi; \ done @if test "x$(SHARED_BUILD)" = "x1"; then \ echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ fi #======================================================================== # Install binary executables (e.g. .exe files and dependent .dll files) # This is for files that must go in the bin directory (located next to # wish and tclsh), like dependent .dll files on Windows. # # You should not have to modify this target, except to define bin_BINARIES # above if necessary. #======================================================================== install-bin-binaries: binaries @test -d $(DESTDIR)$(bindir) || mkdir -p $(DESTDIR)$(bindir) @list='$(bin_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ fi; \ done .SUFFIXES: .c .$(OBJEXT) .C Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status uninstall-binaries: list='$(lib_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ p=`basename $$p`; \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(bin_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/$$p; \ done .PHONY: all binaries clean depend distclean doc install libraries test # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: #======================================================================== # Run C++ Test cases #======================================================================== test: binaries libraries $(TEST_APPS) $(TEST_APPS): FORCE $(CXXCOMPILE) -o $@ $(srcdir)/tests/$@.C $(TEST_LIBS) cp $(srcdir)/tests/test.fits . -@@LD_LIBRARY_PATH_VAR@=@exec_prefix@/lib; export @LD_LIBRARY_PATH_VAR@ ;\ $@ > $@.result 2>&1 ;\ if cmp $@.result $(srcdir)/tests/$@.ok ;\ then echo "$@: PASSED" ; \ else echo "*** $@: TEST FAILED: see $@.result" ; \ fi rm test.fits #======================================================================== # Run Tcl test cases #======================================================================== #tcltest: binaries libraries # (cd tests; sh all.tcl) FORCE: skycat-3.1.2-starlink-1b/astrotcl/README000066400000000000000000000016501215713201500176520ustar00rootroot00000000000000 Astrotcl, C++ Library and Tcl Package for Astronomical Software --------------------------------------------------------------- The Astrotcl package contains a collection of C, C++ and Tcl utilities related to astronomical software. It contains support for manipulating World Coordinates and images in FITS format, and image compression and decompression. The library may be loaded dynamically as a Tcl package with the Tcl command: package require Astrotcl For installation instructions, see the file INSTALL in the parent directory. See the CHANGES file in this directory for a list of recent changes. The following URLs may also be of interest: Skycat home page: http://archive.eso.org/skycat/ Sources and binaries: ftp://ftp.eso.org/pub/archive/skycat/README.html Postscript, PDF, and FrameMaker Documentation: ftp://ftp.eso.org/pub/archive/skycat/doc HTML Docs: http://archive.eso.org/skycat/docs/skycat-man.html skycat-3.1.2-starlink-1b/astrotcl/VERSION000066400000000000000000000000171215713201500200360ustar00rootroot00000000000000astrotcl-2.1.0 skycat-3.1.2-starlink-1b/astrotcl/aclocal.m4000066400000000000000000000140161215713201500206320ustar00rootroot00000000000000builtin(include,../tclconfig/tcl.m4) AC_DEFUN(ASTROTCL_CONFIG, [ # Load the Tclutil definitions cf=../tclutil/tclutilConfig.sh if test -f $cf ; then . $cf AC_SUBST(tclutil_VERSION) AC_SUBST(tclutil_LIB_FILE) AC_SUBST(tclutil_BUILD_LIB_SPEC) AC_SUBST(tclutil_LIB_SPEC) AC_SUBST(BLT_LIB_SPEC) AC_SUBST(tclutil_SRC_DIR) AC_SUBST(CFITSIO_LIB_SPEC) else AC_MSG_ERROR([$cf doesn't exist]) fi AC_CHECK_HEADERS(sys/filio.h) # Check if we need (or can use) the socklen_t type. AC_CHECK_TYPES([socklen_t],,,[#include ]) AC_DEFINE(USE_COMPAT_CONST, 1, [For compatibility between tcl8.4 and previous tcl releases]) #-------------------------------------------------------------------- # From the cfitsio configure script #-------------------------------------------------------------------- AC_CHECK_HEADERS(stdlib.h string.h math.h limits.h ,ANSI_HEADER=yes,ANSI_HEADER=no)dnl # ================= test for the unix ftruncate function ================ AC_MSG_CHECKING("whether ftruncate works") AC_TRY_LINK([#include ], [ ftruncate(0, 0); ], [ AC_DEFINE(HAVE_FTRUNCATE) AC_MSG_RESULT("yes") ], AC_MSG_RESULT("no") ) # --------------------------------------------------------- # some systems define long long for 64-bit ints # --------------------------------------------------------- AC_MSG_CHECKING("whether long long is defined") AC_TRY_COMPILE([#include ], [ long long filler; ], [ AC_DEFINE(HAVE_LONGLONG) AC_MSG_RESULT("yes") ], AC_MSG_RESULT("no") ) # ------------------------------------------------------------------------- # check is System V IPC is supported on this machine # ------------------------------------------------------------------------- AC_MSG_CHECKING("whether system V style IPC services are supported") AC_TRY_LINK([#include #include #include ], [ shmat(0, 0, 0); shmdt(0); shmget(0, 0, 0); semget(0, 0, 0); ], [ AC_DEFINE(HAVE_SHMEM_SERVICES) my_shmem=\${SOURCES_SHMEM} AC_MSG_RESULT("yes") ], AC_MSG_RESULT("no") ) AC_SUBST(my_shmem) # ------------------------------------------------------------------------- # some systems define flock_t, for others we have to define it ourselves # ------------------------------------------------------------------------- AC_MSG_CHECKING("do we have flock_t defined in sys/fcntl.h") AC_TRY_COMPILE([#include ], [ flock_t filler; ], [ AC_DEFINE(HAVE_FLOCK_T) AC_MSG_RESULT("yes") ], AC_MSG_RESULT("no") ) if test "$HAVE_FLOCK_T" != 1; then AC_MSG_CHECKING("do we have flock_t defined in sys/flock.h") AC_TRY_COMPILE([#include ], [ flock_t filler; ], [ AC_DEFINE(HAVE_FLOCK_T) AC_MSG_RESULT("yes") ], AC_MSG_RESULT("no") ) fi # ------------------------------------------------------------------------- # there are some idiosyncrasies with semun defs (used in semxxx). Solaris # does not define it at all # ------------------------------------------------------------------------- AC_MSG_CHECKING("do we have union semun defined") AC_TRY_COMPILE( [#include #include #include #include ], [ union semun filler; ], [ AC_DEFINE(HAVE_UNION_SEMUN) AC_MSG_RESULT("yes") ], AC_MSG_RESULT("no") ) AC_DEFINE(HAVE_NET_SERVICES) # ==================== END OF cfitsio SECTION ================ #------------------------------------------------------------------------ # ASTROTCL_PATH_CFITSIO -- # # Locate the CFITSIO library # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-cfitsio=... # # Defines the following vars: # CFITSIO_LIB_SPEC String to add to link the CFITSIO lib (-L... -lBLT) # CFITSIO_LIB_DIR Directory containing libcfitsio.so #------------------------------------------------------------------------ AC_DEFUN(ASTROTCL_PATH_CFITSIO, [ AC_MSG_CHECKING(for CFITSIO library) AC_ARG_WITH(cfitsio, [AC_HELP_STRING([--with-cfitsio=DIR],[link with CFITSIO library installed in DIR])], CFITSIO_LIB_DIR=$withval) CFITSIO_LIBNAME=libcfitsio${SHLIB_SUFFIX} CFITSIO_LIBFLAG=-lcfitsio if test -z "$CFITSIO_LIB_DIR" ; then # If --with-cfitsio=dir was not specified, try the exec-prefix/lib dir places="\ $exec_prefix/lib \ $prefix/lib \ " for i in $places ; do if test -f $i/$CFITSIO_LIBNAME then CFITSIO_LIB_DIR=$i break fi done if test -z "$CFITSIO_LIB_DIR" ; then echo AC_MSG_ERROR([could not find $CFITSIO_LIBNAME: Please use the --with-cfitsio=DIR option.]) fi else # Just assume the given value will work. This may not be true if # CFITSIO itself isn't built yet, so allow the flexibility. CFITSIO_LIB_DIR=$CFITSIO_LIB_DIR/lib fi CFITSIO_LIB_SPEC="-L$CFITSIO_LIB_DIR $CFITSIO_LIBFLAG" AC_MSG_RESULT($CFITSIO_LIB_DIR) AC_SUBST(CFITSIO_LIB_DIR) AC_SUBST(CFITSIO_LIB_SPEC) ]) #------------------------------------------------------------------------ # Check if we require additional libraries to support C++ shareable # libraries. system=`uname -s`-`uname -r` SHLIB_LD_CXX_LIBS="" export SHLIB_LD_CXX_LIBS case $system in SunOS-5*) SHLIB_LD_CXX_LIBS="-lCrun -lCstd" ;; OSF*) SHLIB_LD_CXX_LIBS="-lcxx -lcxxstd" ;; esac AC_SUBST(SHLIB_LD_CXX_LIBS) #------------------------------------------------------------------------- # The cxx C++ compiler under Tru64 UNIX needs the special # CXXFLAGS "-std gnu -D__USE_STD_IOSTREAM=1". These allow the standard # library streams headers to work and to generate templates that do # not require special handling throughout skycat directories (normally # template object files are created in various cxx_repository subdirectories, # this way the object files are kept embedded the usual object files, see # the cxx man page for details). #------------------------------------------------------------------------- export CXXFLAGS case $system in OSF*) case "x$CXX" in xcxx*) CXXFLAGS="$CXXFLAGS -g3 -std gnu -D__USE_STD_IOSTREAM=1" ;; esac ;; esac ]) skycat-3.1.2-starlink-1b/astrotcl/astrotclConfig.sh.in000066400000000000000000000037111215713201500227140ustar00rootroot00000000000000# E.S.O. - VLT project # $Id: astrotclConfig.sh.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # astrotclConfig.sh -- # # This shell script (for sh) is generated automatically by Astrotcl's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. # This script is intended to be included by the configure scripts # for Astrotcl extensions so that they don't have to figure this all # out for themselves. This file does not duplicate information # already provided by tclConfig.sh, so you may need to use that # file in addition to this one. # # The information in this file is specific to a single platform. # Astrotcl's version number. astrotcl_VERSION='@PACKAGE_VERSION@' # The name of the Astrotcl library: astrotcl_LIB_FILE=@astrotcl_LIB_FILE@ # Astrotcl build directory. astrotcl_BUILD_DIR='@astrotcl_BUILD_DIR@' # String to pass to linker to pick up the Astrotcl library from its # build directory. astrotcl_BUILD_LIB_SPEC='@astrotcl_BUILD_LIB_SPEC@' # String to pass to linker to pick up the Astrotcl library from its # installed directory. astrotcl_LIB_SPEC='@astrotcl_LIB_SPEC@' # Location of the top-level source directories from which Astrotcl # was built. This is the directory that contains generic, unix, etc. # If Astrotcl was compiled in a different place than the directory # containing the source files, this points to the location of the sources, # not the location where Astrotcl was compiled. astrotcl_SRC_DIR='@astrotcl_SRC_DIR@' # List of object files used to build the library (for merging packages). astrotcl_PKG_OBJECTS='@astrotcl_PKG_OBJECTS@' # List of header filesinstalled for this library (for merging packages). astrotcl_PKG_HEADERS='@astrotcl_PKG_HEADERS@' # String to pass to linker to pick up the CFITSIO library from its # installed directory. CFITSIO_LIB_SPEC='@CFITSIO_LIB_SPEC@' # Directory containing the CFITSIO shared library CFITSIO_LIB_DIR='@CFITSIO_LIB_DIR@' skycat-3.1.2-starlink-1b/astrotcl/configure000077500000000000000000013725501215713201500207140ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Starlink Autoconf 2.59 for astrotcl 2.1.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='astrotcl' PACKAGE_TARNAME='astrotcl' PACKAGE_VERSION='2.1.0' PACKAGE_STRING='astrotcl 2.1.0' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_LIBS TK_XINCLUDES CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP CXX CXXFLAGS ac_ct_CXX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS tclutil_VERSION tclutil_LIB_FILE tclutil_BUILD_LIB_SPEC tclutil_LIB_SPEC BLT_LIB_SPEC tclutil_SRC_DIR CFITSIO_LIB_SPEC my_shmem SHLIB_LD_CXX_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TK_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS SHLIB_SUFFIX DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_CFLAGS SHLIB_LD_LIBS LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LD_LIBRARY_PATH_VAR CFITSIO_LIB_DIR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG WISH_PROG astrotcl_LIB_FILE astrotcl_BUILD_DIR astrotcl_BUILD_LIB_SPEC astrotcl_LIB_SPEC astrotcl_PKG_OBJECTS astrotcl_SRC_DIR LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures astrotcl 2.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of astrotcl 2.1.0:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-threads build with threads --enable-shared build and link with shared libraries --enable-shared --enable-64bit enable 64bit support (where applicable) --enable-64bit-vis enable 64bit Sparc VIS support --enable-wince enable Win/CE support (where applicable) --disable-load disallow dynamic loading and "load" command --enable-symbols build with debugging symbols --disable-symbols Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) --with-tclinclude directory containing the public Tcl header files --with-tkinclude directory containing the public Tk header files. --with-x use the X Window System --with-celib=DIR use Windows/CE support library from DIR --with-cfitsio=DIR link with CFITSIO library installed in DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF astrotcl configure 2.1.0 generated by Starlink Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by astrotcl $as_me 2.1.0, which was generated by Starlink Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.4" echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 if test x"${PACKAGE_NAME}" = x ; then { { echo "$as_me:$LINENO: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 echo "$as_me: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} { (exit 1); exit 1; }; } fi if test x"3.4" = x ; then { { echo "$as_me:$LINENO: error: TEA version not specified." >&5 echo "$as_me: error: TEA version not specified." >&2;} { (exit 1); exit 1; }; } elif test "3.4" != "${TEA_VERSION}" ; then echo "$as_me:$LINENO: result: warning: requested TEA version \"3.4\", have \"${TEA_VERSION}\"" >&5 echo "${ECHO_T}warning: requested TEA version \"3.4\", have \"${TEA_VERSION}\"" >&6 else echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CYGPATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -w" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then echo "$as_me:$LINENO: result: $CYGPATH" >&5 echo "${ECHO_T}$CYGPATH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi # This package name must be replaced statically for AC_SUBST to work # Substitute STUB_LIB_FILE in case package creates a stub library too. # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" with_tclconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tcl configuration" >&5 echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 if test "${ac_cv_c_tclconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d ${TCLTK_ROOT}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" { echo "$as_me:$LINENO: WARNING: \"Cannot find Tcl configuration definitions\"" >&5 echo "$as_me: WARNING: \"Cannot find Tcl configuration definitions\"" >&2;} exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6 fi fi echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . $TCL_BIN_DIR/tclConfig.sh else echo "$as_me:$LINENO: result: file not found" >&5 echo "${ECHO_T}file not found" >&6 fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" #AC_SUBST(TCL_BUILD_LIB_SPEC) #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true # Check whether --with-tk or --without-tk was given. if test "${with_tk+set}" = set; then withval="$with_tk" with_tkconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tk configuration" >&5 echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6 if test "${ac_cv_c_tkconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case ${with_tkconfig} in */tkConfig.sh ) if test -f ${with_tkconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;} with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5 echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d ${TCLTK_ROOT}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" { echo "$as_me:$LINENO: WARNING: \"Cannot find Tk configuration definitions\"" >&5 echo "$as_me: WARNING: \"Cannot find Tk configuration definitions\"" >&2;} exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} echo "$as_me:$LINENO: result: found $TK_BIN_DIR/tkConfig.sh" >&5 echo "${ECHO_T}found $TK_BIN_DIR/tkConfig.sh" >&6 fi fi echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6 if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . $TK_BIN_DIR/tkConfig.sh else echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6 fi # # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TK_BIN_DIR/Makefile ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} fi # Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) cat >>confdefs.h <<\_ACEOF #define MAC_OSX_TK 1 _ACEOF TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi # # eval is required to do the TK_DBGX substitution # eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} prefix=${TCL_PREFIX} else { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 echo "$as_me: --prefix defaulting to /usr/local" >&6;} prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then #if test x"${TCL_EXEC_PREFIX}" != x; then #AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) #exec_prefix=${TCL_EXEC_PREFIX} #else { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} exec_prefix=$prefix #fi fi #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_cv_c_compiler_gnu = yes; then GCC=yes fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 OLDCC="$CC" CC="$CC -pipe" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC="$OLDCC" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi #-------------------------------------------------------------------- # Pick up flags from the environment (user). #-------------------------------------------------------------------- CC="${CC} $CFLAGS" CXX="${CXX} $CXXFLAGS $CFLAGS" #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac if test "${TEA_PLATFORM}" = "unix" ; then #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for sin" >&5 echo $ECHO_N "checking for sin... $ECHO_C" >&6 if test "${ac_cv_func_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sin to an innocuous variant, in case declares sin. For example, HP-UX 11i declares gettimeofday. */ #define sin innocuous_sin /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sin /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sin (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_sin) || defined (__stub___sin) choke me #else char (*f) () = sin; #endif #ifdef __cplusplus } #endif int main () { return f != sin; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sin=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sin=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 echo "${ECHO_T}$ac_cv_func_sin" >&6 if test $ac_cv_func_sin = yes; then MATH_LIBS="" else MATH_LIBS="-lm" fi echo "$as_me:$LINENO: checking for main in -lieee" >&5 echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 if test "${ac_cv_lib_ieee_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ieee_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 if test $ac_cv_lib_ieee_main = yes; then MATH_LIBS="-lieee $MATH_LIBS" fi #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for main in -linet" >&5 echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_inet_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 if test $ac_cv_lib_inet_main = yes; then LIBS="$LIBS -linet" fi if test "${ac_cv_header_net_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking net/errno.h usability" >&5 echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking net/errno.h presence" >&5 echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_net_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 fi if test $ac_cv_header_net_errno_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_ERRNO_H 1 _ACEOF fi #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_connect) || defined (__stub___connect) choke me #else char (*f) () = connect; #endif #ifdef __cplusplus } #endif int main () { return f != connect; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = yes; then tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then echo "$as_me:$LINENO: checking for setsockopt" >&5 echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 if test "${ac_cv_func_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define setsockopt to an innocuous variant, in case declares setsockopt. For example, HP-UX 11i declares gettimeofday. */ #define setsockopt innocuous_setsockopt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setsockopt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef setsockopt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_setsockopt) || defined (__stub___setsockopt) choke me #else char (*f) () = setsockopt; #endif #ifdef __cplusplus } #endif int main () { return f != setsockopt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 if test $ac_cv_func_setsockopt = yes; then : else echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); int main () { setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 if test $ac_cv_lib_socket_setsockopt = yes; then LIBS="$LIBS -lsocket" else tcl_checkBoth=1 fi fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo "$as_me:$LINENO: checking for accept" >&5 echo $ECHO_N "checking for accept... $ECHO_C" >&6 if test "${ac_cv_func_accept+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define accept to an innocuous variant, in case declares accept. For example, HP-UX 11i declares gettimeofday. */ #define accept innocuous_accept /* System header to define __stub macros and hopefully few prototypes, which can conflict with char accept (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef accept /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char accept (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_accept) || defined (__stub___accept) choke me #else char (*f) () = accept; #endif #ifdef __cplusplus } #endif int main () { return f != accept; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_accept=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_accept=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 echo "${ECHO_T}$ac_cv_func_accept" >&6 if test $ac_cv_func_accept = yes; then tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) choke me #else char (*f) () = gethostbyname; #endif #ifdef __cplusplus } #endif int main () { return f != gethostbyname; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = yes; then : else echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then LIBS="$LIBS -lnsl" fi fi # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' echo "$as_me:$LINENO: checking dirent.h" >&5 echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 if test "${tcl_cv_dirent_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_dirent_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_dirent_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test $tcl_cv_dirent_h = no; then cat >>confdefs.h <<\_ACEOF #define NO_DIRENT_H 1 _ACEOF fi echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking errno.h usability" >&5 echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking errno.h presence" >&5 echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 fi if test $ac_cv_header_errno_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_ERRNO_H 1 _ACEOF fi if test "${ac_cv_header_float_h+set}" = set; then echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking float.h usability" >&5 echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking float.h presence" >&5 echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_float_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 fi if test $ac_cv_header_float_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_FLOAT_H 1 _ACEOF fi if test "${ac_cv_header_values_h+set}" = set; then echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking values.h usability" >&5 echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking values.h presence" >&5 echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_values_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 fi if test $ac_cv_header_values_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_VALUES_H 1 _ACEOF fi if test "${ac_cv_header_limits_h+set}" = set; then echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking limits.h usability" >&5 echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking limits.h presence" >&5 echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_limits_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 fi if test $ac_cv_header_limits_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIMITS_H 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define NO_LIMITS_H 1 _ACEOF fi if test "${ac_cv_header_stdlib_h+set}" = set; then echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking stdlib.h usability" >&5 echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking stdlib.h presence" >&5 echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stdlib_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 fi if test $ac_cv_header_stdlib_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtol" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtoul" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtod" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STDLIB_H 1 _ACEOF fi if test "${ac_cv_header_string_h+set}" = set; then echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking string.h usability" >&5 echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking string.h presence" >&5 echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_string_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 fi if test $ac_cv_header_string_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strstr" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STRING_H 1 _ACEOF fi if test "${ac_cv_header_sys_wait_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_wait_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 fi if test $ac_cv_header_sys_wait_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_SYS_WAIT_H 1 _ACEOF fi if test "${ac_cv_header_dlfcn_h+set}" = set; then echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 fi if test $ac_cv_header_dlfcn_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_DLFCN_H 1 _ACEOF fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). for ac_header in sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi #-------------------------------------------------------------------- # Do application specific checks (see aclocal.m4) #-------------------------------------------------------------------- # Load the Tclutil definitions cf=../tclutil/tclutilConfig.sh if test -f $cf ; then . $cf else { { echo "$as_me:$LINENO: error: $cf doesn't exist" >&5 echo "$as_me: error: $cf doesn't exist" >&2;} { (exit 1); exit 1; }; } fi for ac_header in sys/filio.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Check if we need (or can use) the socklen_t type. echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { if ((socklen_t *) 0) return 0; if (sizeof (socklen_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test $ac_cv_type_socklen_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SOCKLEN_T 1 _ACEOF fi cat >>confdefs.h <<\_ACEOF #define USE_COMPAT_CONST 1 _ACEOF #-------------------------------------------------------------------- # From the cfitsio configure script #-------------------------------------------------------------------- for ac_header in stdlib.h string.h math.h limits.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF ANSI_HEADER=yes else ANSI_HEADER=no fi done # ================= test for the unix ftruncate function ================ echo "$as_me:$LINENO: checking \"whether ftruncate works\"" >&5 echo $ECHO_N "checking \"whether ftruncate works\"... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { ftruncate(0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_FTRUNCATE 1 _ACEOF echo "$as_me:$LINENO: result: \"yes\"" >&5 echo "${ECHO_T}\"yes\"" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: \"no\"" >&5 echo "${ECHO_T}\"no\"" >&6 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # --------------------------------------------------------- # some systems define long long for 64-bit ints # --------------------------------------------------------- echo "$as_me:$LINENO: checking \"whether long long is defined\"" >&5 echo $ECHO_N "checking \"whether long long is defined\"... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { long long filler; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONGLONG 1 _ACEOF echo "$as_me:$LINENO: result: \"yes\"" >&5 echo "${ECHO_T}\"yes\"" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: \"no\"" >&5 echo "${ECHO_T}\"no\"" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # ------------------------------------------------------------------------- # check is System V IPC is supported on this machine # ------------------------------------------------------------------------- echo "$as_me:$LINENO: checking \"whether system V style IPC services are supported\"" >&5 echo $ECHO_N "checking \"whether system V style IPC services are supported\"... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { shmat(0, 0, 0); shmdt(0); shmget(0, 0, 0); semget(0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_SHMEM_SERVICES 1 _ACEOF my_shmem=\${SOURCES_SHMEM} echo "$as_me:$LINENO: result: \"yes\"" >&5 echo "${ECHO_T}\"yes\"" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: \"no\"" >&5 echo "${ECHO_T}\"no\"" >&6 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # ------------------------------------------------------------------------- # some systems define flock_t, for others we have to define it ourselves # ------------------------------------------------------------------------- echo "$as_me:$LINENO: checking \"do we have flock_t defined in sys/fcntl.h\"" >&5 echo $ECHO_N "checking \"do we have flock_t defined in sys/fcntl.h\"... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { flock_t filler; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_FLOCK_T 1 _ACEOF echo "$as_me:$LINENO: result: \"yes\"" >&5 echo "${ECHO_T}\"yes\"" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: \"no\"" >&5 echo "${ECHO_T}\"no\"" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test "$HAVE_FLOCK_T" != 1; then echo "$as_me:$LINENO: checking \"do we have flock_t defined in sys/flock.h\"" >&5 echo $ECHO_N "checking \"do we have flock_t defined in sys/flock.h\"... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { flock_t filler; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_FLOCK_T 1 _ACEOF echo "$as_me:$LINENO: result: \"yes\"" >&5 echo "${ECHO_T}\"yes\"" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: \"no\"" >&5 echo "${ECHO_T}\"no\"" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi # ------------------------------------------------------------------------- # there are some idiosyncrasies with semun defs (used in semxxx). Solaris # does not define it at all # ------------------------------------------------------------------------- echo "$as_me:$LINENO: checking \"do we have union semun defined\"" >&5 echo $ECHO_N "checking \"do we have union semun defined\"... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { union semun filler; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNION_SEMUN 1 _ACEOF echo "$as_me:$LINENO: result: \"yes\"" >&5 echo "${ECHO_T}\"yes\"" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: \"no\"" >&5 echo "${ECHO_T}\"no\"" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >>confdefs.h <<\_ACEOF #define HAVE_NET_SERVICES 1 _ACEOF # ==================== END OF cfitsio SECTION ================ #------------------------------------------------------------------------ # ASTROTCL_PATH_CFITSIO -- # # Locate the CFITSIO library # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-cfitsio=... # # Defines the following vars: # CFITSIO_LIB_SPEC String to add to link the CFITSIO lib (-L... -lBLT) # CFITSIO_LIB_DIR Directory containing libcfitsio.so #------------------------------------------------------------------------ #------------------------------------------------------------------------ # Check if we require additional libraries to support C++ shareable # libraries. system=`uname -s`-`uname -r` SHLIB_LD_CXX_LIBS="" export SHLIB_LD_CXX_LIBS case $system in SunOS-5*) SHLIB_LD_CXX_LIBS="-lCrun -lCstd" ;; OSF*) SHLIB_LD_CXX_LIBS="-lcxx -lcxxstd" ;; esac #------------------------------------------------------------------------- # The cxx C++ compiler under Tru64 UNIX needs the special # CXXFLAGS "-std gnu -D__USE_STD_IOSTREAM=1". These allow the standard # library streams headers to work and to generate templates that do # not require special handling throughout skycat directories (normally # template object files are created in various cxx_repository subdirectories, # this way the object files are kept embedded the usual object files, see # the cxx man page for details). #------------------------------------------------------------------------- export CXXFLAGS case $system in OSF*) case "x$CXX" in xcxx*) CXXFLAGS="$CXXFLAGS -g3 -std gnu -D__USE_STD_IOSTREAM=1" ;; esac ;; esac #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- csources=`cd $srcdir; echo generic/*.[Cc] press/*.[Cc] libwcs/*.[Cc]` cheaders=`cd $srcdir; echo generic/*.h press/*.h libwcs/*.h` cincludes="-I$srcdir/../tclutil/generic -I$srcdir/generic -I$srcdir/press -I$srcdir/libwcs" tclsources=`cd $srcdir; echo library/*.tcl` vars="${csources}" for i in $vars; do case $i in \$*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 echo "$as_me: error: could not find source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done vars="${cheaders}" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_HEADERS="$PKG_HEADERS $i" done vars="$cincludes" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done vars="$tclutil_BUILD_LIB_SPEC ${BLT_LIB_SPEC} ${CFITSIO_LIB_SPEC}" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done PKG_CFLAGS="$PKG_CFLAGS " vars="" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 echo "$as_me: error: could not find stub source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done vars="${tclsources}" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then cat >>confdefs.h <<\_ACEOF #define BUILD_astrotcl 1 _ACEOF CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for Tcl public headers" >&5 echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" with_tclinclude=${withval} fi; if test "${ac_cv_c_tclh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} { (exit 1); exit 1; }; } fi else # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; *) list="" ;; esac # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "$TCL_BIN_DIR/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 echo "${ECHO_T}${ac_cv_c_tclh}" >&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" #TEA_PRIVATE_TCL_HEADERS echo "$as_me:$LINENO: checking for Tk public headers" >&5 echo $ECHO_N "checking for Tk public headers... $ECHO_C" >&6 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" with_tkinclude=${withval} fi; if test "${ac_cv_c_tkh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else { { echo "$as_me:$LINENO: error: ${with_tkinclude} directory does not contain tk.h" >&5 echo "$as_me: error: ${with_tkinclude} directory does not contain tk.h" >&2;} { (exit 1); exit 1; }; } fi else # If Tk was built as a framework, attempt to use # the framework's Headers directory. case ${TK_DEFS} in *TK_FRAMEWORK*) list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" ;; *) list="" ;; esac # Look in the source dir only if Tk is not installed, # and in that situation, look there before installed locations. if test -f "$TK_BIN_DIR/Makefile" ; then list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tk's --prefix location, # relative to directory of tkConfig.sh, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then { { echo "$as_me:$LINENO: error: tk.h not found. Please specify its location with --with-tkinclude" >&5 echo "$as_me: error: tk.h not found. Please specify its location with --with-tkinclude" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ${ac_cv_c_tkh}" >&5 echo "${ECHO_T}${ac_cv_c_tkh}" >&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then # On Windows and Aqua, we need the X compat headers echo "$as_me:$LINENO: checking for X11 header files" >&5 echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" fi echo "$as_me:$LINENO: result: ${INCLUDE_DIR_NATIVE}" >&5 echo "${ECHO_T}${INCLUDE_DIR_NATIVE}" >&6 fi #TEA_PRIVATE_TK_HEADERS if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then withval="$with_x" fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then # Both variables are already set. have_x=yes else if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -fr conftest.dir if mkdir conftest.dir; then cd conftest.dir # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' _ACEOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -fr conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XtMalloc (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then # Didn't find X anywhere. Cache the known absence of X. ac_cv_have_x="have_x=no" else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 not_really_there="yes" fi rm -f conftest.err conftest.$ac_ext else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then echo "$as_me:$LINENO: checking for X11 header files" >&5 echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 XINCLUDES="# no special path needed" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 XINCLUDES="nope" fi rm -f conftest.err conftest.$ac_ext if test "$XINCLUDES" = nope; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then echo "$as_me:$LINENO: result: $i" >&5 echo "${ECHO_T}$i" >&6 XINCLUDES=" -I$i" break fi done fi else if test "$x_includes" != ""; then XINCLUDES=-I$x_includes else XINCLUDES="# no special path needed" fi fi if test "$XINCLUDES" = nope; then echo "$as_me:$LINENO: result: could not find any!" >&5 echo "${ECHO_T}could not find any!" >&6 XINCLUDES="# no include files found" fi if test "$no_x" = yes; then echo "$as_me:$LINENO: checking for X11 libraries" >&5 echo $ECHO_N "checking for X11 libraries... $ECHO_C" >&6 XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.dylib -o -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then echo "$as_me:$LINENO: result: $i" >&5 echo "${ECHO_T}$i" >&6 XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then echo "$as_me:$LINENO: checking for XCreateWindow in -lXwindow" >&5 echo $ECHO_N "checking for XCreateWindow in -lXwindow... $ECHO_C" >&6 if test "${ac_cv_lib_Xwindow_XCreateWindow+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXwindow $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char XCreateWindow (); int main () { XCreateWindow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_Xwindow_XCreateWindow=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xwindow_XCreateWindow=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 echo "${ECHO_T}$ac_cv_lib_Xwindow_XCreateWindow" >&6 if test $ac_cv_lib_Xwindow_XCreateWindow = yes; then XLIBSW=-lXwindow fi fi if test "$XLIBSW" = nope ; then echo "$as_me:$LINENO: result: could not find any! Using -lX11." >&5 echo "${ECHO_T}could not find any! Using -lX11." >&6 XLIBSW=-lX11 fi if test x"${XLIBSW}" != x ; then PKG_LIBS="${PKG_LIBS} ${XLIBSW}" fi fi #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants. cat >>confdefs.h <<\_ACEOF #define USE_THREAD_ALLOC 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _THREAD_SAFE 1 _ACEOF echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the # same library, as some systems hide it there until # pthread.h is defined. We could alternatively do an # AC_TRY_COMPILE with pthread.h, but that will work with # libpthread really doesn't exist, like AIX 4.2. # [Bug: 4359] echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __pthread_mutex_init (); int main () { __pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread___pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthreads_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 if test $ac_cv_lib_c_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_r_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 { echo "$as_me:$LINENO: WARNING: \"Don t know how to find pthread lib on your system - thread support disabled\"" >&5 echo "$as_me: WARNING: \"Don t know how to find pthread lib on your system - thread support disabled\"" >&2;} fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output echo "$as_me:$LINENO: checking for building with threads" >&5 echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 if test "${TCL_THREADS}" = "1"; then cat >>confdefs.h <<\_ACEOF #define TCL_THREADS 1 _ACEOF #LIBS="$LIBS $THREADS_LIBS" echo "$as_me:$LINENO: result: yes (default)" >&5 echo "${ECHO_T}yes (default)" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then { echo "$as_me:$LINENO: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&5 echo "$as_me: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&2;} fi ;; *) if test "${TCL_THREADS}" = "1"; then { echo "$as_me:$LINENO: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&5 echo "$as_me: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&2;} fi ;; esac #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking how to build libraries" >&5 echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$as_me:$LINENO: result: shared" >&5 echo "${ECHO_T}shared" >&6 SHARED_BUILD=1 else echo "$as_me:$LINENO: result: static" >&5 echo "${ECHO_T}static" >&6 SHARED_BUILD=0 cat >>confdefs.h <<\_ACEOF #define STATIC_BUILD 1 _ACEOF fi #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- # Step 0: Enable 64 bit support? echo "$as_me:$LINENO: checking if 64bit support is enabled" >&5 echo $ECHO_N "checking if 64bit support is enabled... $ECHO_C" >&6 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" do64bit=$enableval else do64bit=no fi; echo "$as_me:$LINENO: result: $do64bit" >&5 echo "${ECHO_T}$do64bit" >&6 # Step 0.b: Enable Solaris 64 bit VIS support? echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" do64bitVIS=$enableval else do64bitVIS=no fi; echo "$as_me:$LINENO: result: $do64bitVIS" >&5 echo "${ECHO_T}$do64bitVIS" >&6 if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 0.c: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = "windows" ; then echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 # Check whether --enable-wince or --disable-wince was given. if test "${enable_wince+set}" = set; then enableval="$enable_wince" doWince=$enableval else doWince=no fi; echo "$as_me:$LINENO: result: $doWince" >&5 echo "${ECHO_T}$doWince" >&6 fi # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. echo "$as_me:$LINENO: checking system version (for dynamic loading)" >&5 echo $ECHO_N "checking system version (for dynamic loading)... $ECHO_C" >&6 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then echo "$as_me:$LINENO: result: unknown (can't find uname command)" >&5 echo "${ECHO_T}unknown (can't find uname command)" >&6 system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print }' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi if test "${TEA_PLATFORM}" = "windows" ; then system=windows fi echo "$as_me:$LINENO: result: $system" >&5 echo "${ECHO_T}$system" >&6 fi fi # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then have_dl=yes else have_dl=no fi # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case and CC_SEARCH_FLAGS becomes LD_SEARCH_FLAGS for us # (and we have no CC_SEARCH_FLAGS). do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g if test "$GCC" = "yes" ; then CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" else CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} { (exit 1); exit 1; }; } fi if test "$GCC" = "yes" ; then { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} { (exit 1); exit 1; }; } fi # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true # Check whether --with-celib or --without-celib was given. if test "${with_celib+set}" = set; then withval="$with_celib" with_celibconfig=${withval} fi; echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 if test "${ac_cv_c_celibconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi fi if test x"${ac_cv_c_celibconfig}" = x ; then { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 echo "$as_me: error: Cannot find celib support library directory" >&2;} { (exit 1); exit 1; }; } else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 echo "${ECHO_T}found $CELIB_DIR" >&6 fi fi # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} { (exit 1); exit 1; }; } doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 vars="bufferoverflowU.lib" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower($0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do cat >>confdefs.h <<_ACEOF #define $i 1 _ACEOF done cat >>confdefs.h <<_ACEOF #define _WIN32_WCE $CEVERSION _ACEOF cat >>confdefs.h <<_ACEOF #define UNDER_CE $CEVERSION _ACEOF CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2" SHLIB_LD="$CXX -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 echo "${ECHO_T}Using $CC for compiling with threads" >&6 fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then #LIBOBJS="$LIBOBJS tclLoadAix.o" case $LIBOBJS in "tclLoadAix.$ac_objext" | \ *" tclLoadAix.$ac_objext" | \ "tclLoadAix.$ac_objext "* | \ *" tclLoadAix.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; esac DL_LIBS="-lld" fi # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: \"64bit mode not supported with GCC on $system\"" >&5 echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS="$LDFLAGS -q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi else if test "$GCC" = "yes" ; then SHLIB_LD="$CXX -shared" else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gettimeofday (); int main () { gettimeofday (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gettimeofday=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then libbsd=yes else libbsd=no fi if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" cat >>confdefs.h <<\_ACEOF #define USE_DELTA_FOR_TZ 1 _ACEOF fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CXX} -nostart" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="$CXX -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then SHLIB_LD="$CXX -shared -fPIC" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="${CXX} -shared -fPIC" SHLIB_LD_LIBS='${LIBS}' ;; *) { echo "$as_me:$LINENO: WARNING: \"64bit mode not supported with GCC on $system\"" >&5 echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;} ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS="$LDFLAGS +DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi LD_LIBRARY_PATH_VAR="SHLIB_PATH" ;; IRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS="$LDFLAGS -64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" if test "$have_dl" = yes; then SHLIB_LD="${CXX} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' else if test "${ac_cv_header_dld_h+set}" = set; then echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dld.h usability" >&5 echo $ECHO_N "checking dld.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dld.h presence" >&5 echo $ECHO_N "checking dld.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dld.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dld.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dld.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dld.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dld.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dld_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 fi if test $ac_cv_header_dld_h = yes; then SHLIB_LD="ld -shared" DL_OBJS="tclLoadDld.o" DL_LIBS="-ldld" LD_SEARCH_FLAGS="" fi fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x ; then CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" if test "$have_dl" = yes; then SHLIB_LD="${CXX} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" LD_SEARCH_FLAGS="" else if test "${ac_cv_header_dld_h+set}" = set; then echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dld.h usability" >&5 echo $ECHO_N "checking dld.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dld.h presence" >&5 echo $ECHO_N "checking dld.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dld.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dld.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dld.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dld.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dld.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dld_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 fi if test $ac_cv_header_dld_h = yes; then SHLIB_LD="ld -shared" DL_OBJS="" DL_LIBS="-ldld" LD_SEARCH_FLAGS="" fi fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[1-2].*) # Not available on all versions: check for include file. if test "${ac_cv_header_dlfcn_h+set}" = set; then echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ----------------------------------- ## ## Report this to the astrotcl lists. ## ## ----------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 fi if test $ac_cv_header_dlfcn_h = yes; then # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi rm -f conftest* else SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' fi # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) SHLIB_LD="${CXX} -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi rm -f conftest* # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" if test $do64bit = yes; then do64bit_ok=yes CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" fi SHLIB_LD='${CXX} -dynamiclib ${CFLAGS} ${LDFLAGS}' echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 if test "${tcl_cv_ld_single_module+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_single_module=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_single_module=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: test -z "${MACOSX_DEPLOYMENT_TARGET}" || \ test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print $2}'`" -lt 4 && \ LDFLAGS="$LDFLAGS -prebind" LDFLAGS="$LDFLAGS -headerpad_max_install_names" echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 if test "${tcl_cv_ld_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_search_paths_first=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_search_paths_first=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="$CXX -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy cat >>confdefs.h <<\_ACEOF #define _OE_SOCKETS 1 _ACEOF ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export :' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" # PWD: don't need this. #LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" LD_SEARCH_FLAGS="" ;; RISCos-*) SHLIB_CFLAGS="-G 0" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[0-6]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC" SHLIB_LD="$CXX -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else SHLIB_LD="$CXX -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' SHLIB_CFLAGS="-KPIC" fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then if test "`gcc -dumpversion` | awk -F. '{print }'" -lt "3" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" fi else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS="$LDFLAGS -xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS="$LDFLAGS -xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi elif test "$arch" = "amd64 i386" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" fi else { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC" SHLIB_LD="$CXX -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' if test "$do64bit" = "yes" ; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS},-R,$v9gcclibdir" fi else SHLIB_CFLAGS="-KPIC" SHLIB_LD="$CXX -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' if test "$GCC" != "yes" ; then CFLAGS="$CFLAGS -DHAVE_TZSET -std1" fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 LDFLAGS="$LDFLAGS -Wl,-Bexport" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LDFLAGS=$hold_ldflags found=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $found" >&5 echo "${ECHO_T}$found" >&6 LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" != "no" -a "$do64bit_ok" = "no" ; then { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need # to determine which of several header files defines the a.out file # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we # support only a file format that is more or less version-7-compatible. # In particular, # - a.out files must begin with `struct exec'. # - the N_TXTOFF on the `struct exec' must compute the seek address # of the text segment # - The `struct exec' must contain a_magic, a_text, a_data, a_bss # and a_entry fields. # The following compilation should succeed if and only if either sys/exec.h # or a.out.h is usable for the purpose. # # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the # `struct exec' includes a second header that contains information that # duplicates the v7 fields that are needed. if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo "$as_me:$LINENO: checking sys/exec.h" >&5 echo $ECHO_N "checking sys/exec.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_SYS_EXEC_H 1 _ACEOF else echo "$as_me:$LINENO: checking a.out.h" >&5 echo $ECHO_N "checking a.out.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_A_OUT_H 1 _ACEOF else echo "$as_me:$LINENO: checking sys/exec_aout.h" >&5 echo $ECHO_N "checking sys/exec_aout.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_midmag == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_SYS_EXEC_AOUT_H 1 _ACEOF else DL_OBJS="" fi fi fi fi # Step 5: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load or --disable-load was given. if test "${enable_load+set}" = set; then enableval="$enable_load" tcl_ok=$enableval else tcl_ok=yes fi; if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; RISCos-*) ;; SCO_SV-3.2*) ;; ULTRIX-4.*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary echo "$as_me:$LINENO: checking for required early compiler flags" >&5 echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 tcl_flags="" if test "${tcl_cv_flag__isoc99_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__isoc99_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _ISOC99_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if test "${tcl_cv_flag__largefile64_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__largefile64_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if test "x${tcl_flags}" = "x" ; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 else echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 echo "${ECHO_T}${tcl_flags}" >&6 fi echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 if test "${tcl_cv_type_64bit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { __int64 value = (__int64) 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_type_64bit=__int64 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_type_64bit="long long" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; } ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_64bit=${tcl_type_64bit} else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then cat >>confdefs.h <<\_ACEOF #define TCL_WIDE_INT_IS_LONG 1 _ACEOF echo "$as_me:$LINENO: result: using long" >&5 echo "${ECHO_T}using long" >&6 elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # We actually want to use the default tcl.h checks in this # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 echo "${ECHO_T}using Tcl header defaults" >&6 else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 # Now check for auxiliary declarations echo "$as_me:$LINENO: checking for struct dirent64" >&5 echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 if test "${tcl_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct dirent64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_dirent64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_dirent64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_DIRENT64 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_struct_dirent64}" >&5 echo "${ECHO_T}${tcl_cv_struct_dirent64}" >&6 echo "$as_me:$LINENO: checking for struct stat64" >&5 echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 if test "${tcl_cv_struct_stat64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_stat64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_stat64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_struct_stat64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_STAT64 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_struct_stat64}" >&5 echo "${ECHO_T}${tcl_cv_struct_stat64}" >&6 echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 if test "${tcl_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { off64_t offset; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_type_off64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_TYPE_OFF64_T 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_type_off64_t}" >&5 echo "${ECHO_T}${tcl_cv_type_off64_t}" >&6 fi #-------------------------------------------------------------------- # Find the CFITSIO library. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for CFITSIO library" >&5 echo $ECHO_N "checking for CFITSIO library... $ECHO_C" >&6 # Check whether --with-cfitsio or --without-cfitsio was given. if test "${with_cfitsio+set}" = set; then withval="$with_cfitsio" CFITSIO_LIB_DIR=$withval fi; CFITSIO_LIBNAME=libcfitsio${SHLIB_SUFFIX} CFITSIO_LIBFLAG=-lcfitsio if test -z "$CFITSIO_LIB_DIR" ; then # If --with-cfitsio=dir was not specified, try the exec-prefix/lib dir places="\ $exec_prefix/lib \ $prefix/lib \ " for i in $places ; do if test -f $i/$CFITSIO_LIBNAME then CFITSIO_LIB_DIR=$i break fi done if test -z "$CFITSIO_LIB_DIR" ; then echo { { echo "$as_me:$LINENO: error: could not find $CFITSIO_LIBNAME: Please use the --with-cfitsio=DIR option." >&5 echo "$as_me: error: could not find $CFITSIO_LIBNAME: Please use the --with-cfitsio=DIR option." >&2;} { (exit 1); exit 1; }; } fi else # Just assume the given value will work. This may not be true if # CFITSIO itself isn't built yet, so allow the flexibility. CFITSIO_LIB_DIR=$CFITSIO_LIB_DIR/lib fi CFITSIO_LIB_SPEC="-L$CFITSIO_LIB_DIR $CFITSIO_LIBFLAG" echo "$as_me:$LINENO: result: $CFITSIO_LIB_DIR" >&5 echo "${ECHO_T}$CFITSIO_LIB_DIR" >&6 vars="${CFITSIO_LIB_SPEC}" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- DBGX="" echo "$as_me:$LINENO: checking for build with symbols" >&5 echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" tcl_ok=$enableval else tcl_ok=no fi; if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 echo "${ECHO_T}yes (standard debugging)" >&6 fi fi if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then cat >>confdefs.h <<\_ACEOF #define TCL_MEM_DEBUG 1 _ACEOF fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 echo "${ECHO_T}enabled symbols mem debugging" >&6 else echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 echo "${ECHO_T}enabled $tcl_ok debugging" >&6 fi fi #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- # allan: can't use stubs, due to BLT dependency #AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${LDFLAGS_DEFAULT} \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for tclsh" >&5 echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_PREFIX}/bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}" fi echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 echo "${ECHO_T}${TCLSH_PROG}" >&6 echo "$as_me:$LINENO: checking for wish" >&5 echo $ECHO_N "checking for wish... $ECHO_C" >&6 if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="${TK_BIN_DIR}/wish" fi else # tkConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" fi list="`ls -d ${TK_PREFIX}/bin 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../bin 2>/dev/null`" for i in $list ; do if test -f "$i/${WISH_PROG}" ; then REAL_TK_BIN_DIR="`cd "$i"; pwd`" break fi done WISH_PROG="${REAL_TK_BIN_DIR}/${WISH_PROG}" fi echo "$as_me:$LINENO: result: ${WISH_PROG}" >&5 echo "${ECHO_T}${WISH_PROG}" >&6 #-------------------------------------------------------------------- # These are for astrotclConfig.sh #-------------------------------------------------------------------- astrotcl_LIB_FILE=${PKG_LIB_FILE} eval pkglibdir="${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval astrotcl_LIB_FLAG="-lastrotcl${PACKAGE_VERSION}" else eval astrotcl_LIB_FLAG="-lastrotcl`echo ${PACKAGE_VERSION} | tr -d .`" fi astrotcl_BUILD_DIR="`pwd`" astrotcl_BUILD_LIB_SPEC="-L`pwd` ${astrotcl_LIB_FLAG}" astrotcl_LIB_SPEC="-L${pkglibdir} ${astrotcl_LIB_FLAG}" for i in ${PKG_OBJECTS} ; do astrotcl_PKG_OBJECTS="$astrotcl_PKG_OBJECTS ../astrotcl/$i" done # astrotcl_SRC_DIR must be a fully qualified path eval astrotcl_SRC_DIR="$srcdir" astrotcl_SRC_DIR=`cd "${astrotcl_SRC_DIR}"; pwd` #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- ac_config_files="$ac_config_files Makefile pkgIndex.tcl astrotclConfig.sh" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by astrotcl $as_me 2.1.0, which was generated by Starlink Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ astrotcl config.status 2.1.0 configured by $0, generated by Starlink Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgIndex.tcl" ) CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; "astrotclConfig.sh" ) CONFIG_FILES="$CONFIG_FILES astrotclConfig.sh" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CYGPATH@,$CYGPATH,;t t s,@EXEEXT@,$EXEEXT,;t t s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t s,@PKG_HEADERS@,$PKG_HEADERS,;t t s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t s,@PKG_LIBS@,$PKG_LIBS,;t t s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t s,@TCL_VERSION@,$TCL_VERSION,;t t s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t s,@TCL_LIBS@,$TCL_LIBS,;t t s,@TCL_DEFS@,$TCL_DEFS,;t t s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t s,@TK_VERSION@,$TK_VERSION,;t t s,@TK_BIN_DIR@,$TK_BIN_DIR,;t t s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t s,@TK_LIBS@,$TK_LIBS,;t t s,@TK_XINCLUDES@,$TK_XINCLUDES,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@EGREP@,$EGREP,;t t s,@MATH_LIBS@,$MATH_LIBS,;t t s,@tclutil_VERSION@,$tclutil_VERSION,;t t s,@tclutil_LIB_FILE@,$tclutil_LIB_FILE,;t t s,@tclutil_BUILD_LIB_SPEC@,$tclutil_BUILD_LIB_SPEC,;t t s,@tclutil_LIB_SPEC@,$tclutil_LIB_SPEC,;t t s,@BLT_LIB_SPEC@,$BLT_LIB_SPEC,;t t s,@tclutil_SRC_DIR@,$tclutil_SRC_DIR,;t t s,@CFITSIO_LIB_SPEC@,$CFITSIO_LIB_SPEC,;t t s,@my_shmem@,$my_shmem,;t t s,@SHLIB_LD_CXX_LIBS@,$SHLIB_LD_CXX_LIBS,;t t s,@PKG_SOURCES@,$PKG_SOURCES,;t t s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t s,@CLEANFILES@,$CLEANFILES,;t t s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t s,@TK_INCLUDES@,$TK_INCLUDES,;t t s,@TCL_THREADS@,$TCL_THREADS,;t t s,@SHARED_BUILD@,$SHARED_BUILD,;t t s,@AR@,$AR,;t t s,@CELIB_DIR@,$CELIB_DIR,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t s,@DL_LIBS@,$DL_LIBS,;t t s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t s,@STLIB_LD@,$STLIB_LD,;t t s,@SHLIB_LD@,$SHLIB_LD,;t t s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t s,@CFITSIO_LIB_DIR@,$CFITSIO_LIB_DIR,;t t s,@TCL_DBGX@,$TCL_DBGX,;t t s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t s,@MAKE_LIB@,$MAKE_LIB,;t t s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t s,@RANLIB_STUB@,$RANLIB_STUB,;t t s,@TCLSH_PROG@,$TCLSH_PROG,;t t s,@WISH_PROG@,$WISH_PROG,;t t s,@astrotcl_LIB_FILE@,$astrotcl_LIB_FILE,;t t s,@astrotcl_BUILD_DIR@,$astrotcl_BUILD_DIR,;t t s,@astrotcl_BUILD_LIB_SPEC@,$astrotcl_BUILD_LIB_SPEC,;t t s,@astrotcl_LIB_SPEC@,$astrotcl_LIB_SPEC,;t t s,@astrotcl_PKG_OBJECTS@,$astrotcl_PKG_OBJECTS,;t t s,@astrotcl_SRC_DIR@,$astrotcl_SRC_DIR,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi skycat-3.1.2-starlink-1b/astrotcl/configure.in000066400000000000000000000225701215713201500213070ustar00rootroot00000000000000# E.S.O. - VLT project # $Id: configure.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is used with GNU autoconf to generate a configure script # # usage: % autoconf # only if configure.in changed # % configure # % make # % make install # # who when what # -------------- -------- --------------------------------------------- # Allan Brighton 15/12/05 Rewrote using TCL TEA standard # ----------------------------------------------------------------------- #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- AC_INIT([astrotcl], [2.1.0]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- TEA_INIT([3.4]) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- TEA_PATH_TKCONFIG TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER #-------------------------------------------------------------------- # Do application specific checks (see aclocal.m4) #-------------------------------------------------------------------- ASTROTCL_CONFIG #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- changequote(<<, >>) csources=`cd $srcdir; echo generic/*.[Cc] press/*.[Cc] libwcs/*.[Cc]` changequote([, ]) cheaders=`cd $srcdir; echo generic/*.h press/*.h libwcs/*.h` cincludes="-I$srcdir/../tclutil/generic -I$srcdir/generic -I$srcdir/press -I$srcdir/libwcs" tclsources=`cd $srcdir; echo library/*.tcl` TEA_ADD_SOURCES([${csources}]) TEA_ADD_HEADERS([${cheaders}]) TEA_ADD_INCLUDES([$cincludes]) TEA_ADD_LIBS([$tclutil_BUILD_LIB_SPEC ${BLT_LIB_SPEC} ${CFITSIO_LIB_SPEC}]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([]) TEA_ADD_TCL_SOURCES([${tclsources}]) #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then AC_DEFINE(BUILD_astrotcl, 1, [Build windows export dll]) CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi AC_SUBST(CLEANFILES) #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- TEA_PUBLIC_TCL_HEADERS #TEA_PRIVATE_TCL_HEADERS TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS #-------------------------------------------------------------------- # Find the CFITSIO library. #-------------------------------------------------------------------- ASTROTCL_PATH_CFITSIO TEA_ADD_LIBS([${CFITSIO_LIB_SPEC}]) #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- # allan: can't use stubs, due to BLT dependency #AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- TEA_MAKE_LIB #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- TEA_PROG_TCLSH TEA_PROG_WISH #-------------------------------------------------------------------- # These are for astrotclConfig.sh #-------------------------------------------------------------------- astrotcl_LIB_FILE=${PKG_LIB_FILE} eval pkglibdir="${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval astrotcl_LIB_FLAG="-lastrotcl${PACKAGE_VERSION}" else eval astrotcl_LIB_FLAG="-lastrotcl`echo ${PACKAGE_VERSION} | tr -d .`" fi astrotcl_BUILD_DIR="`pwd`" astrotcl_BUILD_LIB_SPEC="-L`pwd` ${astrotcl_LIB_FLAG}" astrotcl_LIB_SPEC="-L${pkglibdir} ${astrotcl_LIB_FLAG}" for i in ${PKG_OBJECTS} ; do astrotcl_PKG_OBJECTS="$astrotcl_PKG_OBJECTS ../astrotcl/$i" done AC_SUBST(astrotcl_LIB_FILE) AC_SUBST(astrotcl_BUILD_DIR) AC_SUBST(astrotcl_BUILD_LIB_SPEC) AC_SUBST(astrotcl_LIB_SPEC) AC_SUBST(astrotcl_PKG_OBJECTS) # astrotcl_SRC_DIR must be a fully qualified path eval astrotcl_SRC_DIR="$srcdir" astrotcl_SRC_DIR=`cd "${astrotcl_SRC_DIR}"; pwd` AC_SUBST(astrotcl_SRC_DIR) #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- AC_OUTPUT([Makefile pkgIndex.tcl astrotclConfig.sh]) skycat-3.1.2-starlink-1b/astrotcl/doit000077500000000000000000000002411215713201500176520ustar00rootroot00000000000000#!/bin/sh set -x autoconf \ && configure --prefix=$HOME/work/eso/skycat/src/install --exec_prefix=$HOME/work/eso/skycat/src/install \ && make \ && make install skycat-3.1.2-starlink-1b/astrotcl/generic/000077500000000000000000000000001215713201500204045ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/astrotcl/generic/Astrotcl.C000066400000000000000000000041671215713201500223130ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: Astrotcl.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" * * Astrotcl.C - Initialize Astrotcl package * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 21 Nov 97 Created * pbiereic 26/08/99 Changed Astrotcl_Init() */ static const char* const rcsId="@(#) $Id: Astrotcl.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; #include #include #include #include #include #include #include #include #include #include #include #include "error.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" extern "C" int TclWorldCoords_Init(Tcl_Interp* interp); // Tcl procedure to search for an init for Astrotcl startup file. static char initScript[] = "if {[info proc ::util::Init]==\"\"} {\n\ namespace eval ::util {}\n\ proc ::util::Init {} {\n" #ifdef MAC_TCL " source -rsrc AstrotclInit.tcl\n" #else " global astrotcl_library\n\ tcl_findLibrary astrotcl " PACKAGE_VERSION " " PACKAGE_VERSION " AstrotclInit.tcl ASTROTCL_LIBRARY astrotcl_library\n" #endif " }\n\ }\n\ ::util::Init"; // dummy Tcl command implementation static int astrotcl_cmd(ClientData, Tcl_Interp* interp, int argc, char** argv) { return TCL_OK; } /* * A call to this function is made from the tkAppInit file at startup * to initialize this package */ extern "C" int Astrotcl_Init(Tcl_Interp* interp) { char buf[1024]; static int initialized = 0; if (initialized++) return TCL_OK; // set up Tcl package if (Tcl_PkgProvide (interp, "Astrotcl", PACKAGE_VERSION) != TCL_OK) { return TCL_ERROR; } // add a dummy tcl command (this command doesn't do anything currently) Tcl_CreateCommand(interp, "astrotcl", (Tcl_CmdProc*)astrotcl_cmd, NULL, NULL); // add the wcs command TclWorldCoords_Init(interp); // Set the global Tcl variable astrotcl_version Tcl_SetVar(interp, "astrotcl_version", PACKAGE_VERSION, TCL_GLOBAL_ONLY); return Tcl_Eval(interp, initScript); } skycat-3.1.2-starlink-1b/astrotcl/generic/DCompress.C000066400000000000000000000136361215713201500224200ustar00rootroot00000000000000 /* * E.S.O. - VLT project/ESO Archive * $Id: DCompress.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * Compress.C - method definitions for class Compress * (based on Archive/CADC press routines) * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 2 Aug 96 Created * 2 Jan 06 Renamed file to avoid name conflict with fitsio's * "compress.c" on file systems that ignore case. */ static const char* const rcsId="@(#) $Id: DCompress.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; #include #include #include #include #include #include #include #include #include #include "error.h" #include "Mem.h" #include "DCompress.h" extern "C" { #include "gen_types.h" #include "press.h" } // must correspond to enum CompressType static char* types_[] = {(char *)"NONE", (char *)"UCMP", (char *)"HCMP", (char *)"ULDA", (char *)"GZIP"}; /* * local util to report an error */ static int compress_error(int compress_flag) { if (compress_flag) return error("could not compress data: ", pr_msg); else return error("could not decompress data: ", pr_msg); } /* * compress (or decompress) from read_fd and write results to write_fd * If compress_flag is true, compress, otherwise decompress the file. */ int Compress::compress(int read_fd, int write_fd, CompressType ctype, int compress_flag) { if (ctype == NO_COMPRESS) { // no compression ? just copy int n; char buf[8*1024]; while((n = read(read_fd, buf, sizeof(buf))) > 0) { write(write_fd, buf, n); } return 0; } char* type = types_[ctype]; int status = (compress_flag ? press_f2f(read_fd, write_fd, type) : unpress_f2f(read_fd, write_fd, type)); if (status != 0) return compress_error(compress_flag); return 0; } /* * compress (or decompress) infile using the given compress type and * put the results in outfile. * If compress_flag is true, compress, otherwise decompress the file. * If mmap_flag is true, use mmap to map the file to memory. * * Note: we can just open the file and use the fd, but the "press" C * routines do unbuffered I/O on each char, which is slow. We can * mmap the file to memory and use the "mem to mem" version to improve * speed somewhat... */ int Compress::compress(const char* infile, const char* outfile, CompressType ctype, int compress_flag, int mmap_flag) { if (ctype == NO_COMPRESS) return 0; int status = 0; char* type = types_[ctype]; int write_fd = open(outfile, O_WRONLY|O_CREAT|O_TRUNC, 0777); if (write_fd < 0 ) { return sys_error("can't create output file: ", outfile); } if (mmap_flag) { // map input file to memory Mem inbuf(infile); if (inbuf.status() != 0) { close(write_fd); return ERROR; } unsigned char* outbuf = NULL; int outsize = inbuf.size(); int factor = 2; // estimated comp/decomp factor if (compress_flag) { outsize /= factor; status = press_m2m((unsigned char*)inbuf.ptr(), inbuf.size(), &outbuf, &outsize, type); } else { outsize *= factor; status = unpress_m2m((unsigned char*)inbuf.ptr(), inbuf.size(), &outbuf, &outsize, type); } if (status == 0) { if (write(write_fd, outbuf, outsize) != outsize) status = 1; close(write_fd); free(outbuf); if (status != 0) return sys_error("error writing file: ", outfile); } } else { // use standard read/write sys calls int read_fd = open(infile, O_RDONLY); if (read_fd < 0 ) { close(write_fd); return sys_error("can't open file: ", infile); } status = (compress_flag ? press_f2f(read_fd, write_fd, type) : unpress_f2f(read_fd, write_fd, type)); close(read_fd); close(write_fd); } if (status != 0) return compress_error(compress_flag); return 0; } /* * compress (decompress) the file in place using the given compress type. * If compress_flag is true, compress, otherwise decompress the file. */ int Compress::compress(const char* file, CompressType ctype, int compress_flag, int mmap_flag) { char tmpfile[1024]; sprintf(tmpfile, "%s.comp", file); int status = compress(file, tmpfile, ctype, compress_flag, mmap_flag); if (status != 0) { unlink(tmpfile); return status; } if (rename(tmpfile, file) != 0) return sys_error("rename failed for: ", file); return 0; } /* * compress (or decompress) the contents of inbuf using the given compress type and * allocate the results to outbuf. * * - inbufsz is the size of the input buffer. * * - outbufsz is an estimate of the outbuf size on input and the actual size * on output. * * If compress_flag is true, compress, otherwise decompress the file. * * It is the caller's responsibility to free() the outbuf when no longer needed. */ int Compress::compress(const char* inbuf, int inbufsz, char*& outbuf, int& outbufsz, CompressType ctype, int compress_flag) { if (ctype == NO_COMPRESS) return 0; char* type = types_[ctype]; int status = (compress_flag ? press_m2m((unsigned char*)inbuf, inbufsz, (unsigned char**)&outbuf, &outbufsz, type) : unpress_m2m((unsigned char*)inbuf, inbufsz, (unsigned char**)&outbuf, &outbufsz, type)); if (status != 0) return compress_error(compress_flag); return 0; } /* * Optionally set global compress options. * The first argument indicates the compression type. * "scale" is supported by gzip and h_compress. * "do_smoothing" (boolean) is only supported for h_compress. */ int Compress::set_options(CompressType ctype, int scale, int do_smoothing) { char* type = types_[ctype]; switch(ctype) { case H_COMPRESS: press_setopt(type, 0, do_smoothing, scale, "fits", 0, 0); break; case GZIP_COMPRESS: press_setopt(type, 0, scale); break; default: break; } return 0; } skycat-3.1.2-starlink-1b/astrotcl/generic/DCompress.h000066400000000000000000000051401215713201500224540ustar00rootroot00000000000000// -*-c++-*- #ifndef _Compress_h_ #define _Compress_h_ /* * E.S.O. - VLT project * $Id: DCompress.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * DCompress.h - utility class for compressing/decompressing FITS files * * (wrapper for archive/CADC "press" routines) * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 2 Aug 96 Created * 2 Jan 06 Renamed file to avoid name conflict with fitsio's * "compress.h" on file systems that ignore case. */ /* * Class Compress * */ class Compress { protected: public: // constructor Compress() {} // types of compression enum CompressType { NO_COMPRESS, // no compression UNIX_COMPRESS, // Compressed FITS file (UNIX) H_COMPRESS, // Hcompressed FITS file ULDA_COMPRESS, // ULDA compressed FITS file GZIP_COMPRESS // GZIPed FITS file }; // compress (or decompress) from read_fd and write results to write_fd int compress(int read_fd, int write_fd, CompressType type, int compress_flag = 1); // decompress from read_fd and write results to write_fd int decompress(int read_fd, int write_fd, CompressType type) { return compress(read_fd, write_fd, type, 0); } // compress (or decompress) infile and put the result in outfile int compress(const char* infile, const char* outfile, CompressType type, int compress_flag = 1, int mmap_flag = 1); // decompress infile and put the result in outfile int decompress(const char* infile, const char* outfile, CompressType type, int mmap_flag = 1) { return compress(infile, outfile, type, 0, mmap_flag); } // compress (or decompress) the file in place int compress(const char* file, CompressType type, int compress_flag = 1, int mmap_flag = 1); // decompress the file in place int decompress(const char* file, CompressType type, int mmap_flag = 1) { return compress(file, type, 0, mmap_flag); } // compress (or decompress) inbuf and allocate results in outbuf int compress(const char* inbuf, int inbufsz, char*& outbuf, int& outbufsz, CompressType ctype, int compress_flag = 1); // decompress inbuf and allocate results in outbuf int decompress(const char* inbuf, int inbufsz, char*& outbuf, int& outbufsz, CompressType ctype) { return compress(inbuf, inbufsz, outbuf, outbufsz, ctype, 0); } // optionally set global compress options for scale and smoothing static int set_options(CompressType ctype, int scale = 10, int do_smoothing = 0); }; #endif /* _Compress_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/FitsIO.C000066400000000000000000001532151215713201500216540ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: FitsIO.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" * * FitsIO.C - method definitions for class FitsIO, for operating on * Fits files. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * P.Biereichel 18/07/96 put_keyword char version added for SIMPLE. BITPIX=-16 fixed * Allan Brighton 16/02/98 renamed check_decompress to check_compress and added check * for bitpix=16 for H_COMPRESS. * 12/03/98 Initialize WCS in constructor. * Peter W. Draper 26/01/00 Now adds SIMPLE=T when saving extensions. * Made strftime call Y2K compliant. * Peter W. Draper 04/02/00 Changed constness of write so that * non-const member can be used within this * member. * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. * pbiereic 20/07/04 use %20 field width for keywords in methods put_keyword, * so that other tools like xv, ds9, fv can read stored real-time * images. * abrighto 02/01/05 Renamed .h file to avoid conflict with cfitsio's * "fitsio.h" on case-ignoring file systems, such as * Mac OSX. * Peter W. Draper 05/01/07 Set OBJECT card to value "RTD_BLANK" to determine * that a blank image has been generated. * 08/01/07 Write "END" keyword to blank image headers stream. * Previously written to buffer only. * 01/03/07 Added putcard method for pre-formatted cards. * Peter W. Draper 24/04/07 Handle table columns with K format, that's * TLONGLONG. * 22/05/07 Extend getTableValue so that the value can be scaled * (so that radian table values can be converted into degrees. * Needed for sky coordinates). Could do with a more * general system to determine which columns should * be converted (using the catalogue info?). * 23/05/07 Return compressed images (of the inline type * stored in an extension, RICE etc.) as binary * tables. As images they are garbled anyway. * (GAIA spots this and decompresses them). * 24/06/08 Remove restriction that requires a backing file * when moving HDU. This operation can be done * on memory FITS. * 27/08/08 Use DBL_DIG and FLT_DIG to encode double and * float values so that we do not lose any precision. * 16/03/09 Add getComment function to get the comment * part of a card. * 30/06/09 Check that the length of a opening file is not * less than expected. If true return a NULL in * reallocFile rather than the given pointer. This * protects against opening truncated files. * pbiereic 10/07/07 FitsIO::reallocFile returns the client data pointer when there * is no current FitsIO object. * pbiereic 10/08/07 FitsIO::write: using ISO date string (VLTSW20070156) * pbiereic 12/08/07 added support for data types double and long long int * pbiereic 07/09/07 added support for tiled-image compressed files * pbiereic 26/11/08 FitsIO::write: add basic FITS keys to HDU data */ static const char* const rcsId="@(#) $Id: FitsIO.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; #include #include #include #include #include #include #include #include #include #include #include #include "util.h" #include "error.h" #include "fitsio2.h" #include "SAOWCS.h" #include "DCompress.h" #include "Mem.h" #include "Fits_IO.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" using namespace std; // The type "long" may have 64 bits. #if LONGSIZE == 64 #define FITS_ULONG unsigned long #define FITS_UINT unsigned int #else #define FITS_ULONG unsigned long long #define FITS_UINT unsigned long #endif // size of a FITS block enum {FITSBLOCK=2880}; // common error message const char* noFitsErrMsg = "No FITS file is currently open"; const char* noHdrErrMsg = "Can't get keyword: no FITS header."; // local buffer used to return keyword and table values static char buf_[1024]; // "current" FitsIO object pointer, needed for cfitsio realloc callback FitsIO* FitsIO::fits_ = NULL; // length of memory mapped for current FitsIO object, needed for realloc // callback checks. size_t FitsIO::length_ = 0; /* * constructor: initialize from the given header and data objects * and, optionally, the cfitsio handle used to open the file. * * Note: the public interface is normally via FitsIO::read(), * when reading from a file. This constructor may be usefull * though when creating a FitsIO object from memory data. */ FitsIO::FitsIO(int width, int height, int bitpix, double bzero, double bscale, const Mem& header, const Mem& data, fitsfile* fitsio) : ImageIORep(width, height, bitpix, bzero, bscale, header, data), fitsio_(fitsio) { // Save a reference to the primary header primaryHeader_ = header; // ref counted copy } /* * Destructor: close the cfitsio object */ FitsIO::~FitsIO() { if (fitsio_) { int status = 0; if (fits_close_file(fitsio_, &status) != 0) cfitsio_error(); fitsio_ = NULL; } } /* * Return a copy of this object that shares the data, but can have a different current HDU */ FitsIO* FitsIO::copy() { int status = 0; fitsfile* newFitsio; fits_reopen_file(fitsio_, &newFitsio, &status); if (status != 0) return NULL; return new FitsIO(width_, height_, bitpix_, bzero_, bscale_, header_, data_, newFitsio); } /* * initialize world coordinates (based on the image header) */ int FitsIO::wcsinit() { // if there are multiple HDUs, merge the primary header with // the extension header to get all of the WCS info // (requested by Andreas Wicenec ). if (getNumHDUs() > 1) { int length = header_.length() + primaryHeader_.length(); mergedHeader_ = Mem(length+1, 0); if (mergedHeader_.status() == 0) { strncpy((char*)mergedHeader_.ptr(), (char*)header_.ptr(), header_.length()); strncpy(((char*)mergedHeader_.ptr())+header_.length(), (char*)primaryHeader_.ptr(), primaryHeader_.length()); ((char*)mergedHeader_.ptr())[length] = '\0'; wcs_ = WCS(new SAOWCS((const char*)mergedHeader_.ptr(), length)); return wcs_.status(); } } wcs_ = WCS(new SAOWCS((const char*)header_.ptr(), header_.length())); return wcs_.status(); } /* * create and return a temporary file with a copy of stdin. * The argument is a char array large enough to hold the filename. */ static char* getFromStdin(char* filename) { sprintf(filename, "/tmp/fits%d", getpid()); FILE* f = fopen(filename, "w"); if (!f) { sys_error("could not create temp file: ", filename); return NULL; } char buf[1024]; size_t n; while((n = fread(buf, 1, sizeof(buf), stdin)) > 0) { if (fwrite(buf, 1, n, f) != n) { sys_error("error writing temp file: ", filename); return NULL; } } fclose(f); return filename; } /* * Check if the given file has a suffix that indicates a known * compression type, and if so, compress or decompress the file, * depending on the value of decompress_flag. * * The suffixes recognized correspond to the http Content-types: * * hfits: for H-Compress * gfits, gzfits, gz: for GZIP * cfits, Z: for UNIX compress. * * If istemp is true on entry, filename is overwritten with the * decompressed version. In any case, if any (de)compression is done, * the output is written to a temp file and "istemp" is set to 1. * * The return value is the name of the file, possibly after decompression. * The "buf" argument gives the space for the temporary filename, if * needed. The last argument is the value of "bitpix", if known, or * 0. This is used to check for the correct file type for h_compress, * which only works on 16 bit FITS files. */ const char* FitsIO::check_compress(const char* filename, char* buf, int bufsz, int& istemp, int decompress_flag, int bitpix) { // check the file extension for recognized compression types const char* suffix = strrchr(filename, '.'); if (suffix) suffix++; else suffix = ""; Compress::CompressType ctype = Compress::NO_COMPRESS; if (strcmp(suffix, "hfits") == 0) { if (bitpix && abs(bitpix) != 16) { error("H-compress is only allowed for 16 bit FITS images"); if (istemp) unlink(filename); return NULL; } ctype = Compress::H_COMPRESS; } else if (strcmp(suffix, "gfits") == 0 || strcmp(suffix, "gzfits") == 0 || strcmp(suffix, "gz") == 0) { ctype = Compress::GZIP_COMPRESS; } else if (strcmp(suffix, "cfits") == 0 || strcmp(suffix, "Z") == 0) { ctype = Compress::UNIX_COMPRESS; } if (ctype != Compress::NO_COMPRESS) { Compress c; char tmpfile[1024]; static int count = 0; // for unique filename int status = 0; if (decompress_flag) { // don't use file's dir when decompressing, since it might not be writable sprintf(tmpfile, "/tmp/fio-%s-%d.%d.fits", getenv("USER"), getpid(), count++); // unique filename status = c.decompress(filename, tmpfile, ctype); } else { // use file's dir when compressing, so that rename() is possible sprintf(tmpfile, "%s.tmp", filename); status = c.compress(filename, tmpfile, ctype); } if (istemp || status != 0) unlink(filename); if (status != 0) return NULL; istemp = 1; strncpy(buf, tmpfile, bufsz); return buf; } return filename; } /* * Check if FITS binary table extension contains a compressed image */ const char* FitsIO::check_cfitsio_compress(char* filename, char* buf, int bufsz, int& istemp) { fitsfile* fitsio = NULL; int num = 0, zimage = 0, status = 0; fits_open_file(&fitsio, filename, READONLY, &status); if (status != 0) { cfitsio_error(); return NULL; } if (fits_get_num_hdus(fitsio, &num, &status) != 0) { cfitsio_error(); fits_close_file(fitsio, &status); return NULL; } if (num < 2) { fits_close_file(fitsio, &status); return filename; // no binary table } if (fits_movrel_hdu(fitsio, 1, NULL, &status) != 0) { // move to next HDU cfitsio_error(); fits_close_file(fitsio, &status); return NULL; } fits_read_key(fitsio, TLOGICAL, (char *)"ZIMAGE", &zimage, NULL, &status); // check compressed image fits_close_file(fitsio, &status); if (!zimage) return filename; // no binary table char tmpfile[1024]; static int count = 0; // for unique filename sprintf(tmpfile, "/tmp/cfio-%s-%d.%d.fits", getenv("USER"), getpid(), count++); // unique filename unlink(tmpfile); if (imcopy((char *)filename, tmpfile) != 0) { unlink(tmpfile); return NULL; } istemp = 1; strncpy(buf, tmpfile, bufsz); return buf; } /* * Read a FITS file and return an initialized FitsIO object for it, * or NULL if there are errors. * * If filename is "-", stdin is read into a temp image file and used as the input. * * The Mem class is used to speed up loading the file. The optional mem_options * control whether the memory is mapped read-only or read/write (see class Mem). */ FitsIO* FitsIO::read(const char* filename, int mem_options) { char tmpfile[1024], tmpfile2[1024], cfile[1024]; int istemp = 0, istemp2 = 0; tmpfile[0] = '\0'; if (strcmp(filename, "-") == 0) { // use stdin // we have to use seek later, so copy to a temp file first filename = getFromStdin(tmpfile); if (filename == NULL) return NULL; istemp++; } // check the file extension for recognized compression types filename = check_compress(filename, tmpfile, (int)sizeof(tmpfile), istemp, 1, 0); if (filename == NULL) { if (istemp) unlink(tmpfile); return NULL; } // check if the file is internally tiled-image compressed (cfitsio) if (!istemp) strcpy(cfile, (char *)filename); else strcpy(cfile, tmpfile); filename = check_cfitsio_compress(cfile, tmpfile2, sizeof(tmpfile2), istemp2); if (filename == NULL) { if (istemp) unlink(tmpfile); if (istemp2) unlink(tmpfile2); return NULL; } // map image file to memory to speed up image loading if (mem_options == 0 && access(filename, W_OK) == 0) mem_options = Mem::FILE_RDWR; Mem header(filename, mem_options, 0); if (header.status() != 0) return NULL; if (istemp) { unlink(filename); // will be deleted by the OS later } if (istemp2) { unlink(tmpfile2); } if (header.status() != 0) return NULL; return initialize(header); } /* * Report a cfitsio error */ int FitsIO::cfitsio_error() { char buf[81]; ostringstream os; int i = 0; while (fits_read_errmsg(buf)) { os << buf << endl; i++; } fits_clear_errmsg(); if (i) { error("cfitsio: ", os.str().c_str()); } return ERROR; } /* * This static method is called by the cfitsio routines when the size of the file * has to be increased, such as when adding a new FITS block or table to the file. * Since a client data pointer is not part of the interface, we use the "current" * FitsIO object, set before any operations that could result in a call to this * method. */ void* FitsIO::reallocFile(void* p, size_t newsize) { if (!fits_) { if ( length_ != 0 && newsize > length_ ) { return NULL; } return p; } if (fits_->checkWritable() != 0) return NULL; // not a writable FITS file // OK, we have a writable FITS file. Extend the size, remap and // return the mmap pointer. Mem m = fits_->header_; m.offset(0); if (newsize <= m.size()) return p; m.unmap(); if (m.remap(m.options(), newsize) != 0) return NULL; // error return m.ptr(); } /* * This static method returns a cfitsio handle, given the Mem object for the * FITS header. */ fitsfile* FitsIO::openFitsMem(Mem& header) { // filename for error reporting const char* filename = header.filename(); int rw_flag = 0; // true if memory can be written to if (filename) { rw_flag = ((header.options() & Mem::FILE_RDWR) != 0); } else { filename = "FitsIO"; rw_flag++; } // use the cfitsio library routines to access the file in memory fitsfile* fitsio = NULL; int status = 0; // cfitsio wants to have (and save) pointers to the data pointer and size, // so we have to provide the address of these by accessing the internal // MemRep class in the header object. // XXX (make sure the values are not actually modified...) MemRep* mrep = (MemRep*)header.rep(); FitsIO::length_ = mrep->size; if (fits_open_memfile(&fitsio, filename, rw_flag, &mrep->ptr, &mrep->size, FITSBLOCK, FitsIO::reallocFile, &status) != 0) { FitsIO::length_ = 0; cfitsio_error(); return NULL; } FitsIO::length_ = 0; return fitsio; } /* * Copy a compressed input image to an uncompressed output image. * The code for this method was taken from imcopy.c (cfitsio) */ int FitsIO::imcopy(char *infile, char *outfile) { fitsfile *infptr, *outfptr; /* FITS file pointers defined in fitsio.h */ int status = 0, ii = 1, iteration = 0, hdupos, extend = 0; int hdutype, bitpix, bytepix, naxis = 0, nkeys, datatype = 0, anynul, num = 0; long naxes[9] = {1, 1, 1, 1, 1, 1, 1, 1, 1}; long first, totpix = 0, npix; double *array, bscale = 1.0, bzero = 0.0, nulval = 0.; char card[81]; /* Open the input file and create output file */ fits_open_file(&infptr, infile, READONLY, &status); if (status != 0) { cfitsio_error(); return status; } fits_create_file(&outfptr, outfile, &status); if (status != 0) { cfitsio_error(); return status; } fits_get_num_hdus(infptr, &num, &status); fits_get_hdu_num(infptr, &hdupos); /* Get the current HDU position */ get(infptr, "NAXIS", naxis); get(infptr, "EXTEND", extend); if (naxis == 0 && extend && num == 2) { // check if image is contained in the 2'nd HDU fits_movrel_hdu(infptr, 1, NULL, &status); // move to next HDU } for (; !status; hdupos++) /* Main loop through each extension */ { fits_get_hdu_type(infptr, &hdutype, &status); if (hdutype == IMAGE_HDU) { /* get image dimensions and total number of pixels in image */ for (ii = 0; ii < 9; ii++) naxes[ii] = 1; fits_get_img_param(infptr, 9, &bitpix, &naxis, naxes, &status); totpix = naxes[0] * naxes[1] * naxes[2] * naxes[3] * naxes[4] * naxes[5] * naxes[6] * naxes[7] * naxes[8]; } if (hdutype != IMAGE_HDU || naxis == 0 || totpix == 0) { /* just copy tables and null images */ fits_copy_hdu(infptr, outfptr, 0, &status); } else { /* Explicitly create new image, to support compression */ fits_create_img(outfptr, bitpix, naxis, naxes, &status); if (status) { cfitsio_error(); return(status); } /* copy all the user keywords (not the structural keywords) */ fits_get_hdrspace(infptr, &nkeys, NULL, &status); for (ii = 1; ii <= nkeys; ii++) { fits_read_record(infptr, ii, card, &status); if (fits_get_keyclass(card) > TYP_CMPRS_KEY) fits_write_record(outfptr, card, &status); } switch(bitpix) { case BYTE_IMG: datatype = TBYTE; break; case SHORT_IMG: datatype = TSHORT; break; case LONG_IMG: datatype = TINT; break; case FLOAT_IMG: datatype = TFLOAT; break; case LONGLONG_IMG: datatype = TLONGLONG; break; case DOUBLE_IMG: datatype = TDOUBLE; break; } bytepix = abs(bitpix) / 8; npix = totpix; iteration = 0; /* try to allocate memory for the entire image */ /* use double type to force memory alignment */ array = (double *) calloc(npix, bytepix); /* if allocation failed, divide size by 2 and try again */ while (!array && iteration < 10) { iteration++; npix = npix / 2; array = (double *) calloc(npix, bytepix); } if (!array) { printf("Memory allocation error\n"); return(0); } /* turn off any scaling so that we copy the raw pixel values */ fits_set_bscale(infptr, bscale, bzero, &status); fits_set_bscale(outfptr, bscale, bzero, &status); first = 1; while (totpix > 0 && !status) { /* read all or part of image then write it back to the output file */ fits_read_img(infptr, datatype, first, npix, &nulval, array, &anynul, &status); fits_write_img(outfptr, datatype, first, npix, array, &status); totpix = totpix - npix; first = first + npix; } free(array); } fits_movrel_hdu(infptr, 1, NULL, &status); /* try to move to next HDU */ } if (status == END_OF_FILE) status = 0; /* Reset after normal error */ fits_close_file(outfptr, &status); fits_close_file(infptr, &status); if (status) cfitsio_error(); /* if error occurred, show error message */ return status; } /* * Check that this object represents a FITS file (and not just some kind of memory) * and return 0 if it does. If not, return an error message. */ int FitsIO::checkFitsFile() { // For now, only support extending headers in mmap'ed FITS files if (!fitsio_ || (! (header_.filename() && data_.filename() && strcmp(header_.filename(), data_.filename()) == 0))) { return error("FitsIO: Operation not allowed on memory image"); } return 0; } /* * This static method returns an allocated FitsIO object given a Mem object * containing the data for the file. (header points to the data for the entire * file...). */ FitsIO* FitsIO::initialize(Mem& header) { fitsfile* fitsio = openFitsMem(header); if (!fitsio) return NULL; LONGLONG headStart = 0, dataStart = 0, dataEnd = 0; int status = 0; if (fits_get_hduaddrll(fitsio, &headStart, &dataStart, &dataEnd, &status) != 0) { cfitsio_error(); return NULL; } if (header.length() < (dataEnd - headStart)) { const char* filename = header.filename(); if (filename) log_message("FITS file has the wrong size (too short): %s", filename); else log_message("FITS data has the wrong size (too short)"); // return NULL; } // The data part is the same mmap area as the header, with an offset Mem data(header); header.length(dataStart - headStart); // set usable length of header data.offset(dataStart); // set offset for data data.length(dataEnd-dataStart); return initialize(header, data, fitsio); } /* * This static method returns an allocated FitsIO object, given the cfitsio * handle. */ FitsIO* FitsIO::initialize(Mem& header, Mem& data, fitsfile* fitsio) { int bitpix = 0, width = 0, height = 0; double bzero = 0.0, bscale = 1.0; get(fitsio, "NAXIS1", width); get(fitsio, "NAXIS2", height); get(fitsio, "BITPIX", bitpix); get(fitsio, "BSCALE", bscale); get(fitsio, "BZERO", bzero); return new FitsIO(width, height, bitpix, bzero, bscale, header, data, fitsio); } /* * This static method returns an allocated FitsIO object given the * header and data. */ FitsIO* FitsIO::initialize(Mem& header, Mem& data) { fitsfile* fitsio = openFitsMem(header); if (!fitsio) return NULL; return initialize(header, data, fitsio); } /* * Generate a blank image with a FITS header based on the given fields. * The arguments are the position as ra, dec, equinox in double degrees, * the radius in arcmin, the width and height in pixels and the color * to use for the image (the color value for black, for example). * * If ra < 0, no world coordinate info is added to the header. This will * create just a blank image with no WCS. * */ FitsIO* FitsIO::blankImage(double ra, double dec, double equinox, double radius, int width, int height, unsigned long color0) { // generate the fits data if (width <= 0 || height <= 0) { error("width and height must be positive integers"); return NULL; } Mem data(width*height, 0); if (data.status() != 0) return NULL; char* d = (char*)data.ptr(); memset(d, color0, width*height); Mem header(FITSBLOCK, 0); // more than large enough to hold the fields below if (header.status() != 0) return NULL; ostringstream os; // generate the fits header double r = radius/60.0; // radius in degrees put_keyword(os, "SIMPLE", (char *)"T"); //FITS header put_keyword(os, "BITPIX", 8); // No.Bits per pixel put_keyword(os, "NAXIS ", 2); // No.dimensions put_keyword(os, "NAXIS1", width); // Length X axis put_keyword(os, "NAXIS2", height); // Length Y axis // this causes the pixels to appear black (if the colormap starts with black) put_keyword(os, "DATAMIN", int(color0)); // min color put_keyword(os, "DATAMAX", int(color0+256)); // (theoretical) max color if (ra >= 0) { double cdelt2 = sqrt((r*r)/2.0)/(width/2.0); double cdelt1 = -cdelt2; put_keyword(os, "CTYPE1", (char *)"RA---TAN"); // R.A. in tangent plane projection put_keyword(os, "CTYPE2", (char *)"DEC--TAN"); // DEC. in tangent plane projection put_keyword(os, "CRPIX1", width/2+0.5); // Refpix of first axis put_keyword(os, "CRPIX2", height/2+0.5); // Refpix of second axis put_keyword(os, "CRVAL1", ra); // RA at Ref pix in decimal degrees put_keyword(os, "CRVAL2", dec); // DEC at Ref pix in decimal degrees put_keyword(os, "CDELT1", cdelt1); // RA pixel step (deg) put_keyword(os, "CDELT2", cdelt2); // DEC pixel step (deg) put_keyword(os, "EQUINOX", 2000.0); // default equinox put_keyword(os, "RADECSYS", (char *)"FK5"); // J2000... } // add a keyword so we can determine this image is blank put_keyword(os, "OBJECT", (char *) "RTD_BLANK"); //put_keyword(os, "BLANK", (int)color0); // blank pixel value char buf[81]; sprintf(buf, "%-80s", "END"); // mark the end of the header os << buf; strncpy((char*)header.ptr(), os.str().c_str(), header.length()); // write to shared memory // generate the blank image return new FitsIO(width, height, BYTE_IMAGE, 0.0, 1.0, header, data); } /* * write the keyword/value pair to the given stream. * (char* value version) */ int FitsIO::put_keyword(ostream& os, const char* keyword, char* value) { char buf1[81], buf2[81]; sprintf(buf1, "%-8s= '%s'", keyword, value); sprintf(buf2, "%-80s", buf1); os << buf2; return 0; } /* * write the keyword/value pair to the given stream. * (char value version) */ int FitsIO::put_keyword(ostream& os, const char* keyword, char value) { char buf1[81], buf2[81]; sprintf(buf1, "%-8s= %20c", keyword, value); sprintf(buf2, "%-80s", buf1); os << buf2; return 0; } /* * write the keyword/value pair to the given stream. * (int value version) */ int FitsIO::put_keyword(ostream& os, const char* keyword, int value) { char buf1[81], buf2[81]; sprintf(buf1, "%-8s= %20d", keyword, value); sprintf(buf2, "%-80s", buf1); os << buf2; return 0; } /* * write the keyword/value pair to the given stream. * (double value version) */ int FitsIO::put_keyword(ostream& os, const char* keyword, double value) { char buf1[81], buf2[81]; sprintf(buf1, "%-8s= %20f", keyword, value); sprintf(buf2, "%-80s", buf1); os << buf2; return 0; } /* * write the keyword/value pair to the given open file descriptor. * (int value version) */ int FitsIO::put_keyword(FILE* f, const char* keyword, int value) { char buf[81]; sprintf(buf, "%-8s= %20d", keyword, value); fprintf(f, "%-80s", buf); return 0; } /* * write the keyword/value pair to the given open file descriptor. * (double value version) */ int FitsIO::put_keyword(FILE* f, const char* keyword, double value) { char buf[81]; sprintf(buf, "%-8s= %20f", keyword, value); fprintf(f, "%-80s", buf); return 0; } /* * write the keyword/value pair to the given open file descriptor. * (char* value version) */ int FitsIO::put_keyword(FILE* f, const char* keyword, const char* value) { char buf[81]; sprintf(buf, "%-8s= '%s'", keyword, value); fprintf(f, "%-80s", buf); return 0; } /* * write the keyword/value pair to the given open file descriptor. * (char value version) */ int FitsIO::put_keyword(FILE* f, const char* keyword, char value) { char buf[81]; sprintf(buf, "%-8s= %20c", keyword, value); fprintf(f, "%-80s", buf); return 0; } /* * round off the file size to the next FITS block. * (size is the current size) */ void FitsIO::padFile(FILE* f, int size) { int rest = (size + FITSBLOCK) % FITSBLOCK; if (rest) { while (rest < FITSBLOCK) { fputc(' ', f); rest++; } } } /* * write a fits file from the data and header, if present */ int FitsIO::write(const char *filename) { char tmpfilename[1024]; int istemp = 1; if (fitsio_) { // flush any changes done in a memory FITS file int status = 0; if (fits_flush_file(fitsio_, &status) != 0) return cfitsio_error(); } // if the file exists, rename it to make a backup and to avoid // crashing if we have the file mapped already if (access(filename, F_OK) == 0) { char backup[1024]; sprintf(backup, "%s.BAK", filename); if (rename(filename, backup) != 0) return sys_error("can't create backup file for ", filename); } FILE *f; f = fopen(filename,"w"); if (f == NULL) return error("can't create FITS file: ", filename); // if we have a FITS header, use it, otherwise create one from what we know // and add some "blank cards" at the end for application use int header_length = header_.length(); if ( header_length > 0 ) { char *nextrec = (char *)header_.ptr(); if ( getNumHDUs() > 1 && getHDUNum() != 1 ) { // Saving an image stored in an extension, so need to add // the "SIMPLE" keyword and remove the "XTENSION" one. put_keyword(f, "SIMPLE", 'T'); nextrec += 80; } fwrite((char *)nextrec, 1, header_length, f); padFile(f, header_length); } else { // create a FITS header int size = FITSBLOCK/80; // number of keyword lines in FITS header, including END // output keywords put_keyword(f, "SIMPLE", 'T'); size--; int bitpix = bitpix_; if (bitpix == -16) bitpix = 16; put_keyword(f, "BITPIX", bitpix); size--; put_keyword(f, "NAXIS", 2); size--; put_keyword(f, "NAXIS1", width_); size--; put_keyword(f, "NAXIS2", height_); size--; if (bitpix_ == -16) { put_keyword(f, "BZERO", (double)32768.0); size--; put_keyword(f, "BSCALE", (double)1.0); size--; } put_keyword(f, "COMMENT", "Generated by FitsIO::write"); size--; // add a timestamp char buf2[50]; time_t clock = time(0); strftime(buf2, sizeof(buf2), "%Y-%m-%dT%H:%M:%S", localtime(&clock)); put_keyword(f, "DATE", buf2); size--; // leave some "blank cards" for later modification by other applications char buf[10]; int i = 0; while (size > 1) { sprintf(buf, "BLANK%02d", ++i); put_keyword(f, buf, " "); size--; } fprintf(f, "%-80s", "END"); // ... no need for padding, since we filled up the FITS block } // now write the image data int tsize = abs(bitpix_)/8; // size of a pixel value switch(bitpix_) { case -8: // note: special non-fits format for a saved XImage case 8: case 16: case 32: case -32: case 64: case -64: fwriteNBO((char*)data_.ptr(), tsize, width_*height_, f); break; case -16: { // unsigned short needs to be converted (conversion taken from Midas) unsigned short *pu = (unsigned short *)data_.ptr(); int i = width_*height_; short *ps_new = new short[i]; short *ps = ps_new; if (ps_new == 0) { fclose(f); return error("Not enough memory"); } int nn; if (BIGENDIAN == usingNetBO()) { // native byte order? while (i--) { nn = (int)(*pu++) - 32768; *ps++ = (unsigned int) nn; } } else { while (i--) { nn = (int)(SWAP16(*pu)) - 32768; *ps = (unsigned int) SWAP16(nn); pu++; ps++; } } fwriteNBO((char*)ps_new, tsize, width_*height_, f); delete ps_new; } break; default: fclose(f); return error("unsupported image type"); } // round off file size padFile(f, width_*height_*tsize); fclose(f); // check the file extension for recognized compression types const char *tmpfile = check_compress(filename, tmpfilename, (int)sizeof(tmpfilename), istemp, 0, bitpix_); if (tmpfile == NULL) return ERROR; if (strcmp(tmpfile, filename) != 0) { if (rename(tmpfile, filename) != 0) return sys_error("cannot rename to file ", filename); } return OK; } /* * Write data to disk (network byte ordered, NBO). * Byte swap is only needed when data are in shm and not * in BIGENDIAN. * Since data are passed as char* there is no automatic type * conversion by gcc. */ int FitsIO::fwriteNBO(char *data, int tsize, int size, FILE *f) const { int status; int n = size; if (tsize == 1 || usingNetBO()) { return fwrite(data, tsize, size, f); } Mem dbuf(size * tsize, 0); if (dbuf.status() != 0) return 0; if (tsize == 2) { unsigned short *from = (unsigned short *) data; unsigned short *to = (unsigned short *) dbuf.ptr(); while (n--) { *to++ = SWAP16(*from); from++; } } else if (tsize == 4) { FITS_UINT *from = (FITS_UINT *) data; FITS_UINT *to = (FITS_UINT *) dbuf.ptr(); while (n--) { *to++ = SWAP32(*from); from++; } } else if (tsize == 8) { FITS_ULONG *from = (FITS_ULONG *) data; FITS_ULONG *to = (FITS_ULONG *) dbuf.ptr(); while (n--) { *to++ = SWAP64(*from); from++; } } status = fwrite(dbuf.ptr(), tsize, size, f); return status; } /* * write a (ASCII formatted) copy of the FITS header to the given stream. * (format it in 80 char lines and replace any NULL chars with blanks) */ int FitsIO::getFitsHeader(ostream& os) const { string s((char*)header_.ptr(), header_.length()); istringstream is(s); char buf[81]; while(is.read(buf, 80)) { for (int i = 0; i < 80; i++) if (!isascii(buf[i])) buf[i] = ' '; buf[80] = '\n'; os.write(buf, 81); if (strncmp(buf, "END ", 8) == 0) break; } return 0; } /* * Check if we are inserting a new keyword or updating an existing one. * If inserting, make sure there is enough space in the header and, * if not, try to make space by enlarging the header. * Returns 0 if OK. */ int FitsIO::checkKeywordSpace(const char* keyword) { // make sure the file was mapped with write permission if (checkWritable() != 0) return 1; // error if (!get(keyword)) { // keyword not found in header? // see if there is room in the header for more keys int keysExist = 0, moreKeys = 0, status = 0; if (fits_get_hdrspace(fitsio_, &keysExist, &moreKeys, &status) != 0) return cfitsio_error(); // if there is no more room, make some room // (Normally cfitsio would do this automatically, but since we // may be using mmap, it is more complicated. if (moreKeys == 0 && extendHeader() != 0) return 1; } return 0; } /* * flush any memory changes to the file */ int FitsIO::flush() { int status = 0; fits_ = this; // reallocFile() might be called fits_flush_file(fitsio_, &status); fits_ = NULL; if (status != 0) return cfitsio_error(); return 0; } /* * Insert the given FITS header card and return 0 if OK. * If there is not enough space in the header, the file size is * automatically increased. */ int FitsIO::putcard(const char* card) { // make sure there is enough space in the header if (checkKeywordSpace(card) != 0) return 1; int status = 0; if (fits_write_record(fitsio_, card, &status) != 0) return cfitsio_error(); return flush(); } int FitsIO::put(const char* keyword, float val, const char* comment) { // make sure there is enough space in the header if (checkKeywordSpace(keyword) != 0) return 1; int status = 0; if (fits_update_key(fitsio_, TFLOAT, (char*)keyword, &val, (char*)comment, &status) != 0) return cfitsio_error(); return flush(); } int FitsIO::put(const char* keyword, int val, const char* comment) { // make sure there is enough space in the header if (checkKeywordSpace(keyword) != 0) return 1; int status = 0; if (fits_update_key(fitsio_, TINT, (char*)keyword, &val, (char*)comment, &status) != 0) return cfitsio_error(); return flush(); } int FitsIO::put(const char* keyword, const char* val, const char* comment) { // make sure there is enough space in the header if (checkKeywordSpace(keyword) != 0) return 1; int status = 0; if (fits_update_key(fitsio_, TSTRING, (char*)keyword, (char*)val, (char*)comment, &status) != 0) return cfitsio_error(); return flush(); } /* * extend the size of the FITS header by one header block and if the * header is part of an mmap'ed file, rewrite the file with the * new enlarged header. */ int FitsIO::extendHeader() { // Make sure we have a writable FITS file if (checkWritable() != 0) return 1; // error int status = 0; if (fits_write_comment(fitsio_, "FitsIO: added 1 block to header", &status) != 0) return cfitsio_error(); // calling flush will cause reallocFile() to be called if (flush() != 0) return 1; // error return setHDU(getHDUNum()); // reset header/data mem offsets } /* * get value for the given FITS keyword and return 0 if OK (found) */ int FitsIO::get(const char* keyword, double& val) const { if (! fitsio_) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio_, TDOUBLE, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(const char* keyword, float& val) const { if (! fitsio_) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio_, TFLOAT, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(const char* keyword, int& val) const { if (! fitsio_) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio_, TINT, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(const char* keyword, long& val) const { if (! fitsio_) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio_, TLONG, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(const char* keyword, LONGLONG& val) const { if (! fitsio_) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio_, TLONGLONG, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(const char* keyword, unsigned char& val) const { if (! fitsio_) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio_, TBYTE, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(const char* keyword, short& val) const { if (! fitsio_) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio_, TSHORT, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(const char* keyword, unsigned short& val) const { if (! fitsio_) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio_, TUSHORT, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } /* * find and return the value for the given FITS keyword, or NULL if not found * The returned value, if any, points to static data and should be saved by the * caller. */ char* FitsIO::get(const char* keyword) const { if (! fitsio_) { error(noHdrErrMsg); return NULL; } int status = 0; if (fits_read_key(fitsio_, TSTRING, (char*)keyword, buf_, NULL, &status) != 0) { cfitsio_error(); return NULL; } return buf_; } /* * find and return the comment for the given FITS keyword, or NULL if not found * The returned value, if any, points to static data and should be saved by the * caller. */ char* FitsIO::getComment(const char* keyword) const { if (! fitsio_) { error(noHdrErrMsg); return NULL; } int status = 0; char value[81]; if (fits_read_key(fitsio_, TSTRING, (char*)keyword, value, buf_, &status) != 0) { cfitsio_error(); return NULL; } return buf_; } /* * This is the same as get(const char*), but you supply the buffer to hold * the result, which is then an empty string, if not found. */ char* FitsIO::get(const char* keyword, char* buf, int bufsz) const { char* s = get(keyword); if (s) strncpy(buf, s, bufsz); else buf[0] = '\0'; return buf; } /* * these are static versions of the above */ int FitsIO::get(fitsfile* fitsio, const char* keyword, double& val) { if (! fitsio) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio, TDOUBLE, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(fitsfile* fitsio, const char* keyword, float& val) { if (! fitsio) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio, TFLOAT, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(fitsfile* fitsio, const char* keyword, int& val) { if (! fitsio) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio, TINT, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(fitsfile* fitsio, const char* keyword, long& val) { if (! fitsio) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio, TLONG, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(fitsfile* fitsio, const char* keyword, unsigned char& val) { if (! fitsio) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio, TBYTE, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(fitsfile* fitsio, const char* keyword, unsigned short& val) { if (! fitsio) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio, TUSHORT, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } int FitsIO::get(fitsfile* fitsio, const char* keyword, short& val) { if (! fitsio) return error(noHdrErrMsg); int status = 0; if (fits_read_key(fitsio, TSHORT, (char*)keyword, &val, NULL, &status) != 0) return cfitsio_error(); return 0; } /* * Find and return the value for the given FITS keyword, or NULL if not found. * The returned value, if any, points to static data and should be saved by the * caller. */ char* FitsIO::get(fitsfile* fitsio, const char* keyword) { if (! fitsio) { error(noHdrErrMsg); return NULL; } int status = 0; if (fits_read_key(fitsio, TSTRING, (char*)keyword, buf_, NULL, &status) != 0) { cfitsio_error(); return NULL; } return buf_; } // -- HDU access -- /* * Return the total number of HDUs */ int FitsIO::getNumHDUs() { if (!fitsio_) return 0; // file might be only in memory int status = 0, num = 0; if (fits_get_num_hdus(fitsio_, &num, &status) != 0) { cfitsio_error(); return 0; } return num; } /* * Return the type of the current HDU as a string: "image", "ascii", * or "binary" or NULL if there was an error. * * PWD: return compressed images as a table. */ const char* FitsIO::getHDUType() { if (!fitsio_) { error(noFitsErrMsg); return NULL; } int status = 0, type = 0; if (fits_get_hdu_type(fitsio_, &type, &status) != 0) { cfitsio_error(); return NULL; } /* Check for a compressed image. */ if ( fits_is_compressed_image( fitsio_, &status ) ) { type = BINARY_TBL; } switch(type) { case IMAGE_HDU: return "image"; case ASCII_TBL: return "ascii"; case BINARY_TBL: return "binary"; } return NULL; } /* * Return the number of the current HDU */ int FitsIO::getHDUNum() { if (!fitsio_) return error(noFitsErrMsg); int num = 1; return fits_get_hdu_num(fitsio_, &num); } /* * Move to the specified HDU and make it the current one * (Note that "num" is one based, so the primary array is num = 1.) */ int FitsIO::setHDU(int num) { // PWD: this isn't necessary. // if (checkFitsFile() != 0) // return 1; // error int status = 0, type = 0; if (fits_movabs_hdu(fitsio_, num, &type, &status) != 0) return cfitsio_error(); LONGLONG headStart = 0, dataStart = 0, dataEnd = 0; if (fits_get_hduaddrll(fitsio_, &headStart, &dataStart, &dataEnd, &status) != 0) { return cfitsio_error(); } // update the header and data offsets to point to the new HDU header_.offset(headStart); header_.length(dataStart - headStart); data_.offset(dataStart); data_.length(dataEnd-dataStart); // update these inherited member variables width_ = height_ = bitpix_ = 0; bscale_ = 1.0; bzero_ = 0.0; get(fitsio_, "NAXIS1", width_); get(fitsio_, "NAXIS2", height_); get(fitsio_, "BITPIX", bitpix_); get(fitsio_, "BSCALE", bscale_); get(fitsio_, "BZERO", bzero_); return 0; } /* * Delete the given HDU. Any following HDUs are shifted to fill the gap. */ int FitsIO::deleteHDU(int num) { // make sure the file was mapped with write permission if (checkWritable() != 0) return 1; // error int curHDU = getHDUNum(); if (setHDU(num) != 0) return 1; // error int status = 0; if (fits_delete_hdu(fitsio_, NULL, &status) != 0) return cfitsio_error(); // reset to the original HDU if (curHDU <= getNumHDUs()) return setHDU(curHDU); return 0; } // -- Fits Tables -- /* * Get the dimensions of the current FITS table. */ int FitsIO::getTableDims(long& rows, int& cols) { if (!fitsio_) return error(noFitsErrMsg); int status = 0; if (fits_get_num_rows(fitsio_, &rows, &status) != 0 || fits_get_num_cols(fitsio_, &cols, &status) != 0) return cfitsio_error(); return 0; } /* * Return the table heading for the given column, or NULL if there is an * error. The return value points to static storage... */ char* FitsIO::getTableHead(int col) { if (col <= 0 || col > 999) { error("FITS table column index out of range"); return NULL; } char keyword[16]; sprintf(keyword, "TTYPE%d", col); return get(keyword); } /* * Get the contents of the given column as an array of doubles. * The caller should pass an array of numValues doubles. */ int FitsIO::getTableColumn(int col, double* values, int numValues) { if (!fitsio_) return error(noFitsErrMsg); int status = 0, anynull = 0; if (fits_read_col(fitsio_, TDOUBLE, col, 1, 1, numValues, NULL, values, &anynull, &status) != 0) return cfitsio_error(); return 0; } /* * Return the value in the current FITS table at the given row * and column, or NULL if there was an error. If the value is a * a floating point value it will be scaled (by scale, which defaults to 1.0). * (use this to convert value from radians to degrees). * The returned pointer points to static storage and will be overwritten * on the next call to this method or the get(keyword) methods. */ char* FitsIO::getTableValue(long row, int col, double scale) { if (!fitsio_) { error(noFitsErrMsg); return NULL; } buf_[0] = '\0'; int status = 0, typecode = 0, anynulls = 0; long repeat = 0, width = 0; if (fits_get_coltype(fitsio_, col, &typecode, &repeat, &width, &status) != 0) { cfitsio_error(); return NULL; } if (width > sizeof(buf_)-1) { fmt_error("FITS table value at row %d, col %d is too long", row, col); return NULL; } switch(typecode) { case TSTRING: char* p[1]; p[0] = buf_; if (fits_read_col(fitsio_, TSTRING, col, row, 1, 1, (char *)"", p, &anynulls, &status) != 0) { cfitsio_error(); return NULL; } break; case TBYTE: case TSHORT: case TINT: case TLONG: long l; if (fits_read_col(fitsio_, TLONG, col, row, 1, 1, NULL, &l, &anynulls, &status) != 0) { cfitsio_error(); return NULL; } sprintf(buf_, "%ld", l); break; case TLONGLONG: LONGLONG ll; if (fits_read_col(fitsio_, TLONGLONG, col, row, 1, 1, NULL, &ll, &anynulls, &status) != 0) { cfitsio_error(); return NULL; } /* Handle 64 bit integer printing for this platform. * Can be "long long" or "long", plus windows has "I64d" * format. */ #if _MSC_VER sprintf(buf_, "%I64d", ll); #elif USE_LL_SUFFIX sprintf(buf_, "%lld", ll); #else sprintf(buf_, "%ld", ll); #endif break; case TUSHORT: case TUINT: case TULONG: unsigned long ul; if (fits_read_col(fitsio_, TULONG, col, row, 1, 1, NULL, &ul, &anynulls, &status) != 0) { cfitsio_error(); return NULL; } sprintf(buf_, "%lu", ul); break; case TFLOAT: float f; if (fits_read_col(fitsio_, TFLOAT, col, row, 1, 1, NULL, &f, &anynulls, &status) != 0) { cfitsio_error(); return NULL; } /* Scaling may need more precision */ sprintf(buf_, "%.*g", DBL_DIG, (double)f * scale); break; case TDOUBLE: double d; if (fits_read_col(fitsio_, TDOUBLE, col, row, 1, 1, NULL, &d, &anynulls, &status) != 0) { cfitsio_error(); return NULL; } sprintf(buf_, "%.*g", DBL_DIG, d*scale); break; case TLOGICAL: char c; if (fits_read_col(fitsio_, TLOGICAL, col, row, 1, 1, NULL, &c, &anynulls, &status) != 0) { cfitsio_error(); return NULL; } buf_[0] = (c ? 'T' : 'F'); buf_[1] = '\0'; break; default: fmt_error("cfitsio data type (%d) not supported",typecode); return NULL; } return buf_; } /* * Create a FITS table and make it the current HDU * * extname gives the name of the table. * * The initial size will be rows x cols entries. * * tform is an array giving the FITS data type for each column * (For example: 16A, for a 16 char string, see FITS description.) * * If asciiFlag is 1, an ASCII table is created, otherwise a binary table. */ int FitsIO::createTable(const char* extname, long rows, int cols, char** headings, char** tform, int asciiFlag) { // make sure the file was mapped with write permission if (checkWritable() != 0) return 1; // error int status = 0; int tbltype = (asciiFlag ? ASCII_TBL : BINARY_TBL); fits_ = this; // reallocFile() might be called if (fits_create_tbl(fitsio_, tbltype, rows, cols, headings, tform, NULL, (char*)extname, &status) != 0) { fits_ = NULL; return cfitsio_error(); } fits_ = NULL; if (flush() != 0) return 1; // error flushing data if (fits_movnam_hdu(fitsio_, tbltype, (char*)extname, 0, &status) != 0) { return cfitsio_error(); } return setHDU(getHDUNum()); // remap after modifying file } /* * Set the value in the current FITS table at the given row and column * (For now, all data types are treated as strings) */ int FitsIO::setTableValue(long row, int col, const char* value) { // make sure the file was mapped with write permission if (checkWritable() != 0) return 1; // error if (row < 1) return fmt_error("FITS table row index %d out of range: should be >= 1", row); if (col < 1) return fmt_error("FITS table column index %d out of range: should be >= 1", col); // make sure the file was mapped with write permission if (checkWritable() != 0) return 1; // error int status = 0, typecode = 0; long repeat = 0, width = 0; if (fits_get_coltype(fitsio_, col, &typecode, &repeat, &width, &status) != 0) return cfitsio_error(); switch(typecode) { case TSTRING: if (fits_write_col(fitsio_, TSTRING, col, row, 1, 1, (char**)&value, &status) != 0) return cfitsio_error(); break; case TBYTE: case TSHORT: case TINT: case TLONG: long l; if (sscanf(value, "%ld", &l) != 1) return error("invalid int value: ", value); if (fits_write_col(fitsio_, TLONG, col, row, 1, 1, &l, &status) != 0) return cfitsio_error(); break; case TLONGLONG: LONGLONG ll; #if _MSC_VER if (sscanf(value, "%I64d", &ll) != 1) { #elif USE_LL_SUFFIX if (sscanf(value, "%lld", &ll) != 1) { #else if (sscanf(value, "%ld", &ll) != 1) { #endif return error("invalid long value: ", value); } if (fits_write_col(fitsio_, TLONGLONG, col, row, 1, 1, &ll, &status) != 0) return cfitsio_error(); break; case TUSHORT: case TUINT: case TULONG: unsigned long ul; if (sscanf(value, "%lu", &ul) != 1) return error("invalid unsigned value: ", value); if (fits_write_col(fitsio_, TULONG, col, row, 1, 1, &ul, &status) != 0) return cfitsio_error(); break; case TFLOAT: case TDOUBLE: double d; if (sscanf(value, "%lf", &d) != 1) return error("invalid floating point value: ", value); if (fits_write_col(fitsio_, TDOUBLE, col, row, 1, 1, &d, &status) != 0) return cfitsio_error(); break; case TLOGICAL: char c; if (fits_write_col(fitsio_, TLOGICAL, col, row, 1, 1, (char*)value, &status) != 0) return cfitsio_error(); break; default: return fmt_error("cfitsio data type (%d) not supported"); } return flush(); } /* * Make sure that this object represents a writable FITS file that was * also mapped with read/write permission. The default for FitsIO::read() * is to map the file read-only. If you plan to edit the file by * inserting keywords or tables, you must pass the read-write flag, for * example: * * FitsIO* fits = FitsIO::read(filename, Mem::FILE_RDWR); * * If this was not the case, this method attempts to remap the file read/write. * * The return value is 0 if the file was or could be mapped read-write, * otherwise 1. */ int FitsIO::checkWritable() { if (!fitsio_) return error(noFitsErrMsg); if (checkFitsFile() != 0) return 1; if (!(header_.options() & Mem::FILE_RDWR)) { if (access(header_.filename(), W_OK) != 0) return error("FitsIO: no write permission on file: ", header_.filename()); return header_.remap(Mem::FILE_RDWR); } return 0; } skycat-3.1.2-starlink-1b/astrotcl/generic/Fits_IO.h000066400000000000000000000251011215713201500220500ustar00rootroot00000000000000// -*-c++-*- #ifndef _FitsIO_h_ #define _FitsIO_h_ /* * E.S.O. - VLT project * * "@(#) $Id: Fits_IO.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" * * Fits_IO.h - declarations for class FitsIO, a class representing the * contents of a FITS image file (or other image source) * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 10/01/00 Added getFitsFile member to allow access * to fitsio file handle (used to access * HDUs in derived/related classes). * Peter W. Draper 04/02/00 Changed constness of write so that * non-const member can be used within this * member. * 15/08/00 Made write virtual so it can be overriden. * pbiereic 17/02/03 Revised byte-order issues * Peter W. Draper 13/06/05 Made setHDU virtual so it can be overriden. * 28/11/05 Made copy virtual so it can be overridden. * 14/12/05 Moved setHDU and copy to the ImageIORep base * class so that CompoundImageData does not * need knowledge of this class (so that other * ImageIORep implementations can be used in * CompoundImages). * 01/03/07 Added putcard member to write a header card * without decomposition to kvc. * pbiereic 17/02/03 Revised byte-order issues * abrighto 02/01/05 Renamed .h file to avoid conflict with cfitsio's * "fitsio.h" on case-ignoring file systems, such as * Mac OSX. * 16/03/09 Added getComment function. * Peter W. Draper 29/30/09 Added length_ to support check of opened file * length. * pbiereic 12/08/07 added support for data types double and long long int * pbiereic 07/09/07 added support for tiled-image compressed files */ #include #include #include "ImageIO.h" #include "fitsio.h" /* * This class manages reading and writing FITS files and storing the * image data. It is derived from ImageIORep rather than class ImageIO * for the sake of reference counting. */ class FitsIO : public ImageIORep { private: // set wcslib header length for searching static void set_header_length(const Mem& header); void set_header_length() const; // make sure there is enough space in the header to insert/update a keyword int checkKeywordSpace(const char* keyword); // extend the size of the FITS header by one header block int extendHeader(); static void* reallocFile(void* p, size_t newsize); protected: // PWD: Move here so that derived classes can manipulate (needed to get // at HDU functions from ther fitsfile* fitsio_; // handle to use for cfitsio C library routines static FitsIO* fits_; // current class ptr for reallocFile callback static size_t length_; // current mapped length for reallocFile callback Mem primaryHeader_; // the primary header, if there is more than one HDU Mem mergedHeader_; // the primary header merged with the current extension // header, if applicable (The primary header is appended // after the extension header). // Check that this object represents a FITS file (and not just some kind of memory) // and return 0 if it does. If not, return an error message. int checkFitsFile(); // return 0 if this object represents a FITS file that was mapped for read/write int checkWritable(); // write the keyword/value pair to the given open file descriptor. static int put_keyword(FILE* f, const char* keyword, int value); static int put_keyword(FILE* f, const char* keyword, double value); static int put_keyword(FILE* f, const char* keyword, const char* value); static int put_keyword(FILE* f, const char* keyword, char value); // write keyword/value pair to the given stream. static int put_keyword(ostream& os, const char* keyword, int value); static int put_keyword(ostream& os, const char* keyword, double value); static int put_keyword(ostream& os, const char* keyword, char* value); static int put_keyword(ostream& os, const char* keyword, char value); // round off file size static void padFile(FILE* f, int size); // Report a cfitsio error static int cfitsio_error(); // return a cfitsio handle, given the Mem object for the FITS header. static fitsfile* openFitsMem(Mem& header); // flush any memory changes to the file int flush(); // Return an allocated FitsIO object, given the Mem objects for the header and data // and the cfitsio handle to use to access the file. static FitsIO* initialize(Mem& header, Mem& data, fitsfile* fitsio); public: // constructor: init from given header and data and optional // cfitsio handle. FitsIO(int width, int height, int bitpix, double bzero, double bscale, const Mem& header, const Mem& data, fitsfile* fitsio = NULL); // destructor ~FitsIO(); // Return a copy of this object that shares the data, but can have a different current HDU virtual FitsIO* copy(); // initialize world coordinates (based on the image header) int wcsinit(); // return the class name as a string const char* classname() const {return "FitsIO";} // read a FITS file and return a pointer to an allocated FitsIO object // NULL if an error occurred static FitsIO* read(const char* filename, int memOptions = 0); // write the data to a FITS file int write(const char *filename); // compress or decompress the given file and return the new filename // see comments in source file for details. static const char* check_compress(const char* filename, char* buf, int bufsz, int& istemp, int decompress_flag = 1, int bitpix = 0); // check if FITS binary table extension contains a compressed image static const char* check_cfitsio_compress(char* filename, char* buf, int bufsz, int& istemp); // Copy a compressed input image to an uncompressed output image static int imcopy(char *infile, char *outfile); // Return an allocated FitsIO object, given the Mem object for the file header // (header.ptr() should point to the entire FITS file contents.) static FitsIO* initialize(Mem& header); // Return an allocated FitsIO object, given the Mem objects for the header and data. static FitsIO* initialize(Mem& header, Mem& data); // generate a blank image with a FITS header based on the given fields static FitsIO* blankImage(double ra, double dec, double equinox, double radius, int width, int height, unsigned long color0); // find and set value for the given FITS keyword and return 0 if OK (found) int get(const char* keyword, double& val) const; int get(const char* keyword, float& val) const; int get(const char* keyword, int& val) const; int get(const char* keyword, long& val) const; int get(const char* keyword, long long& val) const; int get(const char* keyword, unsigned char& val) const; int get(const char* keyword, unsigned short& val) const; int get(const char* keyword, short& val) const; // find and return the value for the given FITS keyword, or NULL if not found char* get(const char* keyword) const; // find and return the comment for the given FITS keyword, or NULL if not found char* getComment(const char* keyword) const; // same as get(const char*), but you supply the buffer to hold the result char* get(const char* keyword, char* buf, int bufsz) const; // these are static versions of the above that require the cfitsio handle static int get(fitsfile*, const char* keyword, double& val); static int get(fitsfile*, const char* keyword, float& val); static int get(fitsfile*, const char* keyword, int& val); static int get(fitsfile*, const char* keyword, long& val); static int get(fitsfile*, const char* keyword, unsigned char& val); static int get(fitsfile*, const char* keyword, unsigned short& val); static int get(fitsfile*, const char* keyword, short& val); // find and return the value for the given FITS keyword, or NULL if not found static char* get(fitsfile*, const char* keyword); // write a (ASCII formatted) copy of the FITS header to the given stream. int getFitsHeader(ostream& os) const; // write data to disk (network byte ordered, NBO) int fwriteNBO(char *data, int tsize, int size, FILE *f) const; // Insert the given FITS keyword and value and return 0 if OK // If there is not enough space in the header, the file size is // automatically increased. int put(const char* keyword, double val, const char* comment = NULL); int put(const char* keyword, float val, const char* comment = NULL); int put(const char* keyword, int val, const char* comment = NULL); int put(const char* keyword, const char* val, const char* comment = NULL); // Insert a formatted header card. int putcard(const char* card); // -- HDU access -- // Return the total number of HDUs int getNumHDUs(); // Return the type of the current HDU as a string: "image", "ascii", // or "binary" or NULL if there was as error. const char* getHDUType(); // Return the index of the current HDU int getHDUNum(); // Move to the specified HDU and make it the current one virtual int setHDU(int num); // Delete the given HDU int deleteHDU(int num); // -- Read Fits Tables -- // get the dimensions of the current FITS table int getTableDims(long& rows, int& cols); // return the table heading for the given column char* getTableHead(int col); // Return the value in the current FITS table at the given row and column char* getTableValue(long row, int col, double scale = 1.0); // get the contents of the given column as an array of doubles int getTableColumn(int col, double* values, int numValues); // -- Write Fits Tables -- // Create a FITS table and make it the current HDU int createTable(const char* extname, long rows, int cols, char** headings, char** tform, int asciiFlag = 0); // Set the value in the current FITS table at the given row and column // (For now, all data types are treated as strings) int setTableValue(long row, int col, const char* value); }; #endif /* _FitsIO_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/HMS.C000066400000000000000000000104411215713201500211370ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: HMS.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * HMS.C - method definitions for class HMS * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created * Peter W. Draper 27 Jan 03 Added extra_precision flags for milli-arcsec * 08 Aug 08 Use libwcs dec2str and ra2str functions in the * print methods. Previous version wasn't careful * enough at the boundary conditions (given the * fraction part of the arcseconds value, which * can round up). */ static const char* const rcsId="@(#) $Id: HMS.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; #include #include #include #include "error.h" #include "HMS.h" #include "fitshead.h" // Default precision. int HMS::extra_precision = 0; /* * constructor - from H:M:S.sss, calculate double value * (note: hours is taken as double incase of "-00:mm:ss" */ HMS::HMS(double hours, int min, double sec) : hours_(int(hours)), min_(min), sec_(sec), show_sign_(0) { val_ = (sec/60.0 + min)/60.0; double z = -0.0; // check also for neg zero if (hours < 0.0 || memcmp(&z, &hours, sizeof(double)) == 0) { val_ = hours_ - val_; hours_ = -hours_; sign_ = '-'; } else { val_ = hours_ + val_; sign_ = '+'; } } /* * constructor - from decimal value, calculate H:M:S.sss */ HMS::HMS(double val) : val_(val), show_sign_(0) { double dd, md, v = val, z = -0.0; // check also for neg zero if (v < 0.0 || memcmp(&z, &v, sizeof(double)) == 0) { sign_ = '-'; v = -v; } else { sign_ = '+'; } if ( extra_precision ) { dd = v + 0.000000000001; } else { dd = v + 0.0000000001; } hours_ = (int)dd; md = (dd - hours_) * 60.; min_ = (int)md; sec_ = (md - min_) * 60.; } /* * constructor - from string value, in format H:M:S.sss, hh, d.ddd, or * H M S... * If hflag is 1 and the value is not in H:M:S and is not an * integer (has a decimal point) convert to hours by dividing by 15. * If dflag is specified, it is set to 1 if the value was divided by 15. */ HMS::HMS(const char* s, int hflag, int* dflag) : show_sign_(0) { if (!s) { val_ = sec_ = 0.; hours_ = min_ = 0; return; } double hours = 0; int min = 0; double sec = 0.0; double val = 0.0; int n = sscanf(s, "%lf%*[: ]%d%*[: ]%lf", &hours, &min, &sec); if (n >= 2) { // note: on HP, scanf on "-0.0" returns "0.0", on sun, "-0.0" if (hours == 0.0 && strchr(s, '-')) hours = -0.0; *this = HMS(hours, min, sec); } else if (n == 1) { if (sscanf(s, "%lf", &val) == 1) { if (hflag && strchr(s, '.')) { *this = HMS(val/15.); if (dflag) *dflag = 1; } else *this = HMS(val); } else { *this = HMS(hours, 0, 0); } } else { val_ = HMS_NULL; // error } } /* * print in the given buffer in H:M:S format */ void HMS::print(char* buf) const { if ( extra_precision ) { print_extra_precise_( buf ); } else { print_normal_precise_( buf ); } } // Show 2 digits prec for dec, 3 for ra void HMS::print_normal_precise_( char *buf ) const { char lbuf[32]; if ( show_sign_ ) { dec2str( lbuf, 32, val_, 2 ); } else { ra2str( lbuf, 32, val_ * 15.0, 3 ); } strncpy( buf, lbuf, 32 ); } // Show 4 digits prec for dec, 5 for ra void HMS::print_extra_precise_( char *buf ) const { char lbuf[32]; if ( show_sign_ ) { dec2str( lbuf, 32, val_, 4 ); } else { ra2str( lbuf, 32, val_ * 15.0, 5 ); } strncpy( buf, lbuf, 32 ); } /* * write this object to the given stream in the format * H:M:S.sss */ ostream& operator<<(ostream& os, const HMS& hms) { char buf[80]; hms.print(buf); os << buf; return os; } /* * read an HMS object from the given stream in the format * H:M:S.sss or H M S */ istream& operator>>(istream& is, HMS& hms) { char c; double hours = 0; int min = 0; double sec = 0.0; is >> hours >> c >> min >> c >> sec; hms = HMS(hours, min, sec); return is; } skycat-3.1.2-starlink-1b/astrotcl/generic/HMS.h000066400000000000000000000054231215713201500212100ustar00rootroot00000000000000// -*-c++-*- #ifndef _HMS_h_ #define _HMS_h_ /* * E.S.O. - VLT project * $Id: HMS.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * HMS.h - class representing a value of the form "hours:min:sec" * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 27 Sep 95 Created * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ #include #include using namespace std; const double HMS_NULL = HUGE_VAL; // null value for a double /* * Class HMS */ class HMS { protected: int hours_; // base 60 values H:M:S.sss int min_; double sec_; double val_; // value converted to decimal short show_sign_; // flag, if true, include sign (+/-) when printing char sign_; // '+' or '-' public: // constructors HMS() : hours_(0), min_(0), sec_(0.0), val_(HMS_NULL), show_sign_(0) {} HMS(double hours, int min, double sec); HMS(double val); HMS(const char* s, int hflag = 0, int* dflag = 0); // return true if this object has the null value int isNull() const {return val_ == HMS_NULL;} // set to the null value void setNull() {val_ = HMS_NULL;} // member access int hours() const {return hours_;} int min() const {return min_;} double sec() const {return sec_;} double val() const {return val_;} char sign() const {return sign_;} // set to true to cause << to print with leading sign even when positive void show_sign(int b) {show_sign_ = b;} // ... (add I/O and arithmetic operators here) ... // output operator friend ostream& operator<<(ostream&, const HMS&); friend istream& operator>>(istream&, HMS&); // print in the given buffer in H:M:S format void print(char* buf) const; int operator<(const HMS& hms) const { return val_ < hms.val_; } int operator<=(const HMS& hms) const { return val_ <= hms.val_; } int operator>(const HMS& hms) const { return val_ > hms.val_; } int operator>=(const HMS& hms) const { return val_ >= hms.val_; } int operator==(const HMS& hms) const { return fabs(val_ - hms.val_) <= 0.0000000001; } int operator!=(const HMS& hms) const { return fabs(val_ - hms.val_) >= 0.0000000001; } // return the difference between 2 HMS values friend double operator-(const HMS& a, const HMS& b) { return (a.val_ - b.val_); } // set how many decimal places to show for arc seconds, this is 2 // by default, setting this to 1 shows 3 (milli arcsec). static int extra_precision; protected: void print_normal_precise_( char *buf ) const; void print_extra_precise_( char *buf ) const; }; #endif /* _HMS_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/ImageCoords.C000066400000000000000000000061721215713201500227120ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: ImageCoords.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * ImageCoords.C - method definitions for class ImageCoords * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ static const char* const rcsId="@(#) $Id: ImageCoords.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; #include #include #include #include #include "error.h" #include "ImageCoords.h" /* * constructor - takes x and y as strings */ ImageCoords::ImageCoords(const char* x_str, const char* y_str) : x_(IMAGE_COORD_NULL), y_(IMAGE_COORD_NULL), status_(0) { if (sscanf(x_str, "%lf", &x_) != 1 || sscanf(y_str, "%lf", &y_) != 1) status_ = fmt_error("bad image coords: (%s, %s)", x_str, y_str); } /* * Print the coordinates in the given buffers */ void ImageCoords::print(char* x_buf, char* y_buf) { sprintf(x_buf, "%g", x_); sprintf(y_buf, "%g", y_); } /* * Print the coordinates to the given stream. */ void ImageCoords::print(ostream& os) { os << *this; } /* * get x and y */ void ImageCoords::get(double& x, double& y) { x = x_; y = y_; } /* * output operator: ("" for null coords) */ ostream& operator<<(ostream& os, const ImageCoords& pos) { if (pos.isNull()) os << "\"\""; else os << pos.x_ << " " << pos.y_; return os; } /* * return the distance between this position and the given one * (in pixels) */ double ImageCoords::dist(ImageCoords& pos) const { return dist(x_, y_, pos.x_, pos.y_); } /* * static member to get the distance between 2 points in pixels */ double ImageCoords::dist(double x0, double y0, double x1, double y1) { double x = fabs(x1 - x0); double y = fabs(y1 - y0); return sqrt(x*x + y*y); } /* * Given a radius in pixels, set pos1 and pos2 to the 2 endpoints that form a box * with center at this position. */ int ImageCoords::box(double radius, ImageCoords& pos1, ImageCoords& pos2) const { double w = sqrt((radius * radius)/2.); double x0 = x_ - w; double y0 = y_ - w; double x1 = x_ + w; double y1 = y_ + w; pos1 = ImageCoords(x0, y0); pos2 = ImageCoords(x1, y1); return 0; } /* * Given the endpoints of a box (pos1, pos2), set width, height and radius in * pixels, and return the position at the center of the box */ ImageCoords ImageCoords::center(const ImageCoords& pos1, const ImageCoords& pos2, double& radius, double& width, double& height) { ImageCoords result; if (pos1.status() || pos2.status()) { error("invalid image position argument"); return result; } // get center pos double x1 = pos1.x_, y1 = pos1.y_; double x2 = pos2.x_, y2 = pos2.y_; double x = (x1 + x2)/2.0; double y = (y1 + y2)/2.0; result = ImageCoords(x, y); // get width and height of box width = dist(x1, y1, x2, y1); height = dist(x1, y1, x1, y2); // radius is half the distance from pos1 to pos2 radius = dist(x1, y1, x2, y2)/2.; return result; } skycat-3.1.2-starlink-1b/astrotcl/generic/ImageCoords.h000066400000000000000000000056251215713201500227610ustar00rootroot00000000000000// -*-c++-*- #ifndef _ImageCoords_h_ #define _ImageCoords_h_ /* * E.S.O. - VLT project * $Id: ImageCoords.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * ImageCoords.h - class representing image coordinates (x, y) * (see also class WorldCoords) * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 97 Created * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ using namespace std; #include #include #include const double IMAGE_COORD_NULL = HUGE_VAL; // null value for a double /* * Class ImageCoords */ class ImageCoords { protected: double x_, y_; // coordinates of a pixel int status_; // status for errors in constructor public: // constructor - initialize null coords ImageCoords() : x_(IMAGE_COORD_NULL), y_(IMAGE_COORD_NULL), status_(0) {} // constructor ImageCoords(double x, double y) : x_(x), y_(y), status_(0) {} // constructor - parse X and Y in string format ImageCoords(const char* x_str, const char* y_str); // return true if the coords are null int isNull() const {return x_ == IMAGE_COORD_NULL || y_ == IMAGE_COORD_NULL;} // set to the null value void setNull() {x_ = IMAGE_COORD_NULL; y_ = IMAGE_COORD_NULL;} // output operator: format: "x y" friend ostream& operator<<(ostream&, const ImageCoords& pos); // print coords to the given buffer void print(char* x_buf, char* y_buf); // print coords to the given stream void print(ostream& os); // get x and y void get(double& x, double& y); // check for equality int operator==(const ImageCoords& pos) const { return x_ == pos.x_ && y_ == pos.y_; } int operator!=(const ImageCoords& pos) const { return x_ != pos.x_ || y_ != pos.y_; } // return the difference between 2 image coord points friend ImageCoords operator-(const ImageCoords& a, const ImageCoords& b) { return ImageCoords(a.x_ - b.x_, a.y_ - b.y_); } // short cuts // return x and y double x() const {return x_;} double y() const {return y_;} // get distance between points double dist(ImageCoords& pos) const; // static member to get the distance between 2 points static double dist(double x0, double y0, double x1, double y1); // Given a radius, set pos1 and pos2 to the 2 endpoints that form a box // with center at this position. int box(double radius, ImageCoords& pos1, ImageCoords& pos2) const; // Given the endpoints of a box (pos1, pos2), set width, height and radius // and return the center position of the box. static ImageCoords center(const ImageCoords& pos1, const ImageCoords& pos2, double& radius, double& width, double& height); // member access int status() const {return status_;} }; #endif /* _ImageCoords_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/ImageIO.C000066400000000000000000000103251215713201500217630ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: ImageIO.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" * * ImageIO.C - method definitions for class ImageIO, for managing image * I/O and storage * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 07/03/96 Created * * 12/03/98 Remove dependency on FitsIO (delegated to * class FitsIO or other class derived from * ImageIORep. * Peter W. Draper 24/06/99 Changed to use FITS_LONG as type in byte * swapping. "long" is 8 bytes on alphas and 64 SUNs. * pbiereic 12/08/07 added support for data types double and long long int */ static const char* const rcsId="@(#) $Id: ImageIO.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; /* see Apple Developer Connection Tech Notes http://developer.apple.com/technotes/tn2002/tn2071.html */ #if ! ( defined(__APPLE__) && defined(__MACH__) ) #include #endif #include #include #include #if HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "error.h" #include "ImageIO.h" #include "fitsio2.h" // The type "long" may have 64 bits. #if LONGSIZE == 64 #define FITS_LONG int #define FITS_LONGLONG long #else #define FITS_LONG long #define FITS_LONGLONG long long #endif /* * copy constructor - increment the reference count... */ ImageIO::ImageIO(const ImageIO& im) : rep_(im.rep_) { if (rep_) rep_->refcnt_++; } /* * destructor - delete if there are no more references. */ ImageIO::~ImageIO() { if (rep_ && --rep_->refcnt_ <= 0) delete rep_; } /* * assignment operator */ ImageIO& ImageIO::operator=(const ImageIO& im) { if (im.rep_) im.rep_->refcnt_++; // protect against "im = im" if (rep_ && --rep_->refcnt_ <= 0) delete rep_; rep_ = im.rep_; return *this; } // ----------------------------------------------------------------------- // ImageIORep: base class of internal representation // ----------------------------------------------------------------------- /* * replace header */ int ImageIORep::header(const Mem& m) { header_ = m; return 0; } /* * replace data with data of same size */ int ImageIORep::data(const Mem& m) { if (m.length() < width_* height_ * (abs(bitpix_)/8)) return error("image memory area is too small"); data_ = m; return 0; } /* * If byte swapping is needed for this machine and image, make a byte * swapped copy of the image data, otherwise, do nothing. * Returns 0 if all is OK. */ int ImageIORep::byteSwapData() { int dsize = abs(bitpix_)/8; FITS_LONG l = 1; if (ntohl(l) == l || dsize == 1) { // no byte swapping needed return 0; } // make a byte-swapped copy of the image in memory. // Note: if this causes problems with huge images, maybe we should // make a byte swapped file copy and mmap it. int n = width_ * height_; int datalen = n * dsize; Mem data(datalen, 0); if (data.status() != 0) return 1; // copy the data and swap bytes if (dsize == 2) { // copy shorts (could be an odd number of them...) unsigned short* from = (unsigned short*)data_.ptr(); unsigned short* to = (unsigned short*)data.ptr(); while(n--) { *to++ = ntohs(*from); // note: ntohs could be a macro that references its arg more than once... from++; } } else if (dsize == 4) { // copy longs unsigned FITS_LONG* from = (unsigned FITS_LONG*)data_.ptr(); unsigned FITS_LONG* to = (unsigned FITS_LONG*)data.ptr(); while(n--) { *to++ = ntohl(*from); from++; } } else if (dsize == 8) { // copy long longs (doubles) unsigned FITS_LONGLONG* from = (unsigned FITS_LONGLONG*)data_.ptr(); unsigned FITS_LONGLONG* to = (unsigned FITS_LONGLONG*)data.ptr(); while(n--) { *to++ = SWAP64(*from); from++; } } else { return fmt_error("ImageIO: unexpected value for bitpix: %d", bitpix_); } // replace the image data with the byte swapped data // (This deletes the old data Mem object and replaces it with the new one) data_ = data; return 0; } skycat-3.1.2-starlink-1b/astrotcl/generic/ImageIO.h000066400000000000000000000302301215713201500220250ustar00rootroot00000000000000// -*-c++-*- #ifndef _ImageIO_h_ #define _ImageIO_h_ /* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: ImageIO.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" * * ImageIO.h - declarations for class ImageIO, an abstract base class * representing the contents of an image file (or other * image source) and managing the reading and writing of * image files. The image data is (optionally) kept in shared * memory so that it can be easily accessed by external * applications. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * * 12/03/98 Remove dependency on FitsIO (delegated to * class FitsIO or other class derived from * ImageIORep. * Added WCS class, for optional World Coords * support. * Peter W. Draper 04/02/00 Changed constness of write so that * non-const member can be used within this * member. * 30/05/01 Added DOUBLE_IMAGE enumeration. * Added copy() and setHDU pure virtual members * to support CompoundImageData not having access * to the FitsIO class. The actual effect * of the setHDU member is left to the * implementation (this switches HDU for FitsIO). * Peter W. Draper 08/01/07 Comment out isclear() methods. Not used and * no longer reflect how a blank image is detected * (if resurrected need to add and then check for * RTD_BLANK value in OBJECT card to match behaviour * in RTD, or add a member for blankness). * pbiereic 12/08/07 added support for data types double and long long int */ #include #include #include #include #include "WCSRep.h" #include "Mem.h" // types of image data (these mostly correspond to the FITS BITPIX values) enum ImageDataType { UNKNOWN_IMAGE = -1, // unknown type BYTE_IMAGE = 8, // 8 bit images X_IMAGE = -8, // special, already color scaled, X image data SHORT_IMAGE = 16, // 16 bit signed USHORT_IMAGE = -16, // 16 bit unsigned LONG_IMAGE = 32, // 32 bit integer FLOAT_IMAGE = -32, // 32 bit floating point LONGLONG_IMAGE = 64, // 64 bit integer DOUBLE_IMAGE = -64 // 64 bit double }; /* * This class is used internally for reference counting and subclassing. * The public interface is through the ImageIO class. */ class ImageIORep { friend class ImageIO; protected: int width_, height_; // image dimensions int bitpix_; // image data type double bzero_, bscale_; // image value = bzero + bscale * val Mem header_, data_; // header and data are kept in shared memory, // Format of header is FITS. WCS wcs_; // object used to manage World Coordinate conversion // (You can initialize wcs by calling the virtual method "wcsinit()".) int refcnt_; // reference count int status_; // status after constructor // constructor (derived classes call this) ImageIORep(int width, int height, int bitpix, double bzero, double bscale, const Mem& header, const Mem& data) : width_(width), height_(height), bitpix_(bitpix), bzero_(bzero), bscale_(bscale), header_(header), data_(data), refcnt_(1), status_(0), usingNetBO_(1) {} // FITS uses network byte order (=big Endian). int usingNetBO_; public: // destructor virtual ~ImageIORep() {} // the following methods must be defined in a derived class // initialize world coordinates (based on the image header) virtual int wcsinit() = 0; // If byte swapping is needed for this machine and image, make a byte // swapped copy of the image data, otherwise, do nothing. int byteSwapData(); // return the class name as a string virtual const char* classname() const = 0; // get the value for the given image header keyword and return 0 if found virtual int get(const char* keyword, double& val) const = 0; virtual int get(const char* keyword, float& val) const = 0; virtual int get(const char* keyword, int& val) const = 0; virtual int get(const char* keyword, long& val) const = 0; virtual int get(const char* keyword, long long& val) const = 0; virtual int get(const char* keyword, unsigned char& val) const = 0; virtual int get(const char* keyword, unsigned short& val) const = 0; virtual int get(const char* keyword, short& val) const = 0; // find and return the value for the given FITS keyword, or NULL if not found virtual char* get(const char* keyword) const = 0; // write a (ASCII formatted) copy of the FITS header to the given stream. virtual int getFitsHeader(ostream& os) const = 0; // write the data to an image file virtual int write(const char *filename) = 0; // apply bzero and bscale to the value double scaleValue(double d) const {return bzero_+d*bscale_;} // reverse the effect of bzero and bscale double unScaleValue(double d) const {return (d-bzero_)/bscale_;} // return the size in bytes of a raw image pixel int pixelSize() const {return abs(bitpix_)/8;} // member access int width() const {return width_;} int height() const {return height_;} int bitpix() const {return bitpix_;} double bscale() const {return bscale_;} void bscale(double d) {bscale_ = d;} double bzero() const {return bzero_;} void bzero(double d) {bzero_ = d;} Mem& header() {return header_;} Mem& data() {return data_;} int status() const {return status_;} void status(int s) {status_ = s;} // class uses network byte ordering (=big Endian) int usingNetBO() const {return usingNetBO_;} void usingNetBO(int bo) {usingNetBO_ = bo;} // return the object used to manage world coordinates WCS& wcs() const {return (WCS&)wcs_;} // set the object used to manage world coordinates void wcs(const WCS& newwcs) {wcs_ = newwcs;} // replace header int header(const Mem&); // replace data with data of same size int data(const Mem&); // Return true if no image is loaded (a 2x2 pixel or smaller // image is considered blank). // PWD: unsafe function. This is not true. //virtual int isclear() const {return width_ <= 2 && height_ <= 2;} // create a copy, as lightweight as possible. virtual ImageIORep *copy() = 0; // switch to another component of the implementation. virtual int setHDU(int num) = 0; }; /* * This class defines the public interface for image I/O. It uses reference * counting with the above class to make it easier to implement different * views of the same image data. */ class ImageIO { private: ImageIORep* rep_; // internal representation for reference counting public: // constructor, to create a null object (use assignment operator to set later) ImageIO() : rep_((ImageIORep*)NULL) {} // constructor, from a pointer to a subclass of ImageIORep (FitsIO, etc...). // rep should be allocated with new and will be deleted by this class when // there are no more references to it. ImageIO(ImageIORep* rep) : rep_(rep) {} // copy constructor ImageIO(const ImageIO&); // destructor ~ImageIO(); // assignment ImageIO& operator=(const ImageIO&); // write the data to an image file int write(const char *filename) const { return rep_->write(filename); } // initialize world coordinates (based on the image header) int wcsinit() { return rep_->wcsinit(); } // get the value for the given image header keyword and return 0 if found int get(const char* keyword, double& val) const { return rep_->get(keyword, val); } int get(const char* keyword, float& val) const { return rep_->get(keyword, val); } int get(const char* keyword, int& val) const { return rep_->get(keyword, val); } int get(const char* keyword, long& val) const { return rep_->get(keyword, val); } int get(const char* keyword, long long& val) const { return rep_->get(keyword, val); } int get(const char* keyword, unsigned char& val) const { return rep_->get(keyword, val); } int get(const char* keyword, unsigned short& val) const { return rep_->get(keyword, val); } int get(const char* keyword, short& val) const { return rep_->get(keyword, val); } // find and return the value for the given FITS keyword, or NULL if not found char* get(const char* keyword) const { return rep_->get(keyword); } // get the value for the given image header keyword or return the // supplied default value if not found int get(const char* keyword, double& val, double defVal) const { if (rep_->get(keyword, val) != 0) val = defVal; return 0; } int get(const char* keyword, float& val, float defVal) const { if (rep_->get(keyword, val) != 0) val = defVal; return 0; } int get(const char* keyword, int& val, int defVal) const { if (rep_->get(keyword, val) != 0) val = defVal; return 0; } int get(const char* keyword, long& val, long defVal) const { if (rep_->get(keyword, val) != 0) val = defVal; return 0; } int get(const char* keyword, long long& val, long defVal) const { if (rep_->get(keyword, val) != 0) val = defVal; return 0; } int get(const char* keyword, unsigned char& val, unsigned char defVal) const { if (rep_->get(keyword, val) != 0) val = defVal; return 0; } int get(const char* keyword, unsigned short& val, unsigned short defVal) const { if (rep_->get(keyword, val) != 0) val = defVal; return 0; } int get(const char* keyword, short& val, short defVal) const { if (rep_->get(keyword, val) != 0) val = defVal; return 0; } char* get(const char* keyword, const char* defVal) const { char* s = rep_->get(keyword); return (s != NULL) ? s : (char*)defVal; } // write a (ASCII formatted) copy of the FITS header to the given stream. int getFitsHeader(ostream& os) const { return rep_->getFitsHeader(os); } // apply bzero and bscale to the value double scaleValue(double d) const {return rep_->scaleValue(d);} // reverse the effect of bzero and bscale double unScaleValue(double d) const {return rep_->unScaleValue(d);} // return the size in bytes of a raw image pixel int pixelSize() const {return rep_->pixelSize();} // member access int width() const {return rep_->width();} int height() const {return rep_->height();} int bitpix() const {return rep_->bitpix();} double bscale() const {return rep_->bscale();} void bscale(double d) {rep_->bscale(d);} double bzero() const {return rep_->bzero();} void bzero(double d) {rep_->bzero(d);} const Mem& header() const {return rep_->header();} const Mem& data() const {return rep_->data();} int usingNetBO() const {return rep_->usingNetBO();} void usingNetBO(int bo) {rep_->usingNetBO(bo);} // return a reference to the object used to manage world coordinates WCS& wcs() const {return rep_->wcs();} // set the object used to manage world coordinates void wcs(const WCS& newwcs) {rep_->wcs(newwcs);} // replace header int header(const Mem& m) {return rep_->header(m);} // replace data with data of same size int data(const Mem& m) {return rep_->data(m);} // short cuts const char* headerPtr() const {return (const char*)rep_->header().ptr();} const void* dataPtr() const {return rep_->data().ptr();} // note: if status is non-zero, the other methods are undefined int status() const {return rep_ ? rep_->status() : 1;} // Return true if no image is loaded. // PWD: see ImageIORep. //int isclear() const {return rep_->isclear();} // return a pointer to the internal class ImageIORep* rep() const {return rep_;} }; #endif /* _ImageIO_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/SAOWCS.C000066400000000000000000000203401215713201500215060ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: SAOWCS.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" * * SAOWCS.C - method definitions for class SAOWCS, an implementation * of the abstract WCS (WCSRep) class interface based on * Doug Mink's (saoimage) WCS library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 30 Sep 96 Created * * 09 Jan 98 Fixed problem with [xy]SecPix_ values for * some (HST) images (affects distance conversion * from WCS to pixel) * 17 Mar 98 Renamed from WSCRep, made WCSRep abstract, * to allow new implementations based on other * libraries. * pbiereic 11/10/99 Added deltset() */ static const char* const rcsId="@(#) $Id: SAOWCS.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; #include #include #include "error.h" #include "SAOWCS.h" /* * constructor: make an SAOWCS object from the FITS header string * and the length of the header string. */ SAOWCS::SAOWCS(const char* header, int headerLength) : WCSRep(), wcs_(NULL), equinox_(0.0), ra_(0.0), dec_(0.0), width_(0.0), height_(0.0), xSecPix_(0.0), ySecPix_(0.0) { equinoxStr_[0] = '\0'; if (header && headerLength) { // The wcssubs/hget routines depend on a static variable being set by hlength()... // (The header string is probably not null terminated, since mmap'ed) hlength((char*)header, headerLength); wcs_ = wcsninit(header, headerLength); if (isWcs()) { // get image center and dimensions wcsfull(wcs_, &ra_, &dec_, &width_, &height_); xSecPix_ = width_*3600./pixWidth(); ySecPix_ = height_*3600./pixHeight(); // set the equinox value and string setEquinox(); } } } /* * destructor */ SAOWCS::~SAOWCS() { if (wcs_) free(wcs_); } /* * util method to set the equinox value and string */ void SAOWCS::setEquinox() { // make sure equinox has a valid value equinox_ = wcs_->equinox; strcpy(equinoxStr_, wcs_->radecout); if (wcs_->sysout == WCS_B1950 || wcs_->sysout == WCS_J2000) sprintf(equinoxStr_, "%g", equinox_); else { strcpy(equinoxStr_, wcs_->radecout); } } /* * convert the given x,y image coordinates to world coordinates, if * possible, and write the result to the given buffer as a list of * the form "RA DEC EQUINOX". * If no conversion can be done, buf will contain an empty list. * * If hms_flag is 1, the result is always in H:M:S D:M:S, otherwise the * format is the one used in the pix2wcst routine (H:M:S for equatorial, * otherwise degrees). */ char* SAOWCS::pix2wcs(double x, double y, char* buf, int bufsz, int hms_flag) const { buf[0] = '\0'; if (isWcs() /* && x > 0 && y > 0 && x < pixWidth() && y < pixHeight()*/) { if (hms_flag == 0) { ::pix2wcst(wcs_, x, y, buf, bufsz); } else { double ra, dec; ::pix2wcs(wcs_, x, y, &ra, &dec); if ( ! (wcs_->offscl == 1)) { char rastr[32], decstr[32]; if (wcs_->degout == 0 || wcs_->sysout == WCS_J2000 || wcs_->sysout == WCS_B1950) ::ra2str(rastr, sizeof(rastr), ra, 3); else ::dec2str(rastr, sizeof(rastr), ra, 3); ::dec2str(decstr, sizeof(decstr), dec, 2); sprintf (buf, "%s %s %s", rastr, decstr, equinoxStr_); } } } return buf; } /* * convert the given x,y image coordinates to world coordinates, if * possible, and write the results to the arguments ra and dec as doubles * in degrees. If no conversion can be done, ra and dec are set to 0.0 * and 1 is returned, otherwise 0 is returned. */ int SAOWCS::pix2wcs(double x, double y, double& ra, double& dec) const { if (!isWcs()) return error("image does not support world coords"); if (x <= 0 || y <= 0 || x > pixWidth() || y > pixHeight()) return error("coordinates out of range"); // note: start at origin = (1,1) rather than (0,0) ra = dec = 0.0; ::pix2wcs(wcs_, x, y, &ra, &dec); if (wcs_->offscl) return error("can't convert world coordinates: out of range"); return 0; } /* * convert the given world coordinates (ra and dec, in degrees) to x,y * image coordinates and put the results in x and y. */ int SAOWCS::wcs2pix(double ra, double dec, double &x, double &y) const { x = y = 0.0; if (!isWcs()) return error("image does not support world coords"); int offscl = 0; // set to 1 if offscale ::wcs2pix(wcs_, ra, dec, &x, &y, &offscl); if (offscl == 1) return error("can't convert world coords: off scale"); return 0; } /* * convert the given world coordinates distance (ra and dec, in degrees) * to an x,y image coordinates distance and put the results in x and y. */ int SAOWCS::wcs2pixDist(double ra, double dec, double &x, double &y) const { // get degrees per pixel double xDegPix = xSecPix_/3600.; double yDegPix = ySecPix_/3600.; if (xDegPix == 0. || yDegPix == 0.) return error("can't convert world coordinate to image distance"); x = fabs(ra/xDegPix); y = fabs(dec/yDegPix); return 0; } /* * convert the given image coordinates distance (x,y) to a world coordinates * distance (ra and dec, in degrees J2000) and put the results in ra and dec. */ int SAOWCS::pix2wcsDist(double x, double y, double& ra, double& dec) const { double xDegPix = xSecPix_/3600.; double yDegPix = ySecPix_/3600.; if (xDegPix == 0. || yDegPix == 0.) return error("can't convert image to world coordinate distance"); ra = fabs(x*xDegPix); dec = fabs(y*yDegPix); return 0; } /* * return the radius of the image in world coordinate arc-minutes * (the distance from the center of the image to the origin) */ double SAOWCS::radius() const { if (!isWcs()) return 0.0; // convert to WCS double ra0 = 0.0, dec0 = 0.0, ra1 = 0.0, dec1 = 0.0; ::pix2wcs(wcs_, 0, 0, &ra0, &dec0); ::pix2wcs(wcs_, pixWidth()/2, pixHeight()/2, &ra1, &dec1); return ::wcsdist(ra0, dec0, ra1, dec1) * 60; } /* * reset the center of the WCS structure * * Args: * ra = New center right ascension in degrees * dec = New center declination in degrees * equinox = (must be 2000 or 1950) */ int SAOWCS::shift(double ra, double dec, double equinox) { char* coorsys; if (equinox == 2000.) coorsys = (char *)"FK5"; else if (equinox == 1950.) coorsys = (char *)"FK4"; else return error("expected equinox of 1950 or 2000"); ::wcsshift(wcs_, ra, dec, coorsys); ra_ = ra; dec_ = dec; return 0; } /* * Set rotation and scaling * * Args: * cdelt1 = scale in degrees/pixel (axis 1); degrees = arcsec/3600. * cdelt2 = scale in degrees/pixel (axis 2) * rotation = rotation angle in degrees */ int SAOWCS::deltset(double cdelt1, double cdelt2, double rotation) { if (!isWcs()) return error("image does not support world coords"); ::wcsdeltset(wcs_, cdelt1, cdelt2, rotation); return 0; } /* * set up the WCS structure from the given information about the image * * Args: * ra = Center right ascension in degrees * dec = Center declination in degrees * secpix = Number of arcseconds per pixel * xrefpix = Reference pixel X coordinate * yrefpix = Reference pixel Y coordinate * nxpix = Number of pixels along x-axis * nypix = Number of pixels along y-axis * rotate = Rotation angle (clockwise positive) in degrees * equinox = Equinox of coordinates, 1950 and 2000 supported * epoch = Epoch of coordinates, used for FK4/FK5 conversion no effect if 0 * proj = Projection */ int SAOWCS::set(double ra, double dec, double secpix, double xrefpix, double yrefpix, int nxpix, int nypix, double rotate, int equinox, double epoch, const char* proj) { if (wcs_) { free(wcs_); wcs_ = NULL; } wcs_ = ::wcsxinit(ra, dec, secpix, xrefpix, yrefpix, nxpix, nypix, rotate, equinox, epoch, (char*)proj); wcsfull(wcs_, &ra_, &dec_, &width_, &height_); xSecPix_ = ySecPix_ = secpix; setEquinox(); return 0; } /* * return the world coordinates of the image center */ WorldCoords SAOWCS::center() const { return WorldCoords(ra_, dec_, equinox()); } skycat-3.1.2-starlink-1b/astrotcl/generic/SAOWCS.h000066400000000000000000000116071215713201500215610ustar00rootroot00000000000000// -*-c++-*- #ifndef _SAOWCS_h_ #define _SAOWCS_h_ /* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: SAOWCS.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" * * SAOWCS.h - declarations for class SAOWCS, an implementation class for * class WCS, which is a reference counted class that manages * a pointer to a class derived from WCSRep. * * This class is based on Doug Mink's (saoimage) WCS C library. * Other implementations of the WCS interface may be added by * Defining new subclasses of the abstract class WCSRep. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 30 Sep 96 Created * 17 Mar 98 Renamed from WSCRep, made WCSRep abstract, * to allow new implementations based on other * libraries. * pbiereic 11/10/99 Added deltset() */ #include "WCSRep.h" #include "WorldCoords.h" #include "wcs.h" /* * This class defines an interface to Doug Mink's (saoimage) WCS C library. * The public interface is through the WCS class. * * Usage: WCS wcs(new SAOWCS(fits_header)); * * The memory for the new object is managed by the WCS class with reference * counting (as long as you use normal assignment and not pointers). */ class SAOWCS : public WCSRep { protected: WorldCoor* wcs_; // C object to manage World Coordinates // The following are needed here because they are sometimes set to 0 // in the wcs_ object double equinox_; // equinox as 2000.0, 1950.0, ... char equinoxStr_[32]; // equinox string: "J2000", "B1950", ... double ra_, dec_; // coordinates of image center in deg double width_, height_; // image width and height in deg double xSecPix_, ySecPix_; // number of arcsecs per pixel void setEquinox(); // set equinox value and string public: // constructor (derived classes call this) SAOWCS(const char* header, int headerLength); // destructor virtual ~SAOWCS(); // return class name as a string virtual const char* classname() const {return "SAOWCS";} // Return 1 if WCS info is available, else 0 ("LINEAR" doesn't count) int isWcs() const {return (wcs_ && ::iswcs(wcs_) && strcmp(equinoxStr_, "LINEAR") != 0);} // return the world coordinates string for the given ximage coords char* pix2wcs(double x, double y, char* buf, int bufsz, int hms_flag = 1) const; // return the world coords (in degrees, as 2 doubles) for the ximage coords int pix2wcs(double x, double y, double& ra, double& dec) const; // get the image coordinates for the given world coords int wcs2pix(double ra, double dec, double &x, double &y) const; // get the image coordinates distance for the given world coords distance in deg int wcs2pixDist(double ra, double dec, double &x, double &y) const; // get the world coords distance in deg for the given image coordinates distance int pix2wcsDist(double x, double y, double& ra, double& dec) const; // set up the WCS structure from the given information about the image int set(double ra, double dec, double secpix, double xrefpix, double yrefpix, int nxpix, int nypix, double rotate, int equinox, double epoch, const char* proj); // reset the center of the WCS structure int shift(double ra, double dec, double equinox); // set rotation and scaling int deltset(double cdelt1, double cdelt2, double rotation); // Return the WCS equinox double equinox() const {return equinox_;} const char* equinoxStr() const {return equinoxStr_;} // return the WCS epoch double epoch() const {return wcs_->epoch;} // return the rotation angle in degrees double rotate() const {return wcs_->rot;} // return the width, height, radius of the image in arcmin double width() const {return width_*60.;} double height() const {return height_*60.;} double radius() const; // return the number of world coordinate arcsecs per pixel double secPix() const {return ySecPix_;} double xSecPix() const {return xSecPix_;} double ySecPix() const {return ySecPix_;} // return the world coordinates of the center of the image WorldCoords center() const; // return image dimensions int pixWidth() const {return int(wcs_->nxpix);} int pixHeight() const {return int(wcs_->nypix);} // Return the WCS distance between the 2 given WCS points in arcsec */ double dist(double ra0, double dec0, double ra1, double dec1) const { return ::wcsdist(ra0, dec0, ra1, dec1) * 60.0 * 60.0; } // return the x,y reference pixel values double xRefPix() const {return wcs_->xrefpix;} double yRefPix() const {return wcs_->yrefpix;} // return the projection type const char* projection() const {return wcs_->ptype;} }; #endif /* _SAOWCS_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/TclWorldCoords.C000066400000000000000000000106451215713201500234220ustar00rootroot00000000000000/* * E.S.O. - VLT project/Archive * $Id: TclWorldCoords.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * TclWorldCoords.C - method definitions for class TclWorldCoords * (Tcl interface to the WorldCoords class) * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 09 Nov 95 Created * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ static const char* const rcsId="@(#) $Id: TclWorldCoords.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; using namespace std; #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "WorldCoords.h" #include "TclWorldCoords.h" /* * declare a table of tcl subcommands * format: name, min_args, max_args, method */ static class TclWorldCoordsSubCmds { public: char* name; // method name int (TclWorldCoords::*fptr)(int argc, char* argv[]); int min_args; // minimum number of args int max_args; // maximum number of args } subcmds_[] = { {(char *)"dtohms", &TclWorldCoords::dtohmsCmd, 1, 2}, {(char *)"hmstod", &TclWorldCoords::hmstodCmd, 1, 2} }; /* * Call the given method in this class with the given arguments */ int TclWorldCoords::call(const char* name, int len, int argc, char* argv[]) { for(unsigned int i = 0; i < (int)sizeof(subcmds_)/sizeof(*subcmds_); i++) { TclWorldCoordsSubCmds* t = &subcmds_[i]; if (strncmp(t->name, name, len) == 0) { if (check_args(name, argc, t->min_args, t->max_args) != TCL_OK) return TCL_ERROR; return (this->*t->fptr)(argc, argv); } } return TclCommand::call(name, len, argc, argv); } /* * A call to this function can be made from the tkAppInit file at startup * to install the starcat command */ extern "C" int TclWorldCoords_Init(Tcl_Interp* interp) { Tcl_CreateCommand(interp, "wcs", (Tcl_CmdProc*)TclWorldCoords::wcsCmd, NULL, NULL); return TCL_OK; } /* * Implementation of the tcl extended command "wcs" - * usage: see man page for more details */ int TclWorldCoords::wcsCmd(ClientData, Tcl_Interp* interp, int argc, char* argv[]) { if (argc != 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " instanceName\"", NULL); return TCL_ERROR; } TclWorldCoords* cmd = new TclWorldCoords(interp, argv[0], argv[1]); return cmd->status(); } /* * Constructor - * * Create an "wcs" object in tcl for accessing the contents of star * catalogs. * * Note that the tcl command for this object is created in the * parent class constructor. */ TclWorldCoords::TclWorldCoords(Tcl_Interp* interp, const char* cmdname, const char* instname) : TclCommand(interp, cmdname, instname) { } /* * return the given world coords in tcl in hh:mm:ss [+-]dd:mm:ss format */ int TclWorldCoords::set_wcs_result(const WorldCoords& wcs) { if (wcs.status() != 0) return TCL_ERROR; ostringstream os; os << wcs; return set_result(os.str().c_str()); } /* * return the given HMS value in tcl in hh:mm:ss format */ int TclWorldCoords::set_hms_result(const HMS& hms) { ostringstream os; os << hms; return set_result(os.str().c_str()); } /* * If 2 arguments are specified, convert ra and dec from degrees to * hh:mm:ss [+-]dd:mm:ss format. If only one argument is specified, * convert it from floating point format to hh:mm:ss. */ int TclWorldCoords::dtohmsCmd(int argc, char* argv[]) { if (argc == 2) { double ra, dec; if (Tcl_GetDouble(interp_, argv[0], &ra) != TCL_OK || Tcl_GetDouble(interp_, argv[1], &dec) != TCL_OK) { return TCL_ERROR; } return set_wcs_result(WorldCoords(ra, dec)); } double val; if (Tcl_GetDouble(interp_, argv[0], &val) != TCL_OK) return TCL_ERROR; return set_hms_result(HMS(val)); } /* * If 2 arguments are specified, convert ra and dec from hh:mm:ss [+-]dd:mm:ss * format to degrees. If 1 argument is specified, convert the value from * hh:mm:ss to floating point format. */ int TclWorldCoords::hmstodCmd(int argc, char* argv[]) { if (argc == 2) { WorldCoords wcs(argv[0], argv[1]); if (wcs.status()) return error("expected world coordinates in H:M:S [+-]D:M:S format"); return set_result(wcs.ra_deg(), wcs.dec_deg()); } HMS hms(argv[0]); return set_result(hms.val()); } skycat-3.1.2-starlink-1b/astrotcl/generic/TclWorldCoords.h000066400000000000000000000026151215713201500234650ustar00rootroot00000000000000// -*-c++-*- #ifndef _TclWorldCoords_h_ #define _TclWorldCoords_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: TclWorldCoords.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * TclWorldCoords.h - Tcl interface to the WorldCoords C++ class for * manipulating world coordinates * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 07 Nov 95 Created */ #include "TclCommand.h" /* * This class declares the methods used to implement the Tcl WorldCoords * command */ class TclWorldCoords : public TclCommand { protected: // call a member function by name virtual int call(const char* name, int len, int argc, char* argv[]); // utility to return a world coordinate hh:mm:ss [+-]dd:mm:ss value in Tcl int set_wcs_result(const WorldCoords& wcs); // utility to return a hh:mm:ss value in Tcl int set_hms_result(const HMS& hms); public: // constructor TclWorldCoords(Tcl_Interp*, const char* cmdname, const char* instname); // entry point from Tcl static int wcsCmd(ClientData, Tcl_Interp* interp, int argc, char* argv[]); // -- tcl subcommands -- /* int resolveCmd(int argc, char* argv[]); */ int dtohmsCmd(int argc, char* argv[]); int hmstodCmd(int argc, char* argv[]); }; #endif /* _TclWorldCoords_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/WCSRep.C000066400000000000000000000032061215713201500216140ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: WCSRep.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" * * WCS.C - method definitions for class WCS, a reference counting * wrapper class for managing world coordinates for an image. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 30 Sep 96 Created * 17 Mar 98 Made WCSRep an abstract base class to allow * new implementations of WCS. Renamed old WCSRep * to SAOWCS (based on Doug Mink's saoimage version). * abrighto 02/01/06 Renamed WCS.C to WCSRep.C to avoid name conflict * with wcs.c on file systems that ignore case */ static const char* const rcsId="@(#) $Id: WCSRep.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; #include #include #include "error.h" #include "WCSRep.h" /* * constructor for internal representation */ WCSRep::WCSRep() : status_(0), refcnt_(1) { } /* * destructor for internal representation */ WCSRep::~WCSRep() { } /* * copy constructor - increment the reference count... */ WCS::WCS(const WCS& wcs) : rep_(wcs.rep_) { if (rep_) rep_->refcnt_++; } /* * destructor - delete if there are no more references. */ WCS::~WCS() { if (rep_ && --rep_->refcnt_ <= 0) delete rep_; } /* * assignment operator */ WCS& WCS::operator=(const WCS& wcs) { if (wcs.rep_) wcs.rep_->refcnt_++; // protect against "wcs = wcs" if (rep_ && --rep_->refcnt_ <= 0) delete rep_; rep_ = wcs.rep_; return *this; } skycat-3.1.2-starlink-1b/astrotcl/generic/WCSRep.h000066400000000000000000000203411215713201500216600ustar00rootroot00000000000000// -*-c++-*- #ifndef _WCS_h_ #define _WCS_h_ /* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: WCSRep.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" * * WCSRep.h - declarations for class WCS, a reference counted wrapper class * for managing world coordinates for an image. The implementation * class is a subclass of the abstract WCSRep class. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 30 Sep 96 Created * 17 MAr 98 Made WCSRep an abstract class, to allow * new WCS implementations. The old WCSRep * class was renamed to SAOWCS. * pbiereic 11/10/99 Added deltset() * abrighto 02/01/06 Renamed WCS.h to WCSRep.h to avoid name conflict * with wcs.h on file systems that ignore case */ #include "WorldCoords.h" /* * This class is used internally for reference counting. * The public interface is through the WCS class. */ class WCSRep { friend class WCS; private: int refcnt_; // reference count int status_; // status after constructor public: // constructor WCSRep(); // destructor virtual ~WCSRep(); // return class name as a string virtual const char* classname() const = 0; // Return 1 if WCS info is available, else 0 virtual int isWcs() const = 0; // return the world coordinates as a string for the given ximage coords virtual char* pix2wcs(double x, double y, char* buf, int bufsz, int hms_flag = 1) const = 0; // return the world coords (in degrees, as 2 doubles) for the ximage coords virtual int pix2wcs(double x, double y, double& ra, double& dec) const = 0; // get the image coordinates for the given world coords virtual int wcs2pix(double ra, double dec, double &x, double &y) const = 0; // get the image coordinates distance for the given world coords distance in deg virtual int wcs2pixDist(double ra, double dec, double &x, double &y) const = 0; // get the world coords distance in deg for the given image coordinates distance virtual int pix2wcsDist(double x, double y, double& ra, double& dec) const = 0; // set up the WCS structure from the given information about the image virtual int set(double ra, double dec, double secpix, double xrefpix, double yrefpix, int nxpix, int nypix, double rotate, int equinox, double epoch, const char* proj) = 0; // set rotation and scaling virtual int deltset(double cdelt1, double cdelt2, double rotation) = 0; // reset the center of the WCS structure virtual int shift(double ra, double dec, double equinox) = 0; // Return the WCS equinox virtual double equinox() const = 0; // Return the WCS equinox as a string virtual const char* equinoxStr() const = 0; // return the WCS epoch virtual double epoch() const = 0; // return the rotation angle in degrees virtual double rotate() const = 0; // return the width, height, radius of the image in arcmin virtual double width() const = 0; virtual double height() const = 0; virtual double radius() const = 0; // return the number of world coordinate arcsecs per pixel virtual double secPix() const = 0; virtual double xSecPix() const = 0; virtual double ySecPix() const = 0; // return the world coordinates of the center of the image virtual WorldCoords center() const = 0; // return image dimensions virtual int pixWidth() const = 0; virtual int pixHeight() const = 0; // Return the WCS distance between the 2 given WCS points in arcsec */ virtual double dist(double ra0, double dec0, double ra1, double dec1) const = 0; // return the x,y reference pixel values virtual double xRefPix() const = 0; virtual double yRefPix() const = 0; // return the projection type virtual const char* projection() const = 0; // member access virtual int status() const {return status_;} virtual void status(int s) {status_ = s;} }; /* * This class defines the public interface. It uses reference * counting with the above class to make it easier to share copies * of this object. */ class WCS { private: WCSRep* rep_; // internal representation for reference counting public: // default constructor: initialize to null WCS() : rep_(NULL) {} // copy constructor WCS(const WCS&); // Constructor, from a pointer to a subclass of WCSRep. // The memory is managed by this class after this call. WCS(WCSRep* rep) : rep_(rep) {} // destructor ~WCS(); // assignment WCS& operator=(const WCS&); // Return 1 if WCS info is available, else 0 // (always check this before calling any other methods) int isWcs() const {return rep_ && rep_->isWcs();} // return the world coordinates string for the given ximage coords // member access int pixWidth() const {return rep_->pixWidth();} int pixHeight() const {return rep_->pixHeight();} // Return the WCS distance between the 2 given WCS points in arcsec */ double dist(double ra0, double dec0, double ra1, double dec1) const { return rep_->dist(ra0, dec0, ra1, dec1); } char* pix2wcs(double x, double y, char* buf, int bufsz, int hms_flag = 1) const { return rep_->pix2wcs(x, y, buf, bufsz, hms_flag); } // return the world coords (in degrees, as 2 doubles) for the ximage coords int pix2wcs(double x, double y, double& ra, double& dec) const { return rep_->pix2wcs(x, y, ra, dec); } // get the image coordinates for the given world coords int wcs2pix(double ra, double dec, double &x, double &y) const { return rep_->wcs2pix(ra, dec, x, y); } // get the image coordinates distance for the given world coords distance in deg int wcs2pixDist(double ra, double dec, double &x, double &y) const { return rep_->wcs2pixDist(ra, dec, x, y); } // get the world coords distance in deg for the given image coordinates distance int pix2wcsDist(double x, double y, double& ra, double& dec) const { return rep_->pix2wcsDist(x, y, ra, dec); } // set up the WCS structure from the given information about the image int set(double ra, double dec, double secpix, double xrefpix, double yrefpix, int nxpix, int nypix, double rotate, int equinox, double epoch, const char* proj) { return rep_->set(ra, dec, secpix, xrefpix, yrefpix, nxpix, nypix, rotate, equinox, epoch, proj); } // set rotation and scaling int deltset(double cdelt1, double cdelt2, double rotation) { return rep_->deltset(cdelt1, cdelt2, rotation); } // reset the center of the WCS structure int shift(double ra, double dec, double equinox) { return rep_->shift(ra, dec, equinox); } // Return the WCS equinox double equinox() const {return rep_->equinox();} const char* equinoxStr() const {return rep_->equinoxStr();} // return the WCS epoch double epoch() const {return rep_->epoch();} // return the rotation angle in degrees double rotate() const {return rep_->rotate();} // return the width, height, radius of the image in arcmin double width() const {return rep_->width();} double height() const {return rep_->height();} double radius() const {return rep_->radius();} // return the number of world coordinate arcsecs per pixel double secPix() const {return rep_->secPix();} double xSecPix() const {return rep_->xSecPix();} double ySecPix() const {return rep_->ySecPix();} // return the x,y reference pixel values double xRefPix() const {return rep_->xRefPix();} double yRefPix() const {return rep_->yRefPix();} // return the projection type const char* projection() const {return rep_->projection();} // return the world coordinates of the center of the image WorldCoords center() const {return rep_->center();} // note: if status is non-zero, the other methods are undefined int status() const {return rep_ ? rep_->status() : 1;} // return true if the WCS object has been initialized int initialized() const {return rep_ ? 1 : 0;} // return a pointer to the internal class WCSRep* rep() const {return rep_;} }; #endif /* _WCS_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/WorldCoords.C000066400000000000000000000355711215713201500227640ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: WorldCoords.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * WorldCoords.C - method definitions for class WorldCoords * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ static const char* const rcsId="@(#) $Id: WorldCoords.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; #include #include #include #include #include "error.h" #include "wcs.h" #include "WorldCoords.h" // prototypes C routines used (the header files are not ANSI C or C++ compat...) extern "C" { // used to convert equinox int prej_q (double q0[2], // IN: ra+dec at equinox eq0 in degrees double q1[2], // OUT: precessed to equinox eq1 double eq0, // IN: Initial equinox (Julian Years) double eq1); // IN: Final equinox (Julian Years) } /* * check range of ra,dec values and return 0 if OK */ int WorldCoords::checkRange() { double ra = ra_.val(), dec = dec_.val(); if (ra < -0.001 || ra >= 25.0) return error("RA value out of range (0..24 hours)"); if (dec < -90. || dec > 90.) return error("DEC value out of range (-90..+90 deg)"); return 0; } /** Set the equinox from the string and return 0 if okay (defaults to 2000). */ static int getEquinox(const char* equinoxStr, double& equinox) { if (!equinoxStr || strcmp(equinoxStr, "J2000") == 0) { equinox = 2000.; return 0; } if (strcmp(equinoxStr, "B1950") == 0) { equinox = 1950.; return 0; } if (*equinoxStr == 'J' || *equinoxStr == 'B') equinoxStr++; if (sscanf(equinoxStr, "%lf", &equinox) == 1) { return 0; } return 1; } /* * convert from one equinox to another. */ int WorldCoords::convertEquinox(double from_equinox, double to_equinox) { if (from_equinox == to_equinox) return 0; double q0[2], q1[2]; q0[0] = ra_.val() * 15; // hours to degrees q0[1] = dec_.val(); if (prej_q(q0, q1, from_equinox, to_equinox)) { // was successful ra_ = HMS(q1[0]/15); // degrees to hours dec_ = HMS(q1[1]); dec_.show_sign(1); return 0; // OK } // error return char buf[126]; sprintf(buf, "could not convert equinox from %g to %g\n", from_equinox, to_equinox); return error(buf); } /* * Convert from one equinox (or named coordinate system) to another. * The first 2 parameters may be numbers, such as "2000" or "1950", or * coordinate system names, like "J2000", "FK5", "GALACTIC", "ECLIPTIC", ... * Epoch is the besselian epoch in years. * If dflag is 1, the ra value was converted to hours by dividing by 15 */ int WorldCoords::convertEquinox(const char* fromEquinoxStr, const char* toEquinoxStr, double epoch, int dflag) { // check for numerical equinox double from_equinox = 0.; double to_equinox = 0.; if (getEquinox(fromEquinoxStr, from_equinox) == 0 && getEquinox(toEquinoxStr, to_equinox) == 0) return convertEquinox(from_equinox, to_equinox); // convert from one system to another int sys1 = wcscsys((char*)fromEquinoxStr); if (sys1 == -1) return error("bad equinox value: ", fromEquinoxStr); int sys2 = wcscsys((char*)toEquinoxStr); if (sys2 == -1) return error("bad equinox value: ", toEquinoxStr); double dtheta = ra_.val(); if (dflag) dtheta *= 15; // hours to degrees double dphi = dec_.val(); wcscon(sys1, sys2, from_equinox, to_equinox, &dtheta, &dphi, epoch); if (sys2 == WCS_J2000 || sys2 == WCS_B1950) dtheta /= 15; // degrees to hours ra_ = HMS(dtheta); dec_ = HMS(dphi); dec_.show_sign(1); return 0; } /* * constructor: note that the ra arg is H:M:S, while dec is D:M:S */ WorldCoords::WorldCoords(const HMS& ra, const HMS& dec, double equinox) : ra_(ra), dec_(dec) { dec_.show_sign(1); status_ = checkRange() || convertEquinox(equinox); } /* * constructor: note that the ra arg is H:M:S, while dec is D:M:S. * EquinoxStr may be a number or the system name, such as "GALACTIC" or "ECLIPTIC". */ WorldCoords::WorldCoords(const HMS& ra, const HMS& dec, const char* equinoxStr) : ra_(ra), dec_(dec) { dec_.show_sign(1); status_ = convertEquinox(equinoxStr); } /* * constructor: note that the ra and dec args are both in degrees */ WorldCoords::WorldCoords(double ra, double dec, double equinox) : ra_(ra/15), dec_(dec) { dec_.show_sign(1); status_ = checkRange() || convertEquinox(equinox); } /* * constructor: note that the ra and dec args are both in degrees. * equinoxStr may be a number or the system name, such as "GALACTIC" or "ECLIPTIC". */ WorldCoords::WorldCoords(double ra, double dec, const char* equinoxStr) : ra_(ra/15), dec_(dec) { dec_.show_sign(1); status_ = convertEquinox(equinoxStr); } /* * constructor: note that r... is H:M:S, while d... is D:M:S */ WorldCoords::WorldCoords(double rh, int rm, double rs, double dd, int dm, double ds, double equinox) : ra_(rh, rm, rs), dec_(dd, dm, ds) { dec_.show_sign(1); status_ = checkRange() || convertEquinox(equinox); } /* * constructor: note that r... is H:M:S, while d... is D:M:S. * equinoxStr may be a number or the system name, such as "GALACTIC" or "ECLIPTIC". */ WorldCoords::WorldCoords(double rh, int rm, double rs, double dd, int dm, double ds, const char* equinoxStr) : ra_(rh, rm, rs), dec_(dd, dm, ds) { dec_.show_sign(1); status_ = convertEquinox(equinoxStr); } /* * constructor - parse a free format string assumed to contain RA and DEC * * Allowed formats of input string: * * hh mm ss.s +/-dd mm ss.s * or * d.ddd +/-d.dddd * * or * hh +/-d.dddd * * If hflag is 1 and the ra value is not in H:M:S and is not an integer, * convert to hours by dividing by 15. */ WorldCoords::WorldCoords(const char* ra_str, const char* dec_str, double equinox, int hflag) : status_(0), ra_(ra_str, hflag), dec_(dec_str) { if (ra_.isNull()) { status_ = 1; return; } if (dec_.isNull()) { status_ = 1; return; } dec_.show_sign(1); status_ = checkRange() || convertEquinox(equinox); } /* * constructor - parse coordinates in string format as above, except that * equinoxStr may be a number or the system name, such as "GALACTIC" or "ECLIPTIC". */ WorldCoords::WorldCoords(const char* ra_str, const char* dec_str, const char* equinoxStr, int hflag) : status_(0), dec_(dec_str) { int dflag = 0; // set to 1 if ra was divided by 15 ra_ = HMS(ra_str, hflag, &dflag); if (ra_.isNull()) { status_ = 1; return; } if (dec_.isNull()) { status_ = 1; return; } dec_.show_sign(1); double equinox = 2000.; if (getEquinox(equinoxStr, equinox) == 0) { status_ = checkRange() || convertEquinox(equinox); } else { // hack - need to know if the RA value is in hours or deg status_ = convertEquinox(equinoxStr, "J2000", 0., dflag); } } /* * Print the coordinates in the given buffers: * If hmsFlag is non-zero, in H:M:S [+-]D:M:S format, otherwise in decimal * degrees. */ void WorldCoords::print(char* ra_buf, char* dec_buf, double equinox, int hmsFlag) { if (equinox == 2000.0) { if (hmsFlag) { ra_.print(ra_buf); dec_.print(dec_buf); } else { sprintf(ra_buf, "%.17g", ra_deg()); sprintf(dec_buf, "%.17g", dec_deg()); } } else { // make tmp copy and convert equinox before printing WorldCoords tmp = *this; tmp.convertEquinox(2000.0, equinox); if (hmsFlag) { tmp.ra_.print(ra_buf); tmp.dec_.print(dec_buf); } else { sprintf(ra_buf, "%.17g", tmp.ra_deg()); sprintf(dec_buf, "%.17g", tmp.dec_deg()); } } } /* * Print the coordinates in the given buffers: * If hmsFlag is non-zero, in H:M:S [+-]D:M:S format, otherwise in decimal * degrees. * Here equinoxStr may be a number or the system name, such as "GALACTIC" or "ECLIPTIC". * The printed coordinates are converted to the given equinox (or system). */ void WorldCoords::print(char* ra_buf, char* dec_buf, const char* equinoxStr, int hmsFlag) { double equinox = 2000.; if (getEquinox(equinoxStr, equinox) == 0) { print(ra_buf, dec_buf, equinox, hmsFlag); } else { // make tmp copy and convert equinox before printing WorldCoords tmp = *this; tmp.convertEquinox("J2000", equinoxStr); if (hmsFlag) { tmp.ra_.print(ra_buf); tmp.dec_.print(dec_buf); } else { sprintf(ra_buf, "%.17g", tmp.ra_deg()); sprintf(dec_buf, "%.17g", tmp.dec_deg()); } } } /* * Print the coordinates to the given stream in the given equinox. */ void WorldCoords::print(ostream& os, double equinox) { if (equinox == 2000.0) { os << *this; } else { // make tmp copy and convert equinox before printing WorldCoords tmp = *this; tmp.convertEquinox(2000.0, equinox); os << tmp; } } /* * Print the coordinates to the given stream in the given equinox (or system). * Here equinoxStr may be a number or the system name, such as "GALACTIC" or "ECLIPTIC". */ void WorldCoords::print(ostream& os, const char* equinoxStr) { double equinox = 2000.; if (getEquinox(equinoxStr, equinox) == 0) { print(os, equinox); } else { // make tmp copy and convert equinox before printing WorldCoords tmp = *this; tmp.convertEquinox("J2000", equinoxStr); os << tmp; } } /* * get ra and dec in degrees in the given equinox */ void WorldCoords::get(double& ra, double& dec, double equinox) { if (equinox == 2000.0) { ra = ra_deg(); dec = dec_deg(); } else { // make tmp copy and convert equinox WorldCoords tmp = *this; tmp.convertEquinox(2000.0, equinox); ra = tmp.ra_deg(); dec = tmp.dec_deg(); } } /* * Get ra and dec in degrees in the given equinox. * Here equinoxStr may be a number or the system name, such as "GALACTIC" or "ECLIPTIC". */ void WorldCoords::get(double& ra, double& dec, const char* equinoxStr) { double equinox = 2000.; if (getEquinox(equinoxStr, equinox) == 0) { get(ra, dec, equinox); } else { // make tmp copy and convert equinox WorldCoords tmp = *this; tmp.convertEquinox("J2000", equinoxStr); ra = tmp.ra_.val(); dec = tmp.dec_.val(); } } /* * output operator: format: h:m:s[+-]d:m:s (J2000) or "" for null coords */ ostream& operator<<(ostream& os, const WorldCoords& pos) { if (pos.isNull()) os << "\"\""; else os << pos.ra_ << " " << pos.dec_; return os; } #if 0 /* * input operator: format: h:m:s[+-]d:m:s (J2000) */ istream& operator>>(istream& is, WorldCoords& pos) { is >> pos.ra_ >> pos.dec_; // XXX need to input equinox ? pos.dec_.show_sign(1); return is; } #endif /* * util: dispos computes distance and position angle solving a spherical * triangle (no approximations) * INPUT :coords in decimal degrees * OUTPUT :dist in arcmin, returns phi in degrees (East of North) * AUTHOR :a.p.martinez */ static double dispos(double dra0, // IN: center RA double decd0, // IN: center DEC double dra, // IN: point RA double decd, // IN: point DEC double& dist) // OUT: distance in arcmin { double alf,alf0,del,del0,phi; double sd,sd0,cd,cd0,cosda,cosd,sind,sinpa,cospa; const double radian=180./M_PI; // coo transformed in radiants alf = dra / radian ; alf0= dra0 / radian ; del = decd / radian; del0= decd0 / radian; sd0=sin(del0); sd =sin(del); cd0=cos(del0); cd =cos(del); cosda=cos(alf-alf0); cosd=sd0*sd+cd0*cd*cosda; dist=acos(cosd); phi=0.0; if(dist > 0.0000004) { sind=sin(dist); cospa=(sd*cd0 - cd*sd0*cosda)/sind; //if(cospa>1.0)cospa=1.0; if (abs(cospa) > 1.0) cospa=cospa/abs(cospa); // 2005-06-02: fix from awicenec@eso.org sinpa=cd*sin(alf-alf0)/sind; phi=acos(cospa)*radian; if(sinpa < 0.0)phi = 360.0-phi; } dist *=radian; dist *=60.0; if(decd0 == 90.) phi = 180.0; if(decd0 == -90.) phi = 0.0; return(phi); } /* * return the distance between this position and the given one in arcmin */ double WorldCoords::dist(WorldCoords& pos) const { double dist; dispos(ra_deg(), dec_deg(), pos.ra_deg(), pos.dec_deg(), dist); return dist; } /* * return the distance between this position and the given one in arcmin * and also set the position angle */ double WorldCoords::dist(WorldCoords& pos, double& pa) const { double dist; pa = dispos(ra_deg(), dec_deg(), pos.ra_deg(), pos.dec_deg(), dist); return dist; } /* * static member to get the distance between 2 points in arcmin */ double WorldCoords::dist(double ra0, double dec0, double ra1, double dec1) { double dist; dispos(ra0, dec0, ra1, dec1, dist); return dist; } // taken from starbase: search.c, used below #define X__PI 3.14159265358979323846 #define X_2PI ( 2 * X__PI ) #define X_R2D (X_2PI / 360.0) #define X_R2H (X_2PI / 24.0) #define X_H2D (360.0 / 24.0) #define r2h(r) ( (r) / X_R2H ) #define h2r(d) ( (d) * X_R2H ) #define r2d(r) ( (r) / X_R2D ) #define d2r(d) ( (d) * X_R2D ) #define h2d(r) ( (r) * X_H2D ) #define d2h(d) ( (d) / X_H2D ) /* * Given a radius in arcmin, set pos1 and pos2 to the 2 endpoints that form a box * with center at this position. */ int WorldCoords::box(double radius, WorldCoords& pos1, WorldCoords& pos2) const { // get units in degrees double ra = ra_.val(), dec = dec_.val(); radius /= 60.0; // get width of square double width = sqrt(2.0*radius*radius); double r1, r2, d1, d2; double cosdec; d1 = dec - width / 2.0; if ( d1 <= -90.0 ) { d1 = -90.0; d2 = dec + width / 2.0; r1 = 0.0; r2 = 24.0; } else { d2 = dec + width / 2.0; if ( d2 >= 90.0 ) { d1 = dec - width / 2.0; d2 = 90.0; r1 = 0.0; r2 = 24.0; } else { if ( dec > 0.0 ) cosdec = fabs(cos(d2r(d1))); else cosdec = fabs(cos(d2r(d2))); r1 = ra - d2h(width) / 2 / cosdec; r2 = ra + d2h(width) / 2 / cosdec; if ( r1 < 0.0 ) r1 += 24; if ( r2 > 24.0 ) r2 -= 24; } } pos1 = WorldCoords(h2d(r1), d1); pos2 = WorldCoords(h2d(r2), d2); return 0; } /* * Given the endpoints of a box (pos1, pos2), set width, height and radius in * arcmin, and return the position at the center of the box */ WorldCoords WorldCoords::center(const WorldCoords& pos1, const WorldCoords& pos2, double& radius, double& width, double& height) { WorldCoords result; if (pos1.status() || pos2.status()) { error("invalid WCS position argument"); return result; } // get center pos double ra1 = pos1.ra_deg(), dec1 = pos1.dec_deg(); double ra2 = pos2.ra_deg(), dec2 = pos2.dec_deg(); double ra = (ra1 + ra2)/2.0; double dec = (dec1 + dec2)/2.0; result = WorldCoords(ra, dec); // get width and height of box width = (wcsdist(ra1, dec1, ra2, dec1) * 60.); height = (wcsdist(ra1, dec1, ra1, dec2) * 60.); // radius is half the distance from pos1 to pos2 radius = (wcsdist(ra1, dec1, ra2, dec2) * 60.)/2.; return result; } skycat-3.1.2-starlink-1b/astrotcl/generic/WorldCoords.h000066400000000000000000000133071215713201500230220ustar00rootroot00000000000000// -*-c++-*- #ifndef _WorldCoords_h_ #define _WorldCoords_h_ /* * E.S.O. - VLT project * $Id: WorldCoords.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * WorldCoords.h - class representing world coordinates * (right-ascension, declination, stored as J2000 internally) * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 27 Sep 95 Created * Peter W. Draper 24 Mar 09 Made checkRange virtual for subclasses */ #include #include "HMS.h" const double WCS_NULL = HMS_NULL; // null value for double coordinate value /* * Class WorldCoords */ class WorldCoords { protected: HMS ra_, dec_; // right-ascension, declination int status_; // status for errors in constructor // convert from one equinox to another int convertEquinox(double from_equinox, double to_equinox = 2000.0); // convert from one equinox (or named coordinate system) to another (string version). // equinoxStr may be a numerical equinox value, or a coordinate system name, such as // "J2000", "FK5", "GALACTIC", "ECLIPTIC", etc. (upper or lower case, abbrieviations okay). // If dflag is 1, the ra value was converted to hours by dividing by 15 int convertEquinox(const char* from_equinox, const char* to_equinox = "J2000", double epoch = 0., int dflag = 1); // check range of ra,dec values virtual int checkRange(); public: // constructor - initialize null coords WorldCoords() : status_(0) {} // constructor: note that ra is H:M:S, while dec is D:M:S WorldCoords(const HMS& ra, const HMS& dec, double equinox = 2000.0); // constructor: note that ra is H:M:S, while dec is D:M:S WorldCoords(const HMS& ra, const HMS& dec, const char* equinoxStr); // constructor: note that ra and dec are both in degrees WorldCoords(double ra, double dec, double equinox = 2000.0); // constructor: note that ra and dec are both in degrees WorldCoords(double ra, double dec, const char* equinoxStr); // constructor: note that r... is H:M:S, while d... is D:M:S WorldCoords(double rh, int rm, double rs, double dd, int dm, double ds, double equinox = 2000.0); // constructor: note that r... is H:M:S, while d... is D:M:S WorldCoords(double rh, int rm, double rs, double dd, int dm, double ds, const char* equinoxStr); // constructor - parse RA and DEC in string format WorldCoords(const char* ra, const char* dec, double equinox = 2000.0, int hflag = 0); // constructor - parse coordinates in string format // Note: equinoxStr may be a number or the system name, such as "GALACTIC" or "ECLIPTIC" WorldCoords(const char* ra, const char* dec, const char* equinoxStr, int hflag = 0); // return true if the coords are null int isNull() const {return ra_.isNull() || dec_.isNull();} // set to the null value void setNull() {ra_.setNull(); dec_.setNull();} #if 0 // input operator: format: H:M:S[+-]D:M:S, J2000 friend istream& operator>>(istream&, WorldCoords& pos); #endif // output operator: format: H:M:S[+-]D:M:S, J2000 friend ostream& operator<<(ostream&, const WorldCoords& pos); // print coords to the given buffer with given equinox in the given format void print(char* ra_buf, char* dec_buf, double equinox = 2000.0, int hmsFlag=1); // print coords to the given buffer with given equinox in the given format // Note: equinoxStr may be a number or the system name, such as "GALACTIC" or "ECLIPTIC" void print(char* ra_buf, char* dec_buf, const char* equinoxStr, int hmsFlag=1); // print coords to the given stream with the given equinox in H:M:S format void print(ostream& os, double equinox = 2000.0); // print coords to the given stream with the given equinox (or system name) in H:M:S format void print(ostream& os, const char* equinoxStr); // get ra and dec in degrees in the given equinox void get(double& ra, double& dec, double equinox); // get ra and dec in degrees in the given equinox void get(double& ra, double& dec, const char* equinoxStr); // check for equality int operator==(const WorldCoords& pos) const { return ra_ == pos.ra_ && dec_ == pos.dec_; } int operator!=(const WorldCoords& pos) const { return ra_ != pos.ra_ || dec_ != pos.dec_; } // return the difference between 2 world coord points friend WorldCoords operator-(const WorldCoords& a, const WorldCoords& b) { return WorldCoords(a.ra_ - b.ra_, a.dec_ - b.dec_); } // short cuts // return ra and dec in degrees double ra_deg() const {return ra_.val()*15;} double dec_deg() const {return dec_.val();} // get distance in arcmin between points double dist(WorldCoords& pos) const; // get distance in arcmin and position angle between points double dist(WorldCoords& pos, double& pa) const; // static member to get the distance between 2 points (in deg) in arcmin static double dist(double ra0, double dec0, double ra1, double dec1); // Given a radius in arcmin, set pos1 and pos2 to the 2 endpoints that form a box // with center at this position. int box(double radius, WorldCoords& pos1, WorldCoords& pos2) const; // Given the endpoints of a box (pos1, pos2), set width, height and radius in // arcmin, and return the center position of the box. static WorldCoords center(const WorldCoords& pos1, const WorldCoords& pos2, double& radius, double& width, double& height); // member access const HMS& ra() const {return ra_;} const HMS& dec() const {return dec_;} int status() const {return status_;} }; #endif /* _WorldCoords_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/WorldOrImageCoords.h000066400000000000000000000127301215713201500242650ustar00rootroot00000000000000// -*-c++-*- #ifndef _WorldOrImageCoords_h_ #define _WorldOrImageCoords_h_ /* * E.S.O. - VLT project * $Id: WorldOrImageCoords.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * WorldOrImageCoords.h - class representing either world (ra, dec, equinox) * or image (x, y) coordinates * (see also class WorldCoords, class ImageCoords) * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 97 Created */ #include "WorldCoords.h" #include "ImageCoords.h" /* * Class WorldOrImageCoords - This class is designed to be used in * situations where you might need to deal with either world coordinates * or image coordinates, but don't know ahead of time which. We could * use a common base class and virtual methods, but that would require * using pointers or references, while it is often more convenient to use * instances of these classes. Also, the methods in both classes have * slightly different signatures. */ class WorldOrImageCoords { protected: WorldCoords wc_; // used for world coords ImageCoords ic_; // used for image coords int isWcs_; // flag: true if using world coords public: // constructor - initialize null coords WorldOrImageCoords() : isWcs_(0) {} // constructor: initialize world coords WorldOrImageCoords(WorldCoords wc) : wc_(wc), isWcs_(1) {} // constructor: initialize image coords WorldOrImageCoords(ImageCoords ic) : ic_(ic), isWcs_(0) {} // return true if the coords are null int isNull() const {return isWcs_ ? wc_.isNull() : ic_.isNull();} // set to the null value void setNull() {if (isWcs_) wc_.setNull(); else ic_.setNull();} // output operator friend ostream& operator<<(ostream& os, const WorldOrImageCoords& pos) { if (pos.isWcs_) os << pos.wc_; else os << pos.ic_; return os; } // print coords to the given buffer in the given equinox void print(char* x_buf, char* y_buf, double equinox = 2000., int hmsFlag=1) { if (isWcs_) wc_.print(x_buf, y_buf, equinox, hmsFlag); else ic_.print(x_buf, y_buf); } // print coords to the given buffer in the given equinox (or system, such as "GALACTIC", "ECLIPTIC") void print(char* x_buf, char* y_buf, const char* equinoxStr, int hmsFlag=1) { if (isWcs_) wc_.print(x_buf, y_buf, equinoxStr, hmsFlag); else ic_.print(x_buf, y_buf); } // print coords to the given stream in the given equinox void print(ostream& os, double equinox = 2000.) { if (isWcs_) wc_.print(os, equinox); else ic_.print(os); } // print coords to the given stream in the given equinox (or system, such as "GALACTIC", "ECLIPTIC") void print(ostream& os, const char* equinoxStr) { if (isWcs_) wc_.print(os, equinoxStr); else ic_.print(os); } // get x and y void get(double& x, double& y, double equinox = 2000.) { if (isWcs_) wc_.get(x, y, equinox); else ic_.get(x, y); } // check for equality int operator==(const WorldOrImageCoords& pos) const { return isWcs_ ? (wc_ == pos.wc_) : (ic_ == pos.ic_); } int operator!=(const WorldOrImageCoords& pos) const { return isWcs_ ? (wc_ != pos.wc_) : (ic_ != pos.ic_); } // return the difference between 2 image coord points friend WorldOrImageCoords operator-(const WorldOrImageCoords& a, const WorldOrImageCoords& b) { if (a.isWcs_ && b.isWcs_) return WorldOrImageCoords(a.wc_ - b.wc_); return WorldOrImageCoords(a.ic_ - b.ic_); } // short cuts // return ra and dec in degrees double ra_deg() const {return wc_.ra_deg();} double dec_deg() const {return wc_.dec_deg();} // return the internal WorldCoords or ImageCoords class WorldCoords& wc() {return wc_;} ImageCoords& ic() {return ic_;} const WorldCoords& wc() const {return wc_;} const ImageCoords& ic() const {return ic_;} // get distance between points double dist(WorldOrImageCoords& pos, double& pa) const { return isWcs_ ? wc_.dist(pos.wc_, pa) : ic_.dist(pos.ic_); } // get distance between points double dist(WorldOrImageCoords& pos) const { return isWcs_ ? wc_.dist(pos.wc_) : ic_.dist(pos.ic_); } // Given a radius, set pos1 and pos2 to the 2 endpoints that form a box // with center at this position. int box(double radius, WorldOrImageCoords& pos1, WorldOrImageCoords& pos2) const { return (pos1.isWcs_ = pos2.isWcs_ = isWcs_) ? wc_.box(radius, pos1.wc_, pos2.wc_) : ic_.box(radius, pos1.ic_, pos2.ic_); } // Given the endpoints of a box (pos1, pos2), set width, height and radius // and return the center position of the box. static WorldOrImageCoords center(const WorldOrImageCoords& pos1, const WorldOrImageCoords& pos2, double& radius, double& width, double& height) { if (pos1.isWcs_ && pos2.isWcs_) return WorldOrImageCoords(WorldCoords::center(pos1.wc_, pos2.wc_, radius, width, height)); return WorldOrImageCoords(ImageCoords::center(pos1.ic_, pos2.ic_, radius, width, height)); } // member access const HMS& ra() const {return wc_.ra();} const HMS& dec() const {return wc_.dec();} double x() const {return ic_.x();} double y() const {return ic_.y();} // return true if using WorldCoords double isWcs() const {return isWcs_;} int status() const {return isWcs_ ? wc_.status() : ic_.status();} }; #endif /* _WorldOrImageCoords_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/compiler.h000066400000000000000000000037221215713201500223730ustar00rootroot00000000000000/* static char sccsid[] = "@(#) ST-ECF os/h/compiler.h 4.1 10/16/92"; */ /* @(#)compiler.h 1.1.1.1 (ESO-IPG) 7/11/91 20:24:30 */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .TYPE Header .NAME compiler.h .LANGUAGE C .AUTHOR Francois Ochsenbein [ESO-IPG] .CATEGORY Compiler-specfic Definitions .COMMENTS This module includes constants depending on the compiler. .ENVIRONMENT .VERSION 1.0 Created file ------------------------------------------------------------*/ #ifndef COMPILER_DEF #define COMPILER_DEF 0 /*=========================================================================== * Define Here Your Specific Implementation *===========================================================================*/ #define _TEMPLATES_ 1 /* Function templates */ #if 0 /* Example */ #define CC_ENV _TURBOC #define _TEMPLATES_ 1 /* Function templates */ #endif /* End of Example */ /*=========================================================================== * Function Templates Facilities *===========================================================================*/ /*=========================================================================== * List of supported Compilers *===========================================================================*/ #define _TURBOC 1 #define CC_TURBOC (CC_ENV == _TURBOC) #ifndef CC_ENV /*=========================================================================== * Definition of Default Compiler *===========================================================================*/ #define CC_ENV 0 #endif #ifndef _TEMPLATES_ /*=========================================================================== * Definition of Allowed Function Templates *===========================================================================*/ # ifndef OSDEFOS_DEF #include "osdefos.h" # endif #if OS_VMS # define _TEMPLATES_ 1 #else # define _TEMPLATES_ 0 #endif #endif #endif skycat-3.1.2-starlink-1b/astrotcl/generic/cotr.c000066400000000000000000000227511215713201500215260ustar00rootroot00000000000000/* static char sccsid[] = "@(#) ST-ECF as/src/cotr.c 4.1 12/6/91"; */ /*++++++ .TYPE Module .IDENTIFICATION cotr.c .VERSION 1.0 26-Feb-1987: Creation . .VERSION 1.1 24-Oct-1988: Changed Names .VERSION 1.2 03-May-1989: Changed statics .Language C .AUTHOR Francois Ochsenbein [ESO-IPG] .KEYWORDS Spherical Coordinate transformations .ENV .COMMENTS The routines provided in this module all deal with coordinate transformations. All spherical coordinates are assumed to be expressed in DEGREES. No function is traced. \begin{TeX} The parameter mnemonics are: \begin{itemize} \item o = array $[\alpha,\delta]$ of spherical coordinates, expressed in degrees. \item R = $3 \times 3$ Rotation (orthogonal) matrix from old to new coordinate frame \item u = vector $[x,y,z]$ of Unit (cosine) direction $(x^2+y^2+z^2=1)$ \end{itemize} \end{TeX} -----------------------------------------------------------------------*/ #include "trigo.h" /* Definitions */ #include "ok.h" #define ra o[0] #define dec o[1] #define x u[0] #define y u[1] #define z u[2] #define X p[0] #define Y p[1] #define ze Euler_angles[0] #define theta Euler_angles[1] #define zeta Euler_angles[2] /*============================================================================*/ int tr_Euler (Euler_angles, R) /*+++ .PURPOSE Compute the rotation matrix from Euler angles .METHOD \begin{TeX} $(z, \theta, \zeta)$. This rotation matrix is actually defined by $$ R = R_z(-z) \cdot R_y(\theta) \cdot R_z(-\zeta)$$ (from old to new frame). \end{TeX} .RETURNS OK ---*/ double Euler_angles[3]; /* IN: Euler angles (z, theta, zeta) */ double R[3][3]; /* OUT: rotation matrix */ { double w; R[0][2] = cosd(ze); R[1][2] = sind(ze); R[2][0] = cosd(zeta); R[2][1] = sind(zeta); R[2][2] = cosd(theta); w = sind(theta); R[0][0] = R[2][0]*R[2][2]*R[0][2] - R[2][1]*R[1][2]; R[1][0] = R[2][0]*R[2][2]*R[1][2] + R[2][1]*R[0][2]; R[0][1] = -R[2][1]*R[2][2]*R[0][2] - R[2][0]*R[1][2]; R[1][1] = -R[2][1]*R[2][2]*R[1][2] + R[2][0]*R[0][2]; R[2][0] = R[2][0]*w; R[2][1] = -R[2][1]*w; R[0][2] = -w*R[0][2]; R[1][2] = -w*R[1][2]; return(OK); } /*============================================================================*/ int tr_oo( o , o2, R) /*+++ .PURPOSE Rotate polar coordinates, using a R rotation matrix (old to new frame) .METHOD Use unit vectors .RETURNS OK ---*/ double o[2]; /* IN: Original angles */ double o2[2]; /* OUT: rotated angles */ double R[3][3]; /* IN: Rotation matrix */ { double us[3]; tr_ou ( o, us); /* tranforms polar angles into dir cos */ tr_uu (us, us, R); /* rotates dir cos */ return(tr_uo(us, o2)); /* transform unit vector to angles */ } /*============================================================================*/ int tr_oo1( o , o2 , R) /*+++ .PURPOSE Rotate polar coordinates, using the inversed R matrix (new to old frame). .METHOD Use unit vectors .RETURNS Non-zero value ---*/ double o[2]; /* IN: original angles */ double o2[2]; /* OUT: rotated angles */ double R[3][3]; /* IN: rotation matrix */ { double us[3]; tr_ou ( o, us); /* tranforms polar angles into dir cos */ tr_uu1 (us, us, R); /* rotates dir cos */ return(tr_uo(us, o2)); /* transform unit vector to angles */ } /*============================================================================*/ int tr_oR ( o , R ) /*+++ .PURPOSE Creates the rotation matrix R[3][3] defined as \begin{TeX} \begin{itemize} \item R[0] (first row) = unit vector towards Zenith \item R[1] (second row) = unit vector towards East \item R[2] (third row) = unit vector towards North \end{itemize} The resulting $R$ matrix can then be used to get the components $\vec{v}_{loc}$ of a vector $\vec{v}$ in the local frame, as {\tt tr\_uu}($\vec{v}$, $\vec{v}_{loc}$, $R$). \end{TeX} .RETURNS OK ---*/ double o[2]; /* IN: original angles */ double R[3][3]; /* OUT: rotation matrix */ { R[2][2] = cosd(dec); R[0][2] = sind(dec); R[1][1] = cosd(ra); R[1][0] = -sind(ra); R[1][2] = 0.e0; R[0][0] = R[2][2] * R[1][1]; R[0][1] = -R[2][2] * R[1][0]; R[2][0] = -R[0][2] * R[1][1]; R[2][1] = R[0][2] * R[1][0]; return(OK); } /*============================================================================*/ int tr_ou (o , u) /*+++ .PURPOSE Transformation from polar coordinates to Unit vector .RETURNS OK ---*/ double o[2]; /* IN: angles ra + dec in degrees */ double u[3]; /* OUT: dir cosines */ { double cosdec; cosdec = cosd(dec); x = cosdec * cosd(ra); y = cosdec * sind(ra); z = sind(dec); return (OK); } /*============================================================================*/ int tr_uo (u,o) /*+++ .PURPOSE Computes angles from direction cosines .RETURNS OK / NOK (x=y=z=0) ---*/ double u[3]; /* IN: Dir cosines */ double o[2]; /* OUT: Angles ra + dec in degrees */ { double r2; /* sqrt(x*x+y*y) */ r2 = x*x + y*y; ra =0.e0; if (r2 == 0.e0) /* in case of poles */ { if (z == 0.e0) return(NOK); dec = ( z>0.e0 ? 90.e0 : -90.e0); return(OK); } dec = atand ( z / sqrt(r2)); ra = atan2d (y , x ); if (ra < 0.e0) ra += 360.e0; return (OK); } /*============================================================================*/ int tr_uR ( u , R ) /*+++ .PURPOSE Creates the rotation matrix R[3][3] with \begin{TeX} \begin{itemize} \item R[0] (first row) = unit vector towards Zenith \item R[1] (second row) = unit vector towards East \item R[2] (third row) = unit vector towards North \end{itemize} \end{TeX} .RETURNS OK .REMARKS For the poles, \begin{TeX} ($|z|=1$), the rotation axis is assumed be the $y$ axis, i.e. the right ascension is assumed to be 0. \end{TeX} ---*/ double u[3]; /* IN: Original direction */ double R[3][3]; /* OUT: Rotation matrix */ { R[0][0] = x; R[0][1] = y; R[0][2] = z; R[2][2] = hypot ( x , y ); R[1][0] = 0.e0; R[1][1] = 1.e0; /* These are defaults for poles */ R[1][2] = 0.e0; if (R[2][2] != 0.e0) { R[1][1] = x / R[2][2]; R[1][0] = -y / R[2][2]; } R[2][0] = -R[0][2] * R[1][1]; R[2][1] = R[0][2] * R[1][0]; return(OK); } /*============================================================================*/ int tr_uu( u1 , u2 , R ) /*+++ .PURPOSE Rotates the unit vector u1 to u2, as \begin{TeX} \quad $\vec{u_2} = R \cdot \vec{u_1}$ \quad (old to new frame) \end{TeX} .RETURNS OK ---*/ double u1[3]; /* IN: Unit vector */ double u2[3]; /* OUT: Resulting unit vector after rotation */ double R[3][3]; /* IN: rotation matrix (e.g. created by tr_oR)*/ { register int i,j; register double val; double u_stack[3]; /* allows same address for input/output */ for (i=0; i<3; i++) { val = 0.e0; for (j=0; j<3; j++) val += R[i][j]*u1[j]; u_stack[i] = val; } for (i=0; i<3; i++) u2[i] = u_stack[i]; /* copies to output */ return(OK); } /*============================================================================*/ int tr_uu1 ( u1 , u2 , R) /*+++ .PURPOSE Rotates the unit vector u1 to u2, as \begin{TeX} \quad $\vec{u_2} = R^{-1} \cdot \vec{u_1}$ \quad (new to old frame). \end{TeX} .RETURNS OK ---*/ double u1[3]; /* IN: Unit vector */ double u2[3]; /* OUT: Resulting unit vector after rotation */ double R[3][3]; /* IN: rotation matrix (e.g. created by tr_oR) */ { register int i,j; register double val; double u_stack[3]; /* allows same address for input/output */ for (i=0; i<3; i++) { for (j=0, val = 0.0e0; j<3; j++) val += R[j][i]*u1[j]; u_stack[i] = val; } for (i=0; i<3; i++) u2[i] = u_stack[i]; /* copies to output */ return(OK); } /*============================================================================*/ int tr_RR ( A , B , R) /*+++ .PURPOSE Product of orthogonal matrices \begin{TeX} \quad $B = R \cdot A$ \quad \end{TeX} .RETURNS OK ---*/ double A[3][3]; /* IN: First Matrix */ double B[3][3]; /* OUT: Result Matrix */ double R[3][3]; /* IN: Rotation Matrix */ { register int i, j, k; double val; double Rs[3][3]; /* Local copy */ for (i=0; i<3; i++) for (j=0; j<3; j++) { for (k=0, val=0.0e0; k<3; k++) val += R[i][k]*A[k][j]; Rs[i][j] = val; } for (i=0; i<3; i++) for (j=0; j<3; j++) B[i][j] = Rs[i][j]; return(OK); } /*============================================================================*/ int tr_RR1 ( A , B , R) /*+++ .PURPOSE Product of orthogonal matrices \begin{TeX} \quad $B = R^{-1} \cdot A$ \quad \end{TeX} .RETURNS OK ---*/ double A[3][3]; /* IN: First Matrix */ double B[3][3]; /* OUT: Result Matrix */ double R[3][3]; /* IN: Rotation Matrix */ { register int i, j, k; double val; double Rs[3][3]; /* Local copy */ for (i=0; i<3; i++) for (j=0; j<3; j++) { for (k=0, val=0.0e0; k<3; k++) val += R[k][i]*A[k][j]; Rs[i][j] = val; } for (i=0; i<3; i++) for (j=0; j<3; j++) B[i][j] = Rs[i][j]; return(OK); } skycat-3.1.2-starlink-1b/astrotcl/generic/jprec.c000066400000000000000000000154761215713201500216700ustar00rootroot00000000000000/* static char sccsid[] = "@(#) ST-ECF as/src/jprec.c 4.1 12/6/91"; */ /*+++++++++++++++ .TYPE Module .IDENTIFICATION jprec.c .VERSION 1.0 27-Feb-1987: Creation . .VERSION 1.1 26-Oct-1988: Cosmetic modifications .Language C .AUTHOR Francois Ochsenbein [ESO-IPG] .KEYWORDS Precession of Coordinates in new IAU system. .ENV .COMMENTS \begin{TeX} This module uses the new (IAU 76) precession constants, and assumes the FK5 system. Precession constants are taken from Lederl\'e and Schwan (Astron. Astrophys. {\bf 134}, 1, 1984), Liske J.H. (Astron. Astrophys. {\bf 73}, 282, 1979), Dates must be expressed in {\em Julian Years}. The precession may be applied on unit vectors (mnemonic {\tt u}), or on equatorial coordinates (mnemonic {\tt q}). \end{TeX} -----------------------------------------------------------------------*/ #include "trigo.h" #include "ok.h" #define ze Euler_angles[0] #define theta Euler_angles[1] #define zeta Euler_angles[2] /*============================================================================*/ int prej_R (R, eq0, eq1 ) /*+++ .PURPOSE Compute the precession matrix, using the new IAU constants. (IAU 1976). The resulting matrix is such that \begin{TeX} \quad $\vec{u}(t_1) = R \cdot \vec{u}(t_0)$ \quad (old to new frame). \end{TeX} .RETURNS OK ---*/ double R[3][3]; /* OUT: rotation matrix */ double eq0; /* IN: Initial equinox (Julian Years) */ double eq1; /* IN: Final equinox (Julian Years) */ { double t0, dt, w; double Euler_angles[3]; t0 = (eq0 - 2000.e0)/100.e0; /* Origin is J2000 */ dt = (eq1 - eq0)/100.e0; w = 2306.2181e0+(1.39656e0-0.000139e0*t0)*t0; /* Arc seconds */ zeta = (w + ( (0.30188e0-0.000344e0*t0) + 0.017998e0*dt) *dt) *dt/3600.e0; /* Degrees */ ze = (w + ( (1.09468e0+0.000066e0*t0) + 0.018203e0*dt) *dt) *dt/3600.e0; /* Degrees */ theta = ( (2004.3109e0 + (-0.85330e0-0.000217e0*t0)*t0) +( (-0.42665e0-0.000217e0*t0) - 0.041833e0*dt) *dt) *dt/3600.e0; /* Computation of rotation matrix */ return(tr_Euler(Euler_angles, R)); } /*============================================================================*/ int prej_q (q0, q1, eq0, eq1) /*+++ .PURPOSE Performs a complete precession between 2 equinoxes. Use the new IAU constants. .METHOD Compute the precession rotation matrix if necessary, then apply the rotation. .RETURNS OK ---*/ double q0[2]; /* IN: ra+dec at equinox eq0 in degrees */ double q1[2]; /* OUT: precessed to equinox eq1 */ double eq0; /* IN: Initial equinox (Julian Years) */ double eq1; /* IN: Final equinox (Julian Years) */ { double us[3]; if (eq0 == eq1) /* No precession at all, same equinox!!! */ { q1[0] = q0[0]; q1[1] = q0[1]; return(OK); } tr_ou(q0, us); /* Convert to unit vector... */ prej_u(us, us, eq0, eq1); /* precess on unit vectors... */ return (tr_uo ( us, q1)); /* And finally -> coordinates */ } /*============================================================================*/ int prej_u (u0, u1, eq0, eq1) /*+++ .PURPOSE Performs a complete precession between 2 equinoxes. Use the new IAU constants. .METHOD Compute the precession rotation matrix if necessary, then apply the rotation. .RETURNS OK ---*/ double u0[3]; /* IN: Unit vector at equinox eq0 */ double u1[3]; /* OUT: precessed to equinox eq1 */ double eq0; /* IN: Initial equinox (Julian Years) */ double eq1; /* IN: Final equinox (Julian Years) */ { static double _eq0 = 2000.e0; static double _eq1 = 2000.e0; static double _r[3][3] = { {1.e0, 0.e0, 0.e0}, {0.e0, 1.e0, 0.e0}, {0.e0, 0.e0, 1.e0}}; if (eq0 == eq1) /* No precession at all, same equinox!!! */ { u1[0] = u0[0]; u1[1] = u0[1]; u1[2] = u0[2]; return(OK); } if ( (_eq0 != eq0) || (_eq1 != eq1) ) { _eq0 = eq0; _eq1 = eq1; prej_R(_r, eq0, eq1); /* Compute precession matrix */ } return (tr_uu ( u0, u1, _r)); /* And finally rotate... */ } #if 0 /*============================================================================*/ int prej_qv (q0, v0, q1, v1, eq0, ep0, eq1, ep1) /*+++ .PURPOSE Performs a complete precession between (equinox0, epoch 0) to (equinox 1, epoch 1). Use the new IAU constants. .METHOD Unit vectors .RETURNS OK ---*/ double q0[2]; /* IN: Position at equinox eq0, epoch ep0 */ double v0[3]; /* IN: Velocity vector */ double q1[2]; /* OUT: precessed to equinox + epoch ep1 */ double v1[3]; /* OUT: Velocity vector */ double eq0; /* IN: Initial equinox (Julian Years) */ double ep0; /* IN: Initial epoch (Julian Years) */ double eq1; /* IN: Final equinox (Julian Years) */ double ep1; /* IN: Final epoch + equinox (Julian Years) */ { static double us[3]; tr_ou(q0, us); /* Convert to unit vector... */ prej_uv(us, v0, us, v1, eq0, ep0, eq1, ep1); /* precess on unit vectors... */ return (tr_uo ( us, q1)); /* And finally -> coordinates */ } /*============================================================================*/ int prej_uv (u0, v0, u1, v1, eq0, ep0, eq1, ep1) /*+++ .PURPOSE Performs a complete precession between (equinox0, epoch 0) to (equinox 1, epoch 1). Use the new IAU constants. .METHOD Apply the velocity corrections, then precess to new equinox. .RETURNS OK ---*/ double u0[3]; /* IN: Unit vector at equinox eq0, epoch ep0 */ double v0[3]; /* IN: Velocity vector ("/yr) */ double u1[3]; /* OUT: precessed to equinox eq1 and epoch ep1 */ double v1[3]; /* OUT: Velocity vector ("/yr) */ double eq0; /* IN: Initial equinox (Julian Years) */ double ep0; /* IN: Initial epoch (Julian Years) */ double eq1; /* IN: Final equinox (Julian Years) */ double ep1; /* IN: Final epoch + equinox (Julian Years) */ { static double _eq0 = 2000.e0; static double _eq1 = 2000.e0; static double _Rf[3][3] = { {1.e0, 0.e0, 0.e0}, /* Precession */ {0.e0, 1.e0, 0.e0}, {0.e0, 0.e0, 1.e0}}; double u[3], du[3], f; register int i; /* Express velocities in eq0 Frame */ tr_vw (v0, du, u0); /* Apply Proper Motion in eq0 Frame */ f = (ep1 - ep0)/3600.e0/DEG; for (i=0; i<3; i++) u[i] = u0[i] + f * v0[i]; /* Renormalize */ f = sqrt(u[0]*u[0] + u[1]*u[1] * u[2]*u[2]); for (i=0; i<3; i++) u[i] /= f; /* Precess position and velocity from eq0 to eq1 */ if (eq0 != eq1) { if ((_eq0 != eq0) || (_eq1 != eq1)) _eq0 = eq0, _eq1 = eq1, prej_R(_Rf, _eq0, _eq1); tr_uu( u, u, _Rf); tr_uu(du, du, _Rf); } /* Output the new position */ for (i=0; i<3; i++) u1[i] = u[i]; /* Compute new velocity vector */ tr_wv(du, v1, u1); /* to Local Frame */ return(OK); } #endif skycat-3.1.2-starlink-1b/astrotcl/generic/ok.h000066400000000000000000000020301215713201500211610ustar00rootroot00000000000000/* static char sccsid[] = "@(#) ST-ECF tc/h/ok.h 4.1 12/6/91"; */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .TYPE Header .NAME ok.h .LANGUAGE C .AUTHOR Francois Ochsenbein [ESO], Alan Richmond [ST-ECF]. .CATEGORY Status definitions .COMMENTS .ENVIRONMENT .VERSION 1.0 05-Mar-1987: Extracted from stesodef.h .VERSION 1.1 28-Mar-1990: Added COMMENT_CHAR ---------------------------*/ #ifndef OK_DEF #define OK_DEF 0 #define COMMENT_CHAR '!' /* Character used allover */ #define OK 1 /* no error */ #define NOK 0 /* not OK */ #define TRUE 1 /* ST-ScI standard */ #define FALSE 0 /* ST-ScI standard */ #define SUCCESS 1 /* ST-ScI standard */ #define FAILURE 0 /* ST-ScI standard */ #define NOT_FOUND (-1) /* mismatch */ #define MODE_INTERACTIVE 1 /* interactive mode */ #define MODE_BATCH 2 /* batch mode */ #define MODE_NETWORK 3 /* network mode */ #define MODE_OTHER 0 /* unknown mode */ #define RECORD_MODE 0400 /* Special option for opening files */ #endif skycat-3.1.2-starlink-1b/astrotcl/generic/osdefos.h000066400000000000000000000072651215713201500222310ustar00rootroot00000000000000/* static char sccsid[] = "@(#) ST-ECF os/h/osdefos.h 4.1 10/16/92"; */ /* @(#)osdefos.h 1.1.1.1 (ESO-IPG) 7/11/91 20:25:38 */ /*+++++++++++++++++++++ .TYPE Header .LANGUAGE C .IDENTIFICATION osdefos.h .AUTHOR BP [ESO-IPG], Francois Ochsenbein .KEYWORDS operating system, parameters, fortran compilers .ENVIRONMENT VMS ULTRIX MSDOS SYSTEM_FIVE SYSV_V2 BSD .COMMENTS This modules defines the OS #def's, and an option SW_LEVEL set to zero for minimizing the size of the generated programs. This version includes #def's keywords OS_VMS OS_ULTRIX OS_MSDOS OS_SYSV OS_SYSV_V2 OS_BSD and the memory classes EXTERN, etc... .VERSION 1.0 10-Mar-1987 Also set defines for standard calls BP .VERSION 1.1 11-Apr-1990 EXTERN is defined as extern for UNIX. CG --------------------------------------------------------------------------*/ #ifndef OSDEFOS_DEF #define OSDEFOS_DEF 0 /*=========================================================================== * List of supported Operating Systems *===========================================================================*/ #define _VMS 1 #define _ULTRIX 2 #define _MSDOS 3 #define _BSD 4 #define _SYSV 5 #define _SYSV_V2 6 #define OS_VMS (OS_ENV == _VMS) #define OS_ULTRIX (OS_ENV == _ULTRIX) #define OS_MSDOS (OS_ENV == _MSDOS) #define OS_BSD (OS_ENV == _BSD) #define OS_SYSV (OS_ENV == _SYSV) #define OS_SYSV_V2 (OS_ENV == _SYSV_V2) /*=========================================================================== * Define Here Your Specific Implementation *===========================================================================*/ #if 0 /* Example of minimal implementation for MicroComputer running MSDOS */ #define SW_LEVEL 0 #define OS_ENV _MSDOS #endif /* End of Example */ #ifndef OS_ENV /*=========================================================================== * Definition of Default Operating System *===========================================================================*/ #ifdef VMS #define OS_ENV _VMS #endif #ifndef OS_ENV #ifdef vms #define OS_ENV _VMS #endif #endif #ifdef ULTRIX #define OS_ENV _ULTRIX #endif #ifdef MSDOS #define OS_ENV _MSDOS #endif #ifdef __MSDOS_ #define OS_ENV _MSDOS #endif #ifdef SYSV_V2 #define OS_ENV _SYSV_V2 #endif #ifdef SYSV #define OS_ENV _SYSV #endif #ifdef BSD #define OS_ENV _BSD #endif #endif /* If no OS variable defined, choose among ULTRIX / SYSV / BSD */ #ifndef OS_ENV # ifdef vax # define OS_ENV _ULTRIX # else # ifdef sun # define OS_ENV _BSD # else # define OS_ENV _SYSV # endif # endif #endif /*=========================================================================== * Definition of Memory Classes (related to OS) *===========================================================================*/ #ifndef SW_LEVEL #define SW_LEVEL 9 #endif #define Rstatic RSTATIC #ifdef vax11c #define REGISTER register #define STATIC static noshare /* standard */ #define RSTATIC static readonly /* Added 13-Feb-1986 */ #define GLOBALDEF globaldef /* standard */ #define GLOBALREF globalref /* standard */ #define GLOBALVALUE globalvalue /* standard */ #define EXTERN globalref /* Mod. 13-Feb-1986 */ #define REXTERN globalref /* Added 13-Feb-1986 */ #define GLOBAL globaldef noshare /* Added 13-Feb-1986 */ #define RGLOBAL globaldef readonly /* Added 13-Feb-1986 */ #else /* gcc */ #define REGISTER register #define STATIC static #define RSTATIC static #define GLOBALDEF #define GLOBALREF extern #define GLOBALVALUE #define EXTERN extern #define REXTERN extern #define GLOBAL #define RGLOBAL #endif #endif skycat-3.1.2-starlink-1b/astrotcl/generic/slasubs.c000066400000000000000000000215671215713201500222370ustar00rootroot00000000000000/* File slasubs.c *** Starlink subroutines by Patrick Wallace used by wcscon.c subroutines *** April 13, 1998 */ #include #include #include /* slaDcs2c (a, b, v): Spherical coordinates to direction cosines. * slaDcc2s (v, a, b): Direction cosines to spherical coordinates. * slaDmxv (dm, va, vb): vector vb = matrix dm * vector va * slaImxv (rm, va, vb): vector vb = (inverse of matrix rm) * vector va * slaDranrm (angle): Normalize angle into range 0-2 pi. * slaDrange (angle): Normalize angle into range +/- pi. * slaDeuler (order, phi, theta, psi, rmat) * Form a rotation matrix from the Euler angles - three successive * rotations about specified Cartesian axes. */ void slaDcs2c (a, b, v) double a; /* Right ascension in radians */ double b; /* Declination in radians */ double *v; /* x,y,z unit vector (returned) */ /* ** slaDcs2c: Spherical coordinates to direction cosines. ** ** The spherical coordinates are longitude (+ve anticlockwise ** looking from the +ve latitude pole) and latitude. The ** Cartesian coordinates are right handed, with the x axis ** at zero longitude and latitude, and the z axis at the ** +ve latitude pole. ** ** P.T.Wallace Starlink 31 October 1993 */ { double cosb; cosb = cos ( b ); v[0] = cos ( a ) * cosb; v[1] = sin ( a ) * cosb; v[2] = sin ( b ); } void slaDcc2s (v, a, b) double *v; /* x,y,z vector */ double *a; /* Right ascension in radians */ double *b; /* Declination in radians */ /* ** slaDcc2s: ** Direction cosines to spherical coordinates. ** ** Returned: ** *a,*b double spherical coordinates in radians ** ** The spherical coordinates are longitude (+ve anticlockwise ** looking from the +ve latitude pole) and latitude. The ** Cartesian coordinates are right handed, with the x axis ** at zero longitude and latitude, and the z axis at the ** +ve latitude pole. ** ** If v is null, zero a and b are returned. ** At either pole, zero a is returned. ** ** P.T.Wallace Starlink 31 October 1993 */ { double x, y, z, r; x = v[0]; y = v[1]; z = v[2]; r = sqrt ( x * x + y * y ); *a = ( r != 0.0 ) ? atan2 ( y, x ) : 0.0; *b = ( z != 0.0 ) ? atan2 ( z, r ) : 0.0; } void slaDmxv (dm, va, vb) double (*dm)[3]; /* 3x3 Matrix */ double *va; /* Vector */ double *vb; /* Result vector (returned) */ /* ** slaDmxv: ** Performs the 3-d forward unitary transformation: ** vector vb = matrix dm * vector va ** ** P.T.Wallace Starlink 31 October 1993 */ { int i, j; double w, vw[3]; /* Matrix dm * vector va -> vector vw */ for ( j = 0; j < 3; j++ ) { w = 0.0; for ( i = 0; i < 3; i++ ) { w += dm[j][i] * va[i]; } vw[j] = w; } /* Vector vw -> vector vb */ for ( j = 0; j < 3; j++ ) { vb[j] = vw[j]; } } void slaDimxv (dm, va, vb) double (*dm)[3]; double *va; double *vb; /* ** - - - - - - - - - ** s l a D i m x v ** - - - - - - - - - ** ** Performs the 3-d backward unitary transformation: ** ** vector vb = (inverse of matrix dm) * vector va ** ** (double precision) ** ** (n.b. The matrix must be unitary, as this routine assumes that ** the inverse and transpose are identical) ** ** ** Given: ** dm double[3][3] matrix ** va double[3] vector ** ** Returned: ** vb double[3] result vector ** ** P.T.Wallace Starlink 31 October 1993 */ { long i, j; double w, vw[3]; /* Inverse of matrix dm * vector va -> vector vw */ for ( j = 0; j < 3; j++ ) { w = 0.0; for ( i = 0; i < 3; i++ ) { w += dm[i][j] * va[i]; } vw[j] = w; } /* Vector vw -> vector vb */ for ( j = 0; j < 3; j++ ) { vb[j] = vw[j]; } } /* 2pi */ #define D2PI 6.2831853071795864769252867665590057683943387987502 /* pi */ #define DPI 3.1415926535897932384626433832795028841971693993751 double slaDranrm (angle) double angle; /* angle in radians */ /* ** slaDranrm: ** Normalize angle into range 0-2 pi. ** The result is angle expressed in the range 0-2 pi (double). ** Defined in slamac.h: D2PI ** ** P.T.Wallace Starlink 30 October 1993 */ { double w; w = fmod ( angle, D2PI ); return ( w >= 0.0 ) ? w : w + D2PI; } #ifndef dsign #define dsign(A,B) ((B)<0.0?-(A):(A)) #endif double slaDrange (angle) double angle; /* ** - - - - - - - - - - ** s l a D r a n g e ** - - - - - - - - - - ** ** Normalize angle into range +/- pi. ** ** (double precision) ** ** Given: ** angle double the angle in radians ** ** The result is angle expressed in the +/- pi (double precision). ** ** Defined in slamac.h: DPI, D2PI ** ** P.T.Wallace Starlink 31 October 1993 */ { double w; w = fmod ( angle, D2PI ); return ( fabs ( w ) < DPI ) ? w : w - dsign ( D2PI, angle ); } void slaDeuler (order, phi, theta, psi, rmat) char *order; /* specifies about which axes the rotations occur */ double phi; /* 1st rotation (radians) */ double theta; /* 2nd rotation (radians) */ double psi; /* 3rd rotation (radians) */ double (*rmat)[3]; /* 3x3 Rotation matrix (returned) */ /* ** slaDeuler: ** Form a rotation matrix from the Euler angles - three successive ** rotations about specified Cartesian axes. ** ** A rotation is positive when the reference frame rotates ** anticlockwise as seen looking towards the origin from the ** positive region of the specified axis. ** ** The characters of order define which axes the three successive ** rotations are about. A typical value is 'zxz', indicating that ** rmat is to become the direction cosine matrix corresponding to ** rotations of the reference frame through phi radians about the ** old z-axis, followed by theta radians about the resulting x-axis, ** then psi radians about the resulting z-axis. ** ** The axis names can be any of the following, in any order or ** combination: x, y, z, uppercase or lowercase, 1, 2, 3. Normal ** axis labelling/numbering conventions apply; the xyz (=123) ** triad is right-handed. Thus, the 'zxz' example given above ** could be written 'zxz' or '313' (or even 'zxz' or '3xz'). Order ** is terminated by length or by the first unrecognised character. ** ** Fewer than three rotations are acceptable, in which case the later ** angle arguments are ignored. Zero rotations produces a unit rmat. ** ** P.T.Wallace Starlink 17 November 1993 */ { int j, i, l, n, k; double result[3][3], rotn[3][3], angle, s, c , w, wm[3][3]; char axis; /* Initialize result matrix */ for ( j = 0; j < 3; j++ ) { for ( i = 0; i < 3; i++ ) { result[i][j] = ( i == j ) ? 1.0 : 0.0; } } /* Establish length of axis string */ l = strlen ( order ); /* Look at each character of axis string until finished */ for ( n = 0; n < 3; n++ ) { if ( n <= l ) { /* Initialize rotation matrix for the current rotation */ for ( j = 0; j < 3; j++ ) { for ( i = 0; i < 3; i++ ) { rotn[i][j] = ( i == j ) ? 1.0 : 0.0; } } /* Pick up the appropriate Euler angle and take sine & cosine */ switch ( n ) { case 0 : angle = phi; break; case 1 : angle = theta; break; case 2 : angle = psi; break; } s = sin ( angle ); c = cos ( angle ); /* Identify the axis */ axis = order[n]; if ( ( axis == 'X' ) || ( axis == 'x' ) || ( axis == '1' ) ) { /* Matrix for x-rotation */ rotn[1][1] = c; rotn[1][2] = s; rotn[2][1] = -s; rotn[2][2] = c; } else if ( ( axis == 'Y' ) || ( axis == 'y' ) || ( axis == '2' ) ) { /* Matrix for y-rotation */ rotn[0][0] = c; rotn[0][2] = -s; rotn[2][0] = s; rotn[2][2] = c; } else if ( ( axis == 'Z' ) || ( axis == 'z' ) || ( axis == '3' ) ) { /* Matrix for z-rotation */ rotn[0][0] = c; rotn[0][1] = s; rotn[1][0] = -s; rotn[1][1] = c; } else { /* Unrecognized character - fake end of string */ l = 0; } /* Apply the current rotation (matrix rotn x matrix result) */ for ( i = 0; i < 3; i++ ) { for ( j = 0; j < 3; j++ ) { w = 0.0; for ( k = 0; k < 3; k++ ) { w += rotn[i][k] * result[k][j]; } wm[i][j] = w; } } for ( j = 0; j < 3; j++ ) { for ( i= 0; i < 3; i++ ) { result[i][j] = wm[i][j]; } } } } /* Copy the result */ for ( j = 0; j < 3; j++ ) { for ( i = 0; i < 3; i++ ) { rmat[i][j] = result[i][j]; } } } /* * Nov 4 1996 New file * * Apr 13 1998 Add list of subroutines to start of file */ skycat-3.1.2-starlink-1b/astrotcl/generic/slasubs.h000066400000000000000000000012371215713201500222340ustar00rootroot00000000000000#ifndef _slasubs_h_ #define _slasubs_h_ /* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: slasubs.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $" * * slasubs.h - #defines to change names in slasubs.c to avoid name conflicts * with sla libraries. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 16 Mar 98 Created */ #define slaDcs2c SAO__slaDcs2c #define slaDmxv SAO__slaDmxv #define slaDimxv SAO__slaDimxv #define slaDcc2s SAO__slaDcc2s #define slaDranrm SAO__slaDranrm #define slaDrange SAO__slaDrange #define slaDeuler SAO__slaDeuler #endif /* _slasubs_h_ */ skycat-3.1.2-starlink-1b/astrotcl/generic/trigo.h000066400000000000000000000076701215713201500217130ustar00rootroot00000000000000/* static char sccsid[] = "@(#) ST-ECF tc/h/trigo.h 4.1 12/6/91"; */ /*+++++++++ .Header trigo.h .LANGUAGE C .AUTHOR Francois Ochsenbein [ESO-IPG] .KEYWORDS Trigonometric mathematical functions .COMMENTS This header contains declarations for mathematical functions and macros for spherical/hyperbolic transformations. .VERSION 1.0 21-Oct-1985: Creation .VERSION 1.1 05-Dec-1988: Transformed some macros to functions ----------------*/ #ifndef TRIGO_DEF #define TRIGO_DEF 0 #include /* Use system Math Library */ #include "compiler.h" /* If function templates are allowed */ /* constants */ #undef PI #define PI 3.14159265358979325e0 #define DEG (180.e0/PI) /* radians to degrees */ /* =57.295779513082320e0 */ /*========================================================================= 1. Trigonometric functions *=========================================================================*/ /* Standard: sin(x) cos(x) tan(x) sinh(x) cosh(x) tanh(x) */ /* Argument in degrees: */ #if _TEMPLATES_ double cosd (double x); double sind (double x); double tand (double x); double acosd(double x); double asind(double x); double atand(double x); double atan2d(double x, double y); #else double acosd(), asind(), atand(), atan2d(); double cosd(), sind(), tand(); #endif /*========================================================================= 2. Spherical functions *=========================================================================*/ #if _TEMPLATES_ int tr_ou (double o[2] , double u[3]); int tr_uo (double u[3] , double o[2]); int tr_uu (double u1[3], double u2[3], double R[3][3]); int tr_uu1 (double u1[3], double u2[3], double R[3][3]); int tr_Euler(double Euler_angles[3], double R[3][3] ); int prej_u (double u0[3], double u1[3], double eq0, double eq1 ); /* Surface of a `rectangle' on the sphere */ double surf_o (double o1[2], double o2[2]); /* Pos. in degrees */ double surf_p (double p1[2], double p2[2]); /* On gnomonic proj. */ /* Distances between two points on the sphere (degrees) */ double s2d_u (double u1[3], double u2[3]); double s2d_o (double o1[2], double o2[2]); double s2d_p (double p1[2], double p2[2]); double dist_u (double u1[3], double u2[3]); double dist_o (double o1[2], double o2[2]); double dist_p (double p1[2], double p2[2]); #else double surf_o(), surf_p(); double s2d_o(), s2d_p(), s2d_u(); double dist_o(), dist_p(), dist_u(); #endif /*========================================================================= 3. Other standard Math Functions *=========================================================================*/ /* Standard: log(x) log10(x) exp(x) sqrt(x) */ /* Standard: hypoth(x,y)= sqrt(x*x + y*y) */ /* Standard: pow(x,y) = x**y */ #if _TEMPLATES_ double sinc (double x); /* sin(x)/x */ double asinc(double x); /* asin(x)/x */ double acosh(double x); double asinh(double x); double atanh(double x); #else double sinc(), asinc(); double acosh(), asinh(), atanh(); #endif /*========================================================================= 4. Arithmetic operations *=========================================================================*/ /* Standard: ceil(x) floor(x) fabs(x) */ /* Standard: fmod(x,y) = x%y, with same sign as x */ /* trigo functions in degrees*/ /*========================================================================= 5. Mantissa / Exponent Conversions *=========================================================================*/ /* Standard: m = frexp (x, &e) Returns m and e such that x = m * 2**e with |m| in range [0.5, 1[ */ /* Standard: y = ldexp (m, e) Returns y = m * 2**e */ /* Standard: f = modf (x, &E) Returns f and E (double) with x = E + f f = fractional part with same sign as x */ #endif skycat-3.1.2-starlink-1b/astrotcl/generic/trigod.c000066400000000000000000000101051215713201500220350ustar00rootroot00000000000000/* static char sccsid[] = "@(#) ST-ECF tc/src/trigod.c 4.1 12/6/91"; */ /*+++ Trigonometric Function in degrees .TYPE Module .IDENTIFICATION trigod.c .LANGUAGE C .AUTHOR Francois Ochsenbein [ESO-IPG] .CATEGORY Trigonometric Functions .COMMENTS Arguments in degrees .VERSION 1.0 21-Oct-1985: Creation .VERSION 1.1 05-Dec-1988: Added inverse functions. ________________________________________*/ #ifndef __hpux__ #include "trigo.h" #include "osdefos.h" STATIC double int_part; #define DOUBLE_MAX 1.7e38 /* max floating value */ /*========================================================================= * cosd *=========================================================================*/ double cosd (x) /*+++ .DES Computation of cosine (argument in degrees) .RET cosine (double) .REM ---*/ double x; /* argument in degrees */ { double argument; char sign; argument = modf (fabs(x)/360.e0, &int_part); sign = 0; if (argument > .5e0) argument = 1.e0 - argument; if (argument > .25e0) argument = .5e0 - argument, sign = 1; if (argument > .125e0) argument = sin( (PI*2) * (.25e0 - argument)); else argument = cos( (PI*2) * argument); if (sign) argument = -argument; return (argument); } /*========================================================================= * sind *=========================================================================*/ double sind(x) /*+++ .DES Computes the sine (argument in degrees) .RET sine of argument (double) .REM No tracing ---*/ double x; /* argument in degrees */ { double argument; char sign; sign = (x >= 0.e0 ? 0 : 1); argument = modf (fabs(x)/360.e0, &int_part); if (argument > .5e0) argument = 1.e0 - argument, sign ^= 1; if (argument > .25e0) argument = .5e0 - argument; if (argument > .125e0) argument = cos( (PI*2) * (.25e0 - argument)); else argument = sin( (PI*2) * argument); if (sign) argument = -argument; return (argument); } /*========================================================================= * tand *=========================================================================*/ double tand(x) /*+++ .DES Computes the tangent (argument in degrees) .RET tangent of argument (double) .REM For +90 degrees, DOUBLE_MAX is returned; For -90 degrees, -DOUBLE_MAX is returned .REM No tracing ---*/ double x; /* argument in degrees */ { double argument; argument = modf (fabs(x)/180.e0, &int_part); if (argument == .5e0) argument = DOUBLE_MAX; else argument = tan (PI*argument); return (x>0.e0 ? argument: -argument); } /*========================================================================= * Inverse functions *=========================================================================*/ double atand(x) /*+++ .DES Computes the Arc tan in degrees .RET Arc tangent of argument (double), in range [-90, 90] ---*/ double x; /* argument in degrees */ { return(DEG*atan(x)); } /*=========================================================================*/ double atan2d(x, y) /*+++ .DES Cartesian to polar .RET Angle in range ]-180, 180] ---*/ double x; /* argument in degrees */ double y; /* argument in degrees */ { return(DEG*atan2(x, y)); } /*=========================================================================*/ double acosd(x) /*+++ .DES Computes the Arc cos in degrees .RET Arc cosine of argument (double), in range [0, 180] .REM Range of argument [-1, +1] ---*/ double x; /* argument in degrees */ { return(DEG*acos(x)); } /*=========================================================================*/ double asind(x) /*+++ .DES Computes the Arc sine in degrees .RET Arc tangent of argument (double) in range [-90, 90] .REM Range of argument [-1, +1] ---*/ double x; /* argument in degrees */ { return(DEG*asin(x)); } /*=========================================================================*/ #endif /* HP_UX */ skycat-3.1.2-starlink-1b/astrotcl/generic/world_coords.C000066400000000000000000000050321215713201500232100ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: world_coords.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * worldCoords.C - C interface implementation for C++ class WorldCoords * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Oct 95 Created * 02/01/06 Renamed worldCoords.C to world_coords.C to * avoid name conflict on file systems that ignore case */ static const char* const rcsId="@(#) $Id: world_coords.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $"; // include the C++ and C interfaces #include "WorldCoords.h" extern "C" { #include "world_coords.h" } /* * copy the C++ WorldCords class object to the C WC struct * and return a pointer to the C WC struct. */ static WC* wcCopy(const WorldCoords& wcs, WC* wc) { if (!wc) return NULL; wc->ra.hours = wcs.ra().hours(); wc->ra.min = wcs.ra().min(); wc->ra.sec = wcs.ra().sec(); wc->ra.val = wcs.ra().val(); wc->dec.hours = wcs.dec().hours(); wc->dec.min = wcs.dec().min(); wc->dec.sec = wcs.dec().sec(); wc->dec.val = wcs.dec().val(); return wc; } /* * initialize null world coordinates * and return a pointer to the WC struct. */ extern "C" WC* wcInitNull(WC* wc) { return wcCopy(WorldCoords(), wc); } /* * return true if the given coords are null */ extern "C" int wcIsNull(WC* wc) { return (wc->ra.val == WCS_NULL || wc->dec.val == WCS_NULL); } /* * initialize from RA, DEC in H:M:S D:M:S format * and return a pointer to the WC struct. */ extern "C" WC* wcInitFromHMS(WC* wc, int rh, int rm, double rs, int dd, int dm, double ds, double equinox) { return wcCopy(WorldCoords(rh, rm, rs, dd, dm, ds, equinox), wc); } /* * initialize from RA, DEC in degrees in floating pt format * and return a pointer to the WC struct. */ extern "C" WC* wcInitFromDeg(WC* wc, double ra, double dec, double equinox) { return wcCopy(WorldCoords(ra, dec, equinox), wc); } /* * initialize world coords from RA and DEC in string format "H:M:S", "D:M:S" */ extern "C" WC* wcInitFromStrings(WC* wc, char* ra, char* dec, double equinox) { return wcCopy(WorldCoords(ra, dec, equinox), wc); } /* * print RA and DEC to the given buffers in the given equinox */ void wcPrint(WC* wc, char* ra_buf, char* dec_buf, double equinox) { if (wc) { WorldCoords tmp(wc->ra.val*15, wc->dec.val); tmp.print(ra_buf, dec_buf, equinox); } } skycat-3.1.2-starlink-1b/astrotcl/generic/world_coords.h000066400000000000000000000031361215713201500232600ustar00rootroot00000000000000#ifndef _worldCoords_h_ #define _worldCoords_h_ /* * E.S.O. - VLT project * $Id: world_coords.h,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * world_coords.h - C interface to C++ class WorldCoords * * (Note: C applications must have at least a dummy C++ main and link * with C++) * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * 02/01/06 Renamed worldCoords.h to world_coords.h to * avoid name conflict on file systems that ignore case */ /* struct representing H:M:S.sss (or D:M:S) value */ typedef struct { int hours; int min; double sec; double val; /* value calculated in degrees */ } WC_HMS; /* struct representing world coordinates */ typedef struct { WC_HMS ra, dec; } WC; /* initialize null world coordinates */ WC* wcInitNull(WC*); /* return true if the given coords are null */ int wcIsNull(WC* wc); /* initialize world coords from RA and DEC in string format "H:M:S", "D:M:S" */ WC* wcInitFromStrings(WC*, char* ra, char* dec, double equinox); /* initialize from RA, DEC in H:M:S D:M:S format */ WC* wcInitFromHMS(WC*, int rh, int rm, double rs, int dd, int dm, double ds, double equinox); /* initialize from RA, DEC in degrees in floating pt format */ WC* wcInitFromDeg(WC*, double ra, double dec, double equinox); /* print RA and DEC to the given buffers in the given equinox */ void wcPrint(WC* wc, char* ra_buf, char* dec_buf, double equinox); #endif /* _worldCoords_h_ */ skycat-3.1.2-starlink-1b/astrotcl/install.sh000077500000000000000000000042121215713201500207740ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 skycat-3.1.2-starlink-1b/astrotcl/library/000077500000000000000000000000001215713201500204345ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/astrotcl/library/AstrotclInit.tcl000066400000000000000000000010531215713201500235560ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: # # AstrotclInit.tcl # # script which is executed by AstrotclImage.C to initialize tcl # # who when what # -------- --------- ---------------------------------------------- # pbiereic 24/08/99 created # abrighto 21/12/05 updated for new version # We depend on. package require Tclutil package require Tclx if {![lcontain $auto_path $astrotcl_library]} { lappend auto_path $astrotcl_library } namespace eval astrotcl {namespace export *} namespace import -force astrotcl::* skycat-3.1.2-starlink-1b/astrotcl/library/mkIndex.tcl000077500000000000000000000002271215713201500225430ustar00rootroot00000000000000#! /bin/sh # -*-tcl-*- # The next line is executed by /bin/sh, but not Tcl \ exec tclsh $0 ${1+"$@"} package require Itcl auto_mkindex . *.tcl exit 0 skycat-3.1.2-starlink-1b/astrotcl/man/000077500000000000000000000000001215713201500175435ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/astrotcl/man/Compress.man3000066400000000000000000000077541215713201500221330ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: Compress.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 15 Jan 98 Created # NAME Compress - utility class for compressing/decompressing FITS files SYNOPSIS class Compress { protected: public: enum CompressType { NO_COMPRESS, // no compression UNIX_COMPRESS, // Compressed FITS file (UNIX) H_COMPRESS, // Hcompressed FITS file ULDA_COMPRESS, // ULDA compressed FITS file GZIP_COMPRESS // GZIPed FITS file }; Compress(); int compress(int read_fd, int write_fd, CompressType type, int compress_flag = 1); int decompress(int read_fd, int write_fd, CompressType type); int compress(const char* infile, const char* outfile, CompressType type, int compress_flag = 1, int mmap_flag = 1); int decompress(const char* infile, const char* outfile, CompressType type, int mmap_flag = 1); int compress(const char* file, CompressType type, int compress_flag = 1, int mmap_flag = 1); int decompress(const char* file, CompressType type, int mmap_flag = 1); int compress(const char* inbuf, int inbufsz, char*& outbuf, int& outbufsz, CompressType ctype, int compress_flag = 1); int decompress(const char* inbuf, int inbufsz, char*& outbuf, int& outbufsz, CompressType ctype); }; DESCRIPTION This class is a C++ wrapper around the CADC "press" routines for FITS image compression. The methods all do the same thing: compress or decompress an image. Some methods take file names as arguments, others pointers to memory areas. The type of compression is specified as an enum value "CompressType". The methods called "compress" all take an optional flag argument that indicates compression or decompression. The methods called "decompress" are shortcut, inline methods that call compress with the decompress flag on. CONSTRUCTORS Compress() Initialize the object. METHODS compress(read_fd, write_fd, type, compress_flag) Compress (or decompress), reading from the given read file descriptor and writing the results to the given write fd. If compress_flag is true, compress, otherwise decompress the file. decompress(read_fd, write_fd, type) Decompress, reading from the given read file descriptor and writing the results to the given write fd. compress(infile, outfile, type, compress_flag, mmap_flag) Compress (or decompress) the given input file and put the result in outfile. If compress_flag is true, compress, otherwise decompress the file. If mmap_flag is true, use mmap to map the file to memory. Note: we can just open the file and use the fd, but the "press" C routines do unbuffered I/O on each char, which is slow. We can mmap the file to memory and use the "mem to mem" version to improve speed somewhat. decompress(infile, outfile, type, mmap_flag) Decompress the given input file and put the result in outfile. compress(file, type, compress_flag, mmap_flag) Compress (decompress) the file in place using the given compress type. If compress_flag is true, compress, otherwise decompress the file. decompress(file, type, mmap_flag) Decompress the file in place. compress(inbuf, inbufsz, outbuf, outbufsz, ctype, compress_flag) Compress (or decompress) the contents of inbuf using the given compress type and allocate the results to outbuf. inbufsz is the size of the input buffer. outbufsz is an estimate of the outbuf size on input and the actual size on output. If compress_flag is true, compress, otherwise decompress the file. It is the caller's responsibility to free() the outbuf when no longer needed. decompress(inbuf, inbufsz, outbuf, outbufsz, ctype) Decompress inbuf and allocate results in outbuf. ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/astrotcl/man/FitsIO.man3000066400000000000000000000224721215713201500214670ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: FitsIO.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 21 Feb 96 Created # NAME FitsIO - C++ Class for Reading, Writing and Managing FITS Images SYNOPSIS #include "FitsIO.h" class FitsIO : public ImageIORep { ... public: FitsIO(int width, int height, int bitpix, double bzero, double bscale, const Mem& header, const Mem& data, fitsfile* fitsio = NULL); ~FitsIO(); int wcsinit(); int usingNetBO() const; const char* classname() const; static FitsIO* read(const char* filename, int memOptions = 0); int write(const char *filename) const; static const char* check_compress(const char* filename, char* buf, int bufsz, int& istemp, int decompress_flag = 1, int bitpix = 0); static FitsIO* initialize(Mem& header); static FitsIO* initialize(Mem& header, Mem& data); static FitsIO* blankImage(double ra, double dec, double equinox, double radius, int width, int height, unsigned long color0); int get(const char* keyword, double& val) const; int get(const char* keyword, float& val) const; int get(const char* keyword, int& val) const; int get(const char* keyword, long& val) const; int get(const char* keyword, unsigned char& val) const; int get(const char* keyword, unsigned short& val) const; int get(const char* keyword, short& val) const; char* get(const char* keyword) const; char* get(const char* keyword, char* buf, int bufsz) const; static int get(fitsfile*, const char* keyword, double& val); static int get(fitsfile*, const char* keyword, float& val); static int get(fitsfile*, const char* keyword, int& val); static int get(fitsfile*, const char* keyword, long& val); static int get(fitsfile*, const char* keyword, unsigned char& val); static int get(fitsfile*, const char* keyword, unsigned short& val); static int get(fitsfile*, const char* keyword, short& val); static char* get(fitsfile*, const char* keyword); int getFitsHeader(ostream& os) const; int put(const char* keyword, double val, const char* comment = NULL); int put(const char* keyword, float val, const char* comment = NULL); int put(const char* keyword, int val, const char* comment = NULL); int put(const char* keyword, const char* val, const char* comment = NULL); int getNumHDUs(); const char* getHDUType(); int getHDUNum(); int setHDU(int num); int deleteHDU(int num); int getTableDims(long& rows, int& cols); char* getTableHead(int col); char* getTableValue(long row, int col); int getTableColumn(int col, double* values, int numValues); int createTable(const char* extname, long rows, int cols, int setTableValue(long row, int col, const char* value); }; DESCRIPTION This class manages the reading and writing of FITS images, including ASCII and binary tables, FITS headers and keywords. FITS file access is based on William Pence's CFITSIO package. World coordinates support is based on Doug Mink's WCSSUBS package (also used by saoimage). The sources from both packages are included in this package. This class is a subclass of ImageIORep, which is the internal class used by class ImageIO for reference counting. The public interface is generally through the ImageIO class, although class FitsIO may be used directly in cases where you know that the image is already in FITS format or you are creating a new image in FITS format. Besides reading and writing FITS images, this class can be used to create a FITS image from data in memory and to create a "blank" image with World Coordinate information for plotting astronomical objects. CREATING A FITSIO OBJECT To create a FitsIO object from a FITS file, use the read method, which returns a pointer to an allocated FitsIO object given the file name. If you have the image data in memory, you can use one of the constructors to create the object. You can pass a pointer to a FitsIO object to the ImageIO constructor to create a reference counted ImageIO object, for example: ImageIO imio = FitsIO::read(filename); or ImageIO imio = new FitsIO(w, h, type, bzero, bscale, header, data); COMPRESSION Images are compressed and decompressed automatically by the read and write methods based on the file name suffix: ".hfits" for H-compress, ".gzfits" or ".gfits" for gzip compression, and ".cfits" for UNIX compression. See Compress for details. IMAGE EXTENSIONS Methods are provided to query the number of FITS HDUs (header data units) and switch to a given HDU. You can iterate through a FITS table by first switching to the HDU containing the table and then calling one of the HDU methods described below. When switching HDUs, make sure that the image display code is not still accessing a different HDU. It might be necessary to save the current HDU number before reading a FITS table and then restore the HDU settings afterwards in this case. FITS TABLES Reading and writing of FITS ASCII and binary tables is supported. FITS tables may also be created and deleted. (Note this class does not support the full functionality of the cfitsio library (yet), but only the features that we needed so far.) WRITING FITS IMAGES Care must be taken when modifying FITS image files used with the FitsIO class, since the files are memory mapped. When using the "put()" method to insert FITS keywords, the FitsIO class automatically handles adding new FITS blocks as needed and remapping the file. This may change the starting location of the FITS image data or extensions. METHODS FitsIO(width, height, bitpix, bzero, bscale, header, data) This constructor is called by the static "read" method once the FITS file has been read. The parameters are based on values read from the FITS header. The header and data arguments are instances of class Mem, which uses reference counting to manage shared and unshared memory. read(filename, int memOptions = 0) Read a FITS file and return an initialized FitsIO object for it, or NULL if there are errors. If filename is "-", stdin is read into a temp image file and used as the input. The Mem class is used to speed up loading the file. The optional mem_options argument controls whether the memory is mapped read-only or read/write. See class Mem for the available options. write(filename) Write the data to a FITS file. blankImage(ra, dec, equinox, radius, width, height, color0) Generate a blank image with a FITS header based on the given fields and including support for World Coordinates. RA and DEC are specified in degrees. Width and Height are in pixels. "color0" is the value to use for the image pixels (usually the value for "black"). get(keyword, val) Find and set the value for the given FITS keyword and return 0 if OK (found). This method is overloaded for various data types. get(keyword) Find and return the string value for the given FITS keyword, or NULL if not found. getFitsHeader(os) Write an ASCII formatted copy of the FITS header to the given stream, format it in 80 char lines and replace any NULL chars with blanks. put(keyword, val, comment) Insert the given FITS keyword and value with the given comment in the FITS header and return 0 if all is OK. If there is not enough space in the FITS header, extend the size of the FITS header by one header block and if the header is part of an mmap'ed file, rewrite the file with the new enlarged header. getNumHDUs() Return the total number of HDUs (FITS header/data units). getHDUType() Return the type of the current HDU as a string: "image", "ascii", or "binary" or NULL if there was as error. getHDUNum() Return the index of the current HDU. setHDU(num) Move to the specified HDU and make it the current one. deleteHDU(num); Delete the given HDU. All following HDUs are moved to fill the space. getTableDims(rows, cols) Get the dimensions of the current FITS table. getTableHead(col); Return the table heading for the given column, or NULL if there is an error. The return value points to static storage. getTableValue(row, col) Return the value in the current FITS table at the given row and column, or NULL if there was an error. The returned pointer points to static storage and will be overwritten on the next call to this method or one of the get(keyword) methods. getTableColumn(col, values, numValues) Get the contents of the given column as an array of doubles. The caller should pass an array of numValues doubles. createTable(extname, rows, cols, headings, tform, asciiFlag) Create a FITS table and make it the current HDU extname gives the name of the table. The initial size will be rows x cols entries. tform is an array giving the FITS data type for each column (For example: 16A, for a 16 char string, see FITS description.) If asciiFlag is 1, an ASCII table is created, otherwise a binary table. setTableValue(row, col, value) Set the value in the current FITS table at the given row and column (For now, all data types are treated as strings) SEE ALSO ImageIO(3++), ImageData, Mem(3C++), Compress(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/astrotcl/man/HMS.man3000066400000000000000000000040221215713201500207500ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: HMS.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 16 Oct 95 Created # NAME HMS - C++ class for working with H:M:S (hours minutes seconds) values SYNOPSIS #include "HMS.h" class HMS { public: HMS(); HMS(int hours, int min, double sec); HMS(double val); int isNull() const; int hours() const; int min() const; double sec() const; double val() const; friend ostream& operator<<(ostream&, const HMS&); friend istream& operator>>(istream&, HMS&); friend int operator< (const HMS& a, const HMS& b); friend int operator<=(const HMS& a, const HMS& b); friend int operator> (const HMS& a, const HMS& b); friend int operator>=(const HMS& a, const HMS& b); friend int operator==(const HMS& a, const HMS& b); friend int operator!=(const HMS& a, const HMS& b); }; DESCRIPTION HMS is a simple class for representing values in Hours:Minutes:Seconds format or in degrees, converting back and forth and comparing. CONSTRUCTORS HMS() Initialize a NULL H:M:S value (see isNull() method). HMS(hours, min, sec) Initialize from hours, minutes and seconds. HMS(val) Initialize from a value in degrees. METHODS isNull() Return true if the HMS object has the NULL value (created with default constructor). hours() min() sec() val() Return the parts of the H:M:S value or the value (val) in degrees. operator<<(ostream, hms) operator>>(istream, hms) I/O operators - using format H:M:S.sss. operator< (a, b); operator<=(a, b); operator> (a, b); operator>=(a, b); operator==(a, b); operator!=(a, b); Comparison operators - compare two H:M:S values. SEE ALSO WorldCoords ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/astrotcl/man/ImageCoords.man3000066400000000000000000000056521215713201500225270ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: ImageCoords.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 15 Jan 98 Created # NAME ImageCoords - class representing image coordinates (x, y) SYNOPSIS #include "ImageCoords.h" class ImageCoords { ... public: ImageCoords(); ImageCoords(double x, double y); ImageCoords(const char* x_str, const char* y_str); isNull() const; void setNull(); friend ostream& operator<<(ostream&, const ImageCoords& pos); void print(char* x_buf, char* y_buf); void print(ostream& os); void get(double& x, double& y); int operator==(const ImageCoords& pos) const; int operator!=(const ImageCoords& pos) const; friend ImageCoords operator-(const ImageCoords& a, const ImageCoords& b); double x() const; double y() const; double dist(ImageCoords& pos) const; static double dist(double x0, double y0, double x1, double y1); int box(double radius, ImageCoords& pos1, ImageCoords& pos2) const; static ImageCoords center(const ImageCoords& pos1, const ImageCoords& pos2, double& radius, double& width, double& height); int status() const; }; DESCRIPTION This class is used to represent image pixel coordinates (x, y). It has an interface similar to the WorldCoords class, and is used by the WorldOrImageCoords class to represent image coordinates. CONSTRUCTORS ImageCoords() Initialize null coordinates. ImageCoords(x, y) Initialize coordinates with (x, y) ImageCoords(x_str, y_str) Parse X and Y in string format. METHODS isNull() Return true if the coordinates are null. setNull() Set to the null value. ostream& operator<<(os, pos) Output operator: format: "x y" print(x_buf, y_buf) Print the coordinates to the given buffers. print(os) Print coordinates to the given stream. get(x, y) Get the values of x and y. operator==(pos) Check for equality. operator!=(pos) Check for inequality. operator-(a, b) { Return the difference between two points. x() return the value of x. y() return the value of y. dist(pos) Get distance between this point and the given one. dist(x0, y0, x1, y1) Static member to get the distance between two points. box(radius, Ipos1, pos2) Given a radius, set pos1 and pos2 to the two endpoints that form a box with center at this position. center(pos1, const pos2, radius, width, height) Given the endpoints of a box (pos1, pos2), set width, height and radius and return the center position of the box. status() Return the status ater the constructor (0 is OK). SEE ALSO WorldCoords, WorldOrImageCoords(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/astrotcl/man/ImageIO.man3000066400000000000000000000151361215713201500216030ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: ImageIO.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 10 Apr 96 Created # NAME ImageIO - Reference Counted C++ Class for Reading and Writing Images SYNOPSIS #include "ImageIO.h" // types of image data (these mostly correspond to the FITS BITPIX values) enum ImageDataType { UNKNOWN_IMAGE = -1, // unknown type BYTE_IMAGE = 8, // 8 bit images X_IMAGE = -8, // special, color scaled, X image data SHORT_IMAGE = 16, // 16 bit signed USHORT_IMAGE = -16, // 16 bit unsigned LONG_IMAGE = 32, // 32 bit integer FLOAT_IMAGE = -32 // 32 bit floating point }; class ImageIORep { ... }; class FitsIO : public ImageIORep { ... }; class ImageIO; ... public: ImageIO(); ImageIO(ImageIORep* rep); ImageIO(const ImageIO&); ~ImageIO(); ImageIO& operator=(const ImageIO&); int usingNetBO() const; int write(const char *filename) const; int wcsinit(); int get(const char* keyword, double& val) const; int get(const char* keyword, float& val) const; int get(const char* keyword, int& val) const; int get(const char* keyword, long& val) const; int get(const char* keyword, unsigned char& val) const; int get(const char* keyword, unsigned short& val) const; int get(const char* keyword, short& val) const; char* get(const char* keyword) const; int getFitsHeader(ostream& os) const; double scaleValue(double d) const; double unScaleValue(double d) const; int pixelSize() const; int width() const; int height() const; int bitpix() const; double bscale() const; double bzero() const; const Mem& header() const; const Mem& data() const; WCS& wcs(); void wcs(const WCS& newwcs); int header(const Mem& m); int data(const Mem& m); const char* headerPtr() const; const void* dataPtr() const; int status() const; ImageIORep* rep() const; }; DESCRIPTION Class ImageIO is used to read, write and manage the memory for astronomical images of various formats. The image header and data may be optionally kept in shared memory (mmap or shm), so they can be accessed by external processes that may want to do image processing or other operations. Regardless of the original image format and derived class, the header and data are always kept in FITS format. Other image types are converted to FITS format by the derived classes (see below). Subclasses of ImageIORep can, however, specify via a virtual method whether the image data is in network or in native byte order (see below). CLASS STRUCTURE Class ImageIO uses reference counting to make it easier to share objects of this type for displaying in multiple windows. The actual (abstract) base class is ImageIORep. An ImageIO object contains a pointer to an ImageIORep object, which may be shared by multiple ImageIO objects. To add new image types, to the ImageIO class, classes are derived from ImageIORep. WORLD COORDINATES SUPPORT This class offers optional support of world coordinates for the image, which can be initialized by calling the wcsinit() method, which must be defined in a derived class, such as FitsIO. Normally wcsinit() will get the necessary information from the image header, which is normally assumed to be in FITS format. METHODS ImageIO() Default constructor, creates a null object (use assignment operator to set later); ImageIO(ImageIORep* rep) Constructor, from a pointer to a subclass of ImageIORep (FitsIO, for example). "rep" should be allocated with the "new" operator and will be deleted by this class when there are no more references to it. Note that this constructors enables automatic conversion from a pointer to a subclass of ImageIORep to class ImageIO. Examples: // create an ImageIO object from a FITS file ImageIO imio1 = FitsIO::read(filename); // create an ImageIO object from FITS data and header in memory Mem header(...), data(...); ImageIO imio2 = new FitsIO(w, h, type, bzero, bscale, header, data); ImageIO(const ImageIO&) Copy constructor: only copies the internal pointer and raises the reference count. ~ImageIO() Destructor, lowers the reference count and frees the memory, if there are no more references. ImageIO& operator=(const ImageIO&) Assignment operator: reference counted. usingNetBO() Return true if the ImageIORep subclass uses native byte ordering. FITS files and most other image formats are in network byte order, however, the derived class may want to byte swap the data first, if needed, so that it is easier to work with. This virtual method is checked by classes that use this object to determine if byte-swapping may need to be done. write(filename) Write the image header and data to a file in a format defined in the derived class. get(keyword, val) Find and set the value for the given FITS keyword and return 0 if OK (found). This method is overloaded for various data types. get(keyword) Find and return the string value for the given FITS keyword, or NULL if not found. scaleValue(d) Apply the FITS keyword values for BZERO and BSCALE to the given value (d = BZERO+d*BSCALE) unScaleValue(d) Reverse the effect of BZERO and BSCALE (d = (d-BZERO)/BSCALE) width() Return the width of the image in pixels. height() Return the height of the image in pixels. bitpix() Return the value of the BITPIX keyword (data type of image). bscale() Return value for the BSCALE keyword. bzero() Return the value for the BZERO keyword. header() Return a reference to the FITS header (class Mem). data() Return a reference to the FITS image data (class Mem). header(const Mem& newheader) Replace teh image header. data(const Mem& newdata) Replace the image data with new data of same size. WCS& wcs() Return a reference to the object used to manage world coordinates. Note that this object is reference counted in the same way as the ImageIO class. void wcs(const WCS& newwcs) Set the WCS object used to manage world coordinates. Since the WCS class is also a reference counted wrapper around an abstract base class (WCSRep), you can define subclasses of class WCSRep that redefines the behavior and implementation of the WCS object. SEE ALSO FitsIO, ImageData(3C++), Mem(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/astrotcl/man/WCS.man3000066400000000000000000000130751215713201500207650ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: WCS.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 30 Sep 96 Created # NAME WCS - Reference counted C++ wrapper class for managing World Coordinates SYNOPSIS #include "WCS.h" class WCSRep; class SAOWCS : public WCSRep {...}; class WCS { ... public: WCS(); WCS(const WCS&); WCS(WCSRep* rep); ~WCS(); WCS& operator=(const WCS&); int isWcs() const; int pixWidth() const; int pixHeight() const; double dist(double ra0, double dec0, double ra1, double dec1) const; char* pix2wcs(double x, double y, char* buf, int bufsz, int hms_flag = 1) const; int pix2wcs(double x, double y, double& ra, double& dec) const; int wcs2pix(double ra, double dec, double &x, double &y) const; int set(double ra, double dec, double secpix, double xrefpix, double yrefpix, int nxpix, int nypix, double rotate, int equinox, double epoch, const char* proj); int shift(double ra, double dec, double equinox); double equinox() const; char* equinoxStr() const; double epoch() const; double rotate() const; double width() const; double height() const; double radius() const; double secPix() const; WorldCoords center() const; int initialized() const; int status() const; }; DESCRIPTION Class WCS is a reference counted wrapper class for managing world coordinates for a given image. This class does not do anything itself, but manages a pointer to a class derived from class WCSRep, which is an abstract base class. Packages can add their own WCS implementations by deriving new subclasses from WCSRep that meet the required interface, which includes the same methods as class WCS. Since class WCS uses reference counting, you do not normally have to worry about allocating and deleting it. You can jsut create an instance and copy it. When the last copy goes out of scope or is deleted, the memory is released. The astrotcl package provides one implementation subclass of WCSRep, class SAOWCS, which is based on Doug Mink's (saoimage) WCS C library (Note: a Starlink based version is also available, see the GAIA plugin for Skycat). The constructor for SAOWCS takes a pointer to a FITS image header and uses that to set up world coordinates for the image. Methods are implemented to convert between image pixel and world coordinates and to set world coordinates when there is no FITS header. See the HTML documentation in http://tdc-www.harvard.edu/software/wcstools.html for information about the underlying C library used by SAOWCS. The latest version of the wcs C library can be found under: ftp://cfa-ftp.harvard.edu/pub/gsc/WCS/. METHODS WCS() WCS(WCSRep* rep) The default constructor creates a null WCS object. If you pass the constructor a pointer to an object of a class derived from WCSRep (SAOWCS, for example), the object is initialized from it. isWcs() Returns nozero if the image supports world coordinates (has the necessary FITS keywords in the image header or from some other source). Note that if this method returns 0, none of the other methods should be called. pix2wcs(int x, int y, char* buf) Return the world coordinates string for the given image coords. pix2wcs(int x, int y, double& ra, double& dec) Return the world coords (in degrees, as 2 doubles) for the image coords. wcs2pix(double ra, double dec, int &x, int &y) Get the image coordinates for the given world coords. dist(double ra0, double dec0, double ra1, double dec1) Return the WCS distance between the 2 given WCS points in arcmin. width() height() radius() Return the width, height, radius of the image in arc-minutes. set(double ra, double dec, double secpix, double xrefpix, double yrefpix, int nxpix, int nypix, double rotate, int equinox, double epoch, const char* proj); Set up the WCS structure from the given information about the image. This method can be used to add world coordinate support to an image even if the image doesn't have it in the header. Arguments: ra = Center right ascension in degrees dec = Center declination in degrees secpix = Number of arcseconds per pixel xrefpix = Reference pixel X coordinate yrefpix = Reference pixel Y coordinate nxpix = Number of pixels along x-axis nypix = Number of pixels along y-axis rotate = Rotation angle (clockwise positive) in degrees equinox = Equinox of coordinates, 1950 and 2000 supported epoch = Epoch of coordinates, used for FK4/FK5 conversion no effect if 0 proj = Projection shift(double ra, double dec, double equinox) Reset the center of the WCS structure. equinox() equinoxStr() Return the WCS equinox as a double (1) or a string (2). epoch() Return the WCS epoch as a double. rotate() Return the rotation angle in degrees. secPix() Return the number of world coordinate arcseconds per pixel. center() Return the world coordinates of the center of the image. pixWidth() const pixHeight() Return image dimensions in pixels. initialized() Returns true if WCS has been initialized (with a FITS header). status() status(int s) Get/set the status of the object (0 is OK). SEE ALSO ImageData, RtdImage(3C++), WorldCoords(3C++), FitsIO(3C++), ImageIO ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/astrotcl/man/WorldCoords.man3000066400000000000000000000113261215713201500225670ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: WorldCoords.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 16 Oct 95 Created # NAME WorldCoords - C++ class for working with world coordinates SYNOPSIS #include "WorldCoords.h" class WorldCoords { ... public: WorldCoords(); WorldCoords(const HMS& ra, const HMS& dec, double equinox = 2000.0); WorldCoords(double ra_deg, double dec_deg, double equinox = 2000.0); WorldCoords(int rh, int rm, double rs, int dd, int dm, float ds, double equinox = 2000.0); WorldCoords(const char* ra_str, const char* dec_str, double equinox = 2000.0); isNull() const; void setNull(); void print(char* ra_buf, char* dec_buf, double equinox = 2000.0); friend istream& operator>>(istream&, WorldCoords& pos); friend ostream& operator<<(ostream&, const WorldCoords& pos); friend int operator==(const WorldCoords& a, const WorldCoords& b); friend int operator!=(const WorldCoords& a, const WorldCoords& b); friend WorldCoords operator-(const WorldCoords& a, const WorldCoords& b); const HMS& ra() const; const HMS& dec() const; int status(); }; DESCRIPTION This class is used to represent world coordinates and to convert between different representations of world coordinates. The member variables in the class are always kept internally in both H:M:S format and as floating point values in the default equinox J2000. For example, for a given WorldCoords object "pos", the coordinates in H:M:S[+-]D:M:S format are given by: (pos.ra(), pos.dec()) ra() and dec() both return a reference to an HMS object, which is used to represent values in hours, minutes and seconds (see HMS). The coordinates in decimal degrees are given by (pos.ra().val()*15, pos.dec().val()). The ra value must be multiplied by 15 to convert from hours to degrees. CONSTRUCTORS WorldCoords() Initialize null world coordinates. (Null coordinates are useful in some cases where you have an optional second position for an area instead of a single point). WorldCoords(ra, dec, equinox) Initialize the world coordinates from RA, DEC in H:M:S D:M:S format. Arguments: ra (in) - RA in H:M:S dec (in) - DEC in D:M:S equinox (in) - optional epoch (2000.0, 1950.0, ...) WorldCoords(rh, rm, rs, dd, dm, ds, equinox) Initialize the world coordinates from H M S D M S as separate values. Arguments: rh (in) - RA hours rm (in) - RA minutes rs (in) - RA seconds dd (in) - DEC degrees dm (in) - DEC minutes ds (in) - DEC seconds equinox (in) - optional epoch (2000.0, 1950.0, ...) WorldCoords(ra_deg, dec_deg, equinox) Initialize the world coordinates from RA, DEC in degrees in floating point format. Arguments: ra (in) - right ascension dec (in) - declination equinox (in) - epoch (2000.0, 1950.0, ...) WorldCoords(ra_str, dec_str, equinox); Initialize the world coordinates from RA and DEC in string format. Allowed formats of input strings: hh mm ss.s +/-dd mm ss.s hh:mm:ss.s +/-dd:mm:ss.s h.hhhh +/-d.dddd Arguments: ra (in) - String containing right ascension dec (in) - String containing declination equinox (in) - epoch (2000.0, 1950.0, ...) METHODS isNull() Return true if the given coords are null (this is true if they were created with the default constructor - i.e.: with no arguments). setNull() Set to the null value. print(ra_buf, dec_buf, equinox) Print the coordinates in the given buffers in H:M:S format in given equinox. operator>>(istream, pos) Input operator: format: H:M:S[+-]D:M:S - reads the position from the given istream. operator<<(ostream, pos) Output operator: format: H:M:S[+-]D:M:S - writes the position to the given ostream. operator==(pos1, pos2) operator!=(pos1, pos2) Comparison operators - check for equality/inequality. ra() Return the RA part of the coordinates (class HMS). ra().val()*15 is the value in degrees, ra.hours(), ra().min() and ra().sec() give the H:M:S values. dec() Return the DEC part of the coordinates (class HMS). dec().val() is the value in degrees, dec.hours(), dec().min() and dec().sec() give the H:M:S values. status() Return the status after the constructor is done (0 is OK, 1 for errors). SEE ALSO HMS ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/astrotcl/man/WorldOrImageCoords.man3000066400000000000000000000110421215713201500240260ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: WorldOrImageCoords.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 15 Jan 98 Created # NAME WorldOrImageCoords - class representing either world or image coordinates SYNOPSIS #include "WorldOrImageCoords.h" class WorldOrImageCoords { ... public: WorldOrImageCoords(); WorldOrImageCoords(WorldCoords wc); WorldOrImageCoords(ImageCoords ic); isNull() const; void setNull(); friend ostream& operator<<(ostream& os, const WorldOrImageCoords& pos); void print(char* x_buf, char* y_buf, double equinox = 2000., int hmsFlag=1); void print(ostream& os, double equinox = 2000.); void get(double& x, double& y, double equinox = 2000.); int operator==(const WorldOrImageCoords& pos) const; int operator!=(const WorldOrImageCoords& pos) const; friend WorldOrImageCoords operator-(const WorldOrImageCoords& a, const WorldOrImageCoords& b); double ra_deg() const; double dec_deg() const; WorldCoords& wc(); ImageCoords& ic(); const WorldCoords& wc() const const ImageCoords& ic() const; double dist(WorldOrImageCoords& pos, double& pa) const; double dist(WorldOrImageCoords& pos) const; int box(double radius, WorldOrImageCoords& pos1, WorldOrImageCoords& pos2) const; static WorldOrImageCoords center(const WorldOrImageCoords& pos1, const WorldOrImageCoords& pos2, double& radius, double& width, double& height); const HMS& ra() const; const HMS& dec() const; double x() const; double y() const; double isWcs() const; int status() const; }; DESCRIPTION Class WorldOrImageCoords is designed to be used in situations where you might need to deal with either world coordinates or image coordinates, but don't know ahead of time which. We could use a common base class and virtual methods, but that would require using pointers or references, while it is often more convenient to use instances of these classes. Also, the methods in both classes have slightly different signatures. After initializing the class with with a WorldCoords(n) object or an ImageCoords(n) object, you can use the isWcs() method to check which one it is, if you don't know. Otherwise, most of the methods work transparently, independent of the coordinate type. However, you should not attempt, for example, to fetch the value of "ra" and "dec" without being sure that the object represents world coordinates. CONSTRUCTORS WorldOrImageCoords() Initialize null coordinates. WorldOrImageCoords(wc) Initialize world coordinates. WorldOrImageCoords(ic) Initialize image coordinates. METHODS isNull(); Return true if the coordinates are null setNull() Set to the null value. operator<<(os, pos) Output operator, prints world coordinates as hh:mm:ss dd:mm:ss, image coordinates as x y. print(x_buf, y_buf, equinox, hmsFlag) Print the coordinates to the given buffer. For world coordinates, if hmsFlag is non-zero, prints in H:M:S [+-]D:M:S format, otherwise in decimal degrees. print(os, equinox) Print the coordinates to the given stream. get(x, y, equinox) Get teh valules of x and y in the given equinox. operator==(pos) Check for equality. operator!=(pos) Check for inequality. operator-(a, b) Return the difference between two points. ra_deg() Return ra in degrees. dec_deg() Return dec in degrees. wc() Return the internal WorldCoords class. ic() Return the internal ImageCoords class. dist(pos, pa) Get distance and pa angle between the given point and this point. dist(pos) Get distance between between the given point and this point. box(radius, pos1, pos2) Given a radius, set pos1 and pos2 to the 2 endpoints that form a box with center at this position. center(pos1, pos2, radius, width, height) { Given the endpoints of a box (pos1, pos2), set width, height and radius and return the center position of the box. ra() Return the value of ra. dec() Return the value of dec. x() Return the value of the x coordinate. y() Return the value of the y coordinate. isWcs() Return true if this class represents world coordinates. status() Return the status after the constructor (0 is OK). SEE ALSO WorldCoords, ImageCoords(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/astrotcl/man/world_coords.man3000066400000000000000000000070451215713201500230310ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: world_coords.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 16 Oct 95 Created # NAME worldCoords - C utility routine for working with world coordinates SYNOPSIS #include "worldCoords.h" typedef struct { int hours; int min; double sec; double val; /* value calculated in degrees */ } WC_HMS; typedef struct { WC_HMS ra, dec; } WC; WC* wcInitNull(WC*); int wcIsNull(WC* wc); WC* wcInitFromHMS(WC*, int rh, int rm, double rs, int dd, int dm, int ds, double equinox); WC* wcInitFromDeg(WC*, double ra, double dec, double equinox); WC* wcInitFromStrings(WC*, char* ra, char* dec, double equinox); void wcPrint(WC* wc, char* ra_buf, char* dec_buf, double equinox); DESCRIPTION The routines described here present a C interface to the C++ WorldCoords class and are used to convert between different representations of world coordinates. The values in the struct are always kept in both H:M:S[+-]D:M:S format (members: hours, min, sec) and as floating point values in hours (member: val) in the default equinox of J2000. C ROUTINES wcInitNull Initialize null world coordinates and return the argument. (Null coordinates are useful in some cases where you have an optional second position for an area instead of a single point). Arguments: wc (in/out) - pointer to WC struct to be filled in Return value: pointer to wc argument. wcIsNull Return true if the given coords are null. Arguments: wc (in) - pointer to initialized WC struct Return value: boolean value wcInitFromHMS Initialize the world coordinates from RA, DEC in H:M:S D:M:S format and return the first parameter. Arguments: wc (in/out) - pointer to WC struct to fill out rh (in) - RA hours rm (in) - RA minutes rs (in) - RA seconds dd (in) - DEC degrees dm (in) - DEC minutes ds (in) - DEC seconds equinox (in) - epoch (2000.0, 1950.0, ...) Return value: pointer to wc argument wcInitFromDeg Initialize the world coordinates from RA, DEC in degrees in floating point format and return the first parameter. Arguments: wc (in/out) - pointer to WC struct to fill out ra (in) - right ascension dec (in) - declination equinox (in) - epoch (2000.0, 1950.0, ...) Return value: pointer to wc argument wcInitFromStrings Initialize the world coordinates from RA, DEC in the format "H:M:S.sss", "[+-]D:M:S.sss" and return the first parameter. The minutes and seconds are optional, so the formats "H.hhh", "[+-]D.ddd" and "H:M", "D:M" are also supported. Arguments: wc (in/out) - pointer to WC struct to fill out ra (in) - right ascention dec (in) - declination equinox (in) - epoch (2000.0, 1950.0, ...) Return value: pointer to wc argument wcPrint Print RA and DEC to the given buffers in the given equinox. Arguments: wc (in) - pointer to WC struct ra_buf (in) - buffer to contain RA in H:M:S dec_buf (in) - buffer to contain DEC in D:M:S equinox (in) - desired epoch (2000.0, 1950.0, ...) Return value: none. SEE ALSO WorldCoords ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/astrotcl/pkgIndex.tcl.in000066400000000000000000000002271215713201500216530ustar00rootroot00000000000000# Tcl package index file, version 1.0 package ifneeded Astrotcl @PACKAGE_VERSION@ [list load [file join [file dirname $dir] @PKG_LIB_FILE@] Astrotcl] skycat-3.1.2-starlink-1b/astrotcl/press/000077500000000000000000000000001215713201500201245ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/astrotcl/press/digitize.c000066400000000000000000000005321215713201500221000ustar00rootroot00000000000000/* digitize.c digitize H-transform * * Programmer: R. White Date: 11 March 1991 */ #include extern void digitize(a,nx,ny,scale) int a[]; int nx,ny; int scale; { int d, *p; /* * round to multiple of scale */ if (scale <= 1) return; d=(scale+1)/2-1; for (p=a; p <= &a[nx*ny-1]; p++) *p = ((*p>0) ? (*p+d) : (*p-d))/scale; } skycat-3.1.2-starlink-1b/astrotcl/press/gen_msg.h000066400000000000000000000017321215713201500217170ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Include File Name: gen/h/gen_msg.h * * Purpose: * Defines the message structure. * * Date : Aug 23, 1991 * * SCCS data : @(#) * Module Name : gen_msg.h * Version Number : 1.3 * Release Number : 1 * Last Updated : 8/12/92 * * Programmer : Severin Gaudet * * Modification History: * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ /* * A huge negative number is required for the MSG_ERRNO value. */ #define MSG_ERRNO (-9999) /* * Define the maximum message size. */ #define MSG_MAX_LEN 2048 typedef struct msg { int m_status; char *m_format; } MSG; extern void msg_append(); extern void msg_clear(); extern void msg_format(char *buffer, char *prefix, int num_msgs, MSG *msgs, int status, ...); skycat-3.1.2-starlink-1b/astrotcl/press/gen_str.h000066400000000000000000000025021215713201500217350ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Include File Name: gen/h/gen_str.h * * Purpose: * Contains defines and declarations for string manipulation. * * Date : Dec 10, 1990 * * SCCS data : @(#) * Module Name : gen_str.h * Version Number : 1.8 * Release Number : 1 * Last Updated : 12/16/92 * * Programmer : Severin Gaudet * * Modification History: * 92/03/02 Norman Hill - Added strnsav. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ /* * Standard include file. */ #include /* * Definitions. */ #ifndef STRSIZ #define STRSIZ 256 #endif #define streq(s1,s2) (strcmp(s1,s2) == 0) #define strne(s1,s2) (strcmp(s1,s2) != 0) /* * External function declarations. */ extern boolean str2float(); extern boolean str2int(); extern void str2lower(); extern void str2upper(); extern char *strapp(); extern char *strext(); extern char *strfit(); extern boolean strfloat(); extern void strhead(); extern boolean strint(); extern char *strnapp(); extern char *strnsav(); extern boolean strpattern(); extern void strroot(); extern char *strsav(); extern char *strtail(); extern void strtokens(); skycat-3.1.2-starlink-1b/astrotcl/press/gen_types.h000066400000000000000000000055341215713201500223010ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Include File Name: gen/h/gen_types.h * * Purpose: * General constants and macros. * * Date : Dec 10, 1990 * * SCCS data : @(#) * Module Name : gen_types.h * Version Number : 1.5 * Release Number : 1 * Last Updated : 2/17/94 * * Programmer : Severin Gaudet * * Modification History: * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ /* * Standard include files. */ #include #include /* * Data structures */ typedef int boolean; typedef unsigned char byte; typedef boolean (*pfb)(); typedef int (*pfi)(); typedef float (*pff)(); typedef void (*pfv)(); typedef void *pointer; /* * Constant definitions */ #ifndef FALSE #define FALSE 0 #define TRUE 1 #endif /* * Memory allocation macro definitions. */ #define gen_alloc(n) (malloc((unsigned)(n))) #define gen_calloc(n,s) (calloc((unsigned)(n),(unsigned)(s))) #define gen_free(p) ((void) free((pointer) (p))) #define gen_realloc(p,n) (realloc((pointer)(p),(unsigned)(n))) #define gen_zero(p,n) (memset((pointer)(p),0,(int)(n))) #define boolean_alloc(n) (boolean *)(gen_alloc(((n)*sizeof(boolean)))) #define byte_alloc(n) (byte *)(gen_alloc(((n) * sizeof(byte)))) #define char_alloc(n) (gen_alloc((n) * sizeof(char))) #define double_alloc(n) (double *)gen_alloc((n)*sizeof(double)) #define float_alloc(n) (float *)gen_alloc((n)*sizeof(float)) #define int_alloc(n) ((int *)gen_alloc((n)*sizeof(int))) #define ptr_alloc(n) ((pointer *)gen_alloc((n)*sizeof(pointer))) #define short_alloc(n) ((short *)gen_alloc((n)*sizeof(short))) /* * General macro definitions. */ #ifdef ABS #undef ABS #endif #define ABS(a) ((a) < 0 ? -(a) : (a)) #define EPSILON 0.00001 #define EVEN(x) ((0x01 & x) ? FALSE : TRUE) #define FEQ(a,b) (ABS((a)-(b)) <= EPSILON) /* Equal */ #define FLE(a,b) (FLT(a,b) || FEQ(a,b)) /* Less than or equal */ #define FLT(a,b) ((b)-(a) > EPSILON) /* Less than */ #define FGE(a,b) (FGT(a,b) || FEQ(a,b)) /* Greater than or equal*/ #define FGT(a,b) ((a)-(b) > EPSILON) /* Greater than */ #define FNE(a,b) (!(FEQ(a,b))) /* Not equal */ #define INRANGE(x,lo,hi) ((x)>=(lo) && (x)<=(hi)) #define INBOX(x,y,l,r,b,t) (INRANGE(x,l,r) && INRANGE(y,b,t)) #ifdef MAX #undef MAX #endif #define MAX(a, b) (((a) > (b)) ? (a) : (b)) #ifdef MIN #undef MIN #endif #define MIN(a, b) (((a) < (b)) ? (a) : (b)) #ifndef NULL #define NULL 0 #endif #define ROUND(x) ((x) + 0.5) #define SIGN(x) (((x) < (0)) ? (FEQ((x),0.0) ? 1 : (-1)) : 1) #define SWAP(a,b) {float swpv; swpv=(a);(a)=(b);(b)=swpv;} #define XOR(a,b) (((a) || (b)) && !((a) && (b))) skycat-3.1.2-starlink-1b/astrotcl/press/gzip.c000066400000000000000000000173651215713201500212550ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: press/src/gzip.c * * Purpose: * decompress files in gzip format. * Copyright (C) 1992-1993 Jean-loup Gailly * This is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License, see the file COPYING. * This version can extract files in gzip format. * * The code in this file is derived from the file funzip.c written * and put in the public domain by Mark Adler. * * Routines: * int gzip_comp : Uncompresses gzipped data. * int unzip : Compress data into gzip format. * * Date : June 21, 1993 * * SCCS data : @(#) * Module Name : gzip.c * Version Number : 1.8 * Release Number : 1 * Last Updated : 07/16/97 * * Programmer : Norman Hill * * Modification History: * 97/07/02 SEC : Bring up to ANSI C. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #ifdef HAVE_SYS_FILIO_H #include #endif #include #include #include #if ! defined( _SOL ) && ! defined( lint ) #include #endif /* allan: 2.8.96, changed #ifdef for configure */ #ifdef HAVE_VFORK_H #include #endif #include "gen_types.h" #include "gen_msg.h" #include "press.h" #include "local_press.h" #include "gzip.h" /* allan: 15-03-99: moved globals to here from gzip.h to avoid linker warning */ unsigned short *dbuf; /* buffer for distances, see trees.c */ unsigned char *swindow; /* Sliding window and suffix table (unlzw) */ unsigned short *tab_prefix; /* prefix code (see unlzw.c) */ unsigned inptr; /* Index of next byte to be processed */ /* in inbuf. */ unsigned insize; /* valid bytes in inbuf */ pfi char_in; /* Function to read bytes. */ pfi char_out; /* Function to write bytes. */ long bytes_out; /* The number of output bytes. */ #define EXTHDR 16 /* Size of extend local header. */ /*+ ************************************************************************ * * Synopsis: * int gzip_comp( char_in, char_out ) * * Purpose: * Statement of purpose. * * Parameters: * int (*char_in)() : (in) Function to get data from input. * int (*char_out)() : (in) Function to write data to output. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * ************************************************************************ -*/ int gzip_comp ( pfi char_in, /* (in) Func. to get data from input. */ pfi char_out /* (in) Func. to put data to output. */ ) { /* void pr_format_message(); */ byte out_buffer[4096]; byte in_buffer[4096]; byte *buf_ptr; int in_pipe[2]; int bytes_left; int bytes_read; int bytes_written; int out_pipe[2]; int tmp_stdin; int tmp_stdout; int status; tmp_stdin = dup( 0 ); tmp_stdout = dup( 1 ); PR_CHECK_IO( pipe( in_pipe ), "in pipe" ); PR_CHECK_IO( pipe( out_pipe ), "out pipe" ); (void) dup2( in_pipe[1], 1 ); (void) dup2( out_pipe[0], 0 ); if ( ( status = vfork() ) == 0 ) { (void) close( in_pipe[0] ); (void) close( out_pipe[1] ); (void) execlp( "gzip", "gzip", "-c", NULL ); pr_format_message( MSG_ERRNO, "gzip" ); _exit( 999 ); } PR_CHECK_IO( status, "vfork" ); (void) close( in_pipe[1] ); (void) close( out_pipe[0] ); (void) dup2( tmp_stdin, 0 ); (void) dup2( tmp_stdout, 1 ); (void) close( tmp_stdin ); (void) close( tmp_stdout ); PR_CHECK_IO( fcntl( out_pipe[1], F_SETFL, O_NDELAY | O_WRONLY ), "fcntl" ); PR_CHECK_IO( fcntl( in_pipe[0], F_SETFL, O_NDELAY ), "fcntl" ); while ( ( bytes_left = char_in( out_buffer, 4096 ) ) != PR_E_EOI ) { buf_ptr = out_buffer; do { bytes_written = write( out_pipe[1], buf_ptr, bytes_left ); if ( bytes_written < 0 ) { bytes_written = 0; } do { bytes_read = read( in_pipe[0], in_buffer, 4096 ); if ( bytes_read > 0 ) { PR_CHECK( char_out( in_buffer, bytes_read ) ); } } while ( bytes_read > 0 ); if ( bytes_read <= 0 && bytes_written <= 0 ) { /* sleep( 1 ); allan: 22.3.98: commented out: very bad for performance... */ } buf_ptr += bytes_written; bytes_left -= bytes_written; } while ( bytes_left > 0 ); } close( out_pipe[1] ); PR_CHECK_IO( fcntl( in_pipe[0], F_SETFL, O_RDONLY ), "fcntl" ); do { bytes_read = read( in_pipe[0], in_buffer, 4096 ); if ( bytes_read > 0 ) { PR_CHECK( char_out( in_buffer, bytes_read ) ); } } while ( bytes_read > 0 ); close( in_pipe[0] ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * int unzip( p_char_in, p_char_out ) * * Purpose: * Function to uncompress gzip files. * * Parameters: * int (*p_char_in)() : (in) Function to get the next input * character. * int (*p_char_out)() : (in) Function to send data to the output. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_EOI : End of input detected. * int PR_E_MAGIC : Invalid magic number. * int PR_E_METHOD : Unknown compression method. * ************************************************************************ -*/ int gzip_uncomp ( pfi p_char_in, /* (in) Func. to get char from input. */ pfi p_char_out /* (in) Func. to put char to output. */ ) { /* void pr_format_message(); */ unsigned char buff[EXTHDR]; /* extended local header */ char c; byte dummy[6]; byte flags; /* Compression flags. */ byte magic[2]; /* The magic number. */ byte method; /* The compress */ unsigned long orig_crc; /* original crc */ unsigned long orig_len; /* original uncompressed length */ char_in = p_char_in; char_out = p_char_out; orig_crc = 0; orig_len = 0; /* * Check the magic number and compression type. */ PR_CHECK( char_in( magic, 2 ) ); if ( memcmp( magic, GZIP_MAGIC, 2 ) != 0 ) { pr_format_message( PR_E_MAGIC ); return( PR_E_MAGIC ); } PR_CHECK( char_in( &method, 1 ) ); if ( method != DEFLATED ) { pr_format_message( PR_E_METHOD, method ); return( PR_E_METHOD ); } PR_CHECK( char_in( &flags, 1 ) ); if ( flags & ENCRYPTED || flags & CONTINUATION || flags & RESERVED ) { pr_format_message( PR_E_UNSUPPORT, "" ); return( PR_E_UNSUPPORT ); } /* * Skip over time stamp, extra flags, and os. */ PR_CHECK( char_in( dummy, 6 ) ); if ( ( flags & EXTRA_FIELD ) != 0 ) { /* * Skip the file length. */ PR_CHECK( char_in( dummy, 2 ) ); } /* * Skip over the original file name. */ if ( ( flags & ORIG_NAME ) != 0 ) { do { PR_CHECK( char_in( &c, 1 ) ); } while ( c != '\0' ); } /* * skip over the comment. */ if ( ( flags & COMMENT ) != 0 ) { do { PR_CHECK( char_in( &c, 1 ) ); } while ( c != '\0' ); } /* * initialize crc */ (void) updcrc(NULL, 0); /* * Decompress */ PR_CHECK( gzip_inflate() ); /* * Get the crc and original length */ /* * crc32 (see algorithm.doc) * uncompressed input size modulo 2^32 */ PR_CHECK( char_in( buff, 8 ) ); orig_crc = LG(buff); orig_len = LG(buff+4); /* * Validate decompression */ #ifdef OMIT if ( orig_crc != updcrc(buff, 0)) { pr_format_message( PR_E_CRC ); } #endif if (orig_len != bytes_out) { pr_format_message( PR_E_SIZE ); } return( PR_SUCCESS ); } skycat-3.1.2-starlink-1b/astrotcl/press/gzip.h000066400000000000000000000121471215713201500212530ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Include File Name: press/h/gzip.h * * Purpose: * Common declarations for all gzip modules * Copyright (C) 1992-1993 Jean-loup Gailly. * This is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License, see the file * COPYING. * * Date : June 22, 1993 * * SCCS data : @(#) * Module Name : gzip.h * Version Number : 1.2 * Release Number : 1 * Last Updated : 07/04/97 * * Programmer : Norman Hill * * Modification History: * 97/07/02 SEC : Added function prototype for flush_window(). * 98/10/16 ESO : Allan Brighton: changed global names to avoid clash * with cfitsio and tclpro, which also use gzip sources. * Changed "window" to "swindow", "prev" to "sprev". * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #ifdef __STDC__ typedef void *voidp; #else typedef char *voidp; #endif # define memzero(s, n) memset ((voidp)(s), 0, (n)) /* * Compression methods (see algorithm.doc) */ #define DEFLATED 8 #define MAX_METHODS 9 #define DIST_BUFSIZE 0x8000 /* buffer for distances, see trees.c */ /* allan: 15-03-99: added "extern" to avoid linker warning */ extern unsigned short *dbuf; /* buffer for distances, see trees.c */ extern unsigned char *swindow; /* Sliding window and suffix table (unlzw) */ #define tab_suffix swindow #define tab_prefix sprev /* hash link (see deflate.c) */ #define head (sprev+WSIZE) /* hash head (see deflate.c) */ extern unsigned short *tab_prefix; /* prefix code (see unlzw.c) */ extern unsigned insize; /* valid bytes in inbuf */ extern unsigned inptr; /* index of next byte to be processed in inbuf */ extern unsigned outcnt; /* bytes in output buffer */ extern long bytes_in; /* number of input bytes */ extern long bytes_out; /* number of output bytes */ extern long header_bytes;/* number of bytes in gzip header */ #define isize bytes_in /* for compatibility with old zip sources (to be cleaned) */ extern long time_stamp; /* original time stamp (modification time) */ extern long ifile_size; /* input file size, -1 for devices (debug only) */ typedef int file_t; /* Do not use stdio */ #define NO_FILE (-1) /* in memory compression */ #define GZIP_MAGIC "\037\213" /* Magic header for gzip files, 1F 8B */ /* * gzip flag byte */ #define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ #define CONTINUATION 0x02 /* bit 1 set: continuation of multi-part gzip file */ #define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ #define ORIG_NAME 0x08 /* bit 3 set: original file name present */ #define COMMENT 0x10 /* bit 4 set: file comment present */ #define ENCRYPTED 0x20 /* bit 5 set: file is encrypted */ #define RESERVED 0xC0 /* bit 6,7: reserved */ /* internal file attribute */ #define UNKNOWN 0xffff #define BINARY 0 #define ASCII 1 #ifndef WSIZE # define WSIZE 0x8000 /* window size--must be a power of two, and */ #endif /* at least 32K for zip's deflate method */ #define MIN_MATCH 3 #define MAX_MATCH 258 /* The minimum and maximum match lengths */ #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) /* Minimum amount of lookahead, except at the end of the input file. * See deflate.c for comments about the MIN_MATCH+1. */ #define MAX_DIST (WSIZE-MIN_LOOKAHEAD) /* In order to simplify the code, particularly on 16 bit machines, match * distances are limited to MAX_DIST instead of WSIZE. */ extern int decrypt; /* flag to turn on decryption */ extern int exit_code; /* program exit code */ extern int verbose; /* be verbose (-v) */ extern int quiet; /* be quiet (-q) */ extern int level; /* compression level */ extern int test; /* check .z file integrity */ extern int to_stdout; /* output to stdout (-c) */ extern int save_orig_name; /* set if original name must be saved */ extern pfi char_in; /* Function to read bytes. */ extern pfi char_out; /* function to write bytes. */ /* put_byte is used for the compressed output, put_ubyte for the * uncompressed output. However unlzw() uses window for its * suffix table instead of its output buffer, so it does not use put_ubyte * (to be cleaned up). */ /* Output a 16 bit value, lsb first */ #define seekable() 0 /* force sequential output */ #define translate_eol 0 /* no option -a yet */ #define tolow(c) (isupper(c) ? (c)-'A'+'a' : (c)) /* force to lower case */ /* Macros for getting two-byte and four-byte header values */ #define SH(p) ((unsigned short)(byte)((p)[0]) | \ ((unsigned short)(byte)((p)[1]) << 8)) #define LG(p) ((unsigned long)(SH(p)) | ((unsigned long)(SH((p)+2)) << 16)) #ifdef XXXDEBUG # define Tracevv(x) {if (verbose>1) fprintf x ;} # define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;} #else # define Tracevv(x) # define Tracecv(c,x) #endif /* * Function prototypes. */ extern int flush_window( void ); skycat-3.1.2-starlink-1b/astrotcl/press/gzip_inflate.c000066400000000000000000001045251215713201500227520ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: press/src/gzip_inflate.c * * Purpose: * Contains the gzip_inflate routine for gzip. * * gzip_inflate.c -- Not copyrighted 1992 by Mark Adler * version c10p1, 10 January 1993 * * You can do whatever you like with this source file, though I would * prefer that if you modify it and redistribute it that you include * comments to that effect with your name and the date. Thank you. * [The history has been moved to the file ChangeLog.] * * * Inflate deflated (PKZIP's method 8 compressed) data. The compression * method searches for as much of the current string of bytes (up to a * length of 258) in the previous 32K bytes. If it doesn't find any * matches (of at least length 3), it codes the next byte. Otherwise, it * codes the length of the matched string and its distance backwards from * the current position. There is a single Huffman code that codes both * single bytes (called "literals") and match lengths. A second Huffman * code codes the distance information, which follows a length code. Each * length or distance code actually represents a base value and a number * of "extra" (sometimes zero) bits to get to add to the base value. At * the end of each deflated block is a special end-of-block (EOB) literal/ * length code. The decoding process is basically: get a literal/length * code; if EOB then done; if a literal, emit the decoded byte; if a * length then get the distance and emit the referred-to bytes from the * sliding window of previously emitted data. * * There are (currently) three kinds of inflate blocks: stored, fixed, and * dynamic. The compressor deals with some chunk of data at a time, and * decides which method to use on a chunk-by-chunk basis. A chunk might * typically be 32K or 64K. If the chunk is uncompressible, then the * "stored" method is used. In this case, the bytes are simply stored as * is, eight bits per byte, with none of the above coding. The bytes are * preceded by a count, since there is no longer an EOB code. * * If the data is compressible, then either the fixed or dynamic methods * are used. In the dynamic method, the compressed data is preceded by * an encoding of the literal/length and distance Huffman codes that are * to be used to decode this block. The representation is itself Huffman * coded, and so is preceded by a description of that code. These code * descriptions take up a little space, and so for small blocks, there is * a predefined set of codes, called the fixed codes. The fixed method is * used if the block codes up smaller that way (usually for quite small * chunks), otherwise the dynamic method is used. In the latter case, the * codes are customized to the probabilities in the current block, and so * can code it much better than the pre-determined fixed codes. * * The Huffman codes themselves are decoded using a mutli-level table * lookup, in order to maximize the speed of decoding plus the speed of * building the decoding tables. See the comments below that precede the * lbits and dbits tuning parameters. * * * Notes beyond the 1.93a appnote.txt: * * 1. Distance pointers never point before the beginning of the output * stream. * 2. Distance pointers can point back across blocks, up to 32k away. * 3. There is an implied maximum of 7 bits for the bit length table and * 15 bits for the actual data. * 4. If only one code exists, then it is encoded using one bit. (Zero * would be more efficient, but perhaps a little confusing.) If two * codes exist, they are coded using one bit each (0 and 1). * 5. There is no way of sending zero distance codes--a dummy must be * sent if there are none. (History: a pre 2.0 version of PKZIP would * store blocks with no distance codes, but this was discovered to be * too harsh a criterion.) Valid only for 1.93a. 2.04c does allow * zero distance codes, which is sent as one code of zero bits in * length. * 6. There are up to 286 literal/length codes. Code 256 represents the * end-of-block. Note however that the static length tree defines * 288 codes just to fill out the Huffman codes. Codes 286 and 287 * cannot be used though, since there is no length base or extra bits * defined for them. Similarly, there are up to 30 distance codes. * However, static trees define 32 codes (all 5 bits) to fill out the * Huffman codes, but the last two had better not show up in the data. * 7. Unzip can check dynamic Huffman blocks for complete code sets. * The exception is that a single code would not be complete (see #4). * 8. The five bits following the block type is really the number of * literal codes sent minus 257. * 9. Length codes 8,16,16 are interpreted as 13 length codes of 8 bits * (1+6+6). Therefore, to output three times the length, you output * three codes (1+1+1), whereas to output four times the same length, * you only need two codes (1+3). Hmm. * 10. In the tree reconstruction algorithm, Code = Code + Increment * only if BitLength(i) is not zero. (Pretty obvious.) * 11. Correction: 4 Bits: # of Bit Length codes - 4 (4 - 19) * 12. Note: length code 284 can represent 227-258, but length code 285 * really is 258. The last length deserves its own, short code * since it gets used a lot in very redundant files. The length * 258 is special since 258 - 3 (the min match length) is 255. * 13. The literal/length and distance code bit lengths are read as a * single stream of lengths. It is possible (and advantageous) for * a repeat code (16, 17, or 18) to go across the boundary between * the two sets of lengths. * * Routines: * type routine : Brief description. * type routine : Brief description. * type routine : Brief description. * * Date : mmm dd, 1993 * * SCCS data : @(#) * Module Name : gzip_inflate.c * Version Number : 1.5 * Release Number : 1 * Last Updated : 08/29/97 * * Programmer : your name * * Modification History: * 97/07/02 SEC : Bring up to ANSI Standard. * 97/08/29 SEC : Free window buffer in gzip_inflate(). * 98/10/29 ESO : Added "static" keywords to avoid conflict with tclpro libs * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include #include #include "gen_types.h" #include "press.h" #include "local_press.h" #include "gzip.h" static int huft_free(HUFT *t); /* allan: added proto */ /* * The inflate algorithm uses a sliding 32K byte window on the uncompressed * stream to find repeated byte strings. This is implemented here as a * circular buffer. The index is updated simply by incrementing and then * and'ing with 0x7fff (32K-1). */ /* byte *swindow; (allan: was already defined in gzip.h) */ unsigned outcnt; /* current position in window */ #define flush_output(w) (outcnt=(w),flush_window()) /* * Tables for deflate from PKZIP's appnote.txt. */ static unsigned border[] = { /* Order of the bit length code lengths */ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; static unsigned short cplens[] = {/* Copy lengths for literal codes 257..285 */ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; /* note: see note #13 above about the 258 in this list. */ static unsigned short cplext[] = {/* Extra bits for literal codes 257..285 */ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99}; /* 99==invalid */ static unsigned short cpdist[] = {/* Copy offsets for distance codes 0..29 */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; static unsigned short cpdext[] = {/* Extra bits for distance codes */ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13}; /* * Macros for gzip_inflate() bit peeking and grabbing. * The usage is: * * NEEDBITS(j) * x = b & mask_bits[j]; * DUMPBITS(j) * * where NEEDBITS makes sure that b has at least j bits in it, and * DUMPBITS removes the bits from b. The macros use the variable k * for the number of bits in b. Normally, b and k are register * variables for speed, and are initialized at the beginning of a * routine that uses these macros from a global bit buffer and count. * * If we assume that EOB will be the longest code, then we will never * ask for bits with NEEDBITS that are beyond the end of the stream. * So, NEEDBITS should not read any more bytes than are needed to * meet the request. Then no bytes need to be "returned" to the buffer * at the end of the last block. * * However, this assumption is not true for fixed blocks--the EOB code * is 7 bits, but the other literal/length codes can be 8 or 9 bits. * (The EOB code is shorter than other codes because fixed blocks are * generally short. So, while a block always has an EOB, many other * literal/length codes have a significantly lower probability of * showing up at all.) However, by making the first table have a * lookup of seven bits, the EOB code will be found in that first * lookup, and so will not require that too many bits be pulled from * the stream. */ static unsigned long bb; /* bit buffer */ static unsigned bk; /* bits in bit buffer */ static unsigned short mask_bits[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff }; #define NEXTBYTE() (byte)get_byte() #define NEEDBITS(n) {while(k<(n)){b|=((unsigned long)NEXTBYTE())<>=(n);k-=(n);} /* * Huffman code decoding is performed using a multi-level table lookup. * The fastest way to decode is to simply build a lookup table whose * size is determined by the longest code. However, the time it takes * to build this table can also be a factor if the data being decoded * is not very long. The most common codes are necessarily the * shortest codes, so those codes dominate the decoding time, and hence * the speed. The idea is you can have a shorter table that decodes the * shorter, more probable codes, and then point to subsidiary tables for * the longer codes. The time it costs to decode the longer codes is * then traded against the time it takes to make longer tables. * * This results of this trade are in the variables lbits and dbits * below. lbits is the number of bits the first level table for literal/ * length codes can decode in one step, and dbits is the same thing for * the distance codes. Subsequent tables are also less than or equal to * those sizes. These values may be adjusted either when all of the * codes are shorter than that, in which case the longest code length in * bits is used, or when the shortest code is *longer* than the requested * table size, in which case the length of the shortest code in bits is * used. * * There are two different values for the two tables, since they code a * different number of possibilities each. The literal/length table * codes 286 possible values, or in a flat code, a little over eight * bits. The distance table codes 30 possible values, or a little less * than five bits, flat. The optimum values for speed end up being * about one bit more than those, so lbits is 8+1 and dbits is 5+1. * The optimum values may differ though from machine to machine, and * possibly even between compilers. Your mileage may vary. */ static int lbits = 9; /* bits in base literal/length lookup table */ static int dbits = 6; /* bits in base distance lookup table */ /* * If BMAX needs to be larger than 16, then h and x[] should be ulg. */ #define BMAX 16 /* maximum bit length of any code (16 for explode) */ #define N_MAX 288 /* maximum number of codes in any set */ static unsigned hufts; /* track memory usage */ /*+ ************************************************************************ * * Synopsis: * int huft_build( b, n, s, d, e, t, m ) * * Purpose: * Given a list of code lengths and a maximum table size, make a set of * tables to decode that set of codes. Return zero on success, one if * the given code set is incomplete (the tables are still built in this * case), two if the input is invalid (all zero length codes or an * oversubscribed set of lengths), and three if not enough memory. * * Parameters: * unsigned *b : (mod) code lengths in bits (all assumed * <= BMAX) * unsigned n : (in) Number of codes (assumed <= N_MAX) * unsigned s : (in) number of simple-valued codes (0..s-1) * unsigned short *d : (mod) list of base values for non-simple codes * unsigned short *e : (mod) list of extra bits for non-simple codes * struct huft **t : (out) result: starting table. * int *m : (mod) maximum lookup bits, returns actual. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_INC_LIT : Code set is incomplete (the tables are * still built in this case) * int PR_E_DATA : The input is invalid (all zero length * codes or an oversubscribed set of lengths) * int PR_E_MEMORY : Memory allocation failure. * ************************************************************************ -*/ static int huft_build ( unsigned *b, /* (???) */ unsigned n, /* (???) */ unsigned s, /* (???) */ unsigned short *d, /* (???) */ unsigned short *e, /* (???) */ HUFT **t, /* (???) */ int *m /* (???) */ ) { /* void pr_format_message(); */ unsigned a; /* counter for codes of length k */ unsigned c[BMAX+1]; /* bit length count table */ unsigned f; /* i repeats in table every f entries */ int g; /* maximum code length */ int h; /* table level */ unsigned i; /* counter, current code */ unsigned j; /* counter */ int k; /* number of bits in current code */ int l; /* bits per table (returned in m) */ unsigned *p; /* pointer into c[], b[], or v[] */ HUFT *q; /* points to current table */ HUFT r; /* table entry for structure assignment */ HUFT *u[BMAX]; /* table stack */ unsigned v[N_MAX]; /* values in order of bit length */ int w; /* bits before this table == (l * h) */ unsigned x[BMAX+1]; /* bit offsets, then code stack */ unsigned *xp; /* pointer into x */ int y; /* number of dummy codes added */ unsigned z; /* number of entries in current table */ /* * Generate counts for each bit length */ (void) memzero(c, sizeof(c)); p = b; i = n; do { Tracecv(*p, (stderr, (n-i >= ' ' && n-i <= '~' ? "%c %d\n" : "0x%x %d\n"), n-i, *p)); c[*p++]++; /* assume all entries <= BMAX */ } while (--i); if (c[0] == n) /* null input--all zero length codes */ { *t = (HUFT *) NULL; *m = 0; return( PR_SUCCESS ); } /* * Find minimum and maximum length, bound *m by those */ l = *m; for (j = 1; j <= BMAX; j++) { if (c[j]) { break; } } k = j; /* minimum code length */ if ((unsigned)l < j) { l = j; } for (i = BMAX; i; i--) { if (c[i]) { break; } } g = i; /* maximum code length */ if ((unsigned)l > i) { l = i; } *m = l; /* * Adjust last length count to fill out codes, if needed */ for (y = 1 << j; j < i; j++, y <<= 1) { if ((y -= c[j]) < 0) { pr_format_message( PR_E_DATA ); return( PR_E_DATA ); /* bad input: more codes than bits */ } } if ((y -= c[i]) < 0) { pr_format_message( PR_E_DATA ); return( PR_E_DATA ); /* bad input: more codes than bits */ } c[i] += y; /* * Generate starting offsets into the value table for each length */ x[1] = j = 0; p = c + 1; xp = x + 2; while (--i) /* note that i == g from above */ { *xp++ = (j += *p++); } /* Make a table of values in order of bit lengths */ p = b; i = 0; do { if ((j = *p++) != 0) { v[x[j]++] = i; } } while (++i < n); /* * Generate the Huffman codes and for each, make the table entries */ x[0] = i = 0; /* first Huffman code is zero */ p = v; /* grab values in bit order */ h = -1; /* no tables yet--level -1 */ w = -l; /* bits decoded == (l * h) */ u[0] = (HUFT *) NULL; /* just to keep compilers happy */ q = (HUFT *) NULL; /* ditto */ z = 0; /* ditto */ /* * go through the bit lengths (k already is bits in shortest code) */ for (; k <= g; k++) { a = c[k]; while (a--) { /* * here i is the Huffman code of length k bits for value *p * make tables up to required level */ while (k > w + l) { h++; w += l; /* previous table always l bits */ /* * compute minimum size table less than or equal to l bits */ /* upper limit on table size */ z = (z = g - w) > (unsigned)l ? l : z; /* try a k-w bit table */ if ((f = 1 << (j = k - w)) > a + 1) { /* too few codes for k-w bit table */ f -= a + 1; /* deduct codes from patterns left */ xp = c + k; while (++j < z) /* try smaller tables up to z bits */ { if ((f <<= 1) <= *++xp) { break; /* enough codes to use up j bits */ } f -= *xp; /* else deduct codes from patterns */ } } z = 1 << j; /* table entries for j-bit table */ /* * allocate and link in new table */ if ((q = (HUFT *) malloc((z + 1)*sizeof( HUFT ))) == (HUFT *)NULL) { if (h) { PR_CHECK( huft_free(u[0])); } pr_format_message( PR_E_MEMORY ); return( PR_E_MEMORY ); /* not enough memory */ } hufts += z + 1; /* track memory usage */ *t = q + 1; /* link to list for huft_free() */ *(t = &(q->v.t)) = (HUFT *) NULL; u[h] = ++q; /* table starts after link */ /* * connect to last table, if there is one */ if (h) { x[h] = i; /* save pattern for backing up */ r.b = (byte)l; /* bits to dump before this table */ r.e = (byte)(16 + j);/* bits in this table */ r.v.t = q; /* pointer to this table */ j = i >> (w - l); /* (get around Turbo C bug) */ u[h-1][j] = r; /* connect to last table */ } } /* * set up table entry in r */ r.b = (byte)(k - w); if (p >= v + n) { r.e = 99; /* out of values--invalid code */ } else if (*p < s) { r.e = (byte)(*p < 256 ? 16 : 15);/* 256 is end-of-block code */ r.v.n = (byte)(*p); /* simple code is just the value */ p++; /* one compiler does not like *p++ */ } else { r.e = (byte)e[*p - s]; /* non-simple--look up in lists */ r.v.n = d[*p++ - s]; } /* * fill code-like entries with r */ f = 1 << (k - w); for (j = i >> w; j < z; j += f) { q[j] = r; } /* * backwards increment the k-bit code i */ for (j = 1 << (k - 1); i & j; j >>= 1) { i ^= j; } i ^= j; /* * backup over finished tables */ while ((i & ((1 << w) - 1)) != x[h]) { h--; /* don't need to update q */ w -= l; } } } /* * Return true PR_E_INC_LIT if we were given an incomplete table */ if ( y != 0 && g != 1 ) { pr_format_message( PR_E_INC_LIT ); return( PR_E_INC_LIT ); } else { return( PR_SUCCESS ); } } /*+ ************************************************************************ * * Synopsis: * int huft_free( t ) * * Purpose: * Free the malloc'ed tables built by huft_build(), which makes a linked * list of the tables it made, with the links in a dummy first entry of * each table. * * Parameters: * struct huft *t : (in) Table to free. * * Values Returned: * int PR_SUCCESS : Normal completion. * ************************************************************************ -*/ static int huft_free ( HUFT *t /* ( ??? ) */ ) { HUFT *p; HUFT *q; /* * Go through linked list, freeing from the malloced (t[-1]) address. */ p = t; while (p != (HUFT *) NULL) { q = (--p)->v.t; free((char*)p); p = q; } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * int inflate_codes( tl, td, bl, bd ) * * Purpose: * gzip_inflate (decompress) the codes in a deflated (compressed) block. * * Parameters: * struct huft *tl : (in) literal/length decoder table. * struct huft *td : (in) distance decoder table. * int bl : (in) Number of bits decoded by tl. * int bd : (in) Number of bits decoded by td. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_DATA : Data is undecodable. * ************************************************************************ -*/ static int inflate_codes ( HUFT *tl, /* ( ??? ) */ HUFT *td, /* ( ??? ) */ int bl, /* ( ??? ) */ int bd /* ( ??? ) */ ) { unsigned e; /* table entry flag/number of extra bits*/ unsigned n, d; /* length and index for copy */ unsigned w; /* current window position */ HUFT *t; /* pointer to table entry */ unsigned ml, md; /* masks for bl and bd bits */ unsigned long b; /* bit buffer */ unsigned k; /* number of bits in bit buffer */ /* * make local copies of globals */ b = bb; /* initialize bit buffer */ k = bk; w = outcnt; /* initialize window position */ /* * inflate the coded data */ ml = mask_bits[bl]; /* precompute masks for speed */ md = mask_bits[bd]; for (;;) /* do until end of block */ { NEEDBITS((unsigned)bl) if ((e = (t = tl + ((unsigned)b & ml))->e) > 16) { do { if (e == 99) { pr_format_message( PR_E_DATA ); return( PR_E_DATA ); } DUMPBITS(t->b) e -= 16; NEEDBITS(e) } while ((e = (t = t->v.t + ((unsigned)b & mask_bits[e]))->e) > 16); } DUMPBITS(t->b) if (e == 16) /* then it's a literal */ { swindow[w++] = (byte)t->v.n; Tracevv((stderr, "%c", swindow[w-1])); if (w == WSIZE) { PR_CHECK( flush_output(w) ); w = 0; } } else /* it's an EOB or a length */ { /* exit if end of block */ if (e == 15) { break; } /* * get length of block to copy */ NEEDBITS(e) n = t->v.n + ((unsigned)b & mask_bits[e]); DUMPBITS(e); /* * decode distance of block to copy */ NEEDBITS((unsigned)bd) if ((e = (t = td + ((unsigned)b & md))->e) > 16) { do { if (e == 99) { pr_format_message( PR_E_DATA ); return( PR_E_DATA ); } DUMPBITS(t->b) e -= 16; NEEDBITS(e) } while ((e = (t = t->v.t + ((unsigned)b & mask_bits[e]))->e) > 16); } DUMPBITS(t->b) NEEDBITS(e) d = w - t->v.n - ((unsigned)b & mask_bits[e]); DUMPBITS(e) Tracevv((stderr,"\\[%d,%d]", w-d, n)); /* * do the copy */ do { n -= (e = (e = WSIZE - ((d &= WSIZE-1) > w ? d : w)) > n ? n : e); #if !defined(NOMEMCPY) && !defined(DEBUG) if (w - d >= e) /* (this test assumes unsigned comparison) */ { memcpy(swindow + w, swindow + d, e); w += e; d += e; } else /* do it slow to avoid memcpy() overlap */ #endif /* !NOMEMCPY */ { do { swindow[w++] = swindow[d++]; Tracevv((stderr, "%c", swindow[w-1])); } while (--e); } if (w == WSIZE) { PR_CHECK( flush_output(w) ); w = 0; } } while (n); } } /* * restore the globals from the locals */ outcnt = w; /* restore global window pointer */ bb = b; /* restore global bit buffer */ bk = k; /* * done */ return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * int inflate_stored( ) * * Purpose: * "decompress" an inflated type 0 (stored) block. * * Parameters: * void * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_DATA : An error occured in the data. * ************************************************************************ -*/ static int inflate_stored ( void ) { /* void pr_format_message(); */ unsigned n; /* number of bytes in block */ unsigned w; /* current window position */ unsigned long b; /* bit buffer */ unsigned k; /* number of bits in bit buffer */ /* * make local copies of globals */ b = bb; /* initialize bit buffer */ k = bk; w = outcnt; /* initialize window position */ /* * go to byte boundary */ n = k & 7; DUMPBITS(n); /* * get the length and its complement */ NEEDBITS(16) n = ((unsigned)b & 0xffff); DUMPBITS(16) NEEDBITS(16) if ( n != (unsigned)( ( ~b ) & 0xffff ) ) { /* * An error in the compressed data. */ pr_format_message( PR_E_DATA ); return( PR_E_DATA ); } DUMPBITS(16) /* * read and output the compressed data */ while (n--) { NEEDBITS(8) swindow[w++] = (byte)b; if (w == WSIZE) { PR_CHECK( flush_output( w ) ); w = 0; } DUMPBITS(8) } /* * restore the globals from the locals */ outcnt = w; /* restore global window pointer */ bb = b; /* restore global bit buffer */ bk = k; return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * int inflate_fixed() * * Purpose: * decompress an inflated type 1 (fixed Huffman codes) block. We should * either replace this with a custom decoder, or at least precompute the * Huffman tables. * * Parameters: * void * * Values Returned: * int PR_SUCCESS : Normal completion. * ************************************************************************ -*/ static int inflate_fixed ( void ) { int i; /* temporary variable */ HUFT *tl; /* literal/length code table */ HUFT *td; /* distance code table */ int bl; /* lookup bits for tl */ int bd; /* lookup bits for td */ unsigned l[288]; /* length list for huft_build */ /* * set up literal table */ for (i = 0; i < 144; i++) { l[i] = 8; } for (; i < 256; i++) { l[i] = 9; } for (; i < 280; i++) { l[i] = 7; } for (; i < 288; i++) /* make a complete, but wrong code set */ { l[i] = 8; } bl = 7; PR_CHECK( huft_build(l, 288, 257, cplens, cplext, &tl, &bl)); /* * set up distance table */ for (i = 0; i < 30; i++) /* make an incomplete code set */ { l[i] = 5; } bd = 5; i = huft_build( l, 30, 0, cpdist, cpdext, &td, &bd ); if ( i != PR_SUCCESS && i != PR_E_INC_LIT ) { PR_CHECK( huft_free(tl) ); return i; } /* * decompress until an end-of-block code */ PR_CHECK( inflate_codes(tl, td, bl, bd)); /* * free the decoding tables, return */ PR_CHECK( huft_free(tl) ); PR_CHECK( huft_free(td) ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * int inflate_dynamic() * * Purpose: * decompress an inflated type 2 (dynamic Huffman codes) block. * * Parameters: * void * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_DATA : Data could not be decompressed. * ************************************************************************ -*/ static int inflate_dynamic ( void ) { /* void pr_format_message(); */ int i; /* temporary variables */ unsigned j; unsigned l; /* last length */ unsigned m; /* mask for bit lengths table */ unsigned n; /* number of lengths to get */ HUFT *tl; /* literal/length code table */ HUFT *td; /* distance code table */ int bl; /* lookup bits for tl */ int bd; /* lookup bits for td */ unsigned nb; /* number of bit length codes */ unsigned nl; /* number of literal/length codes */ unsigned nd; /* number of distance codes */ #ifdef PKZIP_BUG_WORKAROUND unsigned ll[288+32]; /* literal/length and distance code lengths */ #else unsigned ll[286+30]; /* literal/length and distance code lengths */ #endif unsigned long b; /* bit buffer */ unsigned k; /* number of bits in bit buffer */ /* * make local bit buffer */ b = bb; k = bk; /* * read in table lengths */ NEEDBITS(5) nl = 257 + ((unsigned)b & 0x1f); /* number of literal/length codes */ DUMPBITS(5) NEEDBITS(5) nd = 1 + ((unsigned)b & 0x1f); /* number of distance codes */ DUMPBITS(5) NEEDBITS(4) nb = 4 + ((unsigned)b & 0xf); /* number of bit length codes */ DUMPBITS(4) #ifdef PKZIP_BUG_WORKAROUND if (nl > 288 || nd > 32) #else if (nl > 286 || nd > 30) #endif { /* * Bad lengths. */ pr_format_message( PR_E_DATA ); return( PR_E_DATA ); } /* * read in bit-length-code lengths */ for (j = 0; j < nb; j++) { NEEDBITS(3) ll[border[j]] = (unsigned)b & 7; DUMPBITS(3) } for (; j < 19; j++) { ll[border[j]] = 0; } /* * build decoding table for trees--single level, 7 bit lookup */ bl = 7; if ( ( i = huft_build( ll, 19, 19, NULL, NULL, &tl, &bl ) ) != PR_SUCCESS ) { if ( i == PR_E_INC_LIT ) { PR_CHECK( huft_free(tl) ); } return i; /* incomplete code set */ } /* * read in literal and distance code lengths */ n = nl + nd; m = mask_bits[bl]; i = l = 0; while ( (unsigned) i < n ) { NEEDBITS((unsigned)bl) j = (td = tl + ((unsigned)b & m))->b; DUMPBITS(j) j = td->v.n; if (j < 16) /* length of code in bits (0..15) */ { ll[i++] = l = j; /* save last length in l */ } else if (j == 16) /* repeat last length 3 to 6 times */ { NEEDBITS(2) j = 3 + ((unsigned)b & 3); DUMPBITS(2) if ((unsigned)i + j > n) { pr_format_message( PR_E_DATA ); return( PR_E_DATA ); } while (j--) { ll[i++] = l; } } else if (j == 17) /* 3 to 10 zero length codes */ { NEEDBITS(3) j = 3 + ((unsigned)b & 7); DUMPBITS(3) if ((unsigned)i + j > n) { pr_format_message( PR_E_DATA ); return( PR_E_DATA ); } while (j--) { ll[i++] = 0; } l = 0; } else /* j == 18: 11 to 138 zero length codes */ { NEEDBITS(7) j = 11 + ((unsigned)b & 0x7f); DUMPBITS(7) if ((unsigned)i + j > n) { pr_format_message( PR_E_DATA ); return( PR_E_DATA ); } while (j--) { ll[i++] = 0; } l = 0; } } /* * free decoding table for trees */ PR_CHECK( huft_free(tl) ); /* * restore the global bit buffer */ bb = b; bk = k; /* * build the decoding tables for literal/length and distance codes */ bl = lbits; if ((i = huft_build(ll, nl, 257, cplens, cplext, &tl, &bl)) != PR_SUCCESS) { if ( i == PR_E_INC_LIT ) { PR_CHECK( huft_free(tl) ); } return i; /* incomplete code set */ } bd = dbits; if ((i = huft_build(ll + nl, nd, 0, cpdist, cpdext, &td, &bd)) != PR_SUCCESS) { if (i == PR_E_INC_LIT ) { #ifdef PKZIP_BUG_WORKAROUND i = 0; } #else PR_CHECK( huft_free(td) ); } PR_CHECK( huft_free(tl) ); return( i ); /* incomplete code set */ #endif } /* * decompress until an end-of-block code */ PR_CHECK( inflate_codes(tl, td, bl, bd)); /* * free the decoding tables, return */ PR_CHECK( huft_free(tl) ); PR_CHECK( huft_free(td) ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int inflate_block( e ) * * Purpose: * decompress an inflated block * * Parameters: * boolean e : (out) End flag. * * Values Returned: * int PR_SUCCESS : Normal completion. * ************************************************************************ -*/ static int inflate_block ( boolean *e /* (???) */ ) { unsigned t; /* block type */ unsigned long b; /* bit buffer */ unsigned k; /* number of bits in bit buffer */ /* * make local bit buffer */ b = bb; k = bk; /* * read in last block bit */ NEEDBITS(1) *e = (int)b & 1; DUMPBITS(1) /* * read in block type */ NEEDBITS(2) t = (unsigned)b & 3; DUMPBITS(2) /* * restore the global bit buffer */ bb = b; bk = k; /* * inflate that block type */ if ( t == 2 ) { return( inflate_dynamic() ); } else if ( t == 0 ) { return( inflate_stored() ); } else if ( t == 1 ) { return( inflate_fixed() ); } /* * bad block type */ pr_format_message( PR_E_BLOCK, t ); return( PR_E_BLOCK ); } /*+ ************************************************************************ * * Synopsis: * int gzip_inflate() * * Purpose: * Decompress an inflated entry. * * Parameters: * void * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_MEMORY : Memory alloation failure. * ************************************************************************ -*/ int gzip_inflate ( void ) { /* static int inflate_block(); */ boolean e; /* last block flag */ unsigned h; /* maximum struct huft's malloc'ed */ /* * initialize window, bit buffer */ outcnt = 0; bk = 0; bb = 0; PR_CHECK_NULL(swindow = byte_alloc( WSIZE ) ); /* * decompress until the last block */ h = 0; do { hufts = 0; PR_CHECK( inflate_block( &e ) ); if (hufts > h) { h = hufts; } } while ( !e ); /* * Undo too much lookahead. The next read will be byte aligned so we * can discard unused bits in the last meaningful byte. */ while ( bk >= 8 ) { bk -= 8; inptr--; } /* * flush out window, free memory allocated to window. */ PR_CHECK( flush_output( outcnt ) ); gen_free( swindow ); return( PR_SUCCESS ); } skycat-3.1.2-starlink-1b/astrotcl/press/gzip_util.c000066400000000000000000000372221215713201500223040ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: press/src/gzip_util.c * * Purpose: * Contains utility routines for gzip. * * Routines: * type routine : Brief description. * type routine : Brief description. * type routine : Brief description. * * Date : mmm dd, 1993 * * SCCS data : @(#) * Module Name : gzip_util.c * Version Number : 1.2 * Release Number : 1 * Last Updated : 07/04/97 * * Programmer : your name * * Modification History: * 97/07/02 SEC : Bring up to ANSI standard. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include "gen_types.h" #include "press.h" #include "local_press.h" #include "gzip.h" /* ======================================================================== * Table of CRC-32's of all single-byte values (made by makecrc.c) */ static unsigned long crc_32_tab[] = { 0x00000000UL, 0x77073096UL, 0xee0e612cUL, 0x990951baUL, 0x076dc419UL, 0x706af48fUL, 0xe963a535UL, 0x9e6495a3UL, 0x0edb8832UL, 0x79dcb8a4UL, 0xe0d5e91eUL, 0x97d2d988UL, 0x09b64c2bUL, 0x7eb17cbdUL, 0xe7b82d07UL, 0x90bf1d91UL, 0x1db71064UL, 0x6ab020f2UL, 0xf3b97148UL, 0x84be41deUL, 0x1adad47dUL, 0x6ddde4ebUL, 0xf4d4b551UL, 0x83d385c7UL, 0x136c9856UL, 0x646ba8c0UL, 0xfd62f97aUL, 0x8a65c9ecUL, 0x14015c4fUL, 0x63066cd9UL, 0xfa0f3d63UL, 0x8d080df5UL, 0x3b6e20c8UL, 0x4c69105eUL, 0xd56041e4UL, 0xa2677172UL, 0x3c03e4d1UL, 0x4b04d447UL, 0xd20d85fdUL, 0xa50ab56bUL, 0x35b5a8faUL, 0x42b2986cUL, 0xdbbbc9d6UL, 0xacbcf940UL, 0x32d86ce3UL, 0x45df5c75UL, 0xdcd60dcfUL, 0xabd13d59UL, 0x26d930acUL, 0x51de003aUL, 0xc8d75180UL, 0xbfd06116UL, 0x21b4f4b5UL, 0x56b3c423UL, 0xcfba9599UL, 0xb8bda50fUL, 0x2802b89eUL, 0x5f058808UL, 0xc60cd9b2UL, 0xb10be924UL, 0x2f6f7c87UL, 0x58684c11UL, 0xc1611dabUL, 0xb6662d3dUL, 0x76dc4190UL, 0x01db7106UL, 0x98d220bcUL, 0xefd5102aUL, 0x71b18589UL, 0x06b6b51fUL, 0x9fbfe4a5UL, 0xe8b8d433UL, 0x7807c9a2UL, 0x0f00f934UL, 0x9609a88eUL, 0xe10e9818UL, 0x7f6a0dbbUL, 0x086d3d2dUL, 0x91646c97UL, 0xe6635c01UL, 0x6b6b51f4UL, 0x1c6c6162UL, 0x856530d8UL, 0xf262004eUL, 0x6c0695edUL, 0x1b01a57bUL, 0x8208f4c1UL, 0xf50fc457UL, 0x65b0d9c6UL, 0x12b7e950UL, 0x8bbeb8eaUL, 0xfcb9887cUL, 0x62dd1ddfUL, 0x15da2d49UL, 0x8cd37cf3UL, 0xfbd44c65UL, 0x4db26158UL, 0x3ab551ceUL, 0xa3bc0074UL, 0xd4bb30e2UL, 0x4adfa541UL, 0x3dd895d7UL, 0xa4d1c46dUL, 0xd3d6f4fbUL, 0x4369e96aUL, 0x346ed9fcUL, 0xad678846UL, 0xda60b8d0UL, 0x44042d73UL, 0x33031de5UL, 0xaa0a4c5fUL, 0xdd0d7cc9UL, 0x5005713cUL, 0x270241aaUL, 0xbe0b1010UL, 0xc90c2086UL, 0x5768b525UL, 0x206f85b3UL, 0xb966d409UL, 0xce61e49fUL, 0x5edef90eUL, 0x29d9c998UL, 0xb0d09822UL, 0xc7d7a8b4UL, 0x59b33d17UL, 0x2eb40d81UL, 0xb7bd5c3bUL, 0xc0ba6cadUL, 0xedb88320UL, 0x9abfb3b6UL, 0x03b6e20cUL, 0x74b1d29aUL, 0xead54739UL, 0x9dd277afUL, 0x04db2615UL, 0x73dc1683UL, 0xe3630b12UL, 0x94643b84UL, 0x0d6d6a3eUL, 0x7a6a5aa8UL, 0xe40ecf0bUL, 0x9309ff9dUL, 0x0a00ae27UL, 0x7d079eb1UL, 0xf00f9344UL, 0x8708a3d2UL, 0x1e01f268UL, 0x6906c2feUL, 0xf762575dUL, 0x806567cbUL, 0x196c3671UL, 0x6e6b06e7UL, 0xfed41b76UL, 0x89d32be0UL, 0x10da7a5aUL, 0x67dd4accUL, 0xf9b9df6fUL, 0x8ebeeff9UL, 0x17b7be43UL, 0x60b08ed5UL, 0xd6d6a3e8UL, 0xa1d1937eUL, 0x38d8c2c4UL, 0x4fdff252UL, 0xd1bb67f1UL, 0xa6bc5767UL, 0x3fb506ddUL, 0x48b2364bUL, 0xd80d2bdaUL, 0xaf0a1b4cUL, 0x36034af6UL, 0x41047a60UL, 0xdf60efc3UL, 0xa867df55UL, 0x316e8eefUL, 0x4669be79UL, 0xcb61b38cUL, 0xbc66831aUL, 0x256fd2a0UL, 0x5268e236UL, 0xcc0c7795UL, 0xbb0b4703UL, 0x220216b9UL, 0x5505262fUL, 0xc5ba3bbeUL, 0xb2bd0b28UL, 0x2bb45a92UL, 0x5cb36a04UL, 0xc2d7ffa7UL, 0xb5d0cf31UL, 0x2cd99e8bUL, 0x5bdeae1dUL, 0x9b64c2b0UL, 0xec63f226UL, 0x756aa39cUL, 0x026d930aUL, 0x9c0906a9UL, 0xeb0e363fUL, 0x72076785UL, 0x05005713UL, 0x95bf4a82UL, 0xe2b87a14UL, 0x7bb12baeUL, 0x0cb61b38UL, 0x92d28e9bUL, 0xe5d5be0dUL, 0x7cdcefb7UL, 0x0bdbdf21UL, 0x86d3d2d4UL, 0xf1d4e242UL, 0x68ddb3f8UL, 0x1fda836eUL, 0x81be16cdUL, 0xf6b9265bUL, 0x6fb077e1UL, 0x18b74777UL, 0x88085ae6UL, 0xff0f6a70UL, 0x66063bcaUL, 0x11010b5cUL, 0x8f659effUL, 0xf862ae69UL, 0x616bffd3UL, 0x166ccf45UL, 0xa00ae278UL, 0xd70dd2eeUL, 0x4e048354UL, 0x3903b3c2UL, 0xa7672661UL, 0xd06016f7UL, 0x4969474dUL, 0x3e6e77dbUL, 0xaed16a4aUL, 0xd9d65adcUL, 0x40df0b66UL, 0x37d83bf0UL, 0xa9bcae53UL, 0xdebb9ec5UL, 0x47b2cf7fUL, 0x30b5ffe9UL, 0xbdbdf21cUL, 0xcabac28aUL, 0x53b39330UL, 0x24b4a3a6UL, 0xbad03605UL, 0xcdd70693UL, 0x54de5729UL, 0x23d967bfUL, 0xb3667a2eUL, 0xc4614ab8UL, 0x5d681b02UL, 0x2a6f2b94UL, 0xb40bbe37UL, 0xc30c8ea1UL, 0x5a05df1bUL, 0x2d02ef8dUL }; int get_byte ( void ) { byte c; int s; s = char_in( &c, 1 ); return( (int) c ); } #ifdef omit /* util.c -- utility functions for gzip support * Copyright (C) 1992-1993 Jean-loup Gailly * This is free software; you can redistribute it and/or modify it under the * terms of the GNU General Public License, see the file COPYING. */ #include #include #include x#include "tailor.h" #include #include x#include "gzip.h" x#include "crypt.h" /* =========================================================================== * Copy input to output unchanged: zcat == cat with --force. * IN assertion: insize bytes have already been read in inbuf. */ int copy ( int in, /* Input file descriptor. */ int out /* Output file descriptor. */ ) { errno = 0; while (insize != 0 && (int)insize != EOF) { write_buf(out, (char*)inbuf, insize); bytes_out += insize; insize = read(in, (char*)inbuf, INBUFSIZ); } if ((int)insize == EOF && errno != 0) { read_error(); } bytes_in = bytes_out; return OK; } #endif /* omit */ /* =========================================================================== * Run a set of bytes through the crc shift register. If s is a NULL * pointer, then initialize the crc shift register contents instead. * Return the current crc in either case. */ unsigned long updcrc ( byte *s, /* pointer to bytes to pump through. */ unsigned n /* number of bytes in s[]. */ ) { unsigned long c; /* temporary variable. */ static unsigned long crc = 0xffffffffUL; /* shift register contents. */ if (s == NULL) { c = 0xffffffffUL; } else { c = crc; for ( ; n > (unsigned) 0 ; n-- ) { c = crc_32_tab[((int)c ^ (*s++)) & 0xff] ^ (c >> 8); } } crc = c; return ( c ^ 0xffffffffUL ); /* (instead of ~c for 64-bit machines) */ } #ifdef omit /* =========================================================================== * Clear input and output buffers */ void clear_bufs ( void ) { outcnt = 0; insize = inptr = 0; bytes_in = bytes_out = 0L; } /* =========================================================================== * Fill the input buffer. This is called only when the buffer is empty. */ int fill_inbuf ( int eof_ok /* set if EOF acceptable as a result. */ ) { /* void pr_format_message(); */ int len; /* Read as much as possible */ insize = 0; errno = 0; do { len = char_in((char*)inbuf+insize, INBUFSIZ-insize); if (len == 0 || len == PR_E_EOI ) break; insize += len; } while (insize < INBUFSIZ); if (insize == 0) { if (eof_ok) return(PR_E_EOI); pr_format_message( PR_E_EOI ); } bytes_in += (unsigned long)insize; inptr = 1; return inbuf[0]; } /* =========================================================================== * Write the output buffer outbuf[0..outcnt-1] and update bytes_out. * (used for the compressed data only) */ void flush_outbuf ( void ) { if (outcnt == 0) return; write_buf(ofd, (char *)outbuf, outcnt); bytes_out += (ulg)outcnt; outcnt = 0; } #endif /* omit */ /*+ ************************************************************************ * * Synopsis: * int flush_window() * * Purpose: * Write the output window window[0..outcnt-1] and update crc and * bytes_out. (Used for the decompressed data only.) * * Parameters: * type arg1 : (in) What it is * type arg2 : (mod) What it is * type argn : (out) What it is * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Io error. * ************************************************************************ -*/ int flush_window ( void ) { if (outcnt == 0) { return( PR_SUCCESS ); } updcrc(swindow, outcnt); PR_CHECK( char_out( swindow, outcnt ) ); bytes_out += (unsigned long) outcnt; outcnt = 0; return( PR_SUCCESS ); } #ifdef omit /* ======================================================================== * Put string s in lower case, return s. */ char *strlwr ( char *s /* (mod) string to mod to lower case. */ ) { char *t; /* pointer into string. */ for (t = s; *t; t++) *t = tolow(*t); return s; } /* ======================================================================== * Return the base name of a file (remove any directory prefix and * any version suffix). For systems with file names that are not * case sensitive, force the base name to lower case. */ char *basename ( char *fname /* (mod) Filename to get base name of. */ ) { char *p; /* pointer into filename string. */ if ((p = strrchr(fname, PATH_SEP)) != NULL) fname = p+1; #ifdef PATH_SEP2 if ((p = strrchr(fname, PATH_SEP2)) != NULL) fname = p+1; #endif #ifdef PATH_SEP3 if ((p = strrchr(fname, PATH_SEP3)) != NULL) fname = p+1; #endif #ifdef SUFFIX_SEP if ((p = strrchr(fname, SUFFIX_SEP)) != NULL) *p = '\0'; #endif if (casemap('A') == 'a') strlwr(fname); return fname; } /* ======================================================================== * Make a file name legal for file systems not allowing file names with * multiple dots or starting with a dot (such as MSDOS), by changing * all dots except the last one into underlines. A target dependent * function can be used instead of this simple function by defining the macro * MAKE_LEGAL_NAME in tailor.h and providing the function in a target * dependent module. */ void make_simple_name ( char *name /* (mod) filename to make legal. */ ) { char *p = strrchr(name, '.'); /* pointer into filename string. */ if (p == NULL) return; if (p == name) p++; do { if (*--p == '.') *p = '_'; } while (p != name); } #if defined(NO_STRING_H) && !defined(STDC_HEADERS) /* Provide missing strspn and strcspn functions. */ # ifndef __STDC__ # define const # endif int strspn OF((const char *s, const char *accept)); int strcspn OF((const char *s, const char *reject)); /* ======================================================================== * Return the length of the maximum initial segment * of s which contains only characters in accept. */ int strspn ( const char *s, /* (in) String to search for chars in. */ const char *accept /* (in) String of chars to search for. */ ) { register const char *p; /* Pointer into string s. */ register const char *a; /* Pointer into string a. */ register int count = 0; /* Counter. */ for (p = s; *p != '\0'; ++p) { for (a = accept; *a != '\0'; ++a) { if (*p == *a) break; } if (*a == '\0') return count; ++count; } return count; } /* ======================================================================== * Return the length of the maximum inital segment of s * which contains no characters from reject. */ int strcspn ( const char *s, /* (in) String to search for chars in. */ const char *reject /* (in) String of chars to search for. */ ) { register int count = 0; /* Counter. */ while (*s != '\0') { if (strchr(reject, *s++) != NULL) return count; ++count; } return count; } #endif /* NO_STRING_H */ /* ======================================================================== * Add an environment variable (if any) before argv, and update argc. * Return the expanded environment variable to be freed later, or NULL * if no options were added to argv. */ #define SEPARATOR " \t" /* separators in env variable */ char *add_envopt ( int *argcp, /* pointer to argc */ char ***argvp, /* pointer to argv */ char *env /* name of environment variable */ ) { char *p; /* running pointer through env variable */ char **oargv; /* runs through old argv array */ char **nargv; /* runs through new argv array */ int oargc = *argcp; /* old argc */ int nargc = 0; /* number of arguments in env variable */ env = (char*)getenv(env); if (env == NULL) return NULL; p = (char*)xmalloc(strlen(env)+1); env = strcpy(p, env); /* keep env variable intact */ for (p = env; *p; nargc++ ) { /* move through env */ p += strspn(p, SEPARATOR); /* skip leading separators */ if (*p == '\0') break; p += strcspn(p, SEPARATOR); /* find end of word */ if (*p) *p++ = '\0'; /* mark it */ } if (nargc == 0) { free(env); env = NULL; return NULL; } *argcp += nargc; /* Allocate the new argv array, with an extra element just in case * the original arg list did not end with a NULL. */ nargv = (char**)calloc(*argcp+1, sizeof(char *)); if (nargv == NULL) error("out of memory"); oargv = *argvp; *argvp = nargv; /* Copy the program name first */ if (oargc-- < 0) error("argc<=0"); *(nargv++) = *(oargv++); /* Then copy the environment args */ for (p = env; nargc > 0; nargc--) { p += strspn(p, SEPARATOR); /* skip separators */ *(nargv++) = p; /* store start */ while (*p++) ; /* skip over word */ } /* Finally copy the old args and add a NULL (usual convention) */ while (oargc--) *(nargv++) = *(oargv++); *nargv = NULL; return env; } /* ======================================================================== * Error handlers. */ void error ( char *m /* (in) Message to print. */ ) { fprintf(stderr, "\n%s: %s: %s\n", progname, ifname, m); abort_gzip(); } void warn ( char *a, /* message string juxtaposed in output */ char *b /* message string juxtaposed in output */ ) { WARN((stderr, "%s: %s: warning: %s%s\n", progname, ifname, a, b)); } void read_error ( void ) { fprintf(stderr, "\n%s: ", progname); if (errno != 0) { perror(ifname); } else { fprintf(stderr, "%s: unexpected end of file\n", ifname); } abort_gzip(); } void write_error ( void ) { fprintf(stderr, "\n%s: ", progname); perror(ofname); abort_gzip(); } /* ======================================================================== * Display compression ratio on the given stream on 6 characters. */ void display_ratio ( long num; long den; FILE *file; ) { long ratio; /* 1000 times the compression ratio. */ if (den == 0) { ratio = 0; /* no compression */ } else if (den < 2147483L) { /* (2**31 -1)/1000 */ ratio = 1000L*num/den; } else { ratio = num/(den/1000L); } if (ratio < 0) { putc('-', file); ratio = -ratio; } else { putc(' ', file); } fprintf(file, "%2ld.%1ld%%", ratio / 10L, ratio % 10L); } /* ======================================================================== * Semi-safe malloc -- never returns NULL. */ voidp i xmalloc ( unsigned size; /* (in) Size to malloc. */ ) { voidp cp = (voidp)malloc (size); /* pointer to malloced memory. */ if (cp == NULL) error("out of memory"); return cp; } #endif skycat-3.1.2-starlink-1b/astrotcl/press/h_comp.h000066400000000000000000000016131215713201500215430ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Include File Name: press/h/h_comp.h * * Purpose: * Header file for the h compress routines. * * Date : Mar 15, 1993 * * SCCS data : @(#) * Module Name : h_comp.h * Version Number : 1.3 * Release Number : 1 * Last Updated : 30 Mar 1993 * * Programmer : Norman Hill * * Modification History: * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ static unsigned char code_magic[2] = { 0xDD, 0x99 }; /* allan: see h_decomp.c for routine */ /* #define read_int( char_in, data ) char_in( (byte *) data, sizeof( int ) ) */ /* allan: see h_press.c for routine */ /*#define write_int( char_out, data ) char_out( (byte *) data, sizeof( int ) )*/ skycat-3.1.2-starlink-1b/astrotcl/press/h_decomp.c000066400000000000000000000723501215713201500220550ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: press/src/h_uncomp.c * * Purpose: * Countains routines to decompress hcompressed data. * * Routines: * static int decode : Decode hcompressed data. * static int dodecode : Do the decode. * static int fitspass : Pass fits header from input to output. * int h_uncomp : Uncompresses hcompressed data. * static int input_bit : Gets a single bit from the input. * static int input_huffman : Huffman decoding for fixed codes. * static int input_nbits : Get a specified number of bits from * the input. * static int makefits : Write a simple fits header for a * 2-d image. * static void qtree_bitins : * static void qtree_copy : * static int qtree_decode : Turn a stream of bits into a * bitplanes. * static int qtree_expand : Do one quadtree expansion step. * static int read_bdirect : Reads an image packed 4 bits per * byte. * static void start_inputing_bits : Initializes the bit input functions. * * Date : Mar 15, 1993 * * SCCS data : @(#) * Module Name : h_decomp.c * Version Number : 1.7 * Release Number : 1 * Last Updated : 07/04/97 * * Programmer : Norman Hill * * Modification History: * 97/07/02 SEC : Bring up to ANSI standard. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include #include #include #include #include #include "gen_types.h" #include "gen_str.h" #include "gen_msg.h" #include "press.h" #include "local_press.h" #include "h_comp.h" #define input_nybble(char_in) input_nbits(char_in,4) /* THE BIT BUFFER */ static int buffer; /* Bits waiting to be input */ static int bits_to_go; /* Number of bits still in buffer */ /* * Static function prototypes. */ static int decode( ); static int dodecode( pfi, int *, int, int, byte * ); static int fitspass( pfi, boolean, pfi ); static int makefits( pfi, int, int, int, char * ); static int input_bit( pfi ); static int input_nbits( pfi, int ); static int qtree_decode( pfi, int *, int, int, int, int ); static void start_inputing_bits( void ); static int input_huffman( pfi ); static void qtree_bitins( byte *, int, int, int *, int, int ); static void qtree_copy( byte *, int, int, byte *, int ); static int qtree_expand ( pfi, byte *, int, int, byte * ); static int read_bdirect ( pfi, int *, int, int, int, byte *, int ); /* * allan: 17.12.97: replaced a non-portable #define with this routine */ int read_int(pfi char_in, int* i) { int status = char_in((byte *)i, sizeof(int)); *i = ntohl(*i); return status; } /*+ ************************************************************************ * * Synopsis: * static int decode( char_in, char_out, a, nx, ny, scale, format ) * * Purpose: * Reads codes from an hcompressed file and creates an array. * * Parameters: * int (*char_in)() : (in) Function to read data. * int (*char_out)() : (in) Function to write data. * int **a : (out) Address of output array. * int *nx : (out) Size on x axis. * int *ny : (out) Size on y axis. * int *scale : (out) Scale factor of digitization. * char **format : (mod) A string indicating the output type. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_FORMAT : Data format was incorrect. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * ************************************************************************ -*/ static int decode ( pfi char_in, /* (in) Function to read data. */ pfi char_out, /* (in) Function to write data. */ int **a, /* (out) Address of output array. */ int *nx, /* (out) Size on x axis. */ int *ny, /* (out) Size on y axis. */ int *scale, /* (out) Scale factor of digitization. */ char **format /* (mod) String of the output type. */ ) { /* int dodecode(); */ /* static int fitspass(); */ /* static int makefits(); */ /* void pr_format_message(); */ int nel; int sumall; int newfits = 0; byte nbitplanes[3]; char tmagic[2]; char line[81]; /* * File starts either with special 2-byte magic code or with * FITS keyword "SIMPLE =" */ PR_CHECK( char_in( tmagic, sizeof( tmagic ) ) ); /* * Check for FITS */ if ( strncmp( tmagic, "SI", 2 ) == 0 ) { /* * read rest of line and make sure the whole keyword is correct */ (void) strncpy( line, "SI", 2 ); if ( char_in( line + 2, 78 ) != 78 ) { pr_format_message( PR_E_FORMAT ); return( PR_E_FORMAT ); } line[80] = '\0'; if ( strncmp( line, "SIMPLE =", 9) != 0 ) { pr_format_message( PR_E_FORMAT ); return( PR_E_FORMAT ); } /* * set output format to default "fits" if it is empty */ if ( ( *format )[0] == '\0' ) { *format = "fits"; } /* * if fits output format and outfile != NULL, write this line to * outfile and then copy rest of FITS header; else just read past * FITS header. */ if ( strcmp( *format, "fits" ) == 0 ) { char_out( line, 80 ); PR_CHECK( fitspass( char_in, TRUE, char_out ) ); } else { PR_CHECK( fitspass( char_in, FALSE, char_out) ); } /* * now read the next two characters -- this time they * MUST be the magic code! */ PR_CHECK( char_in( tmagic, sizeof( tmagic ) ) ); } else { /* * set default format to raw if it is not specified */ if( ( *format )[0] == '\0' ) { *format = "raw"; } /* * if input format is not FITS but output format is FITS, set * a flag so we generate a FITS header once we know how big * the image must be. */ if ( strcmp( *format, "fits" ) == 0) { newfits = 1; } } /* * check for correct magic code value */ if ( memcmp( tmagic, code_magic, sizeof( code_magic ) ) != 0) { pr_format_message( PR_E_FORMAT ); return( PR_E_FORMAT ); } /* * Read the size of the image and the scale factor for digitization. */ PR_CHECK( read_int( char_in, nx ) ); PR_CHECK( read_int( char_in, ny ) ); PR_CHECK( read_int( char_in, scale ) ); /* * write the new fits header to outfile if needed */ if ( newfits ) { PR_CHECK( makefits( char_out, *nx, *ny, 16, "INTEGER*2" ) ); } /* * allocate memory for array */ nel = (*nx) * (*ny); PR_CHECK_NULL( *a = int_alloc( nel ) ); /* * Read the sum of all pixels */ PR_CHECK( read_int( char_in, &sumall ) ); /* * Read the number of bits in quadrants. */ PR_CHECK( char_in( nbitplanes, sizeof( nbitplanes ) ) ); PR_CHECK( dodecode( char_in, *a, *nx, *ny, nbitplanes ) ); /* * put sum of all pixels back into pixel 0 */ (*a)[0] = sumall; return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int dodecode( char_in, a, nx, ny, nbitplanes ) * * Purpose: * Decode stream of characters and return array * This version encodes the different quadrants separately * * Parameters: * int (*char_in)() : (in) Function to get the next data. * int a[] : (in) Array to be created. * int nx : (in) X axis dimension. * int ny : (in) Y axis dimension. * int nbitplanes : (in) Number of bitplanes in quadrants. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_BITPLANE: Bad bit plane. * int PR_E_CODE : Bad format code. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from function dodecode from the hcompress program. * Programmer: R. White Date: 9 May 1991 * ************************************************************************ -*/ static int dodecode ( pfi char_in, int a[], int nx, int ny, byte nbitplanes[3] ) { /* static int input_bit(); */ /* static int input_nbits(); */ /* static int qtree_decode(); */ /* static void start_inputing_bits(); */ byte bit; /* The value of a bit. */ int i; int nel; int nx2; int ny2; nel = nx*ny; nx2 = (nx+1)/2; ny2 = (ny+1)/2; /* * initialize a to zero */ for ( i = 0; i < nel; i++ ) { a[i] = 0; } /* * Initialize bit input */ start_inputing_bits(); /* * read bit planes for each quadrant */ PR_CHECK( qtree_decode( char_in, &a[0], ny, nx2, ny2, nbitplanes[0] ) ); PR_CHECK( qtree_decode( char_in, &a[ny2], ny, nx2, ny/2, nbitplanes[1] ) ); PR_CHECK( qtree_decode( char_in, &a[ny*nx2], ny, nx/2, ny2, nbitplanes[1] ) ); PR_CHECK( qtree_decode( char_in, &a[ny*nx2+ny2], ny, nx/2, ny/2, nbitplanes[2] ) ); /* * make sure there is an EOF symbol (nybble=0) at end */ if ( input_nybble( char_in ) != 0 ) { pr_format_message( PR_E_BITPLANE ); return( PR_E_BITPLANE ); } /* * now get the sign bits * Re-initialize bit input */ start_inputing_bits(); for ( i = 0; i < nel; i++) { if ( a[i] != 0 ) { PR_CHECK( bit = input_bit( char_in ) ); if ( bit != 0 ) { a[i] = -a[i]; } } } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int fitspass( char_in, passthru, char_out ) * * Purpose: * Skip over the fits header in the input, and optionaly copy it to * the output. * * Parameters: * int (*char_in)() : (in) Function to get data from the input. * boolean passthru : (in) True if the header should be written * to the output. * int (*char_out)() : (in) Function to write data to the output. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * int PR_E_EOI : End of input. * * References: * Copied from function dodecode from the hcompress program. * Programmer: R. White Date: 16 April 1992 * ************************************************************************ -*/ static int fitspass ( pfi char_in, boolean passthru, pfi char_out ) { char line[81]; int i; int j; /* * Note that the SIMPLE line has already been stripped off and * written to outfile for FITS files, so we start at i=1 */ for ( i = 1;; i++ ) { PR_CHECK( char_in( line, 80 ) ); if ( passthru ) { PR_CHECK( char_out( line, 80 ) ); } if ( strncmp(line, "END ", 4) == 0) { break; } } /* * write blank lines to make a multiple of 36 lines in header * number of lines written so far is i+1 */ if ( passthru ) { for ( j = 0; j < 80; j++ ) { line[j] = ' '; } line[80] = '\0'; for ( i = 35 - ( i % 36 ); i > 0; i-- ) { PR_CHECK( char_out( line, 80 ) ); } } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * int h_uncomp( char_in, char_out ) * * Purpose: * Uncompresses h compressed data. * * Parameters: * byte (*char_in)() : (in) Function to get data from input. * byte (*char_out)() : (in) Function to write data to output. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_FORMAT : Data format was incorrect. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * ************************************************************************ -*/ int h_uncomp ( pfi char_in, pfi char_out ) { /* static int decode(); */ int h_put_data(); void hinv(); /* void pr_format_message(); */ void undigitize(); int *a; /* Pointer to the image array. */ int nx; /* Size in x axis. */ int ny; /* Size in y axis. */ int scale; /* Scale factor of compression. */ int status; /* Function return status. */ PR_CHECK( decode( char_in, char_out, &a, &nx, &ny, &scale, &( local_press.lp_format ) ) ); undigitize( a, nx, ny, scale ); /* * Inverse H-tranform */ hinv( a, nx, ny, local_press.lp_smooth, scale ); /* * Write the data. */ status = h_put_data( char_out, a, nx, ny, local_press.lp_format ); free( a ); PR_CHECK( status ); if ( local_press.lp_verbose ) { pr_format_message( PR_HDECOMP_INFO, local_press.lp_smooth, nx, ny, scale, local_press.lp_format ); } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int input_bit( char_in ) * * Purpose: * input a bit. * * Parameters: * int (*char_in)() : (in) Gets data from input. * * Values Returned: * int value : if value > 0, the bit value. * int PR_E_IO : Error during io. * int PR_E_EOI : End of input. * ************************************************************************ -*/ static int input_bit ( pfi char_in ) { byte b; if ( bits_to_go == 0 ) { /* * Read the next byte if no */ PR_CHECK( char_in( &b, 1 ) ); buffer = b; bits_to_go = 8; } /* * Return the next bit */ bits_to_go -= 1; return ( ( buffer >> bits_to_go ) & 1 ); } /*+ ************************************************************************ * * Synopsis: * static int input_huffman( char_in ) * * Purpose: * Huffman decoding for fixed codes * * Coded values range from 0-15 * * Huffman code values ( hex ): * * 3e, 00, 01, 08, 02, 09, 1a, 1b, * 03, 1c, 0a, 1d, 0b, 1e, 3f, 0c * * and number of bits in each code: * * 6, 3, 3, 4, 3, 4, 5, 5, * 3, 5, 4, 5, 4, 5, 6, 4 * Statement of purpose. * * Parameters: * int (*char_in)() : (in) Function to read data from input. * * Values Returned: * int code : if value > 0. * int PR_E_IO : Error during io. * * References: * Copied from the hcompress function input_huffman. * Programmer: R. White Date: 7 May 1991 * ************************************************************************ -*/ static int input_huffman ( pfi char_in ) { /* static int input_bit(); */ int b; int c; /* * get first 3 bits to start */ PR_CHECK( c = input_nbits( char_in, 3 ) ); if ( c < 4 ) { /* * this is all we need return 1,2,4,8 for c=0,1,2,3 */ return ( 1 << c ); } /* * get the next bit */ PR_CHECK( b = input_bit( char_in ) ); c = b | ( c << 1 ); if ( c < 13 ) { /* * OK, 4 bits is enough */ switch ( c ) { case 8: return ( 3 ); case 9: return ( 5 ); case 10: return ( 10 ); case 11: return ( 12 ); case 12: return ( 15 ); } } /* * get yet another bit */ PR_CHECK( b = input_bit( char_in ) ); c = b | ( c << 1 ); if ( c < 31 ) { /* * OK, 5 bits is enough */ switch ( c ) { case 26: return ( 6 ); case 27: return ( 7 ); case 28: return ( 9 ); case 29: return ( 11 ); case 30: return ( 13 ); } } /* * need the 6th bit */ PR_CHECK( b = input_bit( char_in ) ); c = b | ( c << 1 ); if ( c == 62 ) { return ( 0 ); } else { return ( 14 ); } } /*+ ************************************************************************ * * Synopsis: * static int input_nbits( char_in, n ) * * Purpose: * Input n bits, n <= 8. * * Parameters: * int (*char_in)() : (in) Function to read data from input. * int n : (in) Number of bytes to read. * * Values Returned: * int value : if > 0, value of the bits * int PR_E_EOI : End of input detected. * int PR_E_IO : Error during io. * ************************************************************************ -*/ static int input_nbits ( pfi char_in, int n ) { byte c; if ( bits_to_go < n ) { /* * need another byte's worth of bits */ buffer <<= 8; PR_CHECK( char_in( &c, 1 ) ); buffer |= c; bits_to_go += 8; } /* * now pick off the first n bits */ bits_to_go -= n; return ( ( buffer >> bits_to_go ) & ( ( 1 << n ) - 1 ) ); } /*+ ************************************************************************ * * Synopsis: * static int makefits( char_out, nx, ny, bitpix, datatype ) * * Purpose: * Writes a simple fits header for a 2-d image. * example of header: * lines must be exactly 80 characters, with no newline at the end * 0123456789 123456789 123456789 123456789 SIMPLE = T /Standard FITS format BITPIX = 16 / NAXIS = 2 /Number of axes NAXIS1 = 256 / NAXIS2 = 256 / DATATYPE= 'INTEGER*2' / END * * Parameters: * type arg1 : (in) What it is * type arg2 : (mod) What it is * type argn : (out) What it is * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : IO error. * * References: * Copied from function makefits from the hcompress program. * Programmer: R. White Date: 24 April 1992 * ************************************************************************ -*/ static int makefits ( pfi char_out, int nx, int ny, int bitpix, char *datatype ) { char line[81]; int i; (void) sprintf( line, "%-80.80s", "SIMPLE = T /Standard FITS format" ); PR_CHECK( char_out( line, 80 ) ); (void) sprintf( line, "%10.10s%10d%-60.60s", "BITPIX =", bitpix, " /Bits per pixel." ); PR_CHECK( char_out( line, 80 ) ); (void) sprintf( line, "%-80.80s", "NAXIS = 2 /Number of axes"); PR_CHECK( char_out( line, 80 ) ); (void) sprintf( line, "%10.10s%10d%-60.60s", "NAXIS1 =", ny, " /" ); PR_CHECK( char_out( line, 80 ) ); (void) sprintf( line, "%10.10s%10d%-60.60s", "NAXIS2 =", nx, " /" ); PR_CHECK( char_out( line, 80 ) ); (void) sprintf( line, "%10.10s'%*.*s'%*s%48s", "DATATYPE=", (int)strlen( datatype), (int)strlen( datatype ), datatype, 22-(int)strlen( datatype), "/", "" ); PR_CHECK( char_out( line, 80 ) ); (void) sprintf( line, "%-80.80s", "END" ); PR_CHECK( char_out( line, 80 ) ); /* * pad with blank lines to get multiple of 36 (2880 bytes) */ for ( i = 0; i < 80; i++ ) { line[i] = ' '; } line[80] = '\0'; for ( i = 7; i < 36; i++) { PR_CHECK( char_out( line, 80 ) ); } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static void qtree_bitins( a, nx, ny, b, n, bit ) * * Purpose: * Copy 4-bit values from a[( nx+1 )/2,( ny+1 )/2] to b[nx,ny], expanding * each value to 2x2 pixels and inserting into bitplane BIT of B. * A,B may NOT be same array ( it wouldn't make sense to be inserting * bits into the same array anyway. ) * * Parameters: * byte a[] : (in) Input array. * int nx : (in) X dimension. * int ny : (in) Y dimension. * int b[] : (out) Output array. * int n : (in) Declare y dimension of b. * int bit : (in) * * Values Returned: * void * * References: * Copied from the hcompress function qtree_bitins. * Programmer: R. White Date: 7 May 1991 * ************************************************************************ -*/ static void qtree_bitins ( byte a[], int nx, int ny, int b[], int n, int bit ) { int i; int j; int *ptr_b00; int *ptr_b10; byte *ptr_k; int tmp; int mask; mask = 1 << bit; /* * expand each 2x2 block */ ptr_k = a; /* ptr_k is index of a[i/2,j/2] */ for ( i = 0; i < nx - 1; i += 2 ) { for ( ptr_b00 = b + n * i, ptr_b10 = ptr_b00 + n; ptr_b00 < b + n * i + ny - 1 ; ptr_b00 += 2, ptr_b10 += 2 ) { tmp = *ptr_k << bit; *( ptr_b10 + 1 ) |= tmp & mask; *ptr_b10 |= ( tmp >> 1 ) & mask; *( ptr_b00 + 1 ) |= ( tmp >> 2 ) & mask; *ptr_b00 |= ( tmp >> 3 ) & mask; ptr_k ++; } if ( ptr_b00 < b + n * i + ny ) /* if ( j < ny )*/ { /* * row size is odd, do last element in row s00+1, s10+1 are * off edge */ *ptr_b10 |= ( ( *ptr_k >> 1 ) & 1 ) << bit; *ptr_b00 |= ( ( *ptr_k >> 3 ) & 1 ) << bit; ptr_k ++; } } if ( i < nx ) { /* * column size is odd, do last row s10, s10+1 are off edge */ ptr_b00 = b + n * i; for ( j = 0; j < ny - 1; j += 2 ) { *( ptr_b00 + 1 ) |= ( ( *ptr_k >> 2 ) & 1 ) << bit; * ptr_b00 |= ( ( *ptr_k >> 3 ) & 1 ) << bit; ptr_b00 += 2; ptr_k ++; } if ( j < ny ) { /* * both row and column size are odd, do corner element * s00+1, s10, s10+1 are off edge */ *ptr_b00 |= ( ( *ptr_k >> 3 ) & 1 ) << bit; *ptr_k ++; } } } /*+ ************************************************************************ * * Synopsis: * static void qtree_copy( a, nx, ny, b, n ) * * Purpose: * copy 4-bit values from a[( nx+1 )/2,( ny+1 )/2] to b[nx,ny], expanding * each value to 2x2 pixels * a,b may be same array * * Parameters: * byte a[] : (in) Source array * int nx : (in) X dimension of destination. * int ny : (in) Y dimension of destination. * byte b[] : (out) Destination array. * int n : (in) Declared y dimension of b. * * Values Returned: * void * * References: * Copied from the hcompress function qtree_copy. * Programmer: R. White Date: 7 May 1991 * ************************************************************************ -*/ static void qtree_copy ( byte a[], int nx, int ny, byte b[], int n ) { int i; int j; int k; int nx2; int ny2; int s00; int s10; /* * first copy 4-bit values to b start at end in case a,b are same * array */ nx2 = ( nx + 1 ) / 2; ny2 = ( ny + 1 ) / 2; k = ny2 * ( nx2 - 1 ) + ny2 - 1; /* k is index of a[i,j] */ for ( i = nx2 - 1; i >= 0; i-- ) { s00 = 2 * ( n * i + ny2 - 1 ); /* s00 is index of b[2*i,2*j] */ for ( j = ny2 - 1; j >= 0; j-- ) { b[s00] = a[k]; k -= 1; s00 -= 2; } } /* * now expand each 2x2 block */ for ( i = 0; i < nx - 1; i += 2 ) { s00 = n * i; /* s00 is index of b[i,j] */ s10 = s00 + n; /* s10 is index of b[i+1,j] */ for ( j = 0; j < ny - 1; j += 2 ) { b[s10 + 1] = b[s00] & (byte) 1; b[s10] = ( b[s00] >> 1 ) & 1; b[s00 + 1] = ( b[s00] >> 2 ) & 1; b[s00] = ( b[s00] >> 3 ) & 1; s00 += 2; s10 += 2; } if ( j < ny ) { /* * row size is odd, do last element in row s00+1, s10+1 are * off edge */ b[s10] = ( b[s00] >> 1 ) & 1; b[s00] = ( b[s00] >> 3 ) & 1; } } if ( i < nx ) { /* * column size is odd, do last row s10, s10+1 are off edge */ s00 = n * i; for ( j = 0; j < ny - 1; j += 2 ) { b[s00 + 1] = ( b[s00] >> 2 ) & 1; b[s00] = ( b[s00] >> 3 ) & 1; s00 += 2; } if ( j < ny ) { /* * both row and column size are odd, do corner element * s00+1, s10, s10+1 are off edge */ b[s00] = ( b[s00] >> 3 ) & 1; } } } /*+ ************************************************************************ * * Synopsis: * static int qtree_decode( char_in, a, n, nqx, nqy, nbitplanes ) * * Purpose: * Read stream of codes from char_in and construct bit planes * in quadrant of 2-D array using binary quadtree coding * * Parameters: * int (*char_in)() : (in) Function to get the next byte. * int a[] : (out) Array to fill. * int n : (in) Declared y dimension of a. * int nqx : (in) Partial length of row to decode. * int nqy : (in) Partial length of column to decode. * int nbitplanes : (in) Number of bitplanes to decode. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_CODE : Bad format code. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from the hcompress function qtree_decode. * Programmer: R. White Date: 7 May 1991 * ************************************************************************ -*/ static int qtree_decode ( pfi char_in, int a[], int n, int nqx, int nqy, int nbitplanes ) { /* static int input_bit(); */ /* static int input_huffman(); */ /* static int input_nbits(); */ /* void pr_format_message(); */ /* static int qtree_expand(); */ /* static void qtree_bitins(); */ /* static int read_bdirect(); */ int log2n; int k; int bit; int b; int nqmax; int nx; int ny; int nfx; int nfy; int c; int nqx2; int nqy2; byte *scratch; /* * log2n is log2 of max(nqx,nqy) rounded up to next power of 2 */ nqmax = ( nqx > nqy ) ? nqx : nqy; log2n = log( (float) nqmax ) / log( 2.0 ) + 0.5; if ( nqmax > ( 1 << log2n ) ) { log2n += 1; } /* * allocate scratch array for working space */ nqx2 = ( nqx + 1 ) / 2; nqy2 = ( nqy + 1 ) / 2; PR_CHECK_NULL( scratch = byte_alloc( nqx2 * nqy2 ) ); /* * now decode each bit plane, starting at the top A is assumed to * be initialized to zero */ for ( bit = nbitplanes - 1; bit >= 0; bit-- ) { /* * Was bitplane was quadtree-coded or written directly? */ b = input_nybble( char_in ); if ( b == 0 ) { /* * bit map was written directly */ PR_CHECK( read_bdirect( char_in, a, n, nqx, nqy, scratch, bit ) ); } else if ( b != 0xf ) { pr_format_message( PR_E_CODE, b ); return ( PR_E_CODE ); } else { /* * bitmap was quadtree-coded, do log2n expansions * * read first code */ PR_CHECK( scratch[0] = input_huffman( char_in ) ); /* * now do log2n expansions, reading codes from file as * necessary */ nx = 1; ny = 1; nfx = nqx; nfy = nqy; c = 1 << log2n; for ( k = 1; k < log2n; k++ ) { /* * this somewhat cryptic code generates the sequence * n[k-1] = ( n[k]+1 )/2 where n[log2n]=nqx or nqy */ c = c >> 1; nx = nx << 1; ny = ny << 1; if ( nfx <= c ) { nx -= 1; } else { nfx -= c; } if ( nfy <= c ) { ny -= 1; } else { nfy -= c; } PR_CHECK( qtree_expand( char_in, scratch, nx, ny, scratch ) ); } /* * now copy last set of 4-bit codes to bitplane bit of * array a */ qtree_bitins( scratch, nqx, nqy, a, n, bit ); } } free( scratch ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int qtree_expand( char_in, a, nx, ny, b ) * * Purpose: * do one quadtree expansion step on array a[( nqx+1 )/2,( nqy+1 )/2] * results put into b[nqx,nqy] ( which may be the same as a ) * * Parameters: * int (*char_in)() : (in) Function to read data from input * byte a[] : (in) Array of data to expand. * int nx : (in) X dimension of a. * int ny : (in) Y dimension of a. * byte b[] : (out) Expanded data. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * * References: * Copied from the hcompress function qtree_expand. * Programmer: R. White Date: 7 May 1991 * ************************************************************************ -*/ static int qtree_expand ( pfi char_in, byte a[], int nx, int ny, byte b[] ) { /* static int input_huffman(); */ /* static void qtree_copy(); */ int i; /* * first copy a to b, expanding each 4-bit value */ qtree_copy( a, nx, ny, b, ny ); /* * now read new 4-bit values into b for each non-zero element */ for ( i = nx * ny - 1; i >= 0; i-- ) { if ( b[i] != 0 ) { PR_CHECK( b[i] = input_huffman( char_in ) ); } } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int read_bdirect( char_in, a, n, nqx, nqy, scratch, bit ) * * Purpose: * Reads an image packed 4 bits per byte. * * Parameters: * int (*char_in)() : (in) Function to read data. * int a[] : (out) * int n : (in) Declared y dimension of a. * int nqx : (in) X dimension of a. * int nqy : (in) Y dimension of a. * byte scratch[] : (in) * int bit : (in) * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * * References: * Copied from the hcompress function qtree_bdirect. * Programmer: R. White Date: 7 May 1991 * ************************************************************************ -*/ static int read_bdirect ( pfi char_in, int a[], int n, int nqx, int nqy, byte scratch[], int bit ) { /* static void qtree_bitins(); */ int i; /* * read bit image packed 4 pixels/nybble */ for ( i = 0; i < ( ( nqx + 1 ) / 2 ) * ( ( nqy + 1 ) / 2 ); i++ ) { PR_CHECK( scratch[i] = input_nybble( char_in ) ); } /* * insert in bitplane BIT of image A */ qtree_bitins( scratch, nqx, nqy, a, n, bit ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static void start_inputing_bits() * * Purpose: * Initialize bit input. * * Parameters: * void * * Values Returned: * void * ************************************************************************ -*/ static void start_inputing_bits ( void ) { /* * Buffer starts out with no bits in it */ bits_to_go = 0; } skycat-3.1.2-starlink-1b/astrotcl/press/h_press.c000066400000000000000000000775111215713201500217460ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: press/src/hpress.c * * Purpose: * Funciton to hcompress image data. * * Routines: * static int bufcopy : Copy non-zero code from array to * buffer. * static int doencode : Encode 2-D array and write stream * of characters to outfile. * static int done_outputing_bits: Flush out the last bits in the * bit buffer. * static int encode : Encode H-transform and write to * output. * static int fitsread : Reads fits header and optionally * passes it to the output. * static int get_data : Gets data from input. * static int get_fits : Gets fits data from input. * static int get_raw : Gets raw data from input. * int h_comp : Does hcompress. * static int output_nbits : Writes a specified number of bits to * the output. * static int qtree_encode : Encode the image using quadtree. * static void qtree_onebit : Do first quadtree reduction step. * static void qtree_reduce : Do one quadtree reduction step. * static void start_outputing_bits: Initializes the bit output * functions. * static int write_bdirect : * * Date : Mar 01, 1993 * * SCCS data : @(#) * Module Name : h_press.c * Version Number : 1.6 * Release Number : 1 * Last Updated : 07/04/97 * * Programmer : Norman Hill * * Modification History: * 97/07/02 SEC : Bring up to ANSI standard. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include #include #include #include #include #include "gen_types.h" #include "gen_msg.h" #include "press.h" #include "h_comp.h" #include "local_press.h" static int bitcount; static int bo_buffer; /* The bit buffer. */ static int bo_bits_to_go; static int qt_bitbuffer; /* Buffer for qtree_encode. */ static int qt_bits_to_go; /* * Huffman code values and number of bits in each code */ static int code[16] = { 0x3e, 0x00, 0x01, 0x08, 0x02, 0x09, 0x1a, 0x1b, 0x03, 0x1c, 0x0a, 0x1d, 0x0b, 0x1e, 0x3f, 0x0c }; static int ncode[16] = { 6, 3, 3, 4, 3, 4, 5, 5, 3, 5, 4, 5, 4, 5, 6, 4 }; #define output_nybble(char_out,c) output_nbits(char_out,c,4) #define output_huffman(char_out,c) output_nbits(char_out,code[c],ncode[c]) /* * Static function prototypes. */ static int bufcopy( byte[], int, byte[], int *, int ); static int doencode( pfi, int[], int, int, byte[3] ); static int done_outputing_bits( pfi ); static int encode( pfi, int[], int, int, int ); static int fitsread( pfi, pfi, int *, int *, int, int ); static int get_data( pfi, pfi, int **, int *, int *, char * ); static int get_fits( pfi, pfi, int **, int *, int * ); static int get_raw( pfi, int **, int, int, int ); static int output_nbits( pfi, int, int ); static int qtree_encode( pfi, int[], int, int, int, int ); static void qtree_onebit( int[], int, int, int, byte[], int ); static void qtree_reduce( byte[], int, int, int, byte[] ); static void start_outputing_bits( void ); static int write_bdirect( pfi, int[], int, int, int, byte[], int ); /* * allan: 17.12.97: replaced a non-portable #define with this routine */ int write_int(pfi char_out, int* i) { int n = htonl(*i); return char_out((byte *)&n, sizeof(int)); } /*+ ************************************************************************ * * Synopsis: * static int bufcopy( a, n, buffer, b, bmax ) * * Purpose: * copy non-zero codes from array to buffer * * Parameters: * byte a[] : (in) array to copy from. * int n : (in) size of array a. * byte buffer : (in) Output buffer. * int b : (out) Num. bytes in buffer. * int bmax : (in) Size of buffer. * * Values Returned: * int 1 : Buffer is full. * int 0 : Buffer is not full. * * References: * Copied from hcompress fitsread function. * Programmer: R. White Date: 15 May 1991 * ************************************************************************ -*/ static int bufcopy ( byte a[], int n, byte buffer[], int *b, int bmax ) { int i; for (i = 0; i < n; i++) { if (a[i] != 0) { /* * add Huffman code for a[i] to buffer */ qt_bitbuffer |= code[a[i]] << qt_bits_to_go; qt_bits_to_go += ncode[a[i]]; if (qt_bits_to_go >= 8) { buffer[*b] = qt_bitbuffer & 0xFF; *b += 1; /* * return warning code if we fill buffer */ if (*b >= bmax) return (1); qt_bitbuffer >>= 8; qt_bits_to_go -= 8; } } } return (0); } /*+ ************************************************************************ * * Synopsis: * static int doencode( char_out, a, nx, ny, nbitplanes ) * * Purpose: * Encode 2-D array and write stream of characters to outfile. * * Parameters: * int (*char_out)() : (in) Function to write data to output. * int a[] : (in) Image to encode. * int nx : (in) X dimension of the image. * int ny : (in) Y dimension of the image. * byte nbitplanes : (in) Number of bit planes in quadrants. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error durring io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from hcompress fitsread function. * Programmer: R. White Date: 24 April 1992 * ************************************************************************ -*/ static int doencode ( pfi char_out, int a[], int nx, int ny, byte nbitplanes[3] ) { /* static int qtree_encode(); */ /* static void start_outputing_bits(); */ /* static int done_outputing_bits(); */ /* static int output_nbits(); */ int nx2; int ny2; nx2 = (nx+1)/2; ny2 = (ny+1)/2; /* * Initialize bit output */ start_outputing_bits(); /* * write out the bit planes for each quadrant */ PR_CHECK( qtree_encode( char_out, &a[0], ny, nx2, ny2, nbitplanes[0] ) ); PR_CHECK( qtree_encode( char_out, &a[ny2], ny, nx2, ny/2, nbitplanes[1] ) ); PR_CHECK( qtree_encode( char_out, &a[ny*nx2], ny, nx/2, ny2, nbitplanes[1] ) ); PR_CHECK( qtree_encode( char_out, &a[ny*nx2+ny2], ny, nx/2, ny/2, nbitplanes[2] ) ); /* * Add zero as an EOF symbol */ PR_CHECK( output_nybble( char_out, 0 ) ); done_outputing_bits( char_out ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int done_outputing_bits( char_out ) * * Purpose: * Flush the last bits in the bit buffer. * * Parameters: * int (*char_out)() : (in) Function to write data to the output. * * Values Returned: * int PR_SUCCESS : Normal completion * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from hcompress done_outputing_bits function. * Programmer: R. White * ************************************************************************ -*/ static int done_outputing_bits ( pfi char_out ) { byte b; if ( bo_bits_to_go < 8 ) { b = bo_buffer< 0) { /* * positive element, put zero at end of buffer */ signbits[nsign] <<= 1; bits_to_go -= 1; } else if (a[i] < 0) { /* * negative element, shift in a one */ signbits[nsign] <<= 1; signbits[nsign] |= 1; bits_to_go -= 1; /* * replace a by absolute value */ a[i] = -a[i]; } if (bits_to_go == 0) { /* * filled up this byte, go to the next one */ bits_to_go = 8; nsign += 1; signbits[nsign] = 0; } } if (bits_to_go != 8) { /* * some bits in last element move bits in last byte to bottom * and increment nsign */ signbits[nsign] <<= bits_to_go; nsign += 1; } /* * calculate number of bit planes for 3 quadrants * * quadrant 0=bottom left, 1=bottom right or top left, 2=top right, */ for (q = 0; q < 3; q++) { vmax[q] = 0; } /* * get maximum absolute value in each quadrant */ nx2 = (nx + 1) / 2; ny2 = (ny + 1) / 2; j = 0; /* column counter */ k = 0; /* row counter */ for (i = 0; i < nel; i++) { q = (j >= ny2) + (k >= nx2); if (vmax[q] < a[i]) vmax[q] = a[i]; if (++j >= ny) { j = 0; k += 1; } } /* * now calculate number of bits for each quadrant */ for (q = 0; q < 3; q++) { nbitplanes[q] = log((float) (vmax[q] + 1)) / log(2.0) + 0.5; if ((vmax[q] + 1) > (1 << nbitplanes[q])) { nbitplanes[q] += 1; } } /* * write nbitplanes */ PR_CHECK( char_out( nbitplanes, sizeof( nbitplanes ) ) ); /* * write coded array */ PR_CHECK( doencode( char_out, a, nx, ny, nbitplanes ) ); /* * write sign bits */ if (nsign > 0) { PR_CHECK( char_out( signbits, nsign ) ); } if ( local_press.lp_verbose ) { /* * total number of bits written to file */ i = bitcount + 8 * (nsign + sizeof(code_magic) + sizeof(nbitplanes) + 4 * sizeof(int)); pr_format_message( PR_HCOMP_INFO, ( (float) i) / nel, 16.0 * nel / ( (float) i ) ); } free(signbits); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int fitsread( char_in, char_out, nx, ny, passthru, * padded ) * * Purpose: * Read FITS header from char_in and optionally pass it to char_out. * nx and ny are found in the header. * * Parameters: * int (*char_in)() : (in) Function to get data from input. * int (*char_out)() : (in) Function to write data to the output. * int *nx : (out) X dimension of the image. * int *ny : (out) Y dimension of the image. * int passthru : (in) Non-zero if copy header to char_out. * int padded : (in) Non-zero if header is padded to 2880. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_FITS : Fits header read error. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from hcompress fitsread function. * Programmer: R. White Date: 16 April 1992 * ************************************************************************ -*/ static int fitsread ( pfi char_in, pfi char_out, int *nx, int *ny, int passthru, int padded ) { /* void pr_format_message(); */ int i; int j; char line[82]; int naxis1; int naxis2; int nline; int noend; int status; /* Function return status. */ int val; /* * make sure we find NAXIS1 and NAXIS2 */ naxis1 = 0; naxis2 = 0; noend = 1; nline = 81; while (noend) { /* * continue looping until we've read END statement or until * we've read a multiple of 36 lines past END (if padded != 0) */ for (i = 0; (i < 36) && (noend || padded); i++) { if ( ( status = char_in( line, nline-1 ) ) == PR_E_EOI ) { pr_format_message( PR_E_FITS_INC ); return( PR_E_FITS ); } PR_CHECK( status ); line[80] = '\0'; /* Replace line of nulls with line of blanks. */ if (strlen(line) != 80) { for (j = strlen(line); j < 80; j++) line[j] = ' '; } /* * copy to outfile if passthru != 0 and we have not reached * END */ if ( passthru && noend ) { PR_CHECK( char_out( line, 80 ) ); } if (strncmp(line, "END ", 4) == 0) { noend = 0; } else if (strncmp(line, "NAXIS1 =", 9) == 0) { if (sscanf(&line[10], " %d", &naxis1) != 1) { pr_format_message( PR_E_FITS, line ); return( PR_E_FITS ); } } else if (strncmp(line, "NAXIS2 =", 9) == 0) { if (sscanf(&line[10], " %d", &naxis2) != 1) { pr_format_message( PR_E_FITS, line ); return( PR_E_FITS ); } } else if (strncmp(line, "NAXIS =", 9) == 0) { if (sscanf(&line[10], " %d", &val) != 1) { pr_format_message( PR_E_FITS, line ); return( PR_E_FITS ); } if (val != 2) { pr_format_message( PR_E_FITS_DIM ); return( PR_E_FITS ); } } else if (strncmp(line, "DATATYPE=", 9) == 0) { if (strncmp(&line[11], "INTEGER*2", 9) != 0) { pr_format_message( PR_E_FITS_TYPE, "INTEGER*2" ); return( PR_E_FITS ); } } else if (strncmp(line, "PSIZE =", 9) == 0) { /* * check PSIZE == 0 */ if (sscanf(&line[10], " %d", &val) != 1) { pr_format_message( PR_E_FITS, line ); return( PR_E_FITS ); } if (val != 0) { pr_format_message( PR_E_FITS_GRP ); return( PR_E_FITS ); } } else if (strncmp(line, "GCOUNT =", 9) == 0) { /* * check for GCOUNT > 1 */ if (sscanf(&line[10], " %d", &val) != 1) { pr_format_message( PR_E_FITS, line ); return( PR_E_FITS ); } if (val > 1) { pr_format_message( PR_E_FITS_GRP ); return( PR_E_FITS ); } } } } if (naxis1 <= 0 || naxis2 <= 0) { pr_format_message( PR_E_NAXIS ); return( PR_E_FITS ); } *ny = naxis1; *nx = naxis2; return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int get_data( char_in, char_out, a, nx, ny, format ) * * Purpose: * Reads data from the input into an array. * * Parameters: * int (*char_in)() : (in) Function to read data from input. * int (*char_out)() : (in) Function to write data to output. * int **a : (out) Image array. * int *nx : (out) X dimension of the image. * int *ny : (out) X dimension of the image. * char *format : (in) Format of input file. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_EOI : Unexpected end of input. * int PR_E_FITS : Fits header read error. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from hcompress get_data function. * Programmer: R. White Date: 17 April 1992 * ************************************************************************ -*/ static int get_data ( pfi char_in, pfi char_out, int **a, int *nx, int *ny, char *format ) { /* int get_raw(); */ /* int get_fits(); */ /* void pr_format_message(); */ if (strcmp(format, "raw") == 0) { PR_CHECK( get_raw(char_in, a, *nx, *ny, 0) ); } else if (strcmp(format, "net") == 0) { PR_CHECK( get_raw(char_in, a, *nx, *ny, 1) ); } else if (strcmp(format, "fits") == 0) { PR_CHECK( get_fits(char_in, char_out, a, nx, ny) ); } else { pr_format_message( PR_E_FORMAT ); return( PR_E_FORMAT ); } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int get_fits( char_in, char_out, a, nx, ny ) * * Purpose: * Reads a fits file into a buffer. * * Parameters: * int (*char_in)() : (in) Function to read data from input. * int (*char_out)() : (in) Function to write data to output. * int **a : (out) Pointer to allocated image array. * int *nx : (out) X dimension of image. * int *ny : (out) Y dimension of image. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_EOI : Unexpected end of input. * int PR_E_FITS : Fits header read error. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from hcompress get_fits function. * Programmer: R. White Date: 17 April 1992 * ************************************************************************ -*/ static int get_fits ( pfi char_in, pfi char_out, int **a, int *nx, int *ny ) { /* int fitsread(); */ /* int get_raw(); */ /* * 1: pass lines through to outfile 1: header is multiple of * 2880 bytes 0: lines are not terminated by newline */ PR_CHECK( fitsread( char_in, char_out, nx, ny, 1, 1 ) ); /* * read raw pixel data with byte swapping */ PR_CHECK( get_raw( char_in, a, *nx, *ny, 1 ) ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int get_raw( char_in, a, nx, ny, swap ) * * Purpose: * Reads raw data from the input. * * Parameters: * int (*char_in)() : (in) Function to read data from input. * int (*char_out)() : (in) Function to write data to output. * int **a : (out) Image array. * int nx : (in) X dimension of the image. * int ny : (in) X dimension of the image. * int swap : (in) Should bytes be swapped? * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_EOI : Unexpected end of input. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from hcompress get_raw function. * Programmer: R. White Date: 17 April 1992 * ************************************************************************ -*/ static int get_raw ( pfi char_in, int **a, int nx, int ny, int swap ) { boolean test_swap(); void h_swap_bytes(); /* void pr_format_message(); */ int i; int j; int k; short *sa; int tswap; PR_CHECK_NULL( *a = (int *) malloc(nx * ny * sizeof(int)) ); /* * read a row at a time to minimize page faulting problems */ PR_CHECK_NULL( sa = (short *) malloc(ny * sizeof(short)) ); /* * see if byte swapping will be needed */ if (swap) { tswap = test_swap(); } else { tswap = 0; } /* * read rows */ for (i = 0; i < nx; i++) { if ( char_in( sa, ny * sizeof( short ) ) != ny * sizeof( short ) ) { pr_format_message( PR_E_EOI ); return( PR_E_EOI ); } /* * swap if necessary */ if (tswap) { h_swap_bytes(sa, ny * sizeof(short)); } /* * copy to array A, converting to int */ k = i * ny; for (j = 0; j < ny; j++) { (*a)[k++] = sa[j]; } } free(sa); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * int h_comp( char_in, char_out ) * * Purpose: * Executes the hcomp program. * * Parameters: * int (*char_in)() : (in) Function to get the next character * from the input. * int (*char_out)() : (in) Function to get the next character * from the output. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * ************************************************************************ -*/ int h_comp ( pfi char_in, pfi char_out ) { void digitize(); /* int encode(); */ /* int get_data(); */ void htrans(); /* void pr_format_message(); */ int *a; /* Image array. */ int nx; /* X dimension of image. */ int ny; /* Y dimension of image. */ nx = local_press.lp_nx; ny = local_press.lp_ny; /* * Read the data. */ PR_CHECK( get_data( char_in, char_out, &a, &nx, &ny, local_press.lp_format ) ); /* * H-transform the data. */ htrans( a, nx, ny ); /* * Digitize the data. */ digitize( a, nx, ny, local_press.lp_scale ); /* * Encode and write to stdout. */ PR_CHECK( encode( char_out, a, nx, ny, local_press.lp_scale ) ); free( a ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int output_nbites( char_out, bits, n ) * * Purpose: * Writes n bits to the output. * * Parameters: * int (*char_out)() : (in) Function to write bytes to output. * int bits : (in) Int containing bits to write. * int n : (in) Number of bits to write. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error durring io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from hcompress output_nbites function. * Programmer: R. White * ************************************************************************ -*/ static int output_nbits ( pfi char_out, int bits, int n ) { byte b; /* * Insert bits at the end of the buffer. */ bo_buffer <<= n; bo_buffer |= ( bits & ( ( 1 << n ) - 1 ) ); bo_bits_to_go -= n; if ( bo_bits_to_go <= 0 ) { /* * The buffer is full, write the top 8 bits. */ b = (bo_buffer >> (-bo_bits_to_go)) & 0xff; PR_CHECK( char_out( &b, 1 ) ); bo_bits_to_go += 8; } bitcount += n; return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int qtree_encode( char_out, a, n, nqx, nqy, nbitplanes ) * * Purpose: * Encode values in quadrant of 2-D array using binary quadtree coding * for each bit plane. Assumes array is positive. * * Parameters: * int (*char_out)() : (in) Function to write data to output. * int a[] : (in) Array to output. * int n : (in) Plysical dimension of rows in a. * int nqx : (in) Length of row. * int nqy : (in) Length of column. * int nbitplanes : (in) Number of bit planes to output. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from hcompress get_raw function. * Programmer: R. White Date: 15 May 1991 * ************************************************************************ -*/ static int qtree_encode ( pfi char_out, int a[], int n, int nqx, int nqy, int nbitplanes ) { /* static int bufcopy(); */ /* static int output_nbits(); */ /* void pr_format_message(); */ /* static void qtree_onebit(); */ /* static void qtree_reduce(); */ /* static int write_bdirect(); */ int log2n; int i; int k; int bit; int b; int bmax; int nqmax; int nqx2; int nqy2; int nx; int ny; byte *scratch; byte *buffer; /* * log2n is log2 of max(nqx,nqy) rounded up to next power of 2 */ nqmax = (nqx > nqy) ? nqx : nqy; log2n = log((float) nqmax) / log(2.0) + 0.5; if (nqmax > (1 << log2n)) { log2n += 1; } /* * initialize buffer point, max buffer size */ nqx2 = (nqx + 1) / 2; nqy2 = (nqy + 1) / 2; bmax = (nqx2 * nqy2 + 1) / 2; /* * We're indexing A as a 2-D array with dimensions (nqx,nqy). * Scratch is 2-D with dimensions (nqx/2,nqy/2) rounded up. Buffer * is used to store string of codes for output. */ PR_CHECK_NULL( scratch = (byte *) malloc(2 * bmax) ); PR_CHECK_NULL( buffer = (byte *) malloc(bmax) ); /* * now encode each bit plane, starting with the top */ for (bit = nbitplanes - 1; bit >= 0; bit--) { /* * initial bit buffer */ b = 0; qt_bitbuffer = 0; qt_bits_to_go = 0; /* * on first pass copy A to scratch array */ qtree_onebit(a, n, nqx, nqy, scratch, bit); nx = (nqx + 1) >> 1; ny = (nqy + 1) >> 1; /* * copy non-zero values to output buffer, which will be written * in reverse order */ if (bufcopy(scratch, nx * ny, buffer, &b, bmax)) { /* * quadtree is expanding data, change warning code and just * fill buffer with bit-map */ PR_CHECK( write_bdirect( char_out, a, n, nqx, nqy, scratch, bit ) ); goto bitplane_done; } /* * do log2n reductions */ for (k = 1; k < log2n; k++) { qtree_reduce(scratch, ny, nx, ny, scratch); nx = (nx + 1) >> 1; ny = (ny + 1) >> 1; if (bufcopy(scratch, nx * ny, buffer, &b, bmax)) { PR_CHECK( write_bdirect( char_out, a, n, nqx, nqy, scratch, bit ) ); goto bitplane_done; } } /* * OK, we've got the code in buffer Write quadtree warning * code, then write buffer in reverse order */ PR_CHECK( output_nybble(char_out, 0xF) ); if (b == 0) { if (qt_bits_to_go > 0) { /* * put out the last few bits */ PR_CHECK( output_nbits( char_out, qt_bitbuffer & ((1 << qt_bits_to_go) - 1), qt_bits_to_go) ); } else { /* * have to write a zero nybble if there are no 1's in * array */ PR_CHECK( output_huffman(char_out, 0) ); } } else { if (qt_bits_to_go > 0) { /* * put out the last few bits */ PR_CHECK( output_nbits(char_out, qt_bitbuffer & ((1 << qt_bits_to_go) - 1), qt_bits_to_go ) ); } for (i = b - 1; i >= 0; i--) { PR_CHECK( output_nbits( char_out, buffer[i], 8 ) ); } } bitplane_done:; } free(buffer); free(scratch); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static void qtree_onebit( a, n, nx, ny, b, bit ) * * Purpose: * Do first quadtree reduction step on bit BIT of array A. * Results put into b. * * Parameters: * int a[] : * int n : * int nx : * int ny : * byte b : * int bit : * * Values Returned: * void * * References: * Copied from hcompress write_bdirect function. * Programmer: R. White Date: 15 May 1991 * ************************************************************************ -*/ static void qtree_onebit ( int a[], int n, int nx, int ny, byte b[], int bit ) { int i; int j; int k; int b0; int b1; int b2; int b3; int s10; int s00; /* * use selected bit to get amount to shift */ b0 = 1 << bit; b1 = b0 << 1; b2 = b0 << 2; b3 = b0 << 3; k = 0; /* k is index of b[i/2,j/2] */ for (i = 0; i < nx - 1; i += 2) { s00 = n * i; /* s00 is index of a[i,j] */ s10 = s00 + n; /* s10 is index of a[i+1,j] */ for (j = 0; j < ny - 1; j += 2) { b[k] = ((a[s10 + 1] & b0) | ((a[s10] << 1) & b1) | ((a[s00 + 1] << 2) & b2) | ((a[s00] << 3) & b3)) >> bit; k += 1; s00 += 2; s10 += 2; } if (j < ny) { /* * row size is odd, do last element in row s00+1,s10+1 are * off edge */ b[k] = (((a[s10] << 1) & b1) | ((a[s00] << 3) & b3)) >> bit; k += 1; } } if (i < nx) { /* * column size is odd, do last row s10,s10+1 are off edge */ s00 = n * i; for (j = 0; j < ny - 1; j += 2) { b[k] = (((a[s00 + 1] << 2) & b2) | ((a[s00] << 3) & b3)) >> bit; k += 1; s00 += 2; } if (j < ny) { /* * both row and column size are odd, do corner element * s00+1, s10, s10+1 are off edge */ b[k] = (((a[s00] << 3) & b3)) >> bit; k += 1; } } } /*+ ************************************************************************ * * Synopsis: * static void qtree_reduce( a, n, nx, ny, b ) * * Purpose: * Do one quadtree reduction step on array a results put into b * (which may be the same as a) * * Parameters: * byte a[] : * int n : * int nx : * int ny : * * Values Returned: * void * * References: * Copied from hcompress write_bdirect function. * Programmer: R. White Date: 15 May 1991 * ************************************************************************ -*/ static void qtree_reduce ( byte a[], int n, int nx, int ny, byte b[] ) { int i; int j; int k; int s10; int s00; k = 0; /* k is index of b[i/2,j/2] */ for (i = 0; i < nx - 1; i += 2) { s00 = n * i; /* s00 is index of a[i,j] */ s10 = s00 + n; /* s10 is index of a[i+1,j] */ for (j = 0; j < ny - 1; j += 2) { b[k] = (a[s10 + 1] != 0) | ((a[s10] != 0) << 1) | ((a[s00 + 1] != 0) << 2) | ((a[s00] != 0) << 3); k += 1; s00 += 2; s10 += 2; } if (j < ny) { /* * row size is odd, do last element in row s00+1,s10+1 are * off edge */ b[k] = ((a[s10] != 0) << 1) | ((a[s00] != 0) << 3); k += 1; } } if (i < nx) { /* * column size is odd, do last row s10,s10+1 are off edge */ s00 = n * i; for (j = 0; j < ny - 1; j += 2) { b[k] = ((a[s00 + 1] != 0) << 2) | ((a[s00] != 0) << 3); k += 1; s00 += 2; } if (j < ny) { /* * both row and column size are odd, do corner element * s00+1, s10, s10+1 are off edge */ b[k] = ((a[s00] != 0) << 3); k += 1; } } } /*+ ************************************************************************ * * Synopsis: * static void start_outputing_bits() * * Purpose: * Initializes the bit output functions. * * Parameters: * void * * Values Returned: * void * * References: * Copied from hcompress start_outputing_bits function. * Programmer: R. White * ************************************************************************ -*/ static void start_outputing_bits ( void ) { bo_buffer = 0; bo_bits_to_go = 8; bitcount = 0; } /*+ ************************************************************************ * * Synopsis: * static int write_bdirect( char_out, a, n, nqx, nqy, scratch, bit ) * * Purpose: * * Parameters: * int (*char_out)() : (in) Function to output data. * int a[] : (in) * int n : (in) * int nqx : (in) * int nqy : (in) * byte scratch : (in) * int bit : (in) * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from hcompress write_bdirect function. * Programmer: R. White Date: 15 May 1991 * ************************************************************************ -*/ static int write_bdirect ( pfi char_out, int a[], int n, int nqx, int nqy, byte scratch[], int bit ) { int i; /* * Write the direct bitmap warning code */ PR_CHECK( output_nybble( char_out, 0x0 ) ); /* * Copy A to scratch array (again!), packing 4 bits/nybble */ qtree_onebit(a, n, nqx, nqy, scratch, bit); /* * write to outfile */ for (i = 0; i < ((nqx + 1) / 2) * ((nqy + 1) / 2); i++) { PR_CHECK( output_nybble( char_out, scratch[i] ) ); } return( PR_SUCCESS ); } skycat-3.1.2-starlink-1b/astrotcl/press/hcomp.c000066400000000000000000000160451215713201500214040ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: press/src/hcomp.c * * Purpose: * Contains the hcompress routines shared by both hcompress and * hdecompress. * * Routines: * int h_put_data : Writes data to output. * static int put_raw : Writes raw data to output. * static int put_fits : Writes fits data to output. * void h_swap_bytes : Swaps bytes in an array. * boolean test_swap : Check to see if swaping is necessary. * * Date : Mar 15, 1993 * * SCCS data : @(#) * Module Name : hcomp.c * Version Number : 1.7 * Release Number : 1 * Last Updated : 03/20/98 * * Programmer : Norman Hill * * Modification History: * 97/07/02 SEC : Bring up to ANSI standard. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include "gen_types.h" #include "gen_str.h" #include "press.h" #include "local_press.h" #include "h_comp.h" /* * Static function prototypes. */ static int put_raw( pfi, int[], int, int, boolean ); static int put_fits( pfi, int[], int, int ); /*+ ************************************************************************ * * Synopsis: * int h_put_data( char_out, a, nx, ny, format ) * * Purpose: * Write the data image swaping bytes if required. * * Parameters: * int (*char_out)() : (in) Function to write characters. * int a[] : (in) Data array to write. * int nx : (in) X dimension of the array. * int ny : (in) Y dimension of the array. * char *format : (in) Output format to use. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_FORMAT : Output format is unknown. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from the hcompress put_data routine. * Programmer: R. White Date: 17 April 1992 * ************************************************************************ -*/ int h_put_data ( pfi char_out, int a[], int nx, int ny, char *format ) { /* void pr_format_message(); */ /* static int put_raw(); */ /* static int put_fits(); */ if ( streq( format, "raw" ) || streq( format, "hhh" ) ) { PR_CHECK( put_raw( char_out, a, nx, ny, FALSE ) ); } else if ( streq( format, "net") ) { PR_CHECK( put_raw( char_out, a, nx, ny, TRUE ) ); } else if (streq( format, "fits" ) ) { PR_CHECK( put_fits( char_out, a, nx, ny ) ); } else { pr_format_message( PR_E_FORMAT ); return( PR_E_FORMAT ); } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int put_raw( char_out, a, nx, ny, swap ) * * Purpose: * Statement of purpose. * * Parameters: * int (*char_out)() : (in) Function to write bytes. * int a[] : (in) Array to write. * int nx : (in) Size of x axis. * int ny : (in) Size of y axis. * boolean swap : (in) If true, bytes will be swaped if * necesary. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from the hcompress put_raw routine. * Programmer: R. White Date: 17 April 1992 * ************************************************************************ -*/ static int put_raw ( pfi char_out, int a[], int nx, int ny, boolean swap ) { void h_swap_bytes(); boolean test_swap(); int i; int j; int k; short *sa; /* Working array for swaped data. */ boolean tswap; /* is byte swaping required? */ int v; /* * see if byte-swapping will be needed */ if (swap) { tswap = test_swap(); } else { tswap = 0; } /* * write a row at a time to minimize page faulting problems */ PR_CHECK_NULL( sa = short_alloc( ny ) ); for ( i = 0; i < nx ; i++ ) { k = i * ny; for ( j = 0; j < ny; j++) { /* * force value into 16-bit integer range */ v = a[k++]; if (v < -32768) { sa[j] = -32768; } else if (v > 32767) { sa[j] = 32767; } else { sa[j] = v; } } if ( tswap ) { h_swap_bytes( sa, ny * sizeof( short ) ); } PR_CHECK( char_out( sa, ny * sizeof( short ) ) ); } gen_free(sa); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int PUT_FITS( char_out, a, nx, ny ) * * Purpose: * Writes fits data to the output. * * Parameters: * int (*char_out)() : (in) Function to write data. * int a[] : (in) Array to be written. * int nx : (in) X dimension. * int ny : (in) Y dimension. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocation failure. * * References: * Copied from the hcompress put_fits routine. * Programmer: R. White Date: 17 April 1992 * ************************************************************************ -*/ static int put_fits ( pfi char_out, int a[], int nx, int ny ) { void pr_foramt_message(); int n; short *sa; int status; /* * write data with swapping */ PR_CHECK( put_raw( char_out, a, nx, ny, TRUE) ); /* * add zeroes to get up to multiple of 2880 bytes * number of padding short ints to write is between 0 and 1439 */ n = 1439 - ( ( nx * ny - 1 ) % 1440 ); status = PR_SUCCESS; if ( n > 0 ) { /* * allocate a block of zeros */ PR_CHECK_NULL( sa = (short *) calloc( n , sizeof( short ) ) ); status = char_out( sa, n * sizeof( short ) ); gen_free( sa ); } return( status ); } /*+ ************************************************************************ * * Synopsis: * void h_swap_bytes( a, n ) * * Purpose: * Swaps the bytes in a. * * Parameters: * byte a[] : (in) An array of bytes to swap. * int n : (in) The size of the array. * * Values Returned: * void * * References: * Copied from the hcompress h_swap_bytes routine. * Programmer: R. White Date: 17 April 1992 * ************************************************************************ -*/ void h_swap_bytes ( byte a[], int n ) { int i; byte tmp; for (i = 0; i < n - 1; i += 2) { tmp = a[i]; a[i] = a[i+1]; a[i+1] = tmp; } } /*+ ************************************************************************ * * Synopsis: * boolean test_swap() * * Purpose: * Test to see if byte swapping is necessary on this machine. * * Parameters: * void * * Values Returned: * boolean TRUE : Byte swapping is necesary. * boolean FALSE : Byte swapping is not necessary. * * References: * Copied from the hcompress test_swap routine. * Programmer: R. White Date: 17 April 1992 * ************************************************************************ -*/ boolean test_swap ( void ) { union { short s; char c[2]; } u; u.c[0] = 0; u.c[1] = 1; return (u.s != 1); } skycat-3.1.2-starlink-1b/astrotcl/press/hinv.c000066400000000000000000000135331215713201500212410ustar00rootroot00000000000000/* Copyright (c) 1993 Association of Universities for Research * in Astronomy. All rights reserved. Produced under National * Aeronautics and Space Administration Contract No. NAS5-26555. */ /* hinv.c Inverse H-transform of NX x NY integer image * * Programmer: R. White Date: 23 July 1993 */ #include #include #include static void unshuffle(); extern void hsmooth(); extern void hinv(a,nx,ny,smooth,scale) int a[]; int nx,ny; int smooth; /* 0 for no smoothing, else smooth during inversion */ int scale; /* used if smoothing is specified */ { int nmax, log2n, i, j, k; int nxtop,nytop,nxf,nyf,c; int oddx,oddy; int shift, bit0, bit1, bit2, mask0, mask1, mask2, prnd0, prnd1, prnd2, nrnd0, nrnd1, nrnd2, lowbit0, lowbit1; int h0, hx, hy, hc; int s10, s00; int *tmp; /* * log2n is log2 of max(nx,ny) rounded up to next power of 2 */ nmax = (nx>ny) ? nx : ny; log2n = log((float) nmax)/log(2.0)+0.5; if ( nmax > (1<> 1; prnd1 = bit1 >> 1; prnd2 = bit2 >> 1; nrnd0 = prnd0 - 1; nrnd1 = prnd1 - 1; nrnd2 = prnd2 - 1; /* * round h0 to multiple of bit2 */ a[0] = (a[0] + ((a[0] >= 0) ? prnd2 : nrnd2)) & mask2; /* * do log2n expansions * * We're indexing a as a 2-D array with dimensions (nx,ny). */ nxtop = 1; nytop = 1; nxf = nx; nyf = ny; c = 1<=0; k--) { /* * this somewhat cryptic code generates the sequence * ntop[k-1] = (ntop[k]+1)/2, where ntop[log2n] = n */ c = c>>1; nxtop = nxtop<<1; nytop = nytop<<1; if (nxf <= c) { nxtop -= 1; } else { nxf -= c; } if (nyf <= c) { nytop -= 1; } else { nyf -= c; } /* * double shift and fix nrnd0 (because prnd0=0) on last pass */ if (k == 0) { nrnd0 = 0; shift = 2; } /* * unshuffle in each dimension to interleave coefficients */ for (i = 0; i= 0) ? prnd1 : nrnd1)) & mask1; hy = (hy + ((hy >= 0) ? prnd1 : nrnd1)) & mask1; hc = (hc + ((hc >= 0) ? prnd0 : nrnd0)) & mask0; /* * propagate bit0 of hc to hx,hy */ lowbit0 = hc & bit0; hx = (hx >= 0) ? (hx - lowbit0) : (hx + lowbit0); hy = (hy >= 0) ? (hy - lowbit0) : (hy + lowbit0); /* * Propagate bits 0 and 1 of hc,hx,hy to h0. * This could be simplified if we assume h0>0, but then * the inversion would not be lossless for images with * negative pixels. */ lowbit1 = (hc ^ hx ^ hy) & bit1; h0 = (h0 >= 0) ? (h0 + lowbit0 - lowbit1) : (h0 + ((lowbit0 == 0) ? lowbit1 : (lowbit0-lowbit1))); /* * Divide sums by 2 (4 last time) */ a[s10+1] = (h0 + hx + hy + hc) >> shift; a[s10 ] = (h0 + hx - hy - hc) >> shift; a[s00+1] = (h0 - hx + hy - hc) >> shift; a[s00 ] = (h0 - hx - hy + hc) >> shift; s00 += 2; s10 += 2; } if (oddy) { /* * do last element in row if row length is odd * s00+1, s10+1 are off edge */ h0 = a[s00 ]; hx = a[s10 ]; hx = ((hx >= 0) ? (hx+prnd1) : (hx+nrnd1)) & mask1; lowbit1 = hx & bit1; h0 = (h0 >= 0) ? (h0 - lowbit1) : (h0 + lowbit1); a[s10 ] = (h0 + hx) >> shift; a[s00 ] = (h0 - hx) >> shift; } } if (oddx) { /* * do last row if column length is odd * s10, s10+1 are off edge */ s00 = ny*i; for (j = 0; j= 0) ? (hy+prnd1) : (hy+nrnd1)) & mask1; lowbit1 = hy & bit1; h0 = (h0 >= 0) ? (h0 - lowbit1) : (h0 + lowbit1); a[s00+1] = (h0 + hy) >> shift; a[s00 ] = (h0 - hy) >> shift; s00 += 2; } if (oddy) { /* * do corner element if both row and column lengths are odd * s00+1, s10, s10+1 are off edge */ h0 = a[s00 ]; a[s00 ] = h0 >> shift; } } /* * divide all the masks and rounding values by 2 */ bit2 = bit1; bit1 = bit0; bit0 = bit0 >> 1; mask1 = mask0; mask0 = mask0 >> 1; prnd1 = prnd0; prnd0 = prnd0 >> 1; nrnd1 = nrnd0; nrnd0 = prnd0 - 1; } free(tmp); } static void unshuffle(a,n,n2,tmp) int a[]; /* array to shuffle */ int n; /* number of elements to shuffle */ int n2; /* second dimension */ int tmp[]; /* scratch storage */ { int i; int nhalf; int *p1, *p2, *pt; /* * copy 2nd half of array to tmp */ nhalf = (n+1)>>1; pt = tmp; p1 = &a[n2*nhalf]; /* pointer to a[i] */ for (i=nhalf; i= 0; i--) { *p1 = *p2; p2 -= n2; p1 -= (n2+n2); } /* * now distribute 2nd half of array (in tmp) to odd elements */ pt = tmp; p1 = &a[n2]; /* pointer to a[i] */ for (i=1; i #include #define min(a,b) (((a)<(b)) ? (a) : (b)) #define max(a,b) (((a)>(b)) ? (a) : (b)) extern void hsmooth(a,nxtop,nytop,ny,scale) int a[]; /* array of H-transform coefficients */ int nxtop,nytop; /* size of coefficient block to use */ int ny; /* actual 1st dimension of array */ int scale; /* truncation scale factor that was used */ { int i, j; int ny2, s10, s00, diff, dmax, dmin, s, smax; int hm, h0, hp, hmm, hpm, hmp, hpp, hx2, hy2; int m1,m2; /* * Maximum change in coefficients is determined by scale factor. * Since we rounded during division (see digitize.c), the biggest * permitted change is scale/2. */ smax = (scale >> 1); if (smax <= 0) return; ny2 = ny << 1; /* * We're indexing a as a 2-D array with dimensions (nxtop,ny) of which * only (nxtop,nytop) are used. The coefficients on the edge of the * array are not adjusted (which is why the loops below start at 2 * instead of 0 and end at nxtop-2 instead of nxtop.) */ /* * Adjust x difference hx */ for (i = 2; i=0, dmin<=0. */ if (dmin < dmax) { diff = max( min(diff, dmax), dmin); /* * Compute change in slope limited to range +/- smax. * Careful with rounding negative numbers when using * shift for divide by 8. */ s = diff-(a[s10]<<3); s = (s>=0) ? (s>>3) : ((s+7)>>3) ; s = max( min(s, smax), -smax); a[s10] = a[s10]+s; } s00 += 2; s10 += 2; } } /* * Adjust y difference hy */ for (i = 0; i=0) ? (s>>3) : ((s+7)>>3) ; s = max( min(s, smax), -smax); a[s00+1] = a[s00+1]+s; } s00 += 2; s10 += 2; } } /* * Adjust curvature difference hc */ for (i = 2; i=0, dmin<=0. */ if (dmin < dmax) { diff = max( min(diff, dmax), dmin); /* * Compute change in slope limited to range +/- smax. * Careful with rounding negative numbers when using * shift for divide by 64. */ s = diff-(a[s10+1]<<6); s = (s>=0) ? (s>>6) : ((s+63)>>6) ; s = max( min(s, smax), -smax); a[s10+1] = a[s10+1]+s; } s00 += 2; s10 += 2; } } } skycat-3.1.2-starlink-1b/astrotcl/press/htrans.c000066400000000000000000000101161215713201500215660ustar00rootroot00000000000000/* htrans.c H-transform of NX x NY integer image * * Programmer: R. White Date: 11 May 1992 */ #include #include #include static void shuffle(); extern void htrans(a,nx,ny) int a[]; int nx, ny; { int nmax, log2n, h0, hx, hy, hc, nxtop, nytop, i, j, k; int oddx, oddy; int shift, mask, mask2, prnd, prnd2, nrnd2; int s10, s00; int *tmp; /* * log2n is log2 of max(nx,ny) rounded up to next power of 2 */ nmax = (nx>ny) ? nx : ny; log2n = log((float) nmax)/log(2.0)+0.5; if ( nmax > (1<> shift; hx = (a[s10+1] + a[s10] - a[s00+1] - a[s00]) >> shift; hy = (a[s10+1] - a[s10] + a[s00+1] - a[s00]) >> shift; hc = (a[s10+1] - a[s10] - a[s00+1] + a[s00]) >> shift; /* * Throw away the 2 bottom bits of h0, bottom bit of hx,hy. * To get rounding to be same for positive and negative * numbers, nrnd2 = prnd2 - 1. */ a[s10+1] = hc; a[s10 ] = ( (hx>=0) ? (hx+prnd) : hx ) & mask ; a[s00+1] = ( (hy>=0) ? (hy+prnd) : hy ) & mask ; a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; s00 += 2; s10 += 2; } if (oddy) { /* * do last element in row if row length is odd * s00+1, s10+1 are off edge */ h0 = (a[s10] + a[s00]) << (1-shift); hx = (a[s10] - a[s00]) << (1-shift); a[s10 ] = ( (hx>=0) ? (hx+prnd) : hx ) & mask ; a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; s00 += 1; s10 += 1; } } if (oddx) { /* * do last row if column length is odd * s10, s10+1 are off edge */ s00 = i*ny; for (j = 0; j=0) ? (hy+prnd) : hy ) & mask ; a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; s00 += 2; } if (oddy) { /* * do corner element if both row and column lengths are odd * s00+1, s10, s10+1 are off edge */ h0 = a[s00] << (2-shift); a[s00 ] = ( (h0>=0) ? (h0+prnd2) : (h0+nrnd2) ) & mask2; } } /* * now shuffle in each dimension to group coefficients by order */ for (i = 0; i>1; nytop = (nytop+1)>>1; /* * divisor doubles after first reduction */ shift = 1; /* * masks, rounding values double after each iteration */ mask = mask2; prnd = prnd2; mask2 = mask2 << 1; prnd2 = prnd2 << 1; nrnd2 = prnd2 - 1; } free(tmp); } static void shuffle(a,n,n2,tmp) int a[]; /* array to shuffle */ int n; /* number of elements to shuffle */ int n2; /* second dimension */ int tmp[]; /* scratch storage */ { int i; int *p1, *p2, *pt; /* * copy odd elements to tmp */ pt = tmp; p1 = &a[n2]; for (i=1; i < n; i += 2) { *pt = *p1; pt += 1; p1 += (n2+n2); } /* * compress even elements into first half of A */ p1 = &a[n2]; p2 = &a[n2+n2]; for (i=2; i #include #include #include #include "gen_types.h" #include "gen_str.h" #include "gen_msg.h" #include "press.h" #include "local_press.h" /*+ ************************************************************************ * * Function: press * * Purpose: * Generic compression function. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_UNSUPPORT : Unsuported compression type. * ************************************************************************ -*/ int press ( pfi char_in, /* (in) Function to get input data. */ pfi char_out, /* (in) Function to write output data. */ char *type /* (in) Compresion type. */ ) { if ( streq( type, PR_UNIX ) ) { PR_CHECK( ux_comp( char_in, char_out ) ); } else if ( streq( type, PR_HCOMP ) ) { PR_CHECK( h_comp( char_in, char_out ) ); } else if ( streq( type, PR_GZIP ) ) { PR_CHECK( gzip_comp( char_in, char_out ) ); } else if ( streq( type, PR_NONE ) ) { PR_CHECK( none_comp( char_in, char_out ) ); } else { pr_format_message( PR_E_UNSUPPORT, type ); return( PR_E_UNSUPPORT ); } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: press_buffer_in * * Purpose: * Copies a string of characters from in input buffer. * * Values Returned: * int len : The number of bytes transfered. * int PR_E_EOI : End of file detected. * ************************************************************************ -*/ int press_buffer_in ( byte *buffer, /* (in) Place to put the characters. */ int length /* (in) The size of buffer. */ ) { int len; if ( local_press.lp_in_buf_pos >= local_press.lp_in_buf_size ) { return( PR_E_EOI ); } else { len = MIN( length, local_press.lp_in_buf_size - local_press.lp_in_buf_pos ); (void) memcpy( buffer, local_press.lp_in_buf + local_press.lp_in_buf_pos, len ); local_press.lp_in_buf_pos += len; return( len ); } } /*+ ************************************************************************ * * Function: press_buffer_out * * Purpose: * Copies a string of characters to the output buffer. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_MEMORY : Memory allocation failure. * ************************************************************************ -*/ int press_buffer_out ( byte *buffer, /* (in) Buffer to write. */ int length /* (in) Number of characters to copy. */ ) { if ( local_press.lp_out_buf_pos + length > local_press.lp_out_buf_size ) { PR_CHECK_NULL( local_press.lp_out_buf = (byte *) gen_realloc( local_press.lp_out_buf, MAX( local_press.lp_out_buf_size + local_press.lp_out_buf_inc, local_press.lp_out_buf_pos + length ) ) ); local_press.lp_out_buf_size += local_press.lp_out_buf_inc; } (void) memcpy( local_press.lp_out_buf + local_press.lp_out_buf_pos, buffer, length ); local_press.lp_out_buf_pos += length; return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: press_file_in * * Purpose: * Gets a string of characters from an input file. * * Values Returned: * int length : The number of characters read. * int PR_E_EOI : End of file detected. * ************************************************************************ -*/ int press_file_in ( byte *buffer, /* (in) The buffer to fill. */ int length /* (in) Number of characters to get. */ ) { int len; len = read( local_press.lp_infile, buffer, length ); if ( len <= 0 ) { return( PR_E_EOI ); } else { return( len ); } } /*+ ************************************************************************ * * Function: press_file_out * * Purpose: * Writes a character to the output file. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Io error detected. * ************************************************************************ -*/ int press_file_out ( byte *buffer, /* (in) Buffer to write. */ int length /* (in) Number of bytes to write. */ ) { PR_CHECK_IO( write( local_press.lp_outfile, buffer, length ), "output file" ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: unpress * * Purpose: * Generic decompression function. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int unpress ( pfi char_in, /* (in) Function to read characters. */ pfi char_out, /* (in) Function to write characters. */ char *type /* (in) Compression type. */ ) { if ( streq( type, PR_UNIX ) ) { PR_CHECK( ux_uncomp( char_in, char_out ) ); } else if ( streq( type, PR_HCOMP ) ) { PR_CHECK( h_uncomp( char_in, char_out ) ) } else if ( streq( type, PR_ULDA ) ) { PR_CHECK( ulda_uncomp( char_in, char_out ) ) } else if ( streq( type, PR_GZIP ) ) { PR_CHECK( gzip_uncomp( char_in, char_out ) ) } else if ( streq( type, PR_NONE ) ) { PR_CHECK( none_uncomp( char_in, char_out ) ) } else { pr_format_message( PR_E_UNSUPPORT, type ); return( PR_E_UNSUPPORT ); } return( PR_SUCCESS ); } skycat-3.1.2-starlink-1b/astrotcl/press/local_press.h000066400000000000000000000074411215713201500226110ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Include File Name: press/h/local_press.h * * Purpose: * Contains the local symbol definitions for the press library. * * Date : Feb 24, 1993 * * SCCS data : @(#) * Module Name : local_press.h * Version Number : 1.6 * Release Number : 1 * Last Updated : 07/04/97 * * Programmer : Norman Hill * * Modification History: * 97/07/02 SEC : Added function prototypes. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #define PR_CHECK( s ) { int estatus; \ if ( ( estatus = ( s ) ) < 0 ) { \ return( estatus ); } } #define PR_CHECK_IO( s, name ) { if ( ( s ) < 0 ) {\ pr_format_message( MSG_ERRNO, (name) );\ return( PR_E_IO ); } } #define PR_CHECK_NULL( s ) { if ( ( s ) == NULL ) {\ pr_format_message( PR_E_MEMORY );\ return( PR_E_MEMORY ); } } typedef struct local_press { char *lp_format; /* Format of hcompress data: raw | fits */ /* | net | hhh */ int lp_nx; /* X dimension of the image. */ int lp_ny; /* Y dimension of the image. */ int lp_smooth; /* Do smoothing after hdecompress? */ boolean lp_verbose; /* Run in verbose mode? */ int lp_scale; /* Scale factor for hcompress and gzip. */ int lp_infile; /* Input file descriptor. */ int lp_outfile; /* Output file descriptor. */ byte *lp_in_buf; /* Pointer to input buffer. */ int lp_in_buf_size; /* Size of the input buffer. */ int lp_in_buf_pos; /* Position in the input buffer. */ byte *lp_out_buf; /* Pointer to output buffer. */ int lp_out_buf_size;/* Size of the output buffer. */ int lp_out_buf_pos; /* Position in the ouput buffer. */ int lp_out_buf_inc; /* Ouput buffer size increment. */ } LOCAL_PRESS; /* * Huffman code lookup table entry--this entry is four bytes for machines * that have 16-bit pointers (e.g. PC's in the small or medium model). * Valid extra bits are 0..13. e == 15 is EOB (end of block), e == 16 * means that v is a literal, 16 < e < 32 means that v is a pointer to * the next table, which codes e - 16 bits, and lastly e == 99 indicates * an unused code. If a code with e == 99 is looked up, this implies an * error in the data. */ typedef struct huft_struct { byte e; /* number of extra bits or operation */ byte b; /* number of bits in this code or subcode */ union { unsigned short n; /* literal, length base, or distance base */ struct huft_struct *t; /* pointer to next level of table */ } v; } HUFT; /* * Globals variable declarations. */ extern LOCAL_PRESS local_press; /* * ANSI C Function Prototypes for local functions. */ extern int get_byte( void ); #if 0 /* allan */ extern int huft_build( unsigned *, unsigned, unsigned, unsigned short *, unsigned short *, HUFT **, int * ); extern int huft_free( HUFT * ); #endif extern int gzip_inflate( void ); /* allan: changed name from "inflate()" to avoid name clash with tclpro */ extern unsigned long updcrc( byte *, unsigned ); extern int h_comp( pfi, pfi ); extern int h_uncomp( pfi, pfi ); extern int gzip_comp( pfi, pfi ); extern int gzip_uncomp( pfi, pfi ); extern int none_comp( pfi, pfi ); extern int none_uncomp( pfi, pfi ); extern void pr_format_message( int, ... ); extern int press( pfi, pfi, char *); extern int unpress( pfi, pfi, char * ); extern int press_buffer_in( byte *, int ); extern int press_buffer_out( byte *, int ); extern int press_file_in( byte *, int ); extern int press_file_out( byte *, int ); extern int ulda_uncomp( pfi, pfi ); extern int ux_comp( pfi, pfi ); extern int ux_uncomp( pfi, pfi ); skycat-3.1.2-starlink-1b/astrotcl/press/msg.c000066400000000000000000000155101215713201500210600ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: gen/src/msg.c * * Purpose: * Message handling routines. When more than one message is * found in the string, the delimiting character is a newline * character. * * Routines: * static int compare_status : Compare function for bsearch. * void msg_append : Appends a message to another. * void msg_clear : Clears the message string. * static char *msg_find : Returns the format string. * void msg_format : Formats and appends the message. * * Date : Aug 23, 1991 * * SCCS data : @(#) * Module Name : msg.c * Version Number : 1.10 * Release Number : 1 * Last Updated : 2/12/93 * * Programmer : Severin Gaudet * : Peter W. Draper * * Modification History: * 92/08/11 nrh - Added check for vms specific errors to * msg_format. * 98/02/09 pwd - modifed to use strerror on UNIX calls. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include #include #include #ifdef VMS #include #endif #include #include "gen_types.h" #include "gen_str.h" #include "gen_msg.h" int errno; #define MSG_NOT_FOUND "Message not found." /*+ ************************************************************************ * * Synopsis: * static int compare_status( p, q ) * * Purpose: * Compares the status values in 2 msg structures. This function * is used be bsearch(). * * Parameters: * char *p : (in) Item to be compared. * char *q : (in) Item to be compared. * * Values Returned: * int 0 : Same status value. * int < 0 : p is greater than q. * int > 0 : q is greater than p. * ************************************************************************ -*/ static int compare_status( p, q ) const void *p; const void *q; { MSG *m1; MSG *m2; m1 = (MSG *) p; m2 = (MSG *) q; return( m2->m_status - m1->m_status ); } /*+ ************************************************************************ * * Synopsis: * void msg_append( msg1, msg2 ) * * Purpose: * Appends msg2 to msg1. This is useful for concatenating messages * from different sources. Make sure that the total length will * not exceed the maximum message length. A newline character is * used as the delimiter between messages. * * Parameters: * char *msg1 : (mod) Message to be appended to. * char *msg2 : (in) Message to be added. * * Values Returned: * None. * ************************************************************************ -*/ void msg_append( msg1, msg2 ) char *msg1; char *msg2; { int len1; int len2; len1 = strlen( msg1 ) + 1; len2 = strlen( msg2 ); len2 = MIN( len2, ( MSG_MAX_LEN - len1 ) ); if ( len2 > 0 ) { if ( len1 == 1 ) { (void) strcpy( msg1, msg2 ); } else { (void) strcat( msg1, "\n" ); (void) strncat( msg1, msg2, len2 ); } } } /*+ ************************************************************************ * * Synopsis: * void msg_clear( msg ) * * Purpose: * Clears the message string by setting the first character to * the end-of-string character. * * Parameters: * char *msg : (mod) String to be cleared. * * Values Returned: * None. * ************************************************************************ -*/ void msg_clear( msg ) char *msg; { msg[0] = '\0'; } /*+ ************************************************************************ * * Synopsis: * static char *msg_find( status, msgs, num_msgs ) * * Purpose: * Returns the format string of the message corresponding to the * given status. * * Parameters: * int status : (in) Status searching for. * MSG *msgs : (in) Array of message structures. * int num_msgs : (in) Number of messages in array. * * Values Returned: * char *format : Format string. * ************************************************************************ -*/ static char *msg_find( status, msgs, num_msgs ) int status; MSG *msgs; int num_msgs; { MSG *m; MSG temp_m; temp_m.m_status = status; m = (MSG *) bsearch( (char *)(&temp_m), (char *) msgs, (unsigned) num_msgs, sizeof( MSG ), compare_status ); if ( m == NULL ) { return( MSG_NOT_FOUND ); } else { return( m->m_format ); } } /*+ ************************************************************************ * * Synopsis: * void msg_format( buffer, prefix, num_msgs, msgs, status, args ) * * Purpose: * Formats the buffer according to the status using the message * array and arguments provided. * * Parameters: * va_list : (in) Variable length arguments. * * Values Returned: * None. * ************************************************************************ -*/ void msg_format(char *buffer, char *prefix, int num_msgs, MSG *msgs, int status, ...) /* XXX allan: 12.11.03: changed from vararg to stdarg */ { void msg_append(); char *msg_find(); char *errno_arg; char *format; int i; int indent_size; char *t1; char *t2; char temp_buffer1[MSG_MAX_LEN]; char temp_buffer2[MSG_MAX_LEN]; va_list args; va_start( args, status ); if ( status == MSG_ERRNO ) { /* * Errno message will be used and then reset to 0. * The '+' character is used to separate the prefix from * the error number. */ errno_arg = va_arg( args, char * ); #ifdef VMS if ( vaxc$errno != 0 ) { (void) sprintf( temp_buffer2, "(%s+%d) %s: %s", prefix, errno, errno_arg, strerror( EVMSERR, vaxc$errno ) ); } else if ( errno != 0 ) { (void) sprintf( temp_buffer2, "(%s+%d) %s: %s", prefix, errno, errno_arg, strerror( errno ) ); } vaxc$errno = 0; errno = 0; #else /* VMS */ if ( errno != 0 ) { (void) sprintf( temp_buffer2, "(%s+%d) %s: %s", prefix, errno, errno_arg, strerror( errno ) ); errno = 0; } #endif /* VMS */ } else { /* * Message array will be used and the prefix-number * separator will be a '-' (implicit since the number * is negative). Since this is a programmer generated * message, parse it for newline characters and indent * accordingly. */ format = msg_find( status, msgs, num_msgs ); (void) vsprintf( temp_buffer1, format, args ); if ( strchr( temp_buffer1, '\n' ) == NULL ) { (void) sprintf( temp_buffer2, "(%s%d) %s", prefix, status, temp_buffer1 ); } else { (void) sprintf( temp_buffer2, "(%s%d) ", prefix, status ); indent_size = strlen( temp_buffer2 ); t1 = temp_buffer1; t2 = temp_buffer2 + indent_size; for ( ; *t1; t1++ ) { *t2++ = *t1; if ( *t1 == '\n' ) { for ( i = 0; i < indent_size; i++ ) { *t2++ = ' '; } } } *t2 = '\0'; } } msg_append( buffer, temp_buffer2 ); } skycat-3.1.2-starlink-1b/astrotcl/press/none.c000066400000000000000000000064231215713201500212340ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * (c) 1995 (c) 1995. * National Research Council Conseil national de recherches * Ottawa, Canada, K1A 0R6 Ottawa, Canada, K1A 0R6 * All rights reserved Tous droits reserves * * NRC disclaims any warranties, Le CNRC denie toute garantie * expressed, implied, or statu- enoncee, implicite ou legale, * tory, of any kind with respect de quelque nature que se soit, * to the software, including concernant le logiciel, y com- * without limitation any war- pris sans restriction toute * ranty of merchantability or garantie de valeur marchande * fitness for a particular pur- ou de pertinence pour un usage * pose. NRC shall not be liable particulier. Le CNRC ne * in any event for any damages, pourra en aucun cas etre tenu * whether direct or indirect, responsable de tout dommage, * special or general, consequen- direct ou indirect, particul- * tial or incidental, arising ier ou general, accessoire ou * from the use of the software. fortuit, resultant de l'utili- * sation du logiciel. * ************************************************************************ * * Module Name: press/src/none.c * * Purpose: * Whatever * * Routines: * type routine : Brief description. * type routine : Brief description. * type routine : Brief description. * * Date : Nov 16, 1995 * * SCCS data : @(#) * Module Name : none.c * Version Number : 1.1 * Release Number : 1 * Last Updated : 03/07/96 * * Programmer : Norm Hill * * Modification History: * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include "gen_types.h" #include "press.h" #include "local_press.h" /*+ ************************************************************************ * * Function: name * * Purpose: * Statement of purpose. * * Values Returned: * type name : Meaning *** delete if void function *** * type name : Meaning *** delete if void function *** * * References: * *** delete if not applicable *** * ************************************************************************ -*/ int none_comp ( pfi char_in, /* (in) Function to get data. */ pfi char_out /* (in) Function to write data. */ ) { byte buffer[4096]; int bytes_left; while ( ( bytes_left = char_in( buffer, sizeof( buffer ) ) ) != PR_E_EOI ) { PR_CHECK( char_out( buffer, bytes_left ) ); } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: name * * Purpose: * Statement of purpose. * * Values Returned: * type name : Meaning *** delete if void function *** * type name : Meaning *** delete if void function *** * * References: * *** delete if not applicable *** * ************************************************************************ -*/ int none_uncomp ( pfi char_in, /* (in) Function to get data. */ pfi char_out /* (in) Function to write data. */ ) { byte buffer[4096]; int bytes_left; while ( ( bytes_left = char_in( buffer, sizeof( buffer ) ) ) != PR_E_EOI ) { PR_CHECK( char_out( buffer, bytes_left ) ); } return( PR_SUCCESS ); } skycat-3.1.2-starlink-1b/astrotcl/press/pr_msg.c000066400000000000000000000055711215713201500215670ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: press/src/pr_msg.c * * Purpose: * Formats messge for the press library. * * Routines: * void pr_format_message : Formats a message. * * Date : Feb 23, 1993 * * SCCS data : @(#) * Module Name : pr_msg.c * Version Number : 1.8 * Release Number : 1 * Last Updated : 07/04/97 * * Programmer : Norman Hill * * Modification History: * 97/07/02 SEC : Bring up to ANSI standard. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include #include "gen_types.h" #include "gen_str.h" #include "gen_msg.h" #include "press.h" #define PR_PREFIX "pr" char pr_msg[MSG_MAX_LEN]; MSG pr_msgs[] = { { PR_HCOMP_INFO, "%6.4f bits/pixel, compression factor %5.1f." }, { PR_HDECOMP_INFO, " Smoothing: %d, image size: %dx%d, scale: %d, output format: %s." }, { PR_E_BITPLANE, " bit plane in hdecompress." }, { PR_E_BITS, "Only codes up to '%d' bits are supported." }, { PR_E_BLOCK, " block type '%d'." }, { PR_E_CODE, " code %d in hdecompress qtree decode." }, { PR_E_CRC, "The CRC stored in the file does not match the data." }, { PR_E_DATA, "Data could not be decompressed." }, { PR_E_EOI, "Unexpected end of input detected." }, { PR_E_FITS, "Error reading fits header line:\n%s" }, { PR_E_FITS_DIM, "The image is not 2 dimensional." }, { PR_E_FITS_GRP, "The fits file contains groups, and cannot be compressed." }, { PR_E_FITS_INC, "The fits header is incomplete." }, { PR_E_FITS_TYPE, "The type of the image data is not '%s'." }, { PR_E_FORMAT, "Hcompress output format is not supported." }, { PR_E_INC_LIT, "Incomplete literal tree." }, { PR_E_MAGIC, "The magic number of the compressed data is wrong." }, { PR_E_MEMORY, "Memory allocation failure." }, { PR_E_METHOD, "Compression method '%s' is not supported." }, { PR_E_NAXIS, "hcompress only supports 2 axis fits files." }, { PR_E_SIZE, "The size of the data is not the expected size." }, { PR_E_UNSUPPORT, "Compression type '%s' is not supported." }, }; int pr_num_msgs = sizeof( pr_msgs ) / sizeof( MSG ); /*+ ************************************************************************ * * Synopsis: * void pr_format_message( va_alist ) * * Purpose: * Formats a message from the contents of the va_alist. * * Parameters: * va_list : (in) Variable length arguments. * * Values Returned: * None. * ************************************************************************ -*/ void pr_format_message ( int status, ... ) { va_list args; va_start( args, status ); msg_format( pr_msg, PR_PREFIX, pr_num_msgs, pr_msgs, status, args ); va_end( args ); } skycat-3.1.2-starlink-1b/astrotcl/press/press.c000066400000000000000000000372501215713201500214330ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: press/src/press.c * * Purpose: * Contains the user interface routines to the press library. * * Routines: * int press_f2f : Compress file to file. * int press_f2m : Compress file to memory. * int press_m2f : Compress memory to file. * int press_m2m : Compress memory to memory. * int press_setopt : Set compression/decompression options. * int unpress_f2f : Uncompress file to file. * int unpress_f2m : Uncompress file to memory. * int unpress_fsize : Returns uncompressed file size. * int unpress_m2f : Uncompress memory to file. * int unpress_m2m : Uncompress memory to memory. * int unpress_msize : Returns uncompressed memory size. * * Date : Feb 24, 1993 * * SCCS data : @(#) * Module Name : press.c * Version Number : 1.12 * Release Number : 1 * Last Updated : 07/04/97 * * Programmer : Norman Hill * * Modification History: * 97/07/02 SEC : Bring up to ANSI standard, added new functions * unpress_fsize and unpress_msize. * 98/03/22 Allan : changed varargs.h to stdarg.h and fixed * va_start call. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include #include /* allan: 22.03.98: was varargs.h */ #include #include #include #include "gen_types.h" #include "gen_msg.h" #include "gen_str.h" #include "press.h" #include "local_press.h" #define SH(p) ((unsigned short)(byte)((p)[0]) | \ ((unsigned short)(byte)((p)[1]) << 8)) #define LG(p) ((unsigned long)(SH(p)) | ((unsigned long)(SH((p)+2)) << 16)) /* allan: changed from "FITS" to "fits" */ LOCAL_PRESS local_press = { "fits", 512, 512, 0, FALSE, 10}; /* * An array of functions to call for each compression type. */ /*+ ************************************************************************ * * Function: press_f2f * * Purpose: * Compresses an input file opened on fd_in to an output file opened * on fd_out. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int press_f2f ( int fd_in, /* (in) Input file descriptor. */ int fd_out, /* (in) Output file descriptor. */ char *type /* (in) Compression type of the file. */ ) { local_press.lp_infile = fd_in; local_press.lp_outfile = fd_out; PR_CHECK( press( press_file_in, press_file_out, type ) ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: press_f2m * * Purpose: * Compresses an input file opened on fd_in to memory buffer * buffer_out. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_MEMORY : Memory allocation failure. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int press_f2m ( int fd_in, /* (in) Input file descriptor. */ byte **o_buf, /* (out) Output memory buffer. */ int *o_buf_size, /* (mod) Estimated output buf size on input, actual buffer size on output. */ char *type /* (in) Compression type of the file. */ ) { local_press.lp_infile = fd_in; local_press.lp_out_buf_size = MAX( *o_buf_size, 1024 ); PR_CHECK_NULL( local_press.lp_out_buf = byte_alloc( local_press.lp_out_buf_size ) ); local_press.lp_out_buf_pos = 0; local_press.lp_out_buf_inc = local_press.lp_out_buf_size; PR_CHECK( press( press_file_in, press_buffer_out, type ) ); /* * Set the returned buffer pointer and length. */ *o_buf = local_press.lp_out_buf; *o_buf_size = local_press.lp_out_buf_pos; return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: press_m2f * * Purpose: * Compress the data in ibuf and write the data to the file opened * on file descriptor fd_out. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int press_m2f ( byte *i_buf, /* (in) Input memory buffer. */ int i_buf_size, /* (in) Input buffer size. */ int fd_out, /* (in) Output file descriptor. */ char *type /* (in) Compression type of the file. */ ) { local_press.lp_in_buf = i_buf; local_press.lp_in_buf_size = i_buf_size; local_press.lp_in_buf_pos = 0; local_press.lp_outfile = fd_out; PR_CHECK( press( press_buffer_in, press_file_out, type ) ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: press_m2m * * Purpose: * Compress the data in ibuf and return the result in a buffer * pointed to by obuf. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_MEMORY : Memory allocation failure. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int press_m2m ( byte *i_buf, /* (in) Input memory buffer. */ int i_buf_size, /* (in) Input buffer size. */ byte **o_buf, /* (out) Output memory buffer. */ int *o_buf_size, /* (mod) Estimated output buf size on input, actual buffer size on output. */ char *type /* (in) Compression type of the file. */ ) { local_press.lp_out_buf_size = MAX( *o_buf_size, 1024 ); PR_CHECK_NULL( local_press.lp_out_buf = byte_alloc( local_press.lp_out_buf_size ) ); local_press.lp_out_buf_pos = 0; local_press.lp_out_buf_inc = local_press.lp_out_buf_size; local_press.lp_in_buf = i_buf; local_press.lp_in_buf_size = i_buf_size; local_press.lp_in_buf_pos = 0; PR_CHECK( press( press_buffer_in, press_buffer_out, type ) ); /* * Set the returned buffer pointer and length. */ *o_buf = local_press.lp_out_buf; *o_buf_size = local_press.lp_out_buf_pos; return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: press_setopt * * Purpose: * This function set the compression options. The options depend * on the compression type. * * * For unix compression: * int press_setopt( PR_UNIX, verbose ) * * Parameters: * char *type : (in) The type of compression: PR_UNIX * boolean verbose : (in) Should run in verbose mode? * * For gzip: * int press_setopt( PR_GZIP, verbose, scale ); * * Parameter: * char *type : (in) The type of compression: PR_GZIP * boolean verbose : (in) Should run in verboase mode? * int scale : (in) Scale factor for scaling: ( 1 - 9 ) * * * For hcompress: * int press_setopt( PR_HCOMP, verbose, smoothing, scale, format, * nx, ny ) * * Parameters: * char *type : (in) The type of compression: PR_HCOMP * boolean verbose : (in) Should run in verbose mode? * boolean smoothing : (in) Should hdecompress use smoothing * int scale : (in) Scale factor to use for hcompress. * char *format : (in) Format to use (fits | raw | net ) * int nx : (in) X dimension of the image. * int ny : (in) Y dimension of teh image. * * Note that nx and ny are required for raw and net files, but ignored for * fits files. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_UNSUPPORTED: Unsupported compression type. * ************************************************************************ -*/ int press_setopt ( char *type, ... ) { va_list args; va_start( args, type ); /* allan: 22.3.98: added type arg */ if ( streq( type, PR_UNIX ) ) { /* local_press.lp_verbose = va_arg( args, boolean ); allan: XXX error with gcc-2.96 */ local_press.lp_verbose = va_arg( args, int ); va_end( args ); } else if ( streq( type, PR_HCOMP ) ) { local_press.lp_verbose = (boolean) va_arg( args, int ); local_press.lp_smooth = va_arg( args, int ); local_press.lp_scale = va_arg( args, int ); local_press.lp_format = va_arg( args, char *); local_press.lp_nx = va_arg( args, int ); local_press.lp_ny = va_arg( args, int ); va_end( args ); } else if ( streq( type, PR_GZIP ) ) { local_press.lp_verbose = (boolean) va_arg( args, int ); local_press.lp_scale = va_arg( args, int ); va_end( args ); } else if ( streq( type, PR_NONE ) ) { /** local_press.lp_verbose = va_arg( args, boolean ); XXX allan: error with gcc-2.96 */ local_press.lp_verbose = va_arg( args, int ); va_end( args ); } else { va_end( args ); pr_format_message( PR_E_UNSUPPORT, type ); return( PR_E_UNSUPPORT ); } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: unpress_f2f * * Purpose: * Uncompresses an input file opened on fd_in to an output file opened * on fd_out. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int unpress_f2f ( int fd_in, /* (in) Input file descriptor. */ int fd_out, /* (in) Output file descriptor. */ char *type /* (in) Compression type of the file. */ ) { local_press.lp_infile = fd_in; local_press.lp_outfile = fd_out; PR_CHECK( unpress( press_file_in, press_file_out, type ) ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: unpress_f2m * * Purpose: * Uncompresses an input file opened on fd_in to memory buffer * buffer_out. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_MEMORY : Memory allocation failure. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int unpress_f2m ( int fd_in, /* (in) Input file descriptor. */ byte **o_buf, /* (out) Output memory buffer. */ int *o_buf_size, /* (mod) Estimated output buf size on input, actual buffer size on output. */ char *type /* (in) Compression type of the file. */ ) { local_press.lp_infile = fd_in; local_press.lp_out_buf_size = MAX( *o_buf_size, 1024 ); PR_CHECK_NULL( local_press.lp_out_buf = byte_alloc( local_press.lp_out_buf_size ) ); local_press.lp_out_buf_pos = 0; local_press.lp_out_buf_inc = local_press.lp_out_buf_size; PR_CHECK( unpress( press_file_in, press_buffer_out, type ) ); /* * Set the returned buffer pointer and length. */ *o_buf = local_press.lp_out_buf; *o_buf_size = local_press.lp_out_buf_pos; return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: unpress_fsize * * Purpose: * Get the uncompressed size of a compressed file. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int unpress_fsize ( int fd_in, /* (in) Input file descriptor. */ int *osize, /* (mod) The uncompressed size. */ char *type /* (in) Compression type of the file. */ ) { char buf[4]; if ( streq( type, PR_GZIP ) ) { PR_CHECK_IO( lseek( fd_in, -4, SEEK_END ), "lseek" ); PR_CHECK_IO( read( fd_in, (char *) buf, sizeof(buf) ), "read" ); *osize = LG( buf ); } else { local_press.lp_infile = fd_in; local_press.lp_out_buf_size = MAX( *osize, 1024 ); PR_CHECK_NULL( local_press.lp_out_buf = byte_alloc( local_press.lp_out_buf_size ) ); local_press.lp_out_buf_pos = 0; local_press.lp_out_buf_inc = local_press.lp_out_buf_size; PR_CHECK( unpress( press_file_in, press_buffer_out, type ) ); gen_free( local_press.lp_out_buf ); *osize = local_press.lp_out_buf_pos; } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: unpress_m2f * * Purpose: * Uncompress the data in ibuf and write the result to the file * descriptor fd_out. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int unpress_m2f ( byte *i_buf, /* (in) Input memory buffer. */ int i_buf_size, /* (in) Input buffer size. */ int fd_out, /* (in) Output file descriptor. */ char *type /* (in) Compression type of the file. */ ) { local_press.lp_in_buf = i_buf; local_press.lp_in_buf_size = i_buf_size; local_press.lp_in_buf_pos = 0; local_press.lp_outfile = fd_out; PR_CHECK( unpress( press_buffer_in, press_file_out, type ) ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: unpress_m2m * * Purpose: * Uncompress the data in ibuf and return the result in a buffer * pointed to by obuf. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_MEMORY : Memory allocation failure. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int unpress_m2m ( byte *i_buf, /* (in) Input memory buffer. */ int i_buf_size, /* (in) Input buffer size. */ byte **o_buf, /* (out) Output memory buffer. */ int *o_buf_size, /* (mod) Estimated output buf size on input, actual buffer size on output. */ char *type /* (in) Compression type of the file. */ ) { local_press.lp_out_buf_size = MAX( *o_buf_size, i_buf_size ); local_press.lp_out_buf_size = MAX( local_press.lp_out_buf_size, 1024 ); PR_CHECK_NULL( local_press.lp_out_buf = byte_alloc( local_press.lp_out_buf_size ) ); local_press.lp_out_buf_pos = 0; local_press.lp_out_buf_inc = local_press.lp_out_buf_size; local_press.lp_in_buf = i_buf; local_press.lp_in_buf_size = i_buf_size; local_press.lp_in_buf_pos = 0; PR_CHECK( unpress( press_buffer_in, press_buffer_out, type ) ); /* * Set the returned buffer pointer and length. */ *o_buf = local_press.lp_out_buf; *o_buf_size = local_press.lp_out_buf_pos; return( PR_SUCCESS ); } /*+ ************************************************************************ * * Function: unpress_msize * * Purpose: * Get the uncompressed size of a compressed file in a memory buffer. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * int PR_E_UNSUPPORT : Unsupported compression type. * ************************************************************************ -*/ int unpress_msize ( byte *i_buf, /* (in) Input memory buffer. */ int i_buf_size, /* (in) The buffer length. */ int *osize, /* (mod) The uncompressed size. */ char *type /* (in) Compression type of the file. */ ) { byte *ptr; if ( streq( type, PR_GZIP ) ) { ptr = &( i_buf[i_buf_size-4] ); *osize = LG( ptr ); } else { local_press.lp_out_buf_size = MAX( *osize, i_buf_size ); local_press.lp_out_buf_size = MAX( local_press.lp_out_buf_size, 1024 ); PR_CHECK_NULL( local_press.lp_out_buf = byte_alloc( local_press.lp_out_buf_size ) ); local_press.lp_out_buf_pos = 0; local_press.lp_out_buf_inc = local_press.lp_out_buf_size; local_press.lp_in_buf = i_buf; local_press.lp_in_buf_size = i_buf_size; local_press.lp_in_buf_pos = 0; PR_CHECK( unpress( press_buffer_in, press_buffer_out, type ) ); gen_free( local_press.lp_out_buf ); *osize = local_press.lp_out_buf_pos; } return( PR_SUCCESS ); } skycat-3.1.2-starlink-1b/astrotcl/press/press.h000066400000000000000000000062511215713201500214350ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Include File Name: press/h/press.h * * Purpose: * Public header file for the compress routines. * Whatever * * Date : Feb 23, 1993 * * SCCS data : @(#) * Module Name : press.h * Version Number : 1.11 * Release Number : 1 * Last Updated : 07/04/97 * * Programmer : Norman Hill * * Modification History: * 97/06/06 JSD : Changed extern definitions. * 97/07/02 SEC : Mod'ed func prototypes for up-to-ANSI standard. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ /* * Status codes. */ #define PR_HCOMP_INFO 2 /* Print h-compress information. */ #define PR_HDECOMP_INFO 1 /* Print h-decompress information. */ #define PR_SUCCESS 0 #define PR_E_BITPLANE (-1) /* Bad bit plane in decoded data. */ #define PR_E_BITS (-2) /* Code size is larger than 16 bits. */ #define PR_E_BLOCK (-3) /* Bad block type in gzip data. */ #define PR_E_CODE (-4) /* Bad code during decode. */ #define PR_E_CRC (-5) /* CRC does not match data. */ #define PR_E_DATA (-6) /* Data had bad format. */ #define PR_E_EOI (-7) /* End of input stream reached. */ #define PR_E_FITS (-8) /* Bad fits header format. */ #define PR_E_FITS_DIM (-9) /* Dimension of image is not 2. */ #define PR_E_FITS_GRP (-10) /* Fits file contains groups. */ #define PR_E_FITS_INC (-11) /* Fits header was incomplete. */ #define PR_E_FITS_TYPE (-12) /* Fits image data type is not INTEGER*2*/ #define PR_E_FORMAT (-13) /* Data has a fromat. */ #define PR_E_INC_LIT (-14) /* Incomplete literal set. */ #define PR_E_IO (-15) /* Error durring io. */ #define PR_E_MAGIC (-16) /* Magic number was not found. */ #define PR_E_MEMORY (-17) /* Memory allocation failure. */ #define PR_E_METHOD (-18) /* Compression method is unknown. */ #define PR_E_NAXIS (-19) /* Image dimensions not in fits header. */ #define PR_E_NO_SAVE (-20) /* Compressed data got larger. */ #define PR_E_SIZE (-21) /* File size is wrong. */ #define PR_E_UNSUPPORT (-22) /* Unsupported compression algorithm. */ /* * Compression types supported. */ #define PR_UNIX "UCMP" #define PR_HCOMP "HCMP" #define PR_ULDA "ULDA" #define PR_GZIP "GZIP" #define PR_NONE "NONE" /* * The following #ifdef makes the interface to C++ cleaner. */ #ifdef __cplusplus extern "C" { #endif /* * Function prototypes and external declarations. */ extern int press_f2f( int, int, char * ); extern int press_f2m( int, byte **, int *, char * ); extern int press_m2f( byte *, int, int, char * ); extern int press_m2m( byte *, int, byte **, int *, char * ); extern int press_setopt( char *, ... ); extern int unpress_f2f( int, int, char * ); extern int unpress_f2m( int, byte **, int *, char * ); extern int unpress_m2f( byte *, int, int, char * ); extern int unpress_m2m( byte *, int, byte **, int *, char * ); extern int unpress_fsize( int, int *, char * ); extern int unpress_msize( byte *, int, int *, char * ); extern char pr_msg[]; /* * Ending the C++ compatibility from above. */ #ifdef __cplusplus } #endif skycat-3.1.2-starlink-1b/astrotcl/press/ulda.c000066400000000000000000000237151215713201500212250ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: press/src/ulda.c * * Purpose: * Function to uncompress ulda data into a fits file. * * Routines: * int ulda_uncomp : Function to uncompress ulda data. * * Date : Apr 05, 1993 * * SCCS data : @(#) * Module Name : ulda.c * Version Number : 1.3 * Release Number : 1 * Last Updated : 07/04/97 * * Programmer : Norman Hill * * Modification History: * 97/07/02 SEC : Mod'ed for clean compile. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include #include #include "gen_types.h" #include "press.h" #include "local_press.h" typedef struct ulda_header { int uh_recno; double uh_lamzer; /* Starting wavelength. */ double uh_lamstp; /* Wavelength step. */ double uh_bscale; /* Scale factor. */ double uh_bzero; /* Scale offset. */ double uh_exp_time; /* Exposure time in seconds. */ long uh_ra; /* Right asscension. */ long uh_dec; /* Declination. */ long uh_numlam; /* Number of data points. */ long uh_num_epsilon; /* Number of encoded epsilon values. */ char uh_dubious[81]; /* Dubious comments. */ char uh_id[17]; /* Homogeneous object id. */ char uh_obs_date[10];/* Observation date. */ char uh_imno[6]; /* Image number. */ char uh_cam[4]; /* Camera id. */ char uh_exp_code[4]; /* Exposure code. */ char uh_ap; /* Aperture id. */ char uh_usage; /* Set to 'U' if the data has been used*/ byte uh_obj_class; /* Object class. */ } ULDA_HEADER; typedef char ULDA_DATA[5]; /*+ ************************************************************************ * * Synopsis: * int ulda_uncomp( char_in, char_out ) * * Purpose: * Uncompresses a ulda spectrum into a fits file. * * Parameters: * int (*char_in)() : (in) Function to read data. * int (*char_out)() : (in) Function to write data. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_IO : Error during io. * int PR_E_MEMORY : Memory allocaiton failure. * ************************************************************************ -*/ int ulda_uncomp ( pfi char_in, pfi char_out ) { ULDA_HEADER header; ULDA_DATA *data; byte line[81]; int line_count; static char *fmt1 = "%-8.8s= %-30.30s/ %-38.38s"; static char *fmt2 = "%-8.8s= %-10d / %-38.38s"; static char *fmt3 = "%-8.8s= %-13.10E / %-38.38s"; static char *fmt4 = "%-8.8s= '%-28.28s'/ %-38.38s"; static char *fmt5 = "%-8.8s= '%c ' / %-38.38s"; int i; int j; byte val; int run_length; byte e_value; int band; short tmp; /* * Read the header part of the data. */ PR_CHECK( char_in( (byte *) &header, 189 ) ); /* * Write the fits header. */ line_count = 0; (void) sprintf( (char *) line, fmt1, "SIMPLE", "T", "Standard FITS format" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "BITPIX", 8, "8 bits per pixel." ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "NAXIS", 0, "" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt1, "EXTEND", "T", "There is a binary table extension." ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "RA", header.uh_ra, "" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "DEC", header.uh_dec, "" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt4, "CAMERA", header.uh_cam, "Camera idenifier" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt1, "IMAGE", header.uh_imno, "Image number" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt5, "APERTURE", header.uh_ap, "Aperture id" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt4, "DISPERSN", "LOW", "Camera idenifier" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt4, "DATE", header.uh_obs_date, "Observation date" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt3, "EXPOSURE", header.uh_exp_time, "Exposure time (sec)" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt4, "EXPCODE", header.uh_exp_code, "Exposure code" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt4, "OBJECT", header.uh_id, "Object id" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt5, "CLASS", header.uh_obj_class, "Aperture id" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; header.uh_dubious[72] = '\0'; (void) sprintf( (char *) line, "COMMENT %-72.72s", header.uh_dubious ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, "%-80.80s", "END" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; /* * Fill in the rest of the header block with spaces. */ (void) memset( line, ' ', 80 ); for ( i = ( line_count - 1 ) % 36 + 1; i < 36; i ++ ) { PR_CHECK( char_out( line, 80 ) ); } /* * Write the extension header. */ line_count = 0; (void) sprintf( (char *) line, fmt1, "XTENSION", "'BINTABLE'", "Binary table extension" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "BITPIX", 8, "8 bits per pixel" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "NAXIS", 2, "" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "NAXIS1", 5, "" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "NAXIS2", header.uh_numlam, "Number of spectral bands" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "PCOUNT", 0, "" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "GCOUNT", 1, "" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt2, "TFIELDS", 3, "" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt1, "TFORM1", "'I '", "Wavelength" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt4, "TTYPE1", "Wavelength", "Wavelength" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt4, "TUNIT1", "Angstroms", "Wavelength" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt3, "TZERO1", header.uh_lamzer, "Starting Wavelength" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt3, "TSCAL1", header.uh_lamstp, "Wavelength increment" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt1, "TFORM2", "'I '", "Flux" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt4, "TTYPE2", "Flux", "Flux" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt3, "TZERO2", header.uh_bzero, "Flux offset" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt3, "TSCAL2", header.uh_bscale, "Flux increment" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt1, "TFORM3", "'B '", "Epsilon" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, fmt4, "TTYPE3", "Epsilon", "Epsilon" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; (void) sprintf( (char *) line, "%-80.80s", "END" ); PR_CHECK( char_out( line, 80 ) ); line_count ++; /* * Fill in the rest of the header block with spaces. */ (void) memset( line, ' ', 80 ); for ( i = ( line_count - 1 ) % 36 + 1; i < 36; i ++ ) { PR_CHECK( char_out( line, 80 ) ); } PR_CHECK_NULL( data = (ULDA_DATA *) gen_alloc( header.uh_numlam * 5 ) ); /* * Write the data to the output. */ for ( tmp = 0; tmp < header.uh_numlam; tmp++ ) { memcpy( data[tmp], &tmp, 2 ); PR_CHECK( char_in( (byte *) data[tmp] + 2, 2 ) ); } /* * Decode the epsilon values. */ for( band = 0, i = 0; i < header.uh_num_epsilon; i++ ) { PR_CHECK( char_in( &val, 1 ) ); run_length = val >> 3; e_value = val & 0x07; for ( j = 0; j < run_length && band < header.uh_numlam ; j ++, band ++ ) { data[band][4] = e_value; } } /* * write the data to the output */ PR_CHECK( char_out( (byte *) data, header.uh_numlam * 5 ) ); gen_free( data ); /* * Fill in the remainder of the last 2880 block with nulls. */ for ( i = ( ( ( header.uh_numlam * 5 ) - 1 ) % 2880 ) + 1 ; i < 2880; i++ ) { PR_CHECK( char_out( "\0", 1 ) ); } return( PR_SUCCESS ); } skycat-3.1.2-starlink-1b/astrotcl/press/undigitize.c000066400000000000000000000004521215713201500224440ustar00rootroot00000000000000/* undigitize.c undigitize H-transform * * Programmer: R. White Date: 9 May 1991 */ #include extern void undigitize(a,nx,ny,scale) int a[]; int nx,ny; int scale; { int *p; /* * multiply by scale */ if (scale <= 1) return; for (p=a; p <= &a[nx*ny-1]; p++) *p = (*p)*scale; } skycat-3.1.2-starlink-1b/astrotcl/press/ux_press.c000066400000000000000000000344321215713201500221460ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Module Name: press/src/ux_press.c * * Purpose: * Contains routines to do compression and decompression using the * unix compress algorithm. These routines are taken from * version 4.1 of the compress program. * * Routines: * int ux_comp : Compresses using teh unix compress * algorithm. * int ux_uncomp : Uncompress using the unix compress * algorithm. * * Date : Feb 26, 1993 * * SCCS data : @(#) * Module Name : ux_press.c * Version Number : 1.4 * Release Number : 1 * Last Updated : 07/04/97 * * Programmer : Norman Hill * Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas) * Jim McKie (decvax!mcvax!jim) * Steve Davies (decvax!vax135!petsd!peora!srd) * Ken Turkowski (decvax!decwrl!turtlevax!ken) * James A. Woods (decvax!ihnp4!ames!jaw) * Joe Orost (decvax!vax135!petsd!joe) * Dave Mack (csu@alembic.acs.com) * * Modification History: * 97/07/02 SEC : Bring up to ANSI standard. * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include #include #include "gen_types.h" #include "press.h" #include "local_press.h" #include "ux_press.h" static long bytes_out; static int (*g_char_in)(); static int (*g_char_out)(); static count_int checkpoint; static int clear_flg; static unsigned short codetab [HSIZE]; static code_int free_ent; /* First unused entry. */ static count_int htab [HSIZE]; static long in_count; static byte lmask[9] = {0xff, 0xfe, 0xfc, 0xf8, 0xf0, 0xe0, 0xc0, 0x80, 0x00}; static byte magic_header[] = { "\037\235" }; /* 1F 9D */ static int maxbits; static code_int maxcode; static code_int maxmaxcode; static int n_bits; static int offset; static long out_count; static int r_off; static int ratio; static byte rmask[9] = {0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff}; /* * Static function prototypes. */ static int cl_block( void ); static int cl_hash( count_int ); static code_int getcode( void ); static int output( code_int ); /*+ ************************************************************************ * * Synopsis: * static int cl_block( void ) * * Purpose: * * Parameters: * void * * Values Returned: * int PR_SUCCESS : Normal completion. * ************************************************************************ -*/ static int cl_block ( void ) { long rat; checkpoint = in_count + CHECK_GAP; if(in_count > 0x007fffff) { /* * shift will overflow */ rat = bytes_out >> 8; if(rat == 0) { /* * Don't divide by zero */ rat = 0x7fffffff; } else { rat = in_count / rat; } } else { rat = (in_count << 8) / bytes_out; /* 8 fractional bits */ } if ( rat > ratio ) { ratio = rat; } else { ratio = 0; cl_hash( (count_int) HSIZE ); free_ent = FIRST; clear_flg = 1; PR_CHECK( output( (code_int) CLEAR ) ); } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static int cl_hash( hsize ) * * Purpose: * Clears the hash table. * * Parameters: * count_int hsize : (in) The size of the hash table. * * Values Returned: * int PR_SUCCESS : Normal completion. * ************************************************************************ -*/ static int cl_hash ( count_int hsize ) { memset( htab, (byte) 0xff, hsize * sizeof( count_int ) ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * static code_int getcode() * * Purpose: * Gets the next code from the input stream. * * Parameters: * int (*char_in)() : (in) Function to get the next character * from the input stream. * * Values Returned: * int code : Next code in the input stream. * int PR_E_EOI : End of input detected. * ************************************************************************ -*/ static code_int getcode ( void ) { byte *bp; int bits; static byte buf[BITS]; code_int code; static int offset = 0; static int size = 0; bp = buf; if ( clear_flg > 0 || offset >= size || free_ent > maxcode ) { /* * If the next entry will be too big for the current code * size, then we must increase the size. This implies reading * a new buffer full, too. */ if ( free_ent > maxcode ) { n_bits++; if ( n_bits == maxbits ) { maxcode = maxmaxcode; /* won't get any bigger now */ } else { maxcode = MAXCODE(n_bits); } } if ( clear_flg > 0) { maxcode = MAXCODE (n_bits = INIT_BITS); clear_flg = 0; } offset = 0; if ( ( size = g_char_in( buf, n_bits ) ) <= 0 ) { size = 0; return( PR_E_EOI ); } /* Round size down to integral number of codes */ size = (size << 3) - (n_bits - 1); } r_off = offset; bits = n_bits; /* * Get to the first byte. */ bp += (r_off >> 3); r_off &= 7; /* * Get first part (low order bits) */ code = (*bp++ >> r_off); bits -= (8 - r_off); r_off = 8 - r_off; /* now, offset into code word */ /* * Get any 8 bit parts in the middle (<=1 for up to 16 bits). */ if ( bits >= 8 ) { code |= *bp++ << r_off; r_off += 8; bits -= 8; } /* * high order bits. */ code |= (*bp & rmask[bits]) << r_off; offset += n_bits; return( code ); } /*+ ************************************************************************ * * Synopsis: * int output( code ) * * Purpose: * outputs a code. * * Parameters: * code_int code : (in) Code to output. * * Values Returned: * int PR_SUCCESS : Normal completion. * ************************************************************************ -*/ int output ( code_int code ) { int bits; byte *bp; static byte buf[BITS]; int r_off; bp = buf; bits = n_bits; r_off = offset; if ( code >= 0 ) { /* * Get to the first byte. */ bp += (r_off >> 3); r_off &= 7; /* * Since code is always >= 8 bits, only need to mask the first * hunk on the left. */ *bp = ( *bp & rmask[ r_off ] ) | ( code << r_off ) & lmask[ r_off ]; bp++; bits -= ( 8 - r_off ); code >>= 8 - r_off; /* * Get any 8 bit parts in the middle (<=1 for up to 16 bits). */ if ( bits >= 8 ) { *bp++ = code; code >>= 8; bits -= 8; } /* * Last bits. */ if(bits) { *bp = code; } offset += n_bits; if ( offset == ( n_bits << 3 ) ) { bp = buf; bits = n_bits; bytes_out += bits; PR_CHECK( g_char_out( bp, bits ) ); bits = 0; offset = 0; } /* * If the next entry is going to be too big for the code size, * then increase it, if possible. */ if ( free_ent > maxcode || ( clear_flg > 0 ) ) { /* * Write the whole buffer, because the input side won't * discover the size increase until after it has read it. */ if ( offset > 0 ) { PR_CHECK( g_char_out( buf, n_bits ) ); } offset = 0; if ( clear_flg ) { maxcode = MAXCODE( n_bits = INIT_BITS ); clear_flg = 0; } else { n_bits++; if ( n_bits == maxbits ) { maxcode = maxmaxcode; } else { maxcode = MAXCODE( n_bits ); } } } } else { /* * At EOF, write the rest of the buffer. */ if ( offset > 0 ) { PR_CHECK( g_char_out( buf, (offset + 7) / 8 ) ); } bytes_out += (offset + 7) / 8; offset = 0; } return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * int ux_comp( char_in, char_out ) * * Purpose: * Compresses data using the unix compress algorithm. * Algorithm: use open addressing double hashing (no chaining) on the * prefix code / next character combination. We do a variant of Knuth's * algorithm D (vol. 3, sec. 6.4) along with G. Knott's relatively-prime * secondary probe. Here, the modular division first probe is gives way * to a faster exclusive-or manipulation. Also do block compression with * an adaptive reset, whereby the code table is cleared when the compression * ratio decreases, but after the table fills. The variable-length output * codes are re-sized at this point, and a special CLEAR code is generated * for the decompressor. Late addition: construct the table according to * file size for noticeable speed improvement on small files. Please direct * questions about this implementation to ames!jaw. * * Parameters: * int (*char_in)() : (in) Function to get the next input * character. * int (*char_out)() : (in) Function to write the next output * character. * * Values Returned: * int PR_SUCCESS : Normal completion. * ************************************************************************ -*/ int ux_comp ( pfi char_in, pfi char_out ) { int block_compress; int c; byte chr; int disp; code_int ent; long fcode; int hshift; code_int i = 0; g_char_in = char_in; g_char_out = char_out; /* * write the magic number. */ PR_CHECK( char_out( magic_header, 2 ) ); block_compress = BLOCK_MASK; chr = (byte) ( BITS | BLOCK_MASK ); PR_CHECK( char_out( &chr, 1 ) ); offset = 0; bytes_out = 3; /* includes 3-byte header mojo */ out_count = 0; clear_flg = 0; ratio = 0; in_count = 1; maxbits = BITS; maxmaxcode = 1 << maxbits; checkpoint = CHECK_GAP; maxcode = MAXCODE( n_bits = INIT_BITS ); free_ent = ( ( block_compress ) ? FIRST : 256 ); PR_CHECK( char_in( &chr, 1 ) ); ent = (code_int) chr; hshift = 0; for ( fcode = (long) HSIZE; fcode < 65536L; fcode *= 2L ) { hshift++; } /* * set hash code range bound */ hshift = 8 - hshift; /* * clear hash table. */ cl_hash( (count_int) HSIZE); while ( char_in( &chr, 1 ) == 1 ) { c = (int) chr; in_count++; fcode = (long) ( ( (long) c << maxbits) + ent); i = ( ( c << hshift ) ^ ent ); /* xor hashing */ if ( htabof( i ) == fcode ) { ent = codetabof( i ); continue; } else if ( (long)htabof( i ) < 0 ) /* empty slot */ { goto nomatch; } disp = HSIZE - i; /* secondary hash (after G. Knott) */ if ( i == 0 ) { disp = 1; } probe: if ( (i -= disp) < 0 ) { i += HSIZE; } if ( htabof( i ) == fcode ) { ent = codetabof( i ); continue; } if ( (long)htabof( i ) > 0 ) { goto probe; } nomatch: PR_CHECK( output( ent ) ); out_count++; ent = c; if ( free_ent < maxmaxcode ) { codetabof( i ) = free_ent++; /* code -> hashtable */ htabof( i ) = fcode; } else if ( (count_int)in_count >= checkpoint && block_compress ) { cl_block(); } } /* * Put out the final code. */ PR_CHECK( output( ent ) ); out_count++; PR_CHECK( output( -1 ) ); return( PR_SUCCESS ); } /*+ ************************************************************************ * * Synopsis: * int ux_uncomp( char_in, char_out ) * * Purpose: * Decompresses a memory buffer into a second buffer. * Statement of purpose. * * Parameters: * int (*char_in)() : (in) Function to get a compressed char. * int (*char_out)() : (in) Function to put an uncompressed char. * * Values Returned: * int PR_SUCCESS : Normal completion. * int PR_E_BITS : More bits than can be handled. * int PR_E_MAGIC : Incorrect magic number. * * References: * Compress compresses files using a heavily modified version of the * LZW algorithm as described in IEEE Computer, June 1984. * ************************************************************************ -*/ int ux_uncomp ( pfi char_in, pfi char_out ) { int block_compress; byte buffer[2]; byte chr; code_int code; int finchar; code_int incode; code_int oldcode; /* The previous code. */ byte *stackp; g_char_in = char_in; g_char_out = char_out; free_ent = 0; /* * Check to see if the magic number is correct. */ if ( char_in( buffer, 2 ) != 2 || memcmp( magic_header, buffer, 2 ) != 0 ) { pr_format_message( PR_E_MAGIC ); return( PR_E_MAGIC ); } PR_CHECK( char_in( buffer, 1 ) ); maxbits = (int) buffer[0]; block_compress = maxbits & BLOCK_MASK; maxbits &= BIT_MASK; maxmaxcode = 1 << maxbits; if ( maxbits > BITS ) { pr_format_message( PR_E_BITS, BITS ); return( PR_E_BITS ); } /* * As above, initialize the first 256 entries in the table. */ maxcode = MAXCODE(n_bits = INIT_BITS); for ( code = 255; code >= 0; code-- ) { tab_prefixof(code) = 0; tab_suffixof(code) = (byte)code; } free_ent = ((block_compress) ? FIRST : 256 ); finchar = oldcode = getcode(); /* * Check for EOF. */ if( oldcode == PR_E_EOI ) { return( PR_SUCCESS ); } /* * Write the first character. */ chr = (byte) finchar; PR_CHECK( char_out( &chr, 1 ) ); stackp = de_stack; while ( ( code = getcode() ) > -1 ) { if ( ( code == CLEAR ) && block_compress ) { for ( code = 255; code >= 0; code-- ) { tab_prefixof( code ) = 0; } clear_flg = 1; free_ent = FIRST - 1; if ( ( code = getcode () ) == PR_E_EOI ) { /* * O, untimely death! */ break; } } incode = code; /* * Special case for KwKwK string. */ if ( code >= free_ent ) { *stackp++ = finchar; code = oldcode; } /* * Generate output characters in reverse order */ while ( code >= 256 ) { *stackp++ = tab_suffixof(code); code = tab_prefixof(code); } *stackp++ = finchar = tab_suffixof(code); /* * And put them out in forward order */ do { PR_CHECK( char_out ( --stackp, 1 ) ); } while ( stackp > de_stack ); /* * Generate the new entry. */ if ( ( code=free_ent ) < maxmaxcode ) { tab_prefixof( code ) = (unsigned short) oldcode; tab_suffixof( code) = finchar; free_ent = code+1; } /* * Remember previous code. */ oldcode = incode; } return( PR_SUCCESS ); } skycat-3.1.2-starlink-1b/astrotcl/press/ux_press.h000066400000000000000000000035321215713201500221500ustar00rootroot00000000000000/*+ ************************************************************************ **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** * * Include File Name: press/h/ux_press.h * * Purpose: * Private header for the unix compress routines. * * Date : Feb 23, 1993 * * SCCS data : @(#) * Module Name : ux_press.h * Version Number : 1.1 * Release Number : 1 * Last Updated : 03/01/93 * * Programmer : Norman Hill * * Modification History: * **** C A N A D I A N A S T R O N O M Y D A T A C E N T R E ***** ************************************************************************ -*/ #include typedef int code_int; typedef long int count_int; /* * Define the bits for the third byte in the header. */ #define BLOCK_MASK 0x80 #define BIT_MASK 0x1f #define CHECK_GAP 50000 /* * the next two codes should not be changed lightly, as they must not * lie within the contiguous general code space. */ #define FIRST 257 /* first free entry */ #define CLEAR 256 /* table clear output code */ #define BITS 16 /* Maximum number of bits. */ #define INIT_BITS 9 /* Initial number of bits/code. */ #define HSIZE 69001 /* Hash table size. */ #define htabof(i) htab[i] #define codetabof(i) codetab[i] /* * To save much memory, we overlay the table used by compress() with those * used by decompress(). The tab_prefix table is the same size and type * as the codetab. The tab_suffix table needs 2**BITS characters. We * get this from the beginning of htab. The output stack uses the rest * of htab, and contains characters. There is plenty of room for any * possible stack (stack used to be 8000 characters). */ #define tab_prefixof(i) codetabof(i) #define tab_suffixof(i) ((byte *)(htab))[i] #define de_stack ((byte *)&tab_suffixof(1< #include #include #include "error.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "Mem.h" #include "DCompress.h" #define TTEST(x) {if (!(x)){printf("%s: line %d: Test failed\n", __FILE__, __LINE__); exit(1);}} #ifdef TIME_TESTS #define TEST(x) TIMECALL("x", TTEST(x)) #else #define TEST(x) TTEST(x) #endif main() { char buf[3*1024]; // errors will be printed on stderr automatically set_error_handler(print_error); // compress and decompress the FITS file "test.fits" Compress c; // compress/decompress H_COMPRESS printf("compressing test.fits (H_COMPRESS):\n"); TEST(c.compress("test.fits", "test.fits.hfits", Compress::H_COMPRESS) == 0); printf("decompressing (H_COMPRESS):\n"); TEST(c.decompress("test.fits.hfits", "test.fits.h_decompress", Compress::H_COMPRESS) == 0); // compress/decompress GZIP printf("compressing test.fits (GZIP):\n"); TEST(c.compress("test.fits", "test.fits.gzfits", Compress::GZIP_COMPRESS) == 0); printf("decompressing (GZIP):\n"); TEST(c.decompress("test.fits.gzfits", "test.fits.gzip_decompress", Compress::GZIP_COMPRESS) == 0); printf("comparing results (GZIP):\n"); sprintf(buf, "cmp %s %s", "test.fits", "test.fits.gzip_decompress"); TEST(system(buf) == 0); // compress/decompress UNIX printf("compressing test.fits (UNIX):\n"); TEST(c.compress("test.fits", "test.fits.cfits", Compress::UNIX_COMPRESS) == 0); printf("decompressing (UNIX):\n"); TEST(c.decompress("test.fits.cfits", "test.fits.unix_decompress", Compress::UNIX_COMPRESS) == 0); printf("comparing results (UNIX):\n"); sprintf(buf, "cmp %s %s", "test.fits", "test.fits.unix_decompress"); TEST(system(buf) == 0); #if 0 // memory compress/decompress printf("\ntesting compression of memory (using mmap of FITS file):\n"); Mem m("test.fits"); char* inbuf = (char*)m.ptr(); char* outbuf; int inbufsz = m.size(), outbufsz = m.size()/3; int i; printf("compressing test.fits in memory (GZIP):\n"); TEST(c.compress(inbuf, inbufsz, outbuf, outbufsz, Compress::GZIP_COMPRESS) == 0); printf("decompressing (GZIP) in memory:\n"); TEST(c.decompress(outbuf, outbufsz, inbuf, inbufsz, Compress::GZIP_COMPRESS) == 0); if (inbufsz < m.size()) { printf("decompressed size (%s) does not match expected (%d)\n", inbufsz, m.size()); exit(1); } if ((i = memcmp(inbuf, (char*)m.ptr(), m.size())) != 0) { printf("memcmp of results with original returned %d\n", i); exit(1); } outbufsz = m.size()/2; printf("compressing test.fits in memory (UNIX):\n"); TEST(c.compress(inbuf, inbufsz, outbuf, outbufsz, Compress::UNIX_COMPRESS) == 0); printf("decompressing (UNIX) in memory:\n"); TEST(c.decompress(outbuf, outbufsz, inbuf, inbufsz, Compress::UNIX_COMPRESS) == 0); if (inbufsz < m.size()) { printf("decompressed size (%s) does not match expected (%d)\n", inbufsz, m.size()); exit(1); } if ((i = memcmp(inbuf, (char*)m.ptr(), m.size())) != 0) { printf("memcmp of results with original returned %d\n", i); exit(1); } #endif printf("All tests passed\n"); return(0); } skycat-3.1.2-starlink-1b/astrotcl/tests/tCompress.ok000066400000000000000000000003551215713201500224470ustar00rootroot00000000000000compressing test.fits (H_COMPRESS): decompressing (H_COMPRESS): compressing test.fits (GZIP): decompressing (GZIP): comparing results (GZIP): compressing test.fits (UNIX): decompressing (UNIX): comparing results (UNIX): All tests passed skycat-3.1.2-starlink-1b/astrotcl/tests/tFitsIO.C000066400000000000000000000114751215713201500215670ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tFitsIO.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * tFitsIO.C - test cases for class FitsIO * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 08 Oct 97 Created */ #include #include #include #include #include "error.h" #include "Fits_IO.h" #define TEST(x) {if (!(x)){printf("%s: line %d: Test failed\n", __FILE__, __LINE__); exit(1) ;}} main(int argc, char** argv) { // errors will be printed on stderr automatically set_error_handler(print_error); // default test file is test.fits, or the first cmd line argument char* filename = "test.fits"; if (argc > 1) filename = argv[1]; char cmd[1024]; sprintf(cmd, "cp %s tmp.fits", filename); if (system(cmd) != 0) return fmt_error("error copying %s to tmp.fits", filename); if (system("chmod 777 tmp.fits") != 0) return error("error changing perms on tmp.fits"); FitsIO* fits = FitsIO::read("tmp.fits", Mem::FILE_RDWR); if (! fits) return error("error reading tmp.fits"); // test reading a normal FITS keyword double d; TEST(fits->get("BSCALE", d) == 0); TEST(d == 1.0); // yesy reading it as a string char* bscaleStr = fits->get("BSCALE"); TEST(bscaleStr && sscanf(bscaleStr, "%lf", &d) == 1.0); // test modifying a normal FITS keyword TEST(fits->put("BSCALE", 2.0) == 0); TEST(fits->get("BSCALE", d) == 0); TEST(d == 2.0); // test inserting a normal FITS keyword TEST(fits->put("ARCFILE", "TS1.1998-03-19T01:17:23.199.fits", "Archive File Name") == 0); // test reading an ESO extended FITS keyword char* p = fits->get("HIERARCH ESO DET CHIP1 ID"); TEST(p != NULL); TEST(strcmp(p, "TK2048EB4-1 1604") == 0); // test modifying an ESO extended FITS keyword TEST (fits->put("HIERARCH ESO DET CHIP1 ID", "CHANGED") == 0); p = fits->get("HIERARCH ESO DET CHIP1 ID"); TEST(p != NULL); TEST(strcmp(p, "CHANGED") == 0); // test inserting keywords and extending the file size char keyword[80], comment[80]; for (int i = 0; i < 244; i++) { sprintf(keyword, "TEST_%d", i); sprintf(comment, "test insert of keyword %d", i); if (fits->put(keyword, i, comment) != 0) return error("error inserting keyword: ", keyword); } delete fits; fits = FitsIO::read("tmp.fits", Mem::FILE_RDWR); if (! fits) return error("error re-reading tmp.fits after iniserting keywords"); long rows = 0; int cols = 0; #if 0 // test HDU/Table access TEST(fits->getNumHDUs() == 2); TEST(fits->setHDU(2) == 0); TEST(strcmp(fits->getHDUType(), "binary") == 0); TEST(fits->getTableDims(rows, cols) == 0); TEST(rows == 100); TEST(cols == 3); for(int i = 1; i <= rows; i++) { for(int j = 1; j <= cols; j++) { char* p = fits->getTableValue(i, j); TEST(p != NULL); printf("table(%d,%d) == %s\n", i, j, p); } } #endif #if 0 // test FITS table creation rows = 4; cols = 3; static char* tform[] = {"1J", "32A", "1D"}; static char* headings[] = {"int", "string", "double"}; TEST(fits->createTable("TESTTAB", rows, cols, headings, tform) == 0); TEST(fits->setTableValue(1, 1, "25") == 0); TEST(fits->setTableValue(1, 2, "hello") == 0); TEST(fits->setTableValue(1, 3, "3.14") == 0); TEST(fits->setTableValue(2, 1, "50") == 0); TEST(fits->setTableValue(2, 2, "good bye") == 0); TEST(fits->setTableValue(2, 3, "1.58") == 0); TEST(fits->setTableValue(3, 1, "75") == 0); TEST(fits->setTableValue(3, 2, "test test test test") == 0); TEST(fits->setTableValue(3, 3, "-0.0001") == 0); TEST(fits->setTableValue(4, 1, "100") == 0); TEST(fits->setTableValue(4, 2, "passed") == 0); TEST(fits->setTableValue(4, 3, "0.0001") == 0); #endif delete fits; #if 0 // ----------------------------------------------------------- // See what happens if you try to insert keywords in a decompressed // file (should fail eventually, since using a temp file and can't // increase the size after it is unlinked). if (system("gzip < test.fits > tmp.fits.gz") != 0) return error("error compressing test.fits to tmp.fits.gz"); fits = FitsIO::read("tmp.fits.gz", Mem::FILE_RDWR); if (! fits) return error("error reading tmp.fits.gz"); for (int i = 0; i < 256; i++) { sprintf(keyword, "TEST_%d", i); sprintf(value, "%d", i); sprintf(comment, "test insert of keyword %d", i); if (fits->put(keyword, value, comment) != 0) { error("error inserting keyword in decompressed file (as expected): ", keyword); break; } } delete fits; // ----------------------------------------------------------- #endif printf("All tests passed\n"); // unlink("tmp.fits"); return 0; } skycat-3.1.2-starlink-1b/astrotcl/tests/tFitsIO.ok000066400000000000000000000000211215713201500217770ustar00rootroot00000000000000All tests passed skycat-3.1.2-starlink-1b/astrotcl/tests/tHMS.C000066400000000000000000000041021215713201500210460ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tHMS.C,v 1.1.1.1 2009/03/31 14:11:53 cguirao Exp $ * * tHMS.C - test cases for class HMS * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ using namespace std; #include #include #include #include #include "error.h" #include "HMS.h" main() { // errors will be printed on stderr automatically set_error_handler(print_error); //cout << setprecision(17); cout << "test 1" << endl; HMS h(3, 19, 48.23); cout << h << " HMS = " << h.val()*15 << " = " << HMS(h.val()) << endl; if (h != HMS(h.val())) cout << "Equality test failed: " << h << " != " << HMS(h.val()) << endl; h = HMS(41, 30, 42.2); cout << h << " DMS = " << h.val() << " = " << HMS(h.val()) << endl; h = HMS(-41, 30, 42.2); cout << h << " DMS = " << h.val() << " = " << HMS(h.val()) << endl; h = HMS(-0, 15, 33.3333); cout << h << " DMS = " << h.val() << " = " << HMS(h.val()) << endl; h = HMS(-0.0001); cout << h << " DMS = " << h.val() << " = " << HMS(h.val()) << endl; cout << "\ntest 2" << endl; h = HMS(121.39583332/15.); cout << h << " HMS = " << h.val()*15 << " = " << HMS(h.val()) << endl; cout << "\ntest 3" << endl; h = HMS(121.09583332/15.); cout << h << " HMS = " << h.val()*15 << " = " << HMS(h.val()) << endl; cout << "\ntest 4" << endl; h = HMS(-121.39583332/15.); cout << h << " HMS = " << h.val()*15 << " = " << HMS(h.val()) << endl; cout << "\ntest 5" << endl; h = HMS(-121.09583332/15.); cout << h << " HMS = " << h.val()*15 << " = " << HMS(h.val()) << endl; cout << "\ntest 6" << endl; h = HMS("-08:05:35"); cout << h << " HMS = " << h.val()*15 << " = " << HMS(h.val()) << endl; cout << "\ntest 7" << endl; h = HMS("-08:04:23"); cout << h << " HMS = " << h.val()*15 << " = " << HMS(h.val()) << endl; return(0); } skycat-3.1.2-starlink-1b/astrotcl/tests/tHMS.ok000066400000000000000000000010261215713201500212770ustar00rootroot00000000000000test 1 03:19:48.230 HMS = 49.951 = 03:19:48.230 41:30:42.200 DMS = 41.5117 = 41:30:42.200 -41:30:42.200 DMS = -41.5117 = -41:30:42.200 00:15:33.333 DMS = 0.259259 = 00:15:33.333 -00:00:00.360 DMS = -0.0001 = -00:00:00.360 test 2 08:05:35.000 HMS = 121.396 = 08:05:35.000 test 3 08:04:23.000 HMS = 121.096 = 08:04:23.000 test 4 -08:05:35.000 HMS = -121.396 = -08:05:35.000 test 5 -08:04:23.000 HMS = -121.096 = -08:04:23.000 test 6 -08:05:35.000 HMS = -121.396 = -08:05:35.000 test 7 -08:04:23.000 HMS = -121.096 = -08:04:23.000 skycat-3.1.2-starlink-1b/astrotcl/tests/tHMS.result000066400000000000000000000010261215713201500222040ustar00rootroot00000000000000test 1 03:19:48.230 HMS = 49.951 = 03:19:48.230 41:30:42.200 DMS = 41.5117 = 41:30:42.200 -41:30:42.200 DMS = -41.5117 = -41:30:42.200 00:15:33.333 DMS = 0.259259 = 00:15:33.333 -00:00:00.360 DMS = -0.0001 = -00:00:00.360 test 2 08:05:35.000 HMS = 121.396 = 08:05:35.000 test 3 08:04:23.000 HMS = 121.096 = 08:04:23.000 test 4 -08:05:35.000 HMS = -121.396 = -08:05:35.000 test 5 -08:04:23.000 HMS = -121.096 = -08:04:23.000 test 6 -08:05:35.000 HMS = -121.396 = -08:05:35.000 test 7 -08:04:23.000 HMS = -121.096 = -08:04:23.000 skycat-3.1.2-starlink-1b/astrotcl/tests/tImageCoords.C000066400000000000000000000020151215713201500226140ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tImageCoords.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tImageCoords.C - test cases for class ImageCoords * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 97 Created * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ using namespace std; #include #include #include #include "error.h" #include "ImageCoords.h" main() { // errors will be printed on stderr automatically set_error_handler(print_error); ImageCoords c1(123.456, 654.321); ImageCoords c2("123.456.", "654.321."); cout << "these coords should be the same (or very close):" << endl << c1 << endl << c2 << endl; // test the "box" method (get 2 points given a radius) ImageCoords c3(100., 200.), c4, c5; c3.box(10., c4, c5); cout << "\nbox of radius 10 with center at (100, 200) ==> (" << c4 << "), (" << c5 << ")\n"; return(0); } skycat-3.1.2-starlink-1b/astrotcl/tests/tImageCoords.ok000066400000000000000000000002461215713201500230470ustar00rootroot00000000000000these coords should be the same (or very close): 123.456 654.321 123.456 654.321 box of radius 10 with center at (100, 200) ==> (92.9289 192.929), (107.071 207.071) skycat-3.1.2-starlink-1b/astrotcl/tests/tWorldCoords.C000066400000000000000000000066361215713201500226760ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tWorldCoords.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tWorldCoords.C - test cases for class WorldCoords * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ using namespace std; #include #include #include #include "error.h" #include "WorldCoords.h" main() { // errors will be printed on stderr automatically set_error_handler(print_error); WorldCoords c1(49.95096, 41.51173); WorldCoords c2(3, 19, 48.2304, 41, 30, 42.228); WorldCoords c3(HMS(3, 19, 48.2304), HMS(41, 30, 42.228)); WorldCoords c4(HMS(c1.ra()), HMS(c1.dec())); WorldCoords c5("3 19 48.2304", "+41 30 42.228", 2000.0); WorldCoords c6("3:19:48.2304", "+41:30:42.228", 2000.0); char buf[80]; sprintf(buf, "%f", 49.95096/15); WorldCoords c7(buf, "41.51173", 2000.0); cout << "these coords should all be the same (or very close):" << endl << c1 << endl << c2 << endl << c3 << endl << c4 << endl << c5 << endl << c6 << endl << c7 << endl; c1 = WorldCoords(49.95096, -41.51173); c2 = WorldCoords(3, 19, 48.2304, -41, 30, 42.228); c3 = WorldCoords(HMS(3, 19, 48.2304), HMS(-41, 30, 42.228)); c4 = WorldCoords(HMS(c1.ra()), HMS(c1.dec())); c5 = WorldCoords("3 19 48.2304", "-41 30 42.228", 2000.0); c6 = WorldCoords("3:19:48.2304", "-41:30:42.228", 2000.0); c7 = WorldCoords(buf, "-41.51173", 2000.0); cout << "Here is the same with negative dec:" << endl << c1 << endl << c2 << endl << c3 << endl << c4 << endl << c5 << endl << c6 << endl << c7 << endl; WorldCoords c8("3:19", "+41:30", 2000.0); WorldCoords c9("3", "+41", 2000.0); cout << "And with missing minutes, ... seconds, ..." << endl << c8 << endl << c9 << endl; // test the "box" method (get 2 points given a radius) WorldCoords c10("03:19:48.243", "+41:30:40.31"), c11, c12; c10.box(7.05, c11, c12); cout << "\nbox of radius 7.05 with center at (03:19:48.243, +41:30:40.31) ==> (" << c11 << "), (" << c12 << ")\n"; // test values at or near 0,0 WorldCoords c13("0", "+41:30:40.31"); cout << "\nWith ra = 0.0: " << c13 << ", vals = " << c13.ra().val() << ", " << c13.dec().val() << endl; WorldCoords c14("0.0", "-0.0"); cout << "\nWith ra = 0.0, dec = -0.0: " << c14 << ", vals = " << c14.ra().val() << ", " << c14.dec().val() << endl; WorldCoords c15("0:0:1", "-0:1:1"); cout << "\nWith ra = 0:0:1, dec = -0:1:1: " << c15 << ", vals = " << c15.ra().val() << ", " << c15.dec().val() << endl; // test conversion between h:m:s and deg and back WorldCoords c16("22:45:22.74", "-39:34:14.63"); cout << "\ntest conversion between h:m:s and deg and back\n"; cout << "22:45:22.74 -39:34:14.63 == " << c16 << endl; char ra_buf[80], dec_buf[80]; c16.print(ra_buf, dec_buf, 2000., 0); cout << " == " << ra_buf << " " << dec_buf << endl; double ra = atof(ra_buf), dec = atof(dec_buf); WorldCoords c17(ra, dec); cout << " == " << c17 << endl; // test reported problem when using equinox J2000.0 (with extra ".0") cout << "\ntest use of equinox J2000.0 (with extra .0)\n"; WorldCoords c18("22:45:22.74", "-39:34:14.63", "J2000.0"); cout << " == " << c18 << endl; return(0); } skycat-3.1.2-starlink-1b/astrotcl/tests/tWorldCoords.ok000066400000000000000000000021661215713201500231170ustar00rootroot00000000000000these coords should all be the same (or very close): 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 Here is the same with negative dec: 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 And with missing minutes, ... seconds, ... 03:19:00.000 +41:30:00.00 03:00:00.000 +41:00:00.00 box of radius 7.05 with center at (03:19:48.243, +41:30:40.31) ==> (03:19:21.648 +41:25:41.20), (03:20:14.838 +41:35:39.42) With ra = 0.0: 00:00:00.000 +41:30:40.31, vals = 0, 41.5112 With ra = 0.0, dec = -0.0: 00:00:00.000 -00:00:00.00, vals = 0, -0 With ra = 0:0:1, dec = -0:1:1: 00:00:01.000 -00:01:01.00, vals = 0.000277778, -0.0169444 test conversion between h:m:s and deg and back 22:45:22.74 -39:34:14.63 == 22:45:22.740 -39:34:14.63 == 341.34474999999998 -39.570730555555556 == 22:45:22.740 -39:34:14.63 test use of equinox J2000.0 (with extra .0) == 22:45:22.740 -39:34:14.63 skycat-3.1.2-starlink-1b/astrotcl/tests/tWorldOrImageCoords.C000066400000000000000000000101161215713201500241260ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tWorldOrImageCoords.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tWorldOrImageCoords.C - test cases for class WorldOrImageCoords * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 97 Created * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ using namespace std; #include #include #include #include "error.h" #include "WorldOrImageCoords.h" // test automatic conversion static void print_coords(const ImageCoords& ic, const WorldCoords& wc) { cout << "\nconversion test: image coords: " << ic << ", world coords: " << wc << endl; } main() { // errors will be printed on stderr automatically set_error_handler(print_error); // test image coords WorldOrImageCoords ic1(ImageCoords(123.456, 654.321)); WorldOrImageCoords ic2(ImageCoords("123.456.", "654.321.")); cout << "these coords should be the same (or very close):" << endl << ic1 << endl << ic2 << endl; // test the "box" method (get 2 points given a radius) WorldOrImageCoords ic3(ImageCoords(100., 200.)), ic4, ic5; ic3.box(10., ic4, ic5); cout << "\nbox of radius 10 with center at (100, 200) ==> (" << ic4 << "), (" << ic5 << ")\n"; // test world coords WorldOrImageCoords c1(WorldCoords(49.95096, 41.51173)); WorldOrImageCoords c2(WorldCoords(3, 19, 48.2304, 41, 30, 42.228)); WorldOrImageCoords c3(WorldCoords(HMS(3, 19, 48.2304), HMS(41, 30, 42.228))); WorldOrImageCoords c4(WorldCoords(HMS(c1.ra()), HMS(c1.dec()))); WorldOrImageCoords c5(WorldCoords("3 19 48.2304", "+41 30 42.228", 2000.0)); WorldOrImageCoords c6(WorldCoords("3:19:48.2304", "+41:30:42.228", 2000.0)); char buf[80]; sprintf(buf, "%f", 49.95096/15); WorldOrImageCoords c7(WorldCoords(buf, "41.51173", 2000.0)); cout << "these coords should all be the same (or very close):" << endl << c1 << endl << c2 << endl << c3 << endl << c4 << endl << c5 << endl << c6 << endl << c7 << endl; c1 = WorldOrImageCoords(WorldCoords(49.95096, -41.51173)); c2 = WorldOrImageCoords(WorldCoords(3, 19, 48.2304, -41, 30, 42.228)); c3 = WorldOrImageCoords(WorldCoords(HMS(3, 19, 48.2304), HMS(-41, 30, 42.228))); c4 = WorldOrImageCoords(WorldCoords(HMS(c1.ra()), HMS(c1.dec()))); c5 = WorldOrImageCoords(WorldCoords("3 19 48.2304", "-41 30 42.228", 2000.0)); c6 = WorldOrImageCoords(WorldCoords("3:19:48.2304", "-41:30:42.228", 2000.0)); c7 = WorldOrImageCoords(WorldCoords(buf, "-41.51173", 2000.0)); cout << "Here is the same with negative dec:" << endl << c1 << endl << c2 << endl << c3 << endl << c4 << endl << c5 << endl << c6 << endl << c7 << endl; WorldOrImageCoords c8(WorldCoords("3:19", "+41:30", 2000.0)); WorldOrImageCoords c9(WorldCoords("3", "+41", 2000.0)); cout << "And with missing minutes, ... seconds, ..." << endl << c8 << endl << c9 << endl; // test the "box" method (get 2 points given a radius) WorldOrImageCoords c10(WorldCoords("03:19:48.243", "+41:30:40.31")), c11, c12; c10.box(7.05, c11, c12); cout << "\nbox of radius 7.05 with center at (03:19:48.243, +41:30:40.31) ==> (" << c11 << "), (" << c12 << ")\n"; // test values at or near 0,0 WorldOrImageCoords c13(WorldCoords("0", "+41:30:40.31")); cout << "\nWith ra = 0.0: " << c13 << ", vals = " << c13.ra().val() << ", " << c13.dec().val() << endl; WorldOrImageCoords c14(WorldCoords("0.0", "-0.0")); cout << "\nWith ra = 0.0, dec = -0.0: " << c14 << ", vals = " << c14.ra().val() << ", " << c14.dec().val() << endl; WorldOrImageCoords c15(WorldCoords("0:0:1", "-0:1:1")); cout << "\nWith ra = 0:0:1, dec = -0:1:1: " << c15 << ", vals = " << c15.ra().val() << ", " << c15.dec().val() << endl; // test automatic conversion print_coords(ImageCoords(10., 20.), WorldCoords(10., 20.)); // test assignment c1 = WorldCoords(10., 20.); ic1 = ImageCoords(10., 20.); print_coords(ImageCoords(10., 20.), WorldCoords(10., 20.)); return(0); } skycat-3.1.2-starlink-1b/astrotcl/tests/tWorldOrImageCoords.ok000066400000000000000000000023001215713201500243510ustar00rootroot00000000000000these coords should be the same (or very close): 123.456 654.321 123.456 654.321 box of radius 10 with center at (100, 200) ==> (92.9289 192.929), (107.071 207.071) these coords should all be the same (or very close): 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 03:19:48.230 +41:30:42.23 Here is the same with negative dec: 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 03:19:48.230 -41:30:42.23 And with missing minutes, ... seconds, ... 03:19:00.000 +41:30:00.00 03:00:00.000 +41:00:00.00 box of radius 7.05 with center at (03:19:48.243, +41:30:40.31) ==> (03:19:21.648 +41:25:41.20), (03:20:14.838 +41:35:39.42) With ra = 0.0: 00:00:00.000 +41:30:40.31, vals = 0, 41.5112 With ra = 0.0, dec = -0.0: 00:00:00.000 -00:00:00.00, vals = 0, -0 With ra = 0:0:1, dec = -0:1:1: 00:00:01.000 -00:01:01.00, vals = 0.000277778, -0.0169444 conversion test: image coords: 10 20, world coords: 00:40:00.000 +20:00:00.00 conversion test: image coords: 10 20, world coords: 00:40:00.000 +20:00:00.00 skycat-3.1.2-starlink-1b/astrotcl/tests/test.fits000066400000000000000000015213001215713201500220020ustar00rootroot00000000000000SIMPLE = T / Standard FITS format (NOST-100.0) BITPIX = 16 / # of bits storing pix values NAXIS = 2 / # of axes in frame NAXIS1 = 25 / Length X axis NAXIS2 = 31 / Length Y axis ORIGIN = 'ESO ' / European Southern Observatory DATE = '1998-03-18T16:30:23.415' / UT date when this file was written PC001001 = 0.866025403 / PC002002 = 0.866025403 / CRVAL1 = 5.98364046269628E+00 / RA at Ref pix in decimal degrees CRPIX1 = 1.25000000000000E+01 / Refpix of first axis CDELT1 = 1.0E-4 / SS per pixel in RA CTYPE1 = 'RA---TAN' / Pixel coordinate system PC001002= 0.5 PC002001= -0.5 CRVAL2 = -7.19991314321991E+01 / DEC at Ref pix in decimal degrees CRPIX2 = 1.55000000000000E+01 / Refpix of second axis CDELT2 = 1.0E-4 / SS arcsec per pixel in DEC CTYPE2 = 'DEC--TAN' / Pixel coordinate system EQUINOX = 2000.000 / BSCALE = 1.0 / pixel=FITS*BSCALE+BZERO BZERO = 32768.0 / pixel=FITS*BSCALE+BZERO MJD-OBS = 50890.68722293 / MJD start (1998-03-18T16:29:36.061) EXPTIME = 4.9973 / Total integration time EXTEND = F / Extension may be present OBSERVER= 'FORS observer' / Name of observer OBJECT = 'Objectname' / Target designation INSTRUME= 'FORS1 ' / Instrument used HIERARCH ESO TPL EXPNO = 0 / Exposure number within template HIERARCH ESO INS MODE = 'FREE ' / Instrument mode used HIERARCH ESO INS COLL ID = '+1 ' / Collimator unique ID HIERARCH ESO INS COLL NAME = 'COLL_SR ' / Collimator name HIERARCH ESO INS PIXSCALE = 0.200 / pixel scale in arcsec/pixel HIERARCH ESO INS FILT1 ID = '+35 ' / Filter unique ID HIERARCH ESO INS FILT1 NAME = 'V_BESS ' / Filter i name HIERARCH ESO INS FOCU POS = -0.00002500 / Focus position in cm HIERARCH ESO INS OPTI2 NAME = 'MOS ' / Name of long slit or polarimetric HIERARCH ESO INS OPTI2 ID = ' ' / Id of long slit or polarimetric maHIERARCH ESO INS OPTI2 TYPE = 'MOS ' / Element type HIERARCH ESO INS OPTI3 NAME = 'COLL_SR ' / Name of collimator HIERARCH ESO INS OPTI3 ID = '+1 ' / Identification of collimator HIERARCH ESO INS OPTI3 TYPE = 'COLL ' / Element type HIERARCH ESO INS OPTI4 NAME = 'free ' / Name of retarder plate HIERARCH ESO INS OPTI4 ID = ' ' / Id of retarder plate HIERARCH ESO INS OPTI4 TYPE = ' ' / Element type HIERARCH ESO INS OPTI5 NAME = 'free ' / element name in wheel 1 (WollastonHIERARCH ESO INS OPTI5 ID = ' ' / element id in wheel 1 (Wollaston) HIERARCH ESO INS OPTI5 TYPE = ' ' / Element type HIERARCH ESO INS OPTI6 NAME = 'free ' / element name in wheel2 (grism) HIERARCH ESO INS OPTI6 ID = ' ' / element id in wheel2 (grism) HIERARCH ESO INS OPTI6 TYPE = ' ' / Element type HIERARCH ESO INS OPTI7 NAME = 'V_BESS ' / element name in wheel3 (parallel bHIERARCH ESO INS OPTI7 ID = '+35 ' / element id in wheel3 (parallel beaHIERARCH ESO INS OPTI7 TYPE = 'FILT ' / Element type HIERARCH ESO INS OPTI8 NAME = 'CAMERA ' / camera name HIERARCH ESO INS OPTI8 ID = '+3 ' / camera id HIERARCH ESO INS OPTI8 TYPE = 'CAMERA ' / Element type HIERARCH ESO INS OPTI9 NAME = 'free ' / element name in wheel 4 (interfereHIERARCH ESO INS OPTI9 ID = ' ' / element id in wheel 4 (interferencHIERARCH ESO INS OPTI9 TYPE = ' ' / Element type HIERARCH ESO INS OPTI10 NAME = 'free ' / Element name in wheel 5 (interf. 2HIERARCH ESO INS OPTI10 ID = ' ' / Element id in wheel 5 (interf. 2) HIERARCH ESO INS OPTI10 TYPE = ' ' / Element type HIERARCH ESO DET ID = 'fors - Rev 2.12' / Detector system Id HIERARCH ESO DET NAME = 'fors camera' / Name of detector system HIERARCH ESO DET DATE = '28/01/98' / Installation date HIERARCH ESO DET DID = 'ESO-VLT-DIC.CCDDCS,ESO-VLT-DIC.FCDDCS' / DdictioHIERARCH ESO DET BITS = 16 / Bits per pixel readout HIERARCH ESO DET RA = 0.00000000 / Apparent 00:00:00.0 RA at start HIERARCH ESO DET DEC = 0.00000000 / Apparent 00:00:00.0 DEC at start HIERARCH ESO DET SOFW MODE = 'Normal ' / CCD sw operational mode HIERARCH ESO DET CHIPS = 1 / # of chips in detector array HIERARCH ESO DET CHIP1 ID = 'TK2048EB4-1 1604' / Detector chip identificationHIERARCH ESO DET CHIP1 NAME = ' ' / Detector chip name HIERARCH ESO DET CHIP1 DATE = '28/01/98' / Date of installation [YYYY-MM-DD] HIERARCH ESO DET CHIP1 X = 1 / X location in array HIERARCH ESO DET CHIP1 Y = 1 / Y location in array HIERARCH ESO DET CHIP1 NX = 2048 / # of pixels along X HIERARCH ESO DET CHIP1 NY = 2049 / # of pixels along Y HIERARCH ESO DET CHIP1 PSZX = 24.0 / Size of pixel in X HIERARCH ESO DET CHIP1 PSZY = 24.0 / Size of pixel in Y HIERARCH ESO DET EXP ID = 6471 / Unique exposure ID number HIERARCH ESO DET EXP TYPE = 'Normal ' / Exposure type HIERARCH ESO DET EXP DUMDIT = 0 / # of dummy readouts HIERARCH ESO DET EXP RDTTIME = 89.753 / image readout time HIERARCH ESO DET EXP XFERTIM = 89.680 / image transfer time HIERARCH ESO DET READ MODE = 'normal ' / Readout method HIERARCH ESO DET READ SPEED = 'normal ' / Readout speed HIERARCH ESO DET READ CLOCK = 'Readout A (low gnorm' / Readout clock pattern usHIERARCH ESO DET OUTPUTS = 1 / # of outputs HIERARCH ESO DET OUTREF = 0 / reference output HIERARCH ESO DET OUT1 ID = 'A ' / Output ID as from manufacturer HIERARCH ESO DET OUT1 NAME = ' ' / Description of output HIERARCH ESO DET OUT1 CHIP = 1 / index of chip it belongs to HIERARCH ESO DET OUT1 X = 1 / X location of output HIERARCH ESO DET OUT1 Y = 1 / Y location of output HIERARCH ESO DET OUT1 NX = 0 / valid pixels along X HIERARCH ESO DET OUT1 NY = 0 / valid pixels along Y HIERARCH ESO DET OUT1 PRSCX = 19 / Prescan region in X HIERARCH ESO DET OUT1 OVSCX = 19 / Overscan region in X HIERARCH ESO DET OUT1 CONAD = 1.50 / Conversion from electrons to ADUs HIERARCH ESO DET OUT1 GAIN = 0.00 / Gain for output HIERARCH ESO DET FRAM ID = 1 / Image sequencial number HIERARCH ESO DET FRAM TYPE = 'Normal ' / Type of frame HIERARCH ESO DET WINDOWS = 1 / # of windows readout HIERARCH ESO DET WIN1 STRX = 1 / Lower left pixel in X HIERARCH ESO DET WIN1 STRY = 1 / Lower left pixel in Y HIERARCH ESO DET WIN1 NX = 2080 / # of pixels along X HIERARCH ESO DET WIN1 NY = 2048 / # of pixels along Y HIERARCH ESO DET WIN1 BINX = 1 / Binning factor along X HIERARCH ESO DET WIN1 BINY = 1 / Binning factor along Y HIERARCH ESO DET WIN1 NDIT = 1 / # of subintegrations HIERARCH ESO DET WIN1 UIT1 = 5.000 / user defined subintegration time HIERARCH ESO DET WIN1 DIT1 = 4.9973 / actual subintegration time HIERARCH ESO DET WIN1 DKTM = 5.1346 / Dark current time HIERARCH ESO DET SHUT TYPE = 'Iris ' / type of shutter HIERARCH ESO DET SHUT ID = 'fors shutter' / Shutter unique identifier HIERARCH ESO DET SHUT TMOPEN = 0.235 / Time taken to open shutter HIERARCH ESO DET SHUT TMCLOS = 0.230 / Time taken to close shutter HIERARCH ESO INS MOS1 RA = 6.17962900 / RA of slit in deg HIERARCH ESO INS MOS1 DEC = -72.02527900 / DEC of slit in deg HIERARCH ESO INS MOS1 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS1 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS1 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS2 RA = 6.14554800 / RA of slit in deg HIERARCH ESO INS MOS2 DEC = -72.03162100 / DEC of slit in deg HIERARCH ESO INS MOS2 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS2 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS2 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS3 RA = 6.14558900 / RA of slit in deg HIERARCH ESO INS MOS3 DEC = -72.03793900 / DEC of slit in deg HIERARCH ESO INS MOS3 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS3 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS3 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS4 RA = 6.12855100 / RA of slit in deg HIERARCH ESO INS MOS4 DEC = -72.04426600 / DEC of slit in deg HIERARCH ESO INS MOS4 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS4 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS4 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS5 RA = 6.11150200 / RA of slit in deg HIERARCH ESO INS MOS5 DEC = -72.05059200 / DEC of slit in deg HIERARCH ESO INS MOS5 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS5 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS5 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS6 RA = 6.09444200 / RA of slit in deg HIERARCH ESO INS MOS6 DEC = -72.05691700 / DEC of slit in deg HIERARCH ESO INS MOS6 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS6 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS6 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS7 RA = 6.07737000 / RA of slit in deg HIERARCH ESO INS MOS7 DEC = -72.06324000 / DEC of slit in deg HIERARCH ESO INS MOS7 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS7 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS7 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS8 RA = 6.06028600 / RA of slit in deg HIERARCH ESO INS MOS8 DEC = -72.06956100 / DEC of slit in deg HIERARCH ESO INS MOS8 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS8 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS8 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS9 RA = 6.04319000 / RA of slit in deg HIERARCH ESO INS MOS9 DEC = -72.07588100 / DEC of slit in deg HIERARCH ESO INS MOS9 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS9 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS9 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS10 RA = 6.02608300 / RA of slit in deg HIERARCH ESO INS MOS10 DEC = -72.08220000 / DEC of slit in deg HIERARCH ESO INS MOS10 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS10 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS10 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS11 RA = 6.00896500 / RA of slit in deg HIERARCH ESO INS MOS11 DEC = -72.08851700 / DEC of slit in deg HIERARCH ESO INS MOS11 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS11 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS11 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS12 RA = 5.99183400 / RA of slit in deg HIERARCH ESO INS MOS12 DEC = -72.09483300 / DEC of slit in deg HIERARCH ESO INS MOS12 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS12 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS12 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS13 RA = 5.97469100 / RA of slit in deg HIERARCH ESO INS MOS13 DEC = -72.10114700 / DEC of slit in deg HIERARCH ESO INS MOS13 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS13 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS13 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS14 RA = 5.95753800 / RA of slit in deg HIERARCH ESO INS MOS14 DEC = -72.10745900 / DEC of slit in deg HIERARCH ESO INS MOS14 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS14 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS14 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS15 RA = 5.94037200 / RA of slit in deg HIERARCH ESO INS MOS15 DEC = -72.11377000 / DEC of slit in deg HIERARCH ESO INS MOS15 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS15 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS15 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS16 RA = 5.92319600 / RA of slit in deg HIERARCH ESO INS MOS16 DEC = -72.12008000 / DEC of slit in deg HIERARCH ESO INS MOS16 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS16 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS16 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS17 RA = 5.90600600 / RA of slit in deg HIERARCH ESO INS MOS17 DEC = -72.12638800 / DEC of slit in deg HIERARCH ESO INS MOS17 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS17 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS17 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS18 RA = 5.88880500 / RA of slit in deg HIERARCH ESO INS MOS18 DEC = -72.13269500 / DEC of slit in deg HIERARCH ESO INS MOS18 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS18 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS18 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS19 RA = 5.87159200 / RA of slit in deg HIERARCH ESO INS MOS19 DEC = -72.13900000 / DEC of slit in deg HIERARCH ESO INS MOS19 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS19 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS19 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS LAMP10 NAME = 'FlatRed+2' / Name of the lamp switched on HIERARCH ESO INS LAMP10 TIME = 5.000 / Lamp ilumination time in sec. HIERARCH ESO INS MOS1 POS = 9.000003e+01 / Position of the slit 1 in mm. HIERARCH ESO INS MOS1 WIDTH = 2.999450e-01 / Width of the MOS slit 1 in mm. HIERARCH ESO INS MOS2 POS = 6.999967e+01 / Position of the slit 2 in mm. HIERARCH ESO INS MOS2 WIDTH = 2.996540e-01 / Width of the MOS slit 2 in mm. HIERARCH ESO INS MOS3 POS = 6.999992e+01 / Position of the slit 3 in mm. HIERARCH ESO INS MOS3 WIDTH = 3.001540e-01 / Width of the MOS slit 3 in mm. HIERARCH ESO INS MOS4 POS = 5.999997e+01 / Position of the slit 4 in mm. HIERARCH ESO INS MOS4 WIDTH = 2.990500e-01 / Width of the MOS slit 4 in mm. HIERARCH ESO INS MOS5 POS = 4.999995e+01 / Position of the slit 5 in mm. HIERARCH ESO INS MOS5 WIDTH = 3.001060e-01 / Width of the MOS slit 5 in mm. HIERARCH ESO INS MOS6 POS = 4.000011e+01 / Position of the slit 6 in mm. HIERARCH ESO INS MOS6 WIDTH = 2.997830e-01 / Width of the MOS slit 6 in mm. HIERARCH ESO INS MOS7 POS = 2.999997e+01 / Position of the slit 7 in mm. HIERARCH ESO INS MOS7 WIDTH = 3.000600e-01 / Width of the MOS slit 7 in mm. HIERARCH ESO INS MOS8 POS = 1.999998e+01 / Position of the slit 8 in mm. HIERARCH ESO INS MOS8 WIDTH = 3.000320e-01 / Width of the MOS slit 8 in mm. HIERARCH ESO INS MOS9 POS = 9.999977e+00 / Position of the slit 9 in mm. HIERARCH ESO INS MOS9 WIDTH = 3.000470e-01 / Width of the MOS slit 9 in mm. HIERARCH ESO INS MOS10 POS = 2.000000e-06 / Position of the slit 10 in mm. HIERARCH ESO INS MOS10 WIDTH = 2.999960e-01 / Width of the MOS slit 10 in mm. HIERARCH ESO INS MOS11 POS = -9.999966e+00 / Position of the slit 11 in mm. HIERARCH ESO INS MOS11 WIDTH = 2.999320e-01 / Width of the MOS slit 11 in mm. HIERARCH ESO INS MOS12 POS = -2.000025e+01 / Position of the slit 12 in mm. HIERARCH ESO INS MOS12 WIDTH = 2.995010e-01 / Width of the MOS slit 12 in mm. HIERARCH ESO INS MOS13 POS = -3.000037e+01 / Position of the slit 13 in mm. HIERARCH ESO INS MOS13 WIDTH = 2.997380e-01 / Width of the MOS slit 13 in mm. HIERARCH ESO INS MOS14 POS = -4.000010e+01 / Position of the slit 14 in mm. HIERARCH ESO INS MOS14 WIDTH = 3.001890e-01 / Width of the MOS slit 14 in mm. HIERARCH ESO INS MOS15 POS = -4.999995e+01 / Position of the slit 15 in mm. HIERARCH ESO INS MOS15 WIDTH = 2.998980e-01 / Width of the MOS slit 15 in mm. HIERARCH ESO INS MOS16 POS = -5.999965e+01 / Position of the slit 16 in mm. HIERARCH ESO INS MOS16 WIDTH = 2.992920e-01 / Width of the MOS slit 16 in mm. HIERARCH ESO INS MOS17 POS = -7.000008e+01 / Position of the slit 17 in mm. HIERARCH ESO INS MOS17 WIDTH = 3.001660e-01 / Width of the MOS slit 17 in mm. HIERARCH ESO INS MOS18 POS = -8.000004e+01 / Position of the slit 18 in mm. HIERARCH ESO INS MOS18 WIDTH = 3.000790e-01 / Width of the MOS slit 18 in mm. HIERARCH ESO INS MOS19 POS = -9.000012e+01 / Position of the slit 19 in mm. HIERARCH ESO INS MOS19 WIDTH = 3.002380e-01 / Width of the MOS slit 19 in mm. HISTORY SETHEAD 2.4 1998-09-04 14:49 PC001002 and PC002001 updated END €À€ʀׁ wT(1̀ƀĀ€ÀĀȀӁt,ڴrMрˀĀŀƀǀҁ "ȉՀȀŀÀĀÀŀȀс~Ȧą7ҀĀŀ€€ɀɀӁ Y"րʀɀ€ƀÀŀ̀ҁJȱDž@Ԁ̀ƀ€ƀ̀Ձ5m̅@̀€ƀ€ǀĀ̀ӁA7Q=πǀŀĀ€€€ˀԁ Mȯ/؀ƀȀÀȀځZf\ЀǀÀÀȀȀʁ7WˀɀƀÀ€ƀՁg(#πƀƀƀՁF@:πˀǀĀɀӁv"ԴW рŀĀŀ€€Ȁɀс ?t ڀˀ€ǀہZmȯ݅ ΀ɀ€€̀Ձ"-Ȱ̀€Āʀƀс ,ӀƀƀĀƀɀ́N%&ʀȀÀŀ€ŀ€Ձ Dٵ <ˀʀ€À€ƀȀ΁;ȅwCˀȀƀǀ̀Ӂґ֑9ˀŀ€€€ǁ;E0׀Àɀ7́ր€ŀXTENSION= 'BINTABLE' / binary table extension BITPIX = 8 / 8-bit bytes NAXIS = 2 / 2-dimensional binary table NAXIS1 = 4021 / width of table in bytes NAXIS2 = 100 / number of rows in table PCOUNT = 0 / size of special data area GCOUNT = 1 / one data group (required keyword) TFIELDS = 3 / number of fields in each row TTYPE1 = 'Avalue ' / label for field 1 TFORM1 = '20A ' / data format of field: ASCII Character TTYPE2 = 'Lvalue ' / label for field 2 TFORM2 = '1L ' / data format of field: 1-byte LOGICAL TUNIT2 = 'm**2 ' / physical unit of field TTYPE3 = 'Evalue ' / label for field 3 TFORM3 = '1000E ' / data format of field: 4-byte REAL TUNIT3 = 'cm ' / physical unit of field EXTNAME = 'iter_test' / name of this binary table extension END changed to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fskycat-3.1.2-starlink-1b/astrotcl/tests/tmp.fits000077500000000000000000015631001215713201500216320ustar00rootroot00000000000000SIMPLE = T / Standard FITS format (NOST-100.0) BITPIX = 16 / # of bits storing pix values NAXIS = 2 / # of axes in frame NAXIS1 = 25 / Length X axis NAXIS2 = 31 / Length Y axis ORIGIN = 'ESO ' / European Southern Observatory DATE = '1998-03-18T16:30:23.415' / UT date when this file was written PC001001 = 0.866025403 / PC002002 = 0.866025403 / CRVAL1 = 5.98364046269628E+00 / RA at Ref pix in decimal degrees CRPIX1 = 1.25000000000000E+01 / Refpix of first axis CDELT1 = 1.0E-4 / SS per pixel in RA CTYPE1 = 'RA---TAN' / Pixel coordinate system PC001002= 0.5 PC002001= -0.5 CRVAL2 = -7.19991314321991E+01 / DEC at Ref pix in decimal degrees CRPIX2 = 1.55000000000000E+01 / Refpix of second axis CDELT2 = 1.0E-4 / SS arcsec per pixel in DEC CTYPE2 = 'DEC--TAN' / Pixel coordinate system EQUINOX = 2000.000 / BSCALE = 2. / pixel=FITS*BSCALE+BZERO BZERO = 32768.0 / pixel=FITS*BSCALE+BZERO MJD-OBS = 50890.68722293 / MJD start (1998-03-18T16:29:36.061) EXPTIME = 4.9973 / Total integration time EXTEND = F / Extension may be present OBSERVER= 'FORS observer' / Name of observer OBJECT = 'Objectname' / Target designation INSTRUME= 'FORS1 ' / Instrument used HIERARCH ESO TPL EXPNO = 0 / Exposure number within template HIERARCH ESO INS MODE = 'FREE ' / Instrument mode used HIERARCH ESO INS COLL ID = '+1 ' / Collimator unique ID HIERARCH ESO INS COLL NAME = 'COLL_SR ' / Collimator name HIERARCH ESO INS PIXSCALE = 0.200 / pixel scale in arcsec/pixel HIERARCH ESO INS FILT1 ID = '+35 ' / Filter unique ID HIERARCH ESO INS FILT1 NAME = 'V_BESS ' / Filter i name HIERARCH ESO INS FOCU POS = -0.00002500 / Focus position in cm HIERARCH ESO INS OPTI2 NAME = 'MOS ' / Name of long slit or polarimetric HIERARCH ESO INS OPTI2 ID = ' ' / Id of long slit or polarimetric maHIERARCH ESO INS OPTI2 TYPE = 'MOS ' / Element type HIERARCH ESO INS OPTI3 NAME = 'COLL_SR ' / Name of collimator HIERARCH ESO INS OPTI3 ID = '+1 ' / Identification of collimator HIERARCH ESO INS OPTI3 TYPE = 'COLL ' / Element type HIERARCH ESO INS OPTI4 NAME = 'free ' / Name of retarder plate HIERARCH ESO INS OPTI4 ID = ' ' / Id of retarder plate HIERARCH ESO INS OPTI4 TYPE = ' ' / Element type HIERARCH ESO INS OPTI5 NAME = 'free ' / element name in wheel 1 (WollastonHIERARCH ESO INS OPTI5 ID = ' ' / element id in wheel 1 (Wollaston) HIERARCH ESO INS OPTI5 TYPE = ' ' / Element type HIERARCH ESO INS OPTI6 NAME = 'free ' / element name in wheel2 (grism) HIERARCH ESO INS OPTI6 ID = ' ' / element id in wheel2 (grism) HIERARCH ESO INS OPTI6 TYPE = ' ' / Element type HIERARCH ESO INS OPTI7 NAME = 'V_BESS ' / element name in wheel3 (parallel bHIERARCH ESO INS OPTI7 ID = '+35 ' / element id in wheel3 (parallel beaHIERARCH ESO INS OPTI7 TYPE = 'FILT ' / Element type HIERARCH ESO INS OPTI8 NAME = 'CAMERA ' / camera name HIERARCH ESO INS OPTI8 ID = '+3 ' / camera id HIERARCH ESO INS OPTI8 TYPE = 'CAMERA ' / Element type HIERARCH ESO INS OPTI9 NAME = 'free ' / element name in wheel 4 (interfereHIERARCH ESO INS OPTI9 ID = ' ' / element id in wheel 4 (interferencHIERARCH ESO INS OPTI9 TYPE = ' ' / Element type HIERARCH ESO INS OPTI10 NAME = 'free ' / Element name in wheel 5 (interf. 2HIERARCH ESO INS OPTI10 ID = ' ' / Element id in wheel 5 (interf. 2) HIERARCH ESO INS OPTI10 TYPE = ' ' / Element type HIERARCH ESO DET ID = 'fors - Rev 2.12' / Detector system Id HIERARCH ESO DET NAME = 'fors camera' / Name of detector system HIERARCH ESO DET DATE = '28/01/98' / Installation date HIERARCH ESO DET DID = 'ESO-VLT-DIC.CCDDCS,ESO-VLT-DIC.FCDDCS' / DdictioHIERARCH ESO DET BITS = 16 / Bits per pixel readout HIERARCH ESO DET RA = 0.00000000 / Apparent 00:00:00.0 RA at start HIERARCH ESO DET DEC = 0.00000000 / Apparent 00:00:00.0 DEC at start HIERARCH ESO DET SOFW MODE = 'Normal ' / CCD sw operational mode HIERARCH ESO DET CHIPS = 1 / # of chips in detector array HIERARCH ESO DET CHIP1 ID = 'CHANGED ' / Detector chip identification HIERARCH ESO DET CHIP1 NAME = ' ' / Detector chip name HIERARCH ESO DET CHIP1 DATE = '28/01/98' / Date of installation [YYYY-MM-DD] HIERARCH ESO DET CHIP1 X = 1 / X location in array HIERARCH ESO DET CHIP1 Y = 1 / Y location in array HIERARCH ESO DET CHIP1 NX = 2048 / # of pixels along X HIERARCH ESO DET CHIP1 NY = 2049 / # of pixels along Y HIERARCH ESO DET CHIP1 PSZX = 24.0 / Size of pixel in X HIERARCH ESO DET CHIP1 PSZY = 24.0 / Size of pixel in Y HIERARCH ESO DET EXP ID = 6471 / Unique exposure ID number HIERARCH ESO DET EXP TYPE = 'Normal ' / Exposure type HIERARCH ESO DET EXP DUMDIT = 0 / # of dummy readouts HIERARCH ESO DET EXP RDTTIME = 89.753 / image readout time HIERARCH ESO DET EXP XFERTIM = 89.680 / image transfer time HIERARCH ESO DET READ MODE = 'normal ' / Readout method HIERARCH ESO DET READ SPEED = 'normal ' / Readout speed HIERARCH ESO DET READ CLOCK = 'Readout A (low gnorm' / Readout clock pattern usHIERARCH ESO DET OUTPUTS = 1 / # of outputs HIERARCH ESO DET OUTREF = 0 / reference output HIERARCH ESO DET OUT1 ID = 'A ' / Output ID as from manufacturer HIERARCH ESO DET OUT1 NAME = ' ' / Description of output HIERARCH ESO DET OUT1 CHIP = 1 / index of chip it belongs to HIERARCH ESO DET OUT1 X = 1 / X location of output HIERARCH ESO DET OUT1 Y = 1 / Y location of output HIERARCH ESO DET OUT1 NX = 0 / valid pixels along X HIERARCH ESO DET OUT1 NY = 0 / valid pixels along Y HIERARCH ESO DET OUT1 PRSCX = 19 / Prescan region in X HIERARCH ESO DET OUT1 OVSCX = 19 / Overscan region in X HIERARCH ESO DET OUT1 CONAD = 1.50 / Conversion from electrons to ADUs HIERARCH ESO DET OUT1 GAIN = 0.00 / Gain for output HIERARCH ESO DET FRAM ID = 1 / Image sequencial number HIERARCH ESO DET FRAM TYPE = 'Normal ' / Type of frame HIERARCH ESO DET WINDOWS = 1 / # of windows readout HIERARCH ESO DET WIN1 STRX = 1 / Lower left pixel in X HIERARCH ESO DET WIN1 STRY = 1 / Lower left pixel in Y HIERARCH ESO DET WIN1 NX = 2080 / # of pixels along X HIERARCH ESO DET WIN1 NY = 2048 / # of pixels along Y HIERARCH ESO DET WIN1 BINX = 1 / Binning factor along X HIERARCH ESO DET WIN1 BINY = 1 / Binning factor along Y HIERARCH ESO DET WIN1 NDIT = 1 / # of subintegrations HIERARCH ESO DET WIN1 UIT1 = 5.000 / user defined subintegration time HIERARCH ESO DET WIN1 DIT1 = 4.9973 / actual subintegration time HIERARCH ESO DET WIN1 DKTM = 5.1346 / Dark current time HIERARCH ESO DET SHUT TYPE = 'Iris ' / type of shutter HIERARCH ESO DET SHUT ID = 'fors shutter' / Shutter unique identifier HIERARCH ESO DET SHUT TMOPEN = 0.235 / Time taken to open shutter HIERARCH ESO DET SHUT TMCLOS = 0.230 / Time taken to close shutter HIERARCH ESO INS MOS1 RA = 6.17962900 / RA of slit in deg HIERARCH ESO INS MOS1 DEC = -72.02527900 / DEC of slit in deg HIERARCH ESO INS MOS1 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS1 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS1 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS2 RA = 6.14554800 / RA of slit in deg HIERARCH ESO INS MOS2 DEC = -72.03162100 / DEC of slit in deg HIERARCH ESO INS MOS2 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS2 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS2 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS3 RA = 6.14558900 / RA of slit in deg HIERARCH ESO INS MOS3 DEC = -72.03793900 / DEC of slit in deg HIERARCH ESO INS MOS3 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS3 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS3 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS4 RA = 6.12855100 / RA of slit in deg HIERARCH ESO INS MOS4 DEC = -72.04426600 / DEC of slit in deg HIERARCH ESO INS MOS4 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS4 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS4 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS5 RA = 6.11150200 / RA of slit in deg HIERARCH ESO INS MOS5 DEC = -72.05059200 / DEC of slit in deg HIERARCH ESO INS MOS5 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS5 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS5 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS6 RA = 6.09444200 / RA of slit in deg HIERARCH ESO INS MOS6 DEC = -72.05691700 / DEC of slit in deg HIERARCH ESO INS MOS6 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS6 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS6 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS7 RA = 6.07737000 / RA of slit in deg HIERARCH ESO INS MOS7 DEC = -72.06324000 / DEC of slit in deg HIERARCH ESO INS MOS7 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS7 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS7 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS8 RA = 6.06028600 / RA of slit in deg HIERARCH ESO INS MOS8 DEC = -72.06956100 / DEC of slit in deg HIERARCH ESO INS MOS8 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS8 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS8 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS9 RA = 6.04319000 / RA of slit in deg HIERARCH ESO INS MOS9 DEC = -72.07588100 / DEC of slit in deg HIERARCH ESO INS MOS9 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS9 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS9 POSANG = 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS10 RA = 6.02608300 / RA of slit in deg HIERARCH ESO INS MOS10 DEC = -72.08220000 / DEC of slit in deg HIERARCH ESO INS MOS10 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS10 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS10 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS11 RA = 6.00896500 / RA of slit in deg HIERARCH ESO INS MOS11 DEC = -72.08851700 / DEC of slit in deg HIERARCH ESO INS MOS11 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS11 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS11 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS12 RA = 5.99183400 / RA of slit in deg HIERARCH ESO INS MOS12 DEC = -72.09483300 / DEC of slit in deg HIERARCH ESO INS MOS12 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS12 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS12 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS13 RA = 5.97469100 / RA of slit in deg HIERARCH ESO INS MOS13 DEC = -72.10114700 / DEC of slit in deg HIERARCH ESO INS MOS13 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS13 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS13 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS14 RA = 5.95753800 / RA of slit in deg HIERARCH ESO INS MOS14 DEC = -72.10745900 / DEC of slit in deg HIERARCH ESO INS MOS14 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS14 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS14 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS15 RA = 5.94037200 / RA of slit in deg HIERARCH ESO INS MOS15 DEC = -72.11377000 / DEC of slit in deg HIERARCH ESO INS MOS15 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS15 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS15 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS16 RA = 5.92319600 / RA of slit in deg HIERARCH ESO INS MOS16 DEC = -72.12008000 / DEC of slit in deg HIERARCH ESO INS MOS16 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS16 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS16 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS17 RA = 5.90600600 / RA of slit in deg HIERARCH ESO INS MOS17 DEC = -72.12638800 / DEC of slit in deg HIERARCH ESO INS MOS17 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS17 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS17 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS18 RA = 5.88880500 / RA of slit in deg HIERARCH ESO INS MOS18 DEC = -72.13269500 / DEC of slit in deg HIERARCH ESO INS MOS18 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS18 LEN = 20.09 / MOSi slit length in arcsec HIERARCH ESO INS MOS18 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS MOS19 RA = 5.87159200 / RA of slit in deg HIERARCH ESO INS MOS19 DEC = -72.13900000 / DEC of slit in deg HIERARCH ESO INS MOS19 WID = 0.00 / MOSi slit width in arcsec HIERARCH ESO INS MOS19 LEN = 22.37 / MOSi slit length in arcsec HIERARCH ESO INS MOS19 POSANG= 0.000 / MOS slit posang (N=0 E=90) HIERARCH ESO INS LAMP10 NAME = 'FlatRed+2' / Name of the lamp switched on HIERARCH ESO INS LAMP10 TIME = 5.000 / Lamp ilumination time in sec. HIERARCH ESO INS MOS1 POS = 9.000003e+01 / Position of the slit 1 in mm. HIERARCH ESO INS MOS1 WIDTH = 2.999450e-01 / Width of the MOS slit 1 in mm. HIERARCH ESO INS MOS2 POS = 6.999967e+01 / Position of the slit 2 in mm. HIERARCH ESO INS MOS2 WIDTH = 2.996540e-01 / Width of the MOS slit 2 in mm. HIERARCH ESO INS MOS3 POS = 6.999992e+01 / Position of the slit 3 in mm. HIERARCH ESO INS MOS3 WIDTH = 3.001540e-01 / Width of the MOS slit 3 in mm. HIERARCH ESO INS MOS4 POS = 5.999997e+01 / Position of the slit 4 in mm. HIERARCH ESO INS MOS4 WIDTH = 2.990500e-01 / Width of the MOS slit 4 in mm. HIERARCH ESO INS MOS5 POS = 4.999995e+01 / Position of the slit 5 in mm. HIERARCH ESO INS MOS5 WIDTH = 3.001060e-01 / Width of the MOS slit 5 in mm. HIERARCH ESO INS MOS6 POS = 4.000011e+01 / Position of the slit 6 in mm. HIERARCH ESO INS MOS6 WIDTH = 2.997830e-01 / Width of the MOS slit 6 in mm. HIERARCH ESO INS MOS7 POS = 2.999997e+01 / Position of the slit 7 in mm. HIERARCH ESO INS MOS7 WIDTH = 3.000600e-01 / Width of the MOS slit 7 in mm. HIERARCH ESO INS MOS8 POS = 1.999998e+01 / Position of the slit 8 in mm. HIERARCH ESO INS MOS8 WIDTH = 3.000320e-01 / Width of the MOS slit 8 in mm. HIERARCH ESO INS MOS9 POS = 9.999977e+00 / Position of the slit 9 in mm. HIERARCH ESO INS MOS9 WIDTH = 3.000470e-01 / Width of the MOS slit 9 in mm. HIERARCH ESO INS MOS10 POS = 2.000000e-06 / Position of the slit 10 in mm. HIERARCH ESO INS MOS10 WIDTH = 2.999960e-01 / Width of the MOS slit 10 in mm. HIERARCH ESO INS MOS11 POS = -9.999966e+00 / Position of the slit 11 in mm. HIERARCH ESO INS MOS11 WIDTH = 2.999320e-01 / Width of the MOS slit 11 in mm. HIERARCH ESO INS MOS12 POS = -2.000025e+01 / Position of the slit 12 in mm. HIERARCH ESO INS MOS12 WIDTH = 2.995010e-01 / Width of the MOS slit 12 in mm. HIERARCH ESO INS MOS13 POS = -3.000037e+01 / Position of the slit 13 in mm. HIERARCH ESO INS MOS13 WIDTH = 2.997380e-01 / Width of the MOS slit 13 in mm. HIERARCH ESO INS MOS14 POS = -4.000010e+01 / Position of the slit 14 in mm. HIERARCH ESO INS MOS14 WIDTH = 3.001890e-01 / Width of the MOS slit 14 in mm. HIERARCH ESO INS MOS15 POS = -4.999995e+01 / Position of the slit 15 in mm. HIERARCH ESO INS MOS15 WIDTH = 2.998980e-01 / Width of the MOS slit 15 in mm. HIERARCH ESO INS MOS16 POS = -5.999965e+01 / Position of the slit 16 in mm. HIERARCH ESO INS MOS16 WIDTH = 2.992920e-01 / Width of the MOS slit 16 in mm. HIERARCH ESO INS MOS17 POS = -7.000008e+01 / Position of the slit 17 in mm. HIERARCH ESO INS MOS17 WIDTH = 3.001660e-01 / Width of the MOS slit 17 in mm. HIERARCH ESO INS MOS18 POS = -8.000004e+01 / Position of the slit 18 in mm. HIERARCH ESO INS MOS18 WIDTH = 3.000790e-01 / Width of the MOS slit 18 in mm. HIERARCH ESO INS MOS19 POS = -9.000012e+01 / Position of the slit 19 in mm. HIERARCH ESO INS MOS19 WIDTH = 3.002380e-01 / Width of the MOS slit 19 in mm. HISTORY SETHEAD 2.4 1998-09-04 14:49 PC001002 and PC002001 updated ARCFILE = 'TS1.1998-03-19T01:17:23.199.fits' / Archive File Name TEST_0 = 0 / test insert of keyword 0 TEST_1 = 1 / test insert of keyword 1 TEST_2 = 2 / test insert of keyword 2 TEST_3 = 3 / test insert of keyword 3 TEST_4 = 4 / test insert of keyword 4 TEST_5 = 5 / test insert of keyword 5 TEST_6 = 6 / test insert of keyword 6 TEST_7 = 7 / test insert of keyword 7 TEST_8 = 8 / test insert of keyword 8 TEST_9 = 9 / test insert of keyword 9 TEST_10 = 10 / test insert of keyword 10 TEST_11 = 11 / test insert of keyword 11 TEST_12 = 12 / test insert of keyword 12 TEST_13 = 13 / test insert of keyword 13 TEST_14 = 14 / test insert of keyword 14 TEST_15 = 15 / test insert of keyword 15 TEST_16 = 16 / test insert of keyword 16 TEST_17 = 17 / test insert of keyword 17 TEST_18 = 18 / test insert of keyword 18 TEST_19 = 19 / test insert of keyword 19 TEST_20 = 20 / test insert of keyword 20 TEST_21 = 21 / test insert of keyword 21 TEST_22 = 22 / test insert of keyword 22 TEST_23 = 23 / test insert of keyword 23 TEST_24 = 24 / test insert of keyword 24 TEST_25 = 25 / test insert of keyword 25 TEST_26 = 26 / test insert of keyword 26 TEST_27 = 27 / test insert of keyword 27 TEST_28 = 28 / test insert of keyword 28 TEST_29 = 29 / test insert of keyword 29 TEST_30 = 30 / test insert of keyword 30 TEST_31 = 31 / test insert of keyword 31 TEST_32 = 32 / test insert of keyword 32 TEST_33 = 33 / test insert of keyword 33 COMMENT FitsIO: added 1 block to header TEST_34 = 34 / test insert of keyword 34 TEST_35 = 35 / test insert of keyword 35 TEST_36 = 36 / test insert of keyword 36 TEST_37 = 37 / test insert of keyword 37 TEST_38 = 38 / test insert of keyword 38 TEST_39 = 39 / test insert of keyword 39 TEST_40 = 40 / test insert of keyword 40 TEST_41 = 41 / test insert of keyword 41 TEST_42 = 42 / test insert of keyword 42 TEST_43 = 43 / test insert of keyword 43 TEST_44 = 44 / test insert of keyword 44 TEST_45 = 45 / test insert of keyword 45 TEST_46 = 46 / test insert of keyword 46 TEST_47 = 47 / test insert of keyword 47 TEST_48 = 48 / test insert of keyword 48 TEST_49 = 49 / test insert of keyword 49 TEST_50 = 50 / test insert of keyword 50 TEST_51 = 51 / test insert of keyword 51 TEST_52 = 52 / test insert of keyword 52 TEST_53 = 53 / test insert of keyword 53 TEST_54 = 54 / test insert of keyword 54 TEST_55 = 55 / test insert of keyword 55 TEST_56 = 56 / test insert of keyword 56 TEST_57 = 57 / test insert of keyword 57 TEST_58 = 58 / test insert of keyword 58 TEST_59 = 59 / test insert of keyword 59 TEST_60 = 60 / test insert of keyword 60 TEST_61 = 61 / test insert of keyword 61 TEST_62 = 62 / test insert of keyword 62 TEST_63 = 63 / test insert of keyword 63 TEST_64 = 64 / test insert of keyword 64 TEST_65 = 65 / test insert of keyword 65 TEST_66 = 66 / test insert of keyword 66 TEST_67 = 67 / test insert of keyword 67 TEST_68 = 68 / test insert of keyword 68 COMMENT FitsIO: added 1 block to header TEST_69 = 69 / test insert of keyword 69 TEST_70 = 70 / test insert of keyword 70 TEST_71 = 71 / test insert of keyword 71 TEST_72 = 72 / test insert of keyword 72 TEST_73 = 73 / test insert of keyword 73 TEST_74 = 74 / test insert of keyword 74 TEST_75 = 75 / test insert of keyword 75 TEST_76 = 76 / test insert of keyword 76 TEST_77 = 77 / test insert of keyword 77 TEST_78 = 78 / test insert of keyword 78 TEST_79 = 79 / test insert of keyword 79 TEST_80 = 80 / test insert of keyword 80 TEST_81 = 81 / test insert of keyword 81 TEST_82 = 82 / test insert of keyword 82 TEST_83 = 83 / test insert of keyword 83 TEST_84 = 84 / test insert of keyword 84 TEST_85 = 85 / test insert of keyword 85 TEST_86 = 86 / test insert of keyword 86 TEST_87 = 87 / test insert of keyword 87 TEST_88 = 88 / test insert of keyword 88 TEST_89 = 89 / test insert of keyword 89 TEST_90 = 90 / test insert of keyword 90 TEST_91 = 91 / test insert of keyword 91 TEST_92 = 92 / test insert of keyword 92 TEST_93 = 93 / test insert of keyword 93 TEST_94 = 94 / test insert of keyword 94 TEST_95 = 95 / test insert of keyword 95 TEST_96 = 96 / test insert of keyword 96 TEST_97 = 97 / test insert of keyword 97 TEST_98 = 98 / test insert of keyword 98 TEST_99 = 99 / test insert of keyword 99 TEST_100= 100 / test insert of keyword 100 TEST_101= 101 / test insert of keyword 101 TEST_102= 102 / test insert of keyword 102 TEST_103= 103 / test insert of keyword 103 COMMENT FitsIO: added 1 block to header TEST_104= 104 / test insert of keyword 104 TEST_105= 105 / test insert of keyword 105 TEST_106= 106 / test insert of keyword 106 TEST_107= 107 / test insert of keyword 107 TEST_108= 108 / test insert of keyword 108 TEST_109= 109 / test insert of keyword 109 TEST_110= 110 / test insert of keyword 110 TEST_111= 111 / test insert of keyword 111 TEST_112= 112 / test insert of keyword 112 TEST_113= 113 / test insert of keyword 113 TEST_114= 114 / test insert of keyword 114 TEST_115= 115 / test insert of keyword 115 TEST_116= 116 / test insert of keyword 116 TEST_117= 117 / test insert of keyword 117 TEST_118= 118 / test insert of keyword 118 TEST_119= 119 / test insert of keyword 119 TEST_120= 120 / test insert of keyword 120 TEST_121= 121 / test insert of keyword 121 TEST_122= 122 / test insert of keyword 122 TEST_123= 123 / test insert of keyword 123 TEST_124= 124 / test insert of keyword 124 TEST_125= 125 / test insert of keyword 125 TEST_126= 126 / test insert of keyword 126 TEST_127= 127 / test insert of keyword 127 TEST_128= 128 / test insert of keyword 128 TEST_129= 129 / test insert of keyword 129 TEST_130= 130 / test insert of keyword 130 TEST_131= 131 / test insert of keyword 131 TEST_132= 132 / test insert of keyword 132 TEST_133= 133 / test insert of keyword 133 TEST_134= 134 / test insert of keyword 134 TEST_135= 135 / test insert of keyword 135 TEST_136= 136 / test insert of keyword 136 TEST_137= 137 / test insert of keyword 137 TEST_138= 138 / test insert of keyword 138 COMMENT FitsIO: added 1 block to header TEST_139= 139 / test insert of keyword 139 TEST_140= 140 / test insert of keyword 140 TEST_141= 141 / test insert of keyword 141 TEST_142= 142 / test insert of keyword 142 TEST_143= 143 / test insert of keyword 143 TEST_144= 144 / test insert of keyword 144 TEST_145= 145 / test insert of keyword 145 TEST_146= 146 / test insert of keyword 146 TEST_147= 147 / test insert of keyword 147 TEST_148= 148 / test insert of keyword 148 TEST_149= 149 / test insert of keyword 149 TEST_150= 150 / test insert of keyword 150 TEST_151= 151 / test insert of keyword 151 TEST_152= 152 / test insert of keyword 152 TEST_153= 153 / test insert of keyword 153 TEST_154= 154 / test insert of keyword 154 TEST_155= 155 / test insert of keyword 155 TEST_156= 156 / test insert of keyword 156 TEST_157= 157 / test insert of keyword 157 TEST_158= 158 / test insert of keyword 158 TEST_159= 159 / test insert of keyword 159 TEST_160= 160 / test insert of keyword 160 TEST_161= 161 / test insert of keyword 161 TEST_162= 162 / test insert of keyword 162 TEST_163= 163 / test insert of keyword 163 TEST_164= 164 / test insert of keyword 164 TEST_165= 165 / test insert of keyword 165 TEST_166= 166 / test insert of keyword 166 TEST_167= 167 / test insert of keyword 167 TEST_168= 168 / test insert of keyword 168 TEST_169= 169 / test insert of keyword 169 TEST_170= 170 / test insert of keyword 170 TEST_171= 171 / test insert of keyword 171 TEST_172= 172 / test insert of keyword 172 TEST_173= 173 / test insert of keyword 173 COMMENT FitsIO: added 1 block to header TEST_174= 174 / test insert of keyword 174 TEST_175= 175 / test insert of keyword 175 TEST_176= 176 / test insert of keyword 176 TEST_177= 177 / test insert of keyword 177 TEST_178= 178 / test insert of keyword 178 TEST_179= 179 / test insert of keyword 179 TEST_180= 180 / test insert of keyword 180 TEST_181= 181 / test insert of keyword 181 TEST_182= 182 / test insert of keyword 182 TEST_183= 183 / test insert of keyword 183 TEST_184= 184 / test insert of keyword 184 TEST_185= 185 / test insert of keyword 185 TEST_186= 186 / test insert of keyword 186 TEST_187= 187 / test insert of keyword 187 TEST_188= 188 / test insert of keyword 188 TEST_189= 189 / test insert of keyword 189 TEST_190= 190 / test insert of keyword 190 TEST_191= 191 / test insert of keyword 191 TEST_192= 192 / test insert of keyword 192 TEST_193= 193 / test insert of keyword 193 TEST_194= 194 / test insert of keyword 194 TEST_195= 195 / test insert of keyword 195 TEST_196= 196 / test insert of keyword 196 TEST_197= 197 / test insert of keyword 197 TEST_198= 198 / test insert of keyword 198 TEST_199= 199 / test insert of keyword 199 TEST_200= 200 / test insert of keyword 200 TEST_201= 201 / test insert of keyword 201 TEST_202= 202 / test insert of keyword 202 TEST_203= 203 / test insert of keyword 203 TEST_204= 204 / test insert of keyword 204 TEST_205= 205 / test insert of keyword 205 TEST_206= 206 / test insert of keyword 206 TEST_207= 207 / test insert of keyword 207 TEST_208= 208 / test insert of keyword 208 COMMENT FitsIO: added 1 block to header TEST_209= 209 / test insert of keyword 209 TEST_210= 210 / test insert of keyword 210 TEST_211= 211 / test insert of keyword 211 TEST_212= 212 / test insert of keyword 212 TEST_213= 213 / test insert of keyword 213 TEST_214= 214 / test insert of keyword 214 TEST_215= 215 / test insert of keyword 215 TEST_216= 216 / test insert of keyword 216 TEST_217= 217 / test insert of keyword 217 TEST_218= 218 / test insert of keyword 218 TEST_219= 219 / test insert of keyword 219 TEST_220= 220 / test insert of keyword 220 TEST_221= 221 / test insert of keyword 221 TEST_222= 222 / test insert of keyword 222 TEST_223= 223 / test insert of keyword 223 TEST_224= 224 / test insert of keyword 224 TEST_225= 225 / test insert of keyword 225 TEST_226= 226 / test insert of keyword 226 TEST_227= 227 / test insert of keyword 227 TEST_228= 228 / test insert of keyword 228 TEST_229= 229 / test insert of keyword 229 TEST_230= 230 / test insert of keyword 230 TEST_231= 231 / test insert of keyword 231 TEST_232= 232 / test insert of keyword 232 TEST_233= 233 / test insert of keyword 233 TEST_234= 234 / test insert of keyword 234 TEST_235= 235 / test insert of keyword 235 TEST_236= 236 / test insert of keyword 236 TEST_237= 237 / test insert of keyword 237 TEST_238= 238 / test insert of keyword 238 TEST_239= 239 / test insert of keyword 239 TEST_240= 240 / test insert of keyword 240 TEST_241= 241 / test insert of keyword 241 TEST_242= 242 / test insert of keyword 242 TEST_243= 243 / test insert of keyword 243 END €À€ʀׁ wT(1̀ƀĀ€ÀĀȀӁt,ڴrMрˀĀŀƀǀҁ "ȉՀȀŀÀĀÀŀȀс~Ȧą7ҀĀŀ€€ɀɀӁ Y"րʀɀ€ƀÀŀ̀ҁJȱDž@Ԁ̀ƀ€ƀ̀Ձ5m̅@̀€ƀ€ǀĀ̀ӁA7Q=πǀŀĀ€€€ˀԁ Mȯ/؀ƀȀÀȀځZf\ЀǀÀÀȀȀʁ7WˀɀƀÀ€ƀՁg(#πƀƀƀՁF@:πˀǀĀɀӁv"ԴW рŀĀŀ€€Ȁɀс ?t ڀˀ€ǀہZmȯ݅ ΀ɀ€€̀Ձ"-Ȱ̀€Āʀƀс ,ӀƀƀĀƀɀ́N%&ʀȀÀŀ€ŀ€Ձ Dٵ <ˀʀ€À€ƀȀ΁;ȅwCˀȀƀǀ̀Ӂґ֑9ˀŀ€€€ǁ;E0׀Àɀ7́ր€ŀXTENSION= 'BINTABLE' / binary table extension BITPIX = 8 / 8-bit bytes NAXIS = 2 / 2-dimensional binary table NAXIS1 = 4021 / width of table in bytes NAXIS2 = 100 / number of rows in table PCOUNT = 0 / size of special data area GCOUNT = 1 / one data group (required keyword) TFIELDS = 3 / number of fields in each row TTYPE1 = 'Avalue ' / label for field 1 TFORM1 = '20A ' / data format of field: ASCII Character TTYPE2 = 'Lvalue ' / label for field 2 TFORM2 = '1L ' / data format of field: 1-byte LOGICAL TUNIT2 = 'm**2 ' / physical unit of field TTYPE3 = 'Evalue ' / label for field 3 TFORM3 = '1000E ' / data format of field: 4-byte REAL TUNIT3 = 'cm ' / physical unit of field EXTNAME = 'iter_test' / name of this binary table extension END changed to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to true Tchanged to false Fchanged to false Fchanged to false Fchanged to false Fchanged to false Fskycat-3.1.2-starlink-1b/bootstrap000077500000000000000000000030701215713201500171000ustar00rootroot00000000000000#!/bin/sh #****************************************************************************** # European Southern Observatory / Data Management and Operations Division # Data Flow System department # "@(#) $Id: bootstrap,v 1.1 2010/07/01 15:40:17 cguirao Exp $" #****************************************************************************** # ############################################################################# # HEADER # ############################################################################# # ------- # CHANGES # ------- # WHO WHAT WHEN WHERE # cguirao created 2006/02/20 1_0 # # ------------------- # GENERAL DESCRIPTION # ------------------- # Bootstrap script for packages with Autotools. # The execution of this script generates the Autotools scripts (i.e. configure) # To be executed after a complet check-out of project from CVS # and after the execution of a "make clean-maintainer" # ############################################################################# # MAIN # ############################################################################# # This is to filter out annoying messages. But it failed to exit with the # same error code #autoreconf -i -s --force 2>&1 | egrep -v "libgcrypt.m4:23" | egrep -v "Extending" | egrep -v "ao.m4:9" autoreconf -i -s --force >/dev/null 2>&1 result=$? if [ $result -ne 0 ]; then echo "bootstrap: \"autoreconf -i -s --force\" failed." echo "bootstrap: execute it by hand to get more info" fi exit $result skycat-3.1.2-starlink-1b/cat/000077500000000000000000000000001215713201500157045ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/cat/CHANGES000066400000000000000000001020011215713201500166710ustar00rootroot00000000000000CHANGES to the "catlib" Catalog Interface Library ------------------------------------------------- This file contains a list of changes to the "catlib" libraries. The latest changes are at the top. --------------- 20.10.08 released catlib-4.1.0 ----------------- * Fixes for gcc version 4.2.4. --------------- 03.02.06 released catlib-4.0 ------------------- * Major update: see top level CHANGES file. --------------- 20.01.03 released cat-3.7.4 ----------------- * Ported to gcc-3.2.1 and Tcl-8.4.1 --------------- 27.02.02 released catlib-3.7.3 ----------------- * Fixed problem with temporary downloaded image files being deleted too soon. (Now they are only deleted after they are loaded, so that the OS can delete them later on.) --------------- 27.08.01 released catlib-3.7.2 ----------------- * Merged in minor changes from Peter Biereichel (added some #include files). --------------- 17.02.01 released catlib-3.7.1 ----------------- * Fixed a bug that occurred when a catalog config entry had a copyright field but no x,y or ra,dec columns defined. --------------- 20.09.00 released catlib-3.7 ----------------- * Added changes to support galactic and ecliptic coordinates (pass equinox as a string instead of a double, where the value may be a number (2000, 1950, ...) or a coordinate system name ("FK5, "GALACTIC", ...). --------------- 02.03.00 released catlib-3.6 ----------------- * TclAstroCat.C::queryCmd: now returns a TCL_ERROR if a table row does not contain a valid coordinate position when it should. The previous versions tried to continue, but the error message overwrote the result of the query (in the Tcl result). --------------- 25.10.99 released catlib-3.5 -------------------- * Merged in changes made by Peter Biereichel --------------- 09.09.99 released catlib-3.4.1 -------------------- * Updated for egcs/gcc-2.95. --------------- 22.07.99 released catlib-3.4 ---------------------- * TCS catalogs: fixed a bug dealing with TCS catalogs (error message was "empty TCS result"). The problem was caused by adding an extra parameter to the init() method in the base class (TabTable), but not in the derived class (TcsQueryResult), so that inheritance did not work as expected. * Fixed problem with catalog directory hierarchies. Previously, catalog names had to be unique in the entire catalog hierarchy. Now, the interface has been changed slightly to fix this. A catalog directory argument may now be either a name, as before, or a tcl list of catalog directories, forming a path to the catalog's parent directory. Also, catalogs are now searched for only in the given directory, not recursively down the tree. The "astrocat open" command now also takes an optional directory argument, so that you can open a catalog in a specific directory. The changes are all backward compatible, except for one: there is no more recursive search for catalogs in the tree. However, it is not likely that this feature was used. --------------- 21.06.99 released catlib-3.3.3 ---------------------- * TclAstroCat.C: allow empty RA and DEC columns in query results where ra_col and dec_col are defined (previously an error mesage was generated: "error in RA value, expected HH:MM:SS"). --------------- 22.03.99 released catlib-3.3.2 ---------------------- * Replaced itclsh2.2 with itclsh@ITCL_VERSION@ in Makefile.in. * Fixed a potential bug in the handling of local catalogs. "mmap" was being used to read the catalog file and the resulting string was not always null terminated. Now class LocalCatalog makes a null terminated copy and passes it to class TabTable, which reuses it instead of making a copy of it again. --------------- 28.12.98 released catlib-3.3.1 ---------------------- * Rebuild tclIndex file whenever configure is run, since Tcl8 version is not compatible with tcl7 version (see makelinks script). * TcsCatalog.h: fixed problem with hidden virtual methods reported by the sunpro CC compiler. --------------- 16.11.98 released catlib-3.3 ---------------------- * Ported to tcl8.0.3 (still compatible with tcl7.6/tk4.2/BLT2.1) - Updated namespace syntax and BLT graph handling * Local catalog files starting with "/tmp/" are no longer written to the ~/.skycat/skycat.cfg file. --------------- 30.9.98 released catlib-3.2.2 ---------------------- * Changed the release structure of the catlib package to include the necessary utility packages. Now the catlib tarfile also contains the astrotcl and tclutil packages. The top level Makefile and configure script automatically determine which packages to make. * Fixed a problem dealing with temporary image files and mmap (The fix in the previous version was not working). * Fixed minor bug in TclAstroCat.C::saveCmd() (when the headings argument is not specified). * Added a "History" menu item in the Data-Servers menu for displaying the new image history catalog. --------------- 23.9.98 released catlib-3.2.1 ---------------------- * Fixed minor bugs in test programs, updated docs, updated C interface, added comments indicating that the astroImage interface is obsolete and that the astroCatalog interfaces should be used instead. * Fixed a bug introduced in the previous version. The temp file for images from image servers was being reused instead of using a new file each time, which caused problems with the display that had the file mapped. * Changed the error handling for empty catalogs so that a catalog with no headings (and no dashed line after the heading) is not considerred an error, but just an empty catalog. --------------- 7.9.98 released catlib-3.2 ---------------------- * Fixed a bug dealing with catalog name servers (SIMBAD, NED) introduced in the previous version. * Removed default for limit on number of rows returned from a catalog query (%n in URL). * Merged the image server interfaces with the catalog interfaces. The AstroImage and TclAstroImage classes, and the astroimage Tcl command are still available for backward compatibility, but are now obsolete and should no longer be used. The AstroCatalog and TclAstroCat classes, and the astrocat Tcl command now handle image servers as well as catalogs. The "getimage" methods/subcommands are now part of the catalog classes. The merge was made to avoid duplicating large chunks of code, since there are many similarities in the two interfaces. * Now it is possible to generate image server windows with custom search labels and without the default search widgets (name, ra, dec, radius). This was previously only supported for catalogs. In both cases, if you don't want the default search widgets, add these lines to the config entry: ra_col: -1 dec_col: -1 x_col: -1 y_col: -1 For catalogs, this means that there are no searchable ra,dec or x,y columns. For image servers, it means that you can't search by these values, so they are not displayed. * Catalog config file: Allow search columns with only one value (previously only min and max values were allowed). This feature is enabled if the second label is missing in the "search_cols: " keyword in the catalog config file. For example, in an image server: search_cols: patch Patch will display a "Patch:" label and entry in the user interface. In the URL for the image server, "%cond" will then be replaced by "patch=22", if the user typed in 22. * Fixed the handling of the "maxRows" field for searching catalogs, so that, if it is left blank or zero, there is no limit (previous versions had a default limit). --------------- 5.8.98 released catlib-3.1.18 ---------------------- * AstroCatalog.C:getPreview() Added code to check the the HTTP Content-Encoding of image files (instead of only the Content-type), to help recognize compression types. * TclAstroCat.C, TclAstroImage.C: added "authorize" subcommands to set username and password for HTTP access after an HTTP server returns an "Authorization Required" error. This can be used together with the tclutil/PasswdDialog widget to ask for the username and password for an HTTP service. * AstroCat.tcl, AstroImage.tcl: added a check for a special authorization error message returned from an HTTP GET. A password dialog is displayed where the user can type in the username and password for the HTTP service (first time only). * AstroImage: added support for backup URLs for image servers (was previously only supported for catalogs). This is activated by using the "backup1" and "backup2" keywords in the catalog config file. * "Reload Config File" now works recursively and reloads the information in any remote catalog directories that were open. Previously, only the top level catalogs were reloaded. * Added the X11 library directory to shared lib path in startup script. * Fixed a bug in TabTable.C where the "id" column was still assumed to be always 0. Now the id column index is given as a parameter (taken from catalog config file). * Changed the way that rows are inserted into local catalogs. They were previously appended to the end of the file after removing duplicates. Now the original row position is kept and the row is updated if it already exists (same id) and appended otherwise. (Changed TabTable::insert()). * The catalog and image server windows were using up too many file descriptors (1 each for a log file and 2 each for an HTTP feedback pipe) and in one case, the log file was being opened, but not closed, so that you could eventually run out of fds. Now the pipe and log file are only opened as needed and closed again immediately. --------------- 07.07.98 released catlib-3.1.17 ---------------------- * AstroCat.tcl: Fixed minor debugging problem: propagate -debug flag to AstroQuery.tcl. * QueryResult.C: allow local catalog search without ra,dec columns * CatalogInfo.C: fixed handling of default column positions for ra and dec, to allow catalogs with no ra,dec or x,y columns. --------------- 26.6.98 released catlib-3.1.16 ---------------------- * TcsCatalogObject.h: removed unused method "isNull(int v)", to avoid error message from egcs-1.0.3 compiler about value being too large for int. * AstroCat.tcl, ProxyDialog.tcl: added a menu (under Options) and dialog window for setting a proxy server for HTTP catalog access from behind a firewall. --------------- 19.6.98 released catlib-3.1.15---------------------- * TclQueryUtil.C: Minor change in the way query coordinates are interpreted. If the RA value is an integer, it is assumed to be in hours (as before), but if it is a decimal number (3.2, for example), it is assumed to be in degrees. * AstroCat.tcl: fixed bug in the handling of the MORE URL (mostly used for HST catalogs). The "M=" part before the URL was not being recognized. --------------- 28.5.98 released catlib-3.1.14---------------------- * AstroCat.tcl: MORE and PREVIEW fields can now be commands. No special check is made for "http://" or "file://" as before. * AstroCatalog.C: added check for "SIMPLE" keyword in PREVIEW result, in case the PREVIEW URL is a command and there is no mime-type. * AstroCat.tcl: "Data-Servers/Local catalogs" menu: Added check for local catalogs, to see if the file exists. If not, you are asked if you want to specify a new name or remove the catalog from the menu. * TclAstroCat.C: Minor change in handling of equinox to default to "2000" for galactic or ecliptic coords. * AstroImage.tcl: added "Select Area..." button to AstroImage window to select the area of the image to fetch (as with the catalog window). --------------- 13.5.98 released catlib-3.1.13---------------------- * Added a "help" field to the catalog config file, which may optionally contain a URL pointing to information about the catalog. If the "help" URL is specified, a "Help" button appears in the user interface, which displays the URL in netscape (using the remote interface, if netscape is already running). Changes in AstroCat.tcl, AstroImage.tcl, TclAstroCatalog.[Ch], CatalogInfo.[Ch], TclAstroImage.[Ch]. * Fixed problem with "Preview" images that was caused by using the same temporary file to hold the image each time (now uses a new file each time and deletes the old one). --------------- 4.5.98 released catlib-3.1.12---------------------- * CatalogInfo.C: Fixed the "reload()" method ("Reload Config File") to remove "dead" catalog entries (entries that were removed from the config file since the last time it was read). --------------- 28.4.98 released catlib-3.1.11 --------------------- * Fixed minor bugs in AstroCat.tcl::get_table and get_equinox (was using wrong component name) * AstroCat (catalog window) layout: removed some padding to save space. --------------- 15.4.98 released catlib-3.1.10 --------------------- * (doc, *.tcl): For documenting the "public interface": Updated comments on all Itk component declarations and added "public", "private" and "protected" keywords in the source to help identify the public interface, which is documented in man pages generated from the source by the itcldoc utility (tclutil package). * AstroImage.tcl: Clear image before loading a new image (to avoid problems with decompression and temp files). * Minor changes in configure script and top level makefile for shared libraries * Fixed some bugs added in recent releases (printing query results, setting search columns). --------------- 25.03.98 released catlib-3.1.9 --------------------- * Updated man pages and documentation --------------- 25.03.98 released catlib-3.1.8 --------------------- * Removed declaration for strcasecmp in TabTable.C, since it reportedly conflicted with system definitions in dec alpha. * Added "clone" number to window headers, to help identify related windows when there is more than one main window. --------------- 05.03.98 released catlib-3.1.7 --------------------- * Added short help message for plot symbols * For backward compatibility: Removed dependence on the Tix package (now part of tclutil package). * For backward compatibility with applications using the cat library: The dependency on the astrotcl and tclutil packages is now hidden from applications. libcat.a (.so, .sl, etc.), now contains the astrotcl and tclutil object files, the $prefix/include/cat dir contains copies of the astrotcl and tclutil header files, and the Cat_Init() routine also initializes these packages as well as the Tix package, which is now also included in the tclutil package. --------------- 13.2.98 released catlib-3.1.6 --------------------- * Minor change: removed AstroCat::list_windows method, since no longer needed. --------------- 9.2.98 released catlib-3.1.5 --------------------- * Fixed minor problems with test programs --------------- 3.2.98 released catlib-3.1.4 --------------------- * Added a default mag range of (0..15) for gsc-server only, as a temporary special case until the gsc-server is modified to allow the magnitude to be empty, (i.e.: "mag=," instead of "mag=0,15"). gsc-server doesn't accept a negative mag value, so it doesn't help to set the default range to (-99..99) or some arbitrary range. --------------- 25.01.98 released catlib-3.1.3 --------------------- * Updated comments in Itcl sources for automatic generation of man pages. (There are now man pages for all Itcl classes). * Split the "top level" AstroCat class into different "frame" classes, by request. Now the AstroCat class is made up of an AstroQuery class (defines the panel with the search entries) and the QueryResult class (defines the table for displaying the query results). None of these classes knows about images. For image support, see the Skycat package, which contains classes that are derived from these and add image support. * Added additional plot symbols: arrow, line, compass, ellipse. These (and the "plus" symbol) are all rotated relative to world coordinate "north", if it is known. --------------- released catlib-3.1.2 --------------------------- * Fixed PreviewPlot class (used to plot HST preview data). (Was out of date after upgrade to BLT-2.1). * Split AstroCat class to remove dependence on Skycat. All image related operations, such as plotting objects on an image, are now done in a subclass in the Skycat package. * Catalog config entry: If ra_col, dec_col, x_col, and y_col are all set, then the catalog is assumed to have both ra,dec and x,y columns in the query output. In this case, allow searching by ra,dec, but plot the results using x,y (image coords). (Requested by awicenec@eso.org, for cases where WCS info is incorrect, but x,y coordinates are OK). * Compilied sources with the SunPRO C++ compiler and fixed problems that showed up there and not with gcc. * Reorganized sources: The catalog library is no longer dependent on the RTD package. It is now dependent on two new packages: The Tclutil package was created by gathering "generic" Tcl and C++ code from various applications into a single generic Tcl package. The Astrotcl package was created by gathering general astronomy related Tcl and C++ code from other packages into a single, reusable package. If you were previously loading the Cat and Rtd packages dynamically, you will need to add "package require" statements for the Tclutil and Astrotcl packages, and remove the reference to Rtd, if you don't need Rtd image support. If you were linking the packages statically, you will need to add calls to Tclutil_Init and Astrotcl_Init in tkAppInit.C, and remove the call to Rtd_Init, if you don't need the Rtd image features. If you were using the catalog C++ classes directly, you will need to add some -I compiler options to your Makefiles: (-I$(INSTALLDIR)/astrotcl -I$(INSTALLDIR)/tclutil). The C interface is not affected by this. * The Itcl catalog widgets (AstroCat, AstroImage, etc.) are now a part of the cat package (They were previously part of the skycat package). --------------- 3 Nov 97 released catlib-3.0 ---------------------- * Added support for catalog directories via the new keyword "directory" in the catalog config file. An entry with "serv_type" equal to "directory" should have in the "url" field a URL pointing to another catalog config file. The catalog list is stored as a hierarchical list of catalog entries. New methods and Tcl subcommands have been added to navigate the hierarchy. * Added support for specifying search and sort columns, sort order, column display order, columns to hide or show (see below). * Config file: added new keywords: is_tcs: boolean value indicates whether catalog is a TCS catalog search_cols: list of columns that can be searched sort_cols: list of columns to sort by sort_order: "increasing" or "decreasing" - tells how to sort. show_cols: list of columns to display (default all). Indicates the order of the columns and which ones to show or hide. * Config File: extended the meaning of the "symbol" entry to include information about the color, shape, angle, size and units of plot symbols. New syntax: symbol: colnames symbol sizeexpr : colnames symbol sizeexpr : ... where colnames - is a list of column names used as variables in the entry symbol - is the symbol to use, one of: square, circle, triangle, cross, plus, diamond, elipse. The symbol may also be a list such as {circle yellow} and some symbols take extra args for ratio and angle (elipse, plus), which may be expressions using column names as variables. sizeexpr - is an expression in terms of colnames above, used to determine the size of the symbol. It may also be a list {expr units}, where units is one of {image "deg J2000" "deg B1950"} (default: image, for image pixel coords, see RTD doc for coordinate syntax). The column names can be used as variables in the expression using "$" (following Tcl syntax). examples: symbol: mag circle 15-$mag : xyz square (1-$xyz)*2.5 symbol: {a/b pa mag} {ellipse yellow ${a/b} $pa} {15-$mag} symbol: "a/b pa mag" "ellipse yellow ${a/b} $pa" "15-$mag" * Tcl interface: added new astrocat Tcl subcommands: $cat entry get ?name? ?directory? $cat entry update $info ?name? ?directory? $cat entry add $info ?directory? $cat entry remove $name The entry subcommand can be used to navigate and edit the catalog config information. $cat reload Reload the catalog config file. Use this if the config file was edited and you want to access the new info. $cat sortcols $cat sortorder $cat showcols $cat searchcols Get or set the values of these new keywords in the catalog config file. $cat root Returns the name of the root catalog directory. * Tcl interface: Added options to astrocat Tcl subcommand to support catalog directories. New usage: $cat info $serv_type ?$directory? * C++ interface: - class CatalogInfo: added methods for dealing with catalog directories appending, updating, removing entries, reloading the config file. The file ~/.skycat/skycat.cfg is no longer referenced in this lib (skycat does a "setenv CATLIB_CONFIG ~/.skycat/skycat.cfg" on startup). $SKYCAT_CONFIG is still supported, but $CATLIB_CONFIG is preferred. - class CatalogInfoEntry: added new members for new catalog config keywords, added a "link" member for directory entries, added append() method. - TcsCatalog classes: added code to handle the new ra_col and dec_col changes. * catalog URLs (entries in the config file) may now be local commands as well as file:/ and http:/ entries. If the URL starts with a / and is the name of a local file AND the config file is also local the command will be executed with the given arguments and the result should be a standard query result in tab table format. Substitution is performed on the arguments in the same way as for the http:/ and file:/ entries (%ra for ra, etc...). * Added code to support catalogs in either World coordinates or image coordinates (previously only World Coordinates were supported). A catalog is considerred to be in World Coords by default unless the keywords "x_col" and "y_col" are used (see below). * The catalog library now allows catalogs with varying column order. Previously catalogs were required to have the first 3 columns "id", "ra", and "dec". This is now the default behaviour, but may be overridden with the keywords: "id_col", "ra_col", and "dec_col" in the catalog config file or the header of the search results or local catalog. For example: serv_type: catalog long_name: My test catalog server ... id_col: 6 ra_col: 0 dec_col: 1 Or if the catalog is using image coords instead of World coords: id_col: 6 x_col: 0 y_col: 1 * Catalog config information is now read from query results as well as from the catalog config file and local catalog headers. --------------- 24 April 97 released catlib-2.9 ---------------------- * AstroCatalog: The methods getObject and searchClosestStar (and the C versions acGetObject and acSearchClosestStar) no longer return an error if the object is not found (requested by mcomin). Updated the man pages to state this. *** NOTE: This is a change in behavior from the previous versions *** * Minor changes to man pages to make args and return values more clear. * class AstroCatalog: added "%cond" to the list of variables that are substituted in the catalog config file URLs. This is needed in order to implement the "CatalogSearch()" method, which specifies a list of columns and min and max values to search for. %cond - insert search condition, if any, in the format col1:minVal:maxVal,col2:minVal:maxVal,... Note that there are not yet any catalog servers that use this field, so that the CatalogSearch() method will still not work, but this should change when the servers support this type of search. --------------- 22 April 97 released catlib-2.8 ---------------------- * More minor changes in the configure scripts and makefiles for dealing with shared libraries on HP. * allow mag to be negative (was previously not allowed) in catalog searches. * added this text to the man pages AstroCatalog.man3 (C++ version) and astroCatalog.man3 (C version) QUERY PARAMETERS Parameters for catalog searches are checked to make sure they are valid and in the correct range. A radius value must be between 0.0 and 300.0 arcmin. A magnitude may have any value. For ranges, such as min and max radius and min and max magnitude, the order of the arguments is not important, since they will be rearranged as needed. If both min and max values are 0.0, they are ignored for that search. * made minor changes to the INSTALL file and installation section of the frame docs. --------------- 11 Apr 97 released catlib-2.7 --------------------- * added support for shared libraries and loadable Tcl modules use: configure --enable-shared to create the shared library (libcat.so or libcat.sl). * changed the name of the Tcl init routine for the cat lib from TclAstroCat_Init to Cat_init, to comply with the standards for loadable modules in the new Tcl version (The old version is still supported for backward compat.) * changed the configure script and Makefiles to get information from the rtdConfig.sh script installed by Rtd and produce a catConfig.sh with more information, that can be used by other applications. (Rtd gets the info from tclConfig.sh, tkconfig.sh, etc...). * fixed bug in local catalog search when there is no "mag" column. Now the mag range is ignored if there is no mag column. --------------- 10 Feb 97 released catlib-2.6 --------------------- * fixed bug in local catalog search method (TabTable::search) * added error message for case where you search by ID, but the catalog URL doesn't support it, and when you search by RA,DEC and the URL doesn't support that. Note that the GSC now does support search by object ID, but the default catalog config file (http://archive.eso.org/skycat/skycat.cfg) doesn't include support for it yet, since it would break earlier skycat releases. You can fetch the above URL (with netscape) and look for the GSC entry, which has an alternative URL for GSC commented out. You can put the file in your ~/.skycat directory (named skycat.cfg) or set the environment variable SKYCAT_CONFIG or CATLIB_CONFIG to a URL pointing to the file (file:... or http:...). A future version of skycat will allow the user to build up a private catalog config file interactively. --------------- 30 Jan 97 released catlib-2.5 --------------------- * Added support for backup catalog servers and local catalog config files. The config file has 2 new keywords: "backup1" and "backup2". These are used if there is an error accessing the "url" field for the catalog. * Made changes to the handling of local catalogs to try to improve the performance. Local catalogs are kept entirely in memory now. --------------- 21 Nov 96 released catlib-2.4 --------------------- * Made configure scripts and sources Linux compatible. Thanks to Sidik Isani for supplying the patches for this. * (Catlib) It is now possible to search GSC by Id. --------------- 8 Nov 96 released as catlib-2.3, part of skycat 1.0.1 * Added copyright field to catalog config file and the CatalogInfo class. --------------- 7 Nov 96 released as catlib-2.2, part of skycat 1.0 * Fixed bug in impl. of AstroImage::getArea (where you specify 2 positions and want to get the objects in the box). Now the 2 positions are translated into a center position and radius (since none of the catalog server URLs currently have a place for 2 positions...). To do this, addded a method "WorldCoords::center()" to get the center pos and radius from 2 positions. * Fixed bug when saving local catalogs for images that are not J2000. (The catalog was saved as B1950, for example and later treated as J2000 when loaded). Now all local catalogs are saved (the ra,dec columns) in equinox J2000 and are expected to be in J2000 when opened. For this, an extra argument was added to some astrocat tcl subcommands: the "save" and "remove" commands now take an "equinox" optional argument that defaults to 2000. * Local catalogs: class QueryResult/TcsQueryResult: The catalog config file entry info is now written to local catalog headers. This is needed so you can determine what plot symbols and columns to use in skycat. The syntax is the same as in the catalog config file and the entry is used if it is found. * added rcs keywords as static constants to source files (for Giorgio). --------------- 1 Oct 96 released as catlib-2.0, part of skycat 1.0b12 --------------- 20 Sep 96 released as catlib-2.0b1, part of skycat 1.0b11 * the environment variable CATLIB_CONFIG is accepted instead of SKYCAT_CONFIG (they both have the same meaning: a URL pointing to the catalog config file with the default list of catalogs and their descriptions. * split the "./cat" directory into "./cat" (catalog libraries only) and "./skycat" (skycat application, interpreted and single binary versions), by request. Note that the catalog libraries still depend on two rtd libraries: libwcs.a (rtdwcs) and libutl.a (rtdutl). These are general purpose libraries for handling world coordinates and shared memory, etc. ---------------- 14 Aug 96 released as part of skycat-1.0b10 ------------------ * added bounds checking in catalog classes (catalog query), now enforces: 0 <= ra < 24 -90 <= dec <= 90 mag (no check, order so that min $@.result 2>&1 ;\ if cmp $@.result $(srcdir)/tests/$@.ok ;\ then echo "$@: PASSED" ; \ else echo "*** $@: TEST FAILED: see $@.result" ; \ fi rm test.table ctests: $(C_TEST_APPS) # The C interface tests need a C++ main, since the library contains C++ $(C_TEST_APPS): main.o FORCE $(COMPILE) -o $@ main.o $(srcdir)/tests/$@.c $(TEST_LIBS) $(LIBS) cp $(srcdir)/tests/test.table . -@@LD_LIBRARY_PATH_VAR@=@exec_prefix@/lib; export @LD_LIBRARY_PATH_VAR@ ;\ $@ > $@.result 2>&1 ;\ if cmp $@.result $(srcdir)/tests/$@.ok ;\ then echo "$@: PASSED" ; \ else echo "*** $@: TEST FAILED: see $@.result" ; \ fi rm test.table #======================================================================== # Run Tcl test cases #======================================================================== #tcltest: binaries libraries # (cd tests; sh all.tcl) FORCE: skycat-3.1.2-starlink-1b/cat/README000066400000000000000000000020131215713201500165600ustar00rootroot00000000000000 CAT, A Library for Accessing Astronomical Catalogs in C++, C and Tcl --------------------------------------------------------------------- This directory contains the source code for a set of libraries for accessing astronomical catalogs locally and over the network. The core is written in C++. In addition, Tcl and "plain" C interfaces are supported. For installation instructions, see the file INSTALL in the parent directory. See the CHANGES file in this directory for a list of recent changes. The following URLs may also be of interest: Skycat home page: http://archive.eso.org/skycat/ Sources and binaries: ftp://ftp.eso.org/pub/archive/skycat/README.html Postscript, PDF, and FrameMaker Documentation: ftp://ftp.eso.org/pub/archive/skycat/doc HTML Docs: http://archive.eso.org/skycat/docs/skycat-man.html -------------------------------------- Contacts: Allan Brighton (abrighto@eso.org) Peter Biereichel (pbiereic@eso.org) ESO - European Southern Observatory -------------------------------------- skycat-3.1.2-starlink-1b/cat/VERSION000066400000000000000000000000151215713201500167500ustar00rootroot00000000000000catlib-4.1.0 skycat-3.1.2-starlink-1b/cat/aclocal.m4000066400000000000000000000072041215713201500175470ustar00rootroot00000000000000builtin(include,../tclconfig/tcl.m4) AC_DEFUN(CAT_CONFIG, [ # Load the Tclutil definitions cf=../tclutil/tclutilConfig.sh if test -f $cf ; then . $cf AC_SUBST(tclutil_VERSION) AC_SUBST(tclutil_LIB_FILE) AC_SUBST(tclutil_BUILD_LIB_SPEC) AC_SUBST(tclutil_BUILD_DIR) AC_SUBST(tclutil_LIB_SPEC) AC_SUBST(BLT_LIB_SPEC) AC_SUBST(tclutil_SRC_DIR) AC_SUBST(tclutil_PKG_OBJECTS) AC_SUBST(CFITSIO_LIB_SPEC) else AC_MSG_ERROR([$cf doesn't exist]) fi # Load the Astrotcl definitions cf=../astrotcl/astrotclConfig.sh if test -f $cf ; then . $cf AC_SUBST(astrotcl_VERSION) AC_SUBST(astrotcl_LIB_FILE) AC_SUBST(astrotcl_BUILD_LIB_SPEC) AC_SUBST(astrotcl_BUILD_DIR) AC_SUBST(astrotcl_LIB_SPEC) AC_SUBST(astrotcl_SRC_DIR) AC_SUBST(astrotcl_PKG_OBJECTS) else AC_MSG_ERROR([$cf doesn't exist]) fi # ----------------------------------------------------------------------- # Optionally merge object and header files from dependent packages to make one master lib # ----------------------------------------------------------------------- MERGED=1 AC_ARG_ENABLE(merge, [AC_HELP_STRING([--enable-merge],[merge the contents of dependent packages into a master catalog library])], [MERGED=$enableval], [MERGED=no]) changequote(<<, >>) csources=`cd $srcdir; echo generic/*.[Cc]` changequote([, ]) cat_headers=`cd $srcdir; echo generic/*.h` astrotcl_headers=`cd $srcdir; echo ../astrotcl/{generic,press,libwcs,cfitsio}/*.h` tclutil_headers=`cd $srcdir; echo ../tclutil/generic/*.h` cat_includes="-I$srcdir/generic -I$srcdir/bitmaps" astrotcl_includes="-I$srcdir/../astrotcl/generic -I$srcdir/../astrotcl/cfitsio -I$srcdir/../astrotcl/libwcs" tclutil_includes="-I$srcdir/../tclutil/generic" cincludes="${cat_includes} ${astrotcl_includes} ${tclutil_includes}" tclsources=`cd $srcdir; echo library/*.tcl library/*.xpm` if test $MERGED = yes ; then echo "Will build merged master catalog library" cheaders="${cat_headers} ${astrotcl_headers} ${tclutil_headers}" MERGE_OBJECTS="$astrotcl_PKG_OBJECTS $tclutil_PKG_OBJECTS" dnl AC_DEFINE(MERGE_OBJECTS, 1, [merge the contents of dependent packages into a master catalog library]) else echo "Not making a merged master catalog library" cheaders="${cat_headers}" MERGE_OBJECTS="" fi AC_SUBST(MERGE_OBJECTS) # ----------------------------------------------------------------------- AC_DEFINE(USE_COMPAT_CONST, 1, [For compatibility between tcl8.4 and previous tcl releases]) #------------------------------------------------------------------------ # Check if we require additional libraries to support C++ shareable # libraries. system=`uname -s`-`uname -r` SHLIB_LD_CXX_LIBS="" export SHLIB_LD_CXX_LIBS case $system in SunOS-5*) SHLIB_LD_CXX_LIBS="-lCrun -lCstd" ;; OSF*) SHLIB_LD_CXX_LIBS="-lcxx -lcxxstd" ;; esac AC_SUBST(SHLIB_LD_CXX_LIBS) #------------------------------------------------------------------------- # The cxx C++ compiler under Tru64 UNIX needs the special # CXXFLAGS "-std gnu -D__USE_STD_IOSTREAM=1". These allow the standard # library streams headers to work and to generate templates that do # not require special handling throughout skycat directories (normally # template object files are created in various cxx_repository subdirectories, # this way the object files are kept embedded the usual object files, see # the cxx man page for details). #------------------------------------------------------------------------- export CXXFLAGS case $system in OSF*) case "x$CXX" in xcxx*) CXXFLAGS="$CXXFLAGS -g3 -std gnu -D__USE_STD_IOSTREAM=1" ;; esac ;; esac ]) skycat-3.1.2-starlink-1b/cat/bitmaps/000077500000000000000000000000001215713201500173435ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/cat/bitmaps/bitmaps.tcl000066400000000000000000000017201215713201500215060ustar00rootroot00000000000000#!../bin/rtdimage_wish # # E.S.O. - VLT project/ ESO Archive # # "@(#) $Id: bitmaps.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # script to generate C code declaring X bitmaps so that the (binary) application # doesn't have to be delivered with the bitmap files. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 21 Nov 95 Created puts { /* * E.S.O. - VLT project / ESO Archive * "@(#) $Id: bitmaps.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Tk Bitmap/Pixmap definitions * * This file was generated by ../bitmaps/bitmaps.tcl - DO NO EDIT */ #include #include } puts "void defineCatBitmaps(Tcl_Interp *interp) {" foreach file [glob -nocomplain *.xbm] { set name [file rootname $file] puts " #include \"$file\"" puts " Tk_DefineBitmap(interp, Tk_GetUid(\"$name\"), (char*)${name}_bits, ${name}_width, ${name}_height);\n" } puts "}" exit 0 skycat-3.1.2-starlink-1b/cat/bitmaps/symb_arrow.xbm000066400000000000000000000004561215713201500222440ustar00rootroot00000000000000#define symb_arrow_width 16 #define symb_arrow_height 16 static unsigned char symb_arrow_bits[] = { 0x00, 0x01, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/cat/bitmaps/symb_circle.xbm000066400000000000000000000004501215713201500223450ustar00rootroot00000000000000#define symb_circle_width 16 #define symb_circle_height 16 static char symb_circle_bits[] = { 0xe0, 0x07, 0x18, 0x18, 0x04, 0x20, 0x02, 0x40, 0x02, 0x40, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x02, 0x40, 0x02, 0x40, 0x04, 0x20, 0x18, 0x18, 0xe0, 0x07}; skycat-3.1.2-starlink-1b/cat/bitmaps/symb_compass.xbm000066400000000000000000000004641215713201500225560ustar00rootroot00000000000000#define symb_compass_width 16 #define symb_compass_height 16 static unsigned char symb_compass_bits[] = { 0x00, 0x00, 0x00, 0x01, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xfe, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/cat/bitmaps/symb_cross.xbm000066400000000000000000000004561215713201500222430ustar00rootroot00000000000000#define symb_cross_width 16 #define symb_cross_height 16 static unsigned char symb_cross_bits[] = { 0x01, 0x80, 0x02, 0x40, 0x04, 0x20, 0x08, 0x10, 0x10, 0x08, 0x20, 0x04, 0x40, 0x02, 0x80, 0x01, 0x80, 0x01, 0x40, 0x02, 0x20, 0x04, 0x10, 0x08, 0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x01, 0x80}; skycat-3.1.2-starlink-1b/cat/bitmaps/symb_diamond.xbm000066400000000000000000000004641215713201500225240ustar00rootroot00000000000000#define symb_diamond_width 16 #define symb_diamond_height 16 static unsigned char symb_diamond_bits[] = { 0x80, 0x01, 0x40, 0x02, 0x20, 0x04, 0x10, 0x08, 0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x01, 0x80, 0x01, 0x80, 0x02, 0x40, 0x04, 0x20, 0x08, 0x10, 0x10, 0x08, 0x20, 0x04, 0x40, 0x02, 0x80, 0x01}; skycat-3.1.2-starlink-1b/cat/bitmaps/symb_ellipse.xbm000066400000000000000000000004641215713201500225460ustar00rootroot00000000000000#define symb_ellipse_width 16 #define symb_ellipse_height 16 static unsigned char symb_ellipse_bits[] = { 0x00, 0x00, 0x00, 0x0e, 0x80, 0x11, 0x40, 0x20, 0x20, 0x40, 0x10, 0x40, 0x08, 0x40, 0x08, 0x40, 0x04, 0x20, 0x02, 0x20, 0x02, 0x10, 0x01, 0x08, 0x01, 0x04, 0x02, 0x02, 0x84, 0x01, 0x78, 0x00}; skycat-3.1.2-starlink-1b/cat/bitmaps/symb_line.xbm000066400000000000000000000004531215713201500220360ustar00rootroot00000000000000#define symb_line_width 16 #define symb_line_height 16 static unsigned char symb_line_bits[] = { 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01}; skycat-3.1.2-starlink-1b/cat/bitmaps/symb_plus.xbm000066400000000000000000000004531215713201500220720ustar00rootroot00000000000000#define symb_plus_width 16 #define symb_plus_height 16 static unsigned char symb_plus_bits[] = { 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0xff, 0xff, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01}; skycat-3.1.2-starlink-1b/cat/bitmaps/symb_square.xbm000066400000000000000000000004501215713201500224040ustar00rootroot00000000000000#define symb_square_width 16 #define symb_square_height 16 static char symb_square_bits[] = { 0xff, 0xff, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xff, 0xff}; skycat-3.1.2-starlink-1b/cat/bitmaps/symb_triangle.xbm000066400000000000000000000004671215713201500227210ustar00rootroot00000000000000#define symb_triangle_width 16 #define symb_triangle_height 16 static unsigned char symb_triangle_bits[] = { 0x80, 0x01, 0x80, 0x01, 0x40, 0x02, 0x40, 0x02, 0x20, 0x04, 0x20, 0x04, 0x10, 0x08, 0x10, 0x08, 0x08, 0x10, 0x08, 0x10, 0x04, 0x20, 0x04, 0x20, 0x02, 0x40, 0x02, 0x40, 0x01, 0x80, 0xff, 0xff}; skycat-3.1.2-starlink-1b/cat/catConfig.sh.in000066400000000000000000000031501215713201500205410ustar00rootroot00000000000000# E.S.O. - VLT project # $Id: catConfig.sh.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # catConfig.sh -- # # This shell script (for sh) is generated automatically by Cat's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. # This script is intended to be included by the configure scripts # for Cat extensions so that they don't have to figure this all # out for themselves. This file does not duplicate information # already provided by tclConfig.sh, so you may need to use that # file in addition to this one. # # The information in this file is specific to a single platform. # Cat's version number. cat_VERSION='@PACKAGE_VERSION@' # The name of the Cat library: cat_LIB_FILE=@cat_LIB_FILE@ # String to pass to linker to pick up the Cat library from its # build directory. cat_BUILD_LIB_SPEC='@cat_BUILD_LIB_SPEC@' # Cat build directory. cat_BUILD_DIR='@cat_BUILD_DIR@' # String to pass to linker to pick up the Cat library from its # installed directory. cat_LIB_SPEC='@cat_LIB_SPEC@' # Location of the top-level source directories from which Cat # was built. This is the directory that contains generic, unix, etc. # If Cat was compiled in a different place than the directory # containing the source files, this points to the location of the sources, # not the location where Cat was compiled. cat_SRC_DIR='@cat_SRC_DIR@' # List of object files used to build the library (for merging packages). cat_PKG_OBJECTS='@cat_PKG_OBJECTS@' # List of header filesinstalled for this library (for merging packages). cat_PKG_HEADERS='@cat_PKG_HEADERS@' skycat-3.1.2-starlink-1b/cat/cat_version.tcl.in000066400000000000000000000001511215713201500213260ustar00rootroot00000000000000# This file is generated by configure: DO NOT EDIT BY HAND proc cat_version {} { return @CAT_VERSION@ } skycat-3.1.2-starlink-1b/cat/configure000077500000000000000000013161551215713201500176270ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Starlink Autoconf 2.59 for cat 4.1.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='cat' PACKAGE_TARNAME='cat' PACKAGE_VERSION='4.1.0' PACKAGE_STRING='cat 4.1.0' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_LIBS TK_XINCLUDES CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP CXX CXXFLAGS ac_ct_CXX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS tclutil_VERSION tclutil_LIB_FILE tclutil_BUILD_LIB_SPEC tclutil_BUILD_DIR tclutil_LIB_SPEC BLT_LIB_SPEC tclutil_SRC_DIR tclutil_PKG_OBJECTS CFITSIO_LIB_SPEC astrotcl_VERSION astrotcl_LIB_FILE astrotcl_BUILD_LIB_SPEC astrotcl_BUILD_DIR astrotcl_LIB_SPEC astrotcl_SRC_DIR astrotcl_PKG_OBJECTS MERGE_OBJECTS SHLIB_LD_CXX_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TK_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS SHLIB_SUFFIX DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_CFLAGS SHLIB_LD_LIBS LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG WISH_PROG cat_LIB_FILE cat_BUILD_LIB_SPEC cat_BUILD_DIR cat_LIB_SPEC cat_PKG_OBJECTS cat_SRC_DIR LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures cat 4.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of cat 4.1.0:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-merge merge the contents of dependent packages into a master catalog library --enable-threads build with threads --enable-shared build and link with shared libraries --enable-shared --enable-64bit enable 64bit support (where applicable) --enable-64bit-vis enable 64bit Sparc VIS support --enable-wince enable Win/CE support (where applicable) --disable-load disallow dynamic loading and "load" command --enable-symbols build with debugging symbols --disable-symbols Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) --with-tclinclude directory containing the public Tcl header files --with-tkinclude directory containing the public Tk header files. --with-x use the X Window System --with-celib=DIR use Windows/CE support library from DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF cat configure 4.1.0 generated by Starlink Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by cat $as_me 4.1.0, which was generated by Starlink Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.4" echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 if test x"${PACKAGE_NAME}" = x ; then { { echo "$as_me:$LINENO: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 echo "$as_me: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} { (exit 1); exit 1; }; } fi if test x"3.4" = x ; then { { echo "$as_me:$LINENO: error: TEA version not specified." >&5 echo "$as_me: error: TEA version not specified." >&2;} { (exit 1); exit 1; }; } elif test "3.4" != "${TEA_VERSION}" ; then echo "$as_me:$LINENO: result: warning: requested TEA version \"3.4\", have \"${TEA_VERSION}\"" >&5 echo "${ECHO_T}warning: requested TEA version \"3.4\", have \"${TEA_VERSION}\"" >&6 else echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CYGPATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -w" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then echo "$as_me:$LINENO: result: $CYGPATH" >&5 echo "${ECHO_T}$CYGPATH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi # This package name must be replaced statically for AC_SUBST to work # Substitute STUB_LIB_FILE in case package creates a stub library too. # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" with_tclconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tcl configuration" >&5 echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 if test "${ac_cv_c_tclconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d ${TCLTK_ROOT}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" { echo "$as_me:$LINENO: WARNING: \"Cannot find Tcl configuration definitions\"" >&5 echo "$as_me: WARNING: \"Cannot find Tcl configuration definitions\"" >&2;} exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6 fi fi echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . $TCL_BIN_DIR/tclConfig.sh else echo "$as_me:$LINENO: result: file not found" >&5 echo "${ECHO_T}file not found" >&6 fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" #AC_SUBST(TCL_BUILD_LIB_SPEC) #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true # Check whether --with-tk or --without-tk was given. if test "${with_tk+set}" = set; then withval="$with_tk" with_tkconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tk configuration" >&5 echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6 if test "${ac_cv_c_tkconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case ${with_tkconfig} in */tkConfig.sh ) if test -f ${with_tkconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;} with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5 echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d ${TCLTK_ROOT}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" { echo "$as_me:$LINENO: WARNING: \"Cannot find Tk configuration definitions\"" >&5 echo "$as_me: WARNING: \"Cannot find Tk configuration definitions\"" >&2;} exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} echo "$as_me:$LINENO: result: found $TK_BIN_DIR/tkConfig.sh" >&5 echo "${ECHO_T}found $TK_BIN_DIR/tkConfig.sh" >&6 fi fi echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6 if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . $TK_BIN_DIR/tkConfig.sh else echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6 fi # # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TK_BIN_DIR/Makefile ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} fi # Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) cat >>confdefs.h <<\_ACEOF #define MAC_OSX_TK 1 _ACEOF TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi # # eval is required to do the TK_DBGX substitution # eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} prefix=${TCL_PREFIX} else { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 echo "$as_me: --prefix defaulting to /usr/local" >&6;} prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then #if test x"${TCL_EXEC_PREFIX}" != x; then #AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) #exec_prefix=${TCL_EXEC_PREFIX} #else { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} exec_prefix=$prefix #fi fi #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_cv_c_compiler_gnu = yes; then GCC=yes fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 OLDCC="$CC" CC="$CC -pipe" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC="$OLDCC" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi #-------------------------------------------------------------------- # Pick up flags from the environment (user). #-------------------------------------------------------------------- CC="${CC} $CFLAGS" CXX="${CXX} $CXXFLAGS $CFLAGS" #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac if test "${TEA_PLATFORM}" = "unix" ; then #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for sin" >&5 echo $ECHO_N "checking for sin... $ECHO_C" >&6 if test "${ac_cv_func_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sin to an innocuous variant, in case declares sin. For example, HP-UX 11i declares gettimeofday. */ #define sin innocuous_sin /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sin /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sin (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_sin) || defined (__stub___sin) choke me #else char (*f) () = sin; #endif #ifdef __cplusplus } #endif int main () { return f != sin; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sin=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sin=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 echo "${ECHO_T}$ac_cv_func_sin" >&6 if test $ac_cv_func_sin = yes; then MATH_LIBS="" else MATH_LIBS="-lm" fi echo "$as_me:$LINENO: checking for main in -lieee" >&5 echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 if test "${ac_cv_lib_ieee_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ieee_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 if test $ac_cv_lib_ieee_main = yes; then MATH_LIBS="-lieee $MATH_LIBS" fi #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for main in -linet" >&5 echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_inet_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 if test $ac_cv_lib_inet_main = yes; then LIBS="$LIBS -linet" fi if test "${ac_cv_header_net_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking net/errno.h usability" >&5 echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking net/errno.h presence" >&5 echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_net_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 fi if test $ac_cv_header_net_errno_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_ERRNO_H 1 _ACEOF fi #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_connect) || defined (__stub___connect) choke me #else char (*f) () = connect; #endif #ifdef __cplusplus } #endif int main () { return f != connect; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = yes; then tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then echo "$as_me:$LINENO: checking for setsockopt" >&5 echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 if test "${ac_cv_func_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define setsockopt to an innocuous variant, in case declares setsockopt. For example, HP-UX 11i declares gettimeofday. */ #define setsockopt innocuous_setsockopt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setsockopt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef setsockopt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_setsockopt) || defined (__stub___setsockopt) choke me #else char (*f) () = setsockopt; #endif #ifdef __cplusplus } #endif int main () { return f != setsockopt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 if test $ac_cv_func_setsockopt = yes; then : else echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); int main () { setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 if test $ac_cv_lib_socket_setsockopt = yes; then LIBS="$LIBS -lsocket" else tcl_checkBoth=1 fi fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo "$as_me:$LINENO: checking for accept" >&5 echo $ECHO_N "checking for accept... $ECHO_C" >&6 if test "${ac_cv_func_accept+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define accept to an innocuous variant, in case declares accept. For example, HP-UX 11i declares gettimeofday. */ #define accept innocuous_accept /* System header to define __stub macros and hopefully few prototypes, which can conflict with char accept (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef accept /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char accept (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_accept) || defined (__stub___accept) choke me #else char (*f) () = accept; #endif #ifdef __cplusplus } #endif int main () { return f != accept; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_accept=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_accept=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 echo "${ECHO_T}$ac_cv_func_accept" >&6 if test $ac_cv_func_accept = yes; then tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) choke me #else char (*f) () = gethostbyname; #endif #ifdef __cplusplus } #endif int main () { return f != gethostbyname; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = yes; then : else echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then LIBS="$LIBS -lnsl" fi fi # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' echo "$as_me:$LINENO: checking dirent.h" >&5 echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 if test "${tcl_cv_dirent_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_dirent_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_dirent_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test $tcl_cv_dirent_h = no; then cat >>confdefs.h <<\_ACEOF #define NO_DIRENT_H 1 _ACEOF fi echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking errno.h usability" >&5 echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking errno.h presence" >&5 echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 fi if test $ac_cv_header_errno_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_ERRNO_H 1 _ACEOF fi if test "${ac_cv_header_float_h+set}" = set; then echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking float.h usability" >&5 echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking float.h presence" >&5 echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_float_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 fi if test $ac_cv_header_float_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_FLOAT_H 1 _ACEOF fi if test "${ac_cv_header_values_h+set}" = set; then echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking values.h usability" >&5 echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking values.h presence" >&5 echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_values_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 fi if test $ac_cv_header_values_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_VALUES_H 1 _ACEOF fi if test "${ac_cv_header_limits_h+set}" = set; then echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking limits.h usability" >&5 echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking limits.h presence" >&5 echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_limits_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 fi if test $ac_cv_header_limits_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIMITS_H 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define NO_LIMITS_H 1 _ACEOF fi if test "${ac_cv_header_stdlib_h+set}" = set; then echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking stdlib.h usability" >&5 echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking stdlib.h presence" >&5 echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stdlib_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 fi if test $ac_cv_header_stdlib_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtol" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtoul" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtod" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STDLIB_H 1 _ACEOF fi if test "${ac_cv_header_string_h+set}" = set; then echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking string.h usability" >&5 echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking string.h presence" >&5 echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_string_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 fi if test $ac_cv_header_string_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strstr" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STRING_H 1 _ACEOF fi if test "${ac_cv_header_sys_wait_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_wait_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 fi if test $ac_cv_header_sys_wait_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_SYS_WAIT_H 1 _ACEOF fi if test "${ac_cv_header_dlfcn_h+set}" = set; then echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 fi if test $ac_cv_header_dlfcn_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_DLFCN_H 1 _ACEOF fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). for ac_header in sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi #-------------------------------------------------------------------- # Do application specific checks (see aclocal.m4) #-------------------------------------------------------------------- # Load the Tclutil definitions cf=../tclutil/tclutilConfig.sh if test -f $cf ; then . $cf else { { echo "$as_me:$LINENO: error: $cf doesn't exist" >&5 echo "$as_me: error: $cf doesn't exist" >&2;} { (exit 1); exit 1; }; } fi # Load the Astrotcl definitions cf=../astrotcl/astrotclConfig.sh if test -f $cf ; then . $cf else { { echo "$as_me:$LINENO: error: $cf doesn't exist" >&5 echo "$as_me: error: $cf doesn't exist" >&2;} { (exit 1); exit 1; }; } fi # ----------------------------------------------------------------------- # Optionally merge object and header files from dependent packages to make one master lib # ----------------------------------------------------------------------- MERGED=1 # Check whether --enable-merge or --disable-merge was given. if test "${enable_merge+set}" = set; then enableval="$enable_merge" MERGED=$enableval else MERGED=no fi; csources=`cd $srcdir; echo generic/*.[Cc]` cat_headers=`cd $srcdir; echo generic/*.h` astrotcl_headers=`cd $srcdir; echo ../astrotcl/{generic,press,libwcs,cfitsio}/*.h` tclutil_headers=`cd $srcdir; echo ../tclutil/generic/*.h` cat_includes="-I$srcdir/generic -I$srcdir/bitmaps" astrotcl_includes="-I$srcdir/../astrotcl/generic -I$srcdir/../astrotcl/cfitsio -I$srcdir/../astrotcl/libwcs" tclutil_includes="-I$srcdir/../tclutil/generic" cincludes="${cat_includes} ${astrotcl_includes} ${tclutil_includes}" tclsources=`cd $srcdir; echo library/*.tcl library/*.xpm` if test $MERGED = yes ; then echo "Will build merged master catalog library" cheaders="${cat_headers} ${astrotcl_headers} ${tclutil_headers}" MERGE_OBJECTS="$astrotcl_PKG_OBJECTS $tclutil_PKG_OBJECTS" else echo "Not making a merged master catalog library" cheaders="${cat_headers}" MERGE_OBJECTS="" fi # ----------------------------------------------------------------------- cat >>confdefs.h <<\_ACEOF #define USE_COMPAT_CONST 1 _ACEOF #------------------------------------------------------------------------ # Check if we require additional libraries to support C++ shareable # libraries. system=`uname -s`-`uname -r` SHLIB_LD_CXX_LIBS="" export SHLIB_LD_CXX_LIBS case $system in SunOS-5*) SHLIB_LD_CXX_LIBS="-lCrun -lCstd" ;; OSF*) SHLIB_LD_CXX_LIBS="-lcxx -lcxxstd" ;; esac #------------------------------------------------------------------------- # The cxx C++ compiler under Tru64 UNIX needs the special # CXXFLAGS "-std gnu -D__USE_STD_IOSTREAM=1". These allow the standard # library streams headers to work and to generate templates that do # not require special handling throughout skycat directories (normally # template object files are created in various cxx_repository subdirectories, # this way the object files are kept embedded the usual object files, see # the cxx man page for details). #------------------------------------------------------------------------- export CXXFLAGS case $system in OSF*) case "x$CXX" in xcxx*) CXXFLAGS="$CXXFLAGS -g3 -std gnu -D__USE_STD_IOSTREAM=1" ;; esac ;; esac #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- vars="${csources}" for i in $vars; do case $i in \$*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 echo "$as_me: error: could not find source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done vars="${cheaders}" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_HEADERS="$PKG_HEADERS $i" done vars="${cincludes}" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done if test $MERGED = yes ; then vars="${BLT_LIB_SPEC} ${CFITSIO_LIB_SPEC}" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done else vars="$astrotcl_BUILD_LIB_SPEC $tclutil_BUILD_LIB_SPEC ${BLT_LIB_SPEC} ${CFITSIO_LIB_SPEC}" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done fi PKG_CFLAGS="$PKG_CFLAGS " vars="" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 echo "$as_me: error: could not find stub source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done vars="${tclsources}" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then cat >>confdefs.h <<\_ACEOF #define BUILD_cat 1 _ACEOF CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for Tcl public headers" >&5 echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" with_tclinclude=${withval} fi; if test "${ac_cv_c_tclh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} { (exit 1); exit 1; }; } fi else # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; *) list="" ;; esac # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "$TCL_BIN_DIR/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 echo "${ECHO_T}${ac_cv_c_tclh}" >&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" #TEA_PRIVATE_TCL_HEADERS echo "$as_me:$LINENO: checking for Tk public headers" >&5 echo $ECHO_N "checking for Tk public headers... $ECHO_C" >&6 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" with_tkinclude=${withval} fi; if test "${ac_cv_c_tkh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else { { echo "$as_me:$LINENO: error: ${with_tkinclude} directory does not contain tk.h" >&5 echo "$as_me: error: ${with_tkinclude} directory does not contain tk.h" >&2;} { (exit 1); exit 1; }; } fi else # If Tk was built as a framework, attempt to use # the framework's Headers directory. case ${TK_DEFS} in *TK_FRAMEWORK*) list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" ;; *) list="" ;; esac # Look in the source dir only if Tk is not installed, # and in that situation, look there before installed locations. if test -f "$TK_BIN_DIR/Makefile" ; then list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tk's --prefix location, # relative to directory of tkConfig.sh, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then { { echo "$as_me:$LINENO: error: tk.h not found. Please specify its location with --with-tkinclude" >&5 echo "$as_me: error: tk.h not found. Please specify its location with --with-tkinclude" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ${ac_cv_c_tkh}" >&5 echo "${ECHO_T}${ac_cv_c_tkh}" >&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then # On Windows and Aqua, we need the X compat headers echo "$as_me:$LINENO: checking for X11 header files" >&5 echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" fi echo "$as_me:$LINENO: result: ${INCLUDE_DIR_NATIVE}" >&5 echo "${ECHO_T}${INCLUDE_DIR_NATIVE}" >&6 fi #TEA_PRIVATE_TK_HEADERS if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then withval="$with_x" fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then # Both variables are already set. have_x=yes else if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -fr conftest.dir if mkdir conftest.dir; then cd conftest.dir # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' _ACEOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -fr conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XtMalloc (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then # Didn't find X anywhere. Cache the known absence of X. ac_cv_have_x="have_x=no" else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 not_really_there="yes" fi rm -f conftest.err conftest.$ac_ext else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then echo "$as_me:$LINENO: checking for X11 header files" >&5 echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 XINCLUDES="# no special path needed" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 XINCLUDES="nope" fi rm -f conftest.err conftest.$ac_ext if test "$XINCLUDES" = nope; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then echo "$as_me:$LINENO: result: $i" >&5 echo "${ECHO_T}$i" >&6 XINCLUDES=" -I$i" break fi done fi else if test "$x_includes" != ""; then XINCLUDES=-I$x_includes else XINCLUDES="# no special path needed" fi fi if test "$XINCLUDES" = nope; then echo "$as_me:$LINENO: result: could not find any!" >&5 echo "${ECHO_T}could not find any!" >&6 XINCLUDES="# no include files found" fi if test "$no_x" = yes; then echo "$as_me:$LINENO: checking for X11 libraries" >&5 echo $ECHO_N "checking for X11 libraries... $ECHO_C" >&6 XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.dylib -o -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then echo "$as_me:$LINENO: result: $i" >&5 echo "${ECHO_T}$i" >&6 XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then echo "$as_me:$LINENO: checking for XCreateWindow in -lXwindow" >&5 echo $ECHO_N "checking for XCreateWindow in -lXwindow... $ECHO_C" >&6 if test "${ac_cv_lib_Xwindow_XCreateWindow+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXwindow $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char XCreateWindow (); int main () { XCreateWindow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_Xwindow_XCreateWindow=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xwindow_XCreateWindow=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 echo "${ECHO_T}$ac_cv_lib_Xwindow_XCreateWindow" >&6 if test $ac_cv_lib_Xwindow_XCreateWindow = yes; then XLIBSW=-lXwindow fi fi if test "$XLIBSW" = nope ; then echo "$as_me:$LINENO: result: could not find any! Using -lX11." >&5 echo "${ECHO_T}could not find any! Using -lX11." >&6 XLIBSW=-lX11 fi if test x"${XLIBSW}" != x ; then PKG_LIBS="${PKG_LIBS} ${XLIBSW}" fi fi #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants. cat >>confdefs.h <<\_ACEOF #define USE_THREAD_ALLOC 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _THREAD_SAFE 1 _ACEOF echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the # same library, as some systems hide it there until # pthread.h is defined. We could alternatively do an # AC_TRY_COMPILE with pthread.h, but that will work with # libpthread really doesn't exist, like AIX 4.2. # [Bug: 4359] echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __pthread_mutex_init (); int main () { __pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread___pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthreads_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 if test $ac_cv_lib_c_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_r_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 { echo "$as_me:$LINENO: WARNING: \"Don t know how to find pthread lib on your system - thread support disabled\"" >&5 echo "$as_me: WARNING: \"Don t know how to find pthread lib on your system - thread support disabled\"" >&2;} fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output echo "$as_me:$LINENO: checking for building with threads" >&5 echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 if test "${TCL_THREADS}" = "1"; then cat >>confdefs.h <<\_ACEOF #define TCL_THREADS 1 _ACEOF #LIBS="$LIBS $THREADS_LIBS" echo "$as_me:$LINENO: result: yes (default)" >&5 echo "${ECHO_T}yes (default)" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then { echo "$as_me:$LINENO: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&5 echo "$as_me: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&2;} fi ;; *) if test "${TCL_THREADS}" = "1"; then { echo "$as_me:$LINENO: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&5 echo "$as_me: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&2;} fi ;; esac #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking how to build libraries" >&5 echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$as_me:$LINENO: result: shared" >&5 echo "${ECHO_T}shared" >&6 SHARED_BUILD=1 else echo "$as_me:$LINENO: result: static" >&5 echo "${ECHO_T}static" >&6 SHARED_BUILD=0 cat >>confdefs.h <<\_ACEOF #define STATIC_BUILD 1 _ACEOF fi #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- # Step 0: Enable 64 bit support? echo "$as_me:$LINENO: checking if 64bit support is enabled" >&5 echo $ECHO_N "checking if 64bit support is enabled... $ECHO_C" >&6 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" do64bit=$enableval else do64bit=no fi; echo "$as_me:$LINENO: result: $do64bit" >&5 echo "${ECHO_T}$do64bit" >&6 # Step 0.b: Enable Solaris 64 bit VIS support? echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" do64bitVIS=$enableval else do64bitVIS=no fi; echo "$as_me:$LINENO: result: $do64bitVIS" >&5 echo "${ECHO_T}$do64bitVIS" >&6 if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 0.c: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = "windows" ; then echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 # Check whether --enable-wince or --disable-wince was given. if test "${enable_wince+set}" = set; then enableval="$enable_wince" doWince=$enableval else doWince=no fi; echo "$as_me:$LINENO: result: $doWince" >&5 echo "${ECHO_T}$doWince" >&6 fi # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. echo "$as_me:$LINENO: checking system version (for dynamic loading)" >&5 echo $ECHO_N "checking system version (for dynamic loading)... $ECHO_C" >&6 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then echo "$as_me:$LINENO: result: unknown (can't find uname command)" >&5 echo "${ECHO_T}unknown (can't find uname command)" >&6 system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print }' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi if test "${TEA_PLATFORM}" = "windows" ; then system=windows fi echo "$as_me:$LINENO: result: $system" >&5 echo "${ECHO_T}$system" >&6 fi fi # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then have_dl=yes else have_dl=no fi # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case and CC_SEARCH_FLAGS becomes LD_SEARCH_FLAGS for us # (and we have no CC_SEARCH_FLAGS). do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g if test "$GCC" = "yes" ; then CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" else CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} { (exit 1); exit 1; }; } fi if test "$GCC" = "yes" ; then { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} { (exit 1); exit 1; }; } fi # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true # Check whether --with-celib or --without-celib was given. if test "${with_celib+set}" = set; then withval="$with_celib" with_celibconfig=${withval} fi; echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 if test "${ac_cv_c_celibconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi fi if test x"${ac_cv_c_celibconfig}" = x ; then { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 echo "$as_me: error: Cannot find celib support library directory" >&2;} { (exit 1); exit 1; }; } else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 echo "${ECHO_T}found $CELIB_DIR" >&6 fi fi # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} { (exit 1); exit 1; }; } doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 vars="bufferoverflowU.lib" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower($0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do cat >>confdefs.h <<_ACEOF #define $i 1 _ACEOF done cat >>confdefs.h <<_ACEOF #define _WIN32_WCE $CEVERSION _ACEOF cat >>confdefs.h <<_ACEOF #define UNDER_CE $CEVERSION _ACEOF CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2" SHLIB_LD="$CXX -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 echo "${ECHO_T}Using $CC for compiling with threads" >&6 fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then #LIBOBJS="$LIBOBJS tclLoadAix.o" case $LIBOBJS in "tclLoadAix.$ac_objext" | \ *" tclLoadAix.$ac_objext" | \ "tclLoadAix.$ac_objext "* | \ *" tclLoadAix.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; esac DL_LIBS="-lld" fi # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: \"64bit mode not supported with GCC on $system\"" >&5 echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS="$LDFLAGS -q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi else if test "$GCC" = "yes" ; then SHLIB_LD="$CXX -shared" else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gettimeofday (); int main () { gettimeofday (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gettimeofday=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then libbsd=yes else libbsd=no fi if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" cat >>confdefs.h <<\_ACEOF #define USE_DELTA_FOR_TZ 1 _ACEOF fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CXX} -nostart" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="$CXX -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then SHLIB_LD="$CXX -shared -fPIC" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="${CXX} -shared -fPIC" SHLIB_LD_LIBS='${LIBS}' ;; *) { echo "$as_me:$LINENO: WARNING: \"64bit mode not supported with GCC on $system\"" >&5 echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;} ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS="$LDFLAGS +DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi LD_LIBRARY_PATH_VAR="SHLIB_PATH" ;; IRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS="$LDFLAGS -64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" if test "$have_dl" = yes; then SHLIB_LD="${CXX} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' else if test "${ac_cv_header_dld_h+set}" = set; then echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dld.h usability" >&5 echo $ECHO_N "checking dld.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dld.h presence" >&5 echo $ECHO_N "checking dld.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dld.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dld.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dld.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dld.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dld.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dld_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 fi if test $ac_cv_header_dld_h = yes; then SHLIB_LD="ld -shared" DL_OBJS="tclLoadDld.o" DL_LIBS="-ldld" LD_SEARCH_FLAGS="" fi fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x ; then CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" if test "$have_dl" = yes; then SHLIB_LD="${CXX} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" LD_SEARCH_FLAGS="" else if test "${ac_cv_header_dld_h+set}" = set; then echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dld.h usability" >&5 echo $ECHO_N "checking dld.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dld.h presence" >&5 echo $ECHO_N "checking dld.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dld.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dld.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dld.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dld.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dld.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dld_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 fi if test $ac_cv_header_dld_h = yes; then SHLIB_LD="ld -shared" DL_OBJS="" DL_LIBS="-ldld" LD_SEARCH_FLAGS="" fi fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[1-2].*) # Not available on all versions: check for include file. if test "${ac_cv_header_dlfcn_h+set}" = set; then echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the cat lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 fi if test $ac_cv_header_dlfcn_h = yes; then # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi rm -f conftest* else SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' fi # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) SHLIB_LD="${CXX} -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi rm -f conftest* # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" if test $do64bit = yes; then do64bit_ok=yes CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" fi SHLIB_LD='${CXX} -dynamiclib ${CFLAGS} ${LDFLAGS}' echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 if test "${tcl_cv_ld_single_module+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_single_module=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_single_module=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: test -z "${MACOSX_DEPLOYMENT_TARGET}" || \ test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print $2}'`" -lt 4 && \ LDFLAGS="$LDFLAGS -prebind" LDFLAGS="$LDFLAGS -headerpad_max_install_names" echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 if test "${tcl_cv_ld_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_search_paths_first=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_search_paths_first=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="$CXX -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy cat >>confdefs.h <<\_ACEOF #define _OE_SOCKETS 1 _ACEOF ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export :' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" # PWD: don't need this. #LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" LD_SEARCH_FLAGS="" ;; RISCos-*) SHLIB_CFLAGS="-G 0" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[0-6]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC" SHLIB_LD="$CXX -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else SHLIB_LD="$CXX -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' SHLIB_CFLAGS="-KPIC" fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then if test "`gcc -dumpversion` | awk -F. '{print }'" -lt "3" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" fi else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS="$LDFLAGS -xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS="$LDFLAGS -xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi elif test "$arch" = "amd64 i386" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" fi else { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC" SHLIB_LD="$CXX -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' if test "$do64bit" = "yes" ; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS},-R,$v9gcclibdir" fi else SHLIB_CFLAGS="-KPIC" SHLIB_LD="$CXX -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' if test "$GCC" != "yes" ; then CFLAGS="$CFLAGS -DHAVE_TZSET -std1" fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 LDFLAGS="$LDFLAGS -Wl,-Bexport" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LDFLAGS=$hold_ldflags found=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $found" >&5 echo "${ECHO_T}$found" >&6 LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" != "no" -a "$do64bit_ok" = "no" ; then { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need # to determine which of several header files defines the a.out file # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we # support only a file format that is more or less version-7-compatible. # In particular, # - a.out files must begin with `struct exec'. # - the N_TXTOFF on the `struct exec' must compute the seek address # of the text segment # - The `struct exec' must contain a_magic, a_text, a_data, a_bss # and a_entry fields. # The following compilation should succeed if and only if either sys/exec.h # or a.out.h is usable for the purpose. # # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the # `struct exec' includes a second header that contains information that # duplicates the v7 fields that are needed. if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo "$as_me:$LINENO: checking sys/exec.h" >&5 echo $ECHO_N "checking sys/exec.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_SYS_EXEC_H 1 _ACEOF else echo "$as_me:$LINENO: checking a.out.h" >&5 echo $ECHO_N "checking a.out.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_A_OUT_H 1 _ACEOF else echo "$as_me:$LINENO: checking sys/exec_aout.h" >&5 echo $ECHO_N "checking sys/exec_aout.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_midmag == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_SYS_EXEC_AOUT_H 1 _ACEOF else DL_OBJS="" fi fi fi fi # Step 5: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load or --disable-load was given. if test "${enable_load+set}" = set; then enableval="$enable_load" tcl_ok=$enableval else tcl_ok=yes fi; if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; RISCos-*) ;; SCO_SV-3.2*) ;; ULTRIX-4.*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary echo "$as_me:$LINENO: checking for required early compiler flags" >&5 echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 tcl_flags="" if test "${tcl_cv_flag__isoc99_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__isoc99_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _ISOC99_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if test "${tcl_cv_flag__largefile64_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__largefile64_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if test "x${tcl_flags}" = "x" ; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 else echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 echo "${ECHO_T}${tcl_flags}" >&6 fi echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 if test "${tcl_cv_type_64bit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { __int64 value = (__int64) 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_type_64bit=__int64 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_type_64bit="long long" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; } ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_64bit=${tcl_type_64bit} else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then cat >>confdefs.h <<\_ACEOF #define TCL_WIDE_INT_IS_LONG 1 _ACEOF echo "$as_me:$LINENO: result: using long" >&5 echo "${ECHO_T}using long" >&6 elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # We actually want to use the default tcl.h checks in this # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 echo "${ECHO_T}using Tcl header defaults" >&6 else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 # Now check for auxiliary declarations echo "$as_me:$LINENO: checking for struct dirent64" >&5 echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 if test "${tcl_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct dirent64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_dirent64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_dirent64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_DIRENT64 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_struct_dirent64}" >&5 echo "${ECHO_T}${tcl_cv_struct_dirent64}" >&6 echo "$as_me:$LINENO: checking for struct stat64" >&5 echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 if test "${tcl_cv_struct_stat64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_stat64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_stat64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_struct_stat64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_STAT64 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_struct_stat64}" >&5 echo "${ECHO_T}${tcl_cv_struct_stat64}" >&6 echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 if test "${tcl_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { off64_t offset; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_type_off64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_TYPE_OFF64_T 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_type_off64_t}" >&5 echo "${ECHO_T}${tcl_cv_type_off64_t}" >&6 fi #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- DBGX="" echo "$as_me:$LINENO: checking for build with symbols" >&5 echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" tcl_ok=$enableval else tcl_ok=no fi; if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 echo "${ECHO_T}yes (standard debugging)" >&6 fi fi if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then cat >>confdefs.h <<\_ACEOF #define TCL_MEM_DEBUG 1 _ACEOF fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 echo "${ECHO_T}enabled symbols mem debugging" >&6 else echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 echo "${ECHO_T}enabled $tcl_ok debugging" >&6 fi fi #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- # allan: can't use stubs, due to BLT dependency #AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${LDFLAGS_DEFAULT} \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for tclsh" >&5 echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_PREFIX}/bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}" fi echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 echo "${ECHO_T}${TCLSH_PROG}" >&6 echo "$as_me:$LINENO: checking for wish" >&5 echo $ECHO_N "checking for wish... $ECHO_C" >&6 if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="${TK_BIN_DIR}/wish" fi else # tkConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" fi list="`ls -d ${TK_PREFIX}/bin 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../bin 2>/dev/null`" for i in $list ; do if test -f "$i/${WISH_PROG}" ; then REAL_TK_BIN_DIR="`cd "$i"; pwd`" break fi done WISH_PROG="${REAL_TK_BIN_DIR}/${WISH_PROG}" fi echo "$as_me:$LINENO: result: ${WISH_PROG}" >&5 echo "${ECHO_T}${WISH_PROG}" >&6 #-------------------------------------------------------------------- # These are for catConfig.sh #-------------------------------------------------------------------- cat_LIB_FILE=${PKG_LIB_FILE} eval pkglibdir="${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval cat_LIB_FLAG="-lcat${PACKAGE_VERSION}" else eval cat_LIB_FLAG="-lcat`echo ${PACKAGE_VERSION} | tr -d .`" fi cat_BUILD_LIB_SPEC="-L`pwd` ${cat_LIB_FLAG}" cat_BUILD_DIR="`pwd`" cat_LIB_SPEC="-L${pkglibdir} ${cat_LIB_FLAG}" for i in ${PKG_OBJECTS} ; do cat_PKG_OBJECTS="$cat_PKG_OBJECTS ../cat/$i" done # cat_SRC_DIR must be a fully qualified path eval cat_SRC_DIR="$srcdir" cat_SRC_DIR=`cd "${cat_SRC_DIR}"; pwd` #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- ac_config_files="$ac_config_files Makefile pkgIndex.tcl catConfig.sh cat_version.tcl" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by cat $as_me 4.1.0, which was generated by Starlink Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ cat config.status 4.1.0 configured by $0, generated by Starlink Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgIndex.tcl" ) CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; "catConfig.sh" ) CONFIG_FILES="$CONFIG_FILES catConfig.sh" ;; "cat_version.tcl" ) CONFIG_FILES="$CONFIG_FILES cat_version.tcl" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CYGPATH@,$CYGPATH,;t t s,@EXEEXT@,$EXEEXT,;t t s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t s,@PKG_HEADERS@,$PKG_HEADERS,;t t s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t s,@PKG_LIBS@,$PKG_LIBS,;t t s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t s,@TCL_VERSION@,$TCL_VERSION,;t t s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t s,@TCL_LIBS@,$TCL_LIBS,;t t s,@TCL_DEFS@,$TCL_DEFS,;t t s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t s,@TK_VERSION@,$TK_VERSION,;t t s,@TK_BIN_DIR@,$TK_BIN_DIR,;t t s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t s,@TK_LIBS@,$TK_LIBS,;t t s,@TK_XINCLUDES@,$TK_XINCLUDES,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@EGREP@,$EGREP,;t t s,@MATH_LIBS@,$MATH_LIBS,;t t s,@tclutil_VERSION@,$tclutil_VERSION,;t t s,@tclutil_LIB_FILE@,$tclutil_LIB_FILE,;t t s,@tclutil_BUILD_LIB_SPEC@,$tclutil_BUILD_LIB_SPEC,;t t s,@tclutil_BUILD_DIR@,$tclutil_BUILD_DIR,;t t s,@tclutil_LIB_SPEC@,$tclutil_LIB_SPEC,;t t s,@BLT_LIB_SPEC@,$BLT_LIB_SPEC,;t t s,@tclutil_SRC_DIR@,$tclutil_SRC_DIR,;t t s,@tclutil_PKG_OBJECTS@,$tclutil_PKG_OBJECTS,;t t s,@CFITSIO_LIB_SPEC@,$CFITSIO_LIB_SPEC,;t t s,@astrotcl_VERSION@,$astrotcl_VERSION,;t t s,@astrotcl_LIB_FILE@,$astrotcl_LIB_FILE,;t t s,@astrotcl_BUILD_LIB_SPEC@,$astrotcl_BUILD_LIB_SPEC,;t t s,@astrotcl_BUILD_DIR@,$astrotcl_BUILD_DIR,;t t s,@astrotcl_LIB_SPEC@,$astrotcl_LIB_SPEC,;t t s,@astrotcl_SRC_DIR@,$astrotcl_SRC_DIR,;t t s,@astrotcl_PKG_OBJECTS@,$astrotcl_PKG_OBJECTS,;t t s,@MERGE_OBJECTS@,$MERGE_OBJECTS,;t t s,@SHLIB_LD_CXX_LIBS@,$SHLIB_LD_CXX_LIBS,;t t s,@PKG_SOURCES@,$PKG_SOURCES,;t t s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t s,@CLEANFILES@,$CLEANFILES,;t t s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t s,@TK_INCLUDES@,$TK_INCLUDES,;t t s,@TCL_THREADS@,$TCL_THREADS,;t t s,@SHARED_BUILD@,$SHARED_BUILD,;t t s,@AR@,$AR,;t t s,@CELIB_DIR@,$CELIB_DIR,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t s,@DL_LIBS@,$DL_LIBS,;t t s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t s,@STLIB_LD@,$STLIB_LD,;t t s,@SHLIB_LD@,$SHLIB_LD,;t t s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t s,@TCL_DBGX@,$TCL_DBGX,;t t s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t s,@MAKE_LIB@,$MAKE_LIB,;t t s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t s,@RANLIB_STUB@,$RANLIB_STUB,;t t s,@TCLSH_PROG@,$TCLSH_PROG,;t t s,@WISH_PROG@,$WISH_PROG,;t t s,@cat_LIB_FILE@,$cat_LIB_FILE,;t t s,@cat_BUILD_LIB_SPEC@,$cat_BUILD_LIB_SPEC,;t t s,@cat_BUILD_DIR@,$cat_BUILD_DIR,;t t s,@cat_LIB_SPEC@,$cat_LIB_SPEC,;t t s,@cat_PKG_OBJECTS@,$cat_PKG_OBJECTS,;t t s,@cat_SRC_DIR@,$cat_SRC_DIR,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi skycat-3.1.2-starlink-1b/cat/configure.in000066400000000000000000000215401215713201500202170ustar00rootroot00000000000000# E.S.O. - VLT project # $Id: configure.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is used with GNU autoconf to generate a configure script # # usage: % autoconf # only if configure.in changed # % configure # % make # % make install # # who when what # -------------- -------- --------------------------------------------- # Allan Brighton 15/12/05 Rewrote using TCL TEA standard # ----------------------------------------------------------------------- #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- AC_INIT([cat], [4.1.0]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- TEA_INIT([3.4]) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- TEA_PATH_TKCONFIG TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER #-------------------------------------------------------------------- # Do application specific checks (see aclocal.m4) #-------------------------------------------------------------------- CAT_CONFIG #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- TEA_ADD_SOURCES([${csources}]) TEA_ADD_HEADERS([${cheaders}]) TEA_ADD_INCLUDES([${cincludes}]) if test $MERGED = yes ; then TEA_ADD_LIBS(${BLT_LIB_SPEC} ${CFITSIO_LIB_SPEC}) else TEA_ADD_LIBS([$astrotcl_BUILD_LIB_SPEC $tclutil_BUILD_LIB_SPEC ${BLT_LIB_SPEC} ${CFITSIO_LIB_SPEC}]) fi TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([]) TEA_ADD_TCL_SOURCES([${tclsources}]) #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then AC_DEFINE(BUILD_cat, 1, [Build windows export dll]) CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi AC_SUBST(CLEANFILES) #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- TEA_PUBLIC_TCL_HEADERS #TEA_PRIVATE_TCL_HEADERS TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- # allan: can't use stubs, due to BLT dependency #AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- TEA_MAKE_LIB #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- TEA_PROG_TCLSH TEA_PROG_WISH #-------------------------------------------------------------------- # These are for catConfig.sh #-------------------------------------------------------------------- cat_LIB_FILE=${PKG_LIB_FILE} eval pkglibdir="${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval cat_LIB_FLAG="-lcat${PACKAGE_VERSION}" else eval cat_LIB_FLAG="-lcat`echo ${PACKAGE_VERSION} | tr -d .`" fi cat_BUILD_LIB_SPEC="-L`pwd` ${cat_LIB_FLAG}" cat_BUILD_DIR="`pwd`" cat_LIB_SPEC="-L${pkglibdir} ${cat_LIB_FLAG}" for i in ${PKG_OBJECTS} ; do cat_PKG_OBJECTS="$cat_PKG_OBJECTS ../cat/$i" done AC_SUBST(cat_LIB_FILE) AC_SUBST(cat_BUILD_LIB_SPEC) AC_SUBST(cat_BUILD_DIR) AC_SUBST(cat_LIB_SPEC) AC_SUBST(cat_PKG_OBJECTS) # cat_SRC_DIR must be a fully qualified path eval cat_SRC_DIR="$srcdir" cat_SRC_DIR=`cd "${cat_SRC_DIR}"; pwd` AC_SUBST(cat_SRC_DIR) #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- AC_OUTPUT([Makefile pkgIndex.tcl catConfig.sh cat_version.tcl]) skycat-3.1.2-starlink-1b/cat/generic/000077500000000000000000000000001215713201500173205ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/cat/generic/AstroCatalog.C000066400000000000000000000654761215713201500220310ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: AstroCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * AstroCatalog.C - method definitions for class AstroCatalog * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created * Peter W. Draper 01 May 03 Added "ws" and "hs" to get width and * height in arcsecs (2MASS image servers) * Peter W. Draper 10 Dec 03 Moved "delete cat" in nameToWorldCoords * so that it is performed after the last * reference to "cat" (->equinox()). * Started crashing query subprocess. * 27 Aug 08 Allow image/fits as a content type. */ static const char* const rcsId="@(#) $Id: AstroCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include #include #include #include "error.h" #include "DCompress.h" #include "WorldOrImageCoords.h" #include "HTTP.h" #include "Mem.h" #include "AstroCatalog.h" #include "LocalCatalog.h" using namespace std; /* * swap 2 values */ static inline void swap(double& x1, double& x2) { double tmp = x2; x2 = x1; x1 = tmp; } /* * constructor - used internally only, public interface uses "open(name)" * "e" is the catalog config entry object for this catalog * (see CatalogInfo class) */ AstroCatalog::AstroCatalog(CatalogInfoEntry* e) : entry_(e), status_(OK), more_(0), tmpfile_(NULL) { newTempFile(); } /* * destructor - close catalog and free any resources */ AstroCatalog::~AstroCatalog() { if (tmpfile_) { unlink(tmpfile_); free(tmpfile_); } } /* * copy constructor */ AstroCatalog::AstroCatalog(const AstroCatalog& a) { tmpfile_ = a.tmpfile_ ? strdup(a.tmpfile_) : (char*)NULL; } /* * Return true if the given entry is for a catalog (not an image server or dir) */ int AstroCatalog::isCatalog(CatalogInfoEntry* e) { const char* s = e->servType(); return (strcmp(s, "catalog") == 0 || strcmp(s, "local") == 0 || strcmp(s, "archive") == 0 || strcmp(s, "namesvr") == 0); } /* * Return true if the given entry is for an image server */ int AstroCatalog::isImageServer(CatalogInfoEntry* e) { return (strcmp(e->servType(), "imagesvr") == 0); } /* * Return true if the given entry is for a local catalog */ int AstroCatalog::isLocalCatalog(CatalogInfoEntry* e) { return (strcmp(e->servType(), "local") == 0); } /* * Generate an error message indicating that the wrong type of * catalog was used. */ int AstroCatalog::wrongServType(CatalogInfoEntry* e) { return error("This operation is not allowed for catalogs of type ", e->servType()); } /* * Do a dummy query to get the column names for this catalog and set the * member variable info_ to the result. The return value is 0 if the * query was successful. * * XXX need a standard query syntax for this ? */ int AstroCatalog::getInfo() { if (! isCatalog(entry_)) return ERROR; int more = more_; // don't want to overwrite this flag here AstroQuery q; if (entry_->isWcs()) q.pos(WorldCoords(0., 0.)); // dummy world coords else if (entry_->isPix()) q.pos(ImageCoords(0., 0.)); // dummy image coords q.maxRows(1); int nrows = query(q, NULL, info_); more_ = more; // restore value of this flag if (nrows >= 0) return OK; return ERROR; } /* * If we don't have the header info for this catalog, get it and * return the status. */ int AstroCatalog::checkInfo() { if (info_.numCols() > 0) return 0; return getInfo(); } /* * return the number of columns in the catalog */ int AstroCatalog::numCols() { return ((checkInfo() == OK) ? info_.numCols() : -1); } /* * return a ptr to an array of catalog column names */ char** AstroCatalog::colNames() { return (char**)((checkInfo() == OK) ? info_.colNames() : NULL); } /* * return the name of the given column */ const char* AstroCatalog::colName(int col) { return ((checkInfo() == OK) ? info_.colName(col) : (char*)NULL); } /* * return the column index for the given column name */ int AstroCatalog::colIndex(const char* colName) { return ((checkInfo() == OK) ? info_.colIndex(colName) : -1); } /* * This static method is called to open the named catalog and return a * pointer to an AstroCatalog object for it, or NULL if errors occur. * This is the main entry point to the class. */ AstroCatalog* AstroCatalog::open(const char* name) { // get the entry for this catalog type CatalogInfoEntry* e = CatalogInfo::lookup(name); if (!e) return NULL; // error - no config entry AstroCatalog* result = NULL; if (isLocalCatalog(e)) { result = new LocalCatalog(e); // derived class handles local catalog files } else if (isCatalog(e) || isImageServer(e)) { result = new AstroCatalog(e); // this class handles catalogs and image servers } else { fmt_error("'%s' is of type '%s', not a catalog, archive or image server", name, e->servType()); return NULL; } if (result->status() != 0) { delete result; return NULL; // error making catalog } return result; // normal return } /* * static method to use a name server catalog (simbad_ns@eso or ned_ns@eso) * to get the coordinates from the object name. If feedback is not NULL, * status info is written to the given open file. * * On success, sets the position arg and returns 0, else 1. */ int AstroCatalog::nameToWorldCoords( const char* objName, WorldOrImageCoords& pos, const char* nameServer, FILE* feedback) { double ra, dec; QueryResult result; AstroCatalog* cat = AstroCatalog::open(nameServer); if (cat == NULL) return ERROR; if (cat->getObject(objName, 0, NULL, result)) { delete cat; return ERROR; } if (result.get(0, cat->ra_col(), ra) || result.get(0, cat->dec_col(), dec)) { delete cat; return ERROR; } pos = WorldCoords(ra, dec, cat->equinox()); delete cat; return 0; } /* * Pass a query to the catalog and return the number of objects found. * Only the given columns are retrieved. * * Args: * q - (in) object describing the query * * filename - (in) filename to hold results, or null * * result - (out) reference to object used to access the results * * The return value is the number of rows found, or 0 if none were found. * A return value of -1 indicates an error. */ int AstroCatalog::query(const AstroQuery& q, const char* filename, QueryResult& result) { if (! isCatalog(entry_)) return wrongServType(entry_); // generate the URL for a standard query in buf (using ostringstream) char* result_buf = NULL; int nlines = 0; // if the first URL doesn't work, try the others, if specified const char* urls[3]; urls[0] = entry_->url(); urls[1] = entry_->backup1(); urls[2] = entry_->backup2(); char url[10000]; char* ctype = (char *)""; for (int i = 0; i < 3 && urls[i]; i++) { if (genHttpQuery(url, sizeof(url), q, urls[i]) != 0) return -1; // send the query result_buf = http_.get(url, nlines); ctype = http_.content_type(); if (!ctype) ctype = (char *)""; if (result_buf != NULL && strcmp(ctype, "text/html") != 0) break; // don't go to backup URL if it was a request for authorization if (http_.authorizationRequired()) break; } if (result_buf == NULL) return -1; // error in http get // check the Content-type of the return data if (strcmp(ctype, "text/html") == 0) { // most likely an error message http_.html_error(result_buf); return -1; } // note the catalog config entry in the results // (This contains important info, such as the location of the id, a and dec cols) result.entry(entry_, result_buf); if (result.init(result_buf) != 0) return -1; // error // sort result ? // note: do this before truncating to maxRows to get correct results if (q.numSortCols()) result.sort(q.numSortCols(), q.sortCols(), q.sortOrder()); if (q.maxRows() && result.numRows() > q.maxRows()) { more_ = 1; result.numRows(q.maxRows()); } else { more_ = 0; } // if we didn't already, note the catalog's column heading info if (info_.numCols() <= 0 && info_.init(result.numCols(), result.colNames(), "", 1) != 0) return -1; if (filename && result.save(filename) != 0) return -1; return result.numRows(); } /* * Request an image from the image server based on the given query description * and return 0 if all is ok. (Only valid for image servers). * The name of a FITS file containing the resulting image can be accessed as * this->tmpfile(). * * The catalog config file defines the URL used to get the image. */ int AstroCatalog::getImage(const AstroQuery& q) { if (! isImageServer(entry_)) return wrongServType(entry_); // if the first URL doesn't work, try the others, if specified const char* urls[3]; urls[0] = entry_->url(); urls[1] = entry_->backup1(); urls[2] = entry_->backup2(); char url[10000]; // for each url, backup-url, etc... for (int i = 0; i < 3 && urls[i]; i++) { if (genHttpQuery(url, sizeof(url), q, urls[i]) != 0) return 1; // error if (getImage(url) == 0) return 0; // normal return // don't go to backup URL if it was a request for authorization if (http_.authorizationRequired()) return 1; // error } return 1; // error, none of the URLs worked } /* * Given a URL for an image, request the image from the image server and * return 0 if all is ok. The name of the FITS file containing the * resulting image can be accessed with the method "this->tmpfile()" */ int AstroCatalog::getImage(const char* url) { char* ctype = (char *)""; if (getPreview(url, ctype) == 0 && ( strcmp(ctype, "image/x-fits") == 0 || strcmp(ctype, "image/fits" ) == 0 ) ) return 0; // ok return 1; // error } /* * generate the HTTP catalog query string from the AstroQuery object and URL string * and write it to the given buffer (buf) of size bufsz. * * Note: if the query specifies only an object Id, we need to handle a * a search for the specific ID * * Note: if 2 positions or a width and height were specified in the query, * we need to return the objects in the "area" * * Note: if 1 pos (+ optional mag0, mag1) are specified in the query and * maxRows is 1, we are looking for the "closest" object * * The following substitutions are then performed on the given URL: * * %ra, %dec - world coordinates of center point (for catalogs based in wcs) * * %x, %y - image coordinates of center point (for pixel based catalogs) * * %w, %h - width and height of area in arcmin (area query) * * %ws, %hs - width and height of area in arcsec (area query) * * %r1, %r2 - min and max radius (for circular query) * * %m1, %m2 - min and max magnitude * * %n - max number of rows to return * * %cols - comma sep. list of columns to return: col1,col2,...coln * * %id - ID field of item to return (if supported) * * %mime-type - value for http mime-type field * * %sort - insert list of sort columns: col1,col2,... * * %sortorder - insert string: increasing or decreasing * * %cond - insert search condition, if any, in the format * col1=minVal,maxVal&col2=minVal,maxVal,... */ int AstroCatalog::genHttpQuery(char* buf, int bufsz, const AstroQuery& q, const char* url) { if (q.pos().status() != 0) return ERROR; std::ostringstream os; int i; int url_has_id = 0, url_has_radec = 0, url_has_xy = 0; // XXX temp - until gsc-server is fixed const char* shortName = entry_->shortName(); if (shortName && strncmp(shortName, "gsc", 3) == 0 && q.mag1() == 0.0 && q.mag2() == 0.0) { ((AstroQuery&)q).mag(0., 15.); } // expand the variables in the catalog server command while(*url) { if (*url == '%') { url++; if (*url == '%') { // make "%%" expand to "%" os << '%'; url ++; } else if (strncmp(url, "id", 2) == 0) { os << q.id(); url += 2; url_has_id++; } else if (strncmp(url, "ra", 2) == 0) { os << q.pos().ra(); url += 2; url_has_radec++; } else if (strncmp(url, "dec", 3) == 0) { os << q.pos().dec(); url += 3; url_has_radec++; } else if (*url == 'x') { os << q.pos().x(); url++; url_has_xy++; } else if (*url == 'y') { os << q.pos().y(); url++; url_has_xy++; } else if (strncmp(url, "r1", 2) == 0) { if (q.radius1() != 0.0 || q.radius2() != 0.0) os << q.radius1(); url += 2; } else if (strncmp(url, "r2", 2) == 0) { if (q.radius1() != 0.0 || q.radius2() != 0.0) os << q.radius2(); url += 2; } else if (strncmp(url, "m1", 2) == 0) { if (q.mag1() != 0.0 || q.mag2() != 0.0) os << q.mag1(); url += 2; } else if (strncmp(url, "m2", 2) == 0) { if (q.mag1() != 0.0 || q.mag2() != 0.0) os << q.mag2(); url += 2; } else if (*url == 'n') { // request one more row than maxRows, // so we can determine if that was all... if (q.maxRows() > 0) os << q.maxRows()+1; url++; } else if (strncmp(url, "ws", 2) == 0) { if (q.width() != 0.0 || q.height() != 0.0) os << q.width() * 60.0; url++; } else if (strncmp(url, "hs", 2) == 0) { if (q.width() != 0.0 || q.height() != 0.0) os << q.height() * 60.0; url++; } else if (strncmp(url, "w", 1) == 0) { if (q.width() != 0.0 || q.height() != 0.0) os << q.width(); url++; } else if (strncmp(url, "h", 1) == 0) { if (q.width() != 0.0 || q.height() != 0.0) os << q.height(); url++; } else if (strncmp(url, "cols", 4) == 0) { // insert a list of column names for (i = 0; i < q.numCols(); i++) { os << q.colName(i); if (q.numCols() - i > 1) os << ','; } url += 4; } else if (strncmp(url, "sortorder", 9) == 0) { os << ((q.sortOrder() < 0) ? "decreasing" : "increasing"); url += 9; } else if (strncmp(url, "sort", 4) == 0) { // insert a list of sort column names // XXX note: not all servers may accept the list... int n = q.numSortCols(); if (n > 0) { char** ar = q.sortCols(); for (i = 0; i < n; i++) { os << ar[i]; if (n - i > 1) os << ','; } } url += 4; } else if (strncmp(url, "cond", 4) == 0) { // insert a list of condition column names and min/max values int n = q.numSearchCols(); if (n > 0) { char** arcols = q.searchCols(); char** armin = q.minValues(); char** armax = q.maxValues(); for (i = 0; i < n; i++) { // if min and max are the same or max is empty, assume a // single value, otherwise a range of values if (strcmp(armin[i], armax[i]) == 0 || strlen(armax[i]) == 0) os << arcols[i] << "=" << armin[i]; else os << arcols[i] << "=" << armin[i] << "," << armax[i]; if (n - i > 1) os << '&'; } } url += 4; } else if (strncmp(url, "mime-type", 9) == 0) { os << "application/x-fits"; // should be hard coded in the config file? url += 9; } else { // if it is not recognized, ignore, don't substitue... } } else { os << *url++; } } strncpy(buf, os.str().c_str(), bufsz); // report an error if the caller specified an id, but there is none in the URL if (strlen(q.id()) && ! url_has_id) return fmt_error("%s does not suppport search by id", name()); // report an error if the caller supplied a position, but there is none in the URL if (!q.pos().isNull()) { if (q.pos().isWcs() && !url_has_radec) return fmt_error("%s does not suppport search by World Coordinates", name()); if (!q.pos().isWcs() && !url_has_xy) return fmt_error("%s does not suppport search by image coordinates", name()); } return 0; } /* * Get the number of columns and the column names * for the this catalog and return 0 if all is OK. * * Args: * * numCols, out - number of result columns * colNames, out - reference to array of column names * colTypes, out - reference to array of column type names */ int AstroCatalog::getDescription(int& numCols, char**& colNames) { if (! isCatalog(entry_)) return wrongServType(entry_); if (checkInfo() == OK) { numCols = info_.numCols(); colNames = (char**)info_.colNames(); return 0; } return error("couldn't get catalog info"); } /* * Get the values for the specified columns for the object given by "id" * in the catalog and return 0 if all is OK. * * Args: * * id in - object id in catalog * numCols in - number of columns to get * colNames in - array of column names to read * result out - reference to object managing result rows */ int AstroCatalog::getObject( const char* id, int numCols, char** colNames, QueryResult& result) { if (! isCatalog(entry_)) return wrongServType(entry_); AstroQuery q; q.id(id); q.colNames(numCols, colNames); q.maxRows(1); int nrows = query(q, NULL, result); if (nrows < 0) return 1; // error return return 0; } /* * Get the values for all objects in the specified world coordinates area * Note: This routines returns the number of rows found (in numFound). * * Args: * * numCols in - number of columns to get * colNames in - array of column names to read * pos0 in - coordinates of area - first point * pos1 in - second point of area * mag0 in - min magnitude * mag1 in - max magnitude * maxRows in - max number of rows to return * filename in - if not null, write results to this file * result out - reference to object managing result rows */ int AstroCatalog::getArea( int numCols, char** colNames, const WorldOrImageCoords& pos0, const WorldOrImageCoords& pos1, double mag0, double mag1, int maxRows, const char* filename, int& numFound, QueryResult& result) { if (! isCatalog(entry_)) return wrongServType(entry_); AstroQuery q; q.pos(pos0, pos1); q.colNames(numCols, colNames); q.maxRows(maxRows); numFound = query(q, filename, result); if (numFound < 0) return 1; // error return 0; } /* * Get the values for all objects in the specified circle/ring. * Note: This routines returns the number of rows found (in numFound). * * Args: * * numCols in - number of columns to get * colNames in - array of column names to read * pos in - center position in world coordinates * radius0 in - min radius * radius1 in - max radius * mag0 in - min magnitude * mag1 in - max magnitude * maxRows in - max number of rows to return * filename in - if not null, write results to this file * numFound out - number of objects found * result out - reference to object managing result rows */ int AstroCatalog::circularSearch( int numCols, char** colNames, const WorldOrImageCoords& pos, double radius0, double radius1, double mag0, double mag1, int maxRows, const char* filename, int& numFound, QueryResult& result) { if (! isCatalog(entry_)) return wrongServType(entry_); AstroQuery q; q.pos(pos); q.radius(radius0, radius1); q.mag(mag0, mag1); q.colNames(numCols, colNames); q.maxRows(maxRows); numFound = query(q, filename, result); if (numFound < 0) return 1; // error return 0; } /* * search for the star closest to the given position, with the magnitude in * the given range and return (via the last 2 args) the columns requested * by "colNames" * * Args: * * numCols in - number of columns to get * colNames in - array of column names to read * pos in - center position in world coordinates * mag0 in - min magnitude * mag1 in - max magnitude * result out - reference to object managing result rows */ int AstroCatalog::searchClosestStar( int numCols, char** colNames, const WorldOrImageCoords& pos, double mag0, double mag1, QueryResult& result) { if (! isCatalog(entry_)) return wrongServType(entry_); AstroQuery q; q.pos(pos); q.mag(mag0, mag1); q.colNames(numCols, colNames); q.maxRows(1); int nrows = query(q, NULL, result); if (nrows < 0) return 1; // error return return 0; } /* * search for the stars fulfilling the specified criteria * * Args: * * numCols in - number of columns to get * colNames in - array of column names to get * * numSearchCols in - number of search columns (for to minVals, maxVals) * searchCols in - array of search column names for conditions * (for minVals, maxVals below) * minVals in - optional array of min values for searchCols * maxVals in - optional array of max values for searchCols * * maxRows in - max number of rows to return * filename in - if not null, write results to this file * numFound out - number of objects found * result out - reference to object managing result rows */ int AstroCatalog::CatalogSearch( int numCols, char** colNames, int numSearchCols, char** searchCols, char** minVals, char** maxVals, int maxRows, const char* filename, int& numFound, QueryResult& result) { if (! isCatalog(entry_)) return wrongServType(entry_); AstroQuery q; q.colNames(numCols, colNames); q.condition(numSearchCols, searchCols, minVals, maxVals); q.maxRows(maxRows); numFound = query(q, filename, result); if (numFound < 0) return 1; // error return 0; } /* * Generate a new temp file name for holding images or preview data. (We * could reuse it, but if it is still open and/or mmap'ed, it will cause * an error). We also check the name to see if the user may have set the * tmpfile name, for backward compatibility. */ void AstroCatalog::newTempFile() { static int count = 0; // used to make a unique file name if (!tmpfile_ || strncmp(tmpfile_, "/tmp/cat", 8) == 0) { // set default temp file for holding preview data char buf[80]; sprintf(buf, "/tmp/cat%d%d.fits", (int)getpid(), count++); tmpfile(buf); } } /* * set the name of the temp file used to hold preview data fetched * via http and remove the previous temp file, if it exists. */ void AstroCatalog::tmpfile(const char* name) { if (tmpfile_) { unlink(tmpfile_); free(tmpfile_); } tmpfile_ = strdup(name); } /* * Given a URL pointing to preview data (FITS image or tab table data), * request the data from the server and return 0 if all is OK. On * return, if there were no errors, the "ctype" argument is set to the * Content-type of the result to indicate the type of data. The data is * automatically decompressed if needed (if the content-type is * recognized). The "tmpfile()" method gives the name of the file * containing the results on success. */ int AstroCatalog::getPreview(const char* url, char*& ctype) { // we need to use a new file, since the old one may be still in use // (even after it was deleted, since it may still be open and/or mmapped) newTempFile(); // open the tmp file std::ofstream f(tmpfile_); if (!f) return sys_error("could not open file for writing: ", tmpfile_); if (http_.get(url, f) != 0) { unlink(tmpfile_); return ERROR; } f.close(); // check the Content-type of the return data to determine whether it // needs to be decompressed and if so, how... ctype = http_.content_type(); if (!ctype) ctype = (char *)""; if (strcmp(ctype, "text/html") == 0) { // most likely an HTML formatted server error message std::ifstream is(tmpfile_); unlink(tmpfile_); return http_.html_error(is); } // for now, assume uncompressed table if the Content-type is not recognized char* t = ctype; int is_image = 0; if (strncmp(ctype, "image/", 6) == 0) { t = ctype+6; is_image++; } else if (strncmp(ctype, "text/", 5) == 0) { t = ctype+5; } else { // unknown content type, check if it might be a FITS file Mem m(tmpfile_); if (m.status() == 0 && m.size() >= 2880 && strncmp((const char*)m.ptr(), "SIMPLE", 6) == 0) { ctype = (char *)"image/x-fits"; // assume FITS file is_image++; } else { ctype = (char *)"text/x-starbase"; // assume catalog data } return 0; } // In some cases the Content-type only gives the general type and // we need to check the Content-Encoding also. For example "file.fits.gz" // might have a Content-type of image/x-fits and Content-Encoding of // x-gzip char* ce = http_.content_encoding(); if (is_image && strcmp(t, "x-fits") == 0 && ce != NULL) { if (strcmp(ce, "x-gzip") == 0) { ctype = (char *)"image/x-gfits"; t = ctype+6; } else if (strcmp(ce, "x-compress") == 0) { ctype = (char *)"image/x-cfits"; t = ctype+6; } } // pure FITS or starbase table ? if (strcmp(t, "x-fits") == 0 || strcmp(t, "fits" ) == 0 || strcmp(t, "fits") == 0 || strcmp(t, "x-starbase") == 0 || strcmp(t, "plain") == 0 || strcmp(t, "tab-separated-values") == 0) { return 0; // not compressed, just return filename } Compress::CompressType type = Compress::NO_COMPRESS; if (strcmp(t, "x-hfits") == 0) { type = Compress::H_COMPRESS; // Hcompressed FITS file } else if (strcmp(t, "x-gfits") == 0 || strcmp(t, "x-gstarbase") == 0) { type = Compress::GZIP_COMPRESS; // GZIPed FITS or tab table } else if (strcmp(t, "x-cfits") == 0 || strcmp(t, "x-cstarbase") == 0) { type = Compress::UNIX_COMPRESS; // UNIX Compressed FITS ir tab table } else if (strcmp(t, "x-sfits") == 0) { // Compressed FITS file (Stark) // type = Compress::S_COMPRESS; unlink(tmpfile_); return error("x-sfits compression (Stark) not supported"); } else { unlink(tmpfile_); return error("unknown preview data Content-type: ", ctype); } // do the decompression FILE* feedback = http_.feedback(); if (feedback) { fprintf(feedback, "decompressing data...\n"); fflush(feedback); } Compress c; if (c.decompress(tmpfile_, type) != 0) { unlink(tmpfile_); return ERROR; } // correct Content-type after decompression ctype = (char*)(is_image ? "image/x-fits" : "text/x-starbase"); // if we got here, then we have the FITS file, so return the file name return 0; } /* * return the text of the previous error message */ const char* AstroCatalog::getError() { return last_error(); // from error.h } /* * reset the error message buffer to empty */ void AstroCatalog::clearError() { clear_error(); // from error.h } skycat-3.1.2-starlink-1b/cat/generic/AstroCatalog.h000066400000000000000000000263431215713201500220640ustar00rootroot00000000000000// -*-c++-*- #ifndef _AstroCatalog_h_ #define _AstroCatalog_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: AstroCatalog.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * AstroCatalog.h - class definitions for accessing astronomical * catalogs * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created * Peter W. Draper 21 Jan 99 Moved constructor into public interface. * 20 Mar 09 Added various accessors for meta-data * (VO and comments) * 08 May 09 Added stc_col member */ using namespace std; #include #include "CatalogInfo.h" #include "AstroQuery.h" #include "QueryResult.h" #include "HTTP.h" class WorldCoords; class WorldOrImageCoords; /* * Class AstroCatalog * * This class manages access to astronomical catalogs via a collection * HTTP catalog servers. The main entry point is the "open" method, * which returns a pointer to a class object representing the catalog. */ class AstroCatalog { protected: HTTP http_; // http server handle char* tmpfile_; // temp file to hold fits image int status_; // status after constructor int more_; // true if more rows would have been available // but were not fetched (due to query limit) QueryResult info_; // column name info for this catalog CatalogInfoEntry* entry_; // ptr to the config entry for this catalog // query server for catalog column names and put result in info_ virtual int getInfo(); virtual int checkInfo(); // generate the query string from the given url and query info virtual int genHttpQuery (char* buf, int bufsz, const AstroQuery& q, const char* url); // generate a new temp filename to hold an image or preview data void newTempFile(); public: // constructor - create catalog class instance // note: public interface uses AstroCatalog::open(). // The argument represents the entry in the catalog config file for this catalog AstroCatalog(CatalogInfoEntry*); // destructor - close catalog and free any resources virtual ~AstroCatalog(); // copy constructor AstroCatalog(const AstroCatalog&); // open the named catalog and return a pointer to a new // AstroCatalog object created for it or NULL if errors occur static AstroCatalog* open(const char* name); // use a name server catalog (like simbad_ns@eso or ned_ns@eso) // to get the coordinates from the object name. If feedback is not NULL, // status info is written to the given open file. static int nameToWorldCoords( const char* objName, WorldOrImageCoords& pos, const char* nameServer = "simbad_ns@eso", FILE* feedback = NULL); // Return true if the given entry is for a catalog, archive or name server static int isCatalog(CatalogInfoEntry*); // Return true if the given entry is for an image server static int isImageServer(CatalogInfoEntry*); // Return true if the given entry is for a local catalog static int isLocalCatalog(CatalogInfoEntry*); // Generate an error message indicating that the wrong type of catalog was used. static int wrongServType(CatalogInfoEntry*); // Pass a query to the catalog and return the number of objects found. virtual int query(const AstroQuery& q, const char* filename, QueryResult& result); // return the symbol entry for this catalog (symbol info for plotting) const char* symbol() {return entry_->symbol();} // return the search_cols entry for this catalog const char* searchCols() {return entry_->searchCols();} // return the sort_cols entry for this catalog const char* sortCols() {return entry_->sortCols();} // return the sort_order entry for this catalog const char* sortOrder() {return entry_->sortOrder();} // return the show_cols entry for this catalog const char* showCols() {return entry_->showCols();} // return the copyright field const char* copyright() {return entry_->copyright();} // return the help field const char* help() {return entry_->help();} // return the column index for standard fields, may be set in config file // or in header or result int id_col() {return entry_->id_col();} int ra_col() {return entry_->ra_col();} int dec_col() {return entry_->dec_col();} int x_col() {return entry_->x_col();} int y_col() {return entry_->y_col();} int is_tcs() {return entry_->is_tcs();} int stc_col() {return entry_->stc_col();} // PWD: more "standard" fields. const char* system() {return entry_->system();} double epoch() {return entry_->epoch();} const char* equinoxprefix() {return entry_->equinoxprefix();} const char* unit() {return entry_->unit();} const char* ucd() {return entry_->ucd();} const char* utype() {return entry_->utype();} const char* datatype() {return entry_->datatype();} // return or set comments associated with catalog const char* comments() {return entry_->comments();} void comments(const char* comments) {entry_->comments(comments);} // return true if the catalog uses world coordinates int isWcs() {return entry_->isWcs();} // return true if the catalog uses image pixel coords int isPix() {return entry_->isPix();} // return the equinox of the catalog (default: 2000.) double equinox() {return entry_->equinox();} // set the file ptr to use for http feedback during transfers void feedback(FILE* f) {http_.feedback(f);} // member access: // return status (after constructor) for error checking int status() {return status_;} // return the name of this catalog const char* name() {return entry_->longName();} const char* longName() {return entry_->longName();} const char* shortName() {return entry_->shortName();} // return the serv_type entry from the config file ("catalog", "local", ...) const char* servType() {return entry_->servType();} // return the url field from the config file const char* url() {return entry_->url();} // return the number of columns in the catalog virtual int numCols() ; // return the column names virtual char** colNames() ; virtual const char* colName(int col); // return the column index for the given column name virtual int colIndex(const char* colName); // return true if the catalog contains the given column int hasCol(const char* name) {return (colIndex(name) >= 0);} // return true if more than "maxRows" rows would have been available // to the last call to query() int more() {return more_;} // set/get the temp file to use for getting preview data via http void tmpfile(const char* name); const char* tmpfile() {return tmpfile_;} // Request an image from the image server based on the given query description int getImage(const AstroQuery& q); // Given a URL for an image, request the image from the image server int getImage(const char* url); // fetch a preview image or plot data using the given url int getPreview(const char* url, char*& content_type); // return the handle for the HTTP object used to do the GET // (can be used to determine header values, or check if a // username and password are needed) HTTP& http() {return http_;} // get the catalog config entry for this catalog CatalogInfoEntry* entry() {return entry_;}; // For the VLT Catalog interface // Get the number of columns and the column names // for the this catalog and return 0 if all is OK virtual int getDescription( int& numCols, // out - number of result columns char**& colNames); // out - reference to array of column names // Get the values for the specified columns for the object given by "id" // in the catalog and return 0 if all is OK virtual int getObject( const char* id, // in - object id in catalog int numCols, // in - number of columns to get char** colNames, // in - array of column names to read QueryResult& result); // out - ref to object managing result // Get the values for all objects in the specified world coordinates area // Note: This routines returns the number of rows found (in numFound). virtual int getArea( int numCols, // in - number of columns to get char** colNames, // in - array of column names to read const WorldOrImageCoords& pos0, // in - coordinates of area - first point const WorldOrImageCoords& pos1, // in - second point of area double mag0, // in - min magnitude double mag1, // in - max magnitude int maxRows, // in - max number of rows to return const char* filename, // in - if not null, write results to this file int& numFound, // out - number of objects found QueryResult& result); // out - ref to object managing result // Get the values for all objects in the specified circle/ring. // Note: This routines returns the number of rows found (in numFound). virtual int circularSearch( int numCols, // in - number of columns to get char** colNames, // in - array of column names to read const WorldOrImageCoords& pos, // in - center position in world coordinates double radius0, // in - min radius double radius1, // in - max radius double mag0, // in - min magnitude double mag1, // in - max magnitude int maxRows, // in - max number of rows to return const char* filename, // in - if not null, write results to this file int& numFound, // out - number of objects found QueryResult& result); // out - ref to object managing result // search for the star closest to the given position, with the magnitude in // the given range and return (via the last 2 args) the columns requested // by "colNames" virtual int searchClosestStar( int numCols, // in - number of columns to get char** colNames, // in - array of column names to read const WorldOrImageCoords& pos, // in - center position in world coordinates double mag0, // in - min magnitude double mag1, // in - max magnitude QueryResult& result); // out - ref to object managing result // search for the stars fulfilling the specified criteria virtual int CatalogSearch( int numCols, // in - number of columns to get char** colNames, // in - array of column names to read int numSearchCols, // in - number of search cond. columns char** searchCols, // in - array of search cond.column names char** minVals, // in - optional array of min search values char** maxVals, // in - optional array of max search values int maxRows, // in - max number of rows to return const char* filename, // in - if not null, write results to this file int& numFound, // out - number of objects found QueryResult& result); // out - ref to object managing result // return the text of the previous error message static const char* getError(); // reset the error message buffer to empty static void clearError(); }; #endif /* _AstroCatalog_h_ */ skycat-3.1.2-starlink-1b/cat/generic/AstroImage.C000066400000000000000000000155111215713201500214620ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: AstroImage.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * AstroImage.C - method definitions for class AstroImage * * ------------------------------------------------------------------ * NOTE: This class is obsolete, please use the AstroCatalog class * instead. * ------------------------------------------------------------------ * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ static const char* const rcsId="@(#) $Id: AstroImage.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include #include #include #include "error.h" #include "DCompress.h" #include "AstroImage.h" /* * constructor - used internally only, public interface uses "open(name)" */ AstroImage::AstroImage(CatalogInfoEntry* e) : entry_(e), status_(OK) { // set default temp file for holding images char buf[32]; sprintf(buf, "/tmp/img%d.fits", (int)getpid()); tmpfile_ = strdup(buf); } /* * destructor - close catalog and free any resources */ AstroImage::~AstroImage() { unlink(tmpfile_); if (tmpfile_) free(tmpfile_); } /* * copy constructor */ AstroImage::AstroImage(const AstroImage& a) { tmpfile_ = a.tmpfile_ ? strdup(a.tmpfile_) : (char*)NULL; } /* * set the name of the temp file used to hold the image */ void AstroImage::tmpfile(const char* name) { if (tmpfile_) free(tmpfile_); tmpfile_ = strdup(name); } /* * open the named image server and return a pointer to an AstroImage * object for it, or NULL if errors occur */ AstroImage* AstroImage::open(const char* name) { // get the entry for this image server type CatalogInfoEntry* e = CatalogInfo::lookup(name); if (!e) return NULL; if (strcmp(e->servType(), "imagesvr") == 0) { return new AstroImage(e); } fmt_error("'%s' is of type '%s', and not 'imagesvr' as required here", name, e->servType()); return NULL; } /* * Request an image from the image server and return 0 if all is ok. * The name of a FITS file containing the resulting image can be accessed as * this->tmpfile(). * * The catalog config file defines the URL used to get the image. The URL * may contain variables to be expanded: * * %ra, %dec - replaced with the ra,dec world coords of the center position * * %x, %y - replaced with the x,y image coords of the center position * * %w, %h - replaced with the width and heith arguments in arcmin for * world coords or pixels for image coords. * * Note each catalog supports either world coords or image coords, but not * both. * */ int AstroImage::getImage(const WorldOrImageCoords& pos, double width, double height) { if (pos.isNull() || width <= 0 || height <= 0) { return error("must set position, width and height for image request"); } // if the first URL doesn't work, try the others, if specified const char* urls[3]; urls[0] = entry_->url(); urls[1] = entry_->backup1(); urls[2] = entry_->backup2(); // for each url, backup-url, etc... for (int i = 0; i < 3 && urls[i]; i++) { // generate the http url command ostringstream os; // expand the variables in the http server command const char* p = urls[i]; while(*p) { if (*p == '%') { p++; if (strncmp(p, "ra", 2) == 0) { os << pos.ra(); p += 2; } else if (strncmp(p, "dec", 3) == 0) { // include plus sign, if needed os << pos.dec(); p += 3; } else if (*p == 'x') { os << pos.x(); p++; } else if (*p == 'y') { os << pos.y(); p++; } else if (*p == 'w') { os << width; p++; } else if (*p == 'h') { os << height; p++; } else if (strncmp(p, "mime-type", 9) == 0) { // os << "image/x-gfits"; // ?should be hard coded in the config file os << "application/x-fits"; // ?should be hard coded in the config file p += 9; } } else { os << *p++; } } if (getImage(os.str().c_str()) == 0) return 0; // don't go to backup URL if it was a request for authorization if (http_.authorizationRequired()) return 1; } return 1; // error } /* * Given a URL for the image, request the image from the image server and * return 0 if all is ok. The name of the FITS file containing the * resulting image can be accessed with the method "this->tmpfile()" */ int AstroImage::getImage(const char* url) { // open the tmp file ofstream f(tmpfile_); if (!f) { return error("could not open file for writing", tmpfile_); } if (http_.get(url, f) != 0) return ERROR; f.close(); // check the Content-type of the return image to determine whether it // needs to be decompressed and if so, how... char* ctype = http_.content_type(); if (!ctype) ctype = (char *)""; // if the Content-type is not recognized... if (strncmp(ctype, "image/", 6) != 0) { // check if it might still be a FITS file: ifstream is(tmpfile_); char buf[81]; if (is && is.get(buf, 80) && strncmp(buf, "SIMPLE", 6) == 0) return 0; // if not a FITS file, try to interpret as a HTML error is.seekg(0); return http_.html_error(is); } char* t = ctype+6; // In some cases the Content-type only gives the general type and // we need to check the Content-Encoding also. For example "file.fits.gz" // might have a Content-type of image/x-fits and Content-Encoding of // x-gzip char* ce = http_.content_encoding(); if (strcmp(t, "x-fits") == 0 && ce != NULL) { if (strcmp(ce, "x-gzip") == 0) t = (char *)"x-gfits"; else if (strcmp(ce, "x-compress") == 0) t = (char *)"x-cfits"; } if (strcmp(t, "x-fits") == 0) { // Pure FITS file return 0; // not compressed, just return filename } Compress::CompressType type = Compress::NO_COMPRESS; if (strcmp(t, "x-hfits") == 0) { // Hcompressed FITS file type = Compress::H_COMPRESS; } else if (strcmp(t, "x-gfits") == 0) { // GZIPed FITS file type = Compress::GZIP_COMPRESS; } else if (strcmp(t, "x-cfits") == 0) { // Compressed FITS file (UNIX) type = Compress::UNIX_COMPRESS; } else if (strcmp(t, "x-sfits") == 0) { // Compressed FITS file (Stark) // type = Compress::S_COMPRESS; return error("x-sfits compression (Stark) not supported"); } else { return error("unknown image Content-type: ", ctype); } // do the decompression FILE* feedback = http_.feedback(); if (feedback) { fprintf(feedback, "decompressing image...\n"); fflush(feedback); } Compress c; if (c.decompress(tmpfile_, type) != 0) { return ERROR; } // if we got here, then we have the FITS file return 0; } skycat-3.1.2-starlink-1b/cat/generic/AstroImage.h000066400000000000000000000065551215713201500215370ustar00rootroot00000000000000// -*-c++-*- #ifndef _AstroImage_h_ #define _AstroImage_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: AstroImage.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * AstroImage.h - base class definitions for classes that retrieve an image * from a catalog based on object name, position, width and height. * * ------------------------------------------------------------------ * NOTE: This class is obsolete, please use the AstroCatalog class * instead. * ------------------------------------------------------------------ * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 30 Sep 95 Created */ #include #include "HTTP.h" #include "WorldOrImageCoords.h" #include "CatalogInfo.h" /* * Class AstroImage * * This class is used to retrieve images from a remote image server based * on a name or position and a width and height in arc minutes. The main * entry point is the "open" method, which returns a pointer to a class * object for the image server. */ class AstroImage { protected: HTTP http_; // http server handle char* tmpfile_; // temp file to hold fits image int status_; // status after constructor CatalogInfoEntry* entry_; // ptr to the entry for this image svr // constructor - create catalog class instance // note: public interface uses AstroImage::open to hide subclass info AstroImage(CatalogInfoEntry*); public: // copy constructor AstroImage(const AstroImage&); // destructor - close catalog and free any resources virtual ~AstroImage(); // open the named catalog and return a pointer to an AstroImage // object allocated for it or NULL if errors occur static AstroImage* open(const char* name); // pass a request to the catalog and return the name of a FITS file // containing the resulting image, or NULL if not found int getImage(const WorldOrImageCoords& pos, double width, double height); int getImage(const char* url); // return a pointer to the first config entry // (for link list traversal) static CatalogInfoEntry* firstCatalog() { return CatalogInfo::first(); } // set the file ptr to use for http feedback during image transfers void feedback(FILE* f) {http_.feedback(f);} // member access: // return status (after constructor) for error checking int status() {return status_;} // return the handle for the HTTP object used to do the GET // (can be used to determine header values, or check if a // username and password are needed) HTTP& http() {return http_;} // set/get the temp file to use for getting images via http void tmpfile(const char* name); const char* tmpfile() {return tmpfile_;} // return the name of this service const char* name() {return entry_->longName();} const char* longName() {return entry_->longName();} const char* shortName() {return entry_->shortName();} // return the copyright field const char* copyright() {return entry_->copyright();} // return the help field const char* help() {return entry_->help();} // return true if the image server uses world coordinates int isWcs() {return entry_->isWcs();} // return true if the image server uses image pixel coordinates int isPix() {return entry_->isPix();} }; #endif /* _AstroImage_h_ */ skycat-3.1.2-starlink-1b/cat/generic/AstroQuery.C000066400000000000000000000165021215713201500215460ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: AstroQuery.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * AstroQuery.C - method definitions for class AstroQuery * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ static const char* const rcsId="@(#) $Id: AstroQuery.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include "error.h" #include "util.h" #include "AstroQuery.h" /* * constructor - initialize fields to null values. */ AstroQuery::AstroQuery() : id_(NULL), pos_(), mag1_(0.0), mag2_(0.0), radius1_(0.0), radius2_(0.0), width_(0.0), height_(0.0), numCols_(0), colNames_(NULL), maxRows_(0), numSortCols_(0), sortCols_(NULL), numSearchCols_(0), searchCols_(NULL), minValues_(NULL), maxValues_(NULL) { } /* * copy constructor */ AstroQuery::AstroQuery(const AstroQuery& a) : id_(a.id_ ? strdup(a.id_) : (char*)NULL), pos_(a.pos_), mag1_(a.mag1_), mag2_(a.mag2_), radius1_(a.radius1_), radius2_(a.radius2_), width_(a.width_), height_(a.height_), numCols_(a.numCols_), colNames_(copyArray(a.numCols_, a.colNames_)), maxRows_(a.maxRows_), numSortCols_(a.numSortCols_), sortCols_(copyArray(a.numSortCols_, a.sortCols_)), numSearchCols_(a.numSearchCols_), searchCols_(copyArray(a.numSearchCols_, a.searchCols_)), minValues_(copyArray(a.numSearchCols_, a.minValues_)), maxValues_(copyArray(a.numSearchCols_, a.maxValues_)) { } /* * destructor */ AstroQuery::~AstroQuery() { if (id_) free(id_); // PWD: let these leak. In fact these can be new or malloc memory // depending on various freeflag values... Need to track which. // if (colNames_) // delete[] colNames_; // if (sortCols_) // delete[] sortCols_; // if (searchCols_) // delete[] searchCols_ ; // if (minValues_) // delete[] minValues_; // if (maxValues_) // delete[] maxValues_; } /* * check that the given column name array is valid * returns 0 if the args were OK. */ static int check(int n, char** ar) { if ((n && !ar) || (ar && !n)) return error("invalid column name arguments", "", EINVAL); if (n) for (int i = 0; i < n; i++) if (!ar[i]) return error("incomplete column name array", "", EINVAL); return 0; } /* * set center pos, radius, width and height by setting 2 positions * The positions may be in World or Image coordinates (the units of * the radius, width and height are based on the type of coords - * arcmin or pixel). */ int AstroQuery::pos(const WorldOrImageCoords& p1, const WorldOrImageCoords& p2) { if (p1.status() || p2.status()) return error("invalid position argument", last_error(), EINVAL); radius1_ = 0.; pos_ = WorldOrImageCoords::center(p1, p2, radius2_, width_, height_); return pos_.status(); } /* * set the values of the min and max magnitude */ int AstroQuery::mag(double m1, double m2) { if (m1 < m2) { mag1_ = m1; mag2_ = m2; } else { mag1_ = m2; mag2_ = m1; } return 0; } /* * set the values of the min and max radius */ int AstroQuery::radius(double r1, double r2) { if (r1 < 0.0 || r2 < 0.0) return error("negative radius argument", "", EINVAL); if (r1 < r2) { radius1_ = r1; radius2_ = r2; } else { radius1_ = r2; radius2_ = r1; } // if (pos_.isWcs() && (r1 > 300.0 || r2 > 300.0)) // return error("radius too large (max 300 arcmin)", "", EINVAL); return 0; } /* * set the max radius (with 0 min radius) */ int AstroQuery::radius(double r) { if (r < 0.0) return error("negative radius", "", EINVAL); if (pos_.isNull()) return error("radius for catalog query set with no center position"); //if (pos_.isWcs() && r > 300.) // return error("radius too large (max 300 arcmin)", "", EINVAL); radius1_ = 0.0; radius2_ = r; return 0; } /* * set the number of columns and column names for the query to get * and check that the array is valid (0 and NULL is ok, use default * which is all columns). * If freeFlag is true, the memory for the array is used and freed when * no longer needed, otherwise a copy is made. * * returns 0 if the args were OK. */ int AstroQuery::colNames(int numCols, char** colNames, int freeFlag) { if (check(numCols, colNames) != 0) return ERROR; if (! freeFlag) colNames = copyArray(numCols, colNames); numCols_ = numCols; colNames_ = colNames; return 0; } /* * set the number and names of the columns to sort by. * returns 0 if the args were OK. * If freeFlag is true, the memory for the array is used and freed when * no longer needed, otherwise a copy is made. */ int AstroQuery::sort(int numSortCols, char** sortCols, int freeFlag) { if (numSortCols && check(numSortCols, sortCols) != 0) return ERROR; if (! freeFlag) sortCols = copyArray(numSortCols, sortCols); numSortCols_ = numSortCols; sortCols_ = sortCols; return 0; } /* * Set the condition for the query. This is defined as an array of column * names to compare (and the number of columns), an array of min values * and an array of max values (all char* values). * If freeFlag is true, the memory for the arrays is used and freed when * no longer needed, otherwise a copy is made. * * For backward compatibility, if the column name is "mag", the mag1 and * mag2 fields are set. * * returns 0 if the args were OK. */ int AstroQuery::condition(int n, char** cols, char** low, char** high, int freeFlag) { if ((n && (!cols || (!low && !high))) || ((cols || low || high) && !n)) return error("invalid search condition arguments", "", EINVAL); if (n) { for (int i = 0; i < n; i++) { if (!cols[i] || (high && !high[i]) || (low && !low[i])) return error("incomplete search condition arguments", "", EINVAL); // for backward compat, set mag1, mag2 if col name is mag if (strcasecmp(cols[i], "mag") == 0) { double m1, m2; if (sscanf(low[i], "%lf", &m1) == 1 && sscanf(high[i], "%lf", &m2) == 1) { mag(m1, m2); } } } } if (! freeFlag) { cols = copyArray(n, searchCols_); low = copyArray(n, minValues_); high = copyArray(n, maxValues_); } numSearchCols_ = n; searchCols_ = cols; minValues_ = low; maxValues_ = high; return 0; } /* * set the dimensions for an area query */ int AstroQuery::dim(double w, double h) { if (w < 0.0 || h < 0.0) return error("negative width or height for query", "", EINVAL); width_ = w; height_ = h; return 0; } /* * set the max magnitude (with 0 min mag) */ int AstroQuery::mag(double m) { // if (m < 0.0) // return error("negative magnitude"); mag1_ = 0.0; mag2_ = m; return 0; } /* * set the max number of rows to return */ int AstroQuery::maxRows(int n) { if (n < 0) return error("negative value set for max number of rows"); maxRows_ = n; return 0; } /* * return the name of the given column or NULL if out of range */ const char* AstroQuery::colName(int col) const { if (col >= 0 && col < numCols_) return colNames_[col]; return NULL; } skycat-3.1.2-starlink-1b/cat/generic/AstroQuery.h000066400000000000000000000102021215713201500216020ustar00rootroot00000000000000// -*-c++-*- #ifndef _AstroQuery_h_ #define _AstroQuery_h_ /* * E.S.O. - VLT project * $Id: AstroQuery.h,v 1.2 2010/07/21 19:39:54 cguirao Exp $ * * AstroQuery.h - class describing a query to search an astronomical catalog. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 27 Sep 95 Created */ #include #include #include "WorldOrImageCoords.h" /* * Class AstroQuery * * This class is used in star catalog queries to specify which object(s) * to search for. * * The class attributes specify the conditions for the search, such as * id, name, position, radius, etc. All of the fields are * optional. Fields are set to the appropriate null value, if they are * not being used. * */ class AstroQuery { protected: char* id_; // object Id WorldOrImageCoords pos_; // center position as right ascension, declination double mag1_, mag2_; // min, max magnitude of object (most, least bright) double radius1_, radius2_; // min, max radius in arcmin from center double width_, height_; // width, height in arcmin from center int numCols_; // number of columns corresp. to colNames_ below char** colNames_; // ptr to array of column names to get (default all) int maxRows_; // max number of rows to get int numSortCols_; // number of columns corresp. to sortCols_ below char** sortCols_; // array of column names to sort by int sortOrder_; // >=0 means increasing, <0 means decreasing int numSearchCols_; // number of columns corresp. to searchCols_ below char** searchCols_; // ptr to array of column names to compare char** minValues_; // ptr to array of min column values or NULL char** maxValues_; // ptr to array of max column values or NULL // copy constructor (don't use) AstroQuery(const AstroQuery&); public: // constructors: // search by object Id (for a specific object) // The Id must be gotten by a previous search... AstroQuery(); ~AstroQuery(); // member access (set and get member values) // // note: methods with args set the member values and return the error status. // methods with no args return the value. const char* id() const {return (id_ ? id_ : "");} int id(const char* s) {id_ = strdup(s); return 0;} const WorldOrImageCoords& pos() const {return pos_;} int pos(const WorldOrImageCoords& p) {pos_ = p; return p.status();} // set center, width and height by setting 2 positions int pos(const WorldOrImageCoords& p1, const WorldOrImageCoords& p2); double width() const {return width_;} void width(double w) {width_ = w;} double height() const {return height_;} void height(double h) {height_ = h;} int dim(double w, double h); double mag1() const {return mag1_;} double mag2() const {return mag2_;} int mag(double m); int mag(double m1, double m2); // set min/max mag with check double radius1() const {return radius1_;} double radius2() const {return radius2_;} int radius(double r); int radius(double r1, double r2); // set min/max radius with check char** colNames() const {return colNames_;} const char* colName(int col) const; int numCols() const {return numCols_;} int colNames(int n, char** ar, int freeFlag = 0); int numSortCols() const {return numSortCols_;} char** sortCols() const {return sortCols_;} int sort(int numSortCols, char** sortCols, int freeFlag = 0); int sortOrder() const {return sortOrder_;} void sortOrder(int i) {sortOrder_ = i;} int maxRows() const {return maxRows_;} int maxRows(int n); // set the search conditions (min and max values for given columns) int numSearchCols() const {return numSearchCols_;} char** searchCols() const {return searchCols_;} char** minValues() const {return minValues_;} char** maxValues() const {return maxValues_;} int condition(int numSearchCols, char** searchCols, char**minVals, char**maxVals, int freeFlag = 0); }; #endif /* _AstroQuery_h_ */ skycat-3.1.2-starlink-1b/cat/generic/CatalogInfo.C000066400000000000000000000770511215713201500216240ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: CatalogInfo.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * CatalogInfo.C - method definitions for class CatalogInfo, CatalogInfoEntry * * This class is used to load, edit, access and save catalog config files * either locally or via HTTP from a remote host. * * A config file contains the information necessary to access catalogs. * The syntax for each catalog entry is: * * serv_type: service type, one of: catalog, namesvr, imagesvr * directory, local ... (see Service Types below) * * long_name: long name of service for displaying * short_name: short name of service * url: URL used to access catalog, %ra,%dec, etc. expanded (see below) * * symbol: the symbol to use to plot the given column value * (see Plotting below) * * copyright: optional copyright notice to display in user interface * * help: optional URL pointing to help for the catalog * * search_cols: optional list of columns that can be searched by in the format * col1 "col1 min label" "col1 max label" : ... * example: * search_cols: mag "Brightest (min)" "Faintest (max)" * * sort_cols: optional list of columns to sort by {col1 col2 ...} * sort_order: optional: set to "increasing" or "decreasing" * * show_cols: optional list of columns to display (default: all) * * id_col: column containing id field * ra_col: * dec_col: columns containing ra and dec (for catalogs supporting WCS) * * x_col: * y_col: columns containing x,y coords (for catalogs not supporting WCS) * * is_tcs: flag: true if using TCS columns * * stc_col: column with STC region description (VO WCS) * * Service Types * --------------- * * The currently known service types are: * * catalog - server returns a tab separated table of row/col values * * namesvr - server returns a single line with id, ra and dec to resolve * the given object name * * imagesvr - server returns an image file * * directory - the URL is a pointer to another catalog config file * * local - a local catalog * * * Syntax for "url" field: * -------------------------- * * The url field is used to build a URL to get the results via HTTP. * The syntax is like this: * * http://host:port/cgi-bin/server?arg1&arg2&...argn * * (if ":port" is missing, it defaults to 80.) * * Substitutions are performed on the URL as follows: * * For catalogs: * * %ra, %dec - coordinates of center point * * %w, %h - width and height in arcmin * * %r1, %r2 - min and max radius (for circular query) * %r - use when server only accepts single radius value * * %m1, %m2 - min and max magnitude * %m - use when server only accepts single magnitude * * %n - max number of rows to return * * %cols - list of columns to return (col1,col2,...coln) * * %id - ID field of item to return (if supported) * * %mime-type - value for http mime-type field * * Name servers only need the %id field, which is set to the object name. * * Plotting column values * ---------------------- * * The syntax for the "symbol:" field is as follows: * * symbol: colnames symbol expr : colnames symbol expr : ... * * where * colnames - is a list of column names used (in symbol or expr) * * symbol - is the symbol to use, one of: square, circle, triangle, cross, * plus, diamond, ellipse. * The symbol may also be a list such as {circle yellow} and some * symbols take extra args for ratio and angle (ellipse). * * expr - is an expression in terms of colnames above, used to determine the * size of the symbol. It may also be a list {expr units}, where units * is one of {image "deg $equinox"... } (default: image) (see rtd for * coordinate syntax). The column names (colnames) can be used as variables * in the expression using "$" (following Tcl syntax). * * example: * symbol: mag circle 15-$mag : xyz square (1-$xyz)*2.5 * symbol: {a/b pa mag} {ellipse yellow ${a/b} $pa} {15-$mag} * symbol: "a/b pa mag" "ellipse yellow ${a/b} $pa" "15-$mag" * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 29 Oct 95 Created * Peter W. Draper 25 Sep 03 Modified to output ra_col and dec_col * even when at default values. Can cause * problems when x_col and y_col are also * set (after ra_col and dec_col). * 04 Jul 08 Add additional meta-data support (ucd, utype, * unit and datatype), required for VO world. * 03 Dec 08 Always output ra_col, dec_col, x_col and y_col. * This is needed for catalogues that are saved * and do not have this information set (otherwise * when read back the default columns are assumed). * 20 Mar 09 Add support for comments. Note these are not * output as they are verbose and associated * with local catalogues (so are volatile). */ static const char* const rcsId="@(#) $Id: CatalogInfo.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include #include #include "error.h" #include "util.h" #include "HTTP.h" #include "CatalogInfo.h" using namespace std; // define the default URL for the catalog config info const char* catlib_config_url_ = "http://archive.eso.org/skycat/skycat2.0.cfg"; // config info used if the http config file can't be found static const char* config_info_ = "serv_type: catalog\n" "long_name: Guide Star Catalog at ESO\n" "short_name: gsc@eso\n" "url: http://archive.eso.org/skycat/servers/gsc-server?%ra%dec&obj=%id&r=%r1,%r2&m=%m1,%m2&n=%n&f=8&s=R&F=*\n" "symbol: mag circle 15-$mag\n" "search_cols: mag \"Brightest (min)\" \"Faintest (max)\"" "\n" "serv_type: imagesvr\n" "long_name: Digitized Sky Server at ESO\n" "short_name: dss@eso\n" "url: http://archive.eso.org/cgi-bin/dss?ra=%ra&dec=%dec&mime-type=%mime-type&x=%w&y=%h\n" "\n" "serv_type: namesvr\n" "long_name: SIMBAD Names\n" "short_name: simbad_ns@eso\n" "url: http://archive.eso.org/cgi-bin/sim-server?&o=%id\n" "\n" "serv_type: directory\n" "long_name: ESO Catalogs\n" "short_name: catalogs@eso\n" "url: http://archive.eso.org/skycat/skycat2.0.cfg\n" ; // linked list of catalog entries CatalogInfoEntry* CatalogInfo::entries_ = NULL; // initial undefined column index value static const int undef_col_ = -99; /* * strip leading and trailing white space from s and * return the result (s is modified) */ static char* strip(char* s) { char* p = s; while(isspace(*p)) p++; s = p; p += (strlen(p) - 1); while(p >= s && isspace(*p)) *p-- = '\0'; return s; } /* * split buf on the ':' char and strip leading and trailing * white space on both keyword and value */ int split(char* buf, char*& keyword, char*& value) { // split keyword : value char* p = strchr(buf, ':'); if (!p) return 1; *p++ = '\0'; keyword = strip(buf); value = strip(p); return 0; } /* * read a line from the stream into buf and return the stream. * Lines ending with backslash are continued on the next line */ istream& CatalogInfo::getline(istream& f, char* buf, int size) { if (f.getline(buf, size)) { char* p = buf; int i = strlen(p); if ( i > 0 ) { i -= 1; while(f && p[i] == '\\') { size -= i; p = p + i; if (f.getline(p, size)) { i = strlen(p); if ( i == 0 ) break; i -= 1; } } } } return f; } /* * load a catalog config file from the given istream, construct a * linked list of entries from the file and return a pointer to the * first entry in the list, or NULL if there were errors. * * The arguments are: * * f - istream open for reading the config file (or buffer) * filename - name of file (or URL) for error reporting */ CatalogInfoEntry* CatalogInfo::load(istream& f, const char* filename) { int line = 0; // line number in config file char buf[10*2048]; // contents of a line char* keyword; // left of ':' char* value; // right of ':' CatalogInfoEntry* entry = NULL; // for list of catalog entries CatalogInfoEntry* first = NULL; while(getline(f, buf, sizeof(buf))) { line++; // skip comments and empty lines if (buf[0] == '#' || strlen(buf) == 0) continue; // split keyword : value if (split(buf, keyword, value) != 0) { cfg_error(filename, line, "missing ':'"); delete first; return NULL; } if (strcmp(keyword, "serv_type") == 0) { // check that the current entry is complete and start a new one if (entry) { char* s; if ((s = entry->check()) != NULL) { cfg_error(filename, line, s); delete first; return NULL; } if (first != entry) { if (first->append(entry) != 0) { delete first; return NULL; } } entry = new CatalogInfoEntry; } else { // start the first entry first = entry = new CatalogInfoEntry; } } else if (! entry) { cfg_error(filename, line, "missing 'serv_type:' keyword"); delete first; return NULL; } set_entry_value(entry, keyword, value, 0); } // check last entry if (entry) { char* s; if ((s = entry->check()) != NULL) { cfg_error(filename, line, s); delete first; return NULL; } if (first != entry) { if (first->append(entry) != 0) { delete first; return NULL; } } } else { error("no entries in config file: ", filename); } return first; } /* * Set the value for the given keyword in the given entry. If updateFlag * is 1, only set fields that may be updated after an entry is * created. Fields such as the catalog name and URL may not be modified, * but the symbol and search_col info may be. * * We want to avoid overwriting changes that a user may have made interactively * in an application. Where it makes sense, string fields are only updated if * they were not already set. */ int CatalogInfo::set_entry_value(CatalogInfoEntry* entry, const char* keyword, const char* value, int updateFlag) { if (!updateFlag) { if (strcmp(keyword, "serv_type") == 0) { entry->servType(value); } else if (strcmp(keyword, "long_name") == 0) { entry->longName(value); } else if (strcmp(keyword, "short_name") == 0) { entry->shortName(value); } else if (strcmp(keyword, "url") == 0) { entry->url(value); } else if (strcmp(keyword, "backup1") == 0) { entry->backup1(value); } else if (strcmp(keyword, "backup2") == 0) { entry->backup2(value); } } if (strcmp(keyword, "symbol") == 0) { if (! entry->symbol()) entry->symbol(value); } else if (strcmp(keyword, "search_cols") == 0) { if (! entry->searchCols()) entry->searchCols(value); } else if (strcmp(keyword, "sort_cols") == 0) { if (! entry->sortCols()) entry->sortCols(value); } else if (strcmp(keyword, "sort_order") == 0) { if (! entry->sortOrder()) entry->sortOrder(value); } else if (strcmp(keyword, "show_cols") == 0) { if (! entry->showCols()) entry->showCols(value); } else if (strcmp(keyword, "copyright") == 0) { entry->copyright(value); } else if (strcmp(keyword, "help") == 0) { entry->help(value); } else if (strcmp(keyword, "id_col") == 0) { int id_col = undef_col_; if (sscanf(value, "%d", &id_col) == 1 && id_col != undef_col_) entry->id_col(id_col); } else if (strcmp(keyword, "ra_col") == 0) { int ra_col = undef_col_; if (sscanf(value, "%d", &ra_col) == 1 && ra_col != undef_col_) entry->ra_col(ra_col); } else if (strcmp(keyword, "dec_col") == 0) { int dec_col = undef_col_; if (sscanf(value, "%d", &dec_col) == 1 && dec_col != undef_col_) entry->dec_col(dec_col); } else if (strcmp(keyword, "x_col") == 0) { int x_col = undef_col_; if (sscanf(value, "%d", &x_col) == 1 && x_col != undef_col_) entry->x_col(x_col); } else if (strcmp(keyword, "y_col") == 0) { int y_col = undef_col_; if (sscanf(value, "%d", &y_col) == 1 && y_col != undef_col_) entry->y_col(y_col); } else if (strcmp(keyword, "is_tcs") == 0) { int is_tcs = 0; if (sscanf(value, "%d", &is_tcs) == 1) entry->is_tcs(is_tcs); } // PWD: extras. else if (strcmp(keyword, "stc_col") == 0) { int stc_col = undef_col_; if (sscanf(value, "%d", &stc_col) == 1 && stc_col != undef_col_) entry->stc_col(stc_col); } else if (strcmp(keyword, "system") == 0) { entry->system(value); } else if (strcmp(keyword, "epoch") == 0) { double d; const char *p = value; if ( p[0] == 'j' || p[0] == 'J' ) { entry->epochprefix( "J" ); p++; } else if ( p[0] == 'b' || p[0] == 'B' ) { entry->epochprefix( "B" ); p++; } else { entry->epochprefix( "" ); } if (sscanf(p, "%lf", &d) == 1) { entry->epoch(d); } } else if (strcmp(keyword, "equinox") == 0) { double d; const char *p = value; if ( p[0] == 'j' || p[0] == 'J' ) { entry->equinoxprefix( "J" ); p++; } else if ( p[0] == 'b' || p[0] == 'B' ) { entry->equinoxprefix( "B" ); p++; } else { entry->equinoxprefix( "" ); } if (sscanf(p, "%lf", &d) == 1) { entry->equinox(d); } } else if (strcmp(keyword, "unit") == 0) { entry->unit(value); } else if (strcmp(keyword, "ucd") == 0) { entry->ucd(value); } else if (strcmp(keyword, "utype") == 0) { entry->utype(value); } else if (strcmp(keyword, "datatype") == 0) { entry->datatype(value); } else if ( strcmp(keyword, "comments") == 0) { entry->comments(value); } return 0; } /* * report the error with the filename and line number included */ int CatalogInfo::cfg_error(const char* filename, int line, const char* msg1, const char* msg2) { ostringstream os; os << "error in catalog config file: " << filename << ": line " << line << ": " << msg1 << msg2; return error(os.str().c_str()); } /* * This static method is used to load the root catalog config info * the first time through and return the error status (0 is OK, * 1 for error). */ int CatalogInfo::load() { if (entries_) delete entries_; entries_ = loadRootConfig(); if (!entries_) return 1; // error // add a link to the main ESO config URL, if it is not already there const char* longName = "ESO Catalogs"; const char* shortName = "catalogs@eso"; if (strcmp(entries_->url(), catlib_config_url_) != 0 && ! lookup(entries_, longName) && ! lookup(entries_, shortName)) { CatalogInfoEntry* e = new CatalogInfoEntry; e->servType("directory"); e->url(catlib_config_url_); e->longName(longName); e->shortName(shortName); if (append(e) != 0) return 1; // error } return 0; } /* * This static method is used to reload the root catalog config info * after it has been edited by hand, to make the new data available * in the application. Since pointers to the current entries may still * be in use, we need to update the existing entries. */ int CatalogInfo::reload() { // get default config CatalogInfoEntry* root = loadRootConfig(); if (!root) return 1; // error int status = reload(first(), root->link()); delete root; return status; } /* * This static method is used to reload catalog config info after it has * been edited by hand, to make the new data available in the * application. Since pointers to the old entries may still be in use, we * need to update the old entries with the data from the new * entries. */ int CatalogInfo::reload(CatalogInfoEntry* oldEntry, CatalogInfoEntry* newEntry) { // merge into existing entries for (CatalogInfoEntry* ne = newEntry; ne != NULL; ne = ne->next()) { // see if we have this entry already, and if so, update it int found = 0; for (CatalogInfoEntry* e = oldEntry; e != NULL; e = e->next()) { if (strcmp(e->longName(), ne->longName()) == 0 || strcmp(e->shortName(), ne->shortName()) == 0) { if (e->link()) { // follow opened catalog directory links if (strcmp(ne->servType(), "directory") == 0) { if (load(ne) != 0 || reload(e->link(), ne->link()) != 0) return 1; // error } } // copy the data from the new entry to update the old one // and restore the catalog directory link, if any, since // the update is recursive and follows directory links. CatalogInfoEntry* link = e->link(); CatalogInfoEntry* next = e->next(); *e = *ne; // (see CatalogInfoEntry::operator=, no links copied) e->link(link); e->next(next); found++; break; } } if (!found) { // if this is a new entry, append a copy of it // (see copy constructor: no links copied) CatalogInfoEntry* copy = new CatalogInfoEntry(*ne); oldEntry->append(copy); } } // Remove any "dead" entries (entries that were deleted from the config file). CatalogInfoEntry* e = oldEntry; while (e != NULL) { int found = 0; for (CatalogInfoEntry* ne = newEntry; ne != NULL; ne = ne->next()) { if (strcmp(e->longName(), ne->longName()) == 0 || strcmp(e->shortName(), ne->shortName()) == 0) { found++; break; } } if (!found) { // Entry not found in the new list, remove it CatalogInfoEntry* next = e->next(); remove(e); e = next; } else { e = e->next(); } } return 0; } /* * This static method is used to load the root catalog config info the * first time through and return a pointer to the root entry, or NULL * if there was an error. * * The root catalog config file is searched for in the following URL * locations: * * $CATLIB_CONFIG * $SKYCAT_CONFIG (for backward compat) * ESO default URL * hard coded default */ CatalogInfoEntry* CatalogInfo::loadRootConfig() { // look for a catalog config file in the standard places and make the // first one found the root of the catalog server tree CatalogInfoEntry* e = new CatalogInfoEntry; e->servType("directory"); e->longName("Default Catalog List"); e->shortName("default"); // check the CATLIB_CONFIG environment variable char* url = getenv("CATLIB_CONFIG"); if (url) { e->url(url); if (load(e) == 0) return e; } // check the SKYCAT_CONFIG environment variable url = getenv("SKYCAT_CONFIG"); if (url) { e->url(url); if (load(e) == 0) return e; } // try the default URL e->url(catlib_config_url_); if (load(e) == 0) return e; // if all else fails, use this hard coded config info e->url("default"); istringstream is(config_info_); e->link(load(is)); if (! e->link()) { delete e; return NULL; // error } return e; // normal return } /* * This static method is used to load catalog config info and return the * error status (0 is OK, 1 for error). * * The argument should be a catalog entry of type "directory", where the * URL points to the catalog config file. There may be multiple such * entries in the form of a catalog server tree. */ int CatalogInfo::load(CatalogInfoEntry* e) { // loop through the url list until success HTTP http; int nlines = 0; char * s = http.get(e->url(), nlines); if (!s) return 1; // http error char* ctype = (http.content_type() ? http.content_type() : (char*)""); if (strcmp(ctype, "text/html") == 0) { // most likely an error message return http.html_error(s); } istringstream is(s); e->link(load(is, e->url())); if (! e->link()) return 1; // input error // if it is a local config file, allow URL commands if (strncmp(e->url(), "file:", 5) == 0) HTTP::allowUrlExec(1); return 0; // normal return } /* * return a pointer to the first config file entry * Note that entries_ points to the root of a hierarchical list * of catalog entries. Here we return the first item under the root. */ CatalogInfoEntry* CatalogInfo::first() { // load the config file the first time through if (!entries_) if (load() != 0) return NULL; return entries_->link(); } /* * return a pointer to the root config file entry. */ CatalogInfoEntry* CatalogInfo::root() { // load the config file the first time through if (!entries_) if (load() != 0) return NULL; return entries_; } /* * This static method returns a pointer to the catalog config entry for * the given catalog */ CatalogInfoEntry* CatalogInfo::lookup(const char* name) { // load the config file the first time through if (!entries_) if (load() != 0) return NULL; CatalogInfoEntry* e = lookup(entries_, name); if (e) return e; // if "name" is not a known catalog, it might be a local catalog in a file // in tab table format. if (access(name, R_OK) == 0) return lookupFile(name); error("unknown catalog name: ", name); return NULL; } /* * This static method returns a pointer to the catalog config entry for * the given catalog, searching only in the catalog directory specified by * the given entry. */ CatalogInfoEntry* CatalogInfo::lookup(CatalogInfoEntry* entry, const char* name) { // special case at root? if (entry == entries_ && strcmp(name, entry->longName()) == 0) return entry; for (CatalogInfoEntry* e = entry->link(); e != NULL; e = e->next()) { if (strcmp(e->longName(), name) == 0 || strcmp(e->shortName(), name) == 0) return e; } return NULL; } /* * Make a catalog config entry for a local catalog. * * See if the given file has a catalog config entry in the header part * (we add this to the header of a local catalog in * QueryResult::printTableTop). If no config info can be found in the * header, make a default catalog entry for it. * * The return value is a pointer to the new entry or NULL for errors. */ CatalogInfoEntry* CatalogInfo::lookupFile(const char* name) { ifstream is(name); if (!is) { sys_error("can't open file: ", name); return NULL; } CatalogInfoEntry* entry = new CatalogInfoEntry; // add fields from the file header updateConfigEntry(is, entry); // add fixed entries entry->servType("local"); entry->longName(name); entry->shortName(fileBasename(name)); entry->url(name); if (append(entry) != 0) { delete entry; return NULL; } return (entry); } /* * Append the given entry to the end of the top level catalog directory * list */ int CatalogInfo::append(CatalogInfoEntry* e) { // add to end of top level entry list, don't allow duplicates for (CatalogInfoEntry* p = first(); p != NULL; p = p->next()) { if (strcmp(p->longName(), e->longName()) == 0 || strcmp(p->shortName(), e->shortName()) == 0) { // fprintf(stderr, "warning: duplicate entry in catalog list: %s (%s)\n", // e->longName(), e->shortName()); return 0; } if (!p->next()) { p->next(e); break; } } return 0; } /* * Remove the given entry from the catalog directory list. It is removed * from the list but not deleted, as it might still be referenced * somewhere. */ int CatalogInfo::remove(CatalogInfoEntry* e) { remove(e, entries_); return 0; } /* * Remove the given entry from the given catalog directory list. It is * removed from the list but not deleted, as it might still be referenced * somewhere. */ void CatalogInfo::remove(CatalogInfoEntry* e, CatalogInfoEntry* dir) { if (e) { if (e == dir->link()) { // first item in sublist dir->link(e->next()); e->next(NULL); } else { for (CatalogInfoEntry* p = dir->link(); p != NULL; p = p->next()) { if (p->next() == e) { p->next(e->next()); e->next(NULL); break; } if (p->link()) remove(e, p); } } } } /* * Read config keyword entries from the given stream and update the given * entry values. */ void CatalogInfo::updateConfigEntry(istream& is, CatalogInfoEntry* entry) { if (! entry) return; char buf[2048]; char* keyword; // left of ':' char* value; // right of ':' while (getline(is, buf, sizeof(buf))) { if (buf[0] == '-') break; // end of header // skip comments and empty lines if (buf[0] == '#' || strlen(buf) == 0) continue; // split keyword : value if (split(buf, keyword, value) != 0) { continue; } set_entry_value(entry, keyword, value, 1); } } /* * default constructor - initialize null keyword values amd set default * column values. */ CatalogInfoEntry::CatalogInfoEntry() : id_col_(undef_col_), ra_col_(undef_col_), dec_col_(undef_col_), x_col_(undef_col_), y_col_(undef_col_), is_tcs_(0), stc_col_(undef_col_), equinox_(2000.), epoch_(2000.), link_(NULL), next_(NULL) { for (int i = 0; i < NUM_KEY_STRINGS_; i++) val_[i] = NULL; } /* * copy constructor */ CatalogInfoEntry::CatalogInfoEntry(const CatalogInfoEntry& e) : id_col_(e.id_col_), ra_col_(e.ra_col_), dec_col_(e.dec_col_), x_col_(e.x_col_), y_col_(e.y_col_), is_tcs_(e.is_tcs_), stc_col_(undef_col_), equinox_(e.equinox_), epoch_(e.epoch_), link_(NULL), // no links or marks copied next_(NULL) { for (int i = 0; i < NUM_KEY_STRINGS_; i++) val_[i] = e.val_[i] ? strdup(e.val_[i]) : (char*)NULL; } /* * assignment operator */ CatalogInfoEntry& CatalogInfoEntry::operator=(const CatalogInfoEntry& e) { id_col_ = e.id_col_; ra_col_ = e.ra_col_; dec_col_ = e.dec_col_; x_col_ = e.x_col_; y_col_ = e.y_col_; is_tcs_ = e.is_tcs_; stc_col_ = e.stc_col_; equinox_ = e.equinox_; epoch_ = e.epoch_; // don't copy the links or marks for (int i = 0; i < NUM_KEY_STRINGS_; i++) val_[i] = e.val_[i] ? strdup(e.val_[i]) : (char*)NULL; return *this; } /* * destructor */ CatalogInfoEntry::~CatalogInfoEntry() { if (link_) delete link_; if (next_) delete next_; for (int i = 0; i < NUM_KEY_STRINGS_; i++) { if (val_[i]) { free(val_[i]); val_[i] = NULL; } } } /* * check that all required fields have been set and return an error message * if any field is missing, otherwise NULL if there were no errors */ char* CatalogInfoEntry::check() { if (longName() == NULL) return (char *)"missing long_name"; if (shortName() == NULL) return (char *)"missing short_name"; if (url() == NULL) return (char *)"missing url"; return NULL; // OK } /* * Return the column number for the id, default to 0, or -1 if there * is no id column */ int CatalogInfoEntry::id_col() const { if (id_col_ == undef_col_) return 0; return id_col_; } /* * Return the column number for the X coord, default to -1 (no X column) */ int CatalogInfoEntry::x_col() const { if (x_col_ == undef_col_) return -1; return x_col_; } /* * Return the column number for the Y coord, default to -1 (no Y column) */ int CatalogInfoEntry::y_col() const { if (y_col_ == undef_col_) return -1; return y_col_; } /* * Return the column number for ra, default to 1 if there is no * X column defined, or -1 if there is no ra column. */ int CatalogInfoEntry::ra_col() const { if (ra_col_ == undef_col_) { if (x_col_ == undef_col_) return 1; return -1; } return ra_col_; } /* * Return the column number for dec, default to 2 if there is no * Y column defined, or -1 if there is no dec column. */ int CatalogInfoEntry::dec_col() const { if (dec_col_ == undef_col_) { if (y_col_ == undef_col_) return 2; return -1; } return dec_col_; } /* * Return the column number for the STC region, defaults to -1 if no * STC column is defined. */ int CatalogInfoEntry::stc_col() const { if (stc_col_ == undef_col_) return -1; return stc_col_; } /* * set the value for a config keyword */ void CatalogInfoEntry::setVal_(KeyStrings keyword, const char* s) { if (val_[keyword]) { free(val_[keyword]); val_[keyword] = NULL; } if (s && strlen(s)) { val_[keyword] = strdup(s); } } /* * append the given entry to the end of the list and return an error * if there was already an entryt with the same name there. */ int CatalogInfoEntry::append(CatalogInfoEntry* e) { // add to end of top level entry list for (CatalogInfoEntry* p = this; p != NULL; p = p->next_) { if (strcmp(p->longName(), e->longName()) == 0 || strcmp(p->shortName(), e->shortName()) == 0) { // fprintf(stderr, "warning: duplicate entry in catalog list: %s (%s)\n", // e->longName(), e->shortName()); return 0; } if (!p->next_) { p->next_ = e; break; } } return 0; } /* * output operator: format similar to config file input: * keyword: value ... */ ostream& operator<<(ostream& os, const CatalogInfoEntry& e) { if (e.servType()) os << "serv_type: " << e.servType() << endl; if (e.longName()) os << "long_name: " << e.longName() << endl; if (e.shortName()) os << "short_name: " << e.shortName() << endl; if (e.url()) os << "url: " << e.url() << endl; if (e.backup1()) os << "backup1: " << e.backup1() << endl; if (e.backup2()) os << "backup2: " << e.backup1() << endl; if (e.symbol()) os << "symbol: " << e.symbol() << endl; if (e.searchCols()) os << "search_cols: " << e.searchCols() << endl; if (e.sortCols()) os << "sort_cols: " << e.sortCols() << endl; if (e.showCols()) os << "show_cols: " << e.showCols() << endl; if (e.copyright()) os << "copyright: " << e.copyright() << endl; if (e.help()) os << "help: " << e.help() << endl; if (e.equinox() != 2000.) { if ( e.equinoxprefix() ) os << "equinox: " << e.equinoxprefix() << e.equinox() << endl; else os << "equinox: " << e.equinox() << endl; } if (e.id_col() > 0) os << "id_col: " << e.id_col() << endl; // PWD: always write these values if defined. if (e.ra_col() != undef_col_ ) os << "ra_col: " << e.ra_col() << endl; if (e.dec_col() != undef_col_ ) os << "dec_col: " << e.dec_col() << endl; if (e.x_col() != undef_col_ ) os << "x_col: " << e.x_col() << endl; if (e.y_col() != undef_col_ ) os << "y_col: " << e.y_col() << endl; if (e.is_tcs()) os << "is_tcs: " << e.is_tcs() << endl; // PWD: extras. if (e.stc_col() != undef_col_ ) os << "stc_col: " << e.stc_col() << endl; if (e.epoch() != 2000.) { if ( e.epochprefix() ) os << "epoch: " << e.epochprefix() << e.epoch() << endl; else os << "epoch: " << e.epoch() << endl; } if (e.system()) os << "system: " << e.system() << endl; if (e.unit()) os << "unit: " << e.unit() << endl; if (e.ucd()) os << "ucd: " << e.ucd() << endl; if (e.utype()) os << "utype: " << e.utype() << endl; if (e.datatype()) os << "datatype: " << e.datatype() << endl; return os; } skycat-3.1.2-starlink-1b/cat/generic/CatalogInfo.h000066400000000000000000000252221215713201500216620ustar00rootroot00000000000000// -*-c++-*- #ifndef _CatalogInfo_h_ #define _CatalogInfo_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: CatalogInfo.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * CatalogInfo.h - class holding catalog config information * from the Catalog.cfg file * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 29 Sep 95 Created * Peter W. Draper 01 Jul 08 Added system, epoch, unit, ucd, utype * and datatype support, plus equinox as string. * Needed for VO interop. * 20 Mar 09 Added hooks for preserving comments extracted * from a local catalogue. * 08 May 09 Added stc_col support. */ using namespace std; #include #include #include // forward ref class CatalogInfoEntry; /* * This class manages the catalog config file info. Many of the methods * are static, since the information needs to be cached and shared by * other classes. */ class CatalogInfo { private: // handle for catalog config info for static access static CatalogInfo* catInfo_; // hierarchical list of all catalog entries static CatalogInfoEntry* entries_; // for error reporting static int cfg_error(const char* filename, int line, const char* msg1, const char* msg2 = ""); // load the root config file static CatalogInfoEntry* loadRootConfig(); // Set the value for the given keyword in the given entry static int set_entry_value(CatalogInfoEntry* entry, const char* keyword, const char* value, int updateFlag); // read a line from the stream into buf and return the stream. // Lines ending with backslash are continued on the next line static istream& getline(istream& f, char* buf, int size); // Remove the given entry from the given catalog directory list. static void remove(CatalogInfoEntry* e, CatalogInfoEntry* dir); public: // constructor CatalogInfo() {} // load the default catalog config file static int load(); // load a catalog config file static int load(CatalogInfoEntry*); // reload the default catalog config file after it has been edited by hand // and update recursively any already opened catalog directories static int reload(); // update the old catalog entry with the info from the new one (recursive) static int reload(CatalogInfoEntry* oldEntry, CatalogInfoEntry* newEntry); // load config file info from the given stream (filename for error reporting) static CatalogInfoEntry* load(istream&, const char* filename = "internal"); // return a pointer to the catalog config file entry for the given catalog static CatalogInfoEntry* lookup(const char* catalogName); // as above, but starting the search with the given entry rather than at the root static CatalogInfoEntry* lookup(CatalogInfoEntry* entry, const char* name); // get config entry for a local catalog from the header static CatalogInfoEntry* lookupFile(const char* catalogFileName); // Read config keyword entries from the given stream and update the given // entry values static void updateConfigEntry(istream& is, CatalogInfoEntry* entry); // Append the given entry to the end of the main catalog list static int append(CatalogInfoEntry* e); // Remove the given entry from the catalog list static int remove(CatalogInfoEntry* e); // return a pointer to the first config file entry under the root entry static CatalogInfoEntry* first(); // return a pointer to the root config file entry static CatalogInfoEntry* root(); }; /* * one of these is kept in a list for each catalog entry * in the config file */ class CatalogInfoEntry { friend class CatalogInfo; private: // This enum defines one keyword for each of the config keyword entries // that have string values and is used to index an array of strings // representing the keyword values. enum KeyStrings { SERVTYPE_, // service type (catalog, namesvr, imagesvr, ...) LONGNAME_, // long name for display SHORTNAME_, // short catalog name URL_, // http url to use, with wildcards %ra, %dec, ... BACKUP1_, // backup URL (1) BACKUP2_, // backup URL (2) SYMBOL_, // plot symbol info SEARCH_COLS, // list of searchable column info: colname minLabel maxLabel, ... SORT_COLS, // list of columns to sort by SORT_ORDER, // "increasing" or "decreasing" SHOW_COLS, // list of columns to display (default: all) COPYRIGHT_, // copyright notice for server HELP_, // URL pointing to help page fpr catalog SYSTEM_, // system of the celestial coordinates (FK5, FK4 etc.) EQUINOX_, // equinox qualifying string (J or B) EPOCH_, // epoch qualifying string (J or B) UNIT_, // units for all columns "unit1 \t unit2 \t \t unit4 \t..." UCD_, // UCDs for all columns "ucd1 \t ucd2 \t \t ucd4 \t..." UTYPE_, // utypes for all columns "utype1 \t utype2 \t \t utype4 \t..." DATATYPE_, // datatypes of columns, if interpreted COMMENTS_, // comments associated with entry, if any NUM_KEY_STRINGS_ // dummy last entry, number of keywords }; // array of values for config file keywords, indexed by above enum char* val_[NUM_KEY_STRINGS_]; // integer keyword values int id_col_; // column containing object id int ra_col_; // RA column int dec_col_; // DEC int x_col_; // instead of RA, can use pixel coords X,Y int y_col_; int is_tcs_; // flag: true if using TCS columns int stc_col_; // column containing STC region // double keyword values double equinox_; // equinox of wcs coords (default: J2000) double epoch_; // epoch of wcs coords (default: 2000) CatalogInfoEntry* link_; // If the url is a catalog config file or URL // this points to the first entry in that list. // (i.e.: used for a directory entry, if loaded). CatalogInfoEntry* next_; // next pointer for linked list of entries // set the value for a config keyword void setVal_(KeyStrings keyword, const char* s); public: // default constructor CatalogInfoEntry(); // copy constructor CatalogInfoEntry(const CatalogInfoEntry&); // assignment CatalogInfoEntry& operator=(const CatalogInfoEntry&); // destructor ~CatalogInfoEntry(); // check that all fields have been set and return 0 if all ok char* check(); // set string keyword values void servType(const char* s) {setVal_(SERVTYPE_, s);} void longName(const char* s) {setVal_(LONGNAME_, s);} void shortName(const char* s) {setVal_(SHORTNAME_, s);} void url(const char* s) {setVal_(URL_, s);} void backup1(const char* s) {setVal_(BACKUP1_, s);} void backup2(const char* s) {setVal_(BACKUP2_, s);} void symbol(const char* s) {setVal_(SYMBOL_, s);} void searchCols(const char* s){setVal_(SEARCH_COLS, s);} void sortCols(const char* s) {setVal_(SORT_COLS, s);} void sortOrder(const char* s) {setVal_(SORT_ORDER, s);} void showCols(const char* s) {setVal_(SHOW_COLS, s);} void copyright(const char* s) {setVal_(COPYRIGHT_, s);} void help(const char* s) {setVal_(HELP_, s);} void system(const char* s) {setVal_(SYSTEM_, s);} void equinoxprefix(const char* s) {setVal_(EQUINOX_, s);} void epochprefix(const char* s) {setVal_(EPOCH_, s);} void unit(const char* s) {setVal_(UNIT_, s);} void ucd(const char* s) {setVal_(UCD_, s);} void utype(const char* s) {setVal_(UTYPE_, s);} void datatype(const char* s) {setVal_(DATATYPE_, s);} void comments(const char* s) {setVal_(COMMENTS_, s);} // set int keyword values void id_col(int i) {id_col_ = i;} void ra_col(int i) {ra_col_ = i;} void dec_col(int i) {dec_col_ = i;} void x_col(int i) {x_col_ = i;} void y_col(int i) {y_col_ = i;} void is_tcs(int i) {is_tcs_ = i;} void stc_col(int i) {stc_col_ = i;} // set double keyword values void equinox(double d) {equinox_ = d;} void epoch(double d) {epoch_ = d;} // get string keyword values const char* servType() const {return val_[SERVTYPE_];} const char* longName() const {return val_[LONGNAME_];} const char* shortName() const {return val_[SHORTNAME_];} const char* url() const {return val_[URL_];} const char* backup1() const {return val_[BACKUP1_];} const char* backup2() const {return val_[BACKUP2_];} const char* symbol() const {return val_[SYMBOL_];} const char* searchCols() const {return val_[SEARCH_COLS];} const char* sortCols() const {return val_[SORT_COLS];} const char* sortOrder() const {return val_[SORT_ORDER];} const char* showCols() const {return val_[SHOW_COLS];} const char* copyright() const {return val_[COPYRIGHT_];} const char* help() const {return val_[HELP_];} const char* system() const {return val_[SYSTEM_] ? val_[SYSTEM_] : "";} const char* equinoxprefix() const {return val_[EQUINOX_];} const char* epochprefix() const {return val_[EPOCH_];} const char* unit() const {return val_[UNIT_];} const char* ucd() const {return val_[UCD_];} const char* utype() const {return val_[UTYPE_];} const char* datatype() const {return val_[DATATYPE_];} const char* comments() const {return val_[COMMENTS_];} // get int keyword values int id_col() const; int ra_col() const; int dec_col() const; int x_col() const; int y_col() const; int is_tcs() const {return is_tcs_;} int stc_col() const; // get double keyword values double equinox() const {return equinox_;} double epoch() const {return epoch_;} // return true if the catalog uses word coordinates int isWcs() {return ra_col() >= 0 && dec_col() >= 0;} // return true if the catalog uses image pixel coordinates int isPix() {return x_col() >= 0 && y_col() >= 0;} // set/get pointer to link entry CatalogInfoEntry* link() const {return link_;} void link(CatalogInfoEntry*e) {link_ = e;} // append the given entry to the end of the list int append(CatalogInfoEntry* e); // set/get pointer to next entry CatalogInfoEntry* next() const {return next_;} void next(CatalogInfoEntry*e) {next_ = e;} // output operator (output in format similar to input config file) friend ostream& operator<<(ostream&, const CatalogInfoEntry&); }; #endif /* _CatalogInfo_h_ */ skycat-3.1.2-starlink-1b/cat/generic/LocalCatalog.C000066400000000000000000000110611215713201500217500ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: LocalCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * LocalCatalog.C - method definitions for class LocalCatalog * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 11 Jun 96 Created */ static const char* const rcsId="@(#) $Id: LocalCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include #include #include "error.h" #include "Mem.h" #include "LocalCatalog.h" /* * static method to check the validity of a tab table file. * Returns 0 if OK. */ int LocalCatalog::check_table(const char* file) { TabTable t; return TabTable::head(file, t); } /* * constructor - used internally only, public interface uses "open(name)" * "e" is the catalog config entry object for this catalog. * (see CatalogInfo class) * * In this case, the catalog config entry may have been created automatically. * The name of the file containing the local catalog (tab table) is stored in * "e->url()", which is normally used to store the URL for HTTP access, but is * used here for the filename. * */ LocalCatalog::LocalCatalog(CatalogInfoEntry* e) : AstroCatalog(e), filename_(strdup(e->url())) { status_ = getInfo(); } /* * destructor */ LocalCatalog::~LocalCatalog() { if (filename_) free(filename_); } /* * Run a query on the local catalog and return the number of objects found. * * Args: * q - (in) object describing the query * * filename - (in) filename to hold results, or null * * result - (out) reference to object to manage the results. * * The return value is the number of rows found, or 0 if none were found. * A return value of -1 indicates an error. * * (Redefined from parent class to work with local catalogs) */ int LocalCatalog::query(const AstroQuery& q, const char* filename, QueryResult& result) { if (checkInfo() != 0) return -1; // note the catalog config entry in the results result.entry(entry_); if (result.query(q, info_, filename, more_) != 0) return -1; return result.numRows(); } /* * If we don't have the info for this catalog, get it and * return the status. Here we also check if the file has been modified, * (by an insert or remove operation) and reload it if needed. */ int LocalCatalog::checkInfo() { if (info_.numCols() > 0) { struct stat buf; if (stat(filename_, &buf) != 0) return sys_error("can't access file: ", filename_); if (buf.st_mtime == timestamp_) return 0; } return getInfo(); } /* * Read the local catalog to get the column names and also read in the * data to make later searches faster. The return value is 0 for * success. The info_ member holds the column info and the local catalog * data for searching. It must be updated if the data changes. */ int LocalCatalog::getInfo() { // note update time of file, so we know if it has been modified... struct stat buf; if (stat(filename_, &buf) != 0) return sys_error("can't access file: ", filename_); timestamp_ = buf.st_mtime; // mmap the file and put it in a TabTable Mem m(filename_); if (m.status() != 0) return 1; // make a null terminated copy, which will be managed by info_ size_t size = m.size() + 1; char* data = (char*)malloc(size); if (!data) return fmt_error("can't allocate %d bytes for %s", size, filename_); strncpy(data, (char*)m.ptr(), size-1); data[size-1] = '\0'; if (info_.init(data, 0, 1) != 0) return 1; // copy the comments from table to entry int n = info_.numComments(); if ( n > 0 ) { char* c = NULL; int have = 1024; int l = 0; int used = 0; char* com = (char*)malloc(have); com[0] = '\0'; char* p = com; for ( int i = 0; i < n; i++ ) { info_.getComment( i, c ); l = strlen( c ); if (( used + l ) >= have) { have += 1024; com = (char*)realloc(com, have); p = com + used; } strcpy( p, c ); used += l+1; p += l; if (i < (n-1)) { *p++ = '\n'; // new line not NULL. } } entry_->comments(com); free(com); } // this will extract any catalog config info from the file's header info_.entry(entry_, data); return 0; } skycat-3.1.2-starlink-1b/cat/generic/LocalCatalog.h000066400000000000000000000043551215713201500220250ustar00rootroot00000000000000// -*-c++-*- #ifndef _LocalCatalog_h_ #define _LocalCatalog_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: LocalCatalog.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * LocalCatalog.h - class definitions for accessing local * catalogs stored as starbase format tab tables. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 11 Jun 96 Created * Peter W. Draper 21 Sep 98 Modified private data members to be * protected. Need these for derived * classes. * 03 Jul 08 Added getQuery() method to access whole * data without an actual query. */ #include "AstroCatalog.h" /* * Class LocalCatalog * * This class is used to search a local catalog stored as a file * in tab table format. The format of the table is something like: * * TableName * * VAR=Value * * A B C * - - - * 0 1 3 * 3 2 4 * ... * * where the table name and variable assignments are optional. */ class LocalCatalog : public AstroCatalog { protected: // PWD: change here char* filename_; // file name for local catalog time_t timestamp_; // last update time of file, for caching public: // constructor - create local catalog class instance // note: public interface uses AstroCatalog::open() with the name of the // file containing the local catalog. // The argument represents the entry in the catalog config file for this catalog // (made automatially, if not already present). LocalCatalog(CatalogInfoEntry*); // destructor ~LocalCatalog(); // Run a query on the catalog and return the number of objects found. // (redefined here to work with local catalogs) virtual int query(const AstroQuery& q, const char* filename, QueryResult& result); // check the validity of a tab table file static int check_table(const char* file); // query server for catalog column names and put result in info_ virtual int getInfo(); virtual int checkInfo(); // get the full query for whole table. QueryResult& getQuery() {return info_;} }; #endif /* _LocalCatalog_h_ */ skycat-3.1.2-starlink-1b/cat/generic/QueryResult.C000066400000000000000000000243131215713201500217330ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: QueryResult.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * QueryResult.C - method definitions for class QueryResult * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 07 Nov 95 Created */ static const char* const rcsId="@(#) $Id: QueryResult.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include #include "error.h" #include "QueryResult.h" #include "WorldOrImageCoords.h" #include "AstroQuery.h" // This is a dummy null catalog entry, used as a default static CatalogInfoEntry* defaultEntry_ = new CatalogInfoEntry; /* * constructor: initialize empty table */ QueryResult::QueryResult() : TabTable(), entry_(defaultEntry_) {} /* * constructor: init from query result buffer */ QueryResult::QueryResult(const char* result) : TabTable(result), entry_(defaultEntry_) {} /* * constructor: initialize from data buffer without headings */ QueryResult::QueryResult(int numCols, char** colNames, const char* result) : TabTable(numCols, colNames, result), entry_(defaultEntry_) {} /* * if the result row contains a position (ra, dec) or (x, y), * get it and return success (0). * * Note that by convention the first 3 fields are id, ra and dec, in J2000, * unless otherwise defined in the catalog config entry. For example, if the * config entry specifies: "x_col: 1" and "y_col: 2", then we look for image * coordinates x and y in columns 1 and 2. */ int QueryResult::getPos(int row, WorldOrImageCoords& pos) const { if (entry_->isWcs()) { // use world coords char* ra; // get ra and dec as strings char* dec; // so we can accept H:M:S or d.ddd if (get(row, entry_->ra_col(), ra) || get(row, entry_->dec_col(), dec)) return 1; // error pos = WorldCoords(ra, dec, entry_->equinox(), 1); if (pos.status() == 0) return 0; // success return 1; // error } else if (entry_->isPix()) { // use image coords double x, y; if (get(row, entry_->x_col(), x) || get(row, entry_->y_col(), y)) return 1; // error pos = ImageCoords(x, y); if (pos.status() == 0) return 0; // success return 1; // error } return error("This catalog does not have coordinates"); } /* * get the position from the given row as world coords or report * an error if the catalog is not using world coords */ int QueryResult::getPos(int row, WorldCoords& pos) const { if (! entry_->isWcs()) return error("catalog does not support world coordinates"); WorldOrImageCoords p; if (getPos(row, p) != 0) return 1; pos = p.wc(); return 0; } /* * Search the given tab table for all objects in the specified world or * image coordinate circle/ring and fill "*this" table with the results. * The return value is 0 if all is OK. * * Args: * * table in - tab table to search * q i in - object holding query conditions * maxRows in - max number of rows to find */ int QueryResult::circularSearch( const TabTable& table, const AstroQuery& q, int maxRows) { int tcols = table.numCols(), trows = table.numRows(); // copy table header for the result if (init(tcols, table.colNames(), "", 0) != 0) return ERROR; if (maxRows <= 0) return 0; // search rows and put matching rows in "os" ostringstream os; int n = 0; int i = 0; // get col index for mag int mag_col = inputColIndex("mag"); // get array of col indexed for search columns const int maxcols = 255; if ((n = q.numSearchCols()) > maxcols) return error("too many search columns"); int search_cols[maxcols]; for(i = 0; i < n; i++) search_cols[i] = inputColIndex(q.searchCols()[i]); n = 0; for(i = 0; i < trows; i++) { if (circularCompareRow(table, i, q, mag_col, search_cols) == 0) { table.printRow(os, i); if (++n >= maxRows) break; } } int status = init(numCols_, colNames_, os.str().c_str(), maxRows); return status; return 0; } /* * Given a tab table and a row number, return 0 if the query position * (q.pos()) is within the given radius range (q.radius1(), q.radius2()) * and mag (if applicable) is in the given magnitude range (q.mag1(), * q.mag2()) and all of the other conditions given by q are met. * * mag_col is the column for "mag" or -1 if there is no mag column in the * table, in which case the mag range is ignored. * * Another way of specifying a mag range or a range for any other column * is to use the general purpose condition fields in the AstroQuery object: * q.searchCols(), q.minValues(), q.maxValues(). These are used if set. * (Note that for backward compat., the hard coded values for mag1,mag2 are * still supported, although they could be handled more generally using * q.searchCols(), ...) * * The search_cols parameter is used to save time by passing an array of * column indexes for the search columns (if any). * * The positions are taken either from the columns for ra and dec, if we * are using world coords, or the columns for x and y if we are using * image coords) * * The radius is assumed to be in arcmin for world coords, or pixel for * image coords. */ int QueryResult::circularCompareRow(const TabTable& table, int row, const AstroQuery& q, int mag_col, int* search_cols) { // get value for mag, if there is one if (mag_col != -1 && (q.mag1() != 0.0 || q.mag2() != 0.0)) { double mag; if (table.get(row, mag_col, mag) != 0 || mag < q.mag1() || mag > q.mag2()) return 1; } if (entry_->isWcs() || entry_->isPix()) { if (q.radius1() || q.radius2()) { // get ra,dec point WorldOrImageCoords p; if (entry_->isWcs()) { char* ra; char* dec; if (table.get(row, entry_->ra_col(), ra) != 0 || table.get(row, entry_->dec_col(), dec) != 0) return 1; p = WorldCoords(ra, dec, entry_->equinox(), 1); } else if (entry_->isPix()) { // get x,y double x, y; if (table.get(row, entry_->x_col(), x) != 0 || table.get(row, entry_->y_col(), y) != 0) return 1; p = ImageCoords(x, y); } if (p.status() != 0) return ERROR; // see if point is in radius double dist = q.pos().dist(p); if (dist < q.radius1() || dist > q.radius2()) return 1; // position for row not in range } } // check any other conditions for column values int n = q.numSearchCols(); if (n > 0) { char** minValues = q.minValues(); char** maxValues = q.maxValues(); char* tableValue; for(int i = 0; i < n; i++) { if (table.get(row, search_cols[i], tableValue) != 0) return 1; // since we don't know the type of the column, try double, then int, then string double d, d1, d2; int j, j1, j2; if (sscanf(tableValue, "%lf", &d) == 1 && sscanf(minValues[i], "%lf", &d1) == 1 && sscanf(maxValues[i], "%lf", &d2) == 1) { // compare as double if (d < d1 || d > d2) return 1; // no match } else if (sscanf(tableValue, "%d", &j) == 1 && sscanf(minValues[i], "%d", &j1) == 1 && sscanf(maxValues[i], "%d", &j2) == 1) { // compare as int if (j < j1 || j > j2) return 1; // no match } else { // compare as string if (strcmp(tableValue, minValues[i]) < 0 || strcmp(tableValue, maxValues[i]) > 0) return 1; // no match } } } return 0; // a match } /* * Query the given tab table using the condition described by the * given AstroQuery object. * * Args: * q - (in) object describing the query * * table - (in) table to search * outfile - (in) optional filename to hold results, or null * * more - (out) set to 1 if more objects would be available but were * not returned because q.maxRows was set lower * * The return value 0 if all is OK. The number found is available as this->numRows(). */ int QueryResult::query(const AstroQuery& q, const TabTable& table, const char* outfile, int& more) { // Note: if we have to sort, we don't want to loose data by discarding rows before sorting. // Otherwise, if not sorting, we can save space and time and discard unwanted rows earlier. // In any case, add at least 1 to maxRows, so we can see if there would be more rows available... int maxRows = q.maxRows()+1; if (q.numSortCols() > 0 || q.maxRows() == 0) maxRows = table.numRows(); if (strlen(q.id()) != 0) { // search for id only centerPos_.setNull(); if (search(table, entry_->id_col(), q.id(), maxRows) != 0) return ERROR; } else { centerPos_ = q.pos(); if (circularSearch(table, q, maxRows) != 0) return ERROR; } // sort result ? // note: do this before truncating to maxRows to get correct results if (q.numSortCols()) sort(q.numSortCols(), q.sortCols(), q.sortOrder()); if (q.maxRows() && numRows_ > q.maxRows()) { more = 1; numRows(q.maxRows()); } else { more = 0; } if (outfile && save(outfile) != 0) return ERROR; return 0; } /* * print the table title (and any other info preceding the column headings) * (may be redefined in a derived class to add more info) */ void QueryResult::printTableTop(ostream& os, const char* title) { if (! title) title = "QueryResult"; TabTable::printTableTop(os, title); // add some info from the config file entry, if known, so that we know later // what plot symbol to use when loading the file as a local catalog if (entry_ && entry_->servType()) { os << "\n# Config entry for original catalog server:\n" << *entry_; os << "# End config entry\n\n"; } } /* * Set the catalog config entry for this object. This is included in the * file when this object is saved as a local catalog. The optional result * arg may be a pointer to the result of a catalog query, which may * contain config configuration information. If specified, it is scanned * to update the entry with the new information. */ void QueryResult::entry(CatalogInfoEntry* e, const char* result) { entry_ = e; if (result) { istringstream is(result); CatalogInfo::updateConfigEntry(is, e); } } skycat-3.1.2-starlink-1b/cat/generic/QueryResult.h000066400000000000000000000110131215713201500217710ustar00rootroot00000000000000// -*-c++-*- #ifndef _QueryResult_h_ #define _QueryResult_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: QueryResult.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * QueryResult.h - class definitions for accessing results of a catalog * query * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 7 Nov 95 Created * Peter W. Draper 13 Jan 09 Added getEntry method. * 8 May 09 Added stc_col support. */ #include "WorldOrImageCoords.h" #include "CatalogInfo.h" #include "AstroQuery.h" #include "TabTable.h" /* * Class QueryResult * * This class manages the result of an AstroCatalog::query. The basic * result is a char buffer that contains one row per line where each * column is separated by a tab character. * * This class provides transparent access to the result based on a * row,column index and allows for type conversion from string to the * desired type. */ class QueryResult : public TabTable { protected: WorldOrImageCoords centerPos_; // saved ra,dec or x,y pos from previous query CatalogInfoEntry* entry_; // catalog config file entry pointer, // used if not null when saving to a file // given a tab table (with columns ra and dec)and a row, return 0 if ra and dec // are within the given radius (in arcmin) and mag is in the given magnitude range. virtual int circularCompareRow(const TabTable& table, int row, const AstroQuery& q, int mag_col, int* search_cols); // Search the given tab table for all objects in the specified world // coordinate circle/ring and fill "*this" table with the results. virtual int circularSearch(const TabTable& table, const AstroQuery& q, int maxRows); // print table title and othe info... virtual void printTableTop(ostream& os, const char* title = NULL); public: // constructor: initialize empty table QueryResult(); // constructor: init from query result buffer QueryResult(const char* result); // constructor: initialize from data buffer without headings QueryResult(int numCols, char** colNames, const char* result); // destructor: free any allocated memory virtual ~QueryResult() {} // get the position from the given row as world or image coords virtual int getPos(int row, WorldOrImageCoords& pos) const; // get the position from the given row as world coords or report // an error if the catalog is not using world coords virtual int getPos(int row, WorldCoords& pos) const; // Query the given tab table using the condition described by the // given AstroQuery object. virtual int query(const AstroQuery& q, const TabTable& table, const char* outfile, int& more); // member access // Set the catalog config entry for this object. This is included in the // file when this object is saved as a local catalog. The optional result // arg may be a pointer to the result of a catalog query, which may // contain config configuration information. If specified, it is scanned // to update the entry with the new information. virtual void entry(CatalogInfoEntry* e, const char* result = NULL); // access config info that may have been included in the header // of the query result virtual const char* symbol() const {return entry_->symbol();} virtual const char* copyright() const {return entry_->copyright();} virtual const char* help() const {return entry_->help();} virtual const char* shortName() const {return entry_->shortName();} virtual const char* longName() const {return entry_->longName();} virtual int id_col() const {return entry_->id_col();} virtual int ra_col() const {return entry_->ra_col();} virtual int dec_col() const {return entry_->dec_col();} virtual int x_col() const {return entry_->x_col();} virtual int y_col() const {return entry_->y_col();} virtual double equinox() const {return entry_->equinox();} virtual int stc_col() const {return entry_->stc_col();} // return true if the catalog uses world coords virtual int isWcs() const {return entry_->isWcs();} // return true if the catalog uses image pixel coords virtual int isPix() const {return entry_->isPix();} // get the CatalogInfoEntry instance. CatalogInfoEntry * getInfo() {return entry_;} }; #endif /* _QueryResult_h_ */ skycat-3.1.2-starlink-1b/cat/generic/TabTable.C000066400000000000000000000776511215713201500211220ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: TabTable.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TabTable.C - method definitions for class TabTable * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 08 Jan 96 Created * Peter W. Draper 17 Mar 09 Add changes to support access to the table comments */ static const char* const rcsId="@(#) $Id: TabTable.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include #include #include #include "error.h" #include "util.h" #include "TabTable.h" // these are needed only during a table sort static TabTable* thisPtr_; int TabTable::numSortCols_ = 0; char** TabTable::sortCols_ = NULL; int* TabTable::sortColIndexes_ = NULL; int TabTable::sortOrder_ = 0; int TabTable::sortStatus_ = 0; /* * constructor: initialize empty table */ TabTable::TabTable(char sep) : numRows_(0), numCols_(0), colNames_(NULL), buf_(NULL), table_(NULL), index_(NULL), comments_(NULL), numComments_(0), sep_(sep), status_(0) { } /* * constructor: initialize table from buffer in tab table format: * * VAR VALUE VALUE ... * ... * COL1 COL2 COL3 ... COLN * --- ---- ---- ---- * data data data data * ... * * Currently, anything up to the column headings is ignored (This may change * later). The format is the same as the tab table format used by starbase. * A line beginning with a "-" separates the column names from the data * and all column headings and data are separated by tabs (or sep char). * * The part preceding the column headings may be used later to set certain * variables pertaining to the table. In this case, a variable may have * one or more values, separated by tabs (sep char). * * If maxRows is nonzero, only upto that many rows are taken from buf. */ TabTable::TabTable(const char* buf, int maxRows, char sep) : numRows_(0), numCols_(0), colNames_(NULL), buf_(NULL), table_(NULL), index_(NULL), comments_(NULL), numComments_(0), sep_(sep), status_(0) { status_ = init(buf, maxRows); } /* * constructor: initialize table from data buffer without headings. * The first two args specify the number column headings and their names. * If maxRows is nonzero, only upto that many rows are taken from buf. */ TabTable::TabTable(int numCols, char** colNames, const char* buf, int maxRows, char sep) : numRows_(0), numCols_(0), colNames_(NULL), buf_(NULL), table_(NULL), index_(NULL), comments_(NULL), numComments_(0), sep_(sep), status_(0) { status_ = init(numCols, colNames, buf, maxRows); } /* * destructor: free any allocated memory */ TabTable::~TabTable() { clear(); } /* * Fill the table from the given buffer in tab table format. * If maxRows is nonzero, only upto that many rows are taken from buf. * If owner is nonzero, this class will take control of the memory * for buf, otherwise it makes a copy. The data string in buf should be * null terminated. */ int TabTable::init(const char* buf, int maxRows, int owner) { clear(); // erase any existing rows if (owner) buf_ = (char*)buf; else buf_ = strdup(buf); // scan the table to set colNames, numRows, numCols and get start of data char* line = NULL; if (scanTable(maxRows, line) != 0) return ERROR; return fillTable(line); } /* * Initialize the table from the data buffer (without heading lines). * The first two args specify the number column headings and their names. * If maxRows is nonzero, only upto that many rows are taken from buf. * If owner is nonzero, this class will take control of the memory * for buf, otherwise it makes a copy. The data string in buf should be * null terminated. */ int TabTable::init(int numCols, char** colNames, const char* buf, int maxRows, int owner) { // count the data rows char* nbuf = (owner ? (char*)buf : strdup(buf)); // (watch out for this: t.init(t.colNames()) (don't delete before using...)) char** cnames = copyArray(numCols, colNames); clear(); // erase any existing rows buf_ = nbuf; numRows_ = getNumLines(buf_, maxRows); numCols_ = numCols; colNames_ = cnames; numComments_ = 0; // fill the table rows from the buffer return fillTable(buf_); } /* * make the table empty and free any resources used */ int TabTable::clear() { if (table_) { delete[] table_; table_ = NULL; } if (index_) { delete[] index_; index_ = NULL; } if (comments_) { delete[] comments_; comments_ = NULL; } if (colNames_) { delete[] colNames_; colNames_ = NULL; } numCols_ = 0; numRows_ = 0; numComments_ = 0; if (buf_) { free(buf_); buf_ = NULL; } return 0; } /* * util: trim white space from string and return value */ static char* trim(char* s) { if (strlen(s)) { while(isspace(*s)) s++; char* p = s + strlen(s) - 1; while(isspace(*p) && p > s) *p-- = '\0'; } return s; } /* * scan the table to set colNames, numRows, numCols and set the "start" pointer * to point to the start of the data rows. * If maxRows is nonzero, the input is truncated to that many rows. * Returns 0 if OK. * * As part of routine locate and record any header comments. */ int TabTable::scanTable(int maxRows, char*& start) { char* line = buf_; // start of current line char* head = NULL; // start of header line with column names char* prev_line = NULL; // ptr to previous line char* p; int i; start = NULL; // points to start of data rows, if any for (p = strchr(line, '\n'); p; p = strchr(line = p+1, '\n')) { if (*line == '-') { line = start = p + 1; // data starts after "---" line head = prev_line; // header is line before "---" break; } prev_line = line; // If a comment line count it. if (*line == '#') { numComments_++; } *p = '\0'; } // Now gather the comments. if ( numComments_ > 0 ) { comments_ = new char*[numComments_]; // Back to head of buf_. Note lines are now NULL terminated. char *cline = buf_; int i = 0; for (p = strchr(cline, '\0'); p; p = strchr(cline = p+1, '\0')) { if (*cline == '-') { // No more comments. break; } if (*cline == '#') { comments_[i++] = cline; //cout << cline << endl; } } } if (! head) { // status_ = error("bad tab table format, no '---' line found"); // allow missing headers return 0; } // get the column names (and strip any leading and trailing white space) char* colNames[MAX_COLUMNS]; for (p = strchr(head, sep_); p; p = strchr(head = p+1, sep_)) { *p = '\0'; colNames[numCols_++] = head; } colNames[numCols_++] = head; colNames_ = new char*[numCols_]; for (i = 0; i < numCols_; i++) colNames_[i] = trim(colNames[i]); // count the data rows numRows_ = getNumLines(line, maxRows); return 0; } /* * create and fill the internal table from the given buffer in tab table format * and return 0 if all is OK */ int TabTable::fillTable(char* buf) { if (numRows_ == 0 || numCols_ == 0) return 0; // empty table without a header table_ = new char*[numRows_*numCols_]; index_ = new int[numRows_]; if (!table_ || !index_) { return error("could not allocate enough memory for TabTable"); } // fill the table with row,col values for (int i = 0; i < numRows_; i++) { index_[i] = i; // default order: no sorting yet char* p = strchr(buf, '\n'); if (!p) { char msg[255]; sprintf(msg, "expected %d rows, but found %d", numRows_, i); return error(msg); } *p++ = '\0'; if (splitList(buf, table_+(i*numCols_)) != 0) return ERROR; buf = p; // set for next line } return 0; } /* * scan the given buffer and return the number of lines. * If maxRows is nonzero, truncate the buffer after that many lines. */ int TabTable::getNumLines(char* buf, int maxRows) { int n = 0; for (char* p = strchr(buf, '\n'); p; p = strchr(buf = p+1, '\n')) { if (maxRows > 0 && n >= maxRows) { *++p = '\0'; return maxRows; } if (strncmp(buf, "[EOD]", 5) == 0) { // XXX special case (should be in HTTP.C ?) *buf = '\0'; break; } n++; } return n; } /* * split the given line into numCols_ strings and put them in the given array, * which is assumed to be large enough (at least numCols_ long). * Returns 0 on success, otherwise 1 and an error message. */ int TabTable::splitList(char* line, char** colValues) { char* val = line; int col; for (col = 0; col < numCols_; col++) { char* p = strchr(val, sep_); if (!p) { colValues[col] = trim(val); val = (char *)""; continue; // fill any missing cols with empty values } *p++ = '\0'; colValues[col] = trim(val); val = p; // set for next column } return 0; } /* * report an error in the tab table input at the given row and col, * that the given type of value was expected and the given string value * was found. */ int TabTable::tab_error(int row, int col, char* expected, char* value) const { ostringstream os; os << "error in tab table input: row " << (row+1) << ", col " << (col+1) << ", expected " << expected << ", but found '" << value << "'"; return error(os.str().c_str()); } /* * return the result column index for the given result column name */ int TabTable::colIndex(const char* colName) const { for (int i = 0; i < numCols_; i++) if (strcasecmp(colName, colNames_[i]) == 0) return i; return -1; } /* * return the column name for the given column index */ const char* TabTable::colName(int col) const { if (col >= 0 && col < numCols_ && numCols_ > 0) return colNames_[col]; return NULL; } /* * save the contents of this object as a tab table file and return 0 if * all is OK. */ int TabTable::save(const char* filename) { ofstream os(filename); if (!os) return sys_error("can't open file: ", filename); return save(os); } /* * save the contents of this object as a tab table to the * given stream and return 0 if all is OK. */ int TabTable::save(ostream& os) { if (numCols() == 0) return error("no data to save"); int i, row, col; // print the title (and any other info preceding the column headings) printTableTop(os); // headings int ncols = numCols(), n = ncols-1; for (col = 0; col < ncols; col++) { os << colName(col); if (col < n) os << '\t'; } os << endl; // dashed line for (col = 0; col < ncols; col++) { int l = strlen(colName(col)); for(i = 0; i < l; i++) os << '-'; if (col < n) os << '\t'; } os << endl; // rows and columns return printRows(os); } /* * print the table title (and any other info preceding the column headings) * (may be redefined in a derived class to add more info) */ void TabTable::printTableTop(ostream& os, const char* title) { if (! title) title = "TabTable"; os << title << endl; } /* * append the contents of this object to a tab table file and return 0 if * all is OK. */ int TabTable::append(const char* filename) { if (numRows() == 0 || numCols() == 0) return error("no data to append"); TabTable t; if (head(filename, t) != 0) // get table header in t return ERROR; if (compareHeadings(t) != 0) // compare with this table return error("tables have different columns"); ofstream os(filename, ios::app); if (! os) return sys_error("can't append to file: ", filename); return printRows(os); } /* * Insert the contents of this object (0 or more rows) in a tab table * file and return 0 if all is OK. * * Each row is assumed here to have a unique id column. If a row already * exists with the same id as one that we want to insert, the row is * replaced with the new one. Otherwise, the new row is added at the end * of the file. * * filename is the name of the file to insert in. * * col is the column index of the id column, used to check for * duplicates. */ int TabTable::insert(const char* filename, int col) { if (numRows() == 0 || numCols() == 0) return error("no data to insert"); // make sure we have a valid id column if (col < 0) col = 0; if (checkTableIndex(0, col) != 0) return ERROR; TabTable t; if (head(filename, t) != 0) // get table header in t return ERROR; if (compareHeadings(t) != 0) // compare with this table return error("tables have different columns"); ifstream is(filename); if (! is) return sys_error("can't open file: ", filename); char tmpfile[2048]; sprintf(tmpfile, "%s.TMP", filename); ofstream os(tmpfile); if (! os) return sys_error("can't open file: ", tmpfile); // skip heading char buf[MAX_ROW_SIZE]; while (is.getline(buf, sizeof(buf))) { os << buf << endl; if (buf[0] == '-') break; } // make an array of flags, insertedRow[i] is 1 if row i was inserted in the file int* insertedRow = new int[numRows_]; int row; for (row = 0; row < numRows_; row++) insertedRow[row] = 0; while (is.getline(buf, sizeof(buf))) { if ((row = findRow(buf, col)) < 0) { // if row is not found in this object, add it unchanged to the output file os << buf << endl; } else { // found matching id, add new row to the file to replace the old one printRow(os, row); insertedRow[row] = 1; } } // append any rows that were not inserted in the file for (row = 0; row < numRows_; row++) if (!insertedRow[row]) printRow(os, row); delete[] insertedRow; // make a backup file and rename the tmpfile to the original char bakfile[2048]; sprintf(bakfile, "%s.BAK", filename); if (rename(filename, bakfile) != 0) return sys_error("can't rename file to file.BAK for: ", filename); if (rename(tmpfile, filename) != 0) return sys_error("can't rename file.TMP to file for: ", filename); return 0; } /* * remove all rows in the given tab table file where the value in the * given column matches the value in the same column in any row of this * object. * * For example: if col 0 is the id column and you want to remove any row * from the file foo.tab containing ids from this object, you would call: * * table.remove("foo.tab", 0); * */ int TabTable::remove(const char* filename, int col) { // make sure we have a valid id column if (col < 0) col = 0; if (numRows() == 0 || numCols() == 0) return error("no data rows to remove"); if (checkTableIndex(0, col) != 0) return ERROR; TabTable t; if (head(filename, t) != 0) // get table header in t return ERROR; if (compareHeadings(t) != 0) // compare with this table return error("tables have different columns"); // read from filename and write to $filename.tmp (rename later) ifstream is(filename); if (!is) return sys_error("can't open file: ", filename); char tmpfile[2048]; sprintf(tmpfile, "%s.TMP", filename); ofstream os(tmpfile); if (! os) return sys_error("can't open file: ", tmpfile); char buf[MAX_ROW_SIZE]; // skip heading while (is.getline(buf, sizeof(buf))) { os << buf << endl; if (buf[0] == '-') break; } while (is.getline(buf, sizeof(buf))) { if (findRow(buf, col) < 0) // if row is not found os << buf << endl; // then add to output file } char bakfile[2048]; sprintf(bakfile, "%s.BAK", filename); if (rename(filename, bakfile) != 0) return sys_error("can't rename file to file.BAK for: ", filename); if (rename(tmpfile, filename) != 0) return sys_error("can't rename file.TMP to file for: ", filename); return 0; } /* * If there is a row in this object matching the given column in the the given * row (in buf, a tab separated table row), then return the row number, * otherwise -1. * */ int TabTable::findRow(const char* tableRow, int col) { int i, row, n = numCols_-1; char* colValues[MAX_COLUMNS]; char buf[MAX_ROW_SIZE]; strncpy(buf, tableRow, sizeof(buf)-1); // make a copy, since nulls are inserted by splitList splitList(buf, colValues); for (row = 0; row < numRows_; row++) { if (strcmp(colValues[col], table_[row*numCols_+col]) == 0) return row; } return -1; } /* * local compare function for qsort (method sort), pass on to member method */ static int compareQsort(const void* e1, const void* e2) { return thisPtr_->compareRows(*(int*)e1, *(int*)e2); } /* * local compare function: try to compare numerically, if possible and return * <. = or > 0, as by strcmp. */ static int compareValues(const char* s1, const char* s2) { // try numeric comparison first double d1, d2; int numeric = 2; if (!s1 || sscanf(s1, "%lf", &d1) != 1) numeric--; if (!s2 || sscanf(s2, "%lf", &d2) != 1) numeric--; if (numeric) { if (d1 > d2) return 1; if (d1 < d2) return -1; return 0; } else return strcmp(s1, s2); } /* * compare the given rows and return <. = or > 0, as by strcmp. */ int TabTable::compareRows(int row1, int row2) { int ret = 0; for (int i = 0; i < numSortCols_; i++) { char* item1 = table_[row1*numCols_+sortColIndexes_[i]]; char* item2 = table_[row2*numCols_+sortColIndexes_[i]]; if ((ret = compareValues(item1, item2)) != 0) break; } return ret * sortOrder_; } /* * sort the contents of this tab table by the given columns * numSortCols - the number of columns in the array * sortCols - the array of columns to sort by * sortOrder - >=0 means increasing, <0 means decreasing */ int TabTable::sort(int numSortCols, char** sortCols, int sortOrder) { // since the compare function is a static member, it needs to know these thisPtr_ = this; numSortCols_ = numSortCols; sortOrder_ = (sortOrder >= 0 ? 1 : -1); sortCols_ = sortCols; sortStatus_ = 0; // use integer index instead of column name int colIndexes[MAX_COLUMNS]; for(int i = 0; i < numSortCols; i++) { colIndexes[i] = colIndex(sortCols[i]); if (colIndexes[i] < 0) colIndexes[i] = 0; } sortColIndexes_ = colIndexes; qsort((char*)index_, numRows_, sizeof(int), compareQsort); return sortStatus_; } /* * Search the given tab table file for upto maxRows rows where the given * column has the given value and fill this table with the resulting * rows. * * Args: * * filename - tab table file to search * * searchCol - index of the column to compare (0..n) * * value - value for comparison * * maxRows - max number of rows to find */ int TabTable::search(const char* filename, int searchCol, const char* value, int maxRows) { // open file to search ifstream is(filename); if (!is) return sys_error("can't open file: ", filename); // get table header from stream into result if (head(is, *this) != 0) return ERROR; if (maxRows <= 0) return 0; if (numCols_ < 1) return error("no id column"); return search(is, 1, &colNames_[searchCol], (char**)&value, (char**)&value, maxRows); } /* * Search the given tab table for upto maxRows rows where the given * column has the given value and fill this table with the resulting * rows. * * Args: * * table - tab table to search * * searchCol - index of the column to compare (0..n) * * value - value for comparison * * maxRows - max number of rows to find */ int TabTable::search(const TabTable& table, int searchCol, const char* value, int maxRows) { int tcols = table.numCols(); if (tcols < 1) return error("table contains no columns"); // copy table header for the result if (init(tcols, table.colNames(), "", 0) != 0) return ERROR; if (maxRows <= 0) return 0; return search(table, 1, &colNames_[searchCol], (char**)&value, (char**)&value, maxRows); } /* * Internal version: assumes header has already been read. Search the * given stream for upto maxRows rows with columns values matching the * given arguments and fill this table with the resulting rows. * * Args: * * is - stream positioned at first row after header * * numSearchCols - number of columns in argument arrays * * searchCols - names of the columns to compare * * minValues - min/max values for comparison * maxValues * * maxRows - max number of rows to find */ int TabTable::search(istream& is, int numSearchCols, char** searchCols, char** minValues, char** maxValues, int maxRows) { // read and search rows, put matching rows in "os" char buf[MAX_ROW_SIZE]; ostringstream os; int n = 0; while (is.getline(buf, sizeof(buf))) { if (compareRow(buf, numSearchCols, searchCols, minValues, maxValues) == 0) { os << buf << endl; if (++n >= maxRows) break; } } int status = init(numCols_, colNames_, os.str().c_str(), maxRows); return status; } /* * Internal version: assumes header has already been read. Search the * given tab table for upto maxRows rows with columns values matching the * given arguments and fill this table with the resulting rows. * * Args: * * table - tab table to search * * numSearchCols - number of columns in argument arrays * * searchCols - names of the columns to compare * * minValues - min/max values for comparison * maxValues * * maxRows - max number of rows to find */ int TabTable::search(const TabTable& table, int numSearchCols, char** searchCols, char** minValues, char** maxValues, int maxRows) { // read and search rows, put matching rows in "os" int trows = table.numRows(); ostringstream os; int n = 0; for(int i = 0; i < trows; i++) { if (compareRow(table, i, numSearchCols, searchCols, minValues, maxValues) == 0) { table.printRow(os, i); if (++n >= maxRows) break; } } int status = init(numCols_, colNames_, os.str().c_str(), maxRows); return status; } /* * Search the given tab table file for upto maxRows rows where the given * column has the given value and fill this table with the resulting * rows. * * Args: * * filename - tab table file to search * * searchCol - name of the column to compare * * value - value for comparison * * maxRows - max number of rows to find */ int TabTable::search(const char* filename, const char* searchCol, const char* value, int maxRows) { return search(filename, 1, (char**)&searchCol, (char**)&value, (char**)&value, maxRows); } /* * Search the given tab table for upto maxRows rows where the given * column has the given value and fill this table with the resulting * rows. * * Args: * * table - tab table to search * * searchCol - name of the column to compare * * value - value for comparison * * maxRows - max number of rows to find */ int TabTable::search(const TabTable& table, const char* searchCol, const char* value, int maxRows) { return search(table, 1, (char**)&searchCol, (char**)&value, (char**)&value, maxRows); } /* * Search the given tab table file for upto maxRows rows with columns * values matching the given arguments and fill this table with the * resulting rows. * * Args: * * filename - tab table file to search * numSearchCols - number of columns in argument arrays * * searchCols - names of the columns to compare * * minValues - min/max values for comparison * maxValues * * maxRows - max number of rows to find */ int TabTable::search(const char* filename, int numSearchCols, char** searchCols, char** minValues, char** maxValues, int maxRows) { // open file to search ifstream is(filename); if (!is) return sys_error("can't open file: ", filename); // get table header from stream into result if (head(is, *this) != 0) return ERROR; if (maxRows <= 0) return 0; if (numCols_ < 1) return 0; return search(is, numSearchCols, searchCols, minValues, maxValues, maxRows); } /* * given a buffer containing a row for this table, compare the row with * the given column min and max values and return 0 if there is a match. * * (This method simply splits buf into columns and calls the overeloaded * method below, see the comments there) */ int TabTable::compareRow(char* buf, int numSearchCols, char** searchCols, char** minValues, char** maxValues) { // need to make a copy of the row, since splitList replaces tabs with null chars char buf2[MAX_ROW_SIZE]; strcpy(buf2, buf); char* colValues[MAX_COLUMNS]; if (splitList(buf2, colValues) != 0) return ERROR; return compareRow(colValues, numSearchCols, searchCols, minValues, maxValues); } /* * given a row with columns for this table, compare the row with the * given column min and max values and return 0 if there is a match. * * The first argument represents the row data to be searched. The rest of * the arguments describe the search condition such that * * minValue[i] <= colValues[i] <= maxValue[i] * * Either minValues or maxValues, or any of thier elements may be NULL, * to indicate + or - infinity. * * A numeric comparison is done, if possible. * * If all of the specified conditions are met, 0 is returned. */ int TabTable::compareRow(char** colValues, int numSearchmCols, char** searchCols, char** minValues, char** maxValues) { // for each search column specified... for (int col = 0; col < numSearchmCols; col++) { // see if this table has a column by that name... int i = inputColIndex(searchCols[col]); if (i < 0) return 1; // can't compare non-existant column if (compareCol(colValues[i], (minValues ? minValues[col] : (char*)NULL), (maxValues ? maxValues[col] : (char*)NULL)) != 0) return 1; // column value failed condition } return 0; // condition passed } /* * given a tab table and a row number, compare the row with * the given column min and max values and return 0 if there is a match. */ int TabTable::compareRow(const TabTable& table, int row, int numSearchCols, char** searchCols, char** minValues, char** maxValues) { // for each search column specified... for (int col = 0; col < numSearchCols; col++) { // see if this table has a column by that name... int i = inputColIndex(searchCols[col]); if (i < 0) return 1; // can't compare non-existant column char* s; // get column value in table if (table.get(row, i, s) != 0) return 1; if (compareCol(s, (minValues ? minValues[col] : (char*)NULL), (maxValues ? maxValues[col] : (char*)NULL)) != 0) return 1; // column value failed condition } return 0; // condition passed } /* * return 0 if the given value is in the given range, doing a numeric comparison if * possible. */ int TabTable::compareCol(const char* value, const char* minValue, const char* maxValue) { // try numeric comparison first double d, dmin, dmax; int numeric = 2; if (!minValue || sscanf(minValue, "%lf", &dmin) != 1) { dmin = -HUGE_VAL; numeric--; } if (!maxValue || sscanf(maxValue, "%lf", &dmax) != 1) { dmax = HUGE_VAL; numeric--; } if (numeric && sscanf(value, "%lf", &d) == 1) { if (d < dmin || d > dmax) return 1; // condition failed } else { // try string comparison if ((minValue && strcmp(minValue, value) > 0) || (maxValue && strcmp(maxValue, value) < 0)) return 1; // condition failed } return 0; // condition passed } /* * print the table rows to the given stream */ int TabTable::printRows(ostream& os) const { int row; for (row = 0; row < numRows_; row++) { printRow(os, row); } return 0; } /* * print the given table row to the given stream */ int TabTable::printRow(ostream& os, int row) const { int n = numCols_-1, r = index_[row]; for (int col = 0; col < numCols_; col++) { os << table_[r*numCols_+col]; if (col < n) os << '\t'; } os << endl; return 0; } /* * static method: * read the heading info from the given file and put it in the given object. */ int TabTable::head(const char* filename, TabTable& t) { ifstream is(filename); if (!is) { return sys_error("can't open file: ", filename); } return head(is, t); } /* * static method: * read the heading info from the given stream and put it in the given object */ int TabTable::head(istream& is, TabTable& t) { ostringstream os; char buf[MAX_HEADER_SIZE]; while (is.getline(buf, sizeof(buf))) { os << buf << endl; if (buf[0] == '-') break; } int status = t.init(os.str().c_str()); return status; } /* * compare headings in this table and the given one and return 0 * if they are the same. */ int TabTable::compareHeadings(const TabTable& t) { int ncols = numCols(); if (t.numCols() != ncols) return 1; for (int i = 0; i < ncols; i++) if (strcmp(colName(i), t.colName(i)) != 0) return 1; return 0; } /* * check the given row and col index and generate an error if out of range */ int TabTable::checkTableIndex(int row, int col) const { if (row < 0 || row >= numRows_) { char msg[80]; sprintf(msg, "row index %d out of range (max %d)", row, numRows_-1); return error(msg); } if (col < 0 || col >= numCols_) { char msg[80]; sprintf(msg, "column index %d out of range (max %d)", col, numCols_-1); return error(msg); } return 0; } /* * get the value at the given row,column as a char string */ int TabTable::get(int row, int col, char*& value) const { if (checkTableIndex(row, col) != 0) return ERROR; value = table_[index_[row]*numCols_+col]; return 0; } /* * get the value at the given row,column as an int */ int TabTable::get(int row, int col, int& value) const { char* p; if (get(row, col, p) != 0) return 1; // error if (sscanf(p, "%d", &value) != 1) return tab_error(row, col, (char *)"int", p); return 0; } /* * get the value at the given row,column as a double */ int TabTable::get(int row, int col, double& value) const { char* p; if (get(row, col, p) != 0) return 1; if (sscanf(p, "%lf", &value) != 1) return tab_error(row, col, (char *)"double", p); return 0; } /* * get the value at the given row,column as a float */ int TabTable::get(int row, int col, float& value) const { char* p; double d; if (get(row, col, p) != 0) return 1; // error if (sscanf(p, "%f", &value) != 1) return tab_error(row, col, (char *)"float", p); return 0; } /* * get the value at the given row,column as a short int */ int TabTable::get(int row, int col, short& value) const { char* p; int i; if (get(row, col, p) != 0) return 1; // error if (sscanf(p, "%d", &i) != 1) return tab_error(row, col, (char *)"short", p); value = i; return 0; } /* * get the value at the given row,column as a char */ int TabTable::get(int row, int col, char& value) const { char* p; if (get(row, col, p) != 0) return 1; // error value = *p; return 0; } /* * get the value at the given row,column * (just convert col name to index and call the inherited method) * - use a macro, since the code is always the same - just different * types. */ #define TGET(T) \ int TabTable::get(int row, const char* s, T& value) const \ { \ int col = inputColIndex(s); \ if (col < 0) \ return error("invalid result column: ", s); \ return TabTable::get(row, col, value); \ } TGET(char*) TGET(int) TGET(short) TGET(double) TGET(float) TGET(char) /* * Get a comment (see numComments() for how many are available). */ int TabTable::getComment(int n, char*& value) const { if ( n >= numComments_ ) { return 1; } value = comments_[n]; return 0; } skycat-3.1.2-starlink-1b/cat/generic/TabTable.h000066400000000000000000000231351215713201500211530ustar00rootroot00000000000000// -*-c++-*- #ifndef _TabTable_h_ #define _TabTable_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: TabTable.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TabTable.h - class definitions for accessing values from a char buffer * in the format of table, such as the result of a database query, * where the rows are separated by newlines and the columns by * tabs (or other given char). * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 9 Jan 96 Created * Peter W. Draper 28 Aug 08 Increase MAX_COLUMNS to 512 from 256. * 17 Mar 09 Add changes to access header comments. */ using namespace std; #include /* * Class TabTable * * This class manages a buffer containing a table where the rows are * separated by newlines and the columns by tabs (or other char). The * class provides transparent access to the table based on a row,column * index and allows for type conversion from string to the desired type. */ class TabTable { protected: int numRows_; // number of rows int numCols_; // number of columns char** colNames_; // array of column names char* buf_; // saved copy of input buffer (memory for table) char** table_; // array of row/col values int* index_; // array of row indexes for sorting char** comments_; // array of comments extracted from header int numComments_; // number of comments char sep_; // separator char (default: \t) int status_; // status after constructor (0 if OK) // these are set and used only during a table sort for use by compare methods static int numSortCols_; // number of columns to sort by static char** sortCols_; // array of sort column names static int* sortColIndexes_;// array of sort column indexes static int sortOrder_; // sort order (increasing if >= 0) static int sortStatus_; // status after sort (0 is ok) // scan the table to set colNames, numRows, numCols and set the start of data ptr virtual int scanTable(int maxRows, char*& start); // util to split a line into string array virtual int splitList(char* line, char** colValues); // report errors in input virtual int tab_error(int row, int col, char* expected, char* value) const; // scan the given buffer and return the number of lines virtual int getNumLines(char* buf, int maxRows); // create and fill the internal table from the given buffer in tab table format virtual int fillTable(char* buf); // internal search util: assumes stream is positioned at first row virtual int search(istream& is, int numSearchCols, char** searchCols, char** minValues, char** maxValues, int maxRows); // given a row with columns for this table, compare the row with the // given column min and max values and return 0 if there is a match. virtual int compareRow(char* buf, int numSearchCols, char** searchCols, char** minValues, char** maxValues); // same as above, but with the row split into a string array virtual int compareRow(char** colValues, int numSearchmCols, char** searchCols, char** minValues, char** maxValues); int compareRow(const TabTable& table, int row, int numSearchCols, char** searchCols, char** minValues, char** maxValues); // return 0 if the given value is in the given range, doing a numeric comparison if // possible. virtual int compareCol(const char* value, const char* minValue, const char* maxValue); // return column index in input for the given column name // (may be redefined by a derived class taht changes column names or positions) virtual int inputColIndex(const char* colName) const {return colIndex(colName);} // check that row and column are in range virtual int checkTableIndex(int row, int col=0) const; // print table title and other info virtual void printTableTop(ostream& os, const char* title = NULL); // copy constructor (not defined) // TabTable(const TabTable&); public: // constants enum {MAX_ROW_SIZE=8*1024}; // max size of a tab table row enum {MAX_HEADER_SIZE=1024}; // max size of a tab table heading enum {MAX_COLUMNS=512}; // max number of table columns public: // constructor: initialize empty table TabTable(char sep = '\t'); // constructor: initialize table from buffer in tab table format TabTable(const char* buf, int maxRows = 0, char sep = '\t'); // constructor: initialize table from data buffer without headings TabTable(int numCols, char** colNames, const char* buf, int maxRows = 0, char sep = '\t'); // destructor: free any allocated memory virtual ~TabTable(); // make the table empty and free any resources used virtual int clear(); // fill the table from the given buffer in tab table format virtual int init(const char* buf, int maxRows = 0, int owner = 0); // fill the table from the given buffer in tab table format, with headings // specified separately virtual int init(int numCols, char** colNames, const char* buf, int maxRows = 0, int owner = 0); // access to row,column values // set the parameter value and return 0 on success virtual int get(int row, int col, char*& value) const; virtual int get(int row, int col, int& value) const; virtual int get(int row, int col, double& value) const; virtual int get(int row, int col, float& value) const; virtual int get(int row, int col, short& value) const; virtual int get(int row, int col, char& value) const; // get table values by column name virtual int get(int row, const char* colName, char*& value) const; virtual int get(int row, const char* colName, int& value) const; virtual int get(int row, const char* colName, double& value) const; virtual int get(int row, const char* colName, float& value) const; virtual int get(int row, const char* colName, short& value) const; virtual int get(int row, const char* colName, char& value) const; // return the table column index for the given table column name virtual int colIndex(const char* colName) const; // return the column name for the given column index virtual const char* colName(int col) const; // return true if the table contains the given column virtual int hasCol(const char* name) const {return (colIndex(name) >= 0);} // read the heading info from the given stream and return object for it static int head(const char* filename, TabTable&); static int head(istream&, TabTable&); // compare headings in this table and the given one virtual int compareHeadings(const TabTable& t); // compare the given rows virtual int compareRows(int row1, int row2); // save the contents of this object as a tab table virtual int save(const char* filename); virtual int save(ostream&); // append the contents of this object to the given tab table file virtual int append(const char* filename); // insert (or update) the contents of this object to the given tab table file virtual int insert(const char* filename, int col = 0); // remove rows in the tab table file that match the given col in this object virtual int remove(const char* filename, int col); // find a row in this object matching the col in the given tab separated table row virtual int findRow(const char* tableRow, int col); // sort the contents of this tab table by the given columns virtual int sort(int numSortCols, char** sortCols, int sortOrder = 0); // Search the given tab table for upto maxRows rows with columns // values matching the given arguments and fill this table with the // resulting rows. virtual int search(const TabTable& table, int numSearchCols, char** searchCols, char** minValues, char** maxValues, int maxRows); // search as above, but for a single column name and value virtual int search(const TabTable& table, const char* searchCol, const char* value, int maxRows); // search as above, but for a single column index and value virtual int search(const TabTable& table, int searchCol, const char* value, int maxRows); // Search the given tab table file for upto maxRows rows with columns // values matching the given arguments and fill this table with the // resulting rows. virtual int search(const char* filename, int numSearchCols, char** searchCols, char** minValues, char** maxValues, int maxRows); // search as above, but for a single column name and value virtual int search(const char* filename, const char* searchCol, const char* value, int maxRows); // search as above, but for a single column index and value virtual int search(const char* filename, int searchCol, const char* value, int maxRows); // print the table rows to the given stream virtual int printRows(ostream& os) const; // print the given table row to the given stream virtual int printRow(ostream& os, int row) const; // output operator friend ostream& operator<<(ostream& os, TabTable& t) { t.save(os); return os; } // get a comment int getComment(int n, char*& value) const; // member access virtual int numRows() const {return numRows_;} virtual void numRows(int n) {if (n < numRows_ && n >= 0) numRows_ = n;} virtual int numCols() const {return numCols_;} virtual char** colNames() const {return colNames_;} virtual int status() const {return status_;} virtual int numComments() const {return numComments_;} }; #endif /* _TabTable_h_ */ skycat-3.1.2-starlink-1b/cat/generic/TclAstroCat.C000066400000000000000000001616131215713201500216170ustar00rootroot00000000000000/* * E.S.O. - VLT project/Archive * $Id: TclAstroCat.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TclAstroCat.C - method definitions for class TclAstroCat * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created * pbiereic 26/08/99 Changed Cat_Init() * Peter W. Draper 17/09/08 Added VO support meta-data access. * 28/11/08 Change removeQueryResult to use the id_col * value rather than 0. * 18/03/09 Added comments command. * 20/07/09 Use object interface for building the query * table list. Old interface very slow in tcl8.5. */ static const char* const rcsId="@(#) $Id: TclAstroCat.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "TabTable.h" #include "Mem.h" #include "error.h" #include "util.h" #include "LocalCatalog.h" #include "TclAstroCat.h" #include "TclQueryUtil.h" // from BLT package (now locally because this routine was deleted with blt2.1) extern "C" int Blt_GraphElement( Tcl_Interp *interp, /* Interpreter of the graph widget */ char *pathName, /* Path name of the graph widget */ char *elemName, /* Name of the element to reset */ int numValues, /* Number of values in array */ double *valueArr, /* Array of x,y coordinate pairs */ char *xVector, /* Name of x array */ char *yVector); /* Name of y array */ // initialize these dependent packages here for backward compat extern "C" int Tclutil_Init(Tcl_Interp *interp); extern "C" int Astrotcl_Init(Tcl_Interp *interp); // generated code for bitmaps used in tcl scripts void defineCatBitmaps(Tcl_Interp*); // Tcl procedure to search for an init for Cat startup file. static char initScript[] = "if {[info proc ::cat::Init]==\"\"} {\n\ namespace eval ::cat {}\n\ proc ::cat::Init {} {\n" #ifdef MAC_TCL " source -rsrc CatInit.tcl\n" #else " global cat_library\n\ tcl_findLibrary cat " PACKAGE_VERSION " " PACKAGE_VERSION " CatInit.tcl CAT_LIBRARY cat_library\n" #endif " }\n\ }\n\ ::cat::Init"; /* * Declare a table of tcl subcommands. * * NOTE: keep this table sorted, so we can use a binary search on it ! * (select lines in emacs and use M-x sort-lines) */ static class TclAstroCatSubCmds { public: char* name; // method name int (TclAstroCat::*fptr)(int argc, char* argv[]); int min_args; // minimum number of args int max_args; // maximum number of args } subcmds_[] = { {"authorize", &TclAstroCat::authorizeCmd, 0, 4}, {"check", &TclAstroCat::checkCmd, 1, 1}, {"checkrow", &TclAstroCat::checkrowCmd, 1, 1}, {"close", &TclAstroCat::closeCmd, 0, 0}, {"comments", &TclAstroCat::commentsCmd, 0, 1}, {"copyright", &TclAstroCat::copyrightCmd, 0, 0}, {"datatype", &TclAstroCat::datatypeCmd, 0, 0}, {"dec_col", &TclAstroCat::dec_colCmd, 0, 0}, {"entry", &TclAstroCat::entryCmd, 1, 4}, {"epoch", &TclAstroCat::epochCmd, 0, 0}, {"equinox", &TclAstroCat::equinoxCmd, 0, 0}, {"equinoxprefix",&TclAstroCat::equinoxPrefixCmd,0, 0}, {"feedback", &TclAstroCat::feedbackCmd, 1, 1}, {"getcol", &TclAstroCat::getcolCmd, 2, 2}, {"getidpos", &TclAstroCat::getidposCmd, 1, 1}, {"getimage", &TclAstroCat::getimageCmd, 0, 99}, {"getpreview", &TclAstroCat::getpreviewCmd, 2, 4}, {"hascol", &TclAstroCat::hascolCmd, 1, 1}, {"headings", &TclAstroCat::headingsCmd, 0, 0}, {"help", &TclAstroCat::helpCmd, 0, 0}, {"id_col", &TclAstroCat::id_colCmd, 0, 0}, {"info", &TclAstroCat::infoCmd, 1, 2}, {"is_tcs", &TclAstroCat::is_tcsCmd, 0, 2}, {"ispix", &TclAstroCat::ispixCmd, 0, 0}, {"iswcs", &TclAstroCat::iswcsCmd, 0, 0}, {"load", &TclAstroCat::loadCmd, 1, 2}, {"longname", &TclAstroCat::longnameCmd, 0, 2}, {"more", &TclAstroCat::moreCmd, 0, 0}, {"open", &TclAstroCat::openCmd, 1, 2}, {"plot", &TclAstroCat::plotCmd, 5, 5}, {"query", &TclAstroCat::queryCmd, 0, 99}, {"querypos", &TclAstroCat::queryposCmd, 0, 0}, {"ra_col", &TclAstroCat::ra_colCmd, 0, 0}, {"reload", &TclAstroCat::reloadCmd, 0, 0}, {"remove", &TclAstroCat::removeCmd, 1, 4}, {"root", &TclAstroCat::rootCmd, 0, 0}, {"save", &TclAstroCat::saveCmd, 1, 5}, {"searchcols", &TclAstroCat::searchcolsCmd, 0, 1}, {"servtype", &TclAstroCat::servtypeCmd, 0, 2}, {"shortname", &TclAstroCat::shortnameCmd, 0, 2}, {"showcols", &TclAstroCat::showcolsCmd, 0, 1}, {"sortcols", &TclAstroCat::sortcolsCmd, 0, 1}, {"sortorder", &TclAstroCat::sortorderCmd, 0, 1}, {"stc_col", &TclAstroCat::stc_colCmd, 0, 0}, {"symbol", &TclAstroCat::symbolCmd, 0, 1}, {"system", &TclAstroCat::systemCmd, 0, 0}, {"ucd", &TclAstroCat::ucdCmd, 0, 0}, {"unit", &TclAstroCat::unitCmd, 0, 0}, {"url", &TclAstroCat::urlCmd, 0, 2}, {"utype", &TclAstroCat::utypeCmd, 0, 0}, {"x_col", &TclAstroCat::x_colCmd, 0, 0}, {"y_col", &TclAstroCat::y_colCmd, 0, 0}, }; /* * Call the given method in this class with the given arguments */ int TclAstroCat::call(const char* name, int len, int argc, char* argv[]) { // since this tcl command has a lot of subcommands, // we do a binary search on the method table int low = 0, high = sizeof(subcmds_)/sizeof(*subcmds_) - 1, mid, cond; while (low <= high) { mid = (low + high) / 2; if ((cond = strcmp(name, subcmds_[mid].name)) < 0) high = mid - 1; else if (cond > 0) low = mid + 1; else { TclAstroCatSubCmds& t = subcmds_[mid]; if (check_args(name, argc, t.min_args, t.max_args) != TCL_OK) return TCL_ERROR; return (this->*t.fptr)(argc, argv); } } // not found ? extend search to parent class return TclCommand::call(name, len, argc, argv); } /* * A call to this function can be made from the tkAppInit file at startup * to install the Tcl astrocat and astroimage and relaxted commands * * (note: for convenience, we also install related commands here) */ extern "C" int TclAstroImage_Init(Tcl_Interp *interp); extern "C" int TclWorldCoords_Init(Tcl_Interp *interp); extern "C" int TclTcsCat_Init(Tcl_Interp *interp); extern "C" int Cat_Init(Tcl_Interp* interp) { // Initialize the local packages that "cat" depends on (we include the // object files from these packages directly, to avoid having the // extra dependencies.) // initialize the tclutil package if (Tclutil_Init(interp) == TCL_ERROR) { return TCL_ERROR; } // initialize the astrotcl package if (Astrotcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } char buf[2048]; // set up Cat Tcl package if (Tcl_PkgProvide (interp, "Cat", PACKAGE_VERSION) != TCL_OK) { return TCL_ERROR; } // define bitmaps used by Tcl library defineCatBitmaps(interp); // install the astroimage command if (TclAstroImage_Init(interp) == TCL_ERROR) { return TCL_ERROR; } // install the wcs command if (TclWorldCoords_Init(interp) == TCL_ERROR) { return TCL_ERROR; } // install the tcscat command if (TclTcsCat_Init(interp) == TCL_ERROR) { return TCL_ERROR; } // install the astrocat command Tcl_CreateCommand(interp, "astrocat", (Tcl_CmdProc*)TclAstroCat::astroCatCmd, NULL, NULL); // Set the global Tcl variable cat_version Tcl_SetVar(interp, "cat_version", PACKAGE_VERSION, TCL_GLOBAL_ONLY); return Tcl_Eval(interp, initScript); } /* * for backward compat. */ extern "C" int TclAstroCat_Init(Tcl_Interp* interp) { return Cat_Init(interp); } /* * Implementation of the tcl extended command "astrocat" - * usage: see man page for more details */ int TclAstroCat::astroCatCmd(ClientData, Tcl_Interp* interp, int argc, char* argv[]) { if (argc != 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " instanceName\"", NULL); return TCL_ERROR; } TclAstroCat* cmd = new TclAstroCat(interp, argv[0], argv[1]); return cmd->status(); } /* * Constructor - * * Create an "astrocat" object in tcl for accessing the contents of star * catalogs. * * Note that the tcl command for this object is created in the * parent class constructor. */ TclAstroCat::TclAstroCat(Tcl_Interp* interp, const char* cmdname, const char* instname) : TclCommand(interp, cmdname, instname), cat_(NULL), feedback_(NULL), result_(NULL) { strcpy(equinoxStr_, "2000"); } /* * desctructor */ TclAstroCat::~TclAstroCat() { if (cat_) delete cat_; if (result_) delete result_; } /* * Return the catalog directory entry for the given name or list of * names. * * "dirList" may be the name of a catalog directory, or a Tcl list * of catalog directory names forming the path to the directory. */ CatalogInfoEntry* TclAstroCat::lookupCatalogDirectoryEntry(const char* dirList) { // empty strings means use root if (dirList == NULL || strlen(dirList) == 0) return CatalogInfo::root(); // check if it is not a list, but the name of the directory CatalogInfoEntry* entry = CatalogInfo::lookup(dirList); if (!entry) { Tcl_ResetResult(interp_); int n; char** dirs; if (Tcl_SplitList(interp_, (char*)dirList, &n, &dirs) != TCL_OK) { return NULL; } entry = CatalogInfo::lookup(dirs[0]); if (!entry) { error("catalog directory entry not found for: ", dirs[0]); return NULL; } for(int i = 1; i < n; i++) { entry = CatalogInfo::lookup(entry, dirs[i]); if (!entry) { fmt_error("catalog directory entry for '%s' not found under '%s'", dirs[i], dirs[i-1]); return NULL; } if (strcmp(entry->servType(), "directory") != 0) { fmt_error("'%s' is not a catalog directory entry", dirs[i]); return NULL; } } } if (entry && strcmp(entry->servType(), "directory") != 0) { fmt_error("'%s' is not a catalog directory entry", entry->longName()); return NULL; } return entry; } /* * Open the given astromonical catalog and refer to it in future * queries. * * Usage: $cat open catalogName ?catalogDirectory? * * Where "name" is the name of the catalog (short or long name) * and the optional "catalogDirectory" argument is the name of the * catalog directory containing the catalog, or a list * of catalog directories forming the path to the catalog. * This may be used to avoid conflicts when two catalogs in * different parts of the tree have the same name. */ int TclAstroCat::openCmd(int argc, char* argv[]) { if (cat_) { delete cat_; cat_ = NULL; } if (argc == 1 || (argc == 2 && strlen(argv[1]) == 0)) { // open given catalog cat_ = AstroCatalog::open(argv[0]); if (!cat_) return TCL_ERROR; } if (argc == 2) { // open given catalog in given directory path CatalogInfoEntry* entry = lookupCatalogDirectoryEntry(argv[1]); if (!entry) return TCL_ERROR; entry = CatalogInfo::lookup(entry, argv[0]); if (!entry) return fmt_error("catalog entry for '%s' not found under '%s': ", argv[0], argv[1]); // make a new AstroCatalog object from the entry if (AstroCatalog::isLocalCatalog(entry)) cat_ = new LocalCatalog(entry); else cat_ = new AstroCatalog(entry); if (!cat_ || cat_->status() != 0) return TCL_ERROR; } // set up feedback, if requested if (feedback_) cat_->feedback(feedback_); return TCL_OK; } /* * close the current catalog, if one was open */ int TclAstroCat::closeCmd(int argc, char* argv[]) { if (cat_) delete cat_; cat_ = NULL; return TCL_OK; } /* * save subcommand: * * usage: $cat save $filename ?$iflag? ?$data? ?$equinox? ?$headings? * * With 1 arg, save the results of the previous query to the given file. * * If $iflag is true, the data is inserted in the file if it already * exists and the file is sorted and duplicates removed. * * If $data is specified, it should be a Tcl list of rows to be saved, in * the format returned by the query command. * * If $equinox is specified, it is the equinox of the ra and dec columns in * the data (the first 3 columns are assumed to be id, ra and dec, unless * otherwise defined in the catalog config entry or header). * * If $headings is given, it is used as a Tcl list of column headings. * Otherwise the catalog headings are used, if there is a current * catalog. * * The data is saved to a file in the form of a local catalog (tab table) * that can be loaded again or processed by starbase utilities. */ int TclAstroCat::saveCmd(int argc, char* argv[]) { int iflag = 0; char* filename = argv[0]; if (argc >= 2) { if (Tcl_GetBoolean(interp_, argv[1], &iflag) != TCL_OK) return TCL_ERROR; } if (argc <= 2) { if (!result_) return error("no previous data to save"); int id_col = 0; // catalog's id column index if (cat_) id_col = cat_->entry()->id_col(); return (iflag ? result_->insert(filename, id_col) : result_->save(filename)); } int numCols = 0;; char** colNames = NULL; int freeColNames = 0; char* equinoxStr = (char *)"J2000"; if (argc >= 4) equinoxStr = argv[3]; // get the column names if (argc <= 4) { // use current catalog if (!cat_) return error("no catalog is currently open"); numCols = cat_->numCols(); colNames = cat_->colNames(); } else if (argc == 5) { // use headings list if (Tcl_SplitList(interp_, argv[4], &numCols, &colNames) != TCL_OK) return TCL_ERROR; freeColNames++; // delete memory later } else { return error("wrong # of args for save"); // should not get here ... } // save the query results int status = saveQueryResult(filename, numCols, (char**)colNames, argv[2], iflag, equinoxStr); // clean up if (freeColNames && colNames) Tcl_Free((char *)colNames); // free split list of column headings return status; } /* * Save the query results with the given columns and values to the given * filename. If iflag is true, insert in the existing file, otherwise create * a new file. * "equinoxStr" specifies the equinox of the image being displayed, or one of " "J2000", "B1950", "GALACTIC", "ECLIPTIC". * (the coordinate conversion routines expect coordinates in this system). */ int TclAstroCat::saveQueryResult(const char* filename, int numCols, char** colNames, char* info, int iflag, const char* equinoxStr) { // create a QueryResult object from the headings and data and // save (or append) it to the file QueryResult r; int id_col = 0; // catalog's id column index if (cat_) { r.entry(cat_->entry()); id_col = cat_->entry()->id_col(); } if (getQueryResult(numCols, colNames, info, equinoxStr, r) != TCL_OK) return TCL_ERROR; return (iflag ? r.insert(filename, id_col) : r.save(filename)); } /* * Remove the query results with the given columns and values from the given * filename. * "equinoxStr" specifies the equinox of the image being displayed, or one of " "J2000", "B1950", "GALACTIC", "ECLIPTIC". * (the coordinate conversion routines expect coordinates in this system). */ int TclAstroCat::removeQueryResult(const char* filename, int numCols, char** colNames, char* info, const char* equinoxStr) { // create a QueryResult object from the headings and data and // remove rows matching it from the file QueryResult r; int id_col = 0; if (cat_) { r.entry(cat_->entry()); id_col = cat_->entry()->id_col(); } if (getQueryResult(numCols, colNames, info, equinoxStr, r) != TCL_OK) return TCL_ERROR; return r.remove(filename, id_col); } /* * remove subcommand: * * usage: $cat remove $filename ?$data? ?$equinox? ?$headings? * * With 1 arg, remove the results of the previous query from the given file. * * If $data is specified, it should be a Tcl list of rows to be removed, in * the format returned by the query command. * * If $equinox is specified, it is the equinox of ra and dec in $data (so that * ra,dec can be converted to J2000 for comparison). * * If $headings is given, it is used as a Tcl list of column headings. * Otherwise the catalog headings are used, if there is a current * catalog. * * The data rows are removed from the file, which should be in the form of a * local catalog (tab table), such as that used by the starbase utilities. */ int TclAstroCat::removeCmd(int argc, char* argv[]) { if (argc <= 1) { if (!result_) return error("no previous data for remove"); return result_->remove(argv[0], 0); } int numCols = 0;; char** colNames = NULL; int freeColNames = 0; double equinox = 2000.; char* equinoxStr = (char *)"J2000"; if (argc >= 3) equinoxStr = argv[2]; // get the column names if (argc <= 3) { // use current catalog if (!cat_) return error("no catalog is currently open"); numCols = cat_->numCols(); colNames = cat_->colNames(); } else if (argc == 4) { // use headings list if (Tcl_SplitList(interp_, argv[3], &numCols, &colNames) != TCL_OK) return TCL_ERROR; freeColNames++; // delete memory later } else { return error("wrong # of args for remove"); // should not get here ... } // create a QueryResult object from the headings and data and // remove rows matching it from the file int status = removeQueryResult(argv[0], numCols, (char**)colNames, argv[1], equinoxStr); // clean up if (freeColNames && colNames) Tcl_Free((char *)colNames); // free split list of column headings return status; } /* * Check that the given filename is a valid local catalog * (tab table format). */ int TclAstroCat::checkCmd(int argc, char* argv[]) { return LocalCatalog::check_table(argv[0]); } /* * Tcl subcommand: "iswcs" returns true if the catalog is based on world * coordinates */ int TclAstroCat::iswcsCmd(int argc, char* argv[]) { if (!cat_) return error("no catalog is open"); return set_result(cat_->isWcs()); } /* * Tcl subcommand: "ispix" returns true if the catalog is based on image * pixel coordinates */ int TclAstroCat::ispixCmd(int argc, char* argv[]) { if (!cat_) return error("no catalog is open"); return set_result(cat_->isPix()); } /* * Check that the given row (tcl list of columns) is valid for a local * catalog. The row should contain valid values for ra and dec, if we are * using world coords, or x and y, if we are using image coords. The * default columns are "id ra dec ...", but can be overridden in the * catalog config file or header. * * usage: $cat checkrow $data * * generates an error if the position (ra, dec) or (x, y) is not found or * is not in range */ int TclAstroCat::checkrowCmd(int argc, char* argv[]) { int numValues; char** values; if (Tcl_SplitList(interp_, argv[0], &numValues, &values) != TCL_OK) return TCL_ERROR; // if (numValues < 3) { // free(values); // return error("expected at least 3 columns (id, ra, dec or id, x, y)"); // } if (! cat_) return error("no catalog is currently selected"); WorldOrImageCoords pos; if (cat_->isWcs()) pos = WorldCoords(values[cat_->ra_col()], values[cat_->dec_col()]); else if (cat_->isPix()) pos = ImageCoords(values[cat_->x_col()], values[cat_->y_col()]); Tcl_Free((char *)values); return pos.status(); } /* * feedback subcommand: * * specifies a Tcl file descriptor to use to write feedback info during * HTTP transfer of catalog data. 1 Arg: file descriptor. */ int TclAstroCat::feedbackCmd(int argc, char* argv[]) { if (strlen(argv[0]) != 0) { if (Tcl_GetOpenFile(interp_, argv[0], 1, 1, (ClientData*)&feedback_) != TCL_OK) return TCL_ERROR; } else { feedback_ = NULL; } if (cat_) cat_->feedback(feedback_); return TCL_OK; } /* * pass a query to the current catalog and return the result as a list of * rows. * * usage: $cat query -option value ... * * See comments in genAstroQuery in TclQueryUtil.C for details on the * options. * * The result is a tcl list of query result rows, where each row is a tcl list * of column values. */ int TclAstroCat::queryCmd(int argc, char* argv[]) { if (!cat_) return error("no catalog is currently open"); // generate the query from the command args AstroQuery q; if (genAstroQuery(interp_, argc, argv, q, pos1_, pos2_, equinoxStr_, feedback_, cat_->entry()) != TCL_OK) return TCL_ERROR; // make new QueryResult object, or reuse previous one if (result_) result_->clear(); else result_ = new QueryResult; // do the query int nrows = cat_->query(q, NULL, *result_); // get the results int ncols = result_->numCols(); char* s; int i = 0, j = 0; int errs = 0; if (nrows >= 0) { Tcl_ResetResult(interp_); Tcl_Obj *result = Tcl_GetObjResult(interp_); for (i = 0; i < nrows; i++) { // start a row Tcl_Obj *list = Tcl_NewListObj(0, NULL); if (cat_->isWcs()) { // include formatted world coords WorldCoords pos; if (result_->getPos(i, pos) != 0) return TCL_ERROR; // format the ra,dec position arguments in H:M:S... char ra_buf[32], dec_buf[32]; int ra_col = result_->ra_col(), dec_col = result_->dec_col(); pos.print(ra_buf, dec_buf, equinoxStr_); // put the column values in a list for (j = 0; j < ncols; j++) { if (result_->get(i, j, s) != 0) s = (char *)""; if (j == ra_col) Tcl_ListObjAppendElement(interp_, list, Tcl_NewStringObj(ra_buf,-1)); else if (j == dec_col) Tcl_ListObjAppendElement(interp_, list, Tcl_NewStringObj(dec_buf,-1)); else Tcl_ListObjAppendElement(interp_, list, Tcl_NewStringObj(s, -1)); } } else { // image coords - no special formatting needed // put the column values in a list for (j = 0; j < ncols; j++) { if (result_->get(i, j, s) != 0) s = (char *)""; Tcl_ListObjAppendElement(interp_, list, Tcl_NewStringObj(s, -1)); } } // end a row Tcl_ListObjAppendElement(interp_, result, list); } return TCL_OK; } return TCL_ERROR; // an query error occured (and was reported) } /* * Request an image from the current image server and return (in Tcl) * the name of the FITS file holding the image. * * usage: $cat getimage -option value ... * * See comments in genAstroQuery in TclQueryUtil.C for details on the * options. */ int TclAstroCat::getimageCmd(int argc, char* argv[]) { if (!cat_) return error("no catalog is currently open"); // generate the query from the command args AstroQuery q; if (genAstroQuery(interp_, argc, argv, q, pos1_, pos2_, equinoxStr_, feedback_, cat_->entry()) != TCL_OK) return TCL_ERROR; // do the query if (cat_->getImage(q) != 0) return TCL_ERROR; return set_result(cat_->tmpfile()); } /* * querypos subcommand: * * usage: $cat querypos * * Return the world or image coordinate position arguments from the most * recent query, posibly expanded by a name server such as SIMBAD. The * result is a list of the form {ra dec equinox} for world coordinates * or just {x y} for image coords. * */ int TclAstroCat::queryposCmd(int argc, char* argv[]) { ostringstream os; if (! pos1_.isNull()) { pos1_.print(os, equinoxStr_); // print coords in given equinox if (pos1_.isWcs()) os << " " << equinoxStr_; return set_result(os.str().c_str()); } return TCL_OK; } /* * catalog "info" subcommand: * * usage: $cat info $serv_type ?$directory? * * This command returns a list of catalogs from the catalog config file. * The "serv_type" argument determines which catalogs are listed (one of: * catalog, namesvr, imagesvr, directory, local...). * * If $serv_type is an empty string, all entries are returned. * * If $directory is specified, the return list will be from the given * catalog directory entry, retrieved via HTTP if needed. The default, if * no $directory is given, is the top level list read from the default * config file at startup. $directory may also be a tcl list of directories * forming the path to the target directory. */ int TclAstroCat::infoCmd(int argc, char* argv[]) { Tcl_ResetResult(interp_); CatalogInfoEntry* e; if (argc == 2) { e = lookupCatalogDirectoryEntry(argv[1]); if (!e) return TCL_ERROR; if (! e->link()) { if (CatalogInfo::load(e) != 0) // follow catalog dir link return TCL_ERROR; } } else { e = CatalogInfo::root(); } if (!e || !e->link()) return error("can't find catalog info"); e = e->link(); // get pointer to first catalog in directory // get the serv_type Tcl_ResetResult(interp_); int n = strlen(argv[0]); for (; e != NULL; e = e->next()) { if (strncmp(argv[0], e->servType(), n) == 0) { // ignore local catalogs in /tmp, since they will be deleted later if (! (strcmp(e->servType(), "local") == 0 && strncmp(e->url(), "/tmp/", 5) == 0)) { Tcl_AppendElement(interp_, (char*)e->longName()); } } } return TCL_OK; } /* * catalog "root" subcommand: * * usage: $cat root * * This command returns the name of the root catalog directory * */ int TclAstroCat::rootCmd(int argc, char* argv[]) { Tcl_ResetResult(interp_); const CatalogInfoEntry* e = CatalogInfo::root(); if (!e) return error("no catalogs are loaded"); return set_result(e->longName()); } /* * append the given keyword/value pair to the Tcl result */ void TclAstroCat::appendKeyVal(const char* keyword, const char* value) { if (! value) return; Tcl_AppendResult(interp_, " {", NULL); Tcl_AppendElement(interp_, (char*)keyword); Tcl_AppendElement(interp_, (char*)value); Tcl_AppendResult(interp_, "}", NULL); } /* * append the given list value to the Tcl result. The value is assumed * to already be a a colon separated list of space separated lists. * "a b c : d e f". Here we make sure that the lists are proper Tcl lists, * with special chars handled correctly. */ int TclAstroCat::appendListVal(const char* value) { if (! value) return TCL_OK; char* v = strdup(value); char* p; char* q = v; do { Tcl_AppendResult(interp_, " {", NULL); p = strchr(q, ':'); if (p) *p++ = '\0'; int numValues; char** values; if (Tcl_SplitList(interp_, q, &numValues, &values) != TCL_OK) { free(v); Tcl_ResetResult(interp_); return Tcl_SplitList(interp_, q, &numValues, &values); } q = p; for(int i = 0; i < numValues; i++) { Tcl_AppendElement(interp_, values[i]); } Tcl_Free((char *)values); Tcl_AppendResult(interp_, "}", NULL); } while(p); return TCL_OK; } /* * append the given keyword/value pair to the Tcl result and make a * proper tcl list of lists out of the value, which should have the * format "a b c : d e f : ...", where ':' is the sep char for the main * lists, and space is the sep char for the sublists. */ int TclAstroCat::appendKeyListVal(const char* keyword, const char* value) { if (! value || ! strlen(value)) return TCL_OK; Tcl_AppendResult(interp_, " {", NULL); Tcl_AppendElement(interp_, (char*)keyword); Tcl_AppendResult(interp_, " {", NULL); if (appendListVal(value) != TCL_OK) return TCL_ERROR; Tcl_AppendResult(interp_, "}", NULL); Tcl_AppendResult(interp_, "}", NULL); return TCL_OK; } /* * This method is used to write the value of entries that have the * format: "a b c : d e f" in the config file, but are treated as * tcl lists of lists in Tcl. * * Write the config file format entry value part to the stream. */ int TclAstroCat::tclListToConfigStreamValue(const char* tclList, ostream& os) { int numValues = 0; char** values = NULL; // split into {keyword value} lists if (Tcl_SplitList(interp_, (char*)tclList, &numValues, &values) != TCL_OK) return TCL_ERROR; for (int i = 0; i < numValues; i++) { os << values[i]; if (i < (numValues-1)) os << " : "; } Tcl_Free((char *)values); return TCL_OK; } /* * write the given catalog config entry line (tcl list format) to the * given stream in the format: * * keyword; value */ int TclAstroCat::tclListToConfigStreamLine(const char* tclList, ostream& os) { int numValues = 0; char** values = NULL; // split into {keyword value} lists if (Tcl_SplitList(interp_, (char*)tclList, &numValues, &values) != TCL_OK) return TCL_ERROR; if (numValues != 2) { Tcl_Free((char *)values); return error("astrocat: expected {keyword value} list, not: ", tclList); } const char* keyword = values[0]; const char* value = values[1]; // append to an inline config entry to pass to the entry update method if (strcmp(keyword, "symbol") == 0 || strcmp(keyword, "search_cols") == 0) { os << keyword << ": "; if (tclListToConfigStreamValue(value, os) != TCL_OK) { Tcl_Free((char *)values); return TCL_ERROR; } os << endl; } else { os << keyword << ": " << value << endl; } Tcl_Free((char *)values); return TCL_OK; } /* * write the given catalog config entry (tcl list format) to the * given stream in the format: * * keyword; value * keyword: valuue */ int TclAstroCat::tclListToConfigStream(const char* tclList, ostream& os) { int numValues = 0; char** values = NULL; // split into {keyword value} lists if (Tcl_SplitList(interp_, (char*)tclList, &numValues, &values) != TCL_OK) return TCL_ERROR; for (int i = 0; i < numValues; i++) { if (tclListToConfigStreamLine(values[i], os) != TCL_OK) { Tcl_Free((char *)values); return TCL_ERROR; } } Tcl_Free((char *)values); return TCL_OK; } /* * catalog "entry" subcommand: * * usage: $cat entry get ?name? ?directory? * or: $cat entry set $info ?name? ?directory? * or: $cat entry update $info ?name? ?directory? * or: $cat entry add $info ?directory? * or: $cat entry remove $name * * "entry get" returns the catalog config entry for the currently open * catalog or for the given catalog if one is specified. * * The format of the return value is a tcl list of {keyword value} pairs: * * {{key value} {key value} ...} * * for example: * * {{serv_type catalog} * {long_name "Guide Star Catalog at ESO"} * {short_name gsc@eso} * {url http://archive.eso.org/...} * {symbol ...} * {id_col 0} * {ra_col 1} * {dec_col 2} * ...} * * If the "directory" argument is specified, the entry is searched for * starting in the given catalog directory, otherwise it is searched for * starting at the top level directory (the catalog entries are linked * in a hierarchical list or directory structure). "directory" may also be * a tcl list of catalog directories, forming the path to the directory. * * "entry update" allows you to update fields in the catalog's config * entry. Some fields, such as the catalog name and URL can not be * changed in this way, however the column positions id_col, ra_col, * dec_col, etc... may be updated. The format for the update info is the * same as that returned by "entry get". The directory argument has the * same meaning as with the "entry get" subcommand. * * Note: The "entry update" command is needed, for example, when a * catalog query was run in a subprocess. The results of the query may * include config info, such as the default plot symbol and the columns * for id, ra and dec. This subcommand can be used to get this * information back into the parent process catalog entry. * * "entry add" adds a new catalog entry to the internal list. The format * of the argument is the same as that for update. The entry is added to the * given directory or the top level if none is specified. * * "entry remove" removes the entry for the named catalog from the internal * default catalog list. * */ int TclAstroCat::entryCmd(int argc, char* argv[]) { CatalogInfoEntry* e; CatalogInfoEntry* dir = CatalogInfo::root(); if (! dir) return TCL_ERROR; Tcl_ResetResult(interp_); if (strcmp(argv[0], "get") == 0) { char buf[80]; if (argc == 1) { // get entry from current catalog if (! cat_) return error("no catalog is open"); e = cat_->entry(); } else { if (argc > 2) { // use given catalog directory dir = lookupCatalogDirectoryEntry(argv[2]); if (!dir) return TCL_ERROR; } // get entry from named catalog e = CatalogInfo::lookup(dir, argv[1]); if (!e) return error("can't find catalog entry for: ", argv[1]); } // return tcl list with config entry info appendKeyVal("serv_type", (char*)e->servType()); appendKeyVal("long_name", (char*)e->longName()); appendKeyVal("short_name", (char*)e->shortName()); appendKeyVal("url", (char*)e->url()); appendKeyVal("backup1", (char*)e->backup1()); appendKeyVal("backup2", (char*)e->backup2()); if (appendKeyListVal("symbol", (char*)e->symbol()) != TCL_OK) return TCL_ERROR; if (appendKeyListVal("search_cols", (char*)e->searchCols()) != TCL_OK) return TCL_ERROR; appendKeyVal("sort_cols", (char*)e->sortCols()); appendKeyVal("sort_order", (char*)e->sortOrder()); appendKeyVal("show_cols", (char*)e->showCols()); appendKeyVal("copyright", (char*)e->copyright()); appendKeyVal("help", (char*)e->help()); appendKeyVal("system", (char*)e->system()); // don't include these values if they are already defaults if (e->equinox() != 2000.) { sprintf(buf, "%lg", e->equinox()); appendKeyVal("equinox", buf); } if (e->id_col() != 0) { sprintf(buf, "%d", e->id_col()); appendKeyVal("id_col", buf); } if (e->ra_col() != 1) { sprintf(buf, "%d", e->ra_col()); appendKeyVal("ra_col", buf); } if (e->dec_col() != 2) { sprintf(buf, "%d", e->dec_col()); appendKeyVal("dec_col", buf); } if (e->x_col() != -1) { sprintf(buf, "%d", e->x_col()); appendKeyVal("x_col", buf); } if (e->y_col() != -1) { sprintf(buf, "%d", e->y_col()); appendKeyVal("y_col", buf); } if (e->is_tcs()) { sprintf(buf, "%d", e->is_tcs()); appendKeyVal("is_tcs", buf); } if (e->stc_col() != -1) { sprintf(buf, "%d", e->stc_col()); appendKeyVal("stc_col", buf); } } else if (strcmp(argv[0], "remove") == 0) { e = CatalogInfo::lookup(argv[1]); if (!e) return TCL_ERROR; return CatalogInfo::remove(e); } else { int update = 0, set = 0; if (strcmp(argv[0], "update") == 0) { update++; if (argc == 4 && !(dir = lookupCatalogDirectoryEntry(argv[3]))) return TCL_ERROR; } else if (strcmp(argv[0], "set") == 0) { set++; if (argc == 4 && !(dir = lookupCatalogDirectoryEntry(argv[3]))) return TCL_ERROR; } else if (strcmp(argv[0], "add") == 0) { if (argc == 3 && !(dir = lookupCatalogDirectoryEntry(argv[2]))) return TCL_ERROR; } else { return error("unknown astrocat entry subcommand: ", argv[0]); } // update the entry with new info if (argc < 2) return error("missing catalog entry argument"); ostringstream os; // convert tcl list entry to config file format if (tclListToConfigStream(argv[1], os) != TCL_OK) return TCL_ERROR; // read the new config file entry if (! os) return error("internal error writing config entry"); istringstream is(os.str()); if (update || set) { if (argc == 2) { // use current catalog entry if (! cat_) return error("no catalog is open"); e = cat_->entry(); } else { // update named catalog entry (in named dir) e = CatalogInfo::lookup(dir, argv[2]); if (!e) return error("can't find catalog entry for: ", argv[2]); } if (update) { /* entry update */ CatalogInfo::updateConfigEntry(is, e); } else { /* entry set */ CatalogInfoEntry* ne = CatalogInfo::load(is); if (! ne) return TCL_ERROR; *e = *ne; } } else { /* entry add */ e = CatalogInfo::load(is); if (! e) return TCL_ERROR; // add to end of main entry list return CatalogInfo::append(e); } } return TCL_OK; } /* * load subcommand: * * usage: $cat load $filename ?longName? * * This command loads the named catalog config file, making the catalogs * in it available to the application under the given name * (default: last component of file name). */ int TclAstroCat::loadCmd(int argc, char* argv[]) { ifstream is(argv[0]); if (!is) return sys_error("can't open file: ", argv[0]); CatalogInfoEntry* e = CatalogInfo::load(is, argv[0]); if (!e) return TCL_ERROR; // make a directory entry for the file and add it to the catalog tree CatalogInfoEntry* dir = new CatalogInfoEntry; dir->servType("directory"); char url[2048+5]; sprintf(url, "file:%s", argv[0]); dir->url(url); const char* s = fileBasename(argv[0]); dir->shortName(s); if (argc > 1) s = argv[1]; dir->longName(s); // name to be displayed dir->link(e); return CatalogInfo::append(dir); } /* * reload subcommand: * * usage: $cat reload * * This command reloads the default catalog config file and updates the * internal catalog entries from it. This is meant to be used after * the config file has been edited by hand to make the new data available * to the application. */ int TclAstroCat::reloadCmd(int argc, char* argv[]) { return CatalogInfo::reload(); } /* * more subcommand: return true if there were more rows * to fetch on the last query (i.e.: not all rows that were * found were returned due to limits) */ int TclAstroCat::moreCmd(int argc, char* argv[]) { return set_result(cat_ ? cat_->more() : 0); } /* * headings subcommand: return a Tcl list of the column headings */ int TclAstroCat::headingsCmd(int argc, char* argv[]) { if (cat_) { int n = cat_->numCols(); if (n < 0) return TCL_ERROR; for(int i = 0; i < n; i++) Tcl_AppendElement(interp_, (char*)cat_->colName(i)); } return TCL_OK; } /* * column subcommands: id_col, ra_col, dec_col, x_col, y_col & stc_col * Just return the column index from the catalog config entry. */ int TclAstroCat::id_colCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->id_col()); return TCL_OK; } int TclAstroCat::ra_colCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->ra_col()); return TCL_OK; } int TclAstroCat::dec_colCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->dec_col()); return TCL_OK; } int TclAstroCat::x_colCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->x_col()); return TCL_OK; } int TclAstroCat::y_colCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->y_col()); return TCL_OK; } int TclAstroCat::stc_colCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->stc_col()); return TCL_OK; } /* * VO meta-data subcommands: */ int TclAstroCat::systemCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->system()); return TCL_OK; } int TclAstroCat::epochCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->epoch()); return TCL_OK; } int TclAstroCat::equinoxCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->equinox()); return TCL_OK; } int TclAstroCat::equinoxPrefixCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->equinoxprefix()); return TCL_OK; } int TclAstroCat::unitCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->unit()); return TCL_OK; } int TclAstroCat::ucdCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->ucd()); return TCL_OK; } int TclAstroCat::utypeCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->utype()); return TCL_OK; } int TclAstroCat::datatypeCmd(int argc, char* argv[]) { if (cat_) return set_result(cat_->datatype()); return TCL_OK; } /* * is_tcs command: * * usage: $cat is_tcs ?catalog? ?boolValue? * * With 0 or 1 arg, returns true if this catalog (or the given one) * is a TCS catalog. * * If a value is specified, it sets the tcs flag for the given catalog. * */ int TclAstroCat::is_tcsCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) return set_result(cat_->is_tcs()); return set_result(0); } CatalogInfoEntry* e = CatalogInfo::lookup(argv[0]); if (!e) return TCL_ERROR; if (argc == 1) return set_result(e->is_tcs()); int is_tcs = 0; if (Tcl_GetBoolean(interp_, argv[1], &is_tcs) != TCL_OK) return TCL_ERROR; e->is_tcs(is_tcs); return set_result(0); } /* * symbol subcommand: * * usage: $cat symbol ?value? * * With no args, return the "symbol" entry for this catalog. * With one arg, specify a new value for the symbol entry, * which should be a list of the form: * * {{colNames symbolExpr sizeExpr} ...} * * where colNames is a list of column names used, symbolExpr is one of * the accepted symbol expressions, such as "circle ?color?" and * sizeExpr is an expression (or a list of {expr ?units?}) giving the * radius of an object. */ int TclAstroCat::symbolCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) return appendListVal(cat_->symbol()); } if (! cat_) return error("no catalog is open"); cat_->entry()->symbol(argv[0]); return TCL_OK; } /* * searchcols subcommand: * * usage: $cat searchcols ?value? * * With no args, return the "search_cols" entry for this catalog. * With one arg, specify a new value for the search_cols entry, * which should be a list of the form: * * {{colName minLabel maxLabel} ...} * */ int TclAstroCat::searchcolsCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) return appendListVal(cat_->searchCols()); } else if (! cat_) return error("no catalog is open"); cat_->entry()->searchCols(argv[0]); return TCL_OK; } /* * sortcols subcommand: * * usage: $cat sortcols ?value? * * With no args, return the "sort_cols" entry for this catalog. * With one arg, specify a new value for the sort_cols entry, * which should be a list of the form: * * {col1 col2 ...} * */ int TclAstroCat::sortcolsCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) return set_result(cat_->sortCols()); } else if (! cat_) return error("no catalog is open"); cat_->entry()->sortCols(argv[0]); return TCL_OK; } /* * sortorder subcommand: * * usage: $cat sortorder ?value? * * With no args, return the "sort_order" entry for this catalog. * With one arg, specify a new value for the sort_order entry, * which should be a list of the form: * * {col1 col2 ...} * */ int TclAstroCat::sortorderCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) return set_result(cat_->sortOrder()); } else if (! cat_) return error("no catalog is open"); cat_->entry()->sortOrder(argv[0]); return TCL_OK; } /* * showcols subcommand: * * usage: $cat showcols ?value? * * With no args, return the "show_cols" entry for this catalog. * With one arg, specify a new value for the show_cols entry, * which should be a list of the form: * * {col1 col2 ...} * */ int TclAstroCat::showcolsCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) return set_result(cat_->showCols()); } else if (! cat_) return error("no catalog is open"); cat_->entry()->showCols(argv[0]); return TCL_OK; } /* * copyright subcommand: return the copyright info for this catalog * from the catalog config file. */ int TclAstroCat::copyrightCmd(int argc, char* argv[]) { if (cat_) { return set_result(cat_->copyright()); } return TCL_OK; } /* * help subcommand: return the help info for this catalog * from the catalog config file. */ int TclAstroCat::helpCmd(int argc, char* argv[]) { if (cat_) { return set_result(cat_->help()); } return TCL_OK; } /* * servtype subcommand: return the servtype for this catalog or * for the given catalog. * * "directory" may be the name of the parent catalog directory, or a list * of parent directories forming the path to the given name. * * usage: $cat servtype ?name? ?directory? */ int TclAstroCat::servtypeCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) { return set_result(cat_->servType()); } return TCL_OK; } CatalogInfoEntry* dir = CatalogInfo::root(); if (argc == 2) { // use given catalog directory dir = lookupCatalogDirectoryEntry(argv[1]); if (!dir) return TCL_ERROR; } const CatalogInfoEntry* e = CatalogInfo::lookup(dir, argv[0]); if (e) return set_result(e->servType()); return TCL_OK; } /* * url subcommand: return the url for this catalog or * for the given catalog. * * usage: $cat url ?name? ?directory? * * "directory" may be the name of the parent catalog directory, or a list * of parent directories forming the path to the given name. */ int TclAstroCat::urlCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) { return set_result(cat_->url()); } return TCL_OK; } CatalogInfoEntry* dir = CatalogInfo::root(); if (argc == 2) { // use given catalog directory dir = lookupCatalogDirectoryEntry(argv[1]); if (!dir) return TCL_ERROR; } const CatalogInfoEntry* e = CatalogInfo::lookup(dir, argv[0]); if (e) return set_result(e->url()); return TCL_OK; } /* * hascol subcommand: return true if the catalog contains the * given column name (in the config entry). */ int TclAstroCat::hascolCmd(int argc, char* argv[]) { if (cat_) { return set_result(cat_->hasCol(argv[0])); } return set_result(0); } /* * getcol subcommand: given a row of output from a query, * return the value for the named column in Tcl * * example: set preview [$cat getcol preview $row] */ int TclAstroCat::getcolCmd(int argc, char* argv[]) { int numValues; char** values; int index = -1; if (cat_) index = cat_->colIndex(argv[0]); if (index >= 0) { if (Tcl_SplitList(interp_, argv[1], &numValues, &values) != TCL_OK) return TCL_ERROR; if (index < numValues) { set_result(values[index]); } Tcl_Free((char *)values); } else { return error("no such column: ", argv[0]); } return TCL_OK; } /* * getidpos subcommand: given a row of output from a query, return a list * {id ra dec} (or {id x y} if we're not using wcs) for the given * row. The positions of the 3 columns default to the first 3 columns: * id, ra and dec, but might be specified differently in the catalog * config entry or result header. * * example: lassign [$cat getidpos $row] id ra dec */ int TclAstroCat::getidposCmd(int argc, char* argv[]) { // get column indexes from catalog info int id_col = 0, ra_col = 1, dec_col = 2; if (cat_) { id_col = cat_->id_col(); ra_col = cat_->ra_col(); dec_col = cat_->dec_col(); } int numValues; char** values; if (Tcl_SplitList(interp_, argv[0], &numValues, &values) != TCL_OK) return TCL_ERROR; Tcl_ResetResult(interp_); if (id_col >= 0 && id_col < numValues && ra_col >= 0 && ra_col < numValues && dec_col >= 0 && dec_col < numValues) { Tcl_AppendElement(interp_, values[id_col]); Tcl_AppendElement(interp_, values[ra_col]); Tcl_AppendElement(interp_, values[dec_col]); } Tcl_Free((char *)values); return TCL_OK; } /* * getpreview subcommand: given a URL from a query output line, get the * preview data and put it in a temp file. The return value in Tcl is a * list of {filename type}, where filename is the name of the file * containing the preview data and type is either "image" for a * decompressed FITS image or "table" for a tab table with data to be * plotted in a graph. * * The temp file is re-used and deleted in the destructor. * * example: set preview [$cat getpreview -url "http://...." ?-tmpfile "/tmp/img..."?] * * -url specifies the URL to use * * -tmpfile can be used to specify the image file name to use * */ int TclAstroCat::getpreviewCmd(int argc, char* argv[]) { if (!cat_) return error("no catalog is open"); char* url = NULL; for (int i = 0; i < argc; i += 2) { char* option = argv[i]; char* value = argv[i+1]; if (strcmp(option, "-url") == 0) { url = value; } else if (strcmp(option, "-tmpfile") == 0) { if (value) { unlink(cat_->tmpfile()); cat_->tmpfile(value); } } } if (!url) return error("missing -url option"); char* type; if (cat_->getPreview(url, type) != 0) return TCL_ERROR; Tcl_ResetResult(interp_); Tcl_AppendElement(interp_, (char*)cat_->tmpfile()); Tcl_AppendElement(interp_, type); return TCL_OK; } /* * authorize subcommand: If the previous HTTP GET returned an * authorization error: (The HTML error text returned in Tcl contained * the string: "Authorization Required"), the application can * ask the user to enter a username and password to use to access the * URL and then retry the GET after using this subcommand to set the * authorization information to use. * * usage: * * $cat authorize * $cat authorize username passwd ?realm server? * * With no arguments, this command returns a list of the form * * {needpasswd realm server} * * where: * needpasswd is nonzero if a password is required for the URL * realm is the string taken from the HTTP header (Basic realm=...). * server is the name of the target server that wants the password. * * If arguments are specified, they should be the username and password * and optionally the realm and server hostname. If the last 2 args are * specified, the information is stored in a file for later lookup * (see tclutil/util/src/HTTP.C). */ int TclAstroCat::authorizeCmd(int argc, char* argv[]) { if (!cat_) return error("no catalog is open"); if (argc == 0) { HTTP& http = cat_->http(); ostringstream os; os << http.authorizationRequired() << " " << http.www_auth_realm() << " " << http.hostname(); return set_result(os.str().c_str()); } if (argc == 2) HTTP::authorize(argv[0], argv[1]); else if (argc == 4) HTTP::authorize(argv[0], argv[1], argv[2], argv[3]); else return error("expected: astrocat authorize ?username passwd realm server?"); return TCL_OK; } /* * longname subcommand: * * usage: $cat longname ?name? ?directory? * * returns the long_name field from the catalog config file * for the given long or short name, or for the current catalog. * * "directory" may be the name of the parent catalog directory, or a list * of parent directories forming the path to the given name. */ int TclAstroCat::longnameCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) return set_result(cat_->longName()); return TCL_OK; } CatalogInfoEntry* dir = CatalogInfo::root(); if (argc == 2) { // use given catalog directory dir = lookupCatalogDirectoryEntry(argv[1]); if (!dir) return TCL_ERROR; } const CatalogInfoEntry* e = CatalogInfo::lookup(dir, argv[0]); if (e) return set_result(e->longName()); return TCL_OK; } /* * plot subcommand: plot the contents of the given tab table file in the given * BLT graph widget). * * usage: $cat plot $graph $element $filename xVector yVector * * element is the BLT graph element name * * filename is the local catalog file * * xVector is the name of the BLT x vector * * yVector is the name of the BLT y vector * * The data for the given element in the given graph will be set * directly from here without going through tcl. * * The return value in Tcl is the number of rows (for the graph's x-axis) * */ int TclAstroCat::plotCmd(int argc, char* argv[]) { char* graph = argv[0]; char* elem = argv[1]; char* filename = argv[2]; // mmap the file to get the data in memory Mem m(filename); if (m.status() != 0) return TCL_ERROR; // make a tab table out of the file TabTable tab((char*)m.ptr()); if (tab.status() != 0) return TCL_ERROR; // plot each row under the element name of the column heading int ncols = tab.numCols(); if (ncols < 2) return error("expected at least 2 table columns to plot"); // XXX how to interp 3 or more columns ? int nrows = tab.numRows(); int nvalues = nrows*2; double* xyvalues = new double[nvalues]; int n; for (int row = 0; row < nrows; row++) { if (tab.get(row, 0, xyvalues[n=row*2]) != 0 || tab.get(row, 1, xyvalues[++n]) != 0) { delete[] xyvalues; return TCL_ERROR; } } if (Blt_GraphElement(interp_, graph, elem, nvalues, xyvalues, argv[3], argv[4]) != TCL_OK) { delete[] xyvalues; return TCL_ERROR; } delete[] xyvalues; return set_result(nrows); } /* * shortname subcommand: * * usage: $cat shortname ?name? ?directory? * * returns the short_name field from the catalog config file * for the given long name, or for the current catalog. * * "directory" may be the name of the parent catalog directory, or a list * of parent directories forming the path to the given name. */ int TclAstroCat::shortnameCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) return set_result(cat_->shortName()); return TCL_OK; } CatalogInfoEntry* dir = CatalogInfo::root(); if (argc == 2) { // use given catalog directory dir = lookupCatalogDirectoryEntry(argv[1]); if (!dir) return TCL_ERROR; } const CatalogInfoEntry* e = CatalogInfo::lookup(dir, argv[0]); if (e) return set_result(e->shortName()); return TCL_OK; } /* * Convert the given list from a Tcl list to a QueryResult (tab table), * given the number of columns and the column headings. * * Note: this is needed to make a clean interface between the Tcl and C++ * classes. The Tcl part needs this because of the way that queries are * done in the background, so that the original results are lost when the * child process ends. That is why we have to convert back from Tcl list * to tab table here. It has the added advantage of making a flexible Tcl * command interface where you can specify catalog data as Tcl lists. * * The equinoxStr parameter may be a number in string form, such as "2000", * or "1950.", or it may also be one of "J2000", "B1950", "GALACTIC", "ECLIPTIC". * This value is used to convert the coordinates into the internal J2000 format. * * Normally the first 3 columns are id, ra and dec, but we can't rely on * this, so we take the column info from the QueryResult object (the * r.entry() method should be called to set the catalog entry before calling * this method). */ int TclAstroCat::getQueryResult(int numCols, char** colNames, const char* list, const char* equinoxStr, QueryResult& r) { ostringstream os; int numRows = 0; char** rows = NULL; char raStr[32], decStr[32]; int status = Tcl_SplitList(interp_, (char*)list, &numRows, &rows); if (status == TCL_OK) { for (int row = 0; row < numRows; row++) { int ncols = 0; char** cols = NULL; if (Tcl_SplitList(interp_, rows[row], &ncols, &cols) != TCL_OK || ncols != numCols) { status = error("wrong number of columns: ", rows[row]); break; } int n = ncols-1; if (r.isWcs()) { // if catalog uses world coords... // convert ra,dec to J2000, then print out in the catalog's equinox int ra_col = r.ra_col(); int dec_col = r.dec_col(); const char* raPtr = cols[ra_col]; const char* decPtr = cols[dec_col]; WorldCoords pos(raPtr, decPtr, equinoxStr); // converts to J2000 internally if (pos.status() != 0) { raStr[0] = decStr[0] = '\0'; } else { // print in catalog's equinox pos.print(raStr, decStr, r.equinox()); } // output the columns for (int col = 0; col < ncols; col++) { if (col == ra_col) os << raStr; // ra and dec are formatted specially else if (col == dec_col) os << decStr; else os << cols[col]; if (col < n) os << '\t'; } } else { // output the columns for (int col = 0; col < ncols; col++) { os << cols[col]; if (col < n) os << '\t'; } } os << '\n'; Tcl_Free((char *)cols); } } // create a QueryResult object from the headings and data and // save (or append) it to the file if (status == 0) status = r.init(numCols, colNames, os.str().c_str()); if (rows) Tcl_Free((char *)rows); // free split list of rows return status; } /* * comments subcommand: * * usage: $cat comments ?comments? * * return or set the comments associated with the current catalog. */ int TclAstroCat::commentsCmd(int argc, char* argv[]) { if (argc == 0) { if (cat_) return set_result(cat_->comments()); return TCL_OK; } if (cat_) { cat_->comments(argv[1]); return TCL_OK; } return error( "cannot set comments, no current catalog" ); } skycat-3.1.2-starlink-1b/cat/generic/TclAstroCat.h000066400000000000000000000126621215713201500216630ustar00rootroot00000000000000// -*-c++-*- #ifndef _TclAstroCat_h_ #define _TclAstroCat_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: TclAstroCat.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TclAstroCat.h - Tcl interface to the AstroCatalog C++ class for * accessing astronomical catalogs * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created * Peter W. Draper 18 Mar 09 Added commentsCmd and various commands for * VO support. */ using namespace std; #include "TclCommand.h" #include "AstroCatalog.h" /* * This class declares the methods used to implement the Tcl astrocat * command for accessing astronomical catalogs. */ class TclAstroCat : public TclCommand { protected: AstroCatalog* cat_; // pointer to current open catalog WorldOrImageCoords pos1_, pos2_; // saved positions from last query char equinoxStr_[32]; // saved equinox option from last query FILE* feedback_; // file ptr for feedback during xfer, if set QueryResult* result_; // saved pointer to results of previous query // call a member function by name virtual int call(const char* name, int len, int argc, char* argv[]); // convert tcl list to QueryResult given column headings virtual int getQueryResult(int numCols, char** colNames, const char* list, const char* equinoxStr, QueryResult& r); // Save (or insert) query results to the given file. virtual int saveQueryResult(const char* filename, int numCols, char** colNames, char* info, int iflag, const char* equinoxStr = NULL); // Remove query results from the given file. virtual int removeQueryResult(const char* filename, int numCols, char** colNames, char* info, const char* equinoxStr = NULL); // append the given keyword/value pair to the list virtual void appendKeyVal(const char* keyword, const char* value); virtual int appendKeyListVal(const char* keyword, const char* value); virtual int appendListVal(const char* value); // convert tcl list cat entry to config file format virtual int tclListToConfigStreamValue(const char* tclList, ostream& os); virtual int tclListToConfigStreamLine(const char* tclList, ostream& os); virtual int tclListToConfigStream(const char* tclList, ostream& os); // Return the catalog directory entry for the given name or path CatalogInfoEntry* lookupCatalogDirectoryEntry(const char* dirList); public: // constructor TclAstroCat(Tcl_Interp*, const char* cmdname, const char* instname); ~TclAstroCat(); // entry point from Tcl static int astroCatCmd(ClientData, Tcl_Interp* interp, int argc, char* argv[]); // -- tcl subcommands -- virtual int authorizeCmd(int argc, char* argv[]); virtual int checkCmd(int argc, char* argv[]); virtual int checkrowCmd(int argc, char* argv[]); virtual int closeCmd(int argc, char* argv[]); virtual int copyrightCmd(int argc, char* argv[]); virtual int dec_colCmd(int argc, char* argv[]); virtual int entryCmd(int argc, char* argv[]); virtual int feedbackCmd(int argc, char* argv[]); virtual int getcolCmd(int argc, char* argv[]); virtual int getidposCmd(int argc, char* argv[]); virtual int getimageCmd(int argc, char* argv[]); virtual int getpreviewCmd(int argc, char* argv[]); virtual int hascolCmd(int argc, char* argv[]); virtual int headingsCmd(int argc, char* argv[]); virtual int helpCmd(int argc, char* argv[]); virtual int id_colCmd(int argc, char* argv[]); virtual int infoCmd(int argc, char* argv[]); virtual int is_tcsCmd(int argc, char* argv[]); virtual int ispixCmd(int argc, char* argv[]); virtual int iswcsCmd(int argc, char* argv[]); virtual int loadCmd(int argc, char* argv[]); virtual int longnameCmd(int argc, char* argv[]); virtual int moreCmd(int argc, char* argv[]); virtual int openCmd(int argc, char* argv[]); virtual int plotCmd(int argc, char* argv[]); virtual int queryCmd(int argc, char* argv[]); virtual int queryposCmd(int argc, char* argv[]); virtual int ra_colCmd(int argc, char* argv[]); virtual int reloadCmd(int argc, char* argv[]); virtual int removeCmd(int argc, char* argv[]); virtual int rootCmd(int argc, char* argv[]); virtual int saveCmd(int argc, char* argv[]); virtual int searchcolsCmd(int argc, char* argv[]); virtual int servtypeCmd(int argc, char* argv[]); virtual int shortnameCmd(int argc, char* argv[]); virtual int showcolsCmd(int argc, char* argv[]); virtual int sortcolsCmd(int argc, char* argv[]); virtual int sortorderCmd(int argc, char* argv[]); virtual int stc_colCmd(int argc, char* argv[]); virtual int symbolCmd(int argc, char* argv[]); virtual int urlCmd(int argc, char* argv[]); virtual int x_colCmd(int argc, char* argv[]); virtual int y_colCmd(int argc, char* argv[]); // PWD: extras. virtual int systemCmd(int argc, char* argv[]); virtual int epochCmd(int argc, char* argv[]); virtual int equinoxCmd(int argc, char* argv[]); virtual int equinoxPrefixCmd(int argc, char* argv[]); virtual int unitCmd(int argc, char* argv[]); virtual int ucdCmd(int argc, char* argv[]); virtual int utypeCmd(int argc, char* argv[]); virtual int datatypeCmd(int argc, char* argv[]); virtual int commentsCmd(int argc, char* argv[]); }; #endif /* _TclAstroCat_h_ */ skycat-3.1.2-starlink-1b/cat/generic/TclAstroImage.C000066400000000000000000000274311215713201500221310ustar00rootroot00000000000000 /* * E.S.O. - VLT project/Archive * $Id: TclAstroImage.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * StarCat.C - method definitions for class TclAstroImage * * ------------------------------------------------------------------ * NOTE: This class is obsolete, please use the TclAstroCat class * instead. * ------------------------------------------------------------------ * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ static const char* const rcsId="@(#) $Id: TclAstroImage.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "TclAstroCat.h" #include "TclAstroImage.h" /* * declare a table of tcl subcommands * format: name, min_args, max_args, method */ static class TclAstroImageSubCmds { public: char* name; // method name int (TclAstroImage::*fptr)(int argc, char* argv[]); int min_args; // minimum number of args int max_args; // maximum number of args } subcmds_[] = { {(char *)"authorize", &TclAstroImage::authorizeCmd, 0, 4}, {(char *)"open", &TclAstroImage::openCmd, 1, 1}, {(char *)"close", &TclAstroImage::closeCmd, 0, 0}, {(char *)"getimage", &TclAstroImage::getimageCmd, 6, 99}, {(char *)"info", &TclAstroImage::infoCmd, 1, 1}, {(char *)"centerpos", &TclAstroImage::centerposCmd, 0, 0}, {(char *)"copyright", &TclAstroImage::copyrightCmd, 0, 0}, {(char *)"help", &TclAstroImage::helpCmd, 0, 0}, {(char *)"iswcs", &TclAstroImage::iswcsCmd, 0, 0}, {(char *)"ispix", &TclAstroImage::ispixCmd, 0, 0}, {(char *)"feedback", &TclAstroImage::feedbackCmd, 1, 1}, {(char *)"longname", &TclAstroImage::longnameCmd, 1, 1}, {(char *)"shortname", &TclAstroImage::shortnameCmd, 1, 1} }; /* * Call the given method in this class with the given arguments */ int TclAstroImage::call(const char* name, int len, int argc, char* argv[]) { for(unsigned int i = 0; i < sizeof(subcmds_)/sizeof(*subcmds_); i++) { TclAstroImageSubCmds* t = &subcmds_[i]; if (strncmp(t->name, name, len) == 0) { if (check_args(name, argc, t->min_args, t->max_args) != TCL_OK) return TCL_ERROR; return (this->*t->fptr)(argc, argv); } } return TclCommand::call(name, len, argc, argv); } /* * A call to this function can be made from the tkAppInit file at startup * to install the starcat command */ extern "C" int TclAstroImage_Init(Tcl_Interp* interp) { Tcl_CreateCommand(interp, "astroimage", (Tcl_CmdProc*)TclAstroImage::astroImageCmd, NULL, NULL); return TCL_OK; } /* * Implementation of the tcl extended command "astroimage" - * usage: see man page for more details */ int TclAstroImage::astroImageCmd(ClientData, Tcl_Interp* interp, int argc, char* argv[]) { if (argc != 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " instanceName catalogName\"", NULL); return TCL_ERROR; } TclAstroImage* cmd = new TclAstroImage(interp, argv[0], argv[1]); return cmd->status(); } /* * Constructor - * * Create an "astroimage" object in tcl for accessing the contents of star * catalogs. * * Note that the tcl command for this object is created in the * parent class constructor. */ TclAstroImage::TclAstroImage(Tcl_Interp* interp, const char* cmdname, const char* instname) : TclCommand(interp, cmdname, instname), im_(NULL), equinox_(2000.0), feedback_(NULL) { } /* * destructor */ TclAstroImage::~TclAstroImage() { if (im_) delete im_; } /* * Open the given astromonical catalog and refer to it in future * queries. */ int TclAstroImage::openCmd(int argc, char* argv[]) { if (im_) delete im_; im_ = AstroImage::open(argv[0]); if (!im_) return TCL_ERROR; // set up feedback, if requested if (feedback_) im_->feedback(feedback_); return TCL_OK; } /* * close the current catalog, if one was open */ int TclAstroImage::closeCmd(int argc, char* argv[]) { if (im_) delete im_; im_ = NULL; return TCL_OK; } /* * Request an image from the current image catalog and return (in Tcl) * the name of the FITS file holding the image. * * usage: $cat getimage ?-equinox equinox? -pos $pos -width $width \ * -height $height -tmpfile $file * * -pos - should be in the WCS format: H:M:S[+-]D:M:S * -equinox - equinox for position (default 2000) * * -tmpfile - can be used to specify the pathname of the image file * * -nameserver - name of nameserver catalog to use (simbad@eso, ned@eso,...) * * -name - can be used instead of -pos. The name will be resolved * using the value of -nameserver (default: SIMBAD) * * -width - dimensions of image to get * -height * */ int TclAstroImage::getimageCmd(int argc, char* argv[]) { if (!im_) return error("no catalog is currently open"); // option variables double width = 0.0, height = 0.0; char* nameServer = (char *)"simbad@eso"; int got_pos = 0; // flag: true if we read the position arg equinox_ = 2000.0; pos_.setNull(); // parse options for (int i = 0; i < argc; i += 2) { char* option = argv[i]; char* value = argv[i+1]; if (strcmp(option, "-pos") == 0) { got_pos++; // get ra and dec char** values = NULL; int numValues = 0; if (Tcl_SplitList(interp_, value, &numValues, &values) != TCL_OK) return TCL_ERROR; if (numValues != 2) return error("for -pos: expected list with 2 items"); if (im_->isWcs()) pos_ = WorldCoords(values[0], values[1], equinox_); else if (im_->isPix()) pos_ = ImageCoords(values[0], values[1]); Tcl_Free((char *)values); if (pos_.status()) return TCL_ERROR; } else if (strcmp(option, "-equinox") == 0) { if (got_pos) return error("-equinox should precede the -pos argument"); while(*value && !isdigit(*value)) value++; // skip "J" in J 2000, or "B" in B 1950 if (Tcl_GetDouble(interp_, value, &equinox_) != TCL_OK) return error("bad value for equinox: ", Tcl_GetStringResult(interp_)); } else if (strcmp(option, "-width") == 0) { if (Tcl_GetDouble(interp_, value, &width) != TCL_OK) return error("bad value for width: ", Tcl_GetStringResult(interp_)); } else if (strcmp(option, "-height") == 0) { if (Tcl_GetDouble(interp_, value, &height) != TCL_OK) return error("bad value for height: ", Tcl_GetStringResult(interp_)); } else if (strcmp(option, "-nameserver") == 0) { nameServer = value; } else if (strcmp(option, "-name") == 0) { if (AstroCatalog::nameToWorldCoords(value, pos_, nameServer, feedback_) != 0) return TCL_ERROR; } else if (strcmp(option, "-tmpfile") == 0) { if (value) { unlink(im_->tmpfile()); im_->tmpfile(value); } } } if (pos_.isNull() || width == 0.0 || height == 0.0) return error("must specify a name or position, width and height"); // send the query if (im_->getImage(pos_, width, height) != 0) return TCL_ERROR; return set_result(im_->tmpfile()); } /* * querypos subcommand: * * Return the world coordinate position arguments from the most recent * request, posibly expanded by SIMBAD. The result is a list of the form * {ra dec} */ int TclAstroImage::centerposCmd(int argc, char* argv[]) { ostringstream os; pos_.print(os, equinox_); // print coords in given equinox if (im_->isWcs()) os << " " << equinox_; return set_result(os.str().c_str()); } /* * copyright subcommand: return the copyright info for this image server * from the config file. */ int TclAstroImage::copyrightCmd(int argc, char* argv[]) { if (im_) { return set_result(im_->copyright()); } return TCL_OK; } /* * help subcommand: return the help info for this image server * from the config file. */ int TclAstroImage::helpCmd(int argc, char* argv[]) { if (im_) { return set_result(im_->help()); } return TCL_OK; } /* * feedback subcommand: * * specifies a Tcl file descriptor to use to write feedback info during * HTTP transfer of image. 1 Arg: file descriptor. */ int TclAstroImage::feedbackCmd(int argc, char* argv[]) { if (strlen(argv[0]) != 0) { if (Tcl_GetOpenFile(interp_, argv[0], 1, 1, (ClientData*)&feedback_) != TCL_OK) return TCL_ERROR; } else { feedback_ = NULL; } if (im_) im_->feedback(feedback_); return TCL_OK; } /* * "info" subcommand: * * usage: $im info $serv_type * * This command returns a list of servers from the config file * (skycat.cfg). The "serv_type" argument determines which catalogs * are listed (one of: catalog, namesvr, imagesvr). */ int TclAstroImage::infoCmd(int argc, char* argv[]) { const CatalogInfoEntry* e = CatalogInfo::first(); if (!e) return TCL_ERROR; Tcl_ResetResult(interp_); // get the serv_type for (; e != NULL; e = e->next()) { if (strncmp(argv[0], e->servType(), strlen(e->servType())) == 0) { Tcl_AppendElement(interp_, (char*)e->longName()); } } return TCL_OK; } /* * longname subcommand: return the long_name field from the catalog config file */ int TclAstroImage::longnameCmd(int argc, char* argv[]) { const CatalogInfoEntry* e = CatalogInfo::lookup(argv[0]); if (e) return set_result(e->longName()); return TCL_OK; } /* * shortname subcommand: return the short_name field from the catalog config file */ int TclAstroImage::shortnameCmd(int argc, char* argv[]) { const CatalogInfoEntry* e = CatalogInfo::lookup(argv[0]); if (e) return set_result(e->shortName()); return TCL_OK; } /* * Tcl subcommand: "iswcs" returns true if the catalog is based on world * coordinates */ int TclAstroImage::iswcsCmd(int argc, char* argv[]) { if (!im_) return error("no catalog is open"); return set_result(im_->isWcs()); } /* * Tcl subcommand: "ispix" returns true if the catalog is based on image * coordinates */ int TclAstroImage::ispixCmd(int argc, char* argv[]) { if (!im_) return error("no catalog is open"); return set_result(im_->isPix()); } /* * authorize subcommand: If the previous HTTP GET returned an * authorization error: (The HTML error text returned in Tcl contained * the string: "Authorization Required"), the application can * ask the user to enter a username and password to use to access the * URL and then retry the GET after using this subcommand to set the * authorization information to use. * * usage: * * $cat authorize * $cat authorize username passwd * * With no arguments, this command returns a list of the form * * {needpasswd realm server} * * where: * needpasswd is nonzero if a password is required for the URL * realm is the string taken from the HTTP header (Basic realm=...). * server is the name of the target server that wants the password. * * If arguments are specified, they should be the username and password. * These are saved and used again when the GET is retried, as well as for * all future GETS in this session, unless a new username and password * are given (as a result of an authorization error...). */ int TclAstroImage::authorizeCmd(int argc, char* argv[]) { if (!im_) return error("no image server is open"); if (argc == 0) { HTTP& http = im_->http(); ostringstream os; os << http.authorizationRequired() << " " << http.www_auth_realm() << " " << http.hostname(); return set_result(os.str().c_str()); } if (argc == 2) HTTP::authorize(argv[0], argv[1]); else if (argc == 4) HTTP::authorize(argv[0], argv[1], argv[2], argv[3]); else return error("expected: astroimage authorize ?username passwd realm server?"); return TCL_OK; } skycat-3.1.2-starlink-1b/cat/generic/TclAstroImage.h000066400000000000000000000043171215713201500221740ustar00rootroot00000000000000// -*-c++-*- #ifndef _TclAstroImage_h_ #define _TclAstroImage_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: TclAstroImage.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TclAstroImage.h - Tcl interface to the AstroImage C++ class for * accessing images from catalogs * * ------------------------------------------------------------------ * NOTE: This class is obsolete, please use the TclAstroCat class * instead. * ------------------------------------------------------------------ * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ #include #include "TclCommand.h" #include "AstroImage.h" /* * This class declares the methods used to implement the Tcl astroimage * command for retrieving images from catalogs. */ class TclAstroImage : public TclCommand { protected: AstroImage* im_; // pointer to current open catalog WorldOrImageCoords pos_; // saved position from last request double equinox_; // saved equinox from last request FILE* feedback_; // file ptr for feedback during xfer, if set // call a member function by name virtual int call(const char* name, int len, int argc, char* argv[]); public: // constructor TclAstroImage(Tcl_Interp*, const char* cmdname, const char* instname); ~TclAstroImage(); // entry point from Tcl static int astroImageCmd(ClientData, Tcl_Interp* interp, int argc, char* argv[]); // -- tcl subcommands -- virtual int authorizeCmd(int argc, char* argv[]); virtual int openCmd(int argc, char* argv[]); virtual int closeCmd(int argc, char* argv[]); virtual int getimageCmd(int argc, char* argv[]); virtual int centerposCmd(int argc, char* argv[]); virtual int infoCmd(int argc, char* argv[]); virtual int copyrightCmd(int argc, char* argv[]); virtual int helpCmd(int argc, char* argv[]); virtual int feedbackCmd(int argc, char* argv[]); virtual int longnameCmd(int argc, char* argv[]); virtual int shortnameCmd(int argc, char* argv[]); virtual int iswcsCmd(int argc, char* argv[]); virtual int ispixCmd(int argc, char* argv[]); }; #endif /* _TclAstroImage_h_ */ skycat-3.1.2-starlink-1b/cat/generic/TclQueryUtil.C000066400000000000000000000254441215713201500220430ustar00rootroot00000000000000/* * E.S.O. - VLT project/Archive * $Id: TclQueryUtil.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TclQueryUtil.C - utility routines used by TclAstroCat and TclTcsCat * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 14 Jun 96 Created */ static const char* const rcsId="@(#) $Id: TclQueryUtil.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "tcl.h" #include "error.h" #include "AstroCatalog.h" /* * This utility routine generates an AstroQuery object, given the command * line arguments for a Tcl query command. In addition, the world coordinate * position and equinox arguments of the query are returned. * * This assumes a Tcl query command with the following syntax: * * $cat query -option value ... * * Most options correspond to the AstroQuery class members and methods: * * -id $id * catalog id of object, (as returned from a previous query). If this * is specified, -pos, -name, -mag and -radius should not be * specified and will be ignored. * * -pos {ra dec} * -pos {x y} * -pos {ra1 dec1 ra2 dec2} * -pos {x1 y1 x2 y2} * World {ra, dec} or image {x, y} coordinates of center position, or * list {ra1 dec1 ra2 dec2} or {x1 y1 x2 y2} of 2 points for an area. * World Coordinates are given as {H:M:S[+-]D:M:S} in the given * equinox. If the catalog config entry contains the keywords * "x_col" and "y_col", the coords are interpreted as image coords, * otherwise world coords. * * -equinox $equinox * equinox for position (default 2000). May also be a string of the form * "J2000", "B1950", "GALACTIC", "ECLIPTIC", to indicate the type of the * search coordinates. * * -width $w * -height $h * Dimensions of rectangle with pos at center (alternative to * specifying 2 positions) in arcmin for world coords or pixel for * image coords. * * -mag $mag * max or list {min max} magnitude of object * * -radius $r * max or list (min max} radius from position (in arcmin for world * coords or pixel for image coords). * * -nameserver $ns * name of nameserver catalog to use (simbad@eso, ned@eso,...) * * -name $name * can be used instead of -pos. The name will be resolved using the * value of -nameserver (default: SIMBAD) * * -columns {col1 col2 ...} * list of columns to return * * -searchcols {col1 col2 ...} * list of columns to search by. The -minvalues and -maxvalues options * supply the corresponding value ranges and must have the same lengths. * * -minvalues {v1 v2 ...} * -maxvalues {v1 v2 ...} * list of values corresponding to the columns specified with the -searchcols * option. The values may be numeric or string format, but the lists must have * the same lengths as the one specified by the -searchcols option. * * -sort {col1 col2 ...} * list of column names to sort by * * -sortorder increasing * -sortorder decreasing * Specify the sort order. * * -nrows $n * max number of rows to return. * * Each option has one value, however, for a range or area query, some * values can be a list, such as -radius "$rad1 $rad2" to give a radius * range or -pos "$pos1 $pos2" to give an area. * * If -columns is not specified, all columns are assumed. Otherwise, if * -columns is specified, the column names should be valid for the * catalog and the result will be a list of rows with those columns. * * Note that not all catalogs will support sorting by all fields. * * On return, the AstroQuery object is set so that it cat be passed to a * query routine. In addition the world coordinate position and * equinox args are set, if applicable. * * The feedback argument, if not null, should be a pointer to an open * file to which feedback information should be printed during the query. */ int genAstroQuery(Tcl_Interp* interp, int argc, char* argv[], AstroQuery& q, WorldOrImageCoords& pos1, WorldOrImageCoords& pos2, char* equinoxStr, FILE* feedback, CatalogInfoEntry* entry) { // set defaults int status = 0; pos1.setNull(); pos2.setNull(); int isWcs = entry->isWcs(); int isPix = entry->isPix(); strcpy(equinoxStr, "2000"); double radius1 = 0.0, radius2 = 0.0; double mag1 = 0.0, mag2 = 0.0; double width = 0.0, height = 0.0; char* id = (char *)""; char* nameServer = (char *)"simbad@eso"; // for sorting int numSortCols = 0; char** sortCols = NULL; char* sortOrder = (char *)"increasing"; int nrows = 0; // no default limit... // column selection int numCols = 0; char** colNames = NULL; // for searching by colName, minValue, maxValue int numSearchCols = 0; char** searchCols = NULL; char** minValues = NULL; char** maxValues = NULL; // misc int got_pos = 0; // flag: true if we read the position arg char** values = NULL; int numValues = 0; // parse options for (int i = 0; i < argc; i += 2) { char* option = argv[i]; char* value = argv[i+1]; // first handle options with only one value if (strcmp(option, "-id") == 0) { id = value; } else if (strcmp(option, "-nameserver") == 0) { nameServer = value; } else if (strcmp(option, "-sortorder") == 0) { sortOrder = value; if (strlen(value) == 0) sortOrder = (char *)"increasing"; else if (strcmp(sortOrder, "increasing") != 0 && strcmp(sortOrder, "decreasing") != 0) return error("expected -sortorder increasing (or decreasing), not: ", sortOrder); } else if (strcmp(option, "-name") == 0) { if (AstroCatalog::nameToWorldCoords(value, pos1, nameServer, feedback) != 0) return TCL_ERROR; } else if (strcmp(option, "-equinox") == 0) { if (got_pos) return error("-equinox should precede the -pos argument"); strcpy(equinoxStr, value); } else if (strcmp(option, "-nrows") == 0) { if (Tcl_GetInt(interp, value, &nrows) != TCL_OK) return error("bad value for max number of rows: ", Tcl_GetStringResult(interp));; } else if (strcmp(option, "-width") == 0) { if (Tcl_GetDouble(interp, value, &width) != TCL_OK) return error("bad -width value: ", Tcl_GetStringResult(interp)); } else if (strcmp(option, "-height") == 0) { if (Tcl_GetDouble(interp, value, &height) != TCL_OK) return error("bad -height value: ", Tcl_GetStringResult(interp)); } else { // handle options whic 2) { status = error("expected 1 or 2 values for -radius option"); break; } if (numValues == 2 && Tcl_GetDouble(interp, values[1], &radius2) != TCL_OK) { status = error("bad max radius value: ", Tcl_GetStringResult(interp)); break; } if (Tcl_GetDouble(interp, values[0], &radius1) != TCL_OK) { status = error("bad min radius value: ", Tcl_GetStringResult(interp)); break; } } else if (strcmp(option, "-mag") == 0) { if (numValues > 2) { status = error("expected 1 or 2 values for -mag"); break; } if (numValues == 2 && Tcl_GetDouble(interp, values[1], &mag2) != TCL_OK) { status = error("bad max magnitude value: ", Tcl_GetStringResult(interp)); break; } if (Tcl_GetDouble(interp, values[0], &mag1) != TCL_OK) { status = error("bad min magnitude value: ", Tcl_GetStringResult(interp)); break; } } else if (strcmp(option, "-columns") == 0) { numCols = numValues; colNames = values; values = NULL; // don't free } else if (strcmp(option, "-sort") == 0) { numSortCols = numValues; sortCols = values; values = NULL; // don't free } else if (strcmp(option, "-searchcols") == 0) { numSearchCols = numValues; searchCols = values; values = NULL; // don't free } else if (strcmp(option, "-minvalues") == 0) { if (numValues != numSearchCols) { status = error("number of items for -minvalues not the same as for -searchcols"); break; } minValues = values; values = NULL; // don't free } else if (strcmp(option, "-maxvalues") == 0) { if (numValues != numSearchCols) { status = error("number of items for -maxvalues not the same as for -searchcols"); break; } maxValues = values; values = NULL; // don't free } } } if (values) Tcl_Free((char *)values); if (status != TCL_OK) return TCL_ERROR; // setup the query object and return an error if the arguments are invalid // (args are checked by AstroQuery class) if (strlen(id) && q.id(id)) return TCL_ERROR; if (pos2.isNull()) { if (! pos1.isNull()) if (q.pos(pos1)) return TCL_ERROR; } else { if (q.pos(pos1, pos2)) return ERROR; } if (radius2) { if (q.radius(radius1, radius2)) return TCL_ERROR; } else if (radius1) { if (q.radius(radius1)) return TCL_ERROR; } if (mag2) { if (q.mag(mag1, mag2)) return TCL_ERROR; } else if (mag1) { if (q.mag(mag1)) return TCL_ERROR; } if (width && height) if (q.dim(width, height)) return TCL_ERROR; if (numCols && colNames) if (q.colNames(numCols, (char**)colNames, 1)) return TCL_ERROR; if (nrows && q.maxRows(nrows)) return TCL_ERROR; if (numSortCols && sortCols) { if (q.sort(numSortCols, (char**)sortCols, 1)) return TCL_ERROR; q.sortOrder(*sortOrder == 'i' ? 1 : -1); } if (numSearchCols && searchCols) { if (q.condition(numSearchCols, (char**)searchCols, (char**)minValues, (char**)maxValues, 1)) return TCL_ERROR; } return TCL_OK; } skycat-3.1.2-starlink-1b/cat/generic/TclQueryUtil.h000066400000000000000000000012651215713201500221030ustar00rootroot00000000000000// -*-c++-*- #ifndef _TclQueryUtil_h_ #define _TclQueryUtil_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: TclQueryUtil.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TclQueryUtil.h - utility routines for Tcl catalog commands * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 14 Jun 96 Created */ #include #include class AstroQuery; class WorldCoords; int genAstroQuery(Tcl_Interp* interp, int argc, char* argv[], AstroQuery& q, WorldOrImageCoords& pos1, WorldOrImageCoords& pos2, char* equinoxStr, FILE* feedback, CatalogInfoEntry* entry); #endif /* _TclQueryUtil_h_ */ skycat-3.1.2-starlink-1b/cat/generic/TclTcsCat.C000066400000000000000000000150331215713201500212520ustar00rootroot00000000000000/* * E.S.O. - VLT project/Archive * $Id: TclTcsCat.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TclTcsCat.C - method definitions for class TclTcsCat * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ static const char* const rcsId="@(#) $Id: TclTcsCat.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "TcsCatalog.h" #include "TcsLocalCatalog.h" #include "TclQueryUtil.h" #include "TclTcsCat.h" /* * A call to this function can be made from the tkAppInit file at startup * to install the tcscat command */ extern "C" int TclTcsCat_Init(Tcl_Interp* interp) { // install the tcscat command Tcl_CreateCommand(interp, "tcscat", (Tcl_CmdProc*)TclTcsCat::tcsCatCmd, NULL, NULL); return TCL_OK; } /* * Implementation of the tcl extended command "tcscat" - * usage: see man page for more details */ int TclTcsCat::tcsCatCmd(ClientData, Tcl_Interp* interp, int argc, char* argv[]) { if (argc != 2) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " instanceName\"", NULL); return TCL_ERROR; } TclTcsCat* cmd = new TclTcsCat(interp, argv[0], argv[1]); return cmd->status(); } /* * Constructor - * * Create a "tcscat" object in tcl for accessing the contents of TCS * catalogs. * * Note that the tcl command for this object is created in the * base class constructor. */ TclTcsCat::TclTcsCat(Tcl_Interp* interp, const char* cmdname, const char* instname) : TclAstroCat(interp, cmdname, instname) { } /* * desctructor */ TclTcsCat::~TclTcsCat() { } /* * Save the given query results with the given columns to the given * filename. If iflag is true, insert in the existing file, otherwise create * a new file. "equinox" specifies the equinox of the data (the first 3 columns * are assumed to be the object id, ra and dec). * (This method is redefined here to do the save in TCS catalog format) */ int TclTcsCat::saveQueryResult(const char* filename, int numCols, char** colNames, char* info, int iflag, const char* equinoxStr) { // create a QueryResult object from the headings and data and // save (or append) it to the file TcsQueryResult r; if (getQueryResult(numCols, colNames, info, equinoxStr, r) != TCL_OK) return TCL_ERROR; int id_col = 0; // catalog's id column index if (cat_) id_col = cat_->entry()->id_col(); return (iflag ? r.insert(filename, id_col) : r.save(filename)); } /* * Remove the query results with the given columns and values from the given * filename. "equinox" specifies the equinox of the data (the first 3 columns * are assumed to be the object id, ra and dec). * (redefined here to use TCS catalog format) */ int TclTcsCat::removeQueryResult(const char* filename, int numCols, char** colNames, char* info, const char* equinoxStr) { // create a QueryResult object from the headings and data and // remove rows matching it from the file TcsQueryResult r; // if (cat_) // r.entry(cat_->entry()); if (getQueryResult(numCols, colNames, info, equinoxStr, r) != TCL_OK) return TCL_ERROR; return r.remove(filename, 0); } /* * Open the given astromonical catalog and refer to it in future * queries. */ int TclTcsCat::openCmd(int argc, char* argv[]) { if (cat_) delete cat_; cat_ = TcsCatalog::open(argv[0]); if (!cat_) return TCL_ERROR; // set up feedback, if requested if (feedback_) cat_->feedback(feedback_); return TCL_OK; } /* * Check that the given filename is a valid local TCS catalog * (tab table format with standard TCS columns). */ int TclTcsCat::checkCmd(int argc, char* argv[]) { return TcsLocalCatalog::check_table(argv[0]); } /* * pass a query to the current catalog and return the result as a list of * rows. * * usage: $cat query -option value ... * * Most options correspond to the AstroQuery class members and methods: * * -id - catalog id of object, (as returned from a previous * query). If this is specified, -pos, -name, -mag and * -radius should not be specified and will be ignored. * * -pos - World coordinates pos of center {ra dec}, or list * {ra1 dec1 ra2 dec2} of 2 points for an area. * Position is given as {H:M:S[+-]D:M:S} in J2000 * * -width - dimensions of rectangle with pos at center (alternative * -height to specifying 2 positions) in arcmin * * -equinox - equinox for position (default 2000) * * -mag - max or list {min max} magnitude of object * * -radius - max or list (min max} radius from position * * -nameserver - name of nameserver catalog to use (simbad@eso, ned@eso,...) * * -name - can be used instead of -pos. The name will be resolved * using the value of -nameserver (default: SIMBAD) * * -sort {name if column to sort by} * * -nrows {max number of rows to return} * * Each option has one value, however, for a range or area query, some * values can be a list, such as -radius "$rad1 $rad2" to give a radius * range or -pos "$pos1 $pos2" to give an area. * * Note that not all catalogs will support sorting by all fields. */ int TclTcsCat::queryCmd(int argc, char* argv[]) { if (!cat_) return error("no catalog is currently open"); // generate the query from the command args AstroQuery q; if (genAstroQuery(interp_, argc, argv, q, pos1_, pos2_, equinoxStr_, feedback_, cat_->entry()) != TCL_OK) return TCL_ERROR; // XXX make error msg if -columns was specified ? // make new QueryResult object, or reuse previous one if (result_) result_->clear(); else result_ = new TcsQueryResult; int nrows = cat_->query(q, NULL, *result_); // format results as a tcl list of rows char* s; int i = 0, j = 0; int errs = 0; WorldCoords pos; char buf[1024]; if (nrows > 0) { for (i = 0; i < nrows; i++) { TcsCatalogObject obj; if (((TcsQueryResult*)result_)->getObj(i, obj) != 0) break; obj.print(buf, sizeof(buf)); Tcl_AppendElement(interp_, buf) ; } // see if an error occured in the above loop (causing a break) if (i != nrows) return TCL_ERROR; } if (nrows < 0) return TCL_ERROR; // an query error occured (and was reported) return TCL_OK; } skycat-3.1.2-starlink-1b/cat/generic/TclTcsCat.h000066400000000000000000000027141215713201500213210ustar00rootroot00000000000000// -*-c++-*- #ifndef _TclTcsCat_h_ #define _TclTcsCat_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: TclTcsCat.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TclTcsCat.h - Tcl interface to the TcsCatalog C++ class for * accessing TCS catalogs * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 14 Jun 96 Created */ #include "TclAstroCat.h" #include "TcsCatalog.h" /* * This class declares the methods used to implement the Tcl tcscat * command for accessing TCS catalogs. */ class TclTcsCat : public virtual TclAstroCat { protected: // Save (or insert) query results to the given file. virtual int saveQueryResult(const char* filename, int numCols, char** colNames, char* info, int iflag, const char* equinoxStr); // Remove query results from the given file. virtual int removeQueryResult(const char* filename, int numCols, char** colNames, char* info, const char* equinoxStr); public: // constructor TclTcsCat(Tcl_Interp*, const char* cmdname, const char* instname); ~TclTcsCat(); // entry point from Tcl static int tcsCatCmd(ClientData, Tcl_Interp* interp, int argc, char* argv[]); // -- redefined tcl subcommands -- int openCmd(int argc, char* argv[]); int checkCmd(int argc, char* argv[]); int queryCmd(int argc, char* argv[]); }; #endif /* _TclTcsCat_h_ */ skycat-3.1.2-starlink-1b/cat/generic/TcsCatalog.C000066400000000000000000000053231215713201500214530ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: TcsCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TcsCatalog.C - method definitions for class TcsCatalog * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Jun 96 Created */ static const char* const rcsId="@(#) $Id: TcsCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include "error.h" #include "TcsLocalCatalog.h" #include "TcsCatalog.h" /* * open the named catalog and return a pointer to a TcsCatalog * object for that catalog or NULL if errors occur */ TcsCatalog* TcsCatalog::open(const char* name) { // get the entry for this catalog type CatalogInfoEntry* e = CatalogInfo::lookup(name); if (!e) return NULL; // error - no config entry TcsCatalog* result = NULL; if (strcmp(e->servType(), "local") == 0) result = new TcsLocalCatalog(e); // derived class for local catalogs else result = new TcsCatalog(e); // class for (remote) catalogs if (result->status() != 0) { delete result; return NULL; // error making catalog } return result; // normal return } /* * Get the values for the specified columns for the object given by "id" * in the catalog and return 0 if all is OK. * * Args: * * id in - object id in catalog * obj out - catalog info for row, if found */ int TcsCatalog::getObject( const char* id, TcsCatalogObject& obj) { AstroQuery q; q.id(id); q.maxRows(1); TcsQueryResult result; int nrows = query(q, NULL, result); if (nrows < 0) return 1; // error return if (nrows == 0) { return error("object not found: ", id); // error, not found } int status = result.getObj(0, obj); return status; } /* * search for the star closest to the given position, with the magnitude in * the given range * * Args: * * numCols in - number of columns to get * colNames in - array of column names to read * pos in - center position in world coordinates * mag0 in - min magnitude * mag1 in - max magnitude * obj out - object containing data for row, if found */ int TcsCatalog::searchClosestStar( const WorldCoords& pos, double mag0, double mag1, TcsCatalogObject& obj) { AstroQuery q; q.pos(pos); q.mag(mag0, mag1); q.maxRows(1); TcsQueryResult result; int nrows = query(q, NULL, result); if (nrows < 0) return 1; // error return if (nrows == 0) { return error("no objects found"); } int status = result.getObj(0, obj); return 0; } skycat-3.1.2-starlink-1b/cat/generic/TcsCatalog.h000066400000000000000000000100041215713201500215100ustar00rootroot00000000000000// -*-c++-*- #ifndef _TcsCatalog_h_ #define _TcsCatalog_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: TcsCatalog.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TcsCatalog.h - class specialized for accessing GSC, PPM or similar catalogs * for use by the TCS (Telescope Control Software). * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Jun 96 Created */ #include "AstroCatalog.h" #include "TcsQueryResult.h" /* * Class TcsCatalog * * This class is like class AstroCatalog, except that it assumes a * catalog has fixed columns, such as those that are found in the GSC or * PPM catalogs. This class restricts itself to these fixed columns and * ignores the rest. Each row of a TcsCatalog can be represented by a * TcsCatalogObject. Any missing column values are set to the appropriate * null value. */ class TcsCatalog : public AstroCatalog { private: public: // Note: these two methods are inherited. We just need to redefine them here to avoid // compiler warnings about hiding the parent versions. // Get the values for the specified columns for the object given by "id" // in the catalog and return 0 if all is OK virtual int getObject( const char* id, // in - object id in catalog int numCols, // in - number of columns to get char** colNames, // in - array of column names to read QueryResult& result) { // out - ref to object managing result return AstroCatalog::getObject(id, numCols, colNames, result); } // search for the star closest to the given position, with the magnitude in // the given range and return (via the last 2 args) the columns requested // by "colNames" virtual int searchClosestStar( int numCols, // in - number of columns to get char** colNames, // in - array of column names to read const WorldOrImageCoords& pos, // in - center position in world coordinates double mag0, // in - min magnitude double mag1, // in - max magnitude QueryResult& result) { // out - ref to object managing result return AstroCatalog::searchClosestStar(numCols, colNames, pos, mag0, mag1, result); } public: // constructor - create catalog class instance // note: public interface uses TcsCatalog::open(). // The argument represents the entry in the catalog config file for this catalog TcsCatalog(CatalogInfoEntry* e) : AstroCatalog(e) {} // destructor - close catalog and free any resources virtual ~TcsCatalog() {} // open the named catalog and return a pointer to a new // TcsCatalog object created for it or NULL if errors occur static TcsCatalog* open(const char* name); // return the number of columns in the catalog int numCols() {return TcsCatalogObject::numCols();} // return the column names char** colNames() {return TcsCatalogObject::colNames();} const char* colName(int col) {return TcsCatalogObject::colName(col);} // return the column index for the given column name int colIndex(const char* colName) {return TcsCatalogObject::colIndex(colName);} // return true if the catalog contains the given column int hasCol(const char* name) {return (colIndex(name) >= 0);} // -- the interface for the next 2 methods is different for TCS -- // Get the object given by "id" in the catalog and return 0 if all is OK virtual int getObject( const char* id, // in - object id in catalog TcsCatalogObject& obj); // out - object for row, if found // search for the star closest to the given position, with the magnitude in // the given range virtual int searchClosestStar( const WorldCoords& pos, // in - center position in world coordinates double mag0, // in - min magnitude double mag1, // in - max magnitude TcsCatalogObject& obj); // out - object for row, if found }; #endif /* _TcsCatalog_h_ */ skycat-3.1.2-starlink-1b/cat/generic/TcsCatalogObject.C000066400000000000000000000260531215713201500226050ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: TcsCatalogObject.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TcsCatalogObject.C - method definitions for class TcsCatalogObject * * See the man page for a complete description. * * who when whuat * -------------- -------- ---------------------------------------- * Allan Brighton 13 Jun 96 Created * pbiereic 20/10/03 method printTableRow (VLTSW20030366, cmagagna) */ static const char* const rcsId="@(#) $Id: TcsCatalogObject.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include "error.h" #include "WorldCoords.h" #include "TcsCatalogObject.h" // static array of column names static char* colNames_[] = { (char *)"id", (char *)"ra", (char *)"dec", (char *)"cooSystem", (char *)"epoch", (char *)"pma", (char *)"pmd", (char *)"radvel", (char *)"parallax", (char *)"cooType", (char *)"band", (char *)"mag", (char *)"more", (char *)"preview", (char *)"distance", (char *)"pa" }; // constants for column names enum { ID, RA, DEC, COOSYSTEM, EPOCH, PMA, PMD, RADVEL, PARALLAX, COOTYPE, BAND, MAG, MORE, PREVIEW, DISTANCE, PA }; // number of columns static const int numCols_ = sizeof(colNames_)/sizeof(char*); // -- local utils -- // return an allocated copy of the string, or NULL if it is NULL static inline char* copy(const char* s) {return s ? strdup(s) : (char*)NULL;} /* * check that the given value is in the given range and return 0 * if it is, otherwise generate an error */ static int check(const char* name, double v, double low, double hi) { return (v >= low && v <= hi) ? 0 : error(name, ": column value out of range"); } /* * check that the given string value has one of the specified values */ static int check(const char* name, const char* v, const char* a, const char* b) { return (strcmp(v, a) == 0 || strcmp(v, b) == 0) ? 0 : error(name, ": invalid column value"); } /* * constructor: initialize all fields to default values or null */ TcsCatalogObject::TcsCatalogObject() : ra_(TCS_CATALOG_NULL_DOUBLE), dec_(TCS_CATALOG_NULL_DOUBLE), epoch_(2000.), pma_(TCS_CATALOG_NULL_DOUBLE), pmd_(TCS_CATALOG_NULL_DOUBLE), radvel_(TCS_CATALOG_NULL_DOUBLE), parallax_(TCS_CATALOG_NULL_DOUBLE), mag_(TCS_CATALOG_NULL_DOUBLE), more_(NULL), preview_(NULL), distance_(TCS_CATALOG_NULL_DOUBLE), pa_(TCS_CATALOG_NULL_DOUBLE) { id_[0] = '\0'; strcpy(cooSystem_, "J2000"); strcpy(cooType_, "M"); strcpy(band_, "V"); } /* * copy constructor */ TcsCatalogObject::TcsCatalogObject(const TcsCatalogObject& t) : ra_(t.ra_), dec_(t.dec_), epoch_(t.epoch_), pma_(t.pma_), pmd_(t.pmd_), radvel_(t.radvel_), parallax_(t.parallax_), mag_(t.mag_), more_(copy(t.more_)), preview_(copy(t.preview_)), distance_(t.distance_), pa_(t.pa_) { strcpy(id_, t.id_); strcpy(cooSystem_, t.cooSystem_); strcpy(cooType_, t.cooType_); strcpy(band_, t.band_); } /* * result all fields to default values */ void TcsCatalogObject::reset() { *this = TcsCatalogObject(); } /* * assignment operator */ TcsCatalogObject& TcsCatalogObject::operator=(const TcsCatalogObject& t) { if (more_) free(more_); if (preview_) free(preview_); strcpy(id_, t.id_); ra_ = t.ra_; dec_ = t.dec_; strcpy(cooSystem_, t.cooSystem_); epoch_ = t.epoch_; pma_ = t.pma_; pmd_ = t.pmd_; radvel_ = t.radvel_; parallax_ = t.parallax_; strcpy(cooType_, t.cooType_); strcpy(band_, t.band_); mag_ = t.mag_; more_ = copy(t.more_); preview_ = copy(t.preview_); distance_ = t.distance_; pa_ = t.pa_; return *this; } /* * destructor */ TcsCatalogObject::~TcsCatalogObject() { if (more_) free(more_); if (preview_) free(preview_); } /* * output operator (Tcl list format) */ ostream& operator<<(ostream& os, const TcsCatalogObject& t) { os << '{' << t.id_ << '}'; if (t.ra_ != TCS_CATALOG_NULL_DOUBLE && t.dec_ != TCS_CATALOG_NULL_DOUBLE) { // convert to h:m:s before printing WorldCoords pos(t.ra_, t.dec_); os << ' ' << pos.ra() << ' ' << pos.dec(); } else { os << " {} {}"; } os << " {" << t.cooSystem_ << "}"; os << ' ' << t.epoch_; if (t.pma_ != TCS_CATALOG_NULL_DOUBLE) os << ' ' << t.pma_; else os << " {}"; if (t.pmd_ != TCS_CATALOG_NULL_DOUBLE) os << ' ' << t.pmd_; else os << " {}"; if (t.radvel_ != TCS_CATALOG_NULL_DOUBLE) os << ' ' << t.radvel_; else os << " {}"; if (t.parallax_ != TCS_CATALOG_NULL_DOUBLE) os << ' ' << t.parallax_; else os << " {}"; os << " {" << t.cooType_ << "}"; os << " {" << t.band_ << "}"; if (t.mag_ != TCS_CATALOG_NULL_DOUBLE) os << ' ' << t.mag_; else os << " {}"; os << " {" << (t.more_ ? t.more_ : "") << "}"; os << " {" << (t.preview_ ? t.preview_ : "") << "}"; if (t.distance_ != TCS_CATALOG_NULL_DOUBLE) os << ' ' << t.distance_; else os << " {}"; if (t.pa_ != TCS_CATALOG_NULL_DOUBLE) os << ' ' << t.pa_; else os << " {}"; return os; } /* * print this object as a tab separated row */ int TcsCatalogObject::printTableRow(ostream& os) { char t = '\t'; os << ( id() ? id() : "" ) << t << ra() << t << dec() << t << ( cooSystem() ? cooSystem() : "" ) << t << epoch() << t << pma() << t << pmd() << t << radvel() << t << parallax() << t << ( cooType() ? cooType() : "" ) << t << ( band() ? band() : "" ) << t << mag() << t << ( more() ? more() : "" ) << t << ( preview() ? preview() : "" ) << t << distance() << t << pa() << endl; return 0; } /* * print this object to the given buffer */ void TcsCatalogObject::print(char* buf, int bufsize) { ostringstream os; os << *this; strncpy(buf, os.str().c_str(), bufsize); } /* * print the headings to the given ostream * to match the output of the above output operator (<<). */ void TcsCatalogObject::printHeadings(ostream& os) { for (int i = 0; i < numCols_; i++) { os << colNames_[i]; if (i < (numCols_-1)) os << ' '; } } /* * print the headings to the given buffer, separated by tabs * to match the output of the above output operator (<<). */ void TcsCatalogObject::printHeadings(char* buf, int bufsize) { ostringstream os; printHeadings(os); strncpy(buf, os.str().c_str(), bufsize); } /* * set fields, with range checking, return 0 if OK */ int TcsCatalogObject::id(const char* v) { if (!v) { id_[0] = '\0'; return error("null string specified for object id"); } strncpy(id_, v, sizeof(id_)-1); return 0; } int TcsCatalogObject::ra(double v) { ra_ = v; return check("ra", v, 0., 360.); } int TcsCatalogObject::dec(double v) { dec_ = v; return check("dec", v, -90., 90.); } int TcsCatalogObject::cooSystem(const char* v) { strncpy(cooSystem_, (v ? v : ""), sizeof(cooSystem_)-1); return check("cooSystem", v, "B1950", "J2000"); } int TcsCatalogObject::epoch(double v) { epoch_ = v; return check("epoch", v, -2000., 3000.); } int TcsCatalogObject::pma(double v) { pma_ = v; return check("pma", v, -10., 10.); } int TcsCatalogObject::pmd(double v) { pmd_ = v; return check("pmd", v, -10., 10.); } int TcsCatalogObject::radvel(double v) { radvel_ = v; return check("radvel", v, -200000., 200000.); } int TcsCatalogObject::parallax(double v) { parallax_ = v; return check("parallax", v, -10000., 10000.); } int TcsCatalogObject::cooType(const char* v) { strncpy(cooType_, (v ? v : ""), sizeof(cooType_)-1); return check("cooType", v, "M", "A"); } int TcsCatalogObject::band(const char* v) { strncpy(band_, (v ? v : ""), sizeof(band_)-1); return 0; } int TcsCatalogObject::mag(double v) { mag_ = v; return 0; } int TcsCatalogObject::more(const char* v) { if (more_) free(more_); more_ = copy(v); return 0; } int TcsCatalogObject::preview(const char* v) { if (preview_) free(preview_); preview_ = copy(v); return 0; } int TcsCatalogObject::distance(double v) { distance_ = v; return 0; } int TcsCatalogObject::pa(double v) { pa_ = v; return 0; } // -- for compat with AstroCatalog: -- /* * return the number of columns in the catalog */ int TcsCatalogObject::numCols() { return numCols_; } /* * return a ptr to an array of catalog column names */ char** TcsCatalogObject::colNames() { return colNames_; } /* * return the name of the given column */ const char* TcsCatalogObject::colName(int col) { if (col >= 0 && col < numCols_) return colNames_[col]; error("invalid column index"); return NULL; } /* * return the column index for the given column name */ int TcsCatalogObject::colIndex(const char* colName) { for (int i = 0; i < numCols_; i++) { if (strcmp(colName, colNames_[i]) == 0) return i; } return -1; } /* * Compare the given column (member) of this object with the given object. * The column index corresponds to the column heading array at the top of this * file (it is more efficient to use the index than the col name...). * Return <. = or > 0, as by strcmp. */ int TcsCatalogObject::compare(const TcsCatalogObject& obj, int colIndex) { double d1 = 0., d2 = 0.; const char* s1 = "", *s2 = ""; int numeric = 1; switch(colIndex) { case ID: s1 = id_; s2 = obj.id_; numeric--; break; case RA: d1 = ra_; d2 = obj.ra_; break; case DEC: d1 = dec_; d2 = obj.dec_; break; case COOSYSTEM: s1 = cooSystem_; s2 = obj.cooSystem_; numeric--; break; case EPOCH: d1 = epoch_; d2 = obj.epoch_; break; case PMA: d1 = pma_; d2 = obj.pma_; break; case PMD: d1 = pmd_; d2 = obj.pmd_; break; case RADVEL: d1 = radvel_; d2 = obj.radvel_; break; case PARALLAX: d1 = parallax_; d2 = obj.parallax_; break; case COOTYPE: s1 = cooType_; s2 = obj.cooType_; numeric--; break; case BAND: s1 = band_; s2 = obj.band_; numeric--; break; case MAG: d1 = mag_; d2 = obj.mag_; break; case MORE: s1 = more_; s2 = obj.more_; numeric--; break; case PREVIEW: s1 = preview_; s2 = obj.preview_; numeric--; break; case DISTANCE: d1 = distance_; d2 = obj.distance_; break; case PA: d1 = pa_; d2 = obj.pa_; break; default: return error("invalid TCS column index"); } if (numeric) { if (d1 > d2) return 1; if (d1 < d2) return -1; return 0; } else { return strcmp((s1 ? s1 : ""), (s2 ? s2 : "")); } } /* * Compare the given column (member) of this object with the given object. * The column name corresponds to the column heading array at the top of this * file. * Return <. = or > 0, as by strcmp. */ int TcsCatalogObject::compare(const TcsCatalogObject& obj, char* colName) { int i = colIndex(colName); if (i >= 0) return compare(obj, i); return 0; } skycat-3.1.2-starlink-1b/cat/generic/TcsCatalogObject.h000066400000000000000000000112011215713201500226370ustar00rootroot00000000000000// -*-c++-*- #ifndef _TcsCatalogObject_h_ #define _TcsCatalogObject_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: TcsCatalogObject.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TcsCatalogObject.h - class representing one row of results from a * TcsCatalog query. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Jun 96 Created */ using namespace std; // NULL values //#define TCS_CATALOG_NULL_INT 4294967294 /* (2^32 - 1) */ #define TCS_CATALOG_NULL_DOUBLE 1.E-300 /* * This object represents the contents of one row of GSC/PPM results. * Missing values are set to the appropriate null value (see above). */ class TcsCatalogObject { private: char id_[64]; // object catalog id double ra_; // Alpha coordinate for the target in decimal degrees double dec_; // Delta coordinate for the target in decimal degrees char cooSystem_[8]; // Equinox system and equinox ("B1950" or "J2000") double epoch_; // Epoch expressed as decimal year double pma_; // Proper Motion Alpha in radians/year (-10.0 to 10.0) double pmd_; // Proper Motion Delta in radians/year (-10.0 to 10.0) double radvel_; // radial velocity in km/sec (-200000 to 200000) double parallax_; // Parallax in arcseconds (-10000 to 10000) char cooType_[4]; // Coordinate type as "M" for mean or "A" for apparent character char band_[4]; // Magnitude wavelength band ("V") double mag_; // Object's magnitude in given band char* more_; // An HTTP URL pointing to more info on the object char* preview_; // An HTTP URL pointing to an image of the object double distance_; // distance to center of the field double pa_; // position angle based on center of the field public: // constructor: initialize all fields to null TcsCatalogObject(); // copy constructor TcsCatalogObject(const TcsCatalogObject&); // destructor ~TcsCatalogObject(); // assignment TcsCatalogObject& operator=(const TcsCatalogObject &); // output operator friend ostream& operator<<(ostream&, const TcsCatalogObject&); // print this object to the given buffer void print(char* buf, int bufsize); // print the headings to match the output of '<<' above static void printHeadings(ostream& os); static void printHeadings(char* buf, int bufsize); // print this object as a tab separated row int printTableRow(ostream&); // result all fields to default values void reset(); // return true if the given value is null (by convention) //static int isNull(int v) {return (v == int(TCS_CATALOG_NULL_INT));} static int isNull(double v) {return (v == TCS_CATALOG_NULL_DOUBLE);} static int isNull(const char* v) {return (!v || !*v);} // set fields, with range checking, return 0 if OK int id(const char*); int ra(double); int dec(double); int cooSystem(const char*); int epoch(double); int pma(double); int pmd(double); int radvel(double); int parallax(double); int cooType(const char*); int band(const char*); int mag(double); int more(const char*); int preview(const char*); int distance(double); int pa(double); // member access: return member value const char* id() {return id_;} double ra() {return ra_;} double dec() {return dec_;} const char* cooSystem() {return cooSystem_;} double epoch() {return epoch_;} double pma() {return pma_;} double pmd() {return pmd_;} double radvel() {return radvel_;} double parallax() {return parallax_;} const char* cooType() {return cooType_;} const char* band() {return band_;} double mag() {return mag_;} const char* more() {return more_ ? more_ : "";} const char* preview() {return preview_ ? preview_ : "";} double distance() {return distance_;} double pa() {return pa_;} // for compat. with AstroCatalog // return the number of columns in the catalog static int numCols(); // return the column names static char** colNames(); static const char* colName(int col); // return the column index for the given column name static int colIndex(const char* colName); // return true if the catalog contains the given column static int hasCol(const char* name) {return (colIndex(name) >= 0);} // Compare the given column (member) of this object with the given object. int compare(const TcsCatalogObject& obj, int colIndex); int compare(const TcsCatalogObject& obj, char* colName); }; #endif /* _TcsCatalogObject_h_ */ skycat-3.1.2-starlink-1b/cat/generic/TcsLocalCatalog.C000066400000000000000000000070271215713201500224310ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: TcsLocalCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TcsLocalCatalog.C - method definitions for class TcsLocalCatalog * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 21 Jun 96 Created */ static const char* const rcsId="@(#) $Id: TcsLocalCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include "error.h" #include "Mem.h" #include "TcsLocalCatalog.h" /* * static method to check the validity of a tab table file. * Returns 0 if OK. */ int TcsLocalCatalog::check_table(const char* file) { TabTable t; return TabTable::head(file, t); } /* * constructor - used internally only, public interface uses "open(name)" * "e" is the catalog config entry object for this catalog. * (see CatalogInfo class) * * In this case, the catalog config entry may have been created automatically. * The name of the file containing the local catalog (tab table) is stored in * "e->url()", which is normally used to store the URL for HTTP access, but is * used here for the filename. * */ TcsLocalCatalog::TcsLocalCatalog(CatalogInfoEntry* e) : TcsCatalog(e), filename_(strdup(e->url())) { status_ = getInfo(); } /* * destructor */ TcsLocalCatalog::~TcsLocalCatalog() { if (filename_) free(filename_); } /* * Run a query on the local TCS catalog and return the number of objects found. * * Args: * q - (in) object describing the query * * filename - (in) filename to hold results, or null * * result - (out) reference to object to manage the results. * * The return value is the number of rows found, or 0 if none were found. * A return value of -1 indicates an error. * * (Redefined from parent class to work with local catalogs) */ int TcsLocalCatalog::query(const AstroQuery& q, const char* filename, QueryResult& result) { if (checkInfo() != 0) return 1; // note the catalog config entry in the results result.entry(entry_); if (result.query(q, info_, filename, more_) != 0) return -1; return result.numRows(); } /* * If we don't have the info for this catalog, get it and * return the status. Here we also check if the file has been modified, * (by an insert or remove operation) and reload it if needed. */ int TcsLocalCatalog::checkInfo() { if (info_.numCols() > 0) { struct stat buf; if (stat(filename_, &buf) != 0) return sys_error("can't access file: ", filename_); if (buf.st_mtime == timestamp_) return 0; } return getInfo(); } /* * Read the local catalog to get the column names and also read in the * data to make later searches faster later. The return value is 0 for * success. The info_ member holds the column info and the local catalog * data for searching. It must be updated if the data changes. */ int TcsLocalCatalog::getInfo() { // note update time of file, so we know if it has been modified... struct stat buf; if (stat(filename_, &buf) != 0) return sys_error("can't access file: ", filename_); timestamp_ = buf.st_mtime; // mmap the file and put it in a TabTable Mem m(filename_); if (info_.init((char*)m.ptr()) != 0) return 1; // this will extract any catalog config info from the file's header info_.entry(entry_, (char*)m.ptr()); return 0; } skycat-3.1.2-starlink-1b/cat/generic/TcsLocalCatalog.h000066400000000000000000000033421215713201500224720ustar00rootroot00000000000000// -*-c++-*- #ifndef _TcsLocalCatalog_h_ #define _TcsLocalCatalog_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: TcsLocalCatalog.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TcsLocalCatalog.h - class definitions for accessing local * TCS catalogs stored as starbase format tab tables. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 21 Jun 96 Created */ #include "TcsCatalog.h" /* * Class TcsLocalCatalog * * This class is like LocalCatalog, except that the table columns are fixed * to be a subset of the GSC/PPM columns. */ class TcsLocalCatalog : public TcsCatalog { private: char* filename_; // file name for local catalog time_t timestamp_; // last update time of file, for caching protected: public: // constructor - create local TCS catalog class instance // note: public interface uses TcsCatalog::open() with the name of the // file containing the local TCS catalog. // The argument represents the entry in the catalog config file for this catalog // (made automatially, if not already present). TcsLocalCatalog(CatalogInfoEntry* e); // destructor ~TcsLocalCatalog(); // Run a query on the catalog and return the number of objects found. // (redefined here to work with local catalogs) virtual int query(const AstroQuery& q, const char* filename, QueryResult& result); // check the validity of a tab table file static int check_table(const char* file); // query server for catalog column names and put result in info_ virtual int getInfo(); virtual int checkInfo(); }; #endif /* _TcsLocalCatalog_h_ */ skycat-3.1.2-starlink-1b/cat/generic/TcsQueryResult.C000066400000000000000000000257011215713201500224070ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: TcsQueryResult.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TcsQueryResult.C - method definitions for class TcsQueryResult * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Jun 96 Created */ static const char* const rcsId="@(#) $Id: TcsQueryResult.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include "error.h" #include "WorldCoords.h" #include "TcsQueryResult.h" /* * Fill the table from the given buffer in tab table format. * If maxRows is nonzero, only upto that many rows are taken from buf. * (redefined from parent class to add init of objects_ array) */ int TcsQueryResult::init(const char* buf, int maxRows, int owner) { if (TabTable::init(buf, maxRows, owner) != 0) return ERROR; return make_objects(); } /* * Initialize the table from the data buffer (without heading lines). * The first two args specify the number column headings and their names. * If maxRows is nonzero, only upto that many rows are taken from buf. * (redefined from parent class to add init of objects_ array) */ int TcsQueryResult::init(int numCols, char** colNames, const char* buf, int maxRows, int owner) { if (TabTable::init(numCols, colNames, buf, maxRows, owner) != 0) return ERROR; return make_objects(); } /* * make the table empty and free any resources used * (redefined from parent class to add cleanup of objects_ array) */ int TcsQueryResult::clear() { if (TabTable::clear() != 0) return ERROR; if (objects_ != NULL) { delete [] objects_; objects_ = NULL; } return 0; } /* * make the objects_ array to hold the data for the rows */ int TcsQueryResult::make_objects() { if (objects_ != NULL) { delete [] objects_; objects_ = NULL; } if (numRows_ <= 0) return 0; objects_ = new TcsCatalogObject[numRows_]; if (!objects_) return error("no enough memory"); for (int row = 0; row < numRows_; row++) { if (getObjFromTable(row, objects_[row]) != 0) { delete [] objects_; objects_ = NULL; return ERROR; } } return 0; } /* * get the value at the given row,column as a double * and allow missing columns to be set to the null value */ int TcsQueryResult::getDouble(int row, int col, double& value) { char* p; if (get(row, col, p) != 0) return 1; if (strlen(p) == 0) value = TCS_CATALOG_NULL_DOUBLE; else if (sscanf(p, "%lf", &value) != 1) return tab_error(row, col, (char *)"double", p); return 0; } /* * Access a TcsCatalog (GSC/PPM) result row and fill out the given TcsCatalogObject. * (For compat. with earlier version: it is more efficient to use getObj(int row)) */ int TcsQueryResult::getObj(int row, TcsCatalogObject& t) const { if (checkTableIndex(row) != 0) return ERROR; if (!objects_) return error("empty TCS result"); t = objects_[index_[row]]; return 0; } /* * Return a pointer to an object for the given row or NULL if there is * an error. The memory belongs to this class and should not deleted. */ TcsCatalogObject* TcsQueryResult::getObj(int row) const { if (checkTableIndex(row) != 0) return NULL; if (!objects_) { error("empty TCS result"); return NULL; } return &objects_[index_[row]]; } /* * Access a TcsCatalog (GSC/PPM) result row and fill out the given TcsCatalogObject. * Any missing fields are left at the default or null value. */ int TcsQueryResult::getObjFromTable(int row, TcsCatalogObject& t) { int i; char* s; double d; WorldCoords pos; // ra and dec t.reset(); if (!entry_->isWcs()) return error("catalog does not support World Coordinates"); // set the id, ra and dec if (get(row, id_col(), s) != 0 || t.id(s) != 0 || getPos(row, pos) != 0 || t.ra(pos.ra_deg()) != 0 || t.dec(pos.dec_deg()) != 0) return ERROR; // look for GSC or PPM (http catalog server) names and set the rest // epoch if ((i = inputColIndex("epoch")) >= 0) { if (getDouble(row, i, d) != 0 || t.epoch(d) != 0) return ERROR; } // pma if ((i = inputColIndex("pma")) >= 0) { if (getDouble(row, i, d) != 0 || t.pma(d) != 0) return ERROR; } // pmd if ((i = inputColIndex("pmd")) >= 0) { if (getDouble(row, i, d) != 0 || t.pmd(d) != 0) return ERROR; } // radvel if ((i = inputColIndex("radvel")) >= 0) { if (getDouble(row, i, d) != 0 || t.radvel(d) != 0) return ERROR; } // parallax if ((i = inputColIndex("parallax")) >= 0) { if (getDouble(row, i, d) != 0 || t.parallax(d) != 0) return ERROR; } // mag if ((i = inputColIndex("mag")) >= 0) { if (getDouble(row, i, d) != 0 || t.mag(d) != 0) return ERROR; } // more if ((i = inputColIndex("more")) >= 0) { if (get(row, i, s) != 0 || t.more(s) != 0) return ERROR; } // preview if ((i = inputColIndex("preview")) >= 0) { if (get(row, i, s) != 0 || t.preview(s) != 0) return ERROR; } // distance if ((i = inputColIndex("distance")) >= 0) { if (getDouble(row, i, d) != 0 || t.distance(d) != 0) return ERROR; } // pa if ((i = inputColIndex("pa")) >= 0) { if (getDouble(row, i, d) != 0 || t.pa(d) != 0) return ERROR; } // cooSystem if ((i = inputColIndex("cooSystem")) >= 0) { if (get(row, i, s) != 0 || t.cooSystem(s) != 0) return ERROR; } // cooType if ((i = inputColIndex("cooType")) >= 0) { if (get(row, i, s) != 0 || t.cooType(s) != 0) return ERROR; } // band if ((i = inputColIndex("band")) >= 0) { if (get(row, i, s) != 0 || t.band(s) != 0) return ERROR; } // calculate some missing values if needed (distance to center and pa) if (TcsCatalogObject::isNull(t.distance()) || TcsCatalogObject::isNull(t.pa())) { if (!centerPos_.isNull()) { if (t.distance(centerPos_.wc().dist(pos, d)) != 0 || t.pa(d) != 0) return ERROR; } } return 0; } /* * return column index in the original input for the given TCS column name * (might be different than the output index) */ int TcsQueryResult::inputColIndex(const char* colName) const { int i = -1; if ((i = TabTable::colIndex(colName)) >= 0) return i; // insert any name changes here if (strcmp(colName, "distance") == 0) return TabTable::colIndex("d'"); return -1; } /* * print the given table row to the given stream */ int TcsQueryResult::printRow(ostream& os, int row) const { // output the rows TcsCatalogObject* obj = getObj(row); if (obj == NULL) return ERROR; obj->printTableRow(os); return 0; } /* * print the table title (and any other info preceding the column headings) * (redefined here from parent class to add TCS column info in table header) */ void TcsQueryResult::printTableTop(ostream& os, const char* title) { if (! title) title = "TcsQueryResult"; QueryResult::printTableTop(os, title); // add TCS header // comment os << "\n" << "# This file contains catalog information in TCS tab table format\n" << "\n"; // TCS column info os << "# Column descriptions:\n" << "id_desc= Object ID\n" << "id_type= string # Object ID\n" << "\n" << "ra_desc= Alpha coordinate for the target in decimal degrees\n" << "ra_units= deg\n" << "ra_type= real\n" << "ra_range= 0.,360\n" << "\n" << "dec_desc= Delta coordinate for the target in decimal degrees\n" << "dec_unit= deg\n" << "dec_type= real\n" << "dec_range= 0.,360.\n" << "\n" << "cooSystem_desc= Equinox system and equinox (only 1950 or 2000 are accepted)\n" << "cooSystem_type= string\n" << "cooSystem_range= enum B1950, J2000\n" << "cooSystem_def_val= \"J2000\"\n" << "\n" << "epoch_desc= Epoch expressed as decimal year.\n" << "epoch_type= real\n" << "epoch_range= -2000.,3000.\n" << "epoch_def_val= 2000.\n" << "\n" << "pma_desc= Proper motion alpha in radians/year (-10.0 to 10.0)\n" << "pma_unit= arcsecs/year\n" << "pma_type= real\n" << "pma_range= -10.,10.\n" << "pma_def_val= 0.0\n" << "\n" << "pmd_desc= Proper motion delta in radians/year (-10.0 to 10.0) \n" << "pmd_unit= arcsecs/year\n" << "pmd_type= real\n" << "pmd_range= -10.,10.\n" << "pmd_def_val= 0.0\n" << "\n" << "radvel_desc= Radial velocity in km/sec (-200000 to 200000)\n" << "radvel_unit= km/sec\n" << "radvel_type= real\n" << "radvel_range= -200000.,200000.\n" << "radvel_def_val= 0.\n" << "\n" << "parallax_desc= Parallax in arcseconds (-10000 to 10000)\n" << "parallax_unit= arcseconds\n" << "parallax_type= real\n" << "parallax_range= -10000.0,10000.0\n" << "parallax_def_val= 0.0\n" << "\n" << "cooType_desc= Coordinate type as \"m\" for mean or \"a\" for apparent character\n" << "cooType_type= string\n" << "cooType_range= enum \"m\",\"a\"\n" << "cooType_def_val= \"m\"\n" << "\n" << "band_desc= Magnitude wavelength band\n" << "band_type= string\n" << "band_def_val= \"v\"\n" << "\n" << "mag_desc= Object's magnitude in given band\n" << "mag_unit= magnitude\n" << "mag_type= real\n" << "mag_def_val= 0.0\n" << "\n" << "more_desc= An HTTP URL pointing to more info on the object\n" << "more_unit= http url\n" << "more_type=string\n" << "more_def_val= \"\"\n" << "\n" << "preview_desc= An HTTP URL pointing to an image of the object\n" << "preview_unit= http url\n" << "preview_type= string\n" << "preview_def_val= \"\"\n" << "\n" << "distance_desc= Object distance to field center\n" << "distance_unit= arcmin\n" << "distance_type= real\n" << "\n" << "pa_desc= Object position angle to field center (east of north)\n" << "pa_unit= deg\n" << "pa_type= real\n" << "\n" << "# NULL values\n" << "string_null= \"\" # empty string\n" << "real_null= 1.e-300\n" << "int_null= 4294967294 # (2^32 - 1)\n" << "\n"; } /* * compare the given rows and return <. = or > 0, as by strcmp. * (redefined from parent class to allow compare of columns that * have been renamed or calculated (d', pa)) */ int TcsQueryResult::compareRows(int row1, int row2) { if (row1 < 0 || row1 >= numRows_ || row2 < 0 || row2 >= numRows_) return (sortStatus_ = error("sort row index out of range")); // don't use index_[row] here since we are sorting it int ret = 0; for (int i = 0; i < numSortCols_; i++) { if ((ret = objects_[row1].compare(objects_[row2], sortColIndexes_[i])) != 0) break; } return ret * sortOrder_; } skycat-3.1.2-starlink-1b/cat/generic/TcsQueryResult.h000066400000000000000000000103571215713201500224550ustar00rootroot00000000000000// -*-c++-*- #ifndef _TcsQueryResult_h_ #define _TcsQueryResult_h_ /* * E.S.O. - VLT project/ESO Archive * $Id: TcsQueryResult.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * TcsQueryResult.h - class definitions for accessing results of a * TCS catalog query * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Jun 96 Created */ using namespace std; #include "QueryResult.h" #include "TcsCatalogObject.h" /* * Class TcsQueryResult * * This class manages the result of an TcsCatalog::query. Internally * a QueryResult object manages the "tab table" query results (this could * be changed later if performance is an issue). * * This class provides transparent access to the result based on a * row,column index and, unlike the QueryResult class, is specialized for * accessing the GSC and PPM catalogs. There are special methods to return * GSC and PPM fields in common units and to determine if a field is present * in the catalog. */ class TcsQueryResult : public QueryResult { private: // copy constructor (not defined) TcsQueryResult(TcsQueryResult&); protected: // array of objects created from the rows (better for sorting) TcsCatalogObject* objects_; // get the value at the given row,column as a double // and allow missing columns to be set to the null value virtual int getDouble(int row, int col, double& value); // return column index in the original input for the given TCS column name // (might be different than the output index) virtual int inputColIndex(const char* colName) const; // compare 2 rows (redefined from parent class to compare TCS objects) virtual int compareRows(int row1, int row2); // make array of Tcs objects virtual int make_objects(); // access a TcsCatalog (GSC/PPM) result row: fill out the given TcsCatalogObject virtual int getObjFromTable(int row, TcsCatalogObject&); // print table title and other info virtual void printTableTop(ostream& os, const char* title = NULL); public: // constructor: initialize empty table TcsQueryResult() : QueryResult(), objects_(NULL) {} // constructor: init from query result buffer TcsQueryResult(const char* result) : QueryResult(result), objects_(NULL) {} // destructor: free any allocated memory virtual ~TcsQueryResult() {} // make the table empty and free any resources used virtual int clear(); // fill the table from the given buffer in tab table format virtual int init(const char* buf, int maxRows = 0, int owner = 0); // fill the table from the given buffer in tab table format, with headings // specified separately virtual int init(int numCols, char** colNames, const char* buf, int maxRows = 0, int owner = 0); // access a TcsCatalog (GSC/PPM) result row: fill out the given TcsCatalogObject virtual int getObj(int row, TcsCatalogObject&) const; // Return a pointer to an object for the given row or NULL if there is // an error. The memory belongs to this class and should not deleted. TcsCatalogObject* getObj(int row) const; // print the given table row to the given stream virtual int printRow(ostream& os, int row) const; // -- redefine these to deal with TCS columns -- // get array of TCS column names, number of columns virtual char** colNames() const {return TcsCatalogObject::colNames();} virtual int numCols() const {return TcsCatalogObject::numCols();} // return the TCS column name for the given TCS column index virtual const char* colName(int col) const {return TcsCatalogObject::colName(col);} // return the TCS column index for the given TCS column name virtual int colIndex(const char* colName) const {return TcsCatalogObject::colIndex(colName);} // redefine these here from the base class, since the columns are fixed virtual int id_col() const {return 0;} virtual int ra_col() const {return 1;} virtual int dec_col() const {return 2;} virtual int x_col() const {return -1;} virtual int y_col() const {return -1;} }; #endif /* _TcsQueryResult_h_ */ skycat-3.1.2-starlink-1b/cat/generic/astro_catalog.C000066400000000000000000000326411215713201500222540ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: astro_catalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * astroCatalog.C - C interface implementation for C++ class AstroCatalog * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Oct 95 Created */ static const char* const rcsId="@(#) $Id: astro_catalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include "error.h" // include the C++ and C interfaces #include "AstroCatalog.h" extern "C" { #include "astro_catalog.h" } /* * check that the given catalog handle is not null and return its * error status */ static int acCheckHandle(AcHandle handle) { if (handle) return ((AstroCatalog*)handle)->status(); return error("internal error: ", "bad catalog handle", EINVAL); } /* * check that the given query result handle is not null and return its * error status */ static int acCheckResult(AcResult handle) { if (handle) return ((QueryResult*)handle)->status(); return error("internal error: ", "bad query result handle", EINVAL); } /* * open the named catalog and return a handle for it or NULL if there * were errors */ AcHandle acOpen(char* name) { return (AcHandle)AstroCatalog::open(name); } /* close the catalog and free its resources */ void acClose(AcHandle handle) { if (handle) delete (AstroCatalog*)handle; } /* * return true if there would have been more than "maxRows" available * in the last query */ int acMore(AcHandle handle) { if (acCheckHandle(handle) != OK) return ERROR; return ((AstroCatalog*)handle)->more(); } /* return the number of colums in the catalog */ int acNumCols(AcHandle handle) { if (acCheckHandle(handle) != OK) return ERROR; return ((AstroCatalog*)handle)->numCols(); } /* return the name of the given column in the catalog */ char* acColName(AcHandle handle, int col) { if (acCheckHandle(handle) != OK) return NULL; return (char*)((AstroCatalog*)handle)->colName(col); } /* return a pointer to an array with the names of the columns in the catalog*/ char** acColNames(AcHandle handle) { if (acCheckHandle(handle) != OK) return NULL; return (char**)((AstroCatalog*)handle)->colNames(); } /* return the index for the given column name the catalog */ int acColIndex(AcHandle handle, char* name) { if (acCheckHandle(handle) != OK) return ERROR; return ((AstroCatalog*)handle)->colIndex(name); } /* * Get the number of columns, the column names and types ("char", "int", * "float") for the given catalog and return 0 if all is OK */ int acGetDescription( AcHandle handle, /* in - catalog handle*/ int* numCols, /* out - number of result columns */ char*** colNames) /* out - ptr to array of column names */ { if (acCheckHandle(handle) != OK) return ERROR; return ((AstroCatalog*)handle)->getDescription( *numCols, *colNames); // we don't enforce the const in C } /* * Get the values for the specified columns for the object given by "id" * in the named catalog and return 0 if all is OK */ int acGetObject( AcHandle handle, /* in - catalog handle */ char* id, /* in - object id in catalog */ int numCols, /* in - number of columns to get (size of colNames) */ char** colNames, /* in - null terminated array of column names to read */ AcResult* result) /* out - handle for accessing query results (see below) */ { if (acCheckHandle(handle) != OK) return ERROR; QueryResult* qr = new QueryResult; int status = ((AstroCatalog*)handle)->getObject( id, numCols, colNames, *qr); if (status == 0) *result = (AcResult)qr; return status; } /* * Get the values for all objects in the specified world coordinates area */ int acGetArea( AcHandle handle, /* in - catalog handle */ int numCols, /* in - number of columns to get (size of colNames) */ char** colNames, /* in - null terminated array of column names to read */ double ra0, /* in - coordinates of area */ double dec0, double ra1, double dec1, double mag0, /* in - min magnitude */ double mag1, /* in - max magnitude */ int maxRows, /* in - max number of rows to return */ char* filename, /* in - if not null, write results to this file */ int* numFound, /* out - number of objects found */ AcResult* result) /* out - handle for accessing query results (see below) */ { if (acCheckHandle(handle) != OK) return ERROR; QueryResult* qr = new QueryResult; int status = ((AstroCatalog*)handle)->getArea( numCols, colNames, WorldCoords(ra0, dec0), WorldCoords(ra1, dec1), mag0, mag1, maxRows, filename, *numFound, *qr); if (status == 0) *result = (AcResult)qr; return status; } /* * pass a request to the image server and return the name of a FITS file * containing the resulting image, or NULL if not found * * Args: * * handle - handle returned from ac_open() * * ra, dec - world coordinates position (in deg) * * width, height - dimensions of image to return (in arcmin). * * The return filename is the name of a temporary file that will * be reused on the next call to this routine. * * XXX note: this routine should probably return the status instead * of the filename (the C++ method returns the status). */ char* acGetImage(AcHandle handle, double ra, double dec, double width, double height) { if (acCheckHandle(handle) != OK) return NULL; AstroQuery q; q.pos(WorldCoords(ra, dec)); q.width(width); q.height(height); if (((AstroCatalog*)handle)->getImage(q) != 0) return NULL; return (char*)(((AstroCatalog*)handle)->tmpfile()); } /* return the error message for the most recent error */ char* acGetError() { return last_error(); } /* * return the error code for the most recent error * (see errno.h for the posible error codes) */ int acGetErrorCode() { return last_error_code(); } /* * Get the values for all objects in the specified circle/ring. */ int acCircularSearch( AcHandle handle, /* in - catalog handle */ int numCols, /* in - number of columns to get (size of colNames) */ char** colNames, /* in - null terminated array of column names to read */ double ra, /* in - center position in world coordinates */ double dec, double radius0, /* in - min radius */ double radius1, /* in - max radius */ double mag0, /* in - min magnitude */ double mag1, /* in - max magnitude */ int maxRows, /* in - max number of rows to return */ char* filename, /* in - if not null, write results to this file */ int* numFound, /* out - number of objects found */ AcResult* result) /* out - handle for accessing query results (see below) */ { if (acCheckHandle(handle) != OK) return ERROR; QueryResult* qr = new QueryResult; int status = ((AstroCatalog*)handle)->circularSearch( numCols, colNames, WorldCoords(ra, dec), radius0, radius1, mag0, mag1, maxRows, filename, *numFound, *qr); if (status == 0) *result = (AcResult)qr; return status; } /* * search for the star closest to the given position, with the magnitude in * the given range and return (via the last 2 args) the columns requested * by "colNames" */ int acSearchClosestStar( AcHandle handle, /* in - catalog handle */ int numCols, /* in - number of columns to get (size of colNames) */ char** colNames, /* in - null terminated array of column names to read */ double ra, /* in - center position in world coordinates */ double dec, double mag0, /* in - min magnitude */ double mag1, /* in - max magnitude */ AcResult* result) /* out - handle for accessing query results (see below) */ { if (acCheckHandle(handle) != OK) return ERROR; QueryResult* qr = new QueryResult; int status = ((AstroCatalog*)handle)->searchClosestStar( numCols, colNames, WorldCoords(ra, dec), mag0, mag1, *qr); if (status == 0) *result = (AcResult)qr; return status; } /* * search for the stars fulfilling the specified criteria */ int acCatalogSearch( AcHandle handle, /* in - catalog handle */ int numCols, /* in - number of columns to get */ char** colNames, /* in - array of column names to read */ int numSearchCols, /* in - number of search columns */ char** searchCols, /* in - array of column names to search */ char** minVals, /* in - optional array of min values */ char** maxVals, /* in - optional array of max values */ int maxRows, /* in - max number of rows to return */ const char* filename, /* in - if not null, write results to this file */ int* numFound, /* out - number of objects found */ AcResult* result) /* out - handle for accessing query results (see below) */ { if (acCheckHandle(handle) != OK) return ERROR; QueryResult* qr = new QueryResult; int status = ((AstroCatalog*)handle)->CatalogSearch( numCols, colNames, numSearchCols, searchCols, minVals, maxVals, maxRows, filename, *numFound, *qr); if (status == 0) *result = (AcResult)qr; return status; } /* * --- routines for accessing the query results --- */ /* return number of result rows */ int acrNumRows(AcResult handle) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->numRows(); } /* return number of result columns */ int acrNumCols(AcResult handle) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->numCols(); } /* return a pointer to an array of result column names */ char** acrColNames(AcResult handle) { if (acCheckResult(handle) != OK) return NULL; return (char**)((QueryResult*)handle)->colNames(); } /* * Note: there are various versions for different data types and parameters. * All return 0 for success and set the last argument value or return * 1 for error. */ /* get result values by row and column index */ int acrGetString(AcResult handle, int row, int col, char** value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, col, *value); } int acrGetInt(AcResult handle, int row, int col, int* value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, col, *value); } int acrGetDouble(AcResult handle, int row, int col, double* value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, col, *value); } int acrGetFloat(AcResult handle, int row, int col, float* value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, col, *value); } int acrGetShort(AcResult handle,int row, int col, short* value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, col, *value); } int acrGetChar(AcResult handle,int row, int col, char* value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, col, *value); } /* get result values row and column name */ int acrGetNString(AcResult handle, int row, const char* colName, char** value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, colName, *value); } int acrGetNInt(AcResult handle, int row, const char* colName, int* value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, colName, *value); } int acrGetNDouble(AcResult handle, int row, const char* colName, double* value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, colName, *value); } int acrGetNFloat(AcResult handle, int row, const char* colName, float* value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, colName, *value); } int acrGetNShort(AcResult handle, int row, const char* colName, short* value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, colName, *value); } int acrGetNChar(AcResult handle, int row, const char* colName, char* value) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->get(row, colName, *value); } /* * if the result contains a wcs position (fields ra and dec), * get it and return success (0), otherwise return an error. * * The last 2 args should normally be "ra", "dec". */ int acrGetWC(AcResult handle, int row, WC* pos) { if (acCheckResult(handle) != OK) return ERROR; WorldOrImageCoords w; int status = ((QueryResult*)handle)->getPos(row, w); if (status == 0) { pos->ra.hours = w.ra().hours(); pos->ra.min = w.ra().min(); pos->ra.sec = w.ra().sec(); pos->ra.val = w.ra().val(); pos->dec.hours = w.dec().hours(); pos->dec.min = w.dec().min(); pos->dec.sec = w.dec().sec(); pos->dec.val = w.dec().val(); return 0; } return ERROR; } /* * return the result column index for the given result column name */ int acrColIndex(AcResult handle, const char* colName) { if (acCheckResult(handle) != OK) return ERROR; return ((QueryResult*)handle)->colIndex(colName); } /* * delete the result object (free the memory) */ void acrDelete(AcResult handle) { if (acCheckResult(handle) != OK) return; QueryResult* r = ((QueryResult*)handle); if (r) delete r; } skycat-3.1.2-starlink-1b/cat/generic/astro_catalog.h000066400000000000000000000165551215713201500223270ustar00rootroot00000000000000#ifndef _astroCatalog_h_ #define _astroCatalog_h_ /* * E.S.O. - VLT project * $Id: astro_catalog.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * astro_catalog.h - C interface to C++ class AstroCatalog * * (Note: C applications must have at least a dummy C++ main and link * with C++) * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created */ #include "world_coords.h" /* handle for an open catalog */ typedef void* AcHandle; /* handle for accessing the result of a query */ typedef void* AcResult; /* * open the named catalog and return a handle for it or NULL if there * were errors */ AcHandle acOpen(char* name); /* close the catalog and free its resources */ void acClose(AcHandle); /* * return true if there would have been more than "nrows" available * in the last query */ int acMore(AcHandle); /* return the number of colums in the catalog */ int acNumCols(AcHandle); /* return the name of the given column in the catalog */ char* acColName(AcHandle, int col); /* return a pointer to an array with the names of the columns in the catalog*/ char** acColNames(AcHandle); /* return the index for the given column name the catalog */ int acColIndex(AcHandle handle, char* name); /* * Get the number of columns, the column names * for the given catalog and return 0 if all is OK */ int acGetDescription( AcHandle cat, /* in - catalog handle */ int* numCols, /* out - number of result columns */ char*** colNames); /* out - ptr to array of column names */ /* * Get the values for the specified columns for the object given by "id" * in the given catalog and return 0 if all is OK */ int acGetObject( AcHandle cat, /* in - catalog handle */ char* id, /* in - object id in catalog */ int numCols, /* in - number of columns to get (size of colNames) */ char** colNames, /* in - array[numCols] of column names to read */ AcResult* result); /* out - handle for accessing query results (see below) */ /* * Get the values for all objects in the specified world coordinates area */ int acGetArea( AcHandle cat, /* in - catalog handle */ int numCols, /* in - number of columns to get (size of colNames) */ char** colNames, /* in - array[numCols] of column names to read */ double ra0, /* in - coordinates of area */ double dec0, double ra1, double dec1, double mag0, /* in - min magnitude */ double mag1, /* in - max magnitude */ int maxRows, /* in - max number of rows to return */ char* filename, /* in - if not null, write results to this file */ int* numFound, /* out - number of objects found */ AcResult* result); /* out - handle for accessing query results (see below) */ /* * return a pointer to the most recent error message */ char* acGetError(); /* * return the error code (from ) for the most recent error */ int acGetErrorCode(); /* * Get the values for all objects in the specified circle/ring. */ int acCircularSearch( AcHandle cat, /* in - catalog handle */ int numCols, /* in - number of columns to get (size of colNames) */ char** colNames, /* in - array[numCols] of column names to read */ double ra, /* in - center position in world coordinates */ double dec, double radius0, /* in - min radius */ double radius1, /* in - max radius */ double mag0, /* in - min magnitude */ double mag1, /* in - max magnitude */ int maxRows, /* in - max number of rows to return */ char* filename, /* in - if not null, write results to this file */ int* numFound, /* out - number of objects found */ AcResult* result); /* out - handle for accessing query results (see below) */ /* * search for the star closest to the given position, with the magnitude in * the given range and return (via the last 2 args) the columns requested * by "colNames" */ int acSearchClosestStar( AcHandle cat, /* in - catalog handle */ int numCols, /* in - number of columns to get (size of colNames) */ char** colNames, /* in - array[numCols] of column names to read */ double ra, /* in - center position in world coordinates */ double dec, double mag0, /* in - min magnitude */ double mag1, /* in - max magnitude */ AcResult* result); /* out - handle for accessing query results (see below) */ /* * search for the stars fulfilling the specified criteria */ int acCatalogSearch( AcHandle cat, /* in - catalog handle */ int numCols, /* in - number of columns to get */ char** colNames, /* in - array[numCols] of column names to read */ int numSearchCols, /* in - number of search columns */ char** searchCols, /* in - array of column names to search */ char** minVals, /* in - optional array of min values */ char** maxVals, /* in - optional array of max values */ int maxRows, /* in - max number of rows to return */ const char* filename, /* in - if not null, write results to this file */ int* numFound, /* out - number of objects found */ AcResult* result); /* out - handle for accessing query results (see below) */ /* * pass a request to the catalog and return the name of a FITS file * containing the resulting image, or NULL if not found * * Args: * * handle - handle returned from ac_open() * * ra, dec - world coordinates position * * width, height - dimensions of image to return. * * The return filename is the name of a temporary file that will * be reused on the next call to this routine. */ char* acGetImage(AcHandle handle, double ra, double dec, double width, double height); /* * --- routines for accessing the query results --- */ /* return number of result rows */ int acrNumRows(AcResult); /* return number of result columns */ int acrNumCols(AcResult); /* return a pointer to an array of result column names */ char** acrColNames(AcResult); /* * Get result values: * * Note: there are various versions for different data types and parameters. * All return 0 for success and set the last argument value or return * 1 for error. */ /* get result values by row and column index */ int acrGetString(AcResult, int row, int col, char** value); int acrGetInt(AcResult, int row, int col, int* value); int acrGetDouble(AcResult, int row, int col, double* value); int acrGetFloat(AcResult, int row, int col, float* value); int acrGetShort(AcResult,int row, int col, short* value); int acrGetChar(AcResult,int row, int col, char* value); /* get result values by row and column name */ int acrGetNString(AcResult,int row, const char* colName, char** value); int acrGetNInt(AcResult,int row, const char* colName, int* value); int acrGetNDouble(AcResult,int row, const char* colName, double* value); int acrGetNFloat(AcResult,int row, const char* colName, float* value); int acrGetNShort(AcResult,int row, const char* colName, short* value); int acrGetNChar(AcResult,int row, const char* colName, char* value); /* * if the result contains a wcs position (fields ra and dec), * get it and return success (0) */ int acrGetWC(AcResult, int row, WC* pos); /* * return the result column index for the given result column name */ int acrColIndex(AcResult,const char* colName); /* * delete the result object (free the memory) */ void acrDelete(AcResult); #endif /* __astroCatalog_h_ */ skycat-3.1.2-starlink-1b/cat/generic/astro_image.C000066400000000000000000000042511215713201500217200ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * $Id: astro_image.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * astroImage.C - C interface implementation for C++ class AstroImage * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Oct 95 Created * 02/01/06 Renamed astroImage.C to astro_image.C to avoid * name conflict on file systems that ignore case */ static const char* const rcsId="@(#) $Id: astro_image.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; // include the C++ and C interfaces #include #include "error.h" #include "AstroImage.h" extern "C" { #include "astro_image.h" #include "astro_catalog.h" } /* * check that the given handle is not null and return its * error status */ static int aiCheckHandle(AiHandle handle) { if (handle) return ((AstroImage*)handle)->status(); return error("internal error: ", "bad image server handle", EINVAL); } /* * open the named image server and return a handle for it or NULL if * there were errors */ AiHandle aiOpen(char* name) { return (AiHandle)AstroImage::open(name); } /* close the image server connection and free its resources */ void aiClose(AiHandle handle) { if (handle) delete (AstroImage*)handle; } /* * pass a request to the image server and return the name of a FITS file * containing the resulting image, or NULL if not found * * Args: * * handle - handle returned from ai_open() * * ra, dec - world coordinates position * * width, height - dimensions of image to return. * * The return filename is the name of a temporary file that will * be reused on the next call to this routine. * * XXX note: this routine should probably return the status instead * of the filename (the C++ method returns the status). */ char* aiGetImage(AiHandle handle, double ra, double dec, double width, double height) { if (aiCheckHandle(handle) != OK) return NULL; if (((AstroImage*)handle)->getImage(WorldCoords(ra, dec), width, height) != 0) return NULL; return (char*)(((AstroImage*)handle)->tmpfile()); } skycat-3.1.2-starlink-1b/cat/generic/astro_image.h000066400000000000000000000026371215713201500217730ustar00rootroot00000000000000#ifndef _astroImage_h_ #define _astroImage_h_ /* * E.S.O. - VLT project * $Id: astro_image.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * astro_image.h - C interface to C++ class AstroImage * * (Note: C applications must have at least a dummy C++ main and link * with C++) * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * 02/01/06 Renamed astroImage.h to astro_image.h to avoid * name conflict on file systems that ignore case */ /* handle for an open image server */ typedef void* AiHandle; /* * open the named image server and return a handle for it or NULL if * there were errors */ AiHandle aiOpen(char* name); /* close the image server connection and free its resources */ void aiClose(AiHandle); /* * pass a request to the catalog and return the name of a FITS file * containing the resulting image, or NULL if not found * * Args: * * handle - handle returned from ai_open() * * ra, dec - world coordinates position * * width, height - dimensions of image to return. * * The return filename is the name of a temporary file that will * be reused on the next call to this routine. */ char* aiGetImage(AiHandle handle, double ra, double dec, double width, double height); #endif /* _astroImage_h_ */ skycat-3.1.2-starlink-1b/cat/generic/cat_bitmaps.C000066400000000000000000000034211215713201500217120ustar00rootroot00000000000000 /* * E.S.O. - VLT project / ESO Archive * "@(#) $Id: cat_bitmaps.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Tk Bitmap/Pixmap definitions * * This file was generated by ../bitmaps/bitmaps.tcl - DO NO EDIT */ #include #include void defineCatBitmaps(Tcl_Interp *interp) { #include "symb_circle.xbm" Tk_DefineBitmap(interp, Tk_GetUid("symb_circle"), (char*)symb_circle_bits, symb_circle_width, symb_circle_height); #include "symb_cross.xbm" Tk_DefineBitmap(interp, Tk_GetUid("symb_cross"), (char*)symb_cross_bits, symb_cross_width, symb_cross_height); #include "symb_diamond.xbm" Tk_DefineBitmap(interp, Tk_GetUid("symb_diamond"), (char*)symb_diamond_bits, symb_diamond_width, symb_diamond_height); #include "symb_ellipse.xbm" Tk_DefineBitmap(interp, Tk_GetUid("symb_ellipse"), (char*)symb_ellipse_bits, symb_ellipse_width, symb_ellipse_height); #include "symb_plus.xbm" Tk_DefineBitmap(interp, Tk_GetUid("symb_plus"), (char*)symb_plus_bits, symb_plus_width, symb_plus_height); #include "symb_triangle.xbm" Tk_DefineBitmap(interp, Tk_GetUid("symb_triangle"), (char*)symb_triangle_bits, symb_triangle_width, symb_triangle_height); #include "symb_square.xbm" Tk_DefineBitmap(interp, Tk_GetUid("symb_square"), (char*)symb_square_bits, symb_square_width, symb_square_height); #include "symb_line.xbm" Tk_DefineBitmap(interp, Tk_GetUid("symb_line"), (char*)symb_line_bits, symb_line_width, symb_line_height); #include "symb_arrow.xbm" Tk_DefineBitmap(interp, Tk_GetUid("symb_arrow"), (char*)symb_arrow_bits, symb_arrow_width, symb_arrow_height); #include "symb_compass.xbm" Tk_DefineBitmap(interp, Tk_GetUid("symb_compass"), (char*)symb_compass_bits, symb_compass_width, symb_compass_height); } skycat-3.1.2-starlink-1b/cat/install000077500000000000000000000042121215713201500172770ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 skycat-3.1.2-starlink-1b/cat/install.sh000077500000000000000000000042121215713201500177100ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 skycat-3.1.2-starlink-1b/cat/library/000077500000000000000000000000001215713201500173505ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/cat/library/AstroCat.tcl000066400000000000000000001467071215713201500216130ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: AstroCat.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # AstroCat.tcl - user interface class for viewing catalog info # # See man page AstroCat(n) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 14 Dec 95 created # P.W.Draper 12 Dec 97 added methods to get equinox and table name # 11 May 00 stop immediate delete of images, need backing # store for my catalogue handling commands. # 03 Mar 08 Remove check in new_catalog, opened file is # never closed (and can leave a temporary file). # 10 Nov 08 Add command to local catalogues menu to clear the list. itk::usual AstroCat {} # The AstroCat widget class defines a top level widget for searching and # displaying astronomical catalog data. It contains a menubar with items # for loading, editing, and saving catalog data and a table displaying # rows and columns of catalog data. This class does not know anything # about images or plotting objects in images, however these features may # be added in a derived class (see the SkySearch(n) in the skycat # package for an example). # # You can also run this class as a standalone application with the # command "astrocat". The application options are the same as the class # options. itcl::class cat::AstroCat { inherit util::TopLevelWidget # constructor constructor {args} { eval itk_initialize $args } # destructor - delete C++ based objects so that the temp # files are deleted destructor { # delete temp files on close catch { if {"[$w_.cat servtype]" == "local"} { if {"[string range $itk_option(-catalog) 0 4]" == "/tmp/"} { file delete $itk_option(-catalog) } } } catch { if { $tempimage_ != {} } { file delete $tempimage_ } } catch {$w_.cat delete} catch {close $rfd_} catch {close $wfd_} catch {unset instances_($instance_idx_)} if {"$current_instance_" == "$w_"} { set current_instance_ {} } } # called after options have been evaluated protected method init {} { # if running stand-alone, setup X defaults if {$itk_option(-standalone)} { util::setXdefaults cat::setXdefaults } # set the file used to keep track of URLs (for debugging) set_logfile # do window layout layout_dialog # enter widget name in instance array for later reference set_instance # add a short help window make_short_help # create an object for running interruptable batch queries Batch $w_.batch \ -command [code $this preview_done] \ -debug $itk_option(-debug) # position from previous window, if pos. if {"$current_instance_" != ""} { wm geometry $w_ +[winfo x $current_instance_]+[winfo y $current_instance_] } set current_instance_ $w_ # for local catalogs, start search automatically set name $itk_option(-catalog) if {"[$w_.cat servtype]" == "local"} { wm title $w_ "[file tail [$w_.cat longname $name $itk_option(-catalogdir)]] ($itk_option(-number))" wm iconname $w_ "[file tail [$w_.cat shortname $name $itk_option(-catalogdir)]]" search } # check for TCS catalog if {[$w_.cat is_tcs] || \ (! $itk_option(-tcs) \ && [file exists $name] \ && [is_tcs_catalog $name])} { global ::$w_.tcs set $w_.tcs 1 set_tcs_columns } set initialized_ 1 } # create the ~/.skycat dir if it does not already exists and keep a log # file there. protected method set_logfile {} { global ::env # open log file used to keep track of URLs (for debugging) set dir $env(HOME)/.skycat if {! [file isdirectory $dir]} { catch {mkdir $dir} } set logfile_name_ $dir/log } # open or close a pipe to get feedback during HTTP transfers. # (To save limited fds, we close the feedback pipe after each HTTP op). # The arg should be "on" to turn feedback on, or "off" to turn it off. protected method set_feedback {onoff} { # Process any pending file events. # Note: this is important: if we don't process the events before # closing the feedback file, a crash may result. update if {$itk_option(-debug)} { # if -debug was given, the feedback bit wont work, since the # query is done in the foreground and trying to read the feedback # from the pipe may cause the application to hang... return } if {"$onoff" == "on"} { lassign [pipe] rfd_ wfd_ fileevent $rfd_ readable [code $this feedback] $w_.cat feedback $wfd_ } elseif {[info exists rfd_]} { ::close $rfd_ ::close $wfd_ unset rfd_ wfd_ $w_.cat feedback {} } } # keep an array of instances(name,id) to help locate the # window for a catalog protected method set_instance {} { set name [$w_.cat longname $itk_option(-catalog) $itk_option(-catalogdir)] set id $itk_option(-id) set dirPath $itk_option(-catalogdir) set instance_idx_ "$name,$id,$dirPath" set instances_($instance_idx_) $w_ } # add the menu bar protected method add_menubar {} { TopLevelWidget::add_menubar set m [add_menubutton File "Display File menu"] set file_menu_ $m if {$iscat_} { add_menuitem $m command "Open" \ {Open a local catalog in tab table format} \ -command [code cat::AstroCat::local_catalog \ $itk_option(-id) \ [info class] \ $itk_option(-debug) $w_] \ -accelerator "Control-o" $m add separator add_menuitem $m command "Save as..." \ {Save listed objects to a local catalog file} \ -command [code $this save_as] \ -accelerator "Control-s" add_menuitem $m command "Add to..." \ {Add listed objects to a local catalog file} \ -command [code $this add_to] \ -accelerator "Control-a" add_menuitem $m command "Add selected..." \ {Add selected rows to a local catalog file} \ -command [code $this add_selected] \ -accelerator "Control-A" $m add separator add_menuitem $m command "Print..." \ {Print the listing to a printer or file} \ -command [code $this print] \ -accelerator "Control-p" add_menuitem $m command "Clear" \ {Clear the catalog listing} \ -command [code $this clear] $m add separator } add_menuitem $m command "Close" \ {Close this window} \ -command [code $this close] if {$itk_option(-standalone)} { add_menuitem $m command "Exit" \ {Exit the application} \ -command [code $this quit] \ -accelerator "Control-q" } if {$iscat_} { # Edit menu set m [add_menubutton Edit "Display Edit menu"] set edit_menu_ $m add_menuitem $m command "Remove selected" \ {Remove selected rows from the local catalog} \ -command [code $this remove_selected] \ -state disabled add_menuitem $m command "Enter new object..." \ {Enter the data for a new object for the local catalog} \ -command [code $this enter_new_object] \ -state disabled add_menuitem $m command "Edit selected object..." \ {Edit the data for the selected object in the local catalog} \ -command [code $this edit_selected_object] \ -state disabled } # Options menu set m [add_menubutton Options "Display Options menu"] set options_menu_ $m add_menuitem $m cascade "Set Name Server" \ {Select the name server used to resolve astronomical object names} \ -menu [set ns_menu_ [menu $itk_component(options).m.ns]] if {$iscat_} { add_menuitem $m checkbutton "Use TCS Columns" \ {Display the standard columns used by the ESO TCS (Telescope Control Software)} \ -command [code $this set_tcs_columns] \ -variable $w_.tcs \ -onvalue 1 \ -offvalue 0 $m add separator add_menuitem $m command "Set Sort Columns..." \ {Set options for sorting the query results} \ -command [code $this sort_dialog] \ -state disabled add_menuitem $m command "Hide/Show Columns..." \ {Set options for displaying columns of the query results} \ -command [code $this select_columns] \ -state disabled add_menuitem $m command "Set Search Columns..." \ {Set the list of columns to search by for this catalog} \ -command [code $this set_search_cols] \ -state disabled add_menuitem $m command "Set Plot Symbols..." \ {Set the symbol (color, size, etc.) to use to plot objects} \ -command [code $this set_plot_symbols] \ -state disabled $m add separator } add_menuitem $m command "Proxies..." \ "Define an HTTP proxy server." \ -command [code cat::AstroCat::proxies] check_proxies # add a menu of catalogs ("Data-Servers") add_catalog_menu $w_ $itk_option(-id) [info class] $itk_option(-debug) } # enable or disable some menus protected method set_menu_states {} { $options_menu_ entryconfig "Set Sort Columns..." -state normal $options_menu_ entryconfig "Hide/Show Columns..." -state normal if {[$w_.cat iswcs] || [$w_.cat ispix]} { set state normal } else { set state disabled } $options_menu_ entryconfig "Set Plot Symbols..." -state $state $options_menu_ entryconfig "Set Name Server" -state $state $options_menu_ entryconfig "Use TCS Columns" -state $state # determine states for some menu items if {"[$w_.cat servtype]" == "local"} { set state [set sstate normal] } else { set state [set sstate disabled] # allow user to edit search cols if URL contains "%cond" if {[string first "%cond" [$w_.cat url]] >= 0} { set sstate normal } } $edit_menu_ entryconfig "Remove selected" -state $state $edit_menu_ entryconfig "Enter new object..." -state $state $edit_menu_ entryconfig "Edit selected object..." -state $state $options_menu_ entryconfig "Set Search Columns..." -state $sstate } # add a menubutton with catalog items to the given TopLevelWidget. # # w is the caller's toplevel window (an instance of TopLevelWidget). # # id is an optional unique id to be associated with a new catalog widget. # # classname is the name of the AstroCat subclass to use to create new # catalog widgets (defaults to "AstroCat"). # # debug is a flag is passed from the command line. If true, querries # are run in the foreground, to make debugging easier. # # note: this is defined as a proc rather than a method so that it # can be accessed from outside the class to add the Data-Servers menu public proc add_catalog_menu {w {id ""} {classname AstroCat} {debug 0}} { # save this info so we can update the menu automatically later set catalog_menu_info_($w) \ [code cat::AstroCat::add_catalog_menu $w $id $classname $debug] # add the menu to the caller's menubar set m [$w add_menubutton "Data-Servers" "Display Data Servers menu"] $w add_menuitem $m cascade "Catalogs" \ {Select a catalog from the menu} \ -menu [menu $m.catalogs] fill_catalog_menu $w $id $classname $m.catalogs $debug catalog $w add_menuitem $m cascade "Image Servers" \ {Select an image server from the menu} \ -menu [menu $m.imagesvr] fill_catalog_menu $w $id $classname $m.imagesvr $debug imagesvr $w add_menuitem $m cascade "Archives" \ {Select an archive from the menu} \ -menu [menu $m.archive] fill_catalog_menu $w $id $classname $m.archive $debug archive $w add_menuitem $m cascade "Local Catalogs" \ {Select a local catalog from the menu} \ -menu [menu $m.local] fill_catalog_menu $w $id $classname $m.local $debug local shortname $m.local add separator $w add_menuitem $m.local command "Load from file..." \ {Open a local catalog file} \ -command [code cat::AstroCat::local_catalog $id $classname $debug $w] \ -accelerator "Control-O" # clear the local catalogs (handy when many local catalogs have been # opened). $w add_menuitem $m.local command "Clear local catalogs" \ {Clear all local catalogs from the list} \ -command [code clear_local_catalogs] $m add separator $w add_menuitem $m command "Browse Catalog Directories..." \ "Browse the catalog directory hierarchy to view \ catalogs or add them to the default list" \ -command [code cat::AstroCat::catalog_directory $id $classname $debug $w] \ -accelerator "Control-b" $w add_menuitem $m command "Reload config file..." \ "Reload the default catalog config file after it was edited by hand" \ -command [code cat::AstroCat::reload_config_file $w] \ -accelerator "Control-R" # if there is a local catalog called "history", add it to the menu also if {"[$astrocat_ servtype history]" == "local"} { $m add separator $w add_menuitem $m command "History..." \ "Open an automatically generated catalog of previously viewed images" \ -command [code cat::AstroCat::select_catalog history local $id $classname 0 $debug $w] \ -accelerator "Control-h" } } # reload the default catalog config file using the given astrocat object public proc reload_config_file {w} { global ::env set config_file $env(HOME)/.skycat/skycat.cfg if {[file exists $config_file]} { set env(CATLIB_CONFIG) "file:$config_file" } if {[catch {$astrocat_ reload} msg]} { error_dialog $msg $w } # make sure these windows are updated catch {destroy $w_.symconf} catch {destroy $w_.searchconf} if {[winfo exists .catinf]} { .catinf reinit_tree } if {[info exists instances_]} { foreach i [array names instances_] { $instances_($i) update_search_options } } update_catalog_menus } # Check for a file ~/.skycat/proxies, once each session, and # use it to initialize environment variables for a proxy server # (see also tclutil/util/src/HTTP.C). public proc check_proxies {} { global ::env # only do it once if {$checked_proxies_} { return } cat::ProxyDialog::check_proxies $env(HOME)/.skycat/proxies set checked_proxies_ 1 } # Pop up a dialog to set or change the HTTP proxy server. public proc proxies {} { global ::env utilReUseWidget ProxyDialog .proxy \ -configfile $env(HOME)/.skycat/proxies } # pop up a window to browse the catalog directories. # # id is an optional unique id to be associated with a new catalog widget. # # classname is the name of the AstroCat subclass to use to create new # catalog widgets (defaults to "AstroCat"). # # debug is a flag is passed from the command line. If true, querries # are run in the foreground, to make debugging easier. # # w should be the caller's top level window, if specified. # proc catalog_directory {{id ""} {classname AstroCat} {debug 0} {w ""}} { utilReUseWidget cat::CatalogInfo .catinf \ -id $id \ -classname $classname \ -debug $debug \ -callerw $w \ -command [code cat::AstroCat::update_catalog_menus] # put the window clone number in the title if {[winfo exists $w]} { catch {wm title .catinf "Catalog Directory ([$w cget -number])"} } } # update all of the catalog menus in all instances to show # the current catalog info. public proc update_catalog_menus {} { foreach i [array names catalog_menu_info_] { if {[winfo exists [utilNamespaceTail $i]]} { eval $catalog_menu_info_($i) } } } # pop up a dialog to set the plot symbols to use for this catalog public method set_plot_symbols {} { set columns $headings_ if {[llength $columns] == 0} { info_dialog "Please make a query first so that the column names are known" $w_ return } utilReUseWidget cat::SymbolConfig $w_.symconf \ -catalog $itk_option(-catalog) \ -astrocat [code $w_.cat] \ -columns $columns \ -command [code $this plot] } # pop up a dialog to set the search columns to use for this catalog public method set_search_cols {} { set columns $headings_ if {[llength $columns] == 0} { info_dialog "Please make a query first so that the column names are known" $w_ return } utilReUseWidget cat::SearchConfig $w_.searchconf \ -catalog $itk_option(-catalog) \ -command [code $this update_search_options] \ -astrocat [code $w_.cat] \ -columns $columns } # update the search option entries after they have been edited public method update_search_options {} { $searchopts_ update_search_options } # close this window public method close {} { if {$itk_option(-standalone)} { wm iconify $w_ } else { wm withdraw $w_ } } # pop up a dialog to sort the list public method sort_dialog {} { $results_ sort_dialog } # called when the user has selected columns to sort the results by. # The first arg is the sort columns, the second arg is the order # (increasing, decreasing) public method set_sort_cols {sort_cols sort_order} { global ::$w_.tcs if {"[$w_.cat sortcols]" != "$sort_cols" \ || "[$w_.cat sortorder]" != "$sort_order"} { $w_.cat sortcols $sort_cols $w_.cat sortorder $sort_order $w_.cat is_tcs $itk_option(-catalog) [set $w_.tcs] cat::CatalogInfo::save {} $w_ 0 $results_ config -sort_cols $sort_cols -sort_order $sort_order search } } # pop up a dialog to select table columns to display public method select_columns {} { $results_ select_columns } # called when the user has selected columns to show public method set_show_cols {cols} { global ::$w_.tcs set show [$w_.cat showcols] if {"$show" == ""} { set show [$results_ get_headings] } if {"$show" != "$cols"} { $w_.cat showcols $cols $w_.cat is_tcs $itk_option(-catalog) [set $w_.tcs] cat::CatalogInfo::save {} $w_ 0 } } # add the name server catalogs to the name server menu protected method get_name_servers {} { set m $ns_menu_ if {[catch {set list [$w_.cat info namesvr]} msg]} { error_dialog $msg $w_ return } foreach namesvr $list { $m add radiobutton \ -label $namesvr \ -command [code $this set_namesvr $namesvr] \ -variable $m } if {![info exists namesvr]} { error_dialog "No default name server found for astronomical objects" return } # set default name server global ::$m set $m $namesvr set_namesvr $namesvr } # toggle the TCS option (use the tcscat or the astrocat Tcl command) public method set_tcs_columns {} { global ::$w_.tcs set is_tcs [set $w_.tcs] set itk_option(-tcs) $is_tcs catch {$w_.cat delete} if {$is_tcs} { tcscat $w_.cat } else { astrocat $w_.cat } if {[catch {$w_.cat open $itk_option(-catalog) $itk_option(-catalogdir)} msg]} { error_dialog $msg $w_ return } set iscat_ 1 # if changing formats, reset table column info and entry # since column names will change making previous info invalid if {[$w_.cat is_tcs] != $is_tcs} { $w_.cat is_tcs $itk_option(-catalog) $is_tcs set reset_columns_ 1 } if {[llength $headings_]} { search } } # reset table dialogs if needed public method reset_table {} { $results_ reset $results_ set_options {MORE PREVIEW more preview} Show 0 $w_.cat showcols {} $w_.cat sortcols {} cat::CatalogInfo::save {} $w_ 0 } # return true if the given file contains a TCS catalog public proc is_tcs_catalog {filename} { if {[catch {set f [open $filename]}]} { return 0 } set title [gets $f] ::close $f if {[string match "Tcs*" $title]} { return 1 } return 0 } # clear the table listing public method clear {} { catch {$results_ clear} } # pop up a dialog to print the table listing public method print {} { $results_ print_dialog } # Ask the user for the name of a local catalog file and then # open a window for the catalog. # # id is an optional unique id to be associated with a new catalog widget. # # classname is the name of the AstroCat subclass to use to create new # catalog widgets (defaults to "AstroCat"). # # $debug is a flag set from the command line arg. # # $w should be the top level window of the caller, if specified. public proc local_catalog {{id ""} {classname AstroCat} {debug 0} {w ""}} { set file [filename_dialog [pwd] *] if {"$file" != ""} { if {[file isfile $file]} { if {[catch {$astrocat_ check $file} msg]} { error_dialog $msg } else { select_catalog $file local $id $classname \ [is_tcs_catalog $file] $debug $w } } else { error_dialog "There is no file named '$file'" } } } # Fill up a menu of known data servers to choose from. # # w is the caller's top level widget (containing menubar) # # id is an optional unique id to be associated with a new catalog widget. # # classname is the name of the AstroCat subclass to use to create new # catalog widgets (defaults to "AstroCat"). # # $debug is a flag set from the command line arg. # # The serv_type argument should be one of: "catalog", "archive". # # An optional "cmd" argument may be set to longname or shortname # depending on the names you want in the menu (for local catalogs, # specify shortname, to avoid getting the complete path name in # the menu. public proc fill_catalog_menu {w id classname m debug serv_type {cmd longname}} { if {[catch {set catalog_list [lsort [$astrocat_ info $serv_type]]} msg]} { error_dialog $msg $w return } if {[llength $catalog_list]} { foreach i $catalog_list { set name [$astrocat_ $cmd $i] set is_tcs [$astrocat_ is_tcs $i] $w add_menuitem $m command $name \ "Open $serv_type: \"$i\"" \ -command [code cat::AstroCat::select_catalog $i $serv_type $id \ $classname $is_tcs $debug $w] } } } # Open a window for the given catalog, or report an error if the catalog # does not exist. # $name is the name of the catalog to open, # $classname is the class to use to open it, # $debug is an optional debugging flag, # $w should be set to the top level window of the caller (optional). public proc open_catalog_window {name {id ""} {classname AstroCat} {debug 0} {w ""}} { if {[catch {$astrocat_ open $name} msg]} { error_dialog $msg } cat::AstroCat::select_catalog $name catalog $id $classname 0 $debug $w } # save the current data to a local catalog public method save_as {} { $results_ save_as } # add the rows in the current listing to a local catalog file public method add_to {} { $results_ add_to } # add the currently selected rows to a local catalog file public method add_selected {} { $results_ add_selected } # remove the currently selected rows from a local catalog file public method remove_selected {} { $results_ remove_selected # update the display clear search } # pop up a dialog to enter the data for a new object for a local catalog public method enter_new_object {} { $results_ enter_new_object [code $this search] } # pop up a window so that the user can edit the selected object(s) public method edit_selected_object {} { $results_ edit_selected_object [code $this search] } # open the catalog for this window public method open_catalog {} { # create astrocat object (or tcscat if TCS catalog) global ::$w_.tcs if {[set $w_.tcs $itk_option(-tcs)]} { tcscat $w_.cat } else { astrocat $w_.cat } # normally -catalog should be specified when creating this widget # if not, choose a default... if {"$itk_option(-catalog)" == ""} { return # if {[catch {set catalog_list [$w_.cat info $itk_option(-catalogtype)]} msg]} { # error_dialog $msg $w_ # return # } # set itk_option(-catalog) [lindex $catalog_list [expr [llength $catalog_list]-1]] } # open the catalog set name $itk_option(-catalog) if {[catch {$w_.cat open $name $itk_option(-catalogdir)} msg]} { error_dialog $msg $w_ return -code error } # set iscat_ to true if the catalog is not an image server set iscat_ 1 if {"[$w_.cat servtype]" == "imagesvr"} { set iscat_ 0 } # if this is a local catalog, add it to the catalog menus and tree # XXX should check if local catalog was already known if {"[$w_.cat servtype]" == "local"} { update_catalog_menus # add to catalog tree, if there is one catch {.catinf insert_node $name} # add an entry to the config file for this catalog cat::CatalogInfo::save "" $w_ 0 } # display catalog name in header and icon wm title $w_ "[$w_.cat longname $name $itk_option(-catalogdir)] ($itk_option(-number))" wm iconname $w_ "[$w_.cat shortname $name $itk_option(-catalogdir)]" } # add the search options panel protected method add_search_options {} { # AstroQuery(n) widget for displaying catalog search options. itk_component add searchopts { set searchopts_ [AstroQuery $w_.searchopts \ -relief groove \ -borderwidth 2 \ -debug $itk_option(-debug) \ -astrocat [code $w_.cat] \ -searchcommand [code $this search] \ -feedbackcommand [code $this set_feedback] \ -command [code $this query_done]] } pack $itk_component(searchopts) \ -side top -fill x } # add the table for displaying the query results protected method add_result_table {} { # QueryResult(n) widget to display catalog query results itk_component add results { set results_ [QueryResult $w_.results \ -astrocat [code $w_.cat] \ -title "Search Results" \ -hscroll 1 \ -height 12 \ -sortcommand [code $this set_sort_cols] \ -layoutcommand [code $this set_show_cols] \ -selectmode extended \ -exportselection 0] } { } pack $itk_component(results) -side top -fill both -expand 1 bind $results_.listbox [code $this select_result_row] $results_ set_options {MORE PREVIEW more preview} Show 0 } # add the dialog button frame protected method add_dialog_buttons {} { # dialog buttons pack [frame $w_.buttons -borderwidth 2 -relief raised] \ -side top -fill x if {$iscat_} { set search_label "Search" } else { set search_label "Get Image" } pack \ [button $w_.search \ -text $search_label \ -command [code $this search]] \ -side left -expand 1 -pady 2m -in $w_.buttons if {$iscat_} { pack \ [button $w_.more \ -text "More Info" \ -state disabled \ -command [code $this more]] \ [button $w_.preview \ -text "Preview" \ -state disabled \ -command [code $this preview]] \ -side left -expand 1 -pady 2m -in $w_.buttons } pack \ [button $w_.stop \ -text "Stop" \ -state disabled \ -command [code $this interrupt]] \ [button $w_.close \ -text "Close" \ -command [code $this close]] \ -side left -expand 1 -pady 2m -in $w_.buttons # add a help button, if there is a help URL if {"[$w_.cat help]" != ""} { pack \ [button $w_.help \ -text "Help" \ -command [code $this help]] \ -side left -expand 1 -pady 2m -in $w_.buttons -before $w_.close } } # disable the search button, if the arg is 1, otherwise enable it public method disable_search {{arg 1}} { if {$arg} { set search_state_ disabled } else { set search_state_ normal } } # if the catalog has a "help" URL, try to display it in netscape using the # netscape remote interface. public method help {} { set url [$w_.cat help] if {"$url" != ""} { send_to_netscape $url } else { info_dialog "Sorry, no help is available for this catalog" } } # add a progress bar to display the progress of data transfers protected method add_progress_bar {} { # add a progress bar at the botton pack [ProgressBar $w_.progress] \ -side top -fill x } # do the dialog window layout protected method layout_dialog {} { open_catalog add_menubar add_search_options get_name_servers if {$iscat_} { add_result_table } add_dialog_buttons add_progress_bar } # add a short help window and set the help texts protected method make_short_help {} { TopLevelWidget::make_short_help add_short_help $results_ \ {Query results: {bitmap b1} = select object, \ double click {bitmap b1} = label object, \ {bitmap dragb2} = scroll list} if {$iscat_} { add_short_help $w_.search \ {{bitmap b1} = start catalog search} add_short_help $w_.preview \ {{bitmap b1} = view the preview image or plot data for the selected object} add_short_help $w_.more \ {{bitmap b1} = display more information for the selected object} } else { add_short_help $w_.search \ {{bitmap b1} = fetch the image from the image server} } add_short_help $w_.stop \ {{bitmap b1} = interrupt the current catalog operation} if {[winfo exists $w_.help]} { add_short_help $w_.help \ {{bitmap b1} = Display help information for catalog in netscape} } add_short_help $w_.close {{bitmap b1} = close this window} add_short_help $w_.progress {Progress bar: displays status of work in progress} } # This proc is called when the named catalog selected from the menu. # # serv_type is the type of the catalog: one of: catalog, archive, # local, imagesvr, etc... # # id is an optional unique id to be associated with a new catalog widget. # # classname is the name of the AstroCat subclass to use to create new # catalog widgets (defaults to "AstroCat"). # # tcs_flag can be set to true, if you know it is a TCS catalog. # # $debug is a flag set from the command line arg. # # $w should be the top level window of the caller (optional). public proc select_catalog {name serv_type id classname {tcs_flag 0} {debug 0} {w ""}} { new_catalog $name $id $classname $debug $tcs_flag "catalog" $w } # set the name server to use to resolve object names public method set_namesvr {name} { $searchopts_ config -namesvr $name } # interrupt the current search public method interrupt {} { $w_.batch interrupt $searchopts_ interrupt set_feedback off catch {$results_ config -title "Search Results"} set_state normal } # set/reset widget states while busy public method set_state {state} { set state_ $state if {"$state" == "normal"} { catch {blt::busy release $w_.options} catch {focus -lastfor $w_.options} $w_.search config -state $search_state_ $w_.stop config -state disabled } else { catch {focus .} catch {blt::busy hold $w_.options} $w_.search config -state disabled catch { $w_.more config -state disabled $w_.preview config -state disabled } $w_.stop config -state normal } update idletasks $w_.progress reset } # this method is called by the fileevent handler during the data transfer # from the HTTP C++ class to give the user feedback about how much there is # left to copy, etc... # Read a line from the feedback pipe, which should contain text to be displayed # in the progress widget. # # When we are in busy (disabled, waiting) mode, we also interpret some special # messages, such as: "total length: n bytes" to update the progress bar. public method feedback {} { set text [gets $rfd_] if {"$state_" != "normal"} { if {[scan $text {total length: %d bytes} n] == 1} { $w_.progress config -to $n } elseif {[scan $text {read %d bytes} n] == 1} { $w_.progress config -value $n } elseif {[scan $text {url: %s} url] == 1} { catch { set fd [open $logfile_name_ a+] puts $fd "[clock format [clock seconds]]\n$itk_option(-catalog)\n$url\n\n" ::close $fd } } } $w_.progress config -text $text update idletasks } # This method could be used by a plugin to set the contents of the listing # without doing a query. # The arguments are the table headings (list of strings) and the table data # (list of rows, where each row is a list of values). The "more" flag is # optional and indicates that there would be more data. public method set_info {headings info {more 0}} { query_done "" $headings $info $more } # This method is called when the background query is done. # # Args: # # errmsg - If this is not empty, it contains an error message and # the following args should be ignored. If there were no # errors, this arg is an empty string. # # headings - are the column headings # # info - is a list of rows (result of query) # # more - is a flag set to 1 if there were more rows available that were # not returned due to the maxrows limit set. public method query_done {errmsg headings info more} { if {"$errmsg" != ""} { # check if we need user/passwd info. errmsg should have the format: # "Authorization Required for at " if {[regsub {Authorization Required} $errmsg {Enter username} msg]} { lassign [passwd_dialog $msg] username passwd if {"$username" != "" && "$passwd" != ""} { lassign $errmsg {} {} {} realm {} host $w_.cat authorize $username $passwd $realm $host $searchopts_ search } } else { set_state normal catch {$results_ config -title "Search Results"} # error messages starting with "***" are only displayed in progress win if {"[string range $errmsg 0 2]" != "***"} { error_dialog $errmsg $w_ } after 0 [list $w_.progress config -text $errmsg] } } else { if {! $iscat_} { # for image servers, the info is the image file name set filename $info # load the image and remove the temp file display_image_file $filename if { $tempimage_ != {} } { catch {file delete $tempimage_} } set tempimage_ $filename } else { busy { set prev_headings $headings_ set headings_ $headings set info_ $info # update table $results_ config -headings $headings_ if {$reset_columns_} { set reset_columns_ 0 reset_table } if {"$prev_headings" != "$headings_"} { $results_ update_options set_menu_states } $results_ config -info $info # need to know the equinox of the results, if using world coords if {[$w_.cat iswcs]} { lassign [$w_.searchopts get_pos_radius] {} {} equinox $results_ config -equinox $equinox } if {$more} { set more "+" } else { set more "" } $results_ config -title "Search Results ([$results_ total_rows]$more)" # note column indexes in array (use upper case to simplify search) catch {unset col_} set n -1 foreach i $headings_ { set col_($i) [incr n] } # plot stars #puts "plot time: [expr [lindex [time plot] 0]/1000000.]" plot } } set_state normal } } # start the catalog search based on the current search options # and display the results in the table. public method search {args} { # start the query in the background catch { $results_ config -title "Searching..." $results_ clear } set_state disabled set servtype [$w_.cat servtype] if {"$servtype" == "local"} { $w_.progress config -text "Searching catalog..." } elseif {"$servtype" == "imagesvr"} { $w_.progress config -text "Attempting to contact image server..." } else { $w_.progress config -text "Attempting to contact catalog server..." } $w_.progress look_busy $searchopts_ search } # Get the requested image from the image server based on the given arguments # for the world coord position or name and the given width and height public method getimage_from_args {ra dec name equinox width height} { $searchopts_ set_pos_width_height [list $ra $dec $equinox $width $height $name] search } # If the given name is the name of a local catalog, check that the file exists, # and if not, ask the user for a new path name or remove it from the menu. public proc check_local_catalog {name {id ""} {classname AstroCat} {debug 0} {tcs_flag 0} {type "catalog"} {w ""} {dirPath ""}} { if {"[$astrocat_ servtype $name $dirPath]" != "local"} { return 0 } set file [$astrocat_ url $name] if {[file isfile $file]} { return 0 } set msg "The catalog file [file tail $file] does not exists. \ Do you want to specify a new name?" switch [choice_dialog $msg {{Specify a new name} Cancel {Remove from menu}}] { {Specify a new name} { set file [filename_dialog] if {[file isfile $file]} { $astrocat_ entry remove $name new_catalog $file $id $classname $debug $tcs_flag $type $w $dirPath if {[winfo exists .catinf]} { .catinf reinit_tree } } } Cancel { return 1 } {Remove from menu} { $astrocat_ entry remove $name if {[winfo exists .catinf]} { .catinf reinit_tree } } } # update config file and menus cat::CatalogInfo::save "" $w 0 update_catalog_menus return 1 } # remove all local catalogues from the list. public proc clear_local_catalogs {} { if {[catch {set catalog_list [lsort [$astrocat_ info local]]} msg]} { error_dialog $msg return } if {[llength $catalog_list]} { foreach i $catalog_list { set name [$astrocat_ longname $i] $astrocat_ entry remove $name } cat::CatalogInfo::save "" "" 0 update_catalog_menus } } # set the values for the position and radius entries from the given # list, which should be in the format {ra dec equinox radius} if # we are using wcs, otherwise {x y radius}. public method set_pos_radius {list} { $searchopts_ set_pos_radius $list } # set the values for the position, width and height entries from # the given list, which should be in the format # {ra dec equinox width height (in arcmin)} for wcs, or {x y width height}, # for pixel coordinates. public method set_pos_width_height {list} { $searchopts_ set_pos_width_height $list } # This method is called whenever a result row is selected. # Note the selected values and enable/disable some buttons public method select_result_row {} { $w_.results select_result_row if {! [info exists col_(PREVIEW)] && ! [info exists col_(MORE)]} { return } set row [lindex [$results_ get_selected] 0] if {[llength $row] == 0} { return } set preview [get_col PREVIEW $row] set more [get_col MORE $row] set object_name_ [lindex $row 0] # note: HST returns P=http:.... if {! [regsub {P=(.*)} $preview {\1} preview_url_]} { set preview_url_ $preview } if {"$preview_url_" == ""} { $w_.preview config -state disabled } else { $w_.preview config -state normal } # note: HST returns M=http:.... if {! [regsub {M=(.*)} $more {\1} more_url_]} { set more_url_ $more } if {"$more_url_" == ""} { $w_.more config -state disabled } else { $w_.more config -state normal } } # assuming there is a field called "preview" that is the URL of an # image, get the image or table data for the selected line over HTTP # and display it # # The preview data may be an image or other data, such as a tab table to # display as a graph (like the "cuts" (RtdImageSpectrum) graph). public method preview {} { if {[$results_ num_selected] == 0} { warning_dialog "Please select an object from the list first" $w_ return } if {! [info exists col_(PREVIEW)]} { warning_dialog "Previewing is not supported for this catalog" $w_ return } if {"$preview_url_" == ""} { warning_dialog "No preview for this object" $w_ return } # if it is a file URL, we can just get the file if {[string first file: $preview_url_] == 0} { set filename [string range $preview_url_ 5 end] preview_done 0 [list $filename image/x-fits] } else { # HTTP: do it in the background, since it may take a while set_state disabled $w_.progress config -text "Attempting to contact server..." $w_.progress look_busy # set up the feedback pipe set_feedback on $w_.batch bg_eval [code $this get_preview] } } # get the preview image given by $preview_url_ into a temp file protected method get_preview {} { # get the preview and call preview_done $w_.cat getpreview -url $preview_url_ } # This method is called when we have received the preview data # The "status" argument is the status of the background http get operation (0 if ok). # The result is a list of {filename Content-type}, where filename contains the data # and Content-type indicates the type of the preview data. Decompression is already # taken care of, so we only expect to get a FITS image here or a tab table to plot. # # If we get an authorization error, we ask the user to type in a username and # password and retry the operation with the new info. This is needed for some # HTTP server sites that have special restrictions on data access (especially # image access). protected method preview_done {status result} { set_feedback off if {$status} { # check if we need user/passwd info. errmsg should have the format: # "Authorization Required for at " if {[regsub {Authorization Required} $result {Enter username} msg]} { lassign [passwd_dialog $msg] username passwd if {"$username" != "" && "$passwd" != ""} { lassign $result {} {} {} realm {} host $w_.cat authorize $username $passwd $realm $host preview } } else { error_dialog $result $w_ } } else { if {[llength $result] != 2} { error_dialog "error getting preview data (result = $result)" } else { lassign $result filename type if {"$type" == "image/x-fits"} { # load the image and remove the temp file display_image_file $filename } elseif {"$type" == "text/tab-separated-values" \ || "$type" == "text/x-starbase" \ || "$type" == "text/plain" \ || "$type" == ""} { PreviewPlot $w_.pplot[incr count_] \ -file $filename \ -name $object_name_ \ -shorthelpwin $this \ -transient 1 } else { error_dialog "unrecognized Content-type for preview data: $type" } if {[string first file: $preview_url_] != 0} { # if the image was retrieved via http, remove it catch {file delete $filename} } } } set_state normal # restore preview button state... select_result_row } # send a URL to be displayed by netscape public proc send_to_netscape {url} { if {[catch {exec netscape -remote "openURL($url)"} msg1]} { if {! [string match $msg1 "netscape: warning"]} { if {[catch {exec netscape $url &} msg2]} { warning_dialog "couldn't start netscape: $msg1" } else { info_dialog "Starting netscape..." } } } else { info_dialog "Sending help URL to netscape..." } } # use the "more" URL to display more info about an object using netscape # or mosaic public method more {} { if {[$results_ num_selected] == 0} { warning_dialog "Please select an object from the list first" $w_ return } if {"$more_url_" == ""} { warning_dialog "No more information is available for this object" $w_ return } # start netscape $w_.progress config -text "sending URL to netscape..." update idletasks send_to_netscape $more_url_ } # return the value for the given column name in the given row public method get_col {name row} { if {[info exists col_($name)]} { return [lindex $row $col_($name)] } } # This member proc is used to open a window for the named catalog, # or reuse the existing one for the catalog, if it is already open. # # name is the long name of catalog from config file # # id is an optional unique id to be associated with a new catalog widget. # # classname is the name of the AstroCat subclass to use to create new # catalog widgets (defaults to "AstroCat"). # # debug is a flag: if true, run queries in foreground # # tcs_flag may be set to true if the catalog is TCS format # # type is the catalog serv_type (here it is enough to specify "catalog" or # "imagesvr". # # w should be the top level window of the caller, if specified. # # dirPath may be the name of the catalog directory (or a tcl list forming # the path to it). The default is the root catalog directory. public proc new_catalog {name {id ""} {classname AstroCat} {debug 0} {tcs_flag 0} {type "catalog"} {w ""} {dirPath ""}} { # if it is a local catalog, make sure it exists still, or get a new name if {[check_local_catalog $name $id $classname $debug $tcs_flag $type $w $dirPath] != 0} { return } set i "$name,$id,$dirPath" if {[info exists instances_($i)] && [winfo exists $instances_($i)]} { utilRaiseWindow $instances_($i) if {"[$instances_($i).cat servtype]" == "local"} { # for local catalogs, search automatically when opened $instances_($i) search } return } # If $w was specified, put the window under that top level window # so we get the window numbers right (for cloning, see TopLevelWidget). if {[winfo exists $w]} { set instname $w.ac[incr n_instances_] } else { set instname .ac[incr n_instances_] } set instances_($i) \ [$classname $instname \ -id $id \ -debug $debug \ -catalog $name \ -catalogtype $type \ -catalogdir $dirPath \ -tcs $tcs_flag \ -transient 0 \ -center 0] } # Return a Tcl list of instances of this class. By default # (and for backward compatibility) only catalog windows are # included - not image servers. If "choice" is "all", then # all instances are returned. If choice is imagesvr, only # image server windows are returned. public proc instances {{choice catalogs}} { set list {} if {[info exists instances_]} { foreach i [array names instances_] { if {[winfo exists $instances_($i)]} { if {[$instances_($i) iscat]} { # instance of a catalog window if {"$choice" == "catalogs" || "$choice" == "all"} { lappend list $instances_($i) } } else { # instance of an image server window if {"$choice" == "imagesvr"} { lappend list $instances_($i) } } } } } return $list } # Return the widget instance for the given catalog, if found, # otherwise an empty string public proc get_instance {catalog} { foreach w [cat::AstroCat::instances all] { if {"[$w cget -catalog]" == "$catalog"} { return $w } } } # Return 1 if this window is for a searchable catalog, # and 0 otherwise (in which case it must be an image server window). public method iscat {} { return $iscat_ } # --------------------------------------------------------------- # The following methods deal with images and plotting of objects # in an image and are meant to be defined in a derived class. # See the skycat/skycat/interp/library/SkySearch.tcl for an example. # --------------------------------------------------------------- # plot the stars/objects found in the previous search in a (image) window. # The symbols to use are taken from the config file. # (To be defined in a subclass) public method plot {} { } # display the given image file (To be defined in a subclass) public method display_image_file {filename} { } # return the equinox public method get_equinox {} { return [component searchopts get_equinox] } # return the name of the TableList public method get_table {} { if {[info exists itk_component(results)]} { return $itk_component(results) } error "This catalog is an image server" } # -- options -- # name of catalog itk_option define -catalog catalog Catalog "" { # make sure we use full path name for local catalogs set f $itk_option(-catalog) if {[file exists $f] && "[string index $f 0]" != "/"} { set itk_option(-catalog) [pwd]/$f } } # type of catalog (catalog or archive) itk_option define -catalogtype catalogType CatalogType "catalog" # name of catalog directory, or a tcl list forming the path to it (empty means root) itk_option define -catalogdir catalogDir CatalogDir "" # Optional unique id, used in searching for already existing catalog widgets. itk_option define -id id Id "" # list of catalog column headings (from results of most recent query) protected variable headings_ {} # result from most recent query (list of rows) protected variable info_ {} # font to use for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # font to use for values itk_option define -valuefont valueFont ValueFont TkDefaultFont # font to use for ra,dec labels itk_option define -wcsfont wcsFont WcsFont {Symbol -14} # set the width for displaying labels itk_option define -labelwidth labelWidth LabelWidth 12 # set the anchor for labels itk_option define -anchor anchor Anchor e # flag: if true, run queries in foreground for better debugging itk_option define -debug debug Debug 0 # if -tcs is 1, use fixed format TCS catalog listings itk_option define -tcs tcs Tcs {0} # AstroQuery widget used to manage search options protected variable searchopts_ {} # QueryResult widget used to display search results protected variable results_ {} # array(uppercase col name) of col index from catalog headings protected variable col_ # preview URLs for selected object protected variable preview_url_ {} # more-info URLs for selected object protected variable more_url_ {} # pipe to read feedback during HTTP transfer protected variable rfd_ # pipe to write feedback during HTTP transfer protected variable wfd_ # current state: normal, disabled (i.e.: waiting) protected variable state_ {normal} # log file handle (used to log URLs) protected variable logfile_name_ # flag: set at end of constructor protected variable initialized_ 0 # index of this object in the instances_ array protected variable instance_idx_ {} # name of File menu widget protected variable file_menu_ # name of Edit menu widget protected variable edit_menu_ # name of Options menu widget protected variable options_menu_ # name of Name Server menu widget protected variable ns_menu_ # flag: set when the column headings are changed between TCS and normal protected variable reset_columns_ {0} # currently selected object (Id field in row) protected variable object_name_ {} # count used for filename generation protected variable count_ 0 # flag: true if catalog is not an image server protected variable iscat_ 1 # flag: true if searching is allowed protected variable search_state_ normal # name of temporary image file, deleted when new image is # obtained, or when object destroyed. protected variable tempimage_ {} # -- common variables (common to all instances of this class) -- # C++ astrocat object used by static member procs protected common astrocat_ [astrocat ::cat::.astrocat] # array mapping catalog name to widget/class name protected common instances_ # instance count protected common n_instances_ 0 # current instance name protected common current_instance_ {} # array(TopLevelWidget instance) of command used to update the # Data-Servers menu. This is used to make it posible to update # all instances of this menu in various top level windows. protected common catalog_menu_info_ # flag: set to 1 after we checked for a proxy server protected common checked_proxies_ 0 } skycat-3.1.2-starlink-1b/cat/library/AstroImage.tcl000066400000000000000000000571631215713201500221230ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: AstroImage.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # AstroImage.tcl - user interface class for accessing image servers # such as DSS (Digitized Sky Survey) # # See man page AstroImage(1) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 11 Oct 95 created itk::usual AstroImage {} # AstroImage is a user interface class for accessing image servers # such as DSS (Digitized Sky Survey). itcl::class cat::AstroImage { inherit util::TopLevelWidget # constructor constructor {args} { eval itk_initialize $args } # called after options have been evaluated protected method init {} { global ::env if {"$itk_option(-image)" == ""} { error_dialog "Can't create AstroImage widget: no skycat image widget was specified" destroy $w_ return } wm title $w_ "Image Servers ($itk_option(-number))" # set the file used to keep track of URLs (for debugging) set_logfile # do window layout layout_dialog # set up feedback for HTTP ##set_feedback on # add a short help window make_short_help # create an object for running interruptable batch image requests Batch $w_.batch \ -command [code $this request_done] \ -debug $itk_option(-debug) set initialized_ 1 config -image $itk_option(-image) } # destructor - delete C++ based objects so that the temp image # files are deleted destructor { catch {$w_.im delete} catch {file delete $itk_option(-tmpfile)} ##set_feedback off } # add the menu bar protected method add_menubar {} { TopLevelWidget::add_menubar set m [add_menubutton File] add_menuitem $m command "Close" \ {Close this window} \ -command [code $this quit] set m [add_menubutton Options] add_menuitem $m cascade "Name Server" \ {Select the name server used to resolve astronomical object names} \ -menu [set ns_menu [menu $itk_component(options).m.ns]] get_name_servers $ns_menu # ImageServers menu set m [add_menubutton ImageServers] fill_imagesvr_menu $m imagesvr } # Fill up a menu of known data servers to choose from. # The serv_type argument should be one of: "catalog", "archive", "imagesvr". public method fill_imagesvr_menu {m {serv_type "imagesvr"}} { if {[catch {set imagesvr_list [lsort [$w_.im info $serv_type]]} msg]} { error_dialog $msg $w_ return } if {[llength $imagesvr_list]} { foreach i $imagesvr_list { add_menuitem $m command $i \ "Open $serv_type: \"$i\"" \ -command [code $this select_imagesvr $i] } } } # called when an imagesvr ($name) is selected from the menu. public method select_imagesvr {name} { cat::AstroImage::new_imagesvr $name $itk_option(-image) $itk_option(-debug) } # create the ~/.skycat dir if it does not already exists and keep a log # file there. protected method set_logfile {} { global ::env # open log file used to keep track of URLs (for debugging) set dir $env(HOME)/.skycat if {! [file isdirectory $dir]} { catch {mkdir $dir} } set logfile_name_ $dir/log } # quit and close the window public method quit {} { if {$itk_option(-standalone)} { destroy $w_ } else { wm withdraw $w_ } } # add the name server catalogs to the given menu public method get_name_servers {m} { if {[catch {set list [$w_.im info namesvr]} msg]} { error_dialog $msg $w_ return } foreach namesvr_ $list { $m add radiobutton \ -label $namesvr_ \ -command [code $this set_namesvr $namesvr_] \ -variable $m } # set default name server global ::$m set $m $namesvr_ } # do the dialog window layout protected method layout_dialog {} { # create astroimage object astroimage $w_.im add_menubar pack [frame $w_.main] \ -side top -fill both pack [frame $w_.main.top -relief groove -borderwidth 2] \ -side top -fill x pack [set f [frame $w_.main.top.f -relief groove -borderwidth 2]] \ -side top -fill x -pady 1m blt::blttable $f blt::blttable $f \ [set name_ [LabelEntry $f.name \ -text "Object Name:" \ -command [code $this getimage] \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -anchor e \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ 0,0 -fill x -pady 1m \ [set equinox_ [LabelEntry $f.equinox \ -text "Equinox:" \ -autoselect 1 \ -value "J2000" \ -command [code $this getimage] \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -anchor e \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ 0,1 -fill x -pady 1m \ [set ra_ [LabelEntry $f.ra \ -text "a:" \ -autoselect 1 \ -command [code $this getimage] \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -anchor e \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-wcsfont)]] \ 1,0 -fill x -pady 1m \ [set dec_ [LabelEntry $f.dec \ -text "d:" \ -autoselect 1 \ -command [code $this getimage] \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -anchor e \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-wcsfont)]] \ 1,1 -fill x -pady 1m \ [set width_ [LabelEntry $f.width \ -text "Width in" \ -command [code $this getimage] \ -labelwidth [expr $itk_option(-labelwidth)-3] \ -valuewidth $itk_option(-valuewidth) \ -anchor e \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ 2,0 -fill x -pady 1m \ [set height_ [LabelEntry $f.height \ -text "Height in" \ -command [code $this getimage] \ -labelwidth [expr $itk_option(-labelwidth)-3] \ -valuewidth $itk_option(-valuewidth) \ -anchor e \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ 2,1 -fill x -pady 1m \ [set setf [frame $f.setf]] \ 3,1 -anchor e -fill x -pady 1m \ [set copyright_ [LabelValue $f.copyright \ -anchor w -relief flat \ -labelwidth 0 -valuewidth 0 \ -valuefont $itk_option(-labelfont)]] \ 4,0 -anchor e -fill x -pady 1m -columnspan 2 # add RA and DEC labels to width and height (different font) pack [label $f.width.ra -text "a:" -font $itk_option(-wcsfont)] \ -side left -after $f.width.label -padx 1 pack [label $f.height.dec -text "d:" -font $itk_option(-wcsfont)] \ -side left -after $f.height.label -padx 2 # add buttons for setting coordinates pack \ [set setfrom_ [button $setf.setfrom \ -text "Set From Image" \ -command [code $this set_default_values]]] \ [set selectarea_ [button $setf.selectarea \ -text "Select Area..." \ -command [code $this select_area]]] \ -side right -padx 1m -pady 2m blt::blttable configure $f C1 -padx 2m # dialog buttons pack [frame $w_.buttons -borderwidth 2 -relief groove] \ -side top -fill x pack \ [button $w_.getimage \ -text "Get Image" \ -command [code $this getimage]] \ [button $w_.stop \ -text "Stop" \ -state disabled \ -command [code $this interrupt]] \ [button $w_.close \ -text "Close" \ -command "wm withdraw $w_" ] \ -side left -expand 1 -pady 2m -in $w_.buttons # set the image server (default if not set) if {"$itk_option(-imagesvr)" == ""} { if {[catch {set imagesvr_list [$w_.im info imagesvr]} msg]} { error_dialog $msg $w_ return } set itk_option(-imagesvr) [lindex $imagesvr_list [expr [llength $imagesvr_list]-1]] } set_imagesvr $itk_option(-imagesvr) # add a help button, if there is a help URL if {"[$w_.im help]" != ""} { pack \ [button $w_.help \ -text "Help" \ -command [code $this help]] \ -side left -expand 1 -pady 2m -in $w_.buttons -before $w_.close } # ProgressBar(n) widget, to display the progress of a query itk_component add progress { ProgressBar $w_.progress } pack $itk_component(progress) -side bottom -fill x } # if the catalog has a "help" URL, try to display it in netscape using the # netscape remote interface. public method help {} { set url [$w_.im help] if {"$url" != ""} { cat::AstroCat::send_to_netscape $url } else { info_dialog "Sorry, no help is available for this image server" } } # add a short help window and set the help texts protected method make_short_help {} { TopLevelWidget::make_short_help add_short_help name_ {SIMBAD object name: resolved via SIMBAD server, if given} add_short_help $equinox_ {World Coordinates equinox, default J2000} add_short_help $ra_ {World Coordinates: right ascension (RA)} add_short_help $dec_ {World Coordinates: declination (DEC)} add_short_help $width_ {Width of image in World Coordinates (arcmin)} add_short_help $height_ {Height of image in World Coordinates (arcmin)} add_short_help $setfrom_ {Set default values from the image} add_short_help $w_.getimage {{bitmap b1} = start image request} add_short_help $w_.close {{bitmap b1} = close this window} add_short_help $w_.stop {{bitmap b1} = interrupt the current image fetch} } # set the name server to use to resolve object names public method set_namesvr {name} { set namesvr_ $name } # interrupt the current request public method interrupt {} { $w_.batch interrupt set_feedback off catch {file delete $itk_option(-tmpfile)} set_state normal } # set/reset widget states while busy public method set_state {state} { set state_ $state if {"$state" == "normal"} { catch {blt::busy release $w_.main} catch {focus -lastfor $w_.main} $w_.getimage config -state normal $w_.stop config -state disabled } else { catch {focus .} catch {blt::busy hold $w_.main} $w_.getimage config -state disabled $w_.stop config -state normal } update idletasks $w_.progress reset } # open or close a pipe to get feedback during HTTP transfers. # (To save limited fds, we close the feedback pipe after each HTTP op). # The arg should be "on" to turn feedback on, or "off" to turn it off. protected method set_feedback {onoff} { # Process any pending file events. # Note: this is important: if we don't process the events before # closing the feedback file, a crash may result. update if {$itk_option(-debug)} { # if -debug was given, the feedback bit wont work, since the # query is done in the foreground and trying to read the feedback # from the pipe may cause the application to hang... return } if {"$onoff" == "on"} { lassign [pipe] rfd_ wfd_ fileevent $rfd_ readable [code $this feedback] $w_.im feedback $wfd_ } elseif {[info exists rfd_]} { ::close $rfd_ ::close $wfd_ unset rfd_ wfd_ $w_.im feedback {} } } # this method is called by the fileevent handler during the image transfer # from the HTTP C++ class to give the user feedback about how much there is # left to copy, etc... # Read a line from the feedback pipe, which should contain text to be displayed # in the progress widget. public method feedback {} { set text [gets $rfd_] if {"$state_" != "normal"} { if {[scan $text {total length: %d bytes} n] == 1} { $w_.progress config -to $n } elseif {[scan $text {read %d bytes} n] == 1} { $w_.progress config -value $n } elseif {[scan $text {url: %s} url] == 1} { catch { set fd [open $logfile_name_ a+] puts $fd "[clock format [clock seconds]]\n$itk_option(-imagesvr)\n$url\n\n" ::close $fd } } } $w_.progress config -text $text update idletasks } # This method is called when the background request is done. # The arguments are the error status (0 is OK) and the result, # which is a list of {filename center-pos copyright} protected method request_done {status result} { set_feedback off if {$status} { # check if we need user/passwd info. errmsg should have the format: # "Authorization Required for at " if {[regsub {Authorization Required} $result {Enter username} msg]} { lassign [passwd_dialog $msg] username passwd if {"$username" != "" && "$passwd" != ""} { lassign $result {} {} {} realm {} host $w_.im authorize $username $passwd $realm $host getimage } } else { set_state normal error_dialog $result $w_ after 0 [list $w_.progress config -text $result] } } else { lassign $result filename pos copyright $w_.progress config -text "Loading Image..." $copyright_ configure -value $copyright update idletasks # load the image if {[catch {$itk_option(-image) config -file $filename} msg]} { error_dialog $msg } catch {file delete $filename} if {[llength $pos] >= 2} { lassign $pos ra dec equinox $ra_ config -value $ra $dec_ config -value $dec $name_ config -value "" } set_state normal } } # set (open) the current image server - called when user selects a # name from the menu public method set_imagesvr {name} { config -imagesvr $name wm title $w_ "$name ($itk_option(-number))" wm iconname $w_ [$w_.im shortname $name] $w_.im open $name $copyright_ configure -value [$w_.im copyright] set image $itk_option(-image) set instance_idx "$name,$image" set instances_($instance_idx) $w_ } # member proc (like a static member function) to create an instance of this # class for the named imagesvr (or reuse the existing one for the imagesvr) # # The args are: # # name - long name of imagesvr from config file # # image - name of skycat itcl image widget # # debug - flag: if true, run queries in foreground # # w should be the top level window of the caller (optional). public proc new_imagesvr {name image debug {w ""}} { set i "$name,$image" if {[info exists instances_($i)] && [winfo exists $instances_($i)]} { utilRaiseWindow $instances_($i) return } # If $w was specified, put the window under that top level window # so we get the window numbers right (for cloning, see TopLevelWidget). if {[winfo exists $w]} { set instname $w.ai[incr n_instances_] } else { set instname .ai[incr n_instances_] } set instances_($i) \ [AstroImage $instname \ -image $image -debug $debug -imagesvr $name -transient 0] } # return a list of the instances of this class public proc instances {} { set list {} if {[info exists instances_]} { foreach i [array names instances_] { if {[winfo exists $instances_($i)]} { lappend list $instances_($i) } } } return $list } # Get the requested image from the image server based on the current options # and display the resulting image (args are ignored here) public method getimage {args} { getimage_from_args \ [$ra_ get] [$dec_ get] [$name_ get] [$equinox_ get] \ [$width_ get] [$height_ get] 0 } # Get the requested image from the image server based on the given arguments # for the world coord position or name and the given width and height # if flag is 1, the entries are updated from the arguments. public method getimage_from_args {ra dec name equinox width height {flag 1}} { if {$flag} { $ra_ config -value $ra $dec_ config -value $dec $name_ config -value $name $equinox_ config -value $equinox $width_ config -value $width $height_ config -value $height } catch {file delete $itk_option(-tmpfile)} # generate a new tmpfile name config -tmpfile {} set cmd "$w_.im getimage -tmpfile $itk_option(-tmpfile)" if {"$equinox" != ""} { lappend cmd "-equinox" $equinox } if {"$name" != ""} { lappend cmd "-nameserver" $namesvr_ "-name" $name } elseif {"$ra" != "" && "$dec" != ""} { lappend cmd "-pos" [list $ra $dec] } else { warning_dialog "Please specify either an object name or a position in WCS" $w_ return } lappend cmd -width $width lappend cmd -height $height # start the request in the background set_state disabled $w_.progress config -text "Attempting to contact image server..." $w_.progress look_busy # set up the feedback pipe set_feedback on $w_.batch bg_eval [code [format { list [%s] [%s.im centerpos] } $cmd $w_]] } # Set the default values for the form entries: # set the default position (RA, DEC) to the image center, public method set_default_values {} { $name_ config -value "" if {[$w_.im iswcs]} { set center [$image_ wcscenter] if {[llength $center] == 0 || [$image_ isclear]} { return } lassign $center ra dec equinox set width [$image_ wcswidth] set height [$image_ wcsheight] set_pos_width_height [list $ra $dec $equinox $width $height] } else { set width [$image_ width] set height [$image_ height] set x [expr $width/2.] set y [expr $height/2.] set_pos_width_height [list $x $y $width $height] } } # set the values for the position, width and height entries from the # given list, which should be in the format {ra dec equinox width height} if # we are using wcs, or {x y width height} for image pixel coords. public method set_pos_width_height {list} { set n [llength $list] if {[$w_.im iswcs] && $n == 5} { # using world coords lassign $list ra dec equinox width height $ra_ config -value $ra $dec_ config -value $dec $equinox_ config -value $equinox $width_ config -value [format "%.2f" $width] $height_ config -value [format "%.2f" $height] } elseif {[$w_.im ispix] && $n == 4} { # using image coords lassign $list x y width height $x_ config -value $x $y_ config -value $y $equinox_ config -value "" $width_ config -value [format "%.2f" $width] $height_ config -value [format "%.2f" $height] } } # Ask the user to select an area to search interactively # and insert the resulting radius and center pos in the # catalog window. public method select_area {} { if {[$image_ isclear]} { return } set_pos_width_height [select_image_area [$w_.im iswcs]] } # convert the given input coordinates in the given input units to the # given output units and return a list {x y} with the new values. # The units may be one of {canvas image wcs deg "wcs $equinox", "deg $equinox"} public method convert_coords {in_x in_y in_units out_units} { return [$image_ convert coords $in_x $in_y $in_units {} {} $out_units] } # convert the given input distance in the given input units to the # given output distance and return a list {x y} with the new values. # The units may be one of {canvas image wcs deg "wcs $equinox", "deg $equinox"} public method convert_dist {in_x in_y in_units out_units} { return [$image_ convert dist $in_x $in_y $in_units {} {} $out_units] } # return the current equinox, or an empty string if the imagesvr does # not support world coordinates. The user can change the equinox used # to display coordinates by typing in a different value in the panel. public method get_imagesvr_equinox {} { if {[$w_.im iswcs]} { set equinox [$equinox_ get] if {"$equinox" == ""} { set equinox J2000 } return $equinox } } # Ask the user to select an area of the image by dragging out a region # on the image return the resulting center pos, width and height as a list of # {x y width height}, or {ra dec equinox width height} if wcs_flag # is 1. An empty string is returned if there is no image or the user # cancels the operation. public method select_image_area {wcs_flag} { if {"$image_" == ""} { return } if {[$image_ isclear]} { error_dialog "No image is currently loaded" return } # get canvas coords of selected area set list [$itk_option(-image) select_area] if {[llength $list] != 4} { return } lassign $list x0 y0 x1 y1 # get center and radius in canvas coords set x [expr ($x0+$x1)/2.] set y [expr ($y0+$y1)/2.] set w [expr abs($x1-$x0)] set h [expr abs($y1-$y0)] if {$wcs_flag} { # using world coords set equinox [get_imagesvr_equinox] if {[catch { lassign [convert_coords $x $y canvas "wcs $equinox" ] ra dec lassign [convert_dist $w $h canvas "deg $equinox" ] width height } msg]} { error_dialog "error converting canvas ($x, $y) to world coordinates: $msg" $w_ return } return [list $ra $dec $equinox [expr $width*60.] [expr $height*60.]] } else { # using image coords if {[catch { lassign [convert_coords $x $y canvas image] xi yi lassign [convert_dist $w $h canvas image] width height } msg]} { error_dialog "error converting canvas ($x, $y) to world coordinates: $msg" $w_ return } return [list $x $y $width $height] } } # -- options -- # default image server name itk_option define -imagesvr imagesvr Imagesvr "dss@eso" # image handle (itcl class: SkyCat or derived) itk_option define -image image Image {} { if {$initialized_} { set canvas_ [$itk_option(-image) get_canvas] set image_ [$itk_option(-image) get_image] set_default_values } } # font to use for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # font to use for values itk_option define -valuefont valueFont ValueFont TkFixedFont # font to use for ra,dec labels itk_option define -wcsfont wcsFont WcsFont {Symbol -14} # set the width for displaying labels itk_option define -labelwidth labelWidth LabelWidth 14 # set the width for displaying labels itk_option define -valuewidth valueWidth ValueWidth 14 # set the anchor for labels itk_option define -anchor anchor Anchor e # text for label displayed at top itk_option define -title title Title "Image Request Parameters" # flag: if true, run queries in foreground for better debugging itk_option define -debug debug Debug 0 # temp image file to use itk_option define -tmpfile tmpfile Tmpfile {} { if {"$itk_option(-tmpfile)" == ""} { set itk_option(-tmpfile) "/tmp/im[pid].$itk_option(-number).[incr count_]" } } # -- protected members -- # canvas window containing main image protected variable canvas_ # internal rtdimage widget for main image protected variable image_ # name field widget protected variable name_ # equinox field widget protected variable equinox_ # ra field widget protected variable ra_ # dec field widget protected variable dec_ # width field widget protected variable width_ # height field widget protected variable height_ # "set from image" field widget protected variable setfrom_ # copyright field protected variable copyright_ # pipe to read feedback during image transfer protected variable rfd_ # pipe to write feedback during image transfer protected variable wfd_ # name server to use to resolve object names protected variable namesvr_ {} # current state: normal, disabled (i.e.: waiting) protected variable state_ {normal} # log file handle (used to log URLs) protected variable logfile_ stdout # flag: set at end of constructor protected variable initialized_ 0 # count used for filename generation protected variable count_ 0 # log file handle (used to log URLs) protected variable logfile_name_ # -- common variables (shared by all instances) -- # array mapping catalog name to widget/class name protected common instances_ # instance count protected common n_instances_ 0 } skycat-3.1.2-starlink-1b/cat/library/AstroQuery.tcl000066400000000000000000000556451215713201500222110ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: AstroQuery.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # AstroQuery.tcl - widget for searching astronomical catalogs. # # See man page AstroQuery(n) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 05 Jan 98 created itk::usual AstroQuery {} # An AstroQuery widget is defined as a frame containing entries for search # options. itcl::class cat::AstroQuery { inherit util::FrameWidget # constructor constructor {args} { itk_option add hull.borderwidth hull.relief eval itk_initialize $args } # called after options have been evaluated protected method init {} { # set flag to handle image servers differently if {"[$astrocat servtype]" == "imagesvr"} { set iscat_ 0 } else { set iscat_ 1 } add_search_options add_copyright set_short_help # create an object for running interruptable batch queries Batch $w_.batch \ -command [code $this query_done] \ -debug $itk_option(-debug) # set default values set_default_values } # update the search option entries after they have been edited public method update_search_options {} { if {"$search_col_info_" != "[$astrocat searchcols]"} { add_search_options add_copyright set_default_values } } # add (or update) the search options panel protected method add_search_options {} { if {! [winfo exists $w_.options]} { # Options frame itk_component add options { frame $w_.options } { } pack $w_.options \ -side top -fill x pack \ [label $w_.options.head -text "Search Options" ] \ -side top -pady 2 } if {[winfo exists $w_.options.f]} { destroy $w_.options.f } pack [set f [frame $w_.options.f]] \ -side top -fill x set search_opts_ [blt::blttable $f] set search_opts_row_ 0 # if we are using world coords, display name, equinox, ra, dec if {[$astrocat iswcs]} { add_search_option \ [set name_ \ [LabelEntry $f.name \ -text "Object Name:" \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set equinox_ \ [LabelEntry $f.equinox \ -text "Equinox:" \ -value "J2000" \ -autoselect 1 \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] add_search_option \ [set ra_ \ [LabelEntry $f.ra \ -text "a:" \ -autoselect 1 \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-wcsfont)]] \ [set dec_ \ [LabelEntry $f.dec \ -text "d:" \ -autoselect 1 \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-wcsfont)]] } elseif {[$astrocat ispix]} { # if we are using image coords, display x and y add_search_option \ [set x_ \ [LabelEntry $f.x \ -text "X:" \ -autoselect 1 \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set y_ \ [LabelEntry $f.y \ -text "Y:" \ -autoselect 1 \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] } if {[$astrocat iswcs] || [$astrocat ispix]} { if {$iscat_} { # add min and max radius items (for catalogs) add_search_option \ [set rad1_ [LabelEntry $f.rad1 \ -text "Min Radius:" \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set rad2_ [LabelEntry $f.rad2 \ -text "Max Radius:" \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] } else { # add width and height items (for image servers) add_search_option \ [set width_ [LabelEntry $f.width \ -text "Width:" \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set height_ [LabelEntry $f.height \ -text "Height:" \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] } } # display search columns from config entry. If the max value is missing, # assume just one value, otherwise a range: min..max set n 0 set search_col_info_ [$astrocat searchcols] catch {unset min_values_} catch {unset max_values_} set search_cols_ {} foreach col_info $search_col_info_ { if {[llength $col_info] < 2} { error_dialog \ "invalid search_cols entry in config file: \ '$col_info' ([llength $col_info])" $w_ continue } lassign $col_info col minStr maxStr if {"$col" == ""} { error_dialog "missing column value in config file entry: '$col_info'" $w_ continue } if {"$minStr" == ""} { error_dialog "missing min value in config file entry: '$col_info'" $w_ continue } lappend search_cols_ $col set min_values_($col) [LabelEntry $f.min$n \ -text "$minStr:" \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)] if {"$maxStr" != ""} { set max_values_($col) [LabelEntry $f.max$n \ -text "$maxStr:" \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)] add_search_option $min_values_($col) $max_values_($col) } else { add_search_option $min_values_($col) } incr n } # if the url contains a string such as mag=%m1,%m2, make sure the # user knows the defaults (maybe the servers should be changed?) if {[info exists min_values_(mag)]} { if {[string first {%m2} [$astrocat url]] != -1} { $min_values_(mag) config -value 0 $max_values_(mag) config -value 99 } } # if there were any search options at all... if {$search_opts_row_ > 0} { if {$iscat_} { add_search_option \ [set maxnum_ [LabelEntry $f.maxnum \ -text "Max Objects:" \ -command $itk_option(-searchcommand) \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] } blt::blttable configure $f C1 -padx 2m } else { # no options destroy $w_.options } update idletasks } # add copyright info to the search panel, if present protected method add_copyright {} { set s [$astrocat copyright] if {"$s" != "" && [winfo exists $search_opts_]} { blt::blttable $search_opts_ \ [LabelValue $search_opts_.copyright \ -anchor w -relief flat \ -labelwidth 0 -valuewidth 0 \ -value $s \ -valuefont $itk_option(-labelfont)] \ [incr search_opts_row_],0 -anchor e -fill x -pady 1m -columnspan 2 } } # add a row to the search options panel (blt table). # The args may be one or more widget names to put in a row in the panel. # Each widget is placed in a new column. An empty argument results in an # empty column for that row. If all are empty, the row is left empty. protected method add_search_option {args} { set col 0 foreach w $args { if {"$w" != ""} { blt::blttable $search_opts_ $w $search_opts_row_,$col \ -fill x -pady 1m } incr col } incr search_opts_row_ } # add short help texts to widgets protected method set_short_help {} { if {[$astrocat iswcs]} { add_short_help $name_ {object name: resolved via name server, if given} add_short_help $equinox_ {World Coordinates equinox, default J2000} add_short_help $ra_ {World Coordinates: right ascension (RA)} add_short_help $dec_ {World Coordinates: declination (DEC)} if {$iscat_} { add_short_help $rad1_ {Radius: minimum radius in arcmin for circular search} add_short_help $rad2_ {Radius: maximum radius in arcmin for circular search} add_short_help $maxnum_ {Max number of stars/objects to display} } else { add_short_help $width_ {Width in arcmin of image to get} add_short_help $height_ {Height in arcmin of image to get} } } elseif {[$astrocat ispix]} { add_short_help $x_ {Image coordinates: X value} add_short_help $y_ {Image coordinates: Y value} if {$iscat_} { add_short_help $rad1_ {Radius: minimum radius in pixels for circular search} add_short_help $rad2_ {Radius: maximum radius in pixels for circular search} add_short_help $maxnum_ {Max number of stars/objects to display} } else { add_short_help $width_ {Width in pixels of image to get} add_short_help $height_ {Height in pixels of image to get} } } foreach col $search_cols_ { if {$iscat_} { # add catalog help if {[info exists max_values_($col)]} { add_short_help $min_values_($col) \ "If set, search for rows where $col is greater than this value" add_short_help $max_values_($col) \ "If set, search for rows where $col is less than this value" } else { add_short_help $min_values_($col) \ "If set, search for rows with this $col value" } } else { # add image server help if {[info exists max_values_($col)]} { add_short_help $min_values_($col) \ "If set, fetch an image where $col is greater than this value" add_short_help $max_values_($col) \ "If set, fetch an image where $col is less than this value" } else { add_short_help $min_values_($col) \ "If set, fetch an image with this $col value" } } } } # interrupt the current search public method interrupt {} { $w_.batch interrupt } # start the catalog search based on the current search options # and display the results in the table. public method search {args} { if {$iscat_} { set cmd "$astrocat query" } else { set cmd "$astrocat getimage" } if {[$astrocat iswcs] || [$astrocat ispix]} { set equinox "" if {[$astrocat iswcs]} { set name [$name_ get] set x [$ra_ get] set y [$dec_ get] set equinox [$equinox_ get] } elseif {[$astrocat ispix]} { set name "" set x [$x_ get] set y [$y_ get] } if {$iscat_} { set rad1 [$rad1_ get] set rad2 [$rad2_ get] } else { set width [$width_ get] set height [$height_ get] } if {"$equinox" != ""} { lappend cmd "-equinox" $equinox } if {"$name" != ""} { lappend cmd "-nameserver" $namesvr "-name" $name } elseif {"$x" != "" && "$y" != ""} { lappend cmd "-pos" [list $x $y] } else { #warning_dialog "Please specify either an object name or a position in WCS" $w_ } if {$iscat_} { if {"$rad1" != "" || "$rad2" != ""} { lappend cmd "-radius" "$rad1 $rad2" } set maxnum [$maxnum_ get] if {"$maxnum" != ""} { lappend cmd "-nrows" $maxnum } if {"[set sort_cols [$astrocat sortcols]]" != ""} { lappend cmd "-sort" $sort_cols "-sortorder" [$astrocat sortorder] } } else { if {"$width" != "" || "$height" != ""} { lappend cmd -width $width -height $height } } } # add optional search columns if {"$search_cols_" != ""} { set minvalues {} set maxvalues {} set search_cols {} foreach col $search_cols_ { set min [$min_values_($col) get] if {[catch {set max [$max_values_($col) get]}]} { # if only one value, compare for equality, otherwise range set max $min } if {"$min" == "" && "$max" != "" || "$max" == "" && "$min" != ""} { error_dialog "Please specify min and max values for $col" return } if {"$min" == ""} { continue } lappend search_cols $col lappend minvalues $min lappend maxvalues $max } if {[llength $search_cols]} { lappend cmd -searchcols $search_cols -minvalues $minvalues -maxvalues $maxvalues } } if {"$itk_option(-feedbackcommand)" != ""} { eval $itk_option(-feedbackcommand) on } $w_.batch bg_eval [code $this do_query $cmd] } # return the result of a catalog query. Since this may be run in a separate # process via fork, all of the necessary info is returned in the format: # # {results headings entry querypos more} # # where: # # results are the query results (list of rows) # # headings are the result headings # # entry is the catalog config entry # # querypos is the center pos of the query # # more is a flag, 1 if more rows available # # For image servers, the result of the command is the name of the # file containing the image and the headings field is left empty. protected method do_query {cmd} { if {$iscat_} { return [list [eval $cmd] \ [$astrocat headings] \ [$astrocat entry get] \ [$astrocat querypos] \ [$astrocat more]] } else { return [list [eval $cmd] \ {}\ [$astrocat entry get] \ [$astrocat querypos] \ 0] } } # This method is called when the background query is done. # The arguments are the error status (0 is OK) and the result # of evaluating the Tcl commands. # # The result arg contains a list of items: # # {info headings entry pos more} # # Where: # # info is a list of rows (result of query) # # headings are the column headings # # entry is the catalog config entry (including info from the header # in the query result), # # pos is the query center position (possibly expanded by a name server) # # more is a flag indicating if there were more rows available that were # not returned due to the maxrows limit set. protected method query_done {status result} { if {"$itk_option(-feedbackcommand)" != ""} { eval $itk_option(-feedbackcommand) off } set cmd $itk_option(-command) if {$status} { lappend cmd $result {} {} 0 } else { lassign $result info_ headings_ entry pos more # update the catalog config entry with the entry data from the subprocess # (may have been modified by info in the query result header) $astrocat entry update $entry if {[llength $pos] >= 2} { if {[$astrocat iswcs]} { $name_ config -value "" lassign $pos ra dec equinox $ra_ config -value $ra $dec_ config -value $dec } elseif {[$astrocat ispix]} { lassign $pos x y $x_ config -value $x $y_ config -value $y } } lappend cmd "" $headings_ $info_ $more } # eval caller's command, if there is one if {"$itk_option(-command)" != ""} { eval $cmd } } # Set the default values for the form entries: # set the default position (RA, DEC) to the image center, # set the min radius to 0 and the max radius to the distance # from the center to the origin. public method set_default_values {} { # set the center coords and default radius if {[$astrocat iswcs]} { $name_ config -value "" $ra_ config -value "" $dec_ config -value "" $equinox_ config -value 2000 if {$iscat_} { $rad1_ config -value 0.0 $rad2_ config -value 10.0 $maxnum_ config -value 1000 } else { $width_ config -value 10.0 $height_ config -value 10.0 } } elseif {[$astrocat ispix]} { $x_ config -value "" $y_ config -value "" if {$iscat_} { $rad1_ config -value 0.0 $rad2_ config -value 255.0 $maxnum_ config -value 1000 } else { $width_ config -value 255.0 $height_ config -value 255.0 } } } # return the current equinox, or an empty string if the catalog does # not support world coordinates. The user can change the equinox used # to display coordinates by typing in a different value in the panel. public method get_catalog_equinox {} { if {[$astrocat iswcs]} { set equinox [$equinox_ get] if {"$equinox" == ""} { set equinox J2000 } return $equinox } } # set the values for the position and radius entries from the given # list, which should be in the format {ra dec equinox radius} if # we are using wcs, or {x y radius} for image pixel coords. # This method is only used for catalogs (not image servers). public method set_pos_radius {list} { set n [llength $list] if {[$astrocat iswcs] && $n == 4} { # using world coords lassign $list ra dec equinox radius $ra_ config -value $ra $dec_ config -value $dec $equinox_ config -value $equinox $rad1_ config -value 0.0 $rad2_ config -value $radius } elseif {[$astrocat ispix] && $n == 3} { # using image coords lassign $list x y radius $x_ config -value $x $y_ config -value $y $rad1_ config -value 0.0 $rad2_ config -value $radius } } # Set the values for the position, width and height entries from the # given list, which should be in the format: # {ra dec equinox width height name} # if we are using wcs, or: # {x y width height} for image pixel coords. # Any missing values at the end of the list are treated as blank. # This method is only used for image servers. public method set_pos_width_height {list} { set n [llength $list] if {[$astrocat iswcs] || $n == 5} { # using world coords lassign $list ra dec equinox width height name $ra_ config -value $ra $dec_ config -value $dec $equinox_ config -value $equinox catch {$width_ config -value [format "%.2f" $width]} catch {$height_ config -value [format "%.2f" $height]} $name_ config -value $name } elseif {[$astrocat ispix] || $n == 4} { # using image coords lassign $list x y width height $x_ config -value $x $y_ config -value $y $equinox_ config -value "" catch {$width_ config -value [format "%.2f" $width]} catch {$height_ config -value [format "%.2f" $height]} } } # get the values from the position and radius entries and return # a list in the format {ra dec equinox radius} if we are using wcs, # or {x y radius} for image pixel coords. public method get_pos_radius {} { if {[$astrocat iswcs]} { # using world coords return [list [$ra_ get] [$dec_ get] [$equinox_ get] [$rad2_ get]] } elseif {[$astrocat ispix]} { # using image coords return [list [$x_ get] [$y_ get] [$rad2_ get]] } } # Return the value in the equinox entry, of 2000 if there isn't one. public method get_equinox {} { if {[$astrocat iswcs]} { # using world coords return [$equinox_ get] } else { # using image coords return "2000" } } # -- options -- # Specify the command to evaluate with the results of a query. # The command is evaluated whenever a query is done with the # following args: # # errmsg - If this is not empty, it contains an error message and # the following args should be ignored. If there were no # errors, this arg is an empty string. # # headings - are the column headings # # info - is a list of rows (result of query) # # more - is a flag set to 1 if there were more rows available that were # not returned due to the maxrows limit set. itk_option define -command command Command {} # Specify the command to call to open and close a pipe used to give # feedback during HTTP transfers. The command takes 1 arg: "on" or "off". itk_option define -feedbackcommand feedbackCommand FeedbackCommand {} # Specify the search command to evaluate when the user types # (Can be used to set button states, etc. Defaults to [code $this search]) itk_option define -searchcommand searchCommand SearchCommand {} { if {"$itk_option(-searchcommand)" == ""} { set itk_option(-searchcommand) [code $this search] } } # font used for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # font used for values itk_option define -valuefont valueFont ValueFont TkFixedFont # font used for ra,dec labels itk_option define -wcsfont wcsFont WcsFont {Symbol -14} # set the width for displaying labels itk_option define -labelwidth labelWidth LabelWidth 15 # set the anchor for labels itk_option define -anchor anchor Anchor e # flag: if true, run queries in foreground for better debugging itk_option define -debug debug Debug 0 # -- public variables -- # astrocat (C++ based) object for accessing catalogs public variable astrocat # name server to use to resolve object names public variable namesvr {} # -- protected variables -- # blt table for search options protected variable search_opts_ # current row number for $search_opts_ protected variable search_opts_row_ 0 # saved value of catalog search_cols_ entry, for comparison protected variable search_col_info_ {} # widget name for name field protected variable name_ # widget name for equinox field protected variable equinox_ # widget name for RA field protected variable ra_ # widget name for DEC field protected variable dec_ # widget name for X field protected variable x_ # widget name for Y field protected variable y_ # widget name for min radius field protected variable rad1_ # widget name for max radius field protected variable rad2_ # widget name for image width field protected variable width_ # widget name for image height field protected variable height_ # widget name for "max number of objects" field protected variable maxnum_ # list of columns to search by protected variable search_cols_ {} # array(colName) of widget name for search column min fields protected variable min_values_ # array(colName) of widget name for search column max fields protected variable max_values_ # copyright field protected variable copyright_ # flag: true if catalog is not an image server protected variable iscat_ 1 } skycat-3.1.2-starlink-1b/cat/library/CatInit.tcl000066400000000000000000000007511215713201500214120ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: # # CatInit.tcl # # script which is executed by TclAstroCat.C to initialize tcl # # who when what # -------- --------- ---------------------------------------------- # pbiereic 24/08/99 created package require img::xpm package require Tclutil package require Astrotcl if {![lcontain $auto_path $cat_library]} { lappend auto_path $cat_library } namespace eval cat {namespace export *} namespace import -force cat::* skycat-3.1.2-starlink-1b/cat/library/CatalogInfo.tcl000066400000000000000000000424301215713201500222450ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # "@(#) $Id: CatalogInfo.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # CatalogInfo.tcl - widget for browsing through a hierarchical list of catalogs # # See man page CatalogInfo(n) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 14 Oct 97 created itk::usual CatalogInfo {} # The CatalogInfo class defines a user interface for browsing through a # hierarchical list of catalogs. The list of catalogs is defined in catalog # config files at various hosts on the network or in local catalog config files. # This widget allows you to choose, from various catalog servers on the net, # which catalogs to keep in a personal default catalog list. itcl::class cat::CatalogInfo { inherit util::TopLevelWidget # constructor constructor {args} { eval itk_initialize $args } # destructor - delete C++ based objects so that the temp image # files are deleted destructor { catch {destroy $tree_} } # called after options have been evaluated protected method init {} { global ::cat_library # if running stand-alone, setup X defaults if {$itk_option(-standalone)} { cat::setXdefaults } wm title $w_ "Catalog Directory ($itk_option(-number))" wm iconname $w_ "Catalog Directory" # set the strings to display for server types set serv_types_(local) "local catalog" set serv_types_(directory) "directory" set serv_types_(catalog) "catalog" set serv_types_(archive) "archive" set serv_types_(imagesvr) "image server" set serv_types_(namesvr) "name server" set images_(local) [image create photo -file $cat_library/local.xpm] set images_(directory) [image create photo -file $cat_library/nsfolder.xpm] set images_(open_directory) [image create photo -file $cat_library/nsopenfold.xpm] set images_(catalog) [image create photo -file $cat_library/catalog.xpm] set images_(archive) [image create photo -file $cat_library/archive.xpm] set images_(imagesvr) [image create photo -file $cat_library/imagesvr.xpm] set images_(namesvr) [image create photo -file $cat_library/namesvr.xpm] # do window layout if {[layout_dialog]} { destroy $w_ return } # add a short help window make_short_help set initialized_ 1 } # add the menu bar protected method add_menubar {} { TopLevelWidget::add_menubar set m [add_menubutton File "Display File menu"] set file_menu_ $m add_menuitem $m command "Load config file..." \ {Load a local catalog configuration file and insert it in the catalog list.} \ -command [code $this load_config_file] add_menuitem $m command "Save to config file..." \ {Save catalog configuration information to a file.} \ -command [code cat::CatalogInfo::save_as $w_] $m add separator add_menuitem $m command "Close" \ {Apply changes and close this window} \ -command [code $this close] cat::AstroCat::add_catalog_menu $w_ $itk_option(-id) \ $itk_option(-classname) $itk_option(-debug) } # Apply the current changes, save to default file, call $command public method apply {{ask 0}} { if {$save_needed_} { if {!$ask || [confirm_dialog \ "Do you want to save your changes in the default catalog \ config file (~/.skycat/skycat.cfg)?" $w_]} { save {} $w_ $ask } if {"$command" != ""} { eval $command } } } # apply changes and close the window public method close {{ask 0}} { # apply $ask quit } # pop up a dialog to save the current info to a catalog config file # Note: this is defined as a proc so that it can be accessed by other # widgets without this widget being created first. $w should be the main # window of the calling widget. public proc save_as {w} { set file [filename_dialog [pwd] * $w] if {"$file" != ""} { save $file $w } } # save current config info to the given file, or if file is an empty # string, to the default config file. public proc save {file w {ask 1}} { global ::env set default_file $env(HOME)/.skycat/skycat.cfg if {"$file" == ""} { set file $default_file } set update 0 if {"$file" == "$default_file"} { incr update } elseif {$ask && [file isfile $file]} { if {![confirm_dialog "File: `[file tail $file]' exists \ - Do you want to overwrite it ?" $w]} { return } } if {[file isdir $file]} { error_dialog "File: `[file tail $file]' is a directory" $w return } # get the default catalog list if {[catch {set catalog_list [lsort [$astrocat_ info {}]]} msg]} { error_dialog $msg $w return } # use a temp file in case of errors if {[catch {set fd [open $file.tmp w]} msg]} { error_dialog $msg $w return } puts $fd "# Catalog config file" puts $fd "# This file was automatically generated by Skycat on [clock format [clock seconds]]" puts $fd "" foreach name $catalog_list { if {[catch {set entry [$astrocat_ entry get $name]} msg]} { error_dialog $msg $w ::close $fd catch {file delete $file.tmp} return } puts $fd "" foreach line $entry { lassign $line key value if {"$value" != ""} { if {"$key" == "symbol" || "$key" == "search_cols"} { puts $fd [format "%-15s %s" $key: [join $value " : "]] } else { puts $fd [format "%-15s %s" $key: $value] } } } } ::close $fd # backup $file, then rename $file.tmp to $file if {[file exists $file]} { if {[catch {file rename -force $file $file.BAK} msg]} { error_dialog $msg $w catch {file delete $file.tmp} return } } if {[catch {file rename -force $file.tmp $file} msg]} { error_dialog $msg $w catch {file delete $file.tmp} return } set save_needed_ 0 # tell widgets to update the catalog menus if {$update} { cat::AstroCat::update_catalog_menus } } # do the dialog window layout protected method layout_dialog {} { add_menubar add_tree_frame add_dialog_buttons init_tree return 0 } # add a frame for displaying a tree of catalog servers and catalogs # inside the given frame and side protected method add_tree_frame {} { set tf [frame $w_.tf] set tree_ $tf.tree set vs [scrollbar $w_.vs -orient vertical -command "$tree_ yview"] set hs [scrollbar $w_.hs -orient horizontal -command "$tree_ xview"] set rootdir_ [$astrocat_ root] treeview $tree_ \ -separator $sep_ \ -autocreate no \ -allowduplicates no \ -hideroot yes \ -selectcommand [code $this select_catalog] \ -yscrollcommand "$vs set" \ -xscrollcommand "$hs set" $tree_ column configure treeView -text Name $tree_ column insert end type -text Type -justify left $tree_ sort auto yes table $tf \ 0,0 $tree_ -fill both \ 0,1 $vs -fill y \ 1,0 $hs -fill x table configure $tf c1 r1 r2 -resize none pack $tf -side top -fill both -expand 1 } # initialize the tree of catalogs protected method init_tree {} { # add the root of the tree set id [add_node {} $rootdir_] open_catalog_directory $rootdir_ $id } # Add a node to the catalog tree. "path" is the path to the parent # of the new node in the format "a${sep_}b${sep_}c" where a is the # root and c is immediate parent of the new node. "name" is the name # of the new node and the text to display. protected method add_node {path name} { if {[string first $sep_ $name] != -1} { puts "invalid catalog '$name', contains invalid char: '$sep_'" return } if {"$path" == ""} { set newpath $name } else { set newpath "$path${sep_}$name" } set text $name set dirPath [split $path $sep_] # get server type and display string for it if {[catch {set serv_type [$astrocat_ servtype $name $dirPath]} msg]} { error_dialog $msg $w_ return } if {[info exists serv_types_($serv_type)]} { set type $serv_types_($serv_type) } else { set type $serv_type } # set icon to display if {[catch {set image $images_($serv_type)}]} { set image $images_(local) } if {"$serv_type" == "local"} { set text [file tail $name] } # add the node and server type set node [$tree_ insert end $newpath] $tree_ entry configure $node -data "type $serv_type" $tree_ entry configure $node \ -icons "$image $image" \ -activeicons "$image $image" $tree_ bind $node [code $this node_action $node $path $name $serv_type] return $node } # called for double click on a tree node protected method node_action {id path name serv_type} { if {"$serv_type" == "directory"} { open_catalog_directory $path${sep_}$name $id } else { open_catalog } } # called when a tree node is opened protected method open_catalog_directory {path id} { # get name and type of selected catalog if {"$path" == "$rootdir_"} { set name $rootdir_ set dirPath "" } else { set list [split $path $sep_] set name [lindex $list end] set dirPath [lrange $list 0 [expr [llength $list]-2]] } # catalog directory - add list of catalogs, or show existing list set children [$tree_ entry children $id] if {[llength $children] == 0} { # get and display list of catalogs under this node busy { set dirPath [split $path $sep_] set status [catch {set catalog_list [lsort [$astrocat_ info {} $dirPath]]} msg] } if {$status} { error_dialog $msg $w_ return } foreach i $catalog_list { add_node $path $i } $tree_ open $id # change the directory icon $tree_ entry configure $id \ -opencommand [code $this opened_catalog_directory $id] \ -closecommand [code $this closed_catalog_directory $id] opened_catalog_directory $id } # scroll so that the selected directory is at the top of the window #$tree_ yview $id } # Called when a catalog directory node is opened protected method opened_catalog_directory {id} { set image $images_(open_directory) $tree_ entry configure $id \ -icons "$image $image" \ -activeicons "$image $image" } # Called when a catalog directory node is closed protected method closed_catalog_directory {id} { set image $images_(directory) $tree_ entry configure $id \ -icons "$image $image" \ -activeicons "$image $image" } # add the dialog button frame protected method add_dialog_buttons {} { # dialog buttons pack [frame $w_.buttons -borderwidth 2 -relief raised] \ -side top -fill x pack \ [button $w_.add \ -text "Add" \ -state disabled \ -command [code $this add_catalog]] \ [button $w_.remove \ -text "Remove" \ -state disabled \ -command [code $this remove_catalog]] \ [button $w_.open \ -text "Open" \ -state disabled \ -command [code $this open_catalog]] \ [button $w_.close \ -text "Close" \ -command [code $this close]] \ -side left -expand 1 -padx 8m -pady 2m -in $w_.buttons } # called when a catalog is selected in the catalog list. protected method select_catalog {} { set id [$tree_ curselection] if {$id == ""} { return } set path [$tree_ get -full $id] set catalog_id_ $id set catalog_path_ [split $path $sep_] set catalog_dir_ [lrange $catalog_path_ 0 [expr [llength $catalog_path_]-2]] set catalog_ [lindex $catalog_path_ end] if {[catch {set serv_type [$astrocat_ servtype $catalog_ $catalog_dir_]} msg]} { error_dialog $msg $w_ return } if {"$serv_type" == "directory"} { $w_.open config -state disabled } else { $w_.open config -state normal } if {"$rootdir_${sep_}$catalog_" == "$path"} { $w_.add config -state disabled $w_.remove config -state normal } else { $w_.add config -state normal $w_.remove config -state disabled } } # open a window to search the selected catalog protected method open_catalog {args} { if {[catch {set serv_type [$astrocat_ servtype $catalog_ $catalog_dir_]} msg]} { error_dialog $msg $w_ return } cat::AstroCat::new_catalog \ $catalog_ \ $itk_option(-id) \ $itk_option(-classname) \ $itk_option(-debug) \ 0 \ $serv_type \ $itk_option(-callerw) \ $catalog_dir_ } # add a short help window and set the help texts protected method make_short_help {} { TopLevelWidget::make_short_help add_short_help $tree_ \ "Catalog list: {bitmap b1} = open and display catalog server contents, \ double-click to open a catalog window" add_short_help $w_.add {Add the selected catalog to the default list} add_short_help $w_.remove {Remove the selected catalog from the default list} add_short_help $w_.open {Open the selected catalog for searching} add_short_help $w_.close {Close: close this window} } # add the selected catalog to the catalog list protected method add_catalog {} { if {[catch {set e [$astrocat_ entry get $catalog_ $catalog_dir_]} msg]} { error_dialog $msg $w_ return } if {[catch {set shortName [$astrocat_ shortname $catalog_ $catalog_dir_]} msg]} { error_dialog $msg $w_ return } # get the current default catalog list if {[catch {set catalog_list [lsort [$astrocat_ info {}]]} msg]} { error_dialog $msg $w_ return } # check for duplicates foreach i $catalog_list { if {"$i" == "$catalog_"} { if {! [confirm_dialog \ "\"$catalog_\" is already in the default catalog list. \ Do you want to replace it?"]} { return } # update the entry definition if {[catch {$astrocat_ entry set $e $catalog_ $rootdir_} msg]} { error_dialog $msg $w_ return } incr save_needed_ return } else { if {[catch {set s [$astrocat_ shortname $i]} msg]} { error_dialog $msg $w_ return } if {"$s" == "$shortName"} { error_dialog "short name '$s' for '$catalog_' is not unique" $w_ return } } } # add the catalog to the default list if {[catch {$astrocat_ entry add $e} msg]} { error_dialog $msg $w_ return } # add the new entry to the tree (in sort order) insert_node $catalog_ incr save_needed_ apply } # insert the given catalog in the tree under the root, if it is # not already there. public method insert_node {name} { catch {add_node $rootdir_ $name} } # remove the selected catalog from the catalog list protected method remove_catalog {} { # if this is a directory... if {[catch {set serv_type [$astrocat_ servtype $catalog_ $catalog_dir_]} msg]} { error_dialog $msg $w_ return } if {[catch {$astrocat_ entry remove $catalog_} msg]} { error_dialog $msg $w_ return } $tree_ delete $catalog_id_ $w_.add config -state disabled $w_.remove config -state disabled $w_.open config -state disabled incr save_needed_ apply } # Pop up a dialog to open and load a catalog config file protected method load_config_file {} { set file [filename_dialog [pwd] * $w_] if {"$file" != ""} { if {[file isfile $file]} { if {[file isdir $file]} { error_dialog "File: `[file tail $file]' is a directory" $w_ return } } set name [input_dialog \ "Please enter a descriptive name for the new catalog directory:" \ $w_] if {"$name" == ""} { set name [file rootname [file tail $file]] } if {[catch {$astrocat_ load $file $name} msg]} { error_dialog $msg $w_ } insert_node $name incr save_needed_ apply } } # -- options -- # command to eval when done public variable command {} # debugging flag itk_option define -debug debug Debug 0 # Optional unique id, used in searching for already existing catalog widgets. itk_option define -id id Id "" # Optional: name of caller's top level widget. itk_option define -callerw callerw Callerw "" # name of a subclass of AstroCat to use to create new catalog widgets itk_option define -classname classname Classname "" # font to use for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # font to use for values itk_option define -valuefont valueFont ValueFont TkFixedFont # set the width for displaying labels itk_option define -labelwidth labelWidth LabelWidth 10 # set the anchor for labels itk_option define -anchor anchor Anchor e # -- protected variables -- # tree widget protected variable tree_ # array(serv_type) of server type text to display protected variable serv_types_ # array(serv_type) of image to display in tree node protected variable images_ # name of the root catalog directory protected variable rootdir_ # name of currently selected catalog protected variable catalog_ # id of currently selected catalog protected variable catalog_id_ # full path name of currently selected catalog protected variable catalog_path_ # currently selected catalog directory (as a list of catalog directories in the path) protected variable catalog_dir_ # set to true if the catalog configuration has been edited and needs to be saved protected variable save_needed_ 0 # separator char for tree widget (used in catalog path names) protected variable sep_ "^" # C++ astrocat object used by static member procs common astrocat_ [astrocat ::cat::.cataloginfo] } skycat-3.1.2-starlink-1b/cat/library/EnterObject.tcl000066400000000000000000000031011215713201500222530ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: EnterObject.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # EnterObject.tcl - Widget for entering data to add to a local catalog. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 26 Jun 96 created itk::usual EnterObject {} # EnterObject is a dialog widget for entering object data to add to a # local catalog. itcl::class cat::EnterObject { inherit util::EntryForm # constructor constructor {args} { eval itk_initialize $args } # called after options have been evaluated protected method init {} { EntryForm::init wm title $w_ "Enter Object ($itk_option(-number))" if {"$itk_option(-image)" != ""} { $itk_component(buttons) append \ "Pick object..." \ [code $this pick_object] } } # this method is called to pop up a dialog to allow the user to pick # an object in the image public method pick_object {} { if {"$itk_option(-image)" != ""} { if {[catch {set list [$itk_option(-image) pick_dialog [code $this picked_object]]} msg]} { error_dialog $msg return } } } # this is called when an object has been selected with the pick dialog public method picked_object {list} { lassign $list x y ra dec equinox fwhmX fwhmY symetry object background set_entry ra $ra set_entry dec $dec } # -- options -- # optional image handle (itcl class RtdImage or derived class) itk_option define -image image Image {} # -- protected vars -- } skycat-3.1.2-starlink-1b/cat/library/PreviewPlot.tcl000066400000000000000000000132601215713201500223360ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: PreviewPlot.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # PreviewPlot.tcl - Widget for displaying a graph of tab table data # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 05 Aug 96 Created itk::usual PreviewPlot {} # PreviewPlot is an itcl widget for displaying a graph of tab table data, such # as that returned from a "Preview" URL in catalogs such as the HST. itcl::class cat::PreviewPlot { inherit util::TopLevelWidget # constructor: create a new instance of this class constructor {args} { eval itk_initialize $args wm minsize $w_ 10 10 wm title $w_ "$itk_option(-name) ($itk_option(-number))" # create astrocat object to manage tab table astrocat $w_.cat make_graph make_buttons make_short_help plot $itk_option(-file) } # destructor - clean up when deleted destructor { global ::tcl_version # delete the catalog object catch {$w_.cat delete} if {$tcl_version >= 8.0} { blt::vector destroy $xVector_ $yVector_ } } # make the graph subwindow protected method make_graph {} { global ::tcl_version # note: make the graph in the global namespace for now so that # the old blt utils (features.tcl) still work. Shouldn't be needed # with blt-2.0 or later... set cmd \ [list blt::graph $w_.graph \ -width 8i \ -height 5i \ -borderwidth 3 \ -relief groove \ -title "Preview Data for $itk_option(-name)" ] # BLT graph widget itk_component add graph { set graph_ [uplevel "#0" $cmd] } { } pack $itk_component(graph) \ -fill both -expand 1 -padx 1m -pady 1m add_short_help $itk_component(graph) \ {Graph: plot of preview data for object {bitmap dragb1} = zoom, {bitmap b2} = restore} # blt2.4f vector names ust start with a letter, no dots... # Also, they changed the default symbol to circle. Why? regsub -all {\.} v$graph_.xVector _ xVector_ regsub -all {\.} v$graph_.yVector _ yVector_ global $xVector_ $yVector_ if {$tcl_version >= 8.0} { $graph_ legend config -hide 1 if {![info exists $xVector_]} { blt::vector create $xVector_ $yVector_ } set symbol {} } else { $graph_ legend config -mapped 0 if {![info exists $xVector_]} { blt::vector $xVector_ $yVector_ } set symbol none } $graph_ element create elem -xdata $xVector_ -ydata $yVector_ -symbol $symbol # add BLT features ::Blt_ZoomStack $graph_ ::Blt_ActiveLegend $graph_ ::Blt_Crosshairs $graph_ ::Blt_ClosestPoint $graph_ bind bltCrosshairs \ "catch {$this dispXY %x %y; %W crosshairs configure -position @%x,%y}" # X,Y position frame itk_component add fpos { frame $w_.fpos -relief flat } # X position label. itk_component add xpos { label $itk_component(fpos).xpos -width 20 -anchor w } # Y position label itk_component add yval { label $itk_component(fpos).yval -width 20 -anchor w } pack $itk_component(xpos) $itk_component(yval) -fill x -expand 0 -side left pack $itk_component(fpos) -fill none -expand 0 } # plot the data in the file public method plot {file} { if {! [file exists $file]} { error_dialog "no preview file was specified to plot" return } if {[catch {$w_.cat open $file} msg]} { error_dialog $msg $w_ return } set x {} set y {} lassign [$w_.cat headings] x y $graph_ xaxis configure -title $x $graph_ yaxis configure -title $y global $xVector_ $yVector_ if {[catch { set numValues_ [$w_.cat plot $graph_ elem $file $xVector_ $yVector_] } msg]} { error_dialog "can't plot results: $msg" } # remove the temporary local catalog entry $w_.cat entry remove $itk_option(-file) } # display x, y values at cursor position protected method dispXY {x y} { global $yVector_ if {![$graph_ element closest $x $y "" -interpolate 1 -halo 10000]} { return } lassign [$graph_ invtransform $x $y] x y set x [expr int(round($x))] if {$x < 1 || $x >= $numValues_} { return } set yval [$yVector_ range $x $x] $itk_component(xpos) config -text "X: $x" $itk_component(yval) config -text "Value: $yval" } # make a hard copy of the graph display public method print {} { utilReUseWidget GraphPrint $w_.print -graph $graph_ } # make the button frame at the bottom of the window protected method make_buttons {} { pack [set b [frame $w_.buttons -borderwidth 2 -relief groove]] \ -side top -fill x pack \ [button $b.print -text "Print..." -command [code $this print]] \ [button $b.close -text "Close" -command [code $this quit]] \ -side left -expand 1 -padx 2m -pady 2m } # quit the window public method quit {} { catch {destroy $w_} } # add a short help window and set the help texts protected method make_short_help {} { TopLevelWidget::make_short_help add_short_help $graph_ {Graph: drag {bitmap dragb1} to zoom in, press {bitmap b3} to zoom back out} add_short_help $w_.buttons.print "Print: display a dialog window to print the graph \ to a postscript file or printer." add_short_help $w_.buttons.close "Close this window." } # -- options -- # file containing preview data in tab table format itk_option define -file file File {} # name of object/star (for title) itk_option define -name name Name {} # -- protected vars -- # name of graph widget protected variable graph_ # number of values displayed protected variable numValues_ 0 # x vector for graph protected variable xVector_ # y vector for graph protected variable yVector_ } skycat-3.1.2-starlink-1b/cat/library/ProxyDialog.tcl000066400000000000000000000107161215713201500223220ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: ProxyDialog.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # ProxyDialog.tcl - user interface class for defining a proxy server # for HTTP access. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 26 Jun 98 created # P.W.Draper 05 Sep 08 modified some of the text descriptions itk::usual ProxyDialog {} itcl::class cat::ProxyDialog { inherit util::TopLevelWidget # constructor constructor {args} { eval itk_initialize $args } # called after options have been evaluated protected method init {} { global ::env wm title $w_ Proxies if {"$itk_option(-configfile)" == ""} { config -configfile $env(HOME)/.proxies } pack [message $w_.proxymsg \ -width 6.5i \ -padx 1m \ -anchor c \ -text "You may need to use a proxy server to access \ remote catalogs via HTTP.\ Please enter the hostname and port number for the proxy \ server:"] \ -side top -anchor w -pady 3m pack [set f [frame $w_.proxyf]] \ -side top -anchor w -fill x -pady 2m pack [LabelEntry $w_.proxy \ -text "HTTP Proxy server:" \ -anchor e \ -valuewidth 32] \ -side left -fill x -in $f pack [LabelEntry $w_.port \ -text "Port:" \ -anchor e \ -valuewidth 8] \ -side left -in $f pack [message $w_.noproxymsg \ -width 6.5i \ -padx 1m \ -anchor w \ -text "Below you can specify a list of domains for which no proxy \ server is needed (separate names by space or comma):"] \ -side top -anchor w -pady 3m pack [LabelEntry $w_.noproxy \ -text "No proxy for:" \ -anchor e] \ -side top -fill x -anchor w -pady 2m # add buttons pack [frame $w_.buttons -borderwidth 2 -relief raised] \ -side top -fill x -pady 2m pack \ [button $w_.ok \ -text "OK" \ -command [code $this ok]] \ [button $w_.reset \ -text "Reset" \ -command [code $this reset]] \ [button $w_.clear \ -text "Clear" \ -command [code $this clear]] \ [button $w_.cancel \ -text "Cancel" \ -command [code $this cancel]] \ -side left -expand 1 -pady 2m -in $w_.buttons # set values reset } # called when the OK button is pressed protected method ok {} { global ::env set proxy [string trim [$w_.proxy get]] set port [string trim [$w_.port get]] set noproxy [string trim [$w_.noproxy get]] if {"$proxy" != ""} { if {"$port" == ""} { set env(http_proxy) "http://$proxy/" } else { set env(http_proxy) "http://$proxy:$port/" } set env(http_noproxy) $noproxy set fd [open $itk_option(-configfile) w] puts $fd "http_proxy: $env(http_proxy)" puts $fd "http_noproxy: $env(http_noproxy)" close $fd } else { catch {file delete $itk_option(-configfile)} catch {unset env(http_proxy)} catch {unset env(http_noproxy)} } wm withdraw $w_ } # called when the Reset button is pressed protected method reset {} { global ::env set proxy {} set port {} set noproxy {} if {[info exists env(http_proxy)]} { if {[scan $env(http_proxy) {http://%[^:/]:%d} proxy port] != 2} { scan $env(http_proxy) {http://%[^:/]} proxy } } if {[info exists env(http_noproxy)]} { set noproxy $env(http_noproxy) } $w_.proxy config -value $proxy $w_.port config -value $port $w_.noproxy config -value $noproxy } # called when the Clear button is pressed protected method clear {} { $w_.proxy config -value {} $w_.port config -value {} $w_.noproxy config -value {} } # called when the Cancel button is pressed protected method cancel {} { wm withdraw $w_ } # Read the given config file (created by this class, see "ok" method) # and use it to initialize the environment variables for a proxy server # (see tclutil/util/src/HTTP.C). public proc check_proxies {file} { global ::env if {[file exists $file]} { set fd [open $file] while {[gets $fd line] != -1} { if {[regsub {http_proxy: (.*)} $line {\1} http_proxy]} { set env(http_proxy) $http_proxy } elseif {[regsub {http_noproxy: (.*)} $line {\1} http_noproxy]} { set env(http_noproxy) $http_noproxy } } close $fd } } # -- options -- # set the width for displaying labels itk_option define -configfile configFile ConfigFile {} } skycat-3.1.2-starlink-1b/cat/library/QueryResult.tcl000066400000000000000000000172341215713201500223670ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: QueryResult.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # QueryResult.tcl - Widget for viewing the results of a catalog query. # # See man page QueryResult(n) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 5 Jan 98 created # A QueryResult widget frame is defined as a TableList (see TableList(n) # in the tclutil package) with some methods added for catalog # support. It is used to display the results of a catalog query. See # also AstroQuery(n) for the query paramaters, AstroCat(n) for the main # window or classes derived from these in the skycat package. # These classes do not deal with images - only catalog data. See the # derived classes in the skycat package for image support. itcl::class cat::QueryResult { inherit util::TableList # constructor constructor {args} { eval itk_initialize $args } # pop up a dialog to sort the list public method sort_dialog {} { if {[llength $headings_] == 0} { info_dialog "Please make a query first so that the column names are known" $w_ return } TableList::sort_dialog } # This method is called whenever a result row is selected. # If the row edit window exists, update it with the values for # the new row. public method select_result_row {} { if {[winfo exists $w_.ef]} { $w_.ef configure -values [lindex [get_selected] 0] } } # pop up a dialog to select table columns to display public method select_columns {} { if {[llength $headings_] == 0} { info_dialog "Please make a query first so that the column names are known" $w_ return } TableList::layout_dialog } # reset table dialogs if needed public method reset {} { foreach w "$w_.tblsort $w_.tblcfg" { if {[winfo exists $w]} { $w reset } } $astrocat showcols {} $astrocat sortcols {} } # save the current data to a local catalog public method save_as {} { set file [filename_dialog [pwd] * $w_] if {"$file" != ""} { if {[file isfile $file]} { if {![confirm_dialog "File: `[file tail $file]' exists \ - Do you want to overwrite it ?" $w_]} { return } if {[file isdir $file]} { error_dialog "File: `[file tail $file]' is a directory" $w_ return } } save_to_file $file $info_ $headings_ } } # add the rows in the current listing to a local catalog file public method add_to {} { if {[llength $info_] == 0} { error_dialog "There are no rows to save" $w_ return; } add_rows $info_ $headings_ } # add the currently selected rows to a local catalog file public method add_selected {} { set info [get_selected] if {[llength $info] == 0} { error_dialog "No rows are selected" $w_ return; } add_rows $info $headings_ } # add the given info rows (result of a query) to a local catalog file with # the given headings. The user selects the name of the catalog file. public method add_rows {info headings} { if {[llength $headings] == 0} { error_dialog "There is no data to save" $w_ return; } set file [filename_dialog [pwd] * $w_] if {"$file" != ""} { if {! [file isfile $file]} { if {[confirm_dialog "File: `[file tail $file]' does not exists \ - Do you want to create it ?" $w_]} { save_to_file $file $info $headings } } else { if {[file isdir $file]} { error_dialog "File: `[file tail $file]' is a directory" $w_ return } save_to_file $file $info $headings 1 } } } # remove the currently selected rows from a local catalog file public method remove_selected {} { set file [$astrocat longname] set info [get_selected] if {[llength $info] == 0} { error_dialog "No rows are selected" $w_ return; } if {! [confirm_dialog "Remove selected objects?" $w_]} { return } if {[catch {$astrocat remove $file $info $equinox $headings_} msg]} { error_dialog $msg $w_ return } } # save the given info (the result of query) to the given catalog file, # using the given column headings. # If iflag is 1, insert rows in the existing file. public method save_to_file {file info headings {iflag 0}} { if {[catch {$astrocat save $file $iflag $info $equinox $headings} msg]} { error_dialog "error saving rows to file: $msg" $w_ return 1 } return 0 } # Pop up a dialog to enter the data for a new object for a local catalog. # The command is evaluated after the users enters the new data. public method enter_new_object {{command ""}} { catch {delete object $w_.ef} EnterObject $w_.ef \ -title {Please enter the data for the object below:} \ -labels $headings_ \ -center 0 \ -command [code $this enter_object $command] } # check that the given row contains valid data for a catalog # and return 0 if OK public method check_row {data} { if {[catch {$astrocat checkrow $data} msg]} { error_dialog $msg return 1 } return 0 } # This method is called with the data for a new object to add to a local # catalog. The row is added to the local catalog file and the # command is evaluated. If a row with the given id already exists, it is # updated (after confirmation). public method enter_object {command info} { if {[check_row $info]} { return } # see if this id already exists... set id [lindex $info [$astrocat id_col]] set row [lindex [$astrocat query -id $id] 0] set file [$astrocat longname] set append 1 if {[llength $row]} { if {"$row" == "$info"} { info_dialog "No changes were made to $id." return } # object with this id already exists if {! [confirm_dialog "Update object $id ?" $w_]} { return } # replace with new data if {[save_to_file $file [list $info] $headings_ $append] != 0} { return } } else { # must be a new object if {! [confirm_dialog "Enter new object with id $id ?" $w_]} { return } save_to_file $file [list $info] $headings_ $append } # eval caller supplied command after change eval $command } # pop up a window so that the user can edit the selected object(s). # The optional command is evaluated with no args if the object is # changed. public method edit_selected_object {{command ""}} { catch {destroy $w_.ef} set values [lindex [get_selected] 0] if {[llength $values] == 0} { error_dialog "No rows are selected" $w_ return; } EnterObject $w_.ef \ -title {Please enter the data for the object below:} \ -labels $headings_ \ -values $values \ -command [code $this enter_object $command] } # update the table sort and column display options from the # catalog entry public method update_options {} { # sort cols config \ -sort_cols [$astrocat sortcols] \ -sort_order [$astrocat sortorder] # show/hide cols set show_cols [$astrocat showcols] if {[llength $show_cols]} { set_options $headings_ Show 0 set_options $show_cols Show 1 # $order should be a list of all columns (visible or not) # in the order they should be displayed set order $show_cols foreach i $order { set a($i) 1 } foreach i $headings_ { if {! [info exists a($i)]} { lappend order $i } } config -order $order } } # -- options -- # astrocat (C++ based) object for accessing catalogs public variable astrocat # equinox of ra and dec columns in query result public variable equinox 2000 } skycat-3.1.2-starlink-1b/cat/library/SearchConfig.tcl000066400000000000000000000176251215713201500224220ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: SearchConfig.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # SearchConfig.tcl - Widget for editing a list of search columns # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 22 Oct 97 created itk::usual SearchConfig {} # Class SearchConfig defines dialog window for editing the list of # search columns for the AstroCat catalog window. This allows you # to specify a list of columns to search by, save the information # in a local catalog config file and reconfigure the current windows # to include entries for the search columns. itcl::class cat::SearchConfig { inherit util::TopLevelWidget # constructor constructor {args} { eval itk_initialize $args } # called after options have been evaluated protected method init {} { wm title $w_ "Search Columns for $catalog ($itk_option(-number))" wm iconname $w_ "Search Columns for $catalog" add_tables add_dialog_buttons fill_tables make_short_help } # add a table listing the search columns and entries to edit protected method add_tables {} { pack [set dtab \ [DoubleTableList $w_.dtab \ -selectmode extended \ -command [code $this update_selection] \ -updown 1]] \ -side top -padx 2m -pady 2m -fill both -expand 1 set left_ [$dtab component left] set right_ [$dtab component right] bind [$left_ component listbox] +[code $this select_row $left_] bind [$right_ component listbox] +[code $this select_row $right_] $left_ config -headings {{Search Columns} MinLabel MaxLabel} $right_ config -headings {{Other Columns} MinLabel MaxLabel} # hide some columns $left_ set_option MinLabel Show 0 $left_ set_option MaxLabel Show 0 $right_ set_option MinLabel Show 0 $right_ set_option MaxLabel Show 0 $left_ config -width 12 -height 4 $right_ config -width 12 -height 4 # add entries for editing (left) table pack [set f [frame $w_.f -borderwidth 3 -relief groove]] \ -side top -padx 2m -pady 2m -ipadx 2m -ipady 2m -fill x pack \ [set col_ [LabelEntry $f.col \ -text "Column name:" \ -relief groove \ -disabledforeground black \ -state disabled \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set min_ [LabelEntry $f.min \ -text "Label for min value:" \ -command [code $this set_row] \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set max_ [LabelEntry $f.max \ -text "Label for max value:" \ -command [code $this set_row] \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ -side top -fill x -expand 1 } # fill the left and right tables with the column info protected method fill_tables {} { # get current search cols if {[catch {set search_cols [$astrocat searchcols]} msg]} { error_dialog $msg quit } if {[llength $search_cols]} { $left_ config -info $search_cols $left_ select_row 0 select_row $left_ } # set other available columns on right side foreach i $search_cols { set a([lindex $i 0]) 1 } set l {} foreach i $columns { if {![info exists a($i)]} { lappend l [list $i "Min $i" "Max $i"] } } $right_ config -info $l } # Update the selected row with the typed in values protected method set_row {args} { set row [get_row] if {"$row" != "" && "$sel_" != ""} { $left_ set_row $sel_ $row set sel_ $row } incr save_needed_ } # called when a table row (left or right) is selected protected method select_row {tab} { set sel_ [lindex [$tab get_selected] 0] lassign $sel_ col min max $col_ config -value $col $min_ config -value $min $max_ config -value $max if {"$tab" == "$left_"} { $w_.update config -state normal } else { $w_.update config -state disabled } } # update the selection in the listboxes after a change protected method update_selection {} { if {[llength [$left_ get_selected]]} { select_row $left_ } elseif {[llength [$right_ get_selected]]} { select_row $right_ } else { $col_ config -value {} $min_ config -value {} $max_ config -value {} } incr save_needed_ } # return a row based on the current entries or empty if not all of # the entries contain values protected method get_row {} { set row {} foreach w {col_ min_ max_} { set val [[set $w] get] if {"$val" == ""} { error_dialog "Please specify the column name and the min and max labels" return } lappend row $val } return $row } # apply the changes and close the window protected method apply {{ask 0}} { if {$save_needed_} { if {[catch {$astrocat searchcols [join [$left_ get_contents] :]} msg]} { error_dialog $msg $w_ return } if {!$ask || [confirm_dialog "Do you want to save your changes in the default catalog \ config file (~/.skycat/skycat.cfg)?" $w_]} { cat::CatalogInfo::save {} $w_ $ask set save_needed_ 0 } if {"$command" != ""} { eval $command } } quit } # add the dialog button frame protected method add_dialog_buttons {} { # dialog buttons pack [frame $w_.buttons -borderwidth 2 -relief raised] \ -side top -fill x pack \ [button $w_.ok \ -text "OK" \ -command [code $this apply]] \ [button $w_.cancel \ -text "Cancel" \ -command [code $this quit]] \ [button $w_.update \ -text "Update" \ -state disabled \ -command [code $this set_row]] \ -side left -expand 1 -padx 15m -pady 2m -in $w_.buttons } # add a short help window and set the help texts protected method make_short_help {} { TopLevelWidget::make_short_help add_short_help $left_ {List of search columns to display as entries in catalog window} add_short_help $right_ {List of other column names, select+click arrow buttons to move} add_short_help $col_ {Column name: name of selected search column (read-only)} add_short_help $min_ {Min value label: to be displayed on left side of catalog window} add_short_help $max_ {Max value label: to be displayed on right side of catalog window} add_short_help $w_.ok {OK: Apply changes and close window} add_short_help $w_.cancel {Cancel changes and close window} add_short_help $w_.update {Update list at top with current values} } # -- options -- # command to eval when done public variable command {} # catalog name public variable catalog {none} # astrocat (C++ based) object public variable astrocat # list of column headings for the catalog public variable columns {} # font to use for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # font to use for values itk_option define -valuefont valueFont ValueFont TkFixedFont # set the width for displaying labels itk_option define -labelwidth labelWidth LabelWidth 18 # set the anchor for labels itk_option define -anchor anchor Anchor e # -- protected vars -- # left listbox widget protected variable left_ # right listbox widget protected variable right_ # Widget displaying column name: name of selected search column (read-only) protected variable col_ # Widget displaying min value label. protected variable min_ # Widget displaying max value label. protected variable max_ # table row last selected protected variable sel_ {} # set to true if the catalog configuration has been edited and needs to be saved protected variable save_needed_ 0 } skycat-3.1.2-starlink-1b/cat/library/SymbolConfig.tcl000066400000000000000000000337411215713201500224570ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: SymbolConfig.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # SymbolConfig.tcl - Widget for editing plot symbol information # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 22 Oct 97 created itk::usual SymbolConfig {} # Class SymbolConfig defines a dialog window for editing the plot symbol # information for the AstroCat catalog window. The dialog lets you select # which symbols to plot under given conditions, the size, color, shape # of the symbols, specified as expressions in terms of column name variables. itcl::class cat::SymbolConfig { inherit util::TopLevelWidget # constructor constructor {args} { eval itk_initialize $args } # called after options have been evaluated protected method init {} { wm title $w_ "Plot Symbols for $catalog ($itk_option(-number))" wm iconname $w_ "Plot Symbols for $catalog" add_table add_dialog_buttons fill_table make_short_help } # add a table listing the symbols and some widgets to edit them protected method add_table {} { # table listing overview at top pack [set table_ \ [TableList $w_.table \ -height 3 \ -exportselection 0 \ -headings {Columns Symbol Color Ratio Angle Label Condition Size Units}]] \ -side top -padx 1m -pady 1m -fill both -expand 1 bind [$w_.table component listbox] <1> +[code $this update_table] bind [$w_.table component listbox] +[code $this select_row] # lower frame pack [set f [frame $w_.f]] \ -side top -padx 2m -pady 2m -ipadx 2m -ipady 2m -fill both -expand 1 # double listbox for choosing column names pack [frame $f.cols] \ -side top -fill x -expand 1 -ipady 2m pack \ [LabelWidget $f.cols.label \ -text "Columns:" \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -labelfont $itk_option(-labelfont)] \ -side left pack \ [DoubleList $f.cols.dlist \ -updown 0 \ -height 2 \ -width 12 \ -lefttitle Used \ -righttitle {Not Used}] \ -side left -padx 2m -fill both -expand 1 set left_ [$f.cols.dlist component left] set right_ [$f.cols.dlist component right] # set default contents of right list to catalog cols $right_ set_contents $columns pack \ [set symbol_ [LabelMenu $f.symbol \ -text "Symbol:" \ -relief raised \ -borderwidth 3 \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set color_ [LabelMenu $f.color \ -text "Color:" \ -relief raised \ -borderwidth 3 \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set ratio_ [LabelEntry $f.ratio \ -text "Ratio:" \ -state disabled \ -command [code $this apply] \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set angle_ [LabelEntry $f.angle \ -text "Angle:" \ -state disabled \ -command [code $this apply] \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set label_ [LabelEntry $f.label \ -text "Label:" \ -labelwidth $itk_option(-labelwidth) \ -command [code $this apply] \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set cond_ [LabelEntry $f.cond \ -text "Condition:" \ -labelwidth $itk_option(-labelwidth) \ -command [code $this apply] \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set size_ [LabelEntry $f.size \ -text "Size:" \ -labelwidth $itk_option(-labelwidth) \ -command [code $this apply] \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ [set units_ [LabelMenu $f.units \ -text "Units:" \ -relief raised \ -borderwidth 3 \ -labelwidth $itk_option(-labelwidth) \ -anchor $itk_option(-anchor) \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont)]] \ -side top -fill x -expand 1 -ipady 2m # fill the overview table if {[catch {set symbols [$astrocat symbol]} msg]} { error_dialog $msg quit } # add menu choices foreach i {circle square cross triangle diamond plus compass ellipse line arrow} { $symbol_ add \ -bitmap symb_$i \ -value $i \ -command [code $this set_symbol $i] } $color_ add \ -label "default (black&white)" \ -background [option get $color_ *Menu*background Background] \ -value {} foreach i $itk_option(-colors) { $color_ add \ -label { } \ -value $i \ -background $i } foreach i { {{default (image pixels)} {}} {{WCS degrees in J2000} {deg 2000}} {{WCS degrees in B1950} {deg 1950}}} { $units_ add \ -label [lindex $i 0] \ -value [lindex $i 1] } } # called when a symbol is selcted from the menu protected method set_symbol {symbol} { if {"$symbol" == "ellipse" \ || "$symbol" == "compass"\ || "$symbol" == "plus"\ || "$symbol" == "line"\ || "$symbol" == "arrow"} { set state normal } else { set state disabled } $ratio_ config -state $state $angle_ config -state $state } # fill the table with the symbol info for the current catalog protected method fill_table {} { set info {} foreach i [$astrocat symbol] { lassign $i cols sym expr lassign $sym symbol color ratio angle label cond lassign $expr size units lappend info [list $cols $symbol $color $ratio $angle $label $cond $size $units] } if {[llength $info]} { $table_ config -info $info $table_ select_row 0 select_row } else { after 1000 \ [code info_dialog \ "Note: This catalog does not have any plot symbols yet. \ To add a symbol, fill out the form below and then select 'Add Symbol'" $w_] } } # update the table display from the entries and return an empty # string if all was OK protected method update_table {args} { if {[catch {set row [get_row]} msg]} { error_dialog $msg return ERROR } if {"$row" != "" && "$sel_" != "" && "$sel_" != "$row"} { $table_ set_row $sel_ $row set sel_ $row incr save_needed_ } } # apply the current changes protected method apply {args} { if {"[update_table]" == "ERROR"} { return } save } # save the changes in the default config file protected method save {{ask 0}} { if {$save_needed_} { set info {} foreach i [$table_ get_contents] { if {[llength $i] == 9} { lassign $i cols symbol color ratio angle label cond size units lappend info [list $cols \ [list $symbol $color $ratio $angle $label $cond] \ [list $size $units]] } } if {[catch {$astrocat symbol [join $info :]} msg]} { error_dialog $msg $w_ return } if {!$ask || [confirm_dialog "Do you want to save your changes in the default catalog \ config file (~/.skycat/skycat.cfg)?" $w_]} { cat::CatalogInfo::save {} $w_ $ask set save_needed_ 0 } if {"$command" != ""} { eval $command } } } # called when a table row is selected protected method select_row {} { set sel_ [lindex [$table_ get_selected] 0] lassign $sel_ cols symbol color ratio angle label cond size units # put current columns used in the left box and others in the right foreach i $cols { set a($i) 1 } set other {} foreach i $columns { if {! [info exists a($i)]} { lappend other $i } } $left_ set_contents $cols $right_ set_contents $other $symbol_ config -value $symbol $color_ config -value $color $ratio_ config -value $ratio $angle_ config -value $angle $label_ config -value $label $cond_ config -value $cond set_symbol $symbol $size_ config -value $size $units_ config -value $units $w_.remove config -state normal } # return a table row based on the current entries and menus or empty # if no data was enterred. Raises an error if there was something wrong. protected method get_row {} { set row {} set cols [$left_ get_contents] set symbol [$symbol_ get] set color [$color_ get] set ratio [$ratio_ get] set angle [$angle_ get] set label [$label_ get] set cond [$cond_ get] set size [$size_ get] set units [$units_ get] # test the variable usage in the expressions foreach var $cols { set $var 1 } if {"$size" == ""} { if {[llength $cols]} { error "Please specify a value for size (expr or const) in $units" } return } foreach var {size ratio angle cond} { set v [set $var] if {"$v" != ""} { if {[catch {expr [set $var]} msg]} { error "in $var expr: $msg" } } } # label may also contain col name vars, but may not be numeric if {[catch {subst $label} msg]} { error "error in label '$label': $msg" } return [list $cols $symbol $color $ratio $angle $label $cond $size $units] } # add a new row to the table public method add_row {} { if {[catch {set row [get_row]} msg]} { error_dialog $msg return } if {"$row" != ""} { # no duplicates foreach i [$table_ get_contents] { if {"$i" == "$row"} { info_dialog "To add a new symbol, change some parameters and press Add Symbol" return [update_table] } } $table_ add_row $row $table_ select_row end select_row incr save_needed_ } } # remove the selected row from the table public method remove_row {} { $table_ remove_selected select_row incr save_needed_ } # apply the changes and close the window public method ok {} { apply quit } # add the dialog button frame protected method add_dialog_buttons {} { # dialog buttons pack [frame $w_.buttons -borderwidth 2 -relief raised] \ -side top -fill x pack \ [button $w_.ok \ -text "OK" \ -command [code $this ok]] \ [button $w_.apply \ -text "Apply" \ -command [code $this apply]] \ [button $w_.cancel \ -text "Cancel" \ -command [code $this cancel]] \ [button $w_.add \ -text "Add Symbol" \ -command [code $this add_row]] \ [button $w_.remove \ -text "Remove Symbol" \ -state disabled \ -command [code $this remove_row]] \ -side left -expand 1 -padx 6m -pady 2m -in $w_.buttons } # called when the cancel button is pressed. Delete the window so that # it will be reinitialized next time public method cancel {} { destroy $w_ } # add a short help window and set the help texts protected method make_short_help {} { TopLevelWidget::make_short_help add_short_help $table_ {Table listing symbols to plot, one symbol per row, click to select} add_short_help $symbol_ {Symbol to use to plot stars or other objects} add_short_help $color_ {Color in which to draw the symbol} add_short_help $ratio_ {Ratio of width to height, expr using column names as variables} add_short_help $angle_ {Angle of rotation for symbol, expr using column names as variables} add_short_help $label_ {Label for symbol, using column names as variables} add_short_help $cond_ {Condition for displaying symbol, using column names as variables} add_short_help $size_ {Size of symbol, expression using column names as variables} add_short_help $units_ {Units in which to interpret the size of the symbol} add_short_help $left_ {List of column names used as variables for Size, Ratio, Angle, Label, Condition} add_short_help $right_ {List of unused column names} add_short_help $w_.ok {OK: Apply changes and close window} add_short_help $w_.apply {Apply the current changes} add_short_help $w_.cancel {Cancel changes and Close window} add_short_help $w_.add {Add the current entry as a new plot symbol (must be unique)} add_short_help $w_.remove {Remove the selected plot symbol entry} } # -- options -- # command to eval when done public variable command {} # catalog name public variable catalog {none} # astrocat (C++ based) object public variable astrocat # list of column headings for the catalog public variable columns {} # font to use for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # font to use for values itk_option define -valuefont valueFont ValueFont TkFixedFont # set the width for displaying labels itk_option define -labelwidth labelWidth LabelWidth 8 # color list for color menu itk_option define -colors colors Colors { white black grey yellow red green blue lightblue pink purple orange violet navy turquoise cyan gold tan lavender bisque chartreuse } # set the anchor for labels itk_option define -anchor anchor Anchor e # -- protected vars -- # TableList widget displaying plot info protected variable table_ # symbol shape menu protected variable symbol_ # symbol color menu protected variable color_ # symbol ratio entry protected variable ratio_ # symbol angle entry protected variable angle_ # symbol label entry protected variable label_ # symbol condition entry protected variable cond_ # symbol size entry protected variable size_ # symbol units entry protected variable units_ # left column selection listbox protected variable left_ # right column selection listbox protected variable right_ # table row last selected protected variable sel_ {} # set to true if the catalog configuration has been edited and needs to be saved protected variable save_needed_ 0 } skycat-3.1.2-starlink-1b/cat/library/archive.xpm000066400000000000000000000010651215713201500215210ustar00rootroot00000000000000/* XPM */ static char * archive_xpm[] = { "16 16 9 1", " c #FFFFFFFF0000", ". c #C30BC30BC30B", "X c #FFFFFFFFFFFF", "o c #FFFF659530C2", "O c #65956595CF3C", "+ c #FFFF00000000", "@ c #9A699A69FFFF", "# c #820782078207", "$ c #C30BC30BC30B", " ..X.X.. .......", ". . . . ........", ".. o XOOOOOO..", "X + X@XOXO.", " oo+ +o#.@X@OXXO", "XX + X@XOOOO", ".. o .X@X@X@XO", ". . O @ @X@X@X@O", "X..XO@X@X@X@X@XO", "... O @X@X@X@X@O", "....O@X@X@X@X@XO", "....OX@X@X@X@X@O", "....O@X@X@X@X@XO", "....OX@X@X@X@X@O", ".$$.O@X@X@X@X@XO", "....OOOOOOOOOOOO"}; skycat-3.1.2-starlink-1b/cat/library/catalog.xpm000066400000000000000000000007411215713201500215120ustar00rootroot00000000000000/* XPM */ static char * catalog_xpm[] = { "16 16 5 1", " c #C30BC30BC30B", ". c #00000000FFFF", "X c #FFFFFFFFFFFF", "o c #000000008207", "O c #820782078207", " ", " .......... ", " .XXXXXXX.X. ", " ....XXXXX.XXo", " ..OXXXooOO oooo", " .XoXX. oXXXXXXo", ". XoXXXXXoO..oXo", ". XoXX.O oXXXXXo", ". XoXXXXXoO..oXo", ". XoXX.OOoXXXXXo", " . oXXXXoO...oXo", " ..OXXOooXXXXXXo", "...oooo ....oXo", ".o .XXXXXXXXXXo", "o oooooooooooo", " "}; skycat-3.1.2-starlink-1b/cat/library/catdefaults.tcl000066400000000000000000000044241215713201500223570ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: catdefaults.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # catdefaults.tcl - X defaults for itk catalog widgets # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 20 May 96 created # itk widget defaults (normally you'd put these in the itk sources, but # putting them here makes it easier to "pre-load" the classes for the single # binary version... proc cat::setXdefaults {} { #set menuBg DeepSkyBlue3 set menuBg #009acd set menuFg White option add *foreground Black option add *background Gray77 option add *DisabledForeground Gray90 option add *Button*foreground NavyBlue option add *Button*background Gray77 option add *Canvas*insertBackground white option add *Text.foreground Black option add *Listbox.foreground Black option add *Entry.foreground Black option add *Scrollbar.foreground Gray77 option add *Scrollbar.Width 14 option add *selectForeground Gray77 option add *selectBackground Black option add *highlightThickness 0 option add *Text.highlightThickness 2 option add *Entry.highlightThickness 2 option add *highlightBackground Gray77 option add *highlightColor Black #option add *shelp*Background FloralWhite #option add *plotBackground gray80 set labelFont TkDefaultFont option add *Listbox.font TkFixedFont option add *Entry.font TkFixedFont option add *titleFont TkDefaultFont option add *Button.Font $labelFont option add *Label.Font $labelFont option add *Menu.Font $labelFont option add *Menubutton.Font $labelFont option add *Message.Font $labelFont option add *Scale.Font $labelFont option add *Text.Font TkFixedFont option add *QueryResult.relief sunken option add *QueryResult.borderwidth 3 option add *QueryResult.font TkFixedFont option add *QueryResult.headingFont TkDefaultFont option add *QueryResult.headingLines 1 option add *QueryResult.titleFont TkDefaultFont option add *Menu*background $menuBg option add *Menu*foreground $menuFg option add *Menubutton*background $menuBg option add *menubar*background $menuBg option add *Menubutton*foreground $menuFg } skycat-3.1.2-starlink-1b/cat/library/imagesvr.xpm000066400000000000000000000020321215713201500217100ustar00rootroot00000000000000/* XPM */ static char * imagesvr_xpm[] = { "16 16 32 1", " c #CF3CCF3CCF3C", ". c #8E388E388E38", "X c #7DF77DF77DF7", "o c #AEBAAEBAAEBA", "O c #9E799E799E79", "+ c #6DB66DB66DB6", "@ c #C30BC30BC30B", "# c #4D344D344D34", "$ c #3CF34D346DB6", "% c #4D3486174514", "& c #55556DB63CF3", "* c #5D755D755D75", "= c #30C230C26595", "- c #3CF33CF33CF3", "; c #1C711C711C71", ": c #30C29A696595", "> c #DF7DDF7DDF7D", ", c #000000000000", "< c #04105D754514", "1 c #0C300C300C30", "2 c #BEFBBEFBBEFB", "3 c #451414510410", "4 c #A6999E79BEFB", "5 c #EFBEEFBEEFBE", "6 c #6DB665958617", "7 c #F3CEF3CEFFFF", "8 c #F3CEF3CEF3CE", "9 c #2CB22CB22CB2", "0 c #FFFFFFFFFFFF", "q c #FFFFF3CEF3CE", "w c #C71B9E799658", "e c #9E7924920410", " .XoO.ooOooOO.+@", "o#$#$$#$%&O..+*@", "o=*.o+-;-:*-#-$@", "O*.>O-,,;&<;;,;@", "X-oo1,,=-+;1,,,@", "+,*-,;#>.;;,,,;@", "#,1,,. 2 ;,,,,,@", "#,;,#> O;3,,,,@", "*,,;O>> 4*X.*,;@", "-,;+2.++O5 .>+,@", "++6O5*,;*O7 ++;@", ".o2887.,9$8>+;9@", "+ ;0000O*+q2;+;@", "$oo$XXo8ww9o9.;@", "*2*,,,,9;4;;w;e@", "*$9;,;,;9;.99$9@"}; skycat-3.1.2-starlink-1b/cat/library/local.xpm000066400000000000000000000007371215713201500211770ustar00rootroot00000000000000/* XPM */ static char * local_xpm[] = { "16 16 5 1", " c #C30BC30BC30B", ". c #00000000FFFF", "X c #FFFFFFFFFFFF", "o c #00000000FFFF", "O c #000000008207", " ", " .......... ", " .XXXXXXX.X. ", " .XooXooX.XXO ", " oXXXXXXXoOOO ", " oXXXXXXXXXXO ", " oXooXooXooXO ", " oXXXXXXXXXXO ", " oXXXXXXXXXXO ", " oXooXooXooXO ", " oXXXXXXXXXXO ", " oXXXXXXXXXXO ", " oXooXooXooXO ", " .XXXXXXXXXXO ", " OOOOOOOOOOOO ", " "}; skycat-3.1.2-starlink-1b/cat/library/mkIndex.tcl000077500000000000000000000003161215713201500214560ustar00rootroot00000000000000#!../bin/cat_wish # # mkIndex.tcl - generate a tclIndex file in the current directory # "@(#) $Id: mkIndex.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" package require Itcl auto_mkindex . *.tcl exit 0 skycat-3.1.2-starlink-1b/cat/library/namesvr.xpm000066400000000000000000000010131215713201500215440ustar00rootroot00000000000000/* XPM */ static char * namesvr_xpm[] = { "16 16 7 1", " c #C30BC30BC30B", ". c #208120812081", "X c #30C230C230C2", "o c #9A69CF3CFFFF", "O c #000000000000", "+ c #451445144514", "@ c #FFFF9A6930C2", " ", " .X.X.X.X.X.X. ", " XoooooooooooO ", " .oX++X++X+ooO ", " XoooooooooooO ", " .o@@@oooooooO ", " Xo@@@o++X+ooO ", " .oooooooooooO ", " Xo@@@oooooooO ", " .o@@@o++X+ooO ", " XoooooooooooO ", " .o@@@oooooooO ", " Xo@@@o++X+ooO ", " XoooooooooooO ", " .OOOOOOOOOOOO ", " "}; skycat-3.1.2-starlink-1b/cat/library/nsfolder.xpm000066400000000000000000000007221215713201500217130ustar00rootroot00000000000000/* XPM */ static char * nsfolder_xpm[] = { "15 16 5 1", " c #C30BC30BC30B", ". c #9A699A69FFFF", "X c #65956595CF3C", "o c #FFFFFFFFFFFF", "O c #000000000000", " ", " ", " ..... ", " . . . . ", ". . . . XXXXXX ", ".ooooooooooooX ", ".o . . . . . XO", ".o. . . . . .XO", ".o . . . . . XO", ".o. . . . . .XO", ".o . . . . . XO", ".o. . . . . .XO", "XXXXXXXXXXXXXXO", " OOOOOOOOOOOOOO", " ", " "}; skycat-3.1.2-starlink-1b/cat/library/nsopenfold.xpm000066400000000000000000000010161215713201500222430ustar00rootroot00000000000000/* XPM */ static char * nsopenfold_xpm[] = { "16 16 7 1", " c #C30BC30BC30B", ". c #9A699A69FFFF", "X c #FFFFFFFFFFFF", "o c #65956595CF3C", "O c #000000000000", "+ c #820782078207", "@ c #000034D33CF3", " ", " ", " ..... ", " .XXXXX. ", " .X. . .Xoooooo ", " .X . . .XXXXXo ", " .X. . . . . .oO", "oooooooooooo. oO", "oXXXXXXXXX O+.oO", " o. . . . . O oO", " o . . . . .@OoO", " o . . . . .@OO", " oooooooooooooO", " OOOOOOOOOOOOO", " ", " "}; skycat-3.1.2-starlink-1b/cat/man/000077500000000000000000000000001215713201500164575ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/cat/man/AstroCatalog.man3000066400000000000000000000377501215713201500216360ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: AstroCatalog.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 17 Oct 95 Created # NAME AstroCatalog - C++ class for accessing astromical catalogs SYNOPSIS #include "AstroCatalog.h" class AstroCatalog { ... public: AstroCatalog(const CatalogInfoEntry*); virtual ~AstroCatalog(); static AstroCatalog* open(const char* name); static int nameToWorldCoords( const char* objName, WorldCoords& pos, const char* nameServer = "simbad_ns@eso", FILE* feedback = NULL); virtual int query( const AstroQuery& q, const char* filename, QueryResult& result); const char* symbol(); const char* searchCols(); const char* sortCols(); const char* sortOrder(); const char* showCols(); const char* copyright(); int id_col(); int ra_col(); int dec_col(); int x_col(); int y_col(); int is_tcs(); int isWcs(); double equinox(); int getPreview(const char* url, char*& content_type); CatalogInfoEntry* entry(); void feedback(FILE* f); int status(); const char* name(); const char* longName(); const char* shortName(); const char* servType(); virtual int numCols() ; virtual char** colNames() ; virtual const char* colName(int col); virtual int colIndex(const char* colName); int hasCol(const char* name); int more(); int getDescription( int& numCols, char**& colNames); int getObject( const char* id, int numCols, char** colNames, QueryResult& result); int getArea( int numCols, char** colNames, const WorldCoords& pos0, const WorldCoords& pos1, double mag0, double mag1, int maxRows, const char* filename, int& numFound, QueryResult& result); int circularSearch( int numCols, char** colNames, const WorldCoords& pos, double radius0, double radius1, double mag0, double mag1, int maxRows, const char* filename, int& numFound, QueryResult& result); int searchClosestStar( int numCols, char** colNames, const WorldCoords& pos, double mag0, double mag1, QueryResult& result); int CatalogSearch( int numCols, char** colNames, int numSearchCols, char** searchCols, char** minVals, char** maxVals, int maxRows, const char* filename, int& numFound, QueryResult& result); static const char* getError(); static void clearError(); }; DESCRIPTION This class manages access to astronomical catalogs. The main entry point is the "open" method, which returns a pointer to an AstroCatalog object to be used to access the named catalog. This object should be deleted with "delete" when no longer needed. CATALOG SERVERS This class communicates with catalog servers via HTTP requests. The lists of servers and how to access them are kept in configuration files, which are accessed via HTTP or read from local files. The default catalog config file is a hard coded URL: http://archive.eso.org/skycat/skycat2.0.cfg The default can be overridden by defining the environment variable CATLIB_CONFIG to another valid HTTP URL. For compatibility with previous versions, the environment variable SKYCAT_CONFIG may also be used. LOCAL CATALOGS If the catalog name passed to the open method is the name of a file, it is taken to be a local catalog file in tab table format. This is the same format used by the Starbase utilities. A local catalog is an ASCII file containing an optional title and header information followed by the column headings, a dashed line and the data rows. The columns are separated by tabs. This is also the format of query results returned via HTTP from remote catalog servers. Example: Table1 # comment line # The header may contain catalog config information... symbol: mag circle 15-$mag search_cols: mag "Brightest (min)" "Faintest (max)" id ra dec pos-e mag ------ -- --- ----- --- A00050 3:19:28 8:26:29 0.2 13.49 A00098 3:19:32 8:34:15 0.4 13.40 A00288 3:19:21 8:31:19 0.2 13.13 A00314 3:19:44 8:30:58 0.2 13.98 The format of a local catalog is the same as the format of the result of a query to a remote catalog. The header may contain comments (with '#') and optional configuration information in the same format as the catalog config files. The pointer returned from the open method for files is a pointer to a LocalCatalog object, a subclass of AstroCatalog specialized in dealing with local catalogs. The interface is the same for remote and local catalogs, only the implementation is different in some ways (some virtual methods are redefined in the derived class). UNITS Unless otherwise stated, the units for all radius values are in arcmin for catalogs that support World Coordinates and image pixels for catalogs that do not. A catalog is considered to support World Coordinates if the values of ra_col and dec_col in the catalog config entry are valid (they are 1 and 2 by default). If x_col and y_col were given, the catalog is considered to be using image pixel coordinates. Floating point values for RA and DEC are always in degrees. The default equinox is J2000. QUERY PARAMETERS Parameters for catalog searches are checked to make sure they are valid and in the correct range. A radius value must be between 0.0 and 300.0 arcmin. A magnitude may have any value. For ranges, such as min and max radius and min and max magnitude, the order of the arguments is not important, since they will be rearranged as needed. If both min and max values are 0.0, they are ignored for that search. If you really want to search for objects with "0.0" magnitude, specify a range with small values that are not zero, for example, min/max mag = (-0.0001, +0.0001). FORMAT OF QUERY RESULTS Catalog query results are returned in a class QueryResult object. This object is used to access values based on a row and column index or column name. Overloaded "get" methods allow column values to be retrieved as int, short, float, double, char, char*, or WorldCoords (internally, the values are stored as strings). MEMORY MANAGEMENT Memory is allocated internally for the query results. It is the caller's responsibility to delete the result object when no longer needed. PUBLIC METHODS open(name) Open the named catalog and return a pointer an AstroCatalog (or LocalCatalog) object allocated for the catalog, or NULL if errors occur. Arguments: name (in) - catalog name or file name for local catalogs Return value: pointer to an allocated AstroCatalog or derived object query(q, filename, result) Pass the given query to the catalog server and return the number of objects found. Arguments: q (in ) - AstroQuery object, describes query. filename (in ) - Optional file name: if not NULL, a copy of the results from the server is written to the given file. result (out) - Set on successful return to contain and manage the query results. Return value: The number of objects found, or -1 if errors occured. nameToWorldCoords(objName, pos, nameServer, feedback) Use a name server catalog (like simbad_ns@eso or ned_ns@eso) to get the coordinates from the object name. If feedback is not NULL, status info is written to the given open file. Arguments: objName (in ) - name of star or astronomical object pos (out) - reference to WorldCoords object result nameServer (in ) - name server to use to resolve name feedback (in ) - file pointer for user interface feedback Return value: If successful, 0, otherwise 1. getDescription(numCols, colNames) Get the number of columns and the column names for the given catalog and return 0 if all is OK. The memory for the return arrays is managed internally and should not be modified by the caller. Arguments: numCols (out) - number of catalog columns colNames (out) - reference to array of column names Return value: If successful, 0, otherwise 1. getObject(id, numCols, colNames, result) Get the values for the specified columns for the object given by "id" in the catalog and return 0 if found. The id should be a valid object id obtained by a previous catalog query. If colNames is not NULL, it should be an array of column names to fetch, otherwise all columns are fetched. The result argument is set on return to contain the results of the query. Arguments: id (in ) - object id numCols (in) - number of columns (column names) colNames (in ) - array of column names to read, or NULL to read all columns. result (in/out) - set from query result data Return value: Returns 0 if there were no errors, otherwise 1. It is not considered an error if no object was found. getArea(numCols, colNames, pos0, pos1, mag0, mag1, maxRows, filename, numfound, results) Get the values for all objects in the rectangular region given by the two world coordinate points. If mag0 and mag1 are not 0.0, they are taken to be the minimum and maximum magnitude values for the query. If colNames is not NULL, it should be an array of column names to fetch, otherwise all columns are fetched. The number of object rows returned is limited to maxRows (the more() method can be called to see if more objects would have been available). On return, numFound is set to the number of objects found and, if any were found, result is set to be used for accessing the results. If filename is not NULL, the results will be copied to the given file in the format of a local catalog. Arguments: numCols (in) - number of columns (column names) colNames (in ) - array of column names to read, or NULL to read all pos0 (in ) - world coordinates of first point pos1 (in ) - world coordinates of second point mag0 (in ) - min magnitude mag1 (in ) - max magnitude maxRows (in ) - max number of rows to return filename (in ) - if not null, write results to this file numFound (out) - number of objects found result (in/out) - set to contain query result Return value: If successful, 0, otherwise 1. circularSearch(numCols, colNames, pos, radius0, radius1, mag0, mag1, maxRows, filename, numFound, result) Get the values for all objects in the circle or ring given by the world coordinate point and the min and max radius values. If mag0 and mag1 are not 0.0, they are taken to be the minimum and maximum magnitude values for the query. If colNames is not NULL, it should be an array of column names to fetch, otherwise all columns are fetched. The number of object rows returned is limited to maxRows (the more() method can be called to see if more objects would have been available). On return, numFound is set to the number of objects found and, if any were found, result is set to be used for accessing the results. If filename is not NULL, the results will be copied to the given file in the format of a local catalog. Arguments: numCols (in) - number of columns (column names) colNames (in ) - array of column names to read, or NULL to read all pos (in ) - world coordinates of center point radius0 (in ) - min radius from center point radius1 (in ) - max radius from center point mag0 (in ) - min magnitude mag1 (in ) - max magnitude maxRows (in ) - max number of rows to return filename (in ) - if not null, write results to this file numFound (out) - number of objects found result (in/out) - filled with query result Return value: If successful, 0, otherwise 1. searchClosestStar(numCols, colNames, pos, mag0, mag1, result) Get the values for the specified columns for the object in the catalog closest to the given position and return 0 if found. If colNames is not NULL, it should be an array of column names to fetch, otherwise all columns are fetched. If mag0 and mag1 are not 0.0, they are taken to be the minimum and maximum magnitude values for the query. The result argument is set on return to contain the query results. Arguments: numCols (in) - number of columns (column names) colNames (in ) - array of column names to read, or NULL to read all columns. pos (in ) - world coordinates of point mag0 (in ) - min magnitude mag1 (in ) - max magnitude result (in/out) - set to contain the query result Return value: Returns 0 if there were no errors, otherwise 1. It is not considered an error if no object was found. CatalogSearch(numCols, colNames, numSearchCols, searchCols, minVals, maxVals, maxRows, filename, numFound, result) Get the values for all objects fulfilling the specified criteria. The criteria are given by the array of column names to compare and two arrays of the same size containing min and max values, in string format, corresponding to the column names. Null strings are ignored, so, for example, if there is no min value, only the max value will be used. If colNames is not NULL, it should be an array of column names to fetch, otherwise all columns are fetched. The number of object rows returned is limited to maxRows (the more() method can be called to see if more objects would have been available). On return, numFound is set to the number of objects found and, if any were found, "result" is set for accessing the catalog values found. If filename is not NULL, the results will be copied to the given file in the format of a local catalog Arguments: numCols (in) - number of columns (column names) colNames (in ) - array of column names to read, or NULL to read all columns. numSearchCols (in ) - number of column names to compare searchCols (in ) - array of column names to compare minVals (in ) - array of column minimum values maxVals (in ) - array of column maximum values maxRows (in ) - max number of rows to return filename (in ) - if not null, write results to this file numFound (out) - set to number of objects found result (in/out) - contains query result Return value: Returns 0 if there were no errors, otherwise 1. getError() Return the text of the most recent error message reported by the catalog classes. clearError() Reset the error message buffer to empty. numCols() Return the number of columns in result lists. colName(col) Return the name of the given column (columns are numbered starting with zero). colNames() Return an array of the catalog column names. colIndex(name) Return the catalog column index for the given column name. hasCol(name) Return true if the catalog contains the given column. status() Return the status (after constructor) for error checking. If no errors occured, a value of 0 is returned. more() Return true if more than "maxRows" rows would have been available to the last call to query(). name() longName() shortName() Return the name (long name) or short name of this catalog. These are values defined in the catalog config file. symbol() searchCols() sortCols() sortOrder() showCols() copyright() id_col() ra_col() dec_col() x_col() y_col() is_tcs() isWcs() equinox() All these methods return the corresponding values from the catalog config entry for the current catalog. getPreview(url, content_type) Given a URL pointing to preview data (FITS image or tab table data), request the data from the server and return 0 if all is OK. On return, if there were no errors, the "ctype" argument is set to the Content-type of the result to indicate the type of data. The data is automatically decompressed if needed (if the content-type is recognized). The "tmpfile()" method gives the name of the file containing the results on success. entry() Return a pointer to the catalog config entry for the open catalog. feedback(FILE) Set the file pointer to use for http feedback during transfers. SEE ALSO AstroImage, WorldCoords(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/AstroImage.man3000066400000000000000000000072211215713201500212740ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: AstroImage.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 17 Oct 95 Created # NAME AstroImage - C++ class for accessing astromical image servers (obsolete) SYNOPSIS #include "AstroImage.h" class AstroImage { ... public: AstroImage(const AstroImage&); virtual ~AstroImage(); static AstroImage* open(const char* name); int getImage(const WorldCoords& pos, double width, double height); int getImage(const char* url); static const CatalogInfoEntry* firstCatalog(); void feedback(FILE* f); int status(); void tmpfile(const char* name); const char* tmpfile(); const char* name(); const char* longName(); const char* shortName(); }; DESCRIPTION Note: This class is obsolete. Please use class AstroCatalog, which now also has the getImage method. This class is used to retrieve images from an HTTP based image server based on a name or position and a width and height in arcmin. The main entry point is the "open" method, which returns a pointer to an AstroImage object allocated for use with the named image server. IMAGE SERVERS This class communicates with an image server via HTTP requests. The list of servers and how to access them is kept in a configuration file, which is also accessed via HTTP. The default config file is: http://archive.eso.org/skycat/skycat.cfg The default can be overridden by defining the environment variable SKYCAT_CONFIG to another valid HTTP URL. UNITS Unless otherwise stated, the units for all radius values are in arcmin. Floating point values for RA and DEC are always in degrees. The default equinox is J2000. PUBLIC METHODS open(name) Open the named image server and return a pointer to an AstroImage object allocated for it, or NULL if errors occur. Arguments: name (in ) - Image server name (long or short name from catalog config file). Return value: Pointer to an AstroImage object created for the given image server. getImage(pos, width, height) Pass a request to the image server to get a FITS file at the given position with the given size and return the status. The name of the file holding the result can be accessed as this->tmpfile(). Arguments: pos (in ) - World coordinates of center of image. width (in ) - Image width in arcmin. height (in ) - Image height in arcmin. Return value: Status: 0 if OK, 1 for error. getImage(url) Given a URL for the image, request the image from the image server and return the status. The name of the file holding the result can be accessed as this->tmpfile(). Arguments: url (in ) - HTTP URL for image. Return value: Status: 0 if OK, 1 for error. firstCatalog() Return a pointer to the first catalog config entry (for link list traversal). feedback(FILE) Set the file pointer to use for HTTP feedback during image transfers. status() Return the status (after constructor) for error checking. A return value of 0 is normal, 1 for errors. name() longName() shortName() Return the name (long name) or short name of the image server from the catalog config file. tmpfile() tmpfile(name) Get (or set) the name of the temporary file to use to hold images retrieved from the image server. SEE ALSO AstroCatalog, WorldCoords(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/AstroQuery.man3000066400000000000000000000074121215713201500213610ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: AstroQuery.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 27 Jun 96 Created # NAME AstroQuery - A class describing a query to search an astronomical catalog SYNOPSIS #include "AstroQuery.h" class AstroQuery { ... public: AstroQuery(); AstroQuery(const AstroQuery&); ~AstroQuery(); const char* id() const; int id(const char* s); const WorldCoords& pos() const; int pos(const WorldCoords& p); int pos(const WorldCoords& p1, const WorldCoords& p2); double width() const; void width(double w); double height() const; void height(double h); int dim(double w, double h); double mag1() const; double mag2() const; int mag(double m); int mag(double m1, double m2); double radius1() const; double radius2() const; int radius(double r); int radius(double r1, double r2); char** colNames() const; const char* colName(int col) const; int numCols() const; int colNames(int n, char** ar); const char* sort() const; int sort(const char* s); int maxRows() const; int maxRows(int n); int numSearchCols() const; char** searchCols() const; char** minValues() const; char** maxValues() const; int condition(int numSearchCols, char**searchCols, char**minVals, char**maxVals); }; DESCRIPTION This class is used in star catalog queries to specify which object(s) to search for. The class attributes specify the conditions for the search, such as id, name, position, radius, etc. All of the fields are optional. Fields are set to the appropriate null value, if they are not being used. PUBLIC METHODS All of the public methods in this class simply access class members (set and get member values). Methods with arguments set the member values and return the error status. Methods with no arguments return the value. id() const id(const char* s) Get or set the value for the object id to search for. pos() const pos(const WorldCoords& p) Get or set the center position for a radius search. pos(const WorldCoords& p1, const WorldCoords& p2) Calculate center position, width and height from the 2 corner positions. width() const width(w) height() const height(h) Get/set the value of the width or height fields (in arcmin). dim(double w, double h) Set the values of the width and height fields in arcmin. mag1() mag2() Get the max (or min and max) magnitude fields. mag(double m); Set the max magnitude for the query (min is 0.0). mag(double m1, double m2) Set min/max magnitude with check. radius1() const radius2() const Get max (or min and max) radius values in arcmin. radius(double r) Set the max radius for the query in arcmin (min is 0.0). radius(double r1, double r2) Set min/max radius with check. colNames() const Return array of column names. colName(int col) const Return name of given column. numCols() const Return number of columns. colNames(int n, char** ar) Set the number of columns and the column names. sort() const sort(const char* s) Get or set the sort column. maxRows() const maxRows(int n) Get or set the max number of rows to return from a query. numSearchCols() const searchCols() const minValues() const maxValues() const condition(int numSearchCols, char**searchCols, char**minVals, char**maxVals) Get or set the search conditions as min and max values for given columns (Not implemented yet). SEE ALSO AstroCatalog ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/CatalogInfo.man3000066400000000000000000000063631215713201500214350ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: CatalogInfo.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 07 Nov 97 Created # NAME CatalogInfo - C++ class managing access to catalog configuration files SYNOPSIS #include "CatalogInfo.h" class CatalogInfo { ... public: CatalogInfo(); static int load(); static int reload(); static CatalogInfoEntry* load(istream&, const char* filename = "internal"); static int load(CatalogInfoEntry*); static CatalogInfoEntry* lookup(const char* catalogName); static CatalogInfoEntry* lookup(CatalogInfoEntry* entry, const char* name); static CatalogInfoEntry* lookupFile(const char* catalogFileName); static void updateConfigEntry(istream& is, CatalogInfoEntry* entry); static int append(CatalogInfoEntry* e); static int remove(CatalogInfoEntry* e); static CatalogInfoEntry* first(); static CatalogInfoEntry* root(); }; DESCRIPTION This class is used to load, edit, access and save catalog config files either locally or via HTTP from a remote host. Config files are referenced by a URL. This may be either http:/host/file for remote config files or file:/pathname for local files. This is a static class, since all of the information is meant to be globally available. The most common method called is "lookup", which returns a pointer to the catalog entry for a given catalog name. The default config file is loaded automatically the first time it is needed. There is a hard coded default URL that points to ESO's master config file. The environment variable CATLIB_CONFIG METHODS CatalogInfo() Constructor. Note that this is a static class (all methods are static), so no instances are required. load() Load the default catalog config file (called automatically). reload() Reload the default catalog config file after it has been edited by hand. load(istream, filename) Load a config file info from the given stream (filename is used for error reporting). load(entry) Load the catalog config file given by the entry's URL field. This is used for directory entries, to follow a catalog directory link. lookup(catalogName) Return a pointer to the catalog config file entry for the given catalog. lookup(entry, name) Look up the catalog name as above, but start the search with the given directory entry rather than at the root. lookupFile(catalogFileName) Get the config entry for a local catalog from the header updateConfigEntry(istream, entry) Read catalog config keyword entries from the given stream and update the given entry values. append(entry) Append the given entry to the end of the main catalog list. remove(entry) Remove the given entry from the main catalog list. first() Return a pointer to the first config file entry under the root entry. root() Return a pointer to the root config file entry. SEE ALSO CatalogInfoEntry, AstroCatalog(3C++), Catalog Library (Overview, part of Frame doc) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/CatalogInfoEntry.man3000066400000000000000000000171741215713201500224610ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: CatalogInfoEntry.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 07 Nov 97 Created # NAME CatalogInfoEntry - C++ class representing a catalog config file entry SYNOPSIS #include "CatalogInfo.h" class CatalogInfoEntry { ... public: CatalogInfoEntry(); CatalogInfoEntry(const CatalogInfoEntry&); int operator=(const CatalogInfoEntry&); ~CatalogInfoEntry(); char* check(); void servType(const char* s); void longName(const char* s); void shortName(const char* s); void url(const char* s); void backup1(const char* s); void backup2(const char* s) void symbol(const char* s); void searchCols(const char* s); void sortCols(const char* s); void sortOrder(const char* s); void showCols(const char* s); void copyright(const char* s); void id_col(int i); void ra_col(int i); void dec_col(int i); void x_col(int i); void y_col(int i); void is_tcs(int i); void equinox(double d); const char* servType() const; const char* longName() const; const char* shortName() const; const char* url() const; const char* backup1() const; const char* backup2() const const char* symbol() const; const char* searchCols() const; const char* sortCols() const; const char* sortOrder() const; const char* showCols() const; const char* copyright() const; int id_col() const; int ra_col() const; int dec_col() const; int x_col() const; int y_col() const; int is_tcs() const; double equinox() const; int isWcs(); CatalogInfoEntry* link() const; void link(CatalogInfoEntry*e); int append(CatalogInfoEntry* e); CatalogInfoEntry* next() const; void next(CatalogInfoEntry*e); friend ostream& operator<<(ostream&, const CatalogInfoEntry&); }; DESCRIPTION Objects of class CatalogInfoEntry are used to represent catalog config file entries. The entries are linked together in the form of a hierarchical list. The next pointer points to the next catalog in the list and the link pointer points to the next list in the hierarchy. A config file entry contains the information necessary to access a catalog. The syntax for each catalog entry is: serv_type: service type, one of: catalog, namesvr, imagesvr directory, local... (see SERVICE TYPES below) long_name: long name of service for displaying short_name: short name of service url: URL used to access catalog, %ra,%dec, etc. expanded (see below) symbol: the symbol to use to plot the given column value (see SYMBOLS below) copyright: optional copyright notice to display in user interface search_cols: optional list of columns that can be searched by in the format col1 "col1 min label" "col1 max label" : ... example: search_cols: mag "Brightest (min)" "Faintest (max)" sort_cols: optional list of columns to sort by {col1 col2 ...} sort_order: optional: set to "increasing" or "decreasing" show_cols: optional list of columns to display (default: all) id_col: column containing id field ra_col: dec_col: columns containing ra and dec (for catalogs supporting WCS) x_col: y_col: columns containing x,y coords (for catalogs not supporting WCS) is_tcs: flag: true if using TCS columns SERVICE TYPES The currently known service types are: catalog - server returns a tab separated table of row/col values namesvr - server returns a single line with id, ra and dec to resolve the given object name imagesvr - server returns an image file directory - the URL is a pointer to another catalog config file local - a local catalog URL SYNTAX The url field is used to build a URL to get the results via HTTP. The syntax is like this: http://host:port/cgi-bin/server?arg1&arg2&...argn If ":port" is missing, it defaults to 80. Substitutions are performed on the URL as follows: %ra, %dec - coordinates of center point %w, %h - width and height in arcmin %r1, %r2 - min and max radius (for circular query) %r - use when server only accepts single radius value %m1, %m2 - min and max magnitude %m - use when server only accepts single magnitude %n - max number of rows to return %cols - list of columns to return (col1,col2,...coln) %id - ID field of item to return (if supported) %mime-type - value for http mime-type field Name servers only need the %id field, which is set to the object name. SYMBOLS The syntax for the "symbol:" field is as follows: symbol: colnames symbol expr : colnames symbol expr : ... where colnames - is a list of column names used (in symbol or expr) symbol - is the symbol to use, one of: square, circle, triangle, cross, plus, diamond, ellipse. The symbol may also be a list such as {circle yellow} and some symbols take extra args for ratio and angle (ellipse). expr - is an expression in terms of colnames above, used to determine the size of the symbol. It may also be a list {expr units}, where units is one of {"image" "deg J2000" "deg B1950}. The default is "image" pixel coordinates. See the RTD documentation for details on the syntax of coordinates and units. The column names (colnames) can be used as variables in the expression using "$" (following Tcl syntax). example: symbol: mag circle 15-$mag : xyz square (1-$xyz)*2.5 symbol: {a/b pa mag} {ellipse yellow ${a/b} $pa} {15-$mag} symbol: "a/b pa mag" "ellipse yellow ${a/b} $pa" "15-$mag" METHODS CatalogInfoEntry() Default constructor, sets all fields to NULL or default values. Use methods to set individual values. CatalogInfoEntry(entry) Copy constructor. operator=(entry) Assignment operator. ~CatalogInfoEntry() Destructor. check() Check that all required fields have been set and return 0 if all ok. servType(s) longName(s) shortName(s) url(s) backup1(s) backup2(s) symbol(s) searchCols(s) sortCols(s) sortOrder(s) showCols(s) copyright(s) Set string keyword values (copy is made internally). id_col(i) ra_col(i) dec_col(i) x_col(i) y_col(i) is_tcs(i) Set int keyword values. equinox(d) Set the equinox for the entry. servType() longName() shortName() url() backup1() backup2() symbol() searchCols() sortCols() sortOrder() showCols() copyright() Get string keyword values. id_col() ra_col() dec_col() x_col() y_col() is_tcs() Get int keyword values. equinox() Get the equinox. isWcs() Return true if the catalog uses word coordinates, that is, if ra_col and dec_col have valid values The default is to use World Coordinates with ra_col=1, dec_col=2. link() link(entry) Get or set the pointer to link entry. Link entries are for catalog directory entries, where the link points to the beginning of a new sublist of catalogs. append(entry) Append the given entry to the end of this list. next() next(entry) Get or set the pointer to next entry in the list. operator<<(ostream, entry) Output operator. The output format is like the config file format. SEE ALSO CatalogInfo, AstroCatalog(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/LocalCatalog.man3000066400000000000000000000046001215713201500215640ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: LocalCatalog.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 27 Jun 96 Created # NAME LocalCatalog - Class for accessing local catalogs stored as tab tables SYNOPSIS #include "LocalCatalog.h" class LocalCatalog : public AstroCatalog { ... public: LocalCatalog(const CatalogInfoEntry*); virtual int query(const AstroQuery& q, const char* filename, QueryResult& result); static int check_table(const char* file); virtual int sort(const char* column, int numeric = 1); virtual int uniq(); }; DESCRIPTION This class can be used to search a local catalog stored as a file in tab table format. The format of the table is something like: TableName # comment line # catalog config information keyword: value ... A B C - - - 0 1 3 3 2 4 ... where the table name and catalog config info are optional. This is the same format used by the "Starbase" package or utilities (see: http://cfa-www.harvard.edu/~john/ for more about Starbase). UNITS Unless otherwise stated, the units for all radius values are in arcmin or image pixels, depending on the catalog config entry settings. The default is arcmin. Floating point values for RA and DEC are always in degrees. The default equinox is J2000, unless set otherwise in the catalog config entry or in the table header. PUBLIC METHODS LocalCatalog(const CatalogInfoEntry*) Constructor - create local catalog class instance. Note: public interface normally uses AstroCatalog::open() with the name of the file containing the local catalog. The argument represents the entry in the catalog config file for this catalog (made automatially, if not already present). query(const AstroQuery& q, const char* filename, QueryResult& result) Run a query on the catalog and return the number of objects found (redefined here to work with local catalogs, refer to the parent class AstroCatalog for details.). check_table(const char* file) Check the validity of a tab table file and return 0 if it is ok. SEE ALSO AstroCatalog ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/ProxyDialog.mann000066400000000000000000000023371215713201500216000ustar00rootroot00000000000000# This file was automatically generated by itcldoc # from source code comments. Do not edit by hand! # This file may be processed by the ESO/VLT docDoManPages # command to produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. NAME ProxyDialog - user interface class for defining a proxy server NAMESPACE cat PARENT CLASS util::TopLevelWidget SYNOPSIS ProxyDialog ?options? DESCRIPTION E.S.O. - VLT project/ESO Archive @(#) $Id: ProxyDialog.tcl,v 1.2+++++++++++ 1998/10/28 17:37:23 abrighto Exp $ ProxyDialog.tcl - user interface class for defining a proxy server for HTTP access. who when what -------- --------- ---------------------------------------------- A.Brighton 26 Jun 98 created. WIDGET OPTIONS -configfile Set the width for displaying labels. PROTECTED METHODS cancel {} Called when the Cancel button is pressed. clear {} Called when the Clear button is pressed. init {} Called after options have been evaluated. ok {} Called when the OK button is pressed. reset {} Called when the Reset button is pressed. SEE ALSO TopLevelWidget(n) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/QueryResult.man3000066400000000000000000000113701215713201500215450ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: QueryResult.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 27 Jun 96 Created # NAME QueryResult - Class for accessing results of a catalog query SYNOPSIS #include "QueryResult.h" class QueryResult : public TabTable { public: QueryResult(); QueryResult(const char* result); QueryResult(int numCols, char** colNames, const char* result); virtual ~QueryResult(); virtual int getPos(int row, WorldCoords& pos); virtual int getPos(int row, WorldOrImageCoords& pos); virtual int query(const AstroQuery& q, const char* infile, const char* outfile, int& more); virtual void entry(CatalogInfoEntry* e, const char* result = NULL); virtual const char* symbol() const; virtual const char* copyright() const; virtual int id_col() const; virtual int ra_col() const; virtual int dec_col() const; virtual int x_col() const; virtual int y_col() const; virtual double equinox() const; virtual int isWcs() const; }; DESCRIPTION This class manages the result of an AstroCatalog::query. The basic result is a char buffer that contains one row per line where each column is separated by a tab character. Since this is the same format as a local catalog, this class is also used to implement local catalogs (see LocalCatalog). This class provides transparent access to the result based on a row,column index and allows for type conversion from string to the desired type. This class is the same as class TabTable (the parent class), except that it assumes the table has at least the 3 columns "id", "ra" and "dec", if World Coordinates are supported, or "id", "x" and "y" if image coordinates are being used. This class adds methods to get the position for a row and to search in an circle, given the center position and radius. The class keeps a pointer to a catalog config entry that may be based on the original catalog entry or may be read from the header of the local catalog or query results. World Coordinates are assumed if the entry indicates that ra and dec columns are present. UNITS Unless otherwise stated, the units for all radius values are in arcmin for World Coordinates and image pixels otherwise.. Floating point values for RA and DEC are always in degrees. The default equinox is J2000. PUBLIC METHODS QueryResult() QueryResult(const char* result) QueryResult(int numCols, char** colNames, const char* result) The constructors have the same arguments as for the parent class TabTable. They initialize the table from a buffer in tab table format. See the TabTable constructors for details. getPos(int row, WorldCoords& pos) getPos(int row, WorldOrImageCoords& pos) Get the world coordinate or image pixel position for the given row from the columns "ra" and "dec", or "x" and "y", depending on the settings in the catalog config entry. By default the first 3 fields are: id, ra, dec, in J2000. Keywords in the catalog config entry may override these settings. The return value if 0 unless errors are detected. query(const AstroQuery& q, const char* infile, const char* outfile, int& more) Query the given tab table file using the condition described by the given AstroQuery object. Args: q - (in) object describing the query infile - (in) file to search outfile - (in) optional filename to hold results, or null more - (out) set to 1 if more objects would be available but were not returned because q.maxRows was set lower The return value 0 if all is OK. The number found is available as this->numRows(). entry(e, result) Set the catalog config entry for this object. This is included in the file when this object is saved as a local catalog. The optional result arg may be a pointer to the result of a catalog query, which may contain config configuration information. If specified, it is scanned to update the entry with the new information. symbol() id_col() ra_col() dec_col() x_col() y_col() equinox() All these methods return the corresponding values from the catalog config entry for the query results. This may be the same as for the catalog being searched or may have been modified by config information in the header of the query results or local catalog. isWcs() Returns true if the query results contain ra and dec columns for World Coordinate support. SEE ALSO AstroCatalog ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/TabTable.man3000066400000000000000000000216001215713201500207140ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: TabTable.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 27 Jun 96 Created # NAME TabTable - Class for managing a tab separated table of values SYNOPSIS #include "TabTable.h" class TabTable { ... public: // constants enum {MAX_ROW_SIZE=8*1024}; // max size of a tab table row enum {MAX_HEADER_SIZE=1024}; // max size of a tab table heading enum {MAX_COLUMNS=255}; // max number of table columns public: TabTable(char sep = '\t'); TabTable(const char* buf, int maxRows = 0, char sep = '\t'); TabTable(int numCols, char** colNames, const char* buf, int maxRows = 0, char sep = '\t'); virtual ~TabTable(); virtual int clear(); virtual int init(const char* buf, int maxRows = 0); virtual int init(int numCols, char** colNames, const char* buf, int maxRows = 0); virtual int get(int row, int col, char*& value); virtual int get(int row, int col, int& value); virtual int get(int row, int col, double& value); virtual int get(int row, int col, float& value); virtual int get(int row, int col, short& value); virtual int get(int row, int col, char& value); virtual int get(int row, const char* colName, char*& value); virtual int get(int row, const char* colName, int& value); virtual int get(int row, const char* colName, double& value); virtual int get(int row, const char* colName, float& value); virtual int get(int row, const char* colName, short& value); virtual int get(int row, const char* colName, char& value); virtual int colIndex(const char* colName) const; virtual const char* colName(int col) const; virtual int hasCol(const char* name) const; static int head(const char* filename, TabTable&); static int head(istream&, TabTable&); virtual int compareHeadings(const TabTable& t); virtual int save(const char* filename); virtual int save(ostream&); virtual int append(const char* filename); virtual int remove(const char* filename); virtual int findRow(const char* tableRow); virtual int printRows(ostream& os); virtual int search(const char* filename, int numSearchCols, char** searchCols, char** minValues, char** maxValues, int maxRows); virtual int search(const char* filename, const char* searchCol, const char* value, int maxRows); virtual int search(const char* filename, int searchCol, const char* value, int maxRows); friend ostream& operator<<(ostream& os, TabTable& t); virtual int numRows() const; virtual void numRows(int n); virtual int numCols() const; virtual char** colNames() const; virtual int status() const; }; DESCRIPTION Class TabTable manages a buffer containing a table where the rows are separated by newlines and the columns by tabs (or other specified char). The class provides transparent access to the table based on a row,column index and allows for type conversion from string to the desired type. Methods are also available to print the table and save it to a file. PUBLIC METHODS TabTable(char sep = '\t') Constructor: initialize empty table. TabTable(const char* buf, int maxRows = 0, char sep = '\t') Constructor: initialize table from buffer in tab table format: VAR VALUE VALUE ... ... COL1 COL2 COL3 ... COLN --- ---- ---- ---- data data data data ... Currently, anything up to the column headings is ignored (This may change later). The format is the same as the tab table format used by starbase. A line beginning with a "-" separates the column names from the data and all column headings and data are separated by tabs (or sep char). The part preceding the column headings may be used later to set certain variables pertaining to the table. In this case, a variable may have one or more values, separated by tabs (sep char). If maxRows is nonzero, only upto that many rows are taken from buf. TabTable(int numCols, char** colNames, const char* buf, int maxRows = 0, char sep = '\t') Constructor: initialize table from data buffer without If maxRows is nonzero, only upto that many rows are taken from buf. headings. The first two args specify the number column headings and their names. ~TabTable() Destructor: free any allocated memory init(const char* buf, int maxRows = 0) Fill the table from the given buffer in tab table format. If maxRows is nonzero, only upto that many rows are taken from buf. init(int numCols, char** colNames, const char* buf, int maxRows = 0) Fill the table from the given buffer in tab table format, with headings specified separately. The first two args specify the number column headings and their names. If maxRows is nonzero, only upto that many rows are taken from buf. clear() Make the table empty and free any resources used get(int row, int col, char*& value) get(int row, int col, int& value) get(int row, int col, double& value) get(int row, int col, float& value) get(int row, int col, short& value) get(int row, int col, char& value) Get row,column values: the parameter "value" is set and 0 is returned if there are no errors. Values of type char* point to internal storage and should not be modified. get(int row, const char* colName, char*& value) get(int row, const char* colName, int& value) get(int row, const char* colName, double& value) get(int row, const char* colName, float& value) get(int row, const char* colName, short& value) get(int row, const char* colName, char& value) Get table values by column name. Values of type char* point to internal storage and should not be modified. colIndex(const char* colName) const Return the table column index for the given table column name. const char* colName(int col) const Return the column name for the given column index. hasCol(const char* name) const Return true if the table contains the given column. static int head(const char* filename, TabTable&) static int head(istream&, TabTable&) Read the heading info from the given stream and put it in the given table. compareHeadings(const TabTable& t) Compare headings in this table and the given one and return 0 if they are the same. save(const char* filename) save(ostream&) Save the contents of this object to the given file as a tab table. append(const char* filename) Append the contents of this object to the given tab table file remove(const char* filename) Remove rows in the tab table file that are also in this object. findRow(const char* tableRow) Find a row matching the given tab separated one and return the index. search(const char* filename, int numSearchCols, char** searchCols, char** minValues, char** maxValues, int maxRows) Search the given tab table file for upto maxRows rows with columns values matching the given arguments and fill this table with the resulting rows. Args: filename - tab table file to search numSearchCols - number of columns in argument arrays searchCols - names of the columns to compare minValues - min/max values for comparison maxValues maxRows - max number of rows to find search(const char* filename, const char* searchCol, const char* value, int maxRows); Search the given tab table file for upto maxRows rows where the given column has the given value and fill this table with the resulting rows. Args: filename - tab table file to search searchCol - name of the column to compare value - value for comparison maxRows - max number of rows to find search(const char* filename, int searchCol, const char* value, int maxRows); Search the given tab table file for upto maxRows rows where the given column has the given value and fill this table with the resulting rows. Args: filename - tab table file to search searchCol - index of the column to compare (0..n) value - value for comparison maxRows - max number of rows to find printRows(ostream& os) Print the table rows to the given stream in tab table format. friend ostream& operator<<(ostream& os, TabTable& t) Output operator, prints the table to the given stream in tab table format. numRows() const Return the number of rows in the table. void numRows(int n) Set the number of rows in the table. numCols() const Return the number of columns in the table. colNames() const Return an array of column names in the table. status() const Return the status after the constructor has completed. SEE ALSO QueryResult ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/TcsCatalog.man3000066400000000000000000000120121215713201500212570ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: TcsCatalog.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 27 Jun 96 Created # NAME TcsCatalog - class for accessing TCS catalogs SYNOPSIS #include "TcsCatalog.h" class TcsCatalog : public AstroCatalog { public: TcsCatalog(const CatalogInfoEntry* e); virtual ~TcsCatalog(); static TcsCatalog* open(const char* name); int numCols(); char** colNames(); const char* colName(int col); int colIndex(const char* colName); int hasCol(const char* name); int getObject(const char* id, TcsCatalogObject& obj); int searchClosestStar(const WorldCoords& pos, double mag0, double mag1, TcsCatalogObject& obj); }; DESCRIPTION This class is a subclass of AstroCatalog specialized for accessing GSC, PPM or similar catalogs for use by the TCS (Telescope Control Software). A TcsCatalog is like an AstroCatalog, except that it assumes a catalog has fixed columns, such as those that are found in the GSC or PPM catalogs. This class restricts itself to these fixed columns and ignores the rest. Each row of a TcsCatalog can be represented by a TcsCatalogObject. Any missing column values are set to the appropriate null value (defined in TcsCatalogObject.h). CATALOG SERVERS This class uses the same catalog servers as the AstroCatalog class. Please refer to AstroCatalog for details. LOCAL CATALOGS The format of local catalog files and query results that are stored in files is the same here as in AstroCatalog, except that here the column names are fixed. In addition, catalogs saved in TCS format contain additional comments in the header indicating that the catalog is a TCS catalog and with the meanings of the columns. UNITS Unless otherwise stated, the units for all radius values are in arcmin. Floating point values for RA and DEC are always in degrees. The default equinox is J2000. QUERY PARAMETERS Parameters for catalog searches are checked to make sure they are valid and in the correct range. A radius value must be between 0.0 and 300.0 arcmin. A magnitude may have any value. For ranges, such as min and max radius and min and max magnitude, the order of the arguments is not important, since they will be rearranged as needed. If both min and max values are 0.0, they are ignored for that search. If you really want to search for objects with "0.0" magnitude, specify a range with small values that are not zero, for example, min/max mag = (-0.0001, +0.0001). PUBLIC METHODS TcsCatalog(const CatalogInfoEntry* e) Constructor - create a TCS catalog class instance. Note: the public interface normally uses TcsCatalog::open(). The argument represents the entry in the catalog config file for this catalog. ~TcsCatalog() Destructor - close catalog and free any resources. open(const char* name) Open the named catalog and return a pointer to a new TcsCatalog (or derived class) object created for it or NULL if errors occur. If the given name is really the name of a file, it is opened as a local catalog and the pointer returned is of type TcsLocalCatalog, a subclass of TcsCatalog. If the file is not in the correct format, a NULL pointer is returned. numCols() Return the number of columns in the catalog (fixed number). colNames() Return an array of column names (this is always the same for TCS catalogs). colName(int col) Return the name of the given column (fixed for TCS catalogs). colIndex(const char* colName) Return the column index for the given column name (fixed for TCS catalogs). hasCol(const char* name) Return true if the catalog contains the given column (fixed for TCS catalogs). int getObject(const char* id, TcsCatalogObject& obj) This method is redefined in this class to get the object given by "id" in the catalog and return 0 if all is OK. Note that the interface is changed here to use the TcsCatalogObject to hold the result rather than a QueryResult as in the parent class version. Arguments: id, (in ) - object id in catalog. obj (out) - object for row, if found. int searchClosestStar(const WorldCoords& pos, double mag0, double mag1, TcsCatalogObject& obj) This method is redefined in this class to search for the star closest to the given position, with the magnitude in the given range. Note that the interface is changed here to use the TcsCatalogObject to hold the result rather than a QueryResult as in the parent class version. Arguments: pos, (in ) - center position in world coordinates mag0, (in ) - min magnitude mag1, (in ) - max magnitude obj (out) - object for row, if found SEE ALSO AstroCatalog, TcsCatalogObject(3C++), TcsQueryResult(3C++), TcsLocalCatalog, tcscat(n) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/TcsCatalogObject.man3000066400000000000000000000123551215713201500224200ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: TcsCatalogObject.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 27 Jun 96 Created # NAME TcsCatalogObject - Class representing one row of results of a TcsCatalog query. SYNOPSIS #include "TcsCatalogObject.h" // NULL values #define TCS_CATALOG_NULL_INT 4294967294 /* (2^32 - 1) */ #define TCS_CATALOG_NULL_DOUBLE 1.E-300 class TcsCatalogObject { ... public: TcsCatalogObject(); TcsCatalogObject(const TcsCatalogObject&); ~TcsCatalogObject(); TcsCatalogObject& operator=(const TcsCatalogObject &); friend ostream& operator<<(ostream&, const TcsCatalogObject&); void print(char* buf, int bufsize); static void printHeadings(ostream& os); static void printHeadings(char* buf, int bufsize); int printTableRow(ostream&); void reset(); static int isNull(int v); static int isNull(double v); static int isNull(const char* v); // set values int id(const char*); int ra(double); int dec(double); int cooSystem(const char*); int epoch(double); int pma(double); int pmd(double); int radvel(double); int parallax(double); int cooType(const char*); int band(const char*); int mag(double); int more(const char*); int preview(const char*); int distance(double); int pa(double); // get values const char* id(); double ra(); double dec(); const char* cooSystem(); double epoch(); double pma(); double pmd(); double radvel(); double parallax(); const char* cooType(); const char* band(); double mag(); const char* more(); const char* preview(); double distance(); double pa(); static int numCols(); static char** colNames(); static const char* colName(int col); static int colIndex(const char* colName); static int hasCol(const char* name); }; DESCRIPTION This object represents the contents of one row of TCS (GSC or PPM) query results. Missing values are set to the appropriate null value (see above). Methods are available to set and get the object values. The "set" methods do some error checking. The "get" methods are all simple "inline" methods that simply return the value. The following column values represent a TCS catalog object: id object catalog id ra Alpha coordinate for the target in decimal degrees dec Delta coordinate for the target in decimal degrees cooSystem Equinox system and equinox ("B1950" or "J2000") epoch Epoch expressed as decimal year pma Proper Motion Alpha in radians/year (-10.0 to 10.0) pmd Proper Motion Delta in radians/year (-10.0 to 10.0) radvel radial velocity in km/sec (-200000 to 200000) parallax Parallax in arcseconds (-10000 to 10000) cooType Coord. type: "M" for mean, "A" for apparent character band Magnitude wavelength band ("V") mag Object's magnitude in given band more An HTTP URL pointing to more info on the object preview An HTTP URL pointing to an image of the object distance distance to center of the field pa position angle based on center of the field UNITS Unless otherwise stated, the units for all radius values are in arcmin. Floating point values for RA and DEC are always in degrees. The default equinox is J2000. PUBLIC METHODS TcsCatalogObject() Constructor: initialize all fields to null. TcsCatalogObject(const TcsCatalogObject&) copy constructor. ~TcsCatalogObject() Destructor. TcsCatalogObject& operator=(const TcsCatalogObject &) Assignment. operator<<(ostream&, const TcsCatalogObject&) Output operator (Tcl list format). print(char* buf, int bufsize) Print this object to the given buffer. printHeadings(ostream& os) printHeadings(char* buf, int bufsize) Print the headings to match the output of '<<' above. printTableRow(ostream&) Print this object as a tab separated row reset() Result all fields to default values. isNull(int v) isNull(double v) isNull(const char* v) Return true if the given value is null (by convention). id(const char*) ra(double) dec(double) cooSystem(const char*) epoch(double) pma(double) pmd(double) radvel(double) parallax(double) cooType(const char*) band(const char*) mag(double) more(const char*) preview(const char*) distance(double) pa(double) Set fields, with range checking, return 0 if OK. id() ra() dec() cooSystem() epoch() pma() pmd() radvel() parallax() cooType() band() mag() more() preview() distance() pa() Member access: return member value. The following methods are for compatibility with other AstroCatalog classes: numCols() Return the number of columns in the catalog. colNames() Return an array of column names. colName(int col) Return the column name for the given column. colIndex(const char* colName) Return the column index for the given column name. hasCol(const char* name) Return true if the catalog contains the given column. SEE ALSO TcsCatalog, TcsQueryResult(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/TcsQueryResult.man3000066400000000000000000000044621215713201500222230ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: TcsQueryResult.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 27 Jun 96 Created # NAME TcsQueryResult - class for accessing results of a TCS catalog query SYNOPSIS #include "TcsQueryResult.h" class TcsQueryResult : public QueryResult { ... public: TcsQueryResult(); TcsQueryResult(const char* result); virtual ~TcsQueryResult(); int getObj(int row, TcsCatalogObject&); int printRows(ostream& os); // -- redefine these to deal with TCS columns -- char** colNames(); int numCols(); const char* colName(int col); int colIndex(const char* colName); }; DESCRIPTION This class manages the result of an TcsCatalog::query. Internally a QueryResult object manages the "tab table" query results. This class provides transparent access to the result based on a row, column index and, unlike the QueryResult class, is specialized for accessing the TCS (GSC and PPM) catalogs. There are special methods to return GSC and PPM fields in common units and to determine if a field is present in the catalog. UNITS Unless otherwise stated, the units for all radius values are in arcmin. Floating point values for RA and DEC are always in degrees. The default equinox is J2000. PUBLIC METHODS TcsQueryResult() Constructor: initialize empty table. TcsQueryResult(const char* result) Constructor: initialize from query result buffer. ~TcsQueryResult() destructor: free any allocated memory. getObj(int row, TcsCatalogObject&); Access a TcsCatalog (GSC/PPM) result row: fill out the given TcsCatalogObject. printRows(ostream& os); Print table rows to the given stream. colNames() Get array of column names in a TCS query result. numCols() Get number of columns in a TCS query result. colName(int col) Return the column name for the given column index. int colIndex(const char* colName) Return the column index for the given column name SEE ALSO TcsCatalog, TcsCatalogObject(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/astro_catalog.man3000066400000000000000000000447021215713201500220700ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: astro_catalog.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- -------------------------------------- # Allan Brighton 16 Oct 95 Created # NAME astroCatalog - C library for accessing astromical catalogs SYNOPSIS #include "astroCatalog.h" typedef void* AcHandle; typedef void* AcResult; AcHandle acOpen(char* name); void acClose(AcHandle); int acMore(AcHandle); int acNumCols(AcHandle) char* acColName(AcHandle, int col); char** acColNames(AcHandle); int acColIndex(AcHandle handle, char* name); char* acGetError(); int acGetErrorCode(); int acGetDescription( AcHandle cat, int* numCols, char*** colNames); int acGetObject( AcHandle cat, char* id, int numCols, char** colNames, AcResult* result); int acGetArea( AcHandle cat, int numCols, char** colNames, double ra0, double dec0, double ra1, double dec1, double mag0, double mag1, int maxRows, char* filename, int* numFound, AcResult* result); int acCircularSearch( AcHandle cat, int numCols, char** colNames, double ra, double dec, double radius0, double radius1, double mag0, double mag1, int maxRows, char* filename, int* numFound, AcResult* result); int acSearchClosestStar( AcHandle cat, int numCols, char** colNames, double ra, double dec, double mag0, double mag1, AcResult* result); int acCatalogSearch( AcHandle cat, int numCols, const char* const* colNames, int numSearchCols, char** searchCols, const char* const* minVals, const char* const* maxVals, int maxRows, const char* filename, int* numFound, AcResult* result); /* * --- routines for accessing the query results --- */ int acrNumRows(AcResult); int acrNumCols(AcResult); char** acrColNames(AcResult); int acrGetString(AcResult, int row, int col, char** value); int acrGetInt(AcResult, int row, int col, int* value); int acrGetDouble(AcResult, int row, int col, double* value); int acrGetFloat(AcResult, int row, int col, float* value); int acrGetShort(AcResult,int row, int col, short* value); int acrGetChar(AcResult,int row, int col, char* value); int acrGetNString(AcResult,int row, const char* colName, char** value); int acrGetNInt(AcResult,int row, const char* colName, int* value); int acrGetNDouble(AcResult,int row, const char* colName, double* value); int acrGetNFloat(AcResult,int row, const char* colName, float* value); int acrGetNShort(AcResult,int row, const char* colName, short* value); int acrGetNChar(AcResult,int row, const char* colName, char* value); int acrGetWC(AcResult, int row, WC* pos); int acrColIndex(AcResult,const char* colName); void acrDelete(AcResult); DESCRIPTION This man page describes a library for accessing astronomical catalogs from C applications in a generic way. Note: Although the library is implemented in C++, it also defines a C interface, which is described here. To use this library from C, an application must have a C++ main and be linked with the C++ compiler. This is easily done by renaming the C main to c_main and defining a C++ main that calls it. The main purpose of this library is to provide generic access to a variety of astronomical catalogs available locally or on the network. The interface hides the details of accessing the various catalogs and shows their contents in a uniform way. CATALOG SERVERS This class communicates with a catalog server via HTTP requests. The list of servers and how to access them is kept in a configuration file, which is also accessed via HTTP. The default config file is: http://archive.eso.org/skycat/skycat.cfg The default can be overridden by defining the environment variable SKYCAT_CONFIG to another valid HTTP URL. LOCAL CATALOGS If the catalog name passed to acOpen is the name of a file, it is taken to be a local catalog file in the format used by the Starbase utilities. A local catalog is an ASCII file containing an optional title and header information followed by the column headings, a dashed line and the data rows. The columns are separated by tabs. This is also the format of query results returned via HTTP from remote catalog servers. Example: Table1 id ra dec pos-e mag ------ -- --- ----- --- A00050 3:19:28 8:26:29 0.2 13.49 A00098 3:19:32 8:34:15 0.4 13.40 A00288 3:19:21 8:31:19 0.2 13.13 A00314 3:19:44 8:30:58 0.2 13.98 The pointer returned from acOpen for files is a pointer to an object for accessing local catalogs. The interface is the same for remote and local catalogs, only the implementation is different. QUERY PARAMETERS Parameters for catalog searches are checked to make sure they are valid and in the correct range. A radius value must be between 0.0 and 300.0 arcmin. A magnitude may have any value. For ranges, such as min and max radius and min and max magnitude, the order of the arguments is not important, since they will be rearranged as needed. If both min and max values are 0.0, they are ignored for that search. If you really want to search for objects with "0.0" magnitude, specify a range with small values that are not zero, for example, min/max mag = (-0.0001, +0.0001). FORMAT OF QUERY RESULTS Query results are accessed by a set of routines that operate on a an "AcResult" object that is returned as the last argument in the query routine calls. The object keeps a table of result rows and columns internally and provides an interface for extracting the values in various formats and data types. The format of query results in a file was described above (see LOCAL CATALOGS). ROUTINE NAMES Note that the astroCatalog routine names all have the prefix "ac", while the routines that operate on the query results all have the prefix "acr". MEMORY MANAGEMENT Memory is allocated for the query results. It is the caller's responsibility to delete the result object with the acrDelete() routine when it is no longer needed. ERROR HANDLING Most of the routines described here return non-zero on error and zero if all is OK (routines that return pointers return a NULL pointer on error). The text of the error message can be retrieved with the acGetError() function and an error code is available via the acGetErrorCode function. The error codes are the same as those in and have the same meanings (EINVAL means invalid operand - or parameter, 0 means no code was available). UNITS Unless otherwise stated, the units for all radius values are in arcmin. Floating point values for RA and DEC are always in degrees. The default equinox is J2000. ASTRO CATALOG C ROUTINES acOpen Open the named catalog and return a handle for it. The handle can be used in subsequent operations on the catalog. If the catalog can not be opened, NULL is returned and an error message can be retrieved with acGetError(). Arguments: name (in) - Catalog name, (long or short name) from the catalog config file. Return value: Catalog handle for use in future calls. Use acClose() to free resources when no longer needed. acClose Close the given catalog and free its resources. Arguments: handle (in) - Catalog handle returned from acOpen(). Return value: None acGetDescription Get the number of columns and the column names for the given catalog and return 0 if all is OK. The memory for the return arrays is managed internally and should not be modified by the caller. Arguments: handle (in ) - Catalog handle returned from acOpen(). numCols (out) - Number of catalog columns. colNames (out) - Pointer to array of column names. Return value: If successful, 0, otherwise 1. acGetObject Get the values for the specified columns for the object given by "id" in the catalog and return 0 if there are no errors. The id should be a valid object id obtained by a previous catalog query. If colNames is not NULL, it should be an array of "numCols" column names to fetch, otherwise all columns are fetched. "result" is set to point to an AcResult object for accessing the catalog values found (it may be empty). The memory for the result is allocated (see MEMORY MANAGEMENT above). Arguments: handle (in ) - Catalog handle. id (in ) - Object id. numCols (in ) - Number of column names specified colNames (in ) - Array[numCols] of column names to read, or NULL to read all columns. result (in/out) - Handle for accessing query results. Return value: Returns 0 on success, 1 for errors. It is not considered an error if no object is found. Use acrNumRows(result) to determine if an object was found. Comment: An error is returned if the catalog does not support query by Id. The GSC server now supports this, but older versions of the catalog config file do not have the new URL for this yet. acGetArea Get the values for all objects in the rectangular region given by the two world coordinate points. If mag0 and mag1 are not 0.0, they are taken to be the minimum and maximum magnitude values for the query. If colNames is not NULL, it should be an array of numCols column names to fetch, otherwise all columns are fetched. The number of object rows returned is limited to maxRows (the acMore() routine can be called to see if more objects would have been available). On return, numFound is set to the number of objects found and, if any were found, "result" is set to point to an AcResult object for accessing the catalog values found. The memory for the result is allocated (see MEMORY MANAGEMENT above). If filename is not NULL, the results will be copied to the given file in the format of a local catalog. Arguments: handle (in ) - Catalog handle. numCols (in ) - Number of column names specified. colNames (in ) - Array[numCols] of column names to read, or NULL to read all. ra0 (in ) - World coordinates of first point dec0 (in ) - in degrees. ra1 (in ) - World coordinates of second point dec1 (in ) - in degrees. mag0 (in ) - Min magnitude. mag1 (in ) - Max magnitude. maxRows (in ) - Max number of rows to return. filename (in ) - If not null, write results to this file. numFound (out) - Set to number of objects found. result (in/out) - Handle for accessing query results. Return value: If successful, 0, otherwise 1. Comment: An error is returned is the catalog does not support area querries. acCircularSearch Get the values for all objects in the circle or ring given by the world coordinate point and the min and max radius values. If mag0 and mag1 are not 0.0, they are taken to be the minimum and maximum magnitude values for the query. If colNames is not NULL, it should be an array of column names to fetch, otherwise all columns are fetched. The number of object rows returned is limited to maxRows (the acMore() routine can be called to see if more objects would have been available). On return, numFound is set to the number of objects found and, if any were found, "result" is set to point to an AcResult object for accessing the catalog values found. The memory for the result is allocated (see MEMORY MANAGEMENT above). If filename is not NULL, the results will be copied to the given file in the format of a local catalog. Arguments: handle (in ) - Catalog handle. numCols (in ) - Number of column names specified. colNames (in ) - Array[numCols] of column names to read, or NULL to read all. ra (in ) - World coordinates of center point dec (in ) - in degrees. radius0 (in ) - Min radius from center point. radius1 (in ) - Max radius from center point. mag0 (in ) - Min magnitude. mag1 (in ) - Max magnitude. maxRows (in ) - Max number of rows to return. filename (in ) - If not null, write results to this file. numFound (out) - Number of objects found. result (in/out) - Handle for accessing query results. Return value: If successful, 0, otherwise 1. acSearchClosestStar Get the values for the specified columns for the object in the catalog closest to the given position and return 0 if there are no errors. If colNames is not NULL, it should be an array of column names to fetch, otherwise all columns are fetched. If mag0 and mag1 are not 0.0, they are taken to be the minimum and maximum magnitude values for the query. "result" is set to point to an AcResult object for accessing the catalog values found (it may be empty if none were found). The memory for the result is allocated (see MEMORY MANAGEMENT above). Arguments: handle (in ) - Catalog handle. numCols (in ) - Number of column names specified. colNames (in ) - Array[numCols] of column names to read, or NULL to read all columns. ra (in ) - World coordinates of point dec (in ) - in degrees. mag0 (in ) - Min magnitude. mag1 (in ) - Max magnitude. result (in/out) - Handle for accessing query results. Return value: Returns 0 on success, 1 for errors. It is not considered an error if no object is found. Use acrNumRows(result) to determine if an object was found. acCatalogSearch Get the values for all objects fulfilling the specified criteria. The criteria are given by the array of column names to compare and two arrays of the same size containing min and max values, in string format, corresponding to the column names. Null strings are ignored, so, for example, if there is no min value, only the max value will be used. If colNames is not NULL, it should be an array of column names to fetch, otherwise all columns are fetched. The number of object rows returned is limited to maxRows (the acMore() routine can be called to see if more objects would have been available). On return, numFound is set to the number of objects found and, if any were found, "result" is set to point to an AcResult object for accessing the catalog values found. The memory for the result is allocated (see MEMORY MANAGEMENT above). If filename is not NULL, the results will be copied to the given file in the format of a local catalog. Arguments: handle (in ) - Catalog handle. numCols (in ) - Number of column names specified. colNames (in ) - Array[numCols] of column names to read, or NULL to read all. numSearchCols (in ) - number of column names to compare searchCols (in ) - array of column names to compare minVals (in ) - Array of column minimum values. maxVals (in ) - Array of column maximum values. maxRows (in ) - Max number of rows to return. filename (in ) - If not null, write results to this file. numFound (out) - Number of objects found. result (in/out) - Handle for accessing query results. Return value: If successful, 0, otherwise 1. acMore Return true if there would have been more rows available to the most recent query, but they were not returned because the maximum row (maxRows argument) limit was reached. Arguments: handle (in ) - catalog handle Return value: 1 if more rows were available, otherwise 0. acNumCols Return the number of columns in the catalog. Arguments: handle (in ) - catalog handle Return value: the number of columns in the catalog acColName Return the name of the given column in the catalog, or NULL if there is no such column. Arguments: handle (in ) - catalog handle col (in ) - column index (0..n) Return value: column name of NULL if none acColIndex Return the column index for the given column name, or -1 if there is no such column. Arguments: handle (in ) - catalog handle name (in ) - column name Return value: column index acGetError Return the text of the most recent error message reported by the catalog routines. Arguments: none Return value: pointer to error text (a static buffer) acGetErrorCode Return the error code from the most recent error message. This is one of the codes defined in , for example: EINVAL for an invalid argument value. Arguments: none Return value: error code value ACCESSING CATALOG QUERY RESULTS The following routines operate on the AcResult object returned from the query routines: acrNumRows Return the number of result rows. Arguments: handle (in ) - query result handle Return value: number of rows in result acrNumCols Return the number of result columns. Arguments: handle (in ) - query result handle Return value: number of columns in result acrColNames Return a pointer to an array of result column names. Arguments: handle (in ) - query result handle Return value: array of column names acrGetString acrGetInt acrGetDouble acrGetFloat acrGetShort acrGetChar Get result values by row and column index. Note: there are various versions for different data types and parameters. All return 0 for success and set the last argument value or return 1 for error. Arguments: handle (in ) - query result handle row (in ) - row index col (in ) - column index value (in/out) - address of variable to hold value Return value: 0 for success, otherwise 1 for error. acrGetNString acrGetNInt acrGetNDouble acrGetNFloat acrGetNShort acrGetNChar Get result values by row and column name. Note: there are various versions for different data types and parameters. All return 0 for success and set the last argument value or return 1 for error. Arguments: handle (in ) - query result handle row (in ) - row index col (in ) - column name value (in/out) - address of variable to hold value Return value: 0 for success, otherwise 1 for error. acrGetWC Get the position columns (RA and DEC) from the given result row and return success (0), otherwise error (1). Arguments: handle (in ) - query result handle row (in ) - row index pos (in/out) - address of WC object to hold coords Return value: 0 for success, otherwise 1 for error. acrColIndex Return the result column index for the given result column name. Arguments: handle (in ) - query result handle colName (in ) - name of column Return value: column index or -1 for error. acrDelete Delete the result object (free the memory). SEE ALSO AstroCatalog, TclAstroCat(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/astro_image.man3000066400000000000000000000067211215713201500215370ustar00rootroot00000000000000# $Id: astro_image.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 16 Oct 95 Created # NAME astroImage - C Library for accessing astronomical image servers (obsolete) SYNOPSIS #include "astroImage.h" typedef void* AiHandle; AiHandle aiOpen(char* name); void aiClose(AiHandle); char* aiGetImage(AiHandle handle, double ra, double dec, double width, double height); DESCRIPTION Note: This interface is obsolete. Please use the astroCatalog interface, which now also supports image servers. This man page describes a library for accessing astronomical image servers from C applications in a generic way. Note: Although the library is implemented in C++, it also defines a C interface, which is described here. To use this library from C, an application must have a C++ main and be linked with the C++ compiler. This is easily done by renaming the C main to c_main and defining a C++ main that calls it. The main purpose of this library is to provide generic access to a variety of astronomical image servers available locally or on the network. The interface hides the details of accessing the various servers. IMAGE SERVERS This class communicates with an image server via HTTP requests. The list of servers and how to access them is kept in a configuration file, which is also accessed via HTTP. The default config file is: http://archive.eso.org/skycat/skycat.cfg The default can be overridden by defining the environment variable SKYCAT_CONFIG to another valid HTTP URL. ERROR HANDLING Most of the routines described here return non-zero on error and zero if all is OK (routines that return pointers return a NULL pointer on error). The text of the error message can be retrieved with the acGetError() function and an error code is available via the acGetErrorCode function. The error codes are the same as those in and have the same meanings (EINVAL means invalid operand - or parameter, 0 means no code was available). UNITS Unless otherwise stated, the units for all radius values are in arcmin. Floating point values for RA and DEC are always in degrees. The default equinox is J2000. C ROUTINES aiOpen Open the named image server and return a handle for it or NULL if there were errors. The handle can be used in subsequent operations on the image server. Arguments: name (in) - image server name Return value: image server handle for use in future calls aiClose Close the image server connection and free its resources. Arguments: handle (in) - image server handle Return value: None aiGetImage Pass a request to the image server and return the name of a FITS file containing the resulting image, or NULL if not found. The return filename is the name of a temporary file that will be reused on the next call to this routine. Arguments: handle (in) - image server handle ra (in ) - world coordinates of center point dec (in ) - in degrees width (in ) - width of image in arc-minutes image (in ) - height of image in arc-minutes Return value: pointer to temporary FITS file containing image SEE ALSO AstroImage, TclAstroImage(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/astrocat.man1000066400000000000000000000023651215713201500210630ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: astrocat.man1,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 27 Mar 98 Created # NAME astrocat - Standalone catalog browser application SYNOPSIS astrocat ?catalogName? ?options? DESCRIPTION The "astrocat" command is a standalone user interface to the catalog library. This window interface can be used to query catalogs and get configuration about the available catalogs. See the man pages for astrocat(n) and AstroCatalog(3) for details that are not described here. If a catalog name is specified, it should be one of the names in the catalog configuration file, for example, "gsc@eso". If no catalog name is specified, a default is chosen (first in config file) and you can choose a new catalog from the menus. OPTIONS See AstroCat(n), the Itcl class version, which has the same options. SEE ALSO astrocat(n), AstroCat(n), AstroCatalog(3) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/astrocat.mann000066400000000000000000000371461215713201500211650ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: astrocat.mann,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 25 Jan 98 Created # NAME astrocat - Tcl interface to the catalog library SYNOPSIS astrocat $instName $instName subcommand ... DESCRIPTION The "astrocat" Tcl command is the Tcl interface to the catalog library, in particular the AstroCatalog(3) class. This command can be used to query catalogs and get configuration about the available catalogs. See the man page for AstroCatalog(3) for details that are not described here. The astrocat Tcl command creates a new Tcl command with the same name as its argument ($instName) that provides the subcommands described below. CATALOG DIRECTORIES Catalogs may be organized in hierarchies, with catalog directories containing other catalogs. Some subcommands accept an optional "directory" argument, which may be either the name of the catalog directory, or a tcl list of directories forming a catalog directory path. Note that only catalog directories may be specified in this way, not the catalog names themselves. SUBCOMMANDS $instName authorize $instName authorize username passwd ?realm server? If the previous HTTP GET returned an authorization error: (The HTML error text returned in Tcl contained the string: "Authorization Required"), the application can ask the user to enter a username and password to use to access the URL and then retry the GET after using this subcommand to set the authorization information to use. With no arguments, this command returns a list of the form {needpasswd realm server} where: needpasswd is nonzero if a password is required for the URL. realm is the string taken from the HTTP header (Basic realm=...). server is the name of the target server that wants the password. If arguments are specified, they should be the username and password and optionally the realm and server hostname. If the last 2 args are specified, the information is stored in a file for later lookup (see HTTP(3)). $instName check $filename Check that the given filename is a valid local catalog (tab table format). $instName checkrow $row Check that the given row (Tcl list of columns) is valid for a local catalog. The row should contain valid values for ra and dec, if we are using world coords, or x and y, if we are using image coords. The default columns are "id ra dec ...", but can be overridden in the catalog config file or header. This command generates an error if the position (ra, dec) or (x, y) is not found or is not in range. $instName close Close the current catalog, if one was open. $instName copyright Return the copyright string for this catalog from the catalog config file. $instName dec_col Return the value of the dec_col keyword for this catalog from the catalog config file. $instName delete Use the "$instName delete" subcommand to free the resources for this object and remove the Tcl command. $instName entry get ?$name? ?$directory? $instName entry set $$info ?$name? ?$directory? $instName entry update $info ?$name? ?$directory? $instName entry add $info ?$directory? $instName entry remove $name "entry get" returns the catalog config entry for the currently open catalog or for the given catalog if one is specified. The format of the return value is a tcl list of {keyword value} pairs: {{key value} {key value} ...} for example: {{serv_type catalog} {long_name "Guide Star Catalog at ESO"} {short_name gsc@eso} {url http://archive.eso.org/...} {symbol ...} {id_col 0} {ra_col 1} {dec_col 2} ...} If the "directory" argument is specified, the entry is searched for in the given catalog directory, otherwise it is searched for starting at the top level directory (the catalog entries are linked in a hierarchical list or directory structure). "entry update" allows you to update fields in the catalog's config entry. Some fields, such as the catalog name and URL can not be changed in this way, however the column positions id_col, ra_col, dec_col, etc... may be updated. The format for the update info is the same as that returned by "entry get". The directory argument has the same meaning as with the "entry get" subcommand. Note: The "entry update" command is needed, for example, when a catalog query was run in a subprocess. The results of the query may include config info, such as the default plot symbol and the columns for id, ra and dec. This subcommand can be used to get this information back into the parent process catalog entry. "entry add" adds a new catalog entry to the internal list. The format of the argument is the same as that for update. The entry is added to the given directory or the top level if none is specified. "entry remove" removes the entry for the named catalog from the internal default catalog list. $instName feedback $fileDesc Specifies a Tcl file descriptor to use to write feedback info during HTTP transfer of catalog data. 1 Arg: file descriptor. $instName getcol Given a row of output from a query, return the value for the named column in Tcl. example: set preview [$cat getcol preview $row] $instName getidpos Given a row of output from a query, return a list {id ra dec} (or {id x y} if we're not using wcs) for the given row. The positions of the 3 columns default to the first 3 columns: id, ra and dec, but might be specified differently in the catalog config entry or result header. example: lassign [$cat getidpos $row] id ra dec $instName getimage -option value ... Request an image from the current image server and return the name of the FITS file holding the image. The options are the same as for the query subcommand. $instName getpreview ?-url $url? ?-tmpfile $filename? Given a URL from a query output line, get the preview data and put it in a temp file. The return value in Tcl is a list of {filename type}, where filename is the name of the file containing the preview data and type is either "image" for a decompressed FITS image or "table" for a tab table with data to be plotted in a graph. The temp file is re-used and deleted in the destructor. example: set preview [$cat getpreview -url "http://...." ?-tmpfile "/tmp/img..."?] -url specifies the URL to use. -tmpfile can be used to specify the image file name to use. $instName hascol Return true if the catalog contains the given column name (in the config entry). $instName headings Return a Tcl list of the column headings. $instName help Return the help info for this catalog from the catalog config file. $instName id_col Return the value of the id_col keyword for this catalog from the catalog config file. $instName info $serv_type ?$directory? This command returns a list of catalogs from the catalog config file. The "serv_type" argument determines which catalogs are listed (one of: catalog, namesvr, imagesvr, directory, local...). If $serv_type is an empty string, all entries are returned. If $directory is specified, the return list will be from the given catalog directory entry, retrieved via HTTP if needed. The default, if no $directory is given, is the top level list read from the default config file at startup. $instName is_tcs ?$name? ?$newValue? With 0 or 1 arg, returns true if this catalog (or the given one) is a TCS catalog. If $newValue is specified, it sets the tcs flag for the given catalog. $instName ispix Returns true if the catalog is based on image pixel coordinates. $instName iswcs Returns true if the catalog is based on world coordinates. $instName load $filename This command loads the named catalog config file, making the catalogs in it available to the application. $instName longname ?name? Returns the long_name field from the catalog config file for the given long or short name, or for the current catalog. $instName more Return true if there were more rows to fetch on the last query (i.e.: not all rows that were found were returned due to limits). $instName open name ?directory? Open the named astromonical catalog and refer to it in future queries. If a directory argument is given, it may be either the name of the catalog directory to search, or a tcl list forming the path to the catalog directory. $instName plot $graph $element $filename $xVector $yVector Plot the contents of the given tab table file in the given BLT graph widget. element is the BLT graph element name filename is the local catalog file xVector is the name of the BLT x vector yVector is the name of the BLT y vector The data for the given element in the given graph will be set directly from here without going through tcl. The return value in Tcl is the number of rows (for the graph's x-axis) $instName query ?-option $value ...? Pass a query to the current catalog and return the result as a Tcl list of rows, where each row is a Tcl list of values. Options and Values: -id $id Specify the catalog id of the object, (as returned from a previous query). If this is specified, -pos, -name, -mag and -radius should not be specified and will be ignored. -pos {ra dec} -pos {x y} -pos {ra1 dec1 ra2 dec2} -pos {x1 y1 x2 y2} World {ra, dec} or image {x, y} coordinates of center position, or list {ra1 dec1 ra2 dec2} or {x1 y1 x2 y2} of 2 points for an area. World Coordinates are given as {H:M:S[+-]D:M:S} in the given equinox. If the catalog config entry contains the keywords "x_col" and "y_col", the coords are interpreted as image coords, otherwise world coords. -equinox $equinox specify the quinox for position (default 2000). -width $w -height $h Dimensions of rectangle with pos at center (alternative to specifying 2 positions) in arcmin for world coords or pixel for image coords. -mag $mag Max or list {min max} magnitude of object -radius $r Max or list (min max} radius from position (in arcmin for world coords or pixel for image coords). -nameserver $ns Name of nameserver catalog to use (simbad@eso, ned@eso,...). -name $name Can be used instead of -pos. The name will be resolved using the value of -nameserver (default: SIMBAD) -columns {col1 col2 ...} Specify a list of columns to return. -searchcols {col1 col2 ...} Specify a list of columns to search by. The -minvalues and -maxvalues options supply the corresponding value ranges and must have the same lengths. -minvalues {v1 v2 ...} -maxvalues {v1 v2 ...} Specify a list of values corresponding to the columns specified with the -searchcols option. The values may be numeric or string format, but the lists must have the same lengths as the one specified by the -searchcols option. -sort {col1 col2 ...} Set the list of column names to sort by. -sortorder increasing -sortorder decreasing Set the sort order. -nrows $n Set the max number of rows to return. Each option has one value, however, for a range or area query, some values can be a list, such as -radius "$rad1 $rad2" to give a radius range or -pos "$pos1 $pos2" to give an area. If -columns is not specified, all columns are assumed. Otherwise, if -columns is specified, the column names should be valid for the catalog and the result will be a list of rows with those columns. Note that not all catalogs will support sorting by all fields. $instName querypos Return the world or image coordinate position arguments from the most recent query, posibly expanded by a name server such as SIMBAD. The result is a list of the form {ra dec equinox} for world coordinates or just {x y} for image coords. $instName ra_col return the value of the ra_col field from the config file. $instName reload This command reloads the default catalog config file and updates the internal catalog entries from it. This is meant to be used after the config file has been edited by hand to make the new data available to the application. $instName remove $filename ?$data? ?$equinox? ?$headings? With 1 arg, remove the results of the previous query from the given file. If $data is specified, it should be a Tcl list of rows to be removed, in the format returned by the query command. If $equinox is specified, it is the equinox of ra and dec in $data (so that ra,dec can be converted to J2000 for comparison). If $headings is given, it is used as a Tcl list of column headings. Otherwise the catalog headings are used, if there is a current catalog. The data rows are removed from the file, which should be in the form of a local catalog (tab table), such as that used by the starbase utilities. $instName root This command returns the name of the root catalog directory. $instName save $filename ?$iflag? ?$data? ?$equinox? ?$headings? With 1 arg, save the results of the previous query to the given file. If $iflag is true, the data is inserted in the file if it already exists and the file is sorted and duplicates removed. If $data is specified, it should be a Tcl list of rows to be saved, in the format returned by the query command. If $equinox is specified, it is the equinox of the ra and dec columns in the data (the first 3 columns are assumed to be id, ra and dec, unless otherwise defined in the catalog config entry or header). If $headings is given, it is used as a Tcl list of column headings. Otherwise the catalog headings are used, if there is a current catalog. The data is saved to a file in the form of a local catalog (tab table) that can be loaded again or processed by starbase utilities. $instName searchcols ?newValue? With no args, return the "search_cols" entry for this catalog. With one arg, specify a new value for the search_cols entry, which should be a list of the form: {{colName minLabel maxLabel} ...} $instName servtype ?name? Return the servtype for this catalog or for the given catalog. $instName shortname ?name? Returns the short_name field from the catalog config file for the given long name, or for the current catalog. $instName showcols ?newValue? With no args, return the "show_cols" entry for this catalog. With one arg, specify a new value for the show_cols entry, which should be a list of the form: {col1 col2 ...}. $instName sortcols ?newValue? With no args, return the "sort_cols" entry for this catalog. With one arg, specify a new value for the sort_cols entry, which should be a list of the form: {col1 col2 ...} $instName sortorder With no args, return the "sort_order" entry for this catalog. With one arg, specify a new value for the sort_order entry, which should be a list of the form: {col1 col2 ...} $instName symbol ?newValue? With no args, return the "symbol" entry for this catalog. With one arg, specify a new value for the symbol entry, which should be a list of the form: {{colNames symbolExpr sizeExpr} ...} where colNames is a list of column names used, symbolExpr is one of the accepted symbol expressions, such as "circle ?color?" and sizeExpr is an expression (or a list of {expr ?units?}) giving the radius of an object. $instName url ?name? Return the url for this catalog or for the given catalog. $instName x_col Return the value of the x_col keyword for this catalog from the catalog config file. $instName y_col Return the value of the y_col keyword for this catalog from the catalog config file. SEE ALSO AstroCatalog(3) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/man/tcscat.mann000066400000000000000000000027561215713201500206250ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: tcscat.mann,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 25 Mar 98 Created # NAME tcscat - Tcl interface to the catalog library (TCS version) SYNOPSIS tcscat $instName $instName subcommand ... DESCRIPTION The "tcscat" Tcl command is the TCS (Telescope Control System) Tcl interface to the catalog library, in particular the TcsCatalog(3C++) class, which is a subclass of AstroCatalog(3C++). This command inherits all of the features of the "astrocat" Tcl command, but is designed for use with catalogs that have a fixed number of known columns. See the man page for TcsCatalogObject(3C++) for a description of the columns. A tcscat object can read other types of catalogs, but saving a catalog saves it in TCS format, which contains only the known columns, with default values inserted where necessary. SUBCOMMANDS The tcscat Tcl command creates a new Tcl command with the same name as its argument ($instName). The subcommands are the same as the "astrocat" subcommands, (see astrocat(n)). Only the behavior is redefined. SEE ALSO astrocat(n), TcsCatalog(3C++), TcsCatalogObject(3C++) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/cat/pkgIndex.tcl.in000066400000000000000000000002151215713201500205640ustar00rootroot00000000000000# Tcl package index file, version 1.0 package ifneeded Cat @PACKAGE_VERSION@ [list load [file join [file dirname $dir] @PKG_LIB_FILE@] Cat] skycat-3.1.2-starlink-1b/cat/tests/000077500000000000000000000000001215713201500170465ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/cat/tests/all.tcl000066400000000000000000000005531215713201500203250ustar00rootroot00000000000000#!/bin/sh # The next line restarts using tclutil.sh \ exec wish $0 ${1+"$@"} set n 0 foreach testfile [lsort [glob t*.tcl]] { if {"$testfile" != "test.tcl"} { incr n set name [string range [file rootname $testfile] 1 end] pack \ [button .b$n \ -text $name \ -command "exec wish $testfile -geometry +300+300 &"] \ -side top -fill x } } skycat-3.1.2-starlink-1b/cat/tests/dss.fits000066400000000000000000000550001215713201500205260ustar00rootroot00000000000000SIMPLE = T /FITS header BITPIX = 16 /No.Bits per pixel NAXIS = 2 /No.dimensions NAXIS1 = 35 /Length X axis NAXIS2 = 35 /Length Y axis EXTEND = T / DATE = '04/01/06 ' /Date of FITS file creation ORIGIN = 'CASB -- STScI ' /Origin of FITS image PLTLABEL= 'E1618 ' /Observatory plate label PLATEID = '07WS ' /GSSS Plate ID REGION = 'XE198 ' /GSSS Region Name DATE-OBS= '20/12/57 ' /UT date of Observation UT = '05:36:00.00 ' /UT time of observation EPOCH = 1.9579677734375E+03 /Epoch of plate PLTRAH = 3 /Plate center RA PLTRAM = 9 / PLTRAS = 3.2780210000000E+01 / PLTDECSN= '+ ' /Plate center Dec PLTDECD = 42 / PLTDECM = 33 / PLTDECS = 3.1743320000000E+01 / EQUINOX = 2.0000000000000E+03 /Julian Reference frame equinox EXPOSURE= 4.5000000000000E+01 /Exposure time minutes BANDPASS= 8 /GSSS Bandpass code PLTGRADE= 1 /Plate grade PLTSCALE= 6.7200000000000E+01 /Plate Scale arcsec per mm SITELAT = '+33:24:24.00 ' /Latitude of Observatory SITELONG= '-116:51:48.00 ' /Longitude of Observatory TELESCOP= 'Palomar 48-inch Schmidt'/Telescope where plate taken CNPIX1 = 2846 /X corner (pixels) CNPIX2 = 5050 /Y corner DATATYPE= 'INTEGER*2 ' /Type of Data SCANIMG = 'XE198_07WS_00_00.PIM'/Name of original scan SCANNUM = 0 /Identifies scan of the plate DCHOPPED= F /Image repaired for chopping effects DSHEARED= F /Image repaired for shearing effects DSCNDNUM= 0 /Identifies descendant of plate scan image XPIXELSZ= 2.5284450000000E+01 /X pixel size microns YPIXELSZ= 2.5284450000000E+01 /Y pixel size microns PPO1 = 0.0000000000000E+00 /Orientation Coefficients PPO2 = 0.0000000000000E+00 / PPO3 = 1.7747471555000E+05 / PPO4 = 0.0000000000000E+00 / PPO5 = 0.0000000000000E+00 / PPO6 = 1.7747471555000E+05 / AMDX1 = 6.7240987715710E+01 /Plate solution x coefficients AMDX2 = 3.6605616579680E-01 / AMDX3 = -1.3732674154580E+02 / AMDX4 = -2.2170938540070E-05 / AMDX5 = -2.0113447317610E-05 / AMDX6 = -2.1108647953950E-05 / AMDX7 = 0.0000000000000E+00 / AMDX8 = 1.8223387505210E-06 / AMDX9 = -9.7173567076310E-08 / AMDX10 = 2.3013465940930E-06 / AMDX11 = -6.6734677147540E-08 / AMDX12 = 0.0000000000000E+00 / AMDX13 = 0.0000000000000E+00 / AMDX14 = 0.0000000000000E+00 / AMDX15 = 0.0000000000000E+00 / AMDX16 = 0.0000000000000E+00 / AMDX17 = 0.0000000000000E+00 / AMDX18 = 0.0000000000000E+00 / AMDX19 = 0.0000000000000E+00 / AMDX20 = 0.0000000000000E+00 / AMDY1 = 6.7250690753980E+01 /Plate solution y coefficients AMDY2 = -3.6679440186020E-01 / AMDY3 = -3.1235334956310E+02 / AMDY4 = -3.5598357942100E-05 / AMDY5 = 2.4433823111370E-08 / AMDY6 = 4.3754127047740E-07 / AMDY7 = 0.0000000000000E+00 / AMDY8 = 2.0663931384810E-06 / AMDY9 = 2.9377276167040E-09 / AMDY10 = 2.0894436743940E-06 / AMDY11 = -2.4710339600070E-08 / AMDY12 = 0.0000000000000E+00 / AMDY13 = 0.0000000000000E+00 / AMDY14 = 0.0000000000000E+00 / AMDY15 = 0.0000000000000E+00 / AMDY16 = 0.0000000000000E+00 / AMDY17 = 0.0000000000000E+00 / AMDY18 = 0.0000000000000E+00 / AMDY19 = 0.0000000000000E+00 / AMDY20 = 0.0000000000000E+00 / Based on photographic data of the National Geographic Society -- Palomar Observatory Sky Survey (NGS-POSS) obtained using the Oschin Telescope on Palomar Mountain. The NGS-POSS was funded by a grant from the National Geographic Society to the California Institute of Technology. The plates were processed into the present compressed digital form with their permission. The Digitized Sky Survey was produced at the Space Telescope Science Institute under US Government grant NAG W-2166. Investigators using these scans are requested to include the above acknowledgements in any publications. Copyright (c) 1994, Association of Universities for Research in Astronomy, Inc. All rights reserved. DATAMAX = 14239 /Maximum data value DATAMIN = 4672 /Minimum data value OBJECT = 'dss26885 ' /Object ID OBJCTRA = '03 19 48.000 ' /Object Right Ascension (J2000) OBJCTDEC= '+41 30 39.00 ' /Object Declination (J2000) OBJCTX = 2863.08 /Object X on plate (pixels) OBJCTY = 5067.67 /Object Y on plate (pixels) CTYPE1 = 'RA---TAN' /R.A. in tangent plane projection CTYPE2 = 'DEC--TAN' /DEC. in tangent plane projection CRPIX1 = 17.5 /Refpix of first axis CRPIX2 = 17.5 /Refpix of second axis CRVAL1 = 4.9950032970688E+01 /RA at Ref pix in decimal degrees CRVAL2 = 4.1510514400833E+01 /DEC at Ref pix in decimal degrees CROTA1 = -2.0273621441398E+00 /Rotation angle of first axis (deg) CROTA2 = -2.0273621441398E+00 /Rotation angle of second axis (deg) Warning: CROTA2 is inaccurate due to considerable skew SKEW = -1.8658208368743E+00, -2.1889034514053E+00 /Measure of skew CDELT1 = -4.7341644542403E-04 /RA pixel step (deg) CDELT2 = 4.7352430348753E-04 /DEC pixel step (deg) CD1_1 = -4.7307100872915E-04 /CD matrix CD1_2 = 1.5417459595016E-05 /CD matrix CD2_1 = 1.8081800184200E-05 /CD matrix CD2_2 = 4.7327324869782E-04 /CD matrix PC001001= 9.9927033228733E-01 /PC matrix PC001002= -3.2566379440425E-02 /PC matrix PC002001= 3.8185580024143E-02 /PC matrix PC002002= 9.9946981646377E-01 /PC matrix END ++>OOOHOHH@[SS[OOOHH3SS[[[S_[SSO3[[[c__nk[SSSSO7ckggg[[OHHFccckkkkkg[[[[OkkrrGG K _WWS7FFk r "' ! KCC W[[[SFF $##"!O""$Z# _[FF !z#$$$$"$$'%##!!n[[FFR v#+#%3%&''&b&b'')n(& $#+#+! v__WFFR v#+%3&&(?(+)))))n(('f#+#+#+! kk__WF!Z!Z"#a#+$%';(?**,N+)++*(((';%#"~!z _WF!Z!Z"#a%';)+J,N,N-//.-/-',#,#+u+u(';%3!#" g^ f!!$u&(*-x..00112110-.-x-x*A(&$*"x!662 f!#%'a*,..13335@44210--x,+)&%-#! q"n#%#)2)h,-x0-0346D5555431..P*A*A'%%#!>!"n%#&})h,.125446D55556D420-.P,++(%%-"x>!j""(.+/)223455665655311/T--+E(9%&1#| >bb!j(.%y(.+,t/234555565553110/T,)(9(9'$ b $&'&),t,t-136D46D6D6D6D6D54321\0+'),I*A&1! E>6b "#r&),t,t,t036D6D76D6D6D6D54320.+'),I+'! E ;""B"B')*+-L02`56o55546D6D4210-L,)'&%#&!a]!##'))=*+./2`32`4<4<3432510--L-L,)%-! q q!]3 #$')**+..0X112525110-0-.%,+E,,(#! q!!aV~3 "B$&R)=)=)=+*,I.P.P//0-0-0-0-.%,+E))("x q qa/!>!>$$$'5)=)=((,I,I.%.%0-..|.|-)+E)'&"mma #F#&%%-''$$*&(+p-x,+)(d' ('5&%-"!u""mi/ !!!#%-$*""$*$'a(()' ' ' '5%%$""""""miiz7 q#"!u!u"#Q#Q$$%%$U$U$#&#&!""""""miiY  hp>!BB !!#Q!#Q#Q#Q#Q!"""""" !!i]  h` EBBB ! !!!B mmm iii] ``66>>ea ````22::::::::ee aUU  ]22.62]RXTENSION= 'BINTABLE' / binary table extension BITPIX = 8 / 8-bit bytes NAXIS = 2 / 2-dimensional binary table NAXIS1 = 28 / width of table in bytes NAXIS2 = 16 / number of rows in table PCOUNT = 0 / size of special data area GCOUNT = 1 / one data group (required keyword) TFIELDS = 4 / number of fields in each row TTYPE1 = 'INTEGRATED_SIGNAL' / label for field 1 TFORM1 = '1D ' / data format of the field: 8-byte DOUBLE TUNIT1 = 'log10Counts' / physical unit of field TTYPE2 = 'MAGNITUDE' / label for field 2 TFORM2 = '1D ' / data format of the field: 8-byte DOUBLE TUNIT2 = 'E_Magnitude' / physical unit of field TTYPE3 = 'UNCERTAINTY' / label for field 3 TFORM3 = '1D ' / data format of the field: 8-byte DOUBLE TUNIT3 = 'E_Magnitude' / physical unit of field TTYPE4 = 'NUMBER_OF_OBJECTS' / label for field 4 TFORM4 = '1J ' / data format of the field: 4-byte INTEGER TUNIT4 = 'Objects ' / physical unit of field EXTNAME = 'Photometric CALTABLE' / name of this binary table extension CALCNTXT= 'POSS_E ' /Context in which calibration is valid CALVERSN= '10/07/1996' /Calibration version THRESHLD= 500 /Threshold above sky which signal is measured The lookup table in this extension may be used to infer the magnitude of stars on plates within the context of CALCNTXT. The log(Integrated Signal) is obtained for a star by summing the total counts above THRESHLD above the background. For example, if the background for a star is measured to be 4000 and THRESHLD is 500, then the integrated signal is the sum of counts above 4500. The table may then be interpolated to log10(4500) to obtain the star's magnitude. "Number of Objects" is the number of objects used to derive the calibrated magnitude in each row of the table. HISTORY TASK: fselect3.3e on FILENAME: posse_cal.fits HISTORY Expression: !(MAGNITUDE==0) HISTORY fselect3.3e at 1/5/97 9:42:8.0 END @@2ff`@33:@0?Sw@@/u?$`=@@.?p P@@,e?`@ffn@*y? `*@33;@(@?!`@@&N?k@@$?E@'@@#?ݫ .@ffo@" ?z@33<@!Fz?gkq@ @ i ?'@@?݄] @@@ffp@A@skycat-3.1.2-starlink-1b/cat/tests/main.C000066400000000000000000000006331215713201500201000ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: main.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * main.C - C++ main for testing C interface * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Oct 95 Created */ extern "C" int c_main(int argc, char** argv); int main(int argc, char** argv) { c_main(argc, argv); return 0; } skycat-3.1.2-starlink-1b/cat/tests/tAstroCat000066400000000000000000000013601215713201500206750ustar00rootroot00000000000000#!/bin/sh #\ test -f ../demos/cat_env.sh && . ../demos/cat_env.sh #\ P=$PWD; DIRN=`dirname $0`; cd $DIRN; XP=`pwd`; cd $P #\ if [ -z "$CAT_LIBRARY" ] ; then #\ WISH=cat_wish; L=`dirname $XP`; CAT_LIBRARY="$L/lib/cat" ; export CAT_LIBRARY #\ else WISH=$CAT_LIBRARY/../bin/cat_wish #\ fi #\ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${INSTALL_TARGET}/lib:/vlt/APR2003/tcltk/lib:/vlt/APR2003/tcltk/lib/itcl:/usr/X11R6/lib" #\ exec $WISH "$0" ${1+"$@"} # -------------------------------------------------- source test.tcl puts "testing the astrocat Tcl command..." astrocat cat cat open gsc@eso puts "GSC headings: [cat headings]" puts "GSC query:" set list [cat query -pos {3:19:48 +41:30:39} -radius 10 -nrows 10] foreach i $list { puts $i } exit 0 skycat-3.1.2-starlink-1b/cat/tests/tAstroCat.tcl000077500000000000000000000003721215713201500214630ustar00rootroot00000000000000source test.tcl puts "testing the astrocat Tcl command..." astrocat cat cat open gsc@eso puts "GSC headings: [cat headings]" puts "GSC query:" set list [cat query -pos {3:19:48 +41:30:39} -radius 10 -nrows 10] foreach i $list { puts $i } exit 0 skycat-3.1.2-starlink-1b/cat/tests/tAstroCatalog.C000066400000000000000000000043141215713201500217230ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * $Id: tAstroCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tAstroCatalog.C - test cases for class AstroCatalog * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ using namespace std; #include #include #include #include "error.h" #include "AstroCatalog.h" main() { // gcc doesn't need this, but SunCC does... ios::sync_with_stdio(); // errors will be printed on stderr automatically set_error_handler(print_error); // open the GSC catalog AstroCatalog* cat = AstroCatalog::open("gsc@eso"); if (!cat) { printf("AstroCatalog::open returned NULL\n"); exit(1); } // query the GSC for a list of objects at the given pos and radius WorldCoords pos(3, 19, 48, 41, 30, 39); AstroQuery q; q.pos(pos); q.radius(10); q.maxRows(10); cout << "Query GSC for objects at pos " << q.pos() << ", in radius " << q.radius1() << ".." << q.radius2() << ":" << endl; QueryResult result; int num_results = cat->query(q, "./tAstroCatalog.out", result); if (num_results < 0) { cout << "Query returned an error\n"; exit(1); } cout << "Query returns: " << num_results << " objects, out of " << q.maxRows() << " requested" << endl; cout << "More objects ?: " << (cat->more() ? "YES" : "NO") << endl; cout << "---Result List---" << endl; int ncols = cat->numCols(); int i, j; cout << "columns:\n"; for (i = 0; i < ncols; i++) cout << cat->colName(i) << "\t"; cout << "\n\nresults:\n"; char* s; for (i = 0; i < num_results; i++) { // print the Id if (result.get(i, 0, s) == 0) cout << s << "\t"; else cout << "ERROR\t"; // print the position in H:M:S+D:M:S if (result.getPos(i, pos) == 0) cout << pos.ra() << "\t" << pos.dec() << "\t"; else cout << "ERROR\t"; // print the other columns for (j = 3; j < ncols; j++) { if (result.get(i, j, s) == 0) cout << s << "\t"; else cout << "ERROR\t"; } cout << endl; } cout << "-----------------" << endl; return 0; } skycat-3.1.2-starlink-1b/cat/tests/tAstroCatalog.ok000066400000000000000000000016131215713201500221510ustar00rootroot00000000000000Query GSC for objects at pos 03:19:48.000 +41:30:39.00, in radius 0..10: Query returns: 10 objects, out of 10 requested More objects ?: YES ---Result List--- columns: gsc_id ra dec pos-e mag mag-e mu d' pa results: GSC0285601078 03:19:48.230 +41:30:42.23 0.2 9.23 0.40 F 0.07 39; GSC0285600314 03:19:44.443 +41:30:58.21 0.2 13.98 0.40 F 0.74 296; GSC0285601162 03:19:51.151 +41:31:25.97 0.2 12.93 0.40 F 0.98 37; GSC0285601446 03:19:55.541 +41:31:23.74 0.2 13.72 0.40 F 1.60 62; GSC0285600342 03:19:57.262 +41:31:34.72 0.2 12.31 0.40 F 1.97 62; GSC0285600334 03:19:48.197 +41:32:50.14 0.2 11.77 0.40 F 2.19 1; GSC0285600886 03:19:36.175 +41:29:58.13 0.2 10.86 0.40 F 2.32 253; GSC0285600672 03:19:35.119 +41:30:39.67 0.2 13.39 0.40 F 2.41 270; GSC0285601758 03:19:48.557 +41:28:09.44 0.2 13.78 0.40 F 2.49 178; GSC0285601402 03:19:52.481 +41:33:00.04 0.2 14.67 0.40 F 2.50 20; ----------------- skycat-3.1.2-starlink-1b/cat/tests/tAstroImage000066400000000000000000000016121215713201500212100ustar00rootroot00000000000000#!/bin/sh #\ test -f ../demos/cat_env.sh && . ../demos/cat_env.sh #\ P=$PWD; DIRN=`dirname $0`; cd $DIRN; XP=`pwd`; cd $P #\ if [ -z "$CAT_LIBRARY" ] ; then #\ WISH=cat_wish; L=`dirname $XP`; CAT_LIBRARY="$L/lib/cat" ; export CAT_LIBRARY #\ else WISH=$CAT_LIBRARY/../bin/cat_wish #\ fi #\ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${INSTALL_TARGET}/lib:/vlt/APR2003/tcltk/lib:/vlt/APR2003/tcltk/lib/itcl:/usr/X11R6/lib" #\ exec $WISH "$0" ${1+"$@"} # -------------------------------------------------- source test.tcl puts "testing the astrocat Tcl command with an image server..." astrocat cat cat open dss@eso puts "getting image..." if {[catch { set filename [cat getimage -pos {3:19:48 +41:30:39} -width 1 -height 1] } msg]} { puts "getimage returned error: '$msg'" exit 1 } puts "getimage returns filename = '$filename', renaming to ./dss.fits..." exec mv $filename ./dss.fits exit 0 skycat-3.1.2-starlink-1b/cat/tests/tAstroImage.C000066400000000000000000000027071215713201500213770ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * $Id: tAstroImage.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tAstroImage.C - test cases for class AstroCatalog with an image server * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ using namespace std; #include #include #include #include #include "error.h" #include "AstroCatalog.h" main() { // gcc doesn't need this, but SunCC does... ios::sync_with_stdio(); // errors will be printed on stderr automatically set_error_handler(print_error); // Try to retrieve an image from the DSS server AstroCatalog* cat = AstroCatalog::open("dss@eso"); if (!cat) { printf("AstroCatalog::open returned NULL\n"); exit(1); } AstroQuery q; q.pos(WorldCoords(3, 19, 48, 41, 30, 39)); q.width(1.); q.height(1.); cout << "Retrieve DSS image at pos " << q.pos() << ", with width " << q.width() << " and height " << q.height() << ":" << endl; int result = cat->getImage(q); if (result != 0) { cout << "DSS Test failed\n"; exit(1); } const char* filename = cat->tmpfile(); cout << "DSS returned image file (renaming to ./dss.fits)\n"; ostringstream os; os << "mv " << filename << " ./dss.fits"; if (system(os.str().c_str()) != 0) sys_error("file rename error"); return 0; } skycat-3.1.2-starlink-1b/cat/tests/tAstroImage.ok000066400000000000000000000002021215713201500216120ustar00rootroot00000000000000Retrieve DSS image at pos 03:19:48.000 +41:30:39.00, with width 1 and height 1: DSS returned image file (renaming to ./dss.fits) skycat-3.1.2-starlink-1b/cat/tests/tAstroImage.tcl000066400000000000000000000006721215713201500217760ustar00rootroot00000000000000source test.tcl # # test the astroimage tcl command # puts "testing the astrocat Tcl command with an image server..." astrocat cat cat open dss@eso puts "getting image..." if {[catch { set filename [cat getimage -pos {3:19:48 +41:30:39} -width 1 -height 1] } msg]} { puts "getimage returned error: '$msg'" exit 1 } puts "getimage returns filename = '$filename', renaming to ./dss.fits..." exec mv $filename ./dss.fits exit 0 skycat-3.1.2-starlink-1b/cat/tests/tLocalCatalog.C000066400000000000000000000046321215713201500216700ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * $Id: tLocalCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tLocalCatalog.C - test cases for class LocalCatalog * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 11 Jun 96 Created */ using namespace std; #include #include #include #include "error.h" #include "LocalCatalog.h" main() { // gcc doesn't need this, but SunCC does... ios::sync_with_stdio(); // errors will be printed on stderr automatically set_error_handler(print_error); // open the GSC catalog AstroCatalog* cat = AstroCatalog::open("test.table"); if (!cat) { printf("LocalCatalog::open returned NULL\n"); exit(1); } // query the GSC for a list of objects at the given pos and radius WorldCoords pos(3, 19, 48, 41, 30, 39); AstroQuery q; q.pos(pos); q.radius(10); q.maxRows(10); cout << "Query GSC for objects at pos " << q.pos() << ", in radius " << q.radius1() << ".." << q.radius2() << ":" << endl; QueryResult result; int num_results = cat->query(q, "./tLocalCatalog.out", result); if (num_results < 0) { cout << "Query returned an error\n"; exit(1); } cout << "Query returns: " << num_results << " objects, out of " << q.maxRows() << " requested" << endl; cout << "More objects ?: " << (cat->more() ? "YES" : "NO") << endl; cout << "---Result List---" << endl; int ncols = cat->numCols(); int i, j; cout << "columns:\n"; for (i = 0; i < ncols; i++) cout << cat->colName(i) << "\t"; cout << "\n\nresults:\n"; char* s; for (i = 0; i < num_results; i++) { // print the Id if (result.get(i, 0, s) == 0) cout << s << "\t"; else cout << "ERROR\t"; // print the position in H:M:S+D:M:S if (result.getPos(i, pos) == 0) cout << pos.ra() << "\t" << pos.dec() << "\t"; else cout << "ERROR\t"; // print the other columns for (j = 3; j < ncols; j++) { if (result.get(i, j, s) == 0) cout << s << "\t"; else cout << "ERROR\t"; } cout << endl; } cout << "-----------------" << endl; cout << "test searching by Id in a local catalog\n"; if (cat->getObject("GSC0286902884", 0, NULL, result) != 0) { cout << "ERROR\n"; } else { cout << "OK\n" << result << endl;; } return 0; } skycat-3.1.2-starlink-1b/cat/tests/tLocalCatalog.ok000066400000000000000000000023471215713201500221200ustar00rootroot00000000000000Query GSC for objects at pos 03:19:48.000 +41:30:39.00, in radius 0..10: Query returns: 10 objects, out of 10 requested More objects ?: YES ---Result List--- columns: gsc-id ra dec pos-e mag mag-e mu d' pa results: GSC0285600050 03:19:28.140 +41:26:29.00 0.2 13.49 0.40 F 5.63 222; GSC0285600098 03:19:32.990 +41:34:15.42 0.4 13.40 0.40 F 4.58 322; GSC0285600288 03:19:21.100 +41:31:19.74 0.2 13.13 0.40 F 5.12 277; GSC0285600314 03:19:44.440 +41:30:58.21 0.2 13.98 0.40 F 0.77 293; GSC0285600334 03:19:48.200 +41:32:50.14 0.2 11.77 0.40 F 2.16 360; GSC0285600342 03:19:57.260 +41:31:34.72 0.2 12.31 0.40 F 1.92 62; GSC0285600418 03:19:24.110 +41:34:44.58 0.2 11.69 0.40 F 6.08 312; GSC0285600518 03:19:47.840 +41:25:46.45 0.2 12.74 0.40 F 4.90 181; GSC0285600526 03:19:26.740 +41:32:26.23 0.2 11.25 0.40 F 4.39 294; GSC0285600548 03:19:51.070 +41:26:09.89 0.4 12.09 0.40 F 4.54 173; ----------------- test searching by Id in a local catalog OK QueryResult # Config entry for original catalog server: serv_type: local long_name: test.table short_name: test.table url: test.table # End config entry gsc-id ra dec pos-e mag mag-e mu d' pa ------ -- --- ----- --- ----- -- -- -- GSC0286902884 03:20:0.87 +41:33:14.00 0.2 13.07 0.40 F 3.49 43; skycat-3.1.2-starlink-1b/cat/tests/tPreviewPlot000066400000000000000000000012041215713201500214320ustar00rootroot00000000000000#!/bin/sh #\ test -f ../demos/cat_env.sh && . ../demos/cat_env.sh #\ P=$PWD; DIRN=`dirname $0`; cd $DIRN; XP=`pwd`; cd $P #\ if [ -z "$CAT_LIBRARY" ] ; then #\ WISH=cat_wish; L=`dirname $XP`; CAT_LIBRARY="$L/lib/cat" ; export CAT_LIBRARY #\ else WISH=$CAT_LIBRARY/../bin/cat_wish #\ fi #\ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${INSTALL_TARGET}/lib:/vlt/APR2003/tcltk/lib:/vlt/APR2003/tcltk/lib/itcl:/usr/X11R6/lib" #\ exec $WISH "$0" ${1+"$@"} # -------------------------------------------------- source test.tcl puts "auto_path = $auto_path" util::setXdefaults wm withdraw . PreviewPlot .pp -file test.preview tkwait window .pp exit skycat-3.1.2-starlink-1b/cat/tests/tPreviewPlot.tcl000077500000000000000000000002531215713201500222210ustar00rootroot00000000000000source test.tcl # test the PreviewPlot class puts "auto_path = $auto_path" util::setXdefaults wm withdraw . PreviewPlot .pp -file test.preview tkwait window .pp exit skycat-3.1.2-starlink-1b/cat/tests/tQueryResult.C000066400000000000000000000062321215713201500216450ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tQueryResult.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tQueryResult.C - test cases for class QueryResult * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ using namespace std; #include #include #include #include #include "Mem.h" #include "error.h" #include "WorldCoords.h" #include "QueryResult.h" /* * util: print the file to the stream */ static int print_file(const char* filename, ostream& os) { ifstream is(filename); if (!is) return 1; char buf[1024]; while(is.getline(buf, sizeof(buf))) os << buf << endl; return 0; } main() { // gcc doesn't need this, but SunCC does... ios::sync_with_stdio(); // errors will be printed on stderr automatically set_error_handler(print_error); // dummy table data in Tcl list format char buf[1024]; sprintf(buf, "col1\tcol2\tcol3\n---\t---\t---\n%s\n%s\n%s\n%s\n", "1\t1.0\taa", "2\t2.0\tbbbb", "3\t3.0\tc c c", "4\t4.0\t"); QueryResult t(buf); if (t.status() != 0) { printf("test 1 failed"); exit(1); } cout << "table t = \n" << t; int n; double d; float f; short s; for (int i = 0; i < t.numRows(); i++) { for (int j = 0; j < t.numCols(); j++) { char* s; if (t.get(i, t.colName(j), s) != 0) { printf("test 2 failed at row %d, col %d\n", i, j); exit(1); } printf("row %d, col %d: \"%s\"\n", i, j, s); } if (t.get(i, 0, n) != 0) { printf("test 3 failed at row %d, col 0\n", i); exit(1); } if (t.get(i, 0, s) != 0) { printf("test 4 failed at row %d, col 0\n", i); exit(1); } if (t.get(i, 0, d) != 0) { printf("test 5 failed at row %d, col 0\n", i); exit(1); } if (t.get(i, 1, d) != 0) { printf("test 6 failed at row %d, col 1\n", i); exit(1); } if (t.get(i, 1, f) != 0) { printf("test 7 failed at row %d, col 1\n", i); exit(1); } } if (n != 4 || s != 4 || d != 4.0 || f != 4.0) { printf("test 8 failed\n"); exit(1); } // -- test insert -- cout << "testing insert of rows:\n"; // save table t to a file char* filename = "tQueryResult.out"; if (t.save(filename) != 0) { printf("test 9 failed"); exit(1); } sprintf(buf, "col1\tcol2\tcol3\n---\t---\t---\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "3\t3.0\tc c c", "2\t2.0\tbbbb", "1\t1.0\taa", "1\t1.0\taa", "3\t3.0\tc c c", "5\t5.0\tddd", "2\t2.0\tbbbb", "1\t1.0\taa", "4\t4.0\t"); QueryResult t2(buf); if (t2.status() != 0) { printf("test 10 failed"); exit(1); } cout << "table t2 = \n" << t2; if (t2.insert(filename) != 0) { printf("test 11 failed"); exit(1); } cout << "result after insert:\n"; if (print_file(filename, cout) != 0) { printf("test 12 failed"); exit(1); } cout << "testing remove of rows:\n"; if (t.remove(filename, 0) != 0) { printf("test 13 failed"); exit(1); } if (print_file(filename, cout) != 0) { printf("test 14 failed"); exit(1); } return 0; } skycat-3.1.2-starlink-1b/cat/tests/tQueryResult.ok000066400000000000000000000013201215713201500220650ustar00rootroot00000000000000table t = QueryResult col1 col2 col3 ---- ---- ---- 1 1.0 aa 2 2.0 bbbb 3 3.0 c c c 4 4.0 row 0, col 0: "1" row 0, col 1: "1.0" row 0, col 2: "aa" row 1, col 0: "2" row 1, col 1: "2.0" row 1, col 2: "bbbb" row 2, col 0: "3" row 2, col 1: "3.0" row 2, col 2: "c c c" row 3, col 0: "4" row 3, col 1: "4.0" row 3, col 2: "" testing insert of rows: table t2 = QueryResult col1 col2 col3 ---- ---- ---- 3 3.0 c c c 2 2.0 bbbb 1 1.0 aa 1 1.0 aa 3 3.0 c c c 5 5.0 ddd 2 2.0 bbbb 1 1.0 aa 4 4.0 result after insert: QueryResult col1 col2 col3 ---- ---- ---- 1 1.0 aa 2 2.0 bbbb 3 3.0 c c c 4 4.0 1 1.0 aa 3 3.0 c c c 5 5.0 ddd 2 2.0 bbbb 1 1.0 aa testing remove of rows: QueryResult col1 col2 col3 ---- ---- ---- 5 5.0 ddd skycat-3.1.2-starlink-1b/cat/tests/tTabTable.C000066400000000000000000000066641215713201500210300ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tTabTable.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tTabTable.C - test cases for class TabTable * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 08 Jan 96 Created */ using namespace std; #include #include #include "error.h" #include "TabTable.h" main() { // gcc doesn't need this, but SunCC does... ios::sync_with_stdio(); // errors will be printed on stderr automatically set_error_handler(print_error); // dummy table data in Tab list format char buf[256]; sprintf(buf, "col1\tcol2\tcol3\n---\t---\t---\n%s\n%s\n%s\n%s\n", "1\t1.0\taa", "2\t2.0\tbbbb", "3\t3.0\tc c c", "4\t4.0\t"); TabTable t(buf); if (t.status() != 0) { printf("test 1 failed\n"); exit(1); } int n; double d; float f; short s; for (int i = 0; i < t.numRows(); i++) { for (int j = 0; j < t.numCols(); j++) { char* s; if (t.get(i, j, s) != 0) { printf("test 2 failed at row %d, col %d\n", i, j); exit(1); } printf("row %d: %s = \"%s\"\n", i, t.colName(j), s); } if (t.get(i, 0, n) != 0) { printf("test 3 failed at row %d, col 0\n", i); exit(1); } if (t.get(i, 0, s) != 0) { printf("test 4 failed at row %d, col 0\n", i); exit(1); } if (t.get(i, 0, d) != 0) { printf("test 5 failed at row %d, col 0\n", i); exit(1); } if (t.get(i, 1, d) != 0) { printf("test 6 failed at row %d, col 1\n", i); exit(1); } if (t.get(i, 1, f) != 0) { printf("test 7 failed at row %d, col 1\n", i); exit(1); } } if (n != 4 || s != 4 || d != 4.0 || f != 4.0) { printf("test 8 failed\n"); exit(1); } // test save method char* filename = "tTabTable.out"; if (t.save(filename) != 0) { printf("test 9 failed\n"); exit(1); } // test append method if (t.append(filename) != 0) { printf("test 10 failed\n"); exit(1); } // test alternate constructor TabTable* t2 = new TabTable(t.numCols(), t.colNames(), buf); if (t.compareHeadings(*t2)) { printf("test 11 failed\n"); exit(1); } TabTable* t3 = new TabTable(t2->numCols(), t2->colNames(), buf); delete t2; TabTable t4; if (TabTable::head(filename, t4) != 0) { printf("test 12 failed\n"); exit(1); } if (t3->compareHeadings(t4)) { printf("test 13 failed\n"); exit(1); } // test search method on file saved above cout << "testing search method:\n"; TabTable t5; char** searchCols = t.colNames(); int numCols = t.numCols(); char* minValues[3]; char* maxValues[3]; minValues[0] = "2"; // col0 maxValues[0] = "3"; minValues[1] = "1"; // col1 maxValues[1] = "3"; minValues[2] = "a"; // col2 maxValues[2] = "d"; if (t5.search(filename, numCols, searchCols, minValues, maxValues, 10) != 0) { printf("test 14 failed\n"); exit(1); } cout << "results of search:\n" << t5; // test sort method int ncols = 1; char* colName = "col2"; if (t5.sort(1, &colName) != 0) { printf("test 15 failed\n"); exit(1); } cout << "results after sort:\n" << t5; // test search for single value cout << "\ntesting search method for single column:\n"; if (t5.search(filename, "col2", "2.0", 1) != 0) { printf("test 16 failed\n"); exit(1); } cout << "results of search:\n" << t5; return 0; } skycat-3.1.2-starlink-1b/cat/tests/tTabTable.ok000066400000000000000000000011121215713201500212360ustar00rootroot00000000000000row 0: col1 = "1" row 0: col2 = "1.0" row 0: col3 = "aa" row 1: col1 = "2" row 1: col2 = "2.0" row 1: col3 = "bbbb" row 2: col1 = "3" row 2: col2 = "3.0" row 2: col3 = "c c c" row 3: col1 = "4" row 3: col2 = "4.0" row 3: col3 = "" testing search method: results of search: TabTable col1 col2 col3 ---- ---- ---- 2 2.0 bbbb 3 3.0 c c c 2 2.0 bbbb 3 3.0 c c c results after sort: TabTable col1 col2 col3 ---- ---- ---- 2 2.0 bbbb 2 2.0 bbbb 3 3.0 c c c 3 3.0 c c c testing search method for single column: results of search: TabTable col1 col2 col3 ---- ---- ---- 2 2.0 bbbb skycat-3.1.2-starlink-1b/cat/tests/tTcsCat000066400000000000000000000013551215713201500203420ustar00rootroot00000000000000#!/bin/sh #\ test -f ../demos/cat_env.sh && . ../demos/cat_env.sh #\ P=$PWD; DIRN=`dirname $0`; cd $DIRN; XP=`pwd`; cd $P #\ if [ -z "$CAT_LIBRARY" ] ; then #\ WISH=cat_wish; L=`dirname $XP`; CAT_LIBRARY="$L/lib/cat" ; export CAT_LIBRARY #\ else WISH=$CAT_LIBRARY/../bin/cat_wish #\ fi #\ LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${INSTALL_TARGET}/lib:/vlt/APR2003/tcltk/lib:/vlt/APR2003/tcltk/lib/itcl:/usr/X11R6/lib" #\ exec $WISH "$0" ${1+"$@"} # -------------------------------------------------- source test.tcl puts "testing the tcscat Tcl command..." tcscat cat cat open gsc@eso puts "GSC headings: [cat headings]" puts "GSC query:" set list [cat query -pos {3:19:48 +41:30:39} -radius 10 -nrows 10] foreach i $list { puts $i } exit 0 skycat-3.1.2-starlink-1b/cat/tests/tTcsCat.tcl000077500000000000000000000004311215713201500211200ustar00rootroot00000000000000source test.tcl # # test the tcscat tcl command # puts "testing the tcscat Tcl command..." tcscat cat cat open gsc@eso puts "GSC headings: [cat headings]" puts "GSC query:" set list [cat query -pos {3:19:48 +41:30:39} -radius 10 -nrows 10] foreach i $list { puts $i } exit 0 skycat-3.1.2-starlink-1b/cat/tests/tTcsCatalog.C000066400000000000000000000042401215713201500213620ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * $Id: tTcsCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tTcsCatalog.C - test cases for class TcsCatalog * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Jun 96 Created */ using namespace std; #include #include #include #include "error.h" #include "TcsCatalog.h" main() { // gcc doesn't need this, but SunCC does... ios::sync_with_stdio(); // errors will be printed on stderr automatically set_error_handler(print_error); // open the GSC catalog TcsCatalog* cat = TcsCatalog::open("gsc@eso"); if (!cat) { printf("TcsCatalog::open returned NULL\n"); exit(1); } // query the GSC for a list of objects at the given pos and radius WorldCoords pos(3, 19, 48, 41, 30, 39); AstroQuery q; q.pos(pos); q.radius(10); q.maxRows(10); cout << "Query GSC for objects at pos " << q.pos() << ", in radius " << q.radius1() << ".." << q.radius2() << ":" << endl; TcsQueryResult result; int num_results = cat->query(q, "./tTcsCatalog.out", result); if (num_results < 0) { cout << "Query returned an error\n"; exit(1); } cout << "Query returns: " << num_results << " objects, out of " << q.maxRows() << " requested" << endl; cout << "More objects ?: " << (cat->more() ? "YES" : "NO") << endl; cout << "---Result List---" << endl; // print the column headings cout << "Results:\n\n"; TcsCatalogObject::printHeadings(cout); cout << "\n-\n"; // print out the rows TcsCatalogObject obj; // holds data for one row for (int row = 0; row < num_results; row++) { if (result.getObj(row, obj) != 0) cout << "row " << row << ": ERROR\n"; else cout << obj << endl; } // -- test VLT type interface -- cout << "\ntest VLT style interface:\n\n"; if (cat->searchClosestStar(pos, 0., 15, obj) != 0) { cout << "searchClosestStar: returned error\n"; } else { cout << "searchClosestStar for " << pos << ": returned row:\n" << obj << endl; } return 0; } skycat-3.1.2-starlink-1b/cat/tests/tTcsCatalog.ok000066400000000000000000000025651215713201500216210ustar00rootroot00000000000000Query GSC for objects at pos 03:19:48.000 +41:30:39.00, in radius 0..10: Query returns: 10 objects, out of 10 requested More objects ?: YES ---Result List--- Results: id ra dec cooSystem epoch pma pmd radvel parallax cooType band mag more preview distance pa - {GSC0285601078} 03:19:48.230 +41:30:42.23 {J2000} 2000 {} {} {} {} {M} {V} 9.23 {} {} 0.07 39 {GSC0285600314} 03:19:44.443 +41:30:58.21 {J2000} 2000 {} {} {} {} {M} {V} 13.98 {} {} 0.74 296 {GSC0285601162} 03:19:51.151 +41:31:25.97 {J2000} 2000 {} {} {} {} {M} {V} 12.93 {} {} 0.98 37 {GSC0285601446} 03:19:55.541 +41:31:23.74 {J2000} 2000 {} {} {} {} {M} {V} 13.72 {} {} 1.6 62 {GSC0285600342} 03:19:57.262 +41:31:34.72 {J2000} 2000 {} {} {} {} {M} {V} 12.31 {} {} 1.97 62 {GSC0285600334} 03:19:48.197 +41:32:50.14 {J2000} 2000 {} {} {} {} {M} {V} 11.77 {} {} 2.19 1 {GSC0285600886} 03:19:36.175 +41:29:58.13 {J2000} 2000 {} {} {} {} {M} {V} 10.86 {} {} 2.32 253 {GSC0285600672} 03:19:35.119 +41:30:39.67 {J2000} 2000 {} {} {} {} {M} {V} 13.39 {} {} 2.41 270 {GSC0285601758} 03:19:48.557 +41:28:09.44 {J2000} 2000 {} {} {} {} {M} {V} 13.78 {} {} 2.49 178 {GSC0285601402} 03:19:52.481 +41:33:00.04 {J2000} 2000 {} {} {} {} {M} {V} 14.67 {} {} 2.5 20 test VLT style interface: searchClosestStar for 03:19:48.000 +41:30:39.00: returned row: {GSC0285601078} 03:19:48.230 +41:30:42.23 {J2000} 2000 {} {} {} {} {M} {V} 9.23 {} {} 0.07 39 skycat-3.1.2-starlink-1b/cat/tests/tTcsLocalCatalog.C000066400000000000000000000042621215713201500223410ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * $Id: tTcsLocalCatalog.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tTcsLocalCatalog.C - test cases for class TcsLocalCatalog * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 19 Nov 97 Created */ using namespace std; #include #include #include #include "error.h" #include "TcsCatalog.h" main() { // gcc doesn't need this, but SunCC does... ios::sync_with_stdio(); // errors will be printed on stderr automatically set_error_handler(print_error); // open the GSC catalog TcsCatalog* cat = TcsCatalog::open("test.table"); if (!cat) { printf("TcsCatalog::open returned NULL\n"); exit(1); } // query the GSC for a list of objects at the given pos and radius WorldCoords pos(3, 19, 48, 41, 30, 39); AstroQuery q; q.pos(pos); q.radius(10); q.maxRows(10); cout << "Query GSC for objects at pos " << q.pos() << ", in radius " << q.radius1() << ".." << q.radius2() << ":" << endl; TcsQueryResult result; int num_results = cat->query(q, "./tTcsCatalog.out", result); if (num_results < 0) { cout << "Query returned an error\n"; exit(1); } cout << "Query returns: " << num_results << " objects, out of " << q.maxRows() << " requested" << endl; cout << "More objects ?: " << (cat->more() ? "YES" : "NO") << endl; cout << "---Result List---" << endl; // print the column headings cout << "Results:\n\n"; TcsCatalogObject::printHeadings(cout); cout << "\n-\n"; // print out the rows TcsCatalogObject obj; // holds data for one row for (int row = 0; row < num_results; row++) { if (result.getObj(row, obj) != 0) cout << "row " << row << ": ERROR\n"; else cout << obj << endl; } // -- test VLT type interface -- cout << "\ntest VLT style interface:\n\n"; if (cat->searchClosestStar(pos, 0., 15, obj) != 0) { cout << "searchClosestStar: returned error\n"; } else { cout << "searchClosestStar for " << pos << ": returned row:\n" << obj << endl; } return 0; } skycat-3.1.2-starlink-1b/cat/tests/tTcsLocalCatalog.ok000066400000000000000000000025761215713201500225760ustar00rootroot00000000000000Query GSC for objects at pos 03:19:48.000 +41:30:39.00, in radius 0..10: Query returns: 10 objects, out of 10 requested More objects ?: YES ---Result List--- Results: id ra dec cooSystem epoch pma pmd radvel parallax cooType band mag more preview distance pa - {GSC0285600050} 03:19:28.140 +41:26:29.00 {J2000} 2000 {} {} {} {} {M} {V} 13.49 {} {} 5.63 222 {GSC0285600098} 03:19:32.990 +41:34:15.42 {J2000} 2000 {} {} {} {} {M} {V} 13.4 {} {} 4.58 322 {GSC0285600288} 03:19:21.100 +41:31:19.74 {J2000} 2000 {} {} {} {} {M} {V} 13.13 {} {} 5.12 277 {GSC0285600314} 03:19:44.440 +41:30:58.21 {J2000} 2000 {} {} {} {} {M} {V} 13.98 {} {} 0.77 293 {GSC0285600334} 03:19:48.200 +41:32:50.14 {J2000} 2000 {} {} {} {} {M} {V} 11.77 {} {} 2.16 360 {GSC0285600342} 03:19:57.260 +41:31:34.72 {J2000} 2000 {} {} {} {} {M} {V} 12.31 {} {} 1.92 62 {GSC0285600418} 03:19:24.110 +41:34:44.58 {J2000} 2000 {} {} {} {} {M} {V} 11.69 {} {} 6.08 312 {GSC0285600518} 03:19:47.840 +41:25:46.45 {J2000} 2000 {} {} {} {} {M} {V} 12.74 {} {} 4.9 181 {GSC0285600526} 03:19:26.740 +41:32:26.23 {J2000} 2000 {} {} {} {} {M} {V} 11.25 {} {} 4.39 294 {GSC0285600548} 03:19:51.070 +41:26:09.89 {J2000} 2000 {} {} {} {} {M} {V} 12.09 {} {} 4.54 173 test VLT style interface: searchClosestStar for 03:19:48.000 +41:30:39.00: returned row: {GSC0285600050} 03:19:28.140 +41:26:29.00 {J2000} 2000 {} {} {} {} {M} {V} 13.49 {} {} 5.63 222 skycat-3.1.2-starlink-1b/cat/tests/tastro_catalog.c000066400000000000000000000144441215713201500222270ustar00rootroot00000000000000/* * E.S.O. - VLT project/ ESO Archive * $Id: tastro_catalog.c,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tastroCatalog.C - test cases for C interface to class AstroCatalog * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 13 Oct 95 Created */ #include #include #include #include "astro_catalog.h" #include "world_coords.h" /* * C main: * note: since the background library os is in C++, we need a C++ main * that calls this C main... */ void c_main() { AcHandle cat; /* handle for catalog */ AcResult result; /* handle for query results */ WC wc1, wc2; /* world coords in HMS */ /* query parameters */ double ra1, dec1, ra2, dec2; double radius1 = 0.0, radius2 = 10.0; double mag1 = 0.0, mag2 = 15.0; int i, j, numCols, numRows; char** colNames = NULL; char* s; double dval; /* hard code the name of the catalog we are testing here. * Note: in the C and C++ interfaces, you can get a list of available * catalogs */ char* catName = "gsc@eso"; /* open the GSC catalog */ printf("opening %s...\n", catName); cat = acOpen(catName); if (!cat) { printf("acOpen failed to open: %s: %s\n", catName, acGetError()); exit(1); } /* first initialize the world coords */ wcInitFromHMS( &wc1, 3, 20, 13.736, /* RA */ 41, 25, 32.28, /* DEC */ 2000.0); /* equinox */ ra1 = wc1.ra.val * 15; /* get ra in degrees */ dec1 = wc1.dec.val; wcInitFromHMS( &wc2, 3, 19, 22.535, /* RA */ 41, 35, 49.75, /* DEC */ 2000.0); /* equinox */ ra2 = wc2.ra.val * 15; /* get ra in degrees */ dec2 = wc2.dec.val; /* get and print out the number of columns and the column names */ printf("\ntesting acGetDescription()...\n"); if (acGetDescription( cat, /* catalog handle */ &numCols, /* gets set to number of columns */ &colNames) /* gets set to array of column names */ != 0) { printf("acGetDescription failed: %s\n", acGetError()); exit(1); } printf("%s has %d columns:\ncolumns: ", catName, numCols); for(i = 0; i < numCols; i++) printf(" %s", colNames[i]); printf("\n\n"); /* do a circular search */ printf("\ntesting acCircularSearch()...\n"); if (acCircularSearch( cat, /* catalog handle */ numCols, /* number of columns to get */ colNames, /* names of columns to get */ ra1, /* RA pos */ dec1, /* DEC pos */ radius1, /* min radius */ radius2, /* max radius */ mag1, /* min mag value (brightest) */ mag2, /* max mag value (dimest) */ 10, /* max rows */ NULL, /* filename */ &numRows, /* set to number of rows found */ &result) /* set to result handle */ != 0) { printf("acCircularSearch failed: %s\n", acGetError()); exit(1); } /* print out the results */ printf("acCircularSearch returned %d rows (%d), %d cols (%d):\n", numRows, acrNumRows(result), numCols, acrNumCols(result)); for (i = 0; i < numRows; i++) { for (j = 0; j < numCols; j++) { if (acrGetString(result, i, j, &s) != 0) { printf("acrGetString failed: %s\n", acGetError()); exit(1); } else { printf("row %d, col %d: %s = %s\n", i, j, colNames[j], s); } } } /* free the results */ acrDelete(result); result = NULL; /* do an area search */ printf("\ntesting acGetArea() ...\n"); if (acGetArea( cat, /* catalog handle */ numCols, /* number of columns to get */ colNames, /* names of columns to get */ ra1, /* RA pos */ dec1, /* DEC pos */ ra2, /* RA pos */ dec2, /* DEC pos */ mag1, /* min mag value (brightest) */ mag2, /* max mag value (dimest) */ 10, /* max rows */ NULL, /* filename */ &numRows, /* set to number of rows found */ &result) /* set to result handle */ != 0) { printf("acGetArea failed: %s\n", acGetError()); } else { printf("acGetArea returned %d rows\n", numRows); } /* Search by Id */ printf("\ntesting acGetObject() ...\n"); if (acGetObject( cat, /* catalog handle */ "GSC0286902474", /* Id */ numCols, /* number of columns to get */ colNames, /* names of columns to get */ &result) /* set to result handle */ != 0) { printf("acGetObject failed: %s\n", acGetError()); } else { /* print out the results */ printf("acGetObject results :\n"); for (j = 0; j < numCols; j++) { if (acrGetString(result, 0, j, &s) != 0) { printf("acrGetString failed: %s\n", acGetError()); } else { printf("col %d: %s = %s\n", j, acColName(cat, j), s); } } } /* test search closest star... */ printf("\ntesting acSearchClosestStar()...\n"); if (acSearchClosestStar( cat, /* catalog handle */ numCols, /* number of columns to get */ colNames, /* names of columns to get */ ra1, /* RA pos */ dec1, /* DEC pos */ mag1, /* min mag value (brightest) */ mag2, /* max mag value (dimest) */ &result) /* set to result handle */ != 0) { printf("acSearchClosestStar failed: %s\n", acGetError()); exit(1); } /* print out the results */ printf("acSearchClosestStar results :\n"); for (j = 0; j < numCols; j++) { if (acrGetString(result, 0, j, &s) != 0) { printf("acrGetString failed: %s\n", acGetError()); } else { printf("col %d: %s = %s\n", j, acColName(cat, j), s); } } /* test some of the utility routines */ printf("testing other utility routines...\n"); if (acrNumRows(result) != 1) printf("acrNumRows failed\n"); if (acrNumCols(result) != numCols) printf("acrNumCols failed\n"); for (i = 0; i < numCols; i++) { if (strcmp(acrColNames(result)[i], acColNames(cat)[i]) != 0) printf("column name error for column %d\n", i); } /* and by column name ... */ if (acrGetNDouble(result, 0, "mag", &dval) != 0) printf("error in acrGetNDouble\n"); else printf("value for 'mag' by col name is %f\n", dval); if (acrGetNDouble(result, 0, "dec", &dval) != 0) printf("error in acrGetNDouble\n"); else printf("value for 'dec'as float by col name is %f\n", dval); if (acrGetWC(result, 0, &wc1) != 0) printf("error in acrGetWC\n"); else printf("value for ra (degrees) and dec from acrGetWC: %f %f\n", wc1.ra.val * 15, wc1.dec.val); /* normal exit */ exit(0); } skycat-3.1.2-starlink-1b/cat/tests/tastro_catalog.ok000066400000000000000000000063101215713201500224070ustar00rootroot00000000000000Guide Star Catalog at ESO does not suppport search by id opening gsc@eso... testing acGetDescription()... gsc@eso has 9 columns: columns: gsc_id ra dec pos-e mag mag-e mu d' pa testing acCircularSearch()... acCircularSearch returned 10 rows (10), 9 cols (9): row 0, col 0: gsc_id = GSC0286902722 row 0, col 1: ra = 50.06755 row 0, col 2: dec = 41.41473 row 0, col 3: pos-e = 0.2 row 0, col 4: mag = 13.30 row 0, col 5: mag-e = 0.40 row 0, col 6: mu = F row 0, col 7: d' = 0.80 row 0, col 8: pa = 145; row 1, col 0: gsc_id = GSC0286902944 row 1, col 1: ra = 50.05112 row 1, col 2: dec = 41.41135 row 1, col 3: pos-e = 0.2 row 1, col 4: mag = 13.97 row 1, col 5: mag-e = 0.40 row 1, col 6: mu = F row 1, col 7: d' = 0.90 row 1, col 8: pa = 198; row 2, col 0: gsc_id = GSC0286902474 row 2, col 1: ra = 50.06464 row 2, col 2: dec = 41.39870 row 2, col 3: pos-e = 0.2 row 2, col 4: mag = 12.15 row 2, col 5: mag-e = 0.40 row 2, col 6: mu = F row 2, col 7: d' = 1.65 row 2, col 8: pa = 168; row 3, col 0: gsc_id = GSC0286902570 row 3, col 1: ra = 50.11334 row 3, col 2: dec = 41.39969 row 3, col 3: pos-e = 0.2 row 3, col 4: mag = 12.69 row 3, col 5: mag-e = 0.40 row 3, col 6: mu = F row 3, col 7: d' = 2.97 row 3, col 8: pa = 122; row 4, col 0: gsc_id = GSC0286902564 row 4, col 1: ra = 50.11210 row 4, col 2: dec = 41.46054 row 4, col 3: pos-e = 0.2 row 4, col 4: mag = 13.81 row 4, col 5: mag-e = 0.40 row 4, col 6: mu = F row 4, col 7: d' = 3.24 row 4, col 8: pa = 50; row 5, col 0: gsc_id = GSC0286902856 row 5, col 1: ra = 50.08727 row 5, col 2: dec = 41.37378 row 5, col 3: pos-e = 0.2 row 5, col 4: mag = 14.05 row 5, col 5: mag-e = 0.40 row 5, col 6: mu = F row 5, col 7: d' = 3.39 row 5, col 8: pa = 157; row 6, col 0: gsc_id = GSC0286902776 row 6, col 1: ra = 50.05037 row 6, col 2: dec = 41.36709 row 6, col 3: pos-e = 0.2 row 6, col 4: mag = 11.00 row 6, col 5: mag-e = 0.40 row 6, col 6: mu = F row 6, col 7: d' = 3.53 row 6, col 8: pa = 185; row 7, col 0: gsc_id = GSC0285601584 row 7, col 1: ra = 49.98170 row 7, col 2: dec = 41.40847 row 7, col 3: pos-e = 0.2 row 7, col 4: mag = 14.35 row 7, col 5: mag-e = 0.40 row 7, col 6: mu = F row 7, col 7: d' = 3.55 row 7, col 8: pa = 253; row 8, col 0: gsc_id = GSC0286902744 row 8, col 1: ra = 50.03461 row 8, col 2: dec = 41.36635 row 8, col 3: pos-e = 0.2 row 8, col 4: mag = 13.11 row 8, col 5: mag-e = 0.40 row 8, col 6: mu = F row 8, col 7: d' = 3.70 row 8, col 8: pa = 196; row 9, col 0: gsc_id = GSC0286902405 row 9, col 1: ra = 50.10083 row 9, col 2: dec = 41.37231 row 9, col 3: pos-e = 0.2 row 9, col 4: mag = 10.64 row 9, col 5: mag-e = 0.40 row 9, col 6: mu = F row 9, col 7: d' = 3.75 row 9, col 8: pa = 148; testing acGetArea() ... acGetArea returned 10 rows testing acGetObject() ... acGetObject failed: Guide Star Catalog at ESO does not suppport search by id testing acSearchClosestStar()... acSearchClosestStar results : col 0: gsc_id = GSC0286902722 col 1: ra = 50.06755 col 2: dec = 41.41473 col 3: pos-e = 0.2 col 4: mag = 13.30 col 5: mag-e = 0.40 col 6: mu = F col 7: d' = 0.80 col 8: pa = 145; testing other utility routines... value for 'mag' by col name is 13.300000 value for 'dec'as float by col name is 41.414730 value for ra (degrees) and dec from acrGetWC: 50.067550 41.414730 skycat-3.1.2-starlink-1b/cat/tests/tastro_image.c000066400000000000000000000032051215713201500216700ustar00rootroot00000000000000/* * E.S.O. - VLT project/ ESO Archive * $Id: tastro_image.c,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tastroImage.C - test cases for class C interface to AstroImage classes * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created */ #include #include #include #include "astro_catalog.h" #include "world_coords.h" /* * C main: * note: since the background library is in C++, we need a C++ main * that calls this C main... */ void c_main() { AcHandle im; /* handle for image server */ WC wc; /* world coords */ double ra, dec; double width = 1.0, height = 1.0; /* dimensions of image */ char buf[256]; char* filename; /* Try to retrieve an image from the DSS server */ im = acOpen("dss@eso"); if (!im) { printf("acOpen failed to open DSS server: %s\n", acGetError()); exit(1); } /* first initialize the world coords */ wcInitFromHMS(&wc, 3, 19, 48, 41, 30, 39, 2000.0); ra = wc.ra.val * 15; /* RA in degrees */ dec = wc.dec.val; printf("Retrieve DSS image at pos %d:%d:%f %d %d %f, width: %f, height: %f:\n", wc.ra.hours, wc.ra.min, wc.ra.sec, wc.dec.hours, wc.dec.min, wc.dec.sec, width, height); filename = acGetImage(im, ra, dec, width, height); if (filename == NULL) { printf("DSS Test failed: %s", acGetError()); exit(1); } printf("DSS returned file name (renaming to ./dss.fits)\n"); sprintf(buf, "mv %s ./dss.fits", filename); if (system(buf) != 0) perror("file rename error"); exit(0); } skycat-3.1.2-starlink-1b/cat/tests/tastro_image.ok000066400000000000000000000002151215713201500220550ustar00rootroot00000000000000Retrieve DSS image at pos 3:19:48.000000 41 30 39.000000, width: 1.000000, height: 1.000000: DSS returned file name (renaming to ./dss.fits) skycat-3.1.2-starlink-1b/cat/tests/test.preview000066400000000000000000000016141215713201500214320ustar00rootroot00000000000000PreviewData This is a test of a tab table to plot X Y Z - - - 1 3 7.7 1 3 8 1 3 8 1 3 8 1 4 8 1 4 8 1 4 8 1 4 8 1 5 8 1 5 8 1 5 8 2 3 7.7 2 3 7.7 2 3 7.7 2 4 7 2 4 7 2 4 7 2 4 7 2 5 6 2 5 6 2 5 6 2 5 7 2 5 7 2 5 7 2 5 7 2 5 7.7 2 5 7.7 2 5 7.7 2 5 8 2 5 8 2 5 8 2 5 8 2 5 8 2 5 8 2 5 8 2 5 8 2 6 5 2 6 5 2 6 5 2 6 6 2 6 6 2 6 6 2 6 7 2 6 7 2 6 7 2 6 7 2 6 7 2 6 7 2 6 8 2 6 8 2 6 8 2 6 8 2 6 8 2 6 8 2.2 3.3 8.9 2.2 3.3 8.9 2.2 3.3 8.9 2.2 3.3 8.9 2.2 4.3 7 2.2 4.3 7 2.2 4.3 7 2.2 4.3 8.9 2.2 4.3 8.9 2.2 4.3 8.9 2.2 7 9 2.2 7 9 2.2 7 9 3 4 7 3 4 7 3 4 7 3 4 7 3 5 4 3 5 4 3 5 4 3 5 4 3 5 6 3 5 6 3 5 6 3 5 6 3 5 6 3 5 6 3 5 6 3 5 7 3 5 7 3 5 7 3 6 5 3 6 5 3 6 5 3 6 6 3 6 6 3 6 6 3 6 6 3 6 6 3 6 6 3 6 6 3 6 6 3 6 6 3 6 6 3 6 6 3 6 6 3 6 6 3 6 6 3 6 7 3 6 7 3 6 7 3 6 7 3 6 7 3 6 7 3 6 7 3.2 6 9 3.2 6 9 3.2 6 9 3.2 6 9 4 3 8 4 3 8 4 3 8 4 3 8 4 5 5 4 5 5 4 5 5 4 6 5 4 6 5 4 6 5 4 6 5 4 6 8 4 6 8 4 6 8 skycat-3.1.2-starlink-1b/cat/tests/test.table000066400000000000000000000064331215713201500210440ustar00rootroot00000000000000Local Catalog This table was generated by skycat.tcl on Mon Jun 10 19:35:18 MET DST 1996 by user allan from "Guide Star Catalog at ESO" gsc-id ra dec pos-e mag mag-e mu d' pa ------ -- --- ----- --- ----- -- -- -- GSC0285600050 03:19:28.14 +41:26:29.00 0.2 13.49 0.40 F 5.63 222; GSC0285600098 03:19:32.99 +41:34:15.42 0.4 13.40 0.40 F 4.58 322; GSC0285600288 03:19:21.10 +41:31:19.74 0.2 13.13 0.40 F 5.12 277; GSC0285600314 03:19:44.44 +41:30:58.21 0.2 13.98 0.40 F 0.77 293; GSC0285600334 03:19:48.20 +41:32:50.14 0.2 11.77 0.40 F 2.16 360; GSC0285600342 03:19:57.26 +41:31:34.72 0.2 12.31 0.40 F 1.92 62; GSC0285600418 03:19:24.11 +41:34:44.58 0.2 11.69 0.40 F 6.08 312; GSC0285600518 03:19:47.84 +41:25:46.45 0.2 12.74 0.40 F 4.90 181; GSC0285600526 03:19:26.74 +41:32:26.23 0.2 11.25 0.40 F 4.39 294; GSC0285600548 03:19:51.07 +41:26:9.89 0.4 12.09 0.40 F 4.54 173; GSC0285600582 03:19:54.12 +41:33:48.49 0.2 10.75 0.40 F 3.32 19; GSC0285600616 03:19:37.64 +41:36:26.75 0.2 12.20 0.40 F 6.11 341; GSC0285600662 03:19:51.46 +41:34:25.36 0.2 11.67 0.40 F 3.80 9; GSC0285600672 03:19:35.12 +41:30:39.67 0.2 13.39 0.40 F 2.46 270; GSC0285600676 03:19:17.86 +41:30:25.06 0.2 13.87 0.40 F 5.69 267; GSC0285600832 03:19:36.32 +41:34:21.40 0.2 13.69 0.40 F 4.31 329; GSC0285600856 03:19:37.23 +41:29:9.78 1.2 13.94 0.40 F 2.55 234; GSC0285600886 03:19:36.18 +41:29:58.13 0.2 10.86 0.40 F 2.37 253; GSC0285600980 03:19:36.51 +41:25:2.75 0.2 11.09 0.40 F 6.04 201; GSC0285601044 03:19:45.74 +41:24:6.01 0.2 13.97 0.40 F 6.59 184; GSC0285601066 03:19:34.23 +41:34:50.23 0.2 12.10 0.40 F 4.92 328; GSC0285601078 03:19:48.23 +41:30:42.23 0.2 9.23 0.40 F 0.03 357; GSC0285601092 03:19:47.80 +41:35:46.82 0.2 12.93 0.40 F 5.11 359; GSC0285601162 03:19:51.15 +41:31:25.97 0.2 12.93 0.40 F 0.94 36; GSC0285601186 03:19:40.54 +41:32:55.46 0.2 12.17 0.40 F 2.67 327; GSC0285601330 03:19:51.48 +41:27:24.41 0.2 11.31 0.40 F 3.32 169; GSC0285601350 03:19:21.30 +41:29:27.53 1.2 10.51 0.40 F 5.19 257; GSC0285601402 03:19:52.48 +41:33:0.04 0.2 14.67 0.40 F 2.46 19; GSC0285601410 03:19:59.05 +41:28:46.60 0.2 12.61 0.40 F 2.77 133; GSC0285601412 03:19:25.94 +41:35:25.62 0.2 13.91 0.40 F 6.33 319; GSC0285601426 03:19:40.49 +41:35:44.59 0.2 12.26 0.40 F 5.27 344; GSC0285601446 03:19:55.54 +41:31:23.74 0.2 13.72 0.40 F 1.55 62; GSC0285601492 03:19:43.79 +41:27:25.56 0.2 14.56 0.40 F 3.35 194; GSC0285601540 03:19:34.87 +41:33:42.80 0.2 13.62 0.40 F 3.94 321; GSC0285601584 03:19:55.61 +41:24:30.49 0.2 14.35 0.40 F 6.32 167; GSC0285601598 03:19:15.86 +41:31:58.58 0.2 13.45 0.40 F 6.20 282; GSC0285601660 03:19:19.80 +41:32:2.54 0.2 13.65 0.40 F 5.50 284; GSC0285601758 03:19:48.56 +41:28:9.44 0.2 13.78 0.40 F 2.52 179; GSC0285601824 03:19:22.38 +41:25:46.16 0.2 13.07 0.40 F 6.89 225; GSC0286902390 03:20:14.03 +41:30:29.59 0.2 13.43 0.40 F 4.83 92; GSC0286902594 03:20:15.39 +41:34:55.92 0.2 11.76 0.40 F 6.63 50; GSC0286902669 03:20:22.14 +41:32:23.46 0.2 11.55 0.40 F 6.57 75; GSC0286902672 03:20:17.31 +41:32:34.26 0.2 12.47 0.40 F 5.76 71; GSC0286902678 03:20:4.95 +41:34:21.76 0.2 13.08 0.40 F 4.84 40; GSC0286902822 03:20:2.72 +41:30:34.42 0.2 14.73 0.40 F 2.71 92; GSC0286902844 03:20:2.60 +41:30:59.51 0.2 13.44 0.40 F 2.71 83; GSC0286902860 03:20:19.22 +41:33:4.93 0.2 12.98 0.40 F 6.28 67; GSC0286902884 03:20:0.87 +41:33:14.00 0.2 13.07 0.40 F 3.49 43; skycat-3.1.2-starlink-1b/cat/tests/test.tcl000066400000000000000000000011761215713201500205360ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: test.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # test.tcl - tcl defs to set up environment for test scripts # # Usage: source test.tcl # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 08 Apr 97 created proc tkerror {msg} { global errorInfo puts stderr "$errorInfo" tkerror__ "error: $msg" } # for debugging: print all errors on stderr catch {tkerror} rename tkerror tkerror__ #lappend auto_path ../library package require Cat set tk_strictMotif 1 tk appname Tclutil utilPrintErrors util::setXdefaults skycat-3.1.2-starlink-1b/configure000077500000000000000000002160131215713201500170470ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Starlink Autoconf 2.59 for skycat 3.1.2. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='skycat' PACKAGE_TARNAME='skycat' PACKAGE_VERSION='3.1.2' PACKAGE_STRING='skycat 3.1.2' PACKAGE_BUGREPORT='' ac_subdirs_all="$ac_subdirs_all tclutil astrotcl rtd cat skycat" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS subdirs LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures skycat 3.1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of skycat 3.1.2:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-merge merge the contents of compile-time dependent packages into master rtd, cat and skycat libraries Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-blt=DIR link with BLT library installed in DIR _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF skycat configure 3.1.2 generated by Starlink Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by skycat $as_me 3.1.2, which was generated by Starlink Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in tclconfig $srcdir/tclconfig; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in tclconfig $srcdir/tclconfig" >&5 echo "$as_me: error: cannot find install-sh or install.sh in tclconfig $srcdir/tclconfig" >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Check whether --with-blt or --without-blt was given. if test "${with_blt+set}" = set; then withval="$with_blt" with_blt=$withval fi; # Check whether --enable-merge or --disable-merge was given. if test "${enable_merge+set}" = set; then enableval="$enable_merge" MERGED=$enableval else MERGED=no fi; echo "build merged master libraries for rtd, cat and skycat? $MERGED" subdirs="$subdirs tclutil astrotcl rtd cat skycat" ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by skycat $as_me 3.1.2, which was generated by Starlink Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ skycat config.status 3.1.2 configured by $0, generated by Starlink Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@subdirs@,$subdirs,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi # # CONFIG_SUBDIRS section. # if test "$no_recursion" != yes; then # Remove --cache-file and --srcdir arguments so they do not pile up. ac_sub_configure_args= ac_prev= for ac_arg in $ac_configure_args; do if test -n "$ac_prev"; then ac_prev= continue fi case $ac_arg in -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \ | --c=*) ;; --config-cache | -C) ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) ;; *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; esac done # Always prepend --prefix to ensure using the same prefix # in subdir configurations. ac_sub_configure_args="--prefix=$prefix $ac_sub_configure_args" ac_popdir=`pwd` for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue # Do not complain, so a configure script can configure whichever # parts of a large source tree are present. test -d $srcdir/$ac_dir || continue { echo "$as_me:$LINENO: configuring in $ac_dir" >&5 echo "$as_me: configuring in $ac_dir" >&6;} { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then ac_sub_configure="$SHELL '$ac_srcdir/configure.gnu'" elif test -f $ac_srcdir/configure; then ac_sub_configure="$SHELL '$ac_srcdir/configure'" elif test -f $ac_srcdir/configure.in; then ac_sub_configure=$ac_configure else { echo "$as_me:$LINENO: WARNING: no configuration information is in $ac_dir" >&5 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;} ac_sub_configure= fi # The recursion is here. if test -n "$ac_sub_configure"; then # Make the cache file name correct relative to the subdirectory. case $cache_file in [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;; *) # Relative path. ac_sub_cache_file=$ac_top_builddir$cache_file ;; esac { echo "$as_me:$LINENO: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5 echo "$as_me: running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;} # The eval makes quoting arguments work. eval $ac_sub_configure $ac_sub_configure_args \ --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir || { { echo "$as_me:$LINENO: error: $ac_sub_configure failed for $ac_dir" >&5 echo "$as_me: error: $ac_sub_configure failed for $ac_dir" >&2;} { (exit 1); exit 1; }; } fi cd $ac_popdir done fi skycat-3.1.2-starlink-1b/configure.in000066400000000000000000000016751215713201500174570ustar00rootroot00000000000000# E.S.O. - VLT project # $Id: configure.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is used with GNU autoconf to generate a configure script for # building Skycat. # # who when what # -------------- -------- --------------------------------------------- # Allan Brighton 15/12/05 Rewrote using TCL TEA standard # ----------------------------------------------------------------------- AC_INIT([skycat], [3.1.2]) AC_CONFIG_AUX_DIR(tclconfig) AC_ARG_WITH(blt, [AC_HELP_STRING([--with-blt=DIR],[link with BLT library installed in DIR])], with_blt=$withval) AC_ARG_ENABLE(merge, [AC_HELP_STRING([--enable-merge],[merge the contents of compile-time dependent packages into master rtd, cat and skycat libraries])], [MERGED=$enableval], [MERGED=no]) echo "build merged master libraries for rtd, cat and skycat? $MERGED" AC_CONFIG_SUBDIRS(tclutil astrotcl rtd cat skycat) AC_OUTPUT([Makefile]) skycat-3.1.2-starlink-1b/doit000077500000000000000000000004351215713201500160240ustar00rootroot00000000000000#!/bin/sh # Convenience script to configure, build and install skycat in the given prefix dir. # Edit the next line: prefix=/usr/local #prefix=$HOME/work/eso/skycat/install make -f Makefile.in autoconf configure --prefix=$prefix --exec_prefix=$prefix make all install #make release skycat-3.1.2-starlink-1b/plugins/000077500000000000000000000000001215713201500166165ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/plugins/README000066400000000000000000000007431215713201500175020ustar00rootroot00000000000000 Skycat Plugins ============== This directory contains a sample plugin for skycat, which is a script that can be dynamically loaded by skycat to add new features. * graphics_features This directory contains some simple Tcl scripts that add a menu item to the Skycat "Graphics" menu for saving and reloading line graphics, optionally based on world coordinates and also with a "sticky" option that keeps the graphics around after a new image has been loaded. skycat-3.1.2-starlink-1b/plugins/graphics_features/000077500000000000000000000000001215713201500223145ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/plugins/graphics_features/README000066400000000000000000000007671215713201500232060ustar00rootroot00000000000000 Skycat Plugin Examples ====================== This directory contains the Tcl sources for an example skycat plugin that adds the ability to save line graphics to a file in world or image coordinates and reload them again. To use this file for skycat, set the environment variable SKYCAT_PLUGIN to the path name of the SkyCat_plugin.tcl file. This file defines one tcl proc: SkyCat_plugin, which takes one argument: the name of the top level skycat widget. See the skycat documentation for details. skycat-3.1.2-starlink-1b/plugins/graphics_features/SkyCat_plugin.tcl000066400000000000000000000026041215713201500255760ustar00rootroot00000000000000#-*-tcl-*- # E.S.O. - VLT project/ESO Archive # $Id: SkyCat_plugin.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # SkyCat_plugin.tcl - example SkyCat plug-in script # # This is an example plugin file for skycat. It can be used to add # features to skycat at startup. To use this file for skycat, set the # environment variable SKYCAT_PLUGIN to the path name of this file. # # This file must define at least one tcl proc: SkyCat_plugin, which # takes one argument: the name of the top level skycat widget. # # This plugin adds the ability to save and reload line graphics by # adding 2 menu items to the Graphics menu. # # See the documentation, man pages and Itcl widget source code for details. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 20 Jan 98 created # puts "Loading the graphics features plugin..." # This proc is required. It will be called once for each skycat # instance. The parameter is the name ("$this") of the SkyCat # class object. proc SkyCat_plugin {this} { # get the toplevel widget name set w [utilNamespaceTail $this] # call a proc to add items to the Graphics menu. # Note that the directory containing this file is automatically # appended to the Tcl auto_path, so we can just call a proc # as long as there is a tclIndex file in this directory. add_graphics_features $w } skycat-3.1.2-starlink-1b/plugins/graphics_features/VERSION000066400000000000000000000000261215713201500233620ustar00rootroot00000000000000graphics_features-1.0 skycat-3.1.2-starlink-1b/plugins/graphics_features/graphics_features.tcl000066400000000000000000000154431215713201500265250ustar00rootroot00000000000000#-*-tcl-*- # E.S.O. - VLT project/ESO Archive # $Id: graphics_features.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # graphics_features.tcl - add graphics features to Skycat Graphics # menu. # # The add_graphics_features proc is called by the example SkyCat # plugin script in this directory to add menu items to the Graphics # menu in Skycat to save and reload line graphics. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 20 Jan 98 created # # Add "Save Graphics" and "Load Graphics" menu items to the Skycat # Graphics menu so that line graphics may be saved to a file and # reloaded later. You can save the graphics using world or image # coordinates and specify when reloading, whether or not the graphics # should be "sticky" and remain after a new image is loaded. # # $w is the name of the top level window. proc add_graphics_features {w} { # get the path name of the Graphics menu # (see TopLevelWidget in tclutil) set m [$w get_menu Graphics] $m add separator $w add_menuitem $m command "Save graphics..." \ {Save line graphics to a file} \ -command [code save_graphics $w] $w add_menuitem $m command "Load graphics..." \ {Load line graphics from a file} \ -command [code load_graphics $w] } # convert the given coordinates from $from_units to $to_units using the given # rtdimage handle and return the result. $coords may be a list of an even # number of values {x1 y1 x2 y2 x3 y3 ...}. The result is the same list, # converted to the output coordinates. proc convert_coords {coords from_units to_units image} { set result {} set len [llength $coords] for {set i 0} {$i < $len} {incr i 2} { set ix [lindex $coords $i] set iy [lindex $coords [expr $i+1]] $image convert coords $ix $iy $from_units x y $to_units lappend result $x $y } return $result } # Ask for a file name and save line graphics to the given file proc save_graphics {w} { set filename [filename_dialog] if {"$filename" == ""} { return } # check if file exists and, if so, ask for confirmation if {[file exists $filename]} { if {! [confirm_dialog "File `[file tail $filename]' exists. Overwrite it?"]} { return } } # ask if we should save the graphics in world or image coords set choice [choice_dialog \ "Please select the type of coordinates to save the graphics in:" \ {{World Coordinates} {Image Coordinates} Cancel} {World Coordinates} $w] if {$choice == "Cancel"} { return } elseif {$choice == "World Coordinates"} { set units {deg J2000} } else { set units image } # create the file if {[catch {set fd [open $filename w]} msg]} { error_dialog $msg return } # get the handle of the canvas window for the image set canvas [$w component image component canvas] # get the handle for the rtdimage item (for converting coordinates) set image [$w component image get_image] # get the handle for the image' graphic editor (class CanvasDraw) # so that we can deselect any selected graphic objects set draw [$w component image component draw] $draw deselect_objects # save the coordinate type: degrees J2000 or image pixel coords puts $fd "set units \"$units\"" # loop through the canvas items foreach item [$canvas find all] { set type [$canvas type $item] if {"$type" == "image"} { continue } # get item coords and convert from canvas coords to $units set coords [convert_coords [$canvas coords $item] canvas $units $image] # add a special tag to this item so we can delete it before reloading it $canvas addtag $filename withtag $item # get list of configuration options for the item set config {} foreach cfg [$canvas itemconfigure $item] { lappend config [list [lindex $cfg 0] [lindex $cfg 4]] } puts $fd [list $type $coords $config] } close $fd } # Ask for a file name and load the line graphics from the given file proc load_graphics {w} { set filename [filename_dialog] if {"$filename" == ""} { return } # make sure the file exists if {! [file exists $filename]} { error_dialog "file `[file tail $filename]' does not exist" return } # open the file for reading if {[catch {set fd [open $filename]} msg]} { error_dialog $msg return } # get the handle of the canvas window for the image set canvas [$w component image component canvas] # get the handle for the rtdimage item (for converting coordinates) set image [$w component image get_image] # get the handle for the image' graphic editor (class CanvasDraw) # so that we can set bindings for editing objects set draw [$w component image component draw] # check for "set units..." line set linenum 0 if {[gets $fd line] != -1} { incr linenum if {[llength $line] != 3} { error_dialog "bad input file format: line $linenum, expected: set units ..." close $fd return } lassign $line s1 s2 s3 # check for "set units..." line if {"$s1" == "set" && "$s2" == "units"} { eval $line } else { error_dialog "expected first line to be \"set units ...\"" $w close $fd return } } # if using image coords, ask if the graphics should be "sticky" # (i.e.: stay after new image is loaded) set sticky 0 if {"$units" == "image"} { set choice [choice_dialog \ "Do you want these items to remain visible after you load a new image?:" \ {Yes No Cancel} No $w] if {$choice == "Cancel"} { return } elseif {$choice == "Yes"} { set sticky 1 } else { set sticky 0 } } # delete any items that have already been loaded from this file $canvas delete $filename # loop through the contents of the file and create canvas items while {[gets $fd line] != -1} { incr linenum if {[llength $line] != 3} { error_dialog "bad input file format: line $linenum, expected: type coords config" close $fd return } lassign $line type coords config # convert coords from $units to canvas coords if {[catch {set coords [convert_coords $coords $units canvas $image]} msg]} { puts $msg continue } set id [eval $canvas create $type $coords] foreach cfg $config { lassign $cfg opt arg $canvas itemconfigure $id $opt $arg } # items with the "objects" tag are always deleted when a new image is loaded # so if we want the graphics to be "sticky", we remove that tag. # (The util::CanvasDraw class assigns the "objects" tag for graphic objects # created interactively and other classes follow the convention also.) if {$sticky} { $canvas dtag $id objects $canvas dtag $id $draw.objects $canvas addtag sticky withtag $id } # add bindings so that the items may be edited and saved again $draw add_object_bindings $id } close $fd } skycat-3.1.2-starlink-1b/rtd/000077500000000000000000000000001215713201500157265ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/rtd/CHANGES000066400000000000000000001753751215713201500167430ustar00rootroot00000000000000CHANGES to the RTD Sources -------------------------- This file contains a list of changes to the RTD software and user interface. The latest changes are at the top. --------------- 20.10.08 released rtd-3.2.1 ----------------- * Revised RtdImageHduChooser.tcl --------------- 20.10.08 released rtd-3.2.0 ----------------- * Added support for data types double and long long int. --------------- 10.09.07 released rtd-3.1 ------------------- * Increased maximum number of views of an image from 8 to 64 --------------- 03.02.06 released rtd-3.0 ------------------- * Major update: see top level CHANGES file. --------------- 04.04.05 released rtd-2.29 ----------------- * Merged in RTD changes from Peter Biereichel: * Fixed: too many open files when building colormaps.C * rtdRemote.c: Fixed: variable argument list * workaround bug in tcl 8.4.3 (SourceForge Request ID 835020) * using TCL_CC_SEARCH_FLAGS from tclConfig.sh as of tcl8.4 * added LD_SEARCH_FLAGS to build librtd.so * VLTSW20030157: View->Cuts pop-up window information missing * tested with APR2004 (tcl8.4, itcl3.3) * Test with gcc 3.3: variable argument list has changed * Documented in rtdSem.c and rtdImageEvent.c: semId must be set to -1 if semaphore locking is not used (semId=0 is a valid number). Users usually just clear the image event info structure before filling in the data needed. This has given interference problems with other processes on Solaris after booting the machine. * The image data byte order in RTD is clarified here: - FITS uses network byte ordering (big Endian) and binary FITS images on disks are also in big Endian. - In most cases RTD mmap's image files to avoid copying of images into memory which may lead to heavy disk swaps for very large images. So RTD needs to change the byte order on-the-fly when running on little Endian (i386) machines. The speed hit is pretty small since RTD only works on the visable image part. - A camera process can store the data into shm either in native byte order or tell RTD to do the byte-swap since the data were generated by a machine with a different byte order. - RTD used to have the "native" byte order flag which only did the byte swap for networked byte ordered data on little Endian machines. With the new "shmEndian" flag it is also possible to tell RTD (via an image event) that the data need to be byte-swapped. In the rtdimg/test directory there is a test program tRtdEndian.tcl which tests many Endian/datatype combinations, also including bias subtraction. * Revised the BiasImage and ImageTemplate class (didn't work with all combinations of data-types/endians). * include.mk files contains a flag SRCS_OPTL which only installes some include files (eg. from cfitsio) when VLTROOT is not set. This change was on request (SPR) since these includes gave problems with the RTD VLTSW distribution, which also contains cfitsio (but latest version). * By request: RtdImage.tcl automatically launches rtdServer when needed. * Updated printout for rtd --help (SPR). * Generally 'using namespace std' instead of specifying ::std * "autocut" uses autoSetCutLevels(99.5) instead of medianFilter(). This gives much better results and is also faster. In fact, users complaint about the bad cut-level setting via medianFilter(). * For Allan: --no-print-directory -s in makefile.mk.in was re-enabled again since the output was too verbose. One can easily overlook compiler errors (which happens several times to me). * Added define for SOCKLEN_T in define.h --------------- 20.01.03 released rtd-2.24 ----------------- * Ported to gcc-3.2.1 and Tcl-8.4.1 --------------- 27.02.02 released rtd-2.23 ----------------- * Fixed minor bug in HDU Chooser dialog. --------------- 13.12.01 released rtd-2.22 ----------------- * Enabled WCS coordinate conversion outside of the image area (by request). Now the RA and Dec values are also displayed when the mouse leaves the image area. * fixed problem with equinox syntax reported by David Terrett. --------------- 27.08.01 released rtd-2.21 ----------------- * Merged in changes from Peter Biereichel (see rtd-2.20.10). * Fixed the -float_panel and -panel_orient options as well as the show/hide control panel menu item. --------------- 21.08.01 released rtd-2.20.10 ----------------- * RtdImageCtrl.tcl: loading an image detaches the camera. Re-open pops-up again the HDU chooser (in case that it was closed before). * New widget for viewing the FITS header (RtdImageFitsHeader.tcl) which also shows the headers of the HDU's (becoming more important for VLT/VLTI projects). * RtdImageHduChooser.tcl shows HDU images only on request for speed reasons. Double clicking on a binary FITS table will show/hide the binary table (needed for FLAMES and other VLT projects). Displays only images with NAXIS >=2 (needed for VLT CCD software). * New widgets for 'Pick Object' (RtdImagePick2.tcl and RtdImagePickView.tcl) which allow to pick an object with a given sample size. They will be used by VLT applications like 'tcscam' and are made more general/public than RtdImagePick.tcl (RtdImagePick.tcl wasn't made for inheritance). * added 'statistics noise' subcommand for computing RMS, mean, average, min, max values on a user defined area. * added bltgraph subcommand for plotting VLTI scans (currently used by the VINCI application 'rtdvi'). * added info subcommand (info bbox, etc.). * All image event related tasks revised: o removed XSyncSetPriority() in RtdImage.C since this blocked X-clients after rapid image events (had to reboot Linux). o rtdServer was re-written (C++) for simplification and since Paranal reported that sometimes it exited without any message (nor core dump). o tRtd was generalized for testing image events. Currently it supports short image data only. o New widget for tRtd options which comes up when Rtd is started with the -debug option. o Performance measurements (and widget) revised. o Added method flushX() to ImageDisplay.C * Restructured the code of RtdImage.C since it became too large. Image commands are now in RtdCmds.C, coordinate routines in RtdCoords.C and HDU routines in RtdHDU.C. * Adapted all Makefile.in files for makefile.mk which now contains RTD standard rules. The standard rules were adapted from the previous Makefiles. Note, the standard rules still need to be done for all other sub-packages (tclutil, astotcl, etc.) -- need to talk with Allan... * Fixed "array out of bounds" in getMinMax() (ImageTemplates.C) * added RtdImage options -fillWidth, -fillHeight for auto scaling the image (needed by VLT autoguider which switches full image display to window and vice versa). * iqefunc.c: The old Midas routine crashed RTD. Bug fixed by pbiereic and kbanse (SPR VLTSW20000143). * RtdImage::loadFile() opens the file with reading only to avoid that the file is changed on disk (SPR VLTSW20000144). * for gcc version 2.95.2 on HP-UX 11: had to re-order in a number of files - maybe obsolete with new gcc version... --------------- 30.07.01 released rtd-2.20.9 ----------------- * Fixed problem with X shared memory, ssh and X11 forwarding: (X shm areas are not freed, so don't use them in this case) Added check in RtdImage.C for screen number "0", since when using X11 forwarding with ssh, the display is set to something like "host:10:0" - a proxy server, and the X shared memory is never freed. --------------- 18.05.01 released rtd-2.20.8 ----------------- * Ported to tcl8.3.3 (still compatible with earlier versions). The main change was to update the image related code to use the changed C Tk image interface. --------------- 11.05.01 released rtd-2.20.7 ----------------- * Changed the way multiple FITS image extensions are combined when you press the "Display as One Image" button in the HDU Chooser dialog. Previously, it was assumed that the CRPIX values were negative. Now they may be positive or negative and the resulting image is shifted to begin at 0,0 (See CompoundImage.C). --------------- 17.02.01 released rtd-2.20.6 ----------------- * Fixed a bug converting coordinates between deg and wcs using the rtd tcl subcommand "convert". --------------- 20.09.00 released rtd-2.20.5 ----------------- * Minor layout changes in RtdImageTrans.tcl (slightly different pack padding). * Minor bug fixes in the RtdImageHDUChooser.tcl, for case where CRPIX1 or 2 is not defined. * Fixed a bug in the display of galactic coordinates: RA was being displayed in hours and the equinox was displayed as 2000. Now RA is displayed in degrees and the equinox is displayed as "GALACTIC". --------------- 21.03.00 released rtd-2.20.4 ----------------- * Tested compiling with Sun-CC 4.2 and fixed a number of incompatibilities. * Fixed a panel layout problem introduced in the previous version (when -panel_orient = "horizontal"). * Fixed a statement in ImageData.C that caused compiler error message with some compilers. * Display only the tail end of the file name in the Object field (when the FITS OBJECT keyword is not defined) to save space. --------------- 02.03.00 released rtd-2.20.3 ----------------- * Added support for displaying WFI type images, which contain multiple image extensions, as a single image, based on the CRPIX values in the extensions. The default bahavoir is as before, except that there is a new button in the HDU window "Display as one Image". * Added a new button in the HDU window: "Use Settings from Main Image" that sets the colormap, color scaling options and cut levels for the preview images from the main image. This is needed, since the preview images often appear black when they have not been not prescaled. * Added a new RTD option: -panel_orient horizontal|vertical and added code to support having the main info panel on the left with a vertical orientation. The default for RTD is horizontal, as before. * Added code to check for valid command line options. (Previously the command line options were passed to the Rtd Itcl class directly, but there seems to be a bug in the current Tcl or Itcl version that caused the application to crash when passed an invalid option.) --------------- 27.12.99 released rtd-2.20.2 ----------------------------- * Minor bug fixes for pick object window (RtdImagePick, RtdImageZoomView) --------------- 13.11.99 released rtd-2.20.1 ----------------------------- * RtdImagePick.tcl: Fixed minor bug in pick object window (rectangle was not being displayed in the center of the image). * Merged in changes from Peter Biereichel (see below): * RtdImage.C / RtdImagePick.tcl: Better accuracy for 'pick object' which is required for telescope and instrument operations * RtdImage.C: subtract startX and startY from reference pixels for WCS display in the info panel (this is a quick fix not taking binning into account). * Comment changed in rtdImageEvent.h: Rotation angle is anticlockwise positive (not clockwise) * Added wcsFlags in rtdImageEvent.h and wcsdeltset command --------------- 25.10.99 released rtd-2.20 ------------------------------- * Merged in changes from Peter Biereichel (see below) * colors are initialized only when needed: moved call to initColors() from Rtd_Init() to the RtdImage constructor. * The installed version can be tar'ed to other "identical" target machines without the need to set environment variables before starting RTD. This is needed in the VLT environment where RTD is build on one machine and copied to all the other target machines. For this the following changes were made: - RtdImage::Rtd_Init() searches for RtdInit.tcl in the way itclx does (see also rtdimg/include/RtdInit.icc) - all links were removed in the installation directory - rtd.sh has become a general startup script. For tcl applications rtd.sh is merged with the tcl script by the Makefile (see directories rtdimg/demos and rtdimg/test) - all Makefiles include makefile.mk which allows to redefine the default (i.e. the generated-) installation root directory. - rtd/src/Makefile takes as default generated installation directory INTROOT or VLTROOT if PREFIX is not defined, otherwise /usr/local. The installation root directory can be redefined with 'make install PREFIX=' or setting INSTALL_TARGET before running 'make install'. * Configure option --with-vltgnu added. This option is specific to the gnu installation of the VLT software. * Added image extensions to RTD (copied from Skycat) * Added program options: -attach, -rtd_geometry and -rtd_title * RtdImage.C: Pass the rapid frame event on to the first rapid frame when the frameId in the rtdIMAGE_INFO structure doesn't exists. * Moved "Bias Image" from the Real-Time menu to the File menu * Added: Help menu * Added options -xscale and -yscale (the old options which now work properly) * Changed tRemote.tcl and RtdRemote.tcl. tRemote.tcl is used for an automatic test of Rtd. * man.mk allows to generated man pages from sources (see e.g. rtdevt/man/Makefile) * tkCanvasPsImage.c: uncommented fprintf() --------------- 11.08.99 released rtd-2.19.28 ---------------------------- * Fixed minor bug in RtdImage.C: flipCmd: return correct value for "flip xy". * Updated for egcs/gcc-2.95 (This compiler version is stricter for C++ code and even fails the solaris X11 header files, unless told to ignore the errors...). (see also rtd/src/Makefile) --------------- 16.05.99 released rtd-2.19.27 ---------------------------- * Fixed the -shm_data and -shm_header options again. There were problems since we started using cfitsio (It still had a reference to the old mmapped image data). Now the SysV shared memory is is passed to cfitsio as it should be. However, this required some incompatible changes: now the header and data are kept in a single shared memory area (previously in separate areas. To make up for this, "rtdimage shm get header/data" subcommands now returns a list of 4 values {shmId offset length size}, instead of only the shmId. The list values are the shared memory id, the offset in the shared memory area where the header or data begin, the length of the header or data, and the size of the shared memory area. *** NOTE: possible incompatibility *** * Fixed the isclear() method in RtdImage.C (called by the rtdimage isclear tcl subcommand). The method was assuming that a cleared image had a zero length header, which was not correct. --------------- 30.03.99 released rtd-2.19.26 ---------------------------- * Merged in changes from Peter Biereichel (below): Added new rtdimage subcommand 'biasimage' and widget 'RtdImageBias' for on-the-fly bias image subtraction. The widget can be called from the real-time menu. The features are: o Fast, since only the visible part of the image is updated (as usual, thank's to Allan) o Up to 5 bias images can be loaded (this value could be changed in BiasData.h) o Commands for loading a bias image from a file, copying the current image to a selected bias frame, clearing, displaying ... o Works globally for all Rtd clones. Note, when saving an image, the raw image and not the subtracted image is saved (this could be discussed). * rtdImageEvent.c, rtdServer.c: Added socket option TCP_NODELAY for faster image updates on HP-UX. * hput.c: changed 'long tsec' to 'time_t tsec' (astrotcl/wcslib). * RtdImage::isclear(): bug fixed * RtdRemote.C: argument 3 of 'getsockname' and 'accept' must be 'int' on HP-UX (was 'unsigned int' before) * RtdImage::call(): change strncmp() to strcmp() for commands like remote, remotetcl ---------------------------------------------------------------------------- * RtdRemote.C: Added #ifdef for linux unsigned (although the man page says it should be int, the compiler complains it should be unsigned). --------------- 22.03.99 released rtd-2.19.25 ---------------------------- * Fixed the Exit menu item to really exit and not just close the window, in the case where there is more than one main window. * Fixed socket error check in rtdrmt/src/rtdRemote.c. * Replaced itclsh2.2 with itclsh@ITCL_VERSION@ in Makefile.in. * Changed "quit" method in Rtd.tcl to use "delete object $this" instead of "destroy $w_" and "exit", so that class destructors are called as expected. * RtdImageSpectrum.tcl, RtdImageCut.tcl: removed "global" declaration for BLT vectors, since it caused a crash in tcl8.0.5/blt2.4g (something to do with variable traces). * ImageData.C: flip(): fixed an "off by one" bug that caused the wrong coordinates to be displayed for pixels when the image was rotated and/or flipped at zoom 1. * RtdImageZoomView.tcl: corrected the location of the square in the center of the zoom window (was off by one at zoom 1). * Merged in changes from Peter W. Draper (Starlink) to support 16 and 24 bit color. * Added minor fix to pan window to center the target image if needed. * Change min/max colors to 0/256 in RtdImageColors.tcl when using a read-only colormap. * Fixed the colormap shift method so that it takes the current ITT into account. * Added replacements for calls to memset in class LookupTable and ImageData when dealing with ulong instead of byte. * class ImageDisplay: made putpixel() inline and removed unnecessary check, to improve performance. Also fixed the "clear()" method to work with ulongs instead of bytes (for truecolor support). * Added code to RtdImageColors.tcl to update the color ramp when changing colormap files or itts in truecolor mode. * Added call to new routine Tk_CanvasWindowCoordsNoClip() in tclutil/src/tkCanvasImagePs.c to work around Tk's limit on canvas coordinates to short range. Now the canvas coordinates do not have to be clipped to short range. --------------- 28.12.98 released rtd-2.19.24 ---------------------------- * Rebuild tclIndex file whenever configure is run, since Tcl8 version is not compatible with tcl7 version (see makelinks script). * rtdimg/src/RtdImage.h: added include rtdImageEvt.h to avoid Sunpro cc compiler warning. * rtilib/src/saoutil.c: commented out calloc declaration to avoid conflict reported by sunpro cc. --------------- 03.12.98 released rtd-2.19.23 ---------------------------- * Fixed a minor bug in the destructors for the itcl classes RtdImage and RtdImagePopup. In the first case, the rtdimage object was not being deleted as it should; in the second it was, but should not have been. * Changed the ImageData::write() method (used to save a FITS file or a section of one to disk) to be compatible with the new FitsIO class. --------------- 16.11.98 released rtd-2.19.22 ---------------------------- * Ported to tcl8.0.3 (still compatible with tcl7.6/tk4.2) - Updated namespace syntax - Changed "class" to "itcl::class" for Itcl class declarations - Use full namespace pathnames for itcl member procs - Changed color initialization to be compatible with tcl8.0 (colormap is now initialized in Rtd_Init() and set for all windows) - Added code to handle vectors in the old and new BLT versions (The BLT vector interface changed) - Updated Makefiles and configure scripts to work in both versions - For backward compatibility, Rtd_Init automatically imports all of the required namespaces (rtd::*, util::*, blt::*, itcl::*, itk::*). (Use "namespace import -force" to avoid errors importing the same namespace twice.) - set tk_strictMotif to 1 (changes colors in menu selection) * the RTD is now using the CFITSIO library for FITS access (see the astrotcl package). No incompatible changes were introduced. Only the internal implementation of the FitsIO class was changed and some new methods were added for handling FITS tables and HDUs. The FITS files are still memory mapped (the cfitsio "memory" interface is used). Note that the cfitsio library routines are only used to access the FITS headers and extensions. Since there are no FITS headers involved in "real-time" mode, there is no performace penalty from using the library (the cfitsio routines are not called at all in that case). * RtdImage.C, ImageData.C: Minor changes to handle FITS files with multiple HDU. The RTD only displays the first HDU in a FITS file. If the first HDU is empty, a blank image is displayed. The Skycat application (based on the RTD) contains full support for displaying multiple HDUs and FITS tables, which are treated like local catalogs. --------------- 30.9.98 released rtd-2.19.21 ---------------------------- * Minor change to rtdimage cmap and itt commands so that "$im cmap file" returns the current colormap file and "$im itt file" returns the current itt file. * Changed the release structure of the rtd package to include the necessary utility packages. Now the rtd tarfile also contains the astrotcl and tclutil packages. The top level Makefile and configure script automatically determine which packages to make. --------------- 23.9.98 released rtd-2.19.20 ---------------------------- * Made some minor changes in the rtd colormap and display code to help support 16 and 24 bit color. It is still not directly supported though, since some changes would still need to be made in the ImageData and derived classes to deal with short and int pixel values and byte swapping, etc. For now, you can use 24 bit color only if your display also supports 8-bit pseudocolor while in 24-bit mode (see the Tk command "winfo visuals ."). This works, for example on a Sun Ultra, but not on my Linux machine. * Changed error message given when X visual is not supported. (For now, we still need 8 bit pseudocolor). * Removed menu accelerator Control-w, since it conflicted with the text bindings in entries. --------------- 7.9.98 released rtd-2.19.19 ------------------------------ * Removed trailing "\" in rtdevt/src/Makefile.in * For ESO detector chip coordinates: Changed "HIERARCH ESO DET WIN ..." to "HIERARCH ESO DET WIN1 ...", since the former keyword is not used. A number is always appended to WIN. For now, we only consider the first WIN. --------------- 5.8.98 released rtd-2.19.18 ------------------------------ * Color scaling: Added new command line option "-color_scale" to set the color scaling on startup. The option takes a value: one of linear, log, sqrt, histeq. Also made changes so that the color scaling setting is remembered between images and reapplied. (Source files changed: Rtdimage.tcl, Rtd.tcl, RtdImage.C, ImageData.[Ch]) * Coordinates: Added new coordinate type: "chip", for detector chip or CCD coordinates, that takes into account the origin of the chip and binning. X,Y coordinates in the user interface are now displayed in chip coordinates, which are the same as image coordinates, unless the FITS keywords "HIERARCH ESO DET WIN STRX" and "...STRY" are defined or special fields in the real-time image event struct are set (see below). * Added two new fields to the RTD real-time image event struct in rtdImageEvent.h: startX and startY, with the same meaning as the FITS keywords "HIERARCH ESO DET WIN STRX" and "...STRY" above. These fields are used, along with the existing binningX and binningY fields, to calculate and display the detector chip coordinates. The change is backward compatible, since it uses previously reserved space in the structure. If the values are set to 0, they have no effect. * RTD now reads cut level values from the real-time image events and sets the image cut levels, unless the user set them already by hand. User values override real-time event cut level values. * Changed the arguments to the RtdImage::displayImageEvent() method. This is an internal method, so this should not be an incompatible change. * Implemented "histogram equalization" color scaling and added it to the list of choices in the Rtd "Colors" popup window. The code to implement this was taken from saoimage-1.23.2 and modified only slightly. In order to be able to use histogram equalization code on "byte" images (BITPIX=8), also, the lookup table size had to be changed to 64k, from 256 bytes, which it was previously. * Added the X11 library directory to shared lib path in startup script. * Added code to handle NAN values for image pixels. They are now treated as blank pixels. --------------- 26.6.98 released rtd-2.19.17 ------------------------------ * RtdImage.tcl, RtdImagePrint.tcl: Changed footers in postscript output to include object name, file name and center position. * Compiling: rtdevt/*.c: fixed calls to semctl to avoid errors reported by egcs-1.0.3 (gcc-2.8.x). Removed "void" from "main()". --------------- 19.6.98 released rtd-2.19.16 ------------------------------ * RtdImageCtrl.tcl: fixed minor bug in pack command that showed up only when the options -float_panel and -with_grid were used together. * RtdImage.tcl, RtdImagePrint.tcl: went back to using the tk postscript command for printing images and graphics. This improves the quality of the postscript output over the screendump version, which used the "xgrabsc" utility to do a screendump. The default Tk canvas postscript command does not support printing images and the available patch could not handle large, zoomed in images. This version is now based on a Tk canvas extention I added to the tclutil package and does not require a patch to Tk. The extension is based on the patch, with fixes provided by Peter Draper of Starlink, who also modified the rtd print dialog box. The new dialog box has optional footers in place of headers and has a new option to print the whole canvas window, including any graphics that extend outside the image boundaries. * RtdImage.tcl: changed focus policy to fix problems with mouse pointer warping (moving mouse with arrow keys). The previous version included some code to avoid obscure problems with the CDE window manager, with the "click to focus" setting. If anyone has problems with the new version, please let me know. --------------- 28.5.98 released rtd-2.19.15 ------------------------------ * Added C++ method: RtdImage::makeImage(), replacing calls to ImageData::makeImage() to help simplify the code for derived classes and avoid duplicating code. No change in funtionality or interface. * RtdImage.C: added method isclear(), returns true if image is cleared. * Fixed bug in RtdImageColors.tcl that caused the colormap listing to be empty in certain cases. The colormap files are compiled in and no longer searched for in $RTD_LIBRARY/colormaps. --------------- 4.5.98 released rtd-2.19.14 ------------------------------ * Changed the RtdImage convertCoords() and convertCoordsStr() methods to fix bug in handling images with equinox != 2000. * Changed default zoom limits to -10..20 (was -5..9), (-min_scale, -max_scale) --------------- 28.4.98 released rtd-2.19.13 ------------------------------ * Increased label width for Rtd panel (RtdImagePanel), since labels were being cut off on some screens. * RtdImagePick.tcl (Pick Object): Merged in Peter Biereichel's changes, which include using the RtdImageZoomView class for the image (same as zoom window). This lets you zoom in and out to get the correct resolution. Also Fixed a bug in the "scale_changed" method that showed up on images that were not square. * RtdImage.C: rtdimage "statistics" subcommand (used by Pick Object window): If the user clicks on the image background, so that no FWHM can be calculated, the x,y and ra,dec coordinates of the point selected are returned and fwhmX and fwhmY are set to 0 (Previously, the results were undefined in this case). --------------- 15.4.98 released rtd-2.19.12 ------------------------------ * (doc, *.tcl): For documenting the "public interface": Updated comments on all Itk component declarations and added "public", "private" and "protected" keywords in the source to help identify the public interface, which is documented in man pages generated from the source by the itcldoc utility (tclutil package). * Minor changes in configure script and top level makefile for shared libraries * RtdImagePick.tcl (PickObject window), added "-orient" option, to change layout to "horizontal" or "vertical". Default is same as before (by request, to save window space). * RtdImagePick.tcl: moved initialization from constructor to "init" method, for easier subclassing. * Added command line option for "Pick Object" window layout: usage: "rtd -pickobjectorient vertical" (default: horizontal). (Option also added option to RtdImage.tcl and Rtd.tcl). * ImageData::write(): fixed a bug in image pixel coordinate conversion that caused the world coordinates to be slightly shifted in images created with the "Save region as..." Rtd menu. * Increased some buffer sizes in class RtdRPTool, since specifying a long file name caused the buffers to overflow (defaults were set too low). --------------- 31.03.98 released rtd-2.19.11 ------------------------------ * Updated man pages and documentation * RtdImage.C: Fixed the -shm_data and -shm_header options, which were no longer working after earlier changes. * Added -usexshm option to RtdImageColormap so that it follows the convention of the other rtd images. --------------- 25.03.98 released rtd-2.19.10 ------------------------------ * Made minor changes in the C++ class RtdImage, to make it easier to derive a subclass with its own configuration options (Added 2 optional arguments to RtdImage constructor). * Changed "blank image" size from 10x10 to 2x2 image, since people really seem to use 10x10 pixel images. (The size is sometimes used to determine if the image is "blank"). * ImageData.C: modified setScale so that dispWidth and dispHeight cannot be zero when using very large negative scales (this happens for extremely thin images, i.e. 5000x37), * Removed ImageData::read, use ImageData::makeImage() instead, since it allows different image types through subclassing. * Moved the WCS object (for managing world coordinates) from the ImageData to the ImageIO class (in astrotcl/wcslib). No change to the public interface. This makes it possible for a derived class (of ImageIORep) to replace the WCS implementation with a new one. * RtdImage.h now defines the RTD_OPTIONS macro, which can be used by derived classes to add new options to the rtdimage command. * Rtd.tcl: changed clone method (Menu: "New Window") to not reload the original image again. * RtdImage.tcl: Fixed bindings for -with_warp option to use "+" to not overwrite previous bindings. * Rtd.tcl: Change keyboard accelerators for menu items to use instead of , since is used in Tk for popping up a menu with the keyboard (see -underline option in menubutton(n)). * RtdImage.tcl: Fixed focus code to allow warping the mouse cursor and menu traversal without conflict. * Rtd.tcl, RtdImageCtrl.tcl: - Added -float_panel option to allow info panel to be in a popup window (default is off, no change), usage: rtd ... -float_panel 1, to enable. - Added -panel_layout option to allow changing the order of the zoom and pan windows in the layout (default is the same as before, no change). Usage: rtd ... -panel_layout $value, where value is one of {saoimage reverse default}, for an saoimage type layout, reverse or default. * Added "clone" number to window headers, to help identify related windows when there is more than one main window. --------------- 05.03.98 released rtd-2.19.9 ------------------------------ * Made minor change in the color ramp Tcl code, so that you can now scale and shift the colormap, without it always reverting to the original state. Previously, the colormap shift and scale operations caused the colormap to revert to the original state at the start. * For backward compatibility with applications using the rtd library: The dependency on the astrotcl and tclutil packages is now hidden from applications. librtd.a (.so, .sl, etc.), now contains the astrotcl and tclutil object files, the $prefix/include/rtd dir contains copies of the astrotcl and tclutil header files, and the Rtd_Init() routine also initializes these packages. * Minor changes/bug fixes: - added check in pan window widget (RtdImagePan.tcl) in case there are problems converting world coords ("catch draw_compass"). - propagate -min_scale and -max_scale options to the rapid frame popup (determines the min and max magnification). --------------- 13.2.98 released rtd-2.19.8 ------------------------------ * Fixed a bug in the "pick object" window that showed up when the main image was rotated (minor change made in RtdImagePick.tcl::update_rect. * Fixed the "Hide/Show Popup Windows" feature (moved the implementation to the tclutil package: class TopLevelWidget). The new implementation is more general and less error prone. --------------- 9.2.98 released rtd-2.19.7 ------------------------------ * Fixed problems with floating point precision when converting world coordinates (raised from default of 6 digits to max 17 digits.) * Fixed bug in introduced in the last version that could cause a core dump when setting the cut levels (in ImageTemplates::getMinMax). * Fixed minor syntax error in RtdImage.C that was not found by g++. * Fixed problem with "gethostname" prototype on solaris-2.6 in RtdRemote.C. --------------- 3.2.98 released rtd-2.19.6 ------------------------------ * Added selection mechanism to select a region of the image or canvas. The graphics toolbox now contains a "region" item that can be used to select a region of the image. The new RtdImage -regioncommand option can be used to have a tcl command evaluated whenever a region is selected. Also added binding as a shortcut to select a region * Added a menu item to the "Real-Time ==> Rapid Frame menu": "Delete Rapid Frame", to delete the current rapid frame. * Added a new rtdimage subcommand: "mmap", which has a similar syntax to the "shm" subcommand. The rtd "shm" subcommand is used to manipulate sysV shared memory areas containing the image and header data. The rtd "mmap" subcommand does the same, but with "mmap" memory, which is the default, since rtd uses mmap to read image files. * Fixed bugs in the rtd shm "create" and "delete" subcommand (check for number of arguments was wrong, transformation settings were not being saved). * Added options to rtd (class and command line) to change the magnification range allowed in the user interface: -min_scale and -max_scale, and changed the default range from (-5, 9) to (-10, 20). * Rtd now checks the value of the FITS "BLANK" or "BADPIXEL" keywords and ignores these pixels when setting cutlevels or doing any calculations. The blank pixels are displayed black by default. --------------- 26.01.98 released rtd-2.19.5 ---------------------------- * Updated comments in Itcl sources for automatic generation of man pages. (There are now man pages for all Itcl classes). * Added menu accelerators, keyboard shortcuts for menus --------------- released rtd-2.19.4 ------------------------------------- * Fixed image printing problems (rtd now no longer creates a copy of the image and graphics, but just makes sure the window is not covered by other windows before doing a screendump of the image window). * Compilied sources with the SunPRO C++ compiler and fixed problems that showed up there and not with gcc. * Changes in source configuration: Rtd previously contained a lot of generic code that was not Rtd specific. In order to make simplify the Rtd package and make the generic code available for other applications, 2 new packages were added (see below). Each package can be dynamically loaded and handled in the same was as the Rtd package. The Tclutil package was created by gathering "generic" Tcl and C++ code from various applications into a single generic Tcl package. The Astrotcl package was created by gathering general astronomy related Tcl and C++ code from other packages into a single, reusable package. If you were previously loading the Rtd package dynamically, you will need to add "package require" statements for the Tclutil and Astrotcl packages. If you were linking the package statically, you will need to add calls to Tclutil_Init and Astrotcl_Init in tkAppInit.C. If you were using the rtd C++ classes directly, you will need to add some -I compiler options to your Makefiles: (-I$(INSTALLDIR)/astrotcl -I$(INSTALLDIR)/tclutil). * renamed CanvasPrint to RtdImagePrint, since it is now rtd specific, and made minor changes to the options (pass rtd image obj as option). Restored earlier version of CanvasPrint that does not use xgrabc, for use for generic canvas printing. Added code to print the line graphics when printing an RTD image (was missing after previous changes by P. Biereichel). * Colormap files are now compiled in. This is slightly more efficient and makes it easier to create a single binary application to deliver. You can still load colormap files, but any found in the rtdimg/colormaps directory are compiled in statically. * Added plug-in capability for top level widgets. The basic idea is this: for each top level widget, you have the possibility to specify a plugin file to be sourced after the widget has been created. This is done automatically by the common base class. For any class XYZ, the default initialisation file is ~/.xyzrc and may be overridden by the environment variable $XYZRC. The file should define a Tcl proc named "xyz_plugin". If the plugin file is found, it is sourced and the plugin proc is called with one argument: the name of the widget ($this). If there are multiple instances of a widget, the plugin proc is called once for each. The plugin proc can use Itcl methods and Tcl commands to add menu buttons and other widgets, make changes or additions to the user interface or even replace the contents of key methods. * Tcl scripts: made a number of minor changes in the general purpose Itk widgets that were need for skycat. * RtdImage.C, FitsIO.C: the rtd "clear" command now optionally creates a blank image without world coordinates (previously it always created one with world coords). This change was needed to allow catalogs in skycat that are based on image coords. * FitsIO.C: Files are written in compressed format if they have the extension .hfits, .gfits or .cfits * fixed some bugs for image event synchronization via semaphores * Merged changes from D.Hopkinson (RMP nulticasting, statistics, etc.), P. Biereichel and A. Brighton into a single version. * Mem.C, RtdImage.C, configure.in: added code to handle the different prototypes for the semctl(2) system call on Linux, Solaris and HP. * RtdImage.C: replaced "sigignore(SIGFPE)" with "signal(SIGFPE, SIG_IGN)" for linux support. * rtdwcs: fixed a number of bugs in class FitsIO and related wcslib C functions, mostly dealing with inserting Fits keywords (not used by RTD, but used elsewhere...). * class Mem: added various changes and bug fixes; added a length field (used to indicate the length of the FITS header when the header and image are both mmapped from the same file). --------------- 04 Aug 97 released rtd-2.19 -------------------------------------- * fixed a minor bug in Mem_Map.C (added check in destructor for failed mmap) * Default option itk_option(-disp_image_icon) set to 0 * New option itk_option(-with_warp). Default is 1 for main image only. The option is used to make arrow keys move mouse pointer by one pixel. * The remote interface was extended: the new rtdimage command "remotetcl" eval's Tcl commands in Rtd's Tcl interpreter. For an example see files rtdimg/demos/tRemoteTcl* and rtdimg/library/RtdRemoteTcl.tcl. The proc's connect_to_rtd {} and send_to_rtd {rtd_fd args} are contained in rtdimg/library/tclutil.tcl * Bug fixed in postscript print itk classes (xgrabsc) * The updated RTD PostScript document is in rtd/doc/rtd.ps * New RTD Performance measurement tool in menu "Real-time". To run it use rtd -debug 1; "Attach to camera"; Start Performance Tool from menu "Real-time" * New Recorder/Playback tool in menu "Real-time". This tool works on FITS cubes. * BITPIX=-16 converts to standard FITS format * Support for image event synchronization via semaphores * X synchronisation option implemented for X11R6 * The Rtd image event structure had to be changed because of the new options X synchronisation and image event synchronization via semaphores. * fixed bugs in rtdServer.c and rtdImageEvent.c * Value display in Cuts...; Pixel table with statistics * various bug fixes in the handling of Fits keywords (class FitsIO) and mmap files (class Mem) as well as in the wcslib (hget.c, hput.c) --------------- 17 Jun 97 released rtd-2.18.2 ----------------------------------- * fixed bug in rtdutl/src/Mem.C, method shared(int) (use length() rather than size()). * LabelEntry.tcl, RtdImageCut.tcl: replaced references to the Iwidgets class "entryfield" with equivalent local code in LabelEntry.tcl. This is needed so that we don't have to load the entire iwidgets sources in the single binary version of skycat. The added features include a -validate option of the LabelEntry and derived classes. * CanvasPrint.tcl: allow for the XGRABSCBIN variable to not be set. This is needed for the binary skycat release. By default, look for xgrabsc in the shell $PATH if $XGRABSCBIN is not set --------------- 30 April 97 released rtd-2.18.1 ---------------------------------- * class HTTP: added new feature to HTTP::get(url) (can be used in catalog config file URLs): Now the get method accepts 3 types of URL: - http://host/path - URL: do an HTTP get - file:/path - get the file - /path - command: exec the command and read the standard output. This was a request from Andreas (awicenec@eso.org). * Minor configure script additions, for creating binary release of skycat --------------- 22 April 97 released rtd-2.18 ------------------------------------ * More minor changes in the configure scripts and makefiles for dealing with shared libraries on HP. * Tested on Linux 2.x (watch out for old /usr/lib/libBLT.a, which can be linked in by mistake instead of the new BLT2.1 library). * Updated the Mem class (rtd/rtdutl) with a newer version that handles the case on HP where the same file is mmapped twice, which returns an error under HP-UX. The new version keeps a list of Mem objects and reuses an existing object if needed. --------------- 16 April 97 released rtd-2.17 ------------------------------------ * fixed bug that showed up when you "attach" a camera after viewing an image of the same size. The problem was in the way the image data size was checked: the size (data.size()) was used rather than the length (data.length()), which can be different if the FITS header is also stored in the same shared memory object (class Mem). * minor configure/Makefile changes. Tested with Sun-CC. --------------- 11 April 97 released rtd-2.16 ------------------------------------ * changed the name of the Tcl init routine for Rtd from RtdImage_Init to Rtd_init, to comply with the standards for loadable modules in the new Tcl version (The old version is still supported for backward compat.) * changed the configure script and Makefiles to get information from the from the installed Tcl configuration files: tclConfig.sh, tkconfig.sh, itclConfig.sh, tclxConfig.sh, ... rather than try to guess the correct values. Rtd also produces its own rtdConfig.sh script, which can be used by other applications to find out library and path names for Rtd as well as X and Tcl/Tk. The tclConfig.sh script also contains information on how to generate and use shared libraries on each OS, which is non-trivial and very system dependent. * To set the version number for a new Rtd release, you only have to edit the VERSION file now. The configure script picks this up and generates the necessary #defines and make variables, etc. * replaced GNU make, gcc, Solaris and HP-UX specific features from the Makefiles and configure scripts that were added in rtd-2.15. These are OK for use at ESO, but would cause problems for anyone else who didn't use GNU make or gcc, etc. --------------- 08 April 97 released rtd-2.15 ------------------------------------ * Peter Biereichel ported Rtd to Itcl2.2 and added initial support for shared libraries and modules (based on work done by Kim Gillies). use: configure --enable-shared to create the shared library (librtd.so or librtd.sl). --------------- 01 April 97 released rtd-2.14 ------------------------------------ * adapted for new Tcl/Tk release (tcl 7.6, tk 4.2, [incr Tcl] 2.2, [incr Tk] 2.2...) (see file genTclTk on this directory for a sample installation script for Tcl/Tk) * support for shared libraries: configure tcl/tk, BLT and rtd-2.14 with --enable-shared The Makefiles will create shared libraries as well as archive library files. * master shared library (librtd.so or librtd.sl) can be dynamically loaded with the tcl "load" command (RtdImage_Init was renamed to Rtd_Init) * uses xgrabsc.2_41 (screen dump) for canvas image print --------------- 10 Feb 97 released rtd-2.13 (intern) ----------------------------- * fixed another bug related to shared memory. It seems that the destroy_notify routine in RtdImage.C, which was supposed to cleanup any shared memory it created before exiting, was actually being called at other times, such as when the mouse enters the image window. Seems to be some kind of Tk4.0 bug? Commented out for now. This bug did not affect most users. It only turned up if you were using the RTD remote interface and/or the "shm" subcommand to access image shared memory using SysV shared memory. --------------- 05 Feb 97 released rtd-2.12 (intern) ----------------------------- * fixed bug in [rtdimage shm get] (rtdimage tcl subcommand to return shared memory id, and/or force image to be in shared memory) --------------- 30 Jan 97 released rtd-2.11 -------------------------------------- * Added World Coordinates support to the real-time image events by extending the rtdIMAGE_INFO struct in rtd/rtdevt/rtdImageEvent.h and using the new info in RtdImage.C to set the world coordinates information for the image. The following fields were added to the image event: double ra; /* Center right ascension in degrees */ double dec; /* Center declination in degrees */ double secpix; /* Number of arcseconds per pixel */ double xrefpix; /* Reference pixel X coordinate */ double yrefpix; /* Reference pixel Y coordinate */ double rotate; /* Rotation angle (clockwise positive) in degrees */ int equinox; /* Equinox of coordinates, 1950 and 2000 supported */ double epoch; /* Epoch of coordinates, used for FK4/FK5 conversion, no effect if 0 */ char proj[8]; /* Projection: one of: "-SIN", "-TAN", "-ARC", "-NCP", "-GLS", "-MER", "-AIT", "-STG", "PLATE", "LINEAR", "PIXEL" */ (I think the projection (proj) is only used for display and does not have any effect. I included it because it is part of the function interface (in Doug Mink's wcslib). *** (NOTE: incompatible change: clients must at least be recompiled!) --------------- 21 Nov 96 released rtd-2.9 -------------------------------------- * Made configure scripts and sources Linux compatible. Fixed byte-swap problems on machines that have a byte order different from the network. Thanks to Sidik Isani for supplying the patches for this. * The "Pick Object" feature (View Menu) now also works for images that do not support world coordinates (RtdImage.C, RtdImagePick.tcl). * rtdutl: class HTTP: Local file URLs are now supported, i.e., file:/path/name... --------------- 8 Nov 96 released as rtd-2.8, part of skycat 1.0.1 --------------- * (Rtd) Fixed compass to display East correctly (was reversed...) --------------- 7 Nov 96 released as rtd-2.7, part of skycat 1.0 ------------------ * (WCS lib) Major improvements in the World Coordinates handling. The WCS information for HST images should be handled correctly now, so you can plot guide stars, etc. This previously worked correctly only for some images (such as those from DSS). Many thanks to Doug Mink (dmink@cfa.harvard.edu) for supplying the WCS library and bug fixes. * (Rtd) added a new "Grid" feature (see View menu) that displays a world coordinates based grid over the image. You can also control the grid size (distance in arcsecs between grid lines) in a new entry in the main panel. * (Rtd) The compass widget (N-E display in panel) was removed and replaced with a more correct display in the Pan window. The Pan window now displays 2 arrows indicating the real north and east for the image, based on the world coordinate information. * fixed bug in "measure band" display that caused incorrect distances to be displayed for the width and height lines (the diagonal was ok). (Needed to convert all 3 points from canvas to world coordinates rather than using only 2 points and assuming a linear coordinate system...) (in RtdImage.C). * Added bindings to measure band so that arrow keys can be used to position it. * fixed bug in conversion between world coordinate and pixel distances (in WCS.C). --------------- 18 Oct 96 released as rtd-2.6, part of skycat 1.0b15 ------------------ * rapid frame was being deleting by the "Graphics:clear" menu item: fixed. * graphics: added code to disable line graphics (menu and popup) when image is cleared. * fixed syntax problems in HMS.h and WorldCoords.h reported by mcomin@eso.org that show up when using g++/libg++ and the file is included, which defines templates for operator functions... --------------- 15 Oct 96 released as rtd-2.5, part of skycat 1.0b14 ------------------ * got new version of SAO WCS lib from Doug Mink with some fixes for images where the equinox and epoch were not set. * (Rtd) Changed the way image cut levels are set by default. In the previous version, cut levels were not changed at all when a new image was loaded, which meant that you usually had to press the "Auto Set Cut Levels" button to make the image visible. Now this has been changed as follows: If you set the cut levels explicitly by typing in a number or moving a slider bar, etc., they will not be changed, even if a new image is loaded. However, if you have the cut levels calculated automatically by pressing the "Auto Set Cut Levels" button or the "Median Filter" button, etc., then it is assumed that new cut levels can be set automatically when a new image is loaded. (We would be interested to hear any comments on this. Maybe we should make this behavior optional ny adding a checkbutton somewhere...) * changed bindings on the "measure band" (RtdImageMBand.tcl) so that it acts more like a menu or the line graphics: it will stay up if you click <3>, release and then drag. Clicking <3> again makes it go away. now makes it "freeze" so you can keep it where it is. (or ) displays just the single line mband. * Made a number of changes designed to improve performance on very large images (got test image from Kim Gillies: 170 MB, 8192 x 5464 floats): * the zoom window is no longer updated from the pan window, since that can cause a lot of disk activity on large images (the mouse easily crosses the entire pan image, which would have to be displayed in the zoom window). * auto set cut levels, median filter, finding min/max pixel, etc. now are only calculated for the visible part of the image and (for speed) don't examine all image pixels. (modified getDist() and medianFilter() methods). * added a check and a warning dialog for the case where a very large image is zoomed so that the canvas scroll area exceeds the range of a "short" (32k pixels in X or Y), since there is an internal Tk limit there. I could get around this with a hack, but it would require access to Tk internals that would cause compilation problems in the VLT environment. * fixed problems propagating cut level changes to zoom window (RtdImage.C) * added rcs keywords as static constants to source files (for Giorgio). * added a "Reset" button to the EntryForm class - used to enter WCS data (rtd) and local catalog data (skycat). --------------- 1 Oct 96 released as rtd-2.4, part of skycat 1.0b12 ------------------ * Class ImageData/WCS/RtdImage: removed wcs* routines and replaced them with a new class called "WCS" (module rtdwcs) that is the interface to Doug Mink's SAO WCS lib. Class ImageData now has a method "wcs()" that returns a reference to the WCS object rather than implementing methods like "wcs2pix()" itself. The WCS class uses reference counting so that it is easier to share the information in different rtdimage views. * added a Tcl/Tk interface for setting and displaying the basic WCS info (using the rtdimage wcsset subcommand) and added a new View menu item "WCS Information". * added 2 new rtd subcommands for setting WCS information from outside: "wcsset" (to set WCS parameters) and "wcsshift" to shift the WCS center of the image. See the rtdimage(n) man page for details. * fixed bugs in Mem/Mem_Map classes: do read-only mmap (was read/write: bad for read-only image files), report errors correctly (inserted missing error messages), initialize status_ member variable (was missing). * added error checking in FitsIO.C to catch incomplete FITS files or files that have the wrong type. * added global Tcl variable "rtd_version", set to the version number: "2.4", ... * ImageColor: made changes in colormap handling in an attempt to avoid flashing when using a private colormap. Added new tcl command: "rtd_set_cmap" to set colormap for popup windows to be the same as rtdimage. * FitsIO: Display of FITS header (item in View menu) changed so that displayed copy of header is formatted for ASCII display (with newlines, no NULL chars). * FitsIO: loading large FITS files should be faster now, due to use of mmap(2) in place of reading the file. * wcslib, rtilib: started using new SAO wcslib (wcssubs-1.0) version. Changes in the wcslib pix2wcst routine (converts image pixel coords to a WCS string) caused problems (coords are sometimes output in degrees, sometimes HMS). Replaced calls to pix2wcst with pix2wcs. --------------- 20 Sep 96 released as rtd-2.4b1, part of skycat 1.0b11 ------------------ * Added range checks in LookupTable.C to fix problems caused by keeping previous cut levels for different image data types * rtdutl: non-ANSI-C "press" sources: removed -traditional option from Makefile.in (not available with "cc") and fixed declarations in C sources (taken from "press" module) so that gcc doesn't complain. (was reported by K. Gillies). * min/max pixel values: (ImageTemplates.C): changed algorithm to not examine every pixel on large images. On smaller images, the time is not so important, but on very large images it can take a long time. Now only every nth pixel is examined, which should give an estimate of the min/max pixel values. * All transformations (flipX,Y, rotate, scale) and cut level settings are now kept between image loads and after a "clear" operation (requested by P.Biereichel). * fixed bugs that sometimes caused the values displayed in the upper panel (X, Y, pixel value) to be off by 1 with respect to the zoom window. The problem showed up when the image was at zoom factor 1 and with certain transformations applied and also in rapid frames. It should work correctly now. (Changes in RtdImage.C, ImageData.C, ImageTemplates.C) * RtdImage.C: RtdImageCamera::display(): added "frameId" arg to calls to the pre and post camera commands to differentiate between rapid frames and the main frame. (requested by pbiereic). This affects calls to the pre and post commands specified in the rtdimage "camera attach" command. * RtdImage.C: configureNotify(): fixed bug that sometimes caused the image to not be redrawn correctly after a window manager maximize/minimize resize operation. * RtdImageCtrl.tcl: new_image_cmd: added code to destroy "spectrum" window when a new image is loaded (problem was reported in SPR Nr: 960518 when new image was smaller in real-time mode: could not reproduce) * Real-time interface: in RtdImage.tcl: detach_camera: inserted a call to "$image_ update" to make sure all image windows are up to date with the shared memory image. (This might be needed due to timing problems between the shared memory image and the socket being read from the rtdServer.) * RtdImage.C: added new rtdimage subcommand: "$image update" forces the image to be updated from memory, where it may have been changed by a separate process accessing shared memory... * spectrum (View::Cuts..." menu item): ignore errors when line is too small (was reported as SPR Nr: 960536, forwarded by P. Biereichel) * added code (from P. Biereichel) to make sure zoom window gets cleared when the mouse leaves the image window (see RtdImageZoomView.tcl) ---------------- 14 Aug 96 released rtd as part of skycat-1.0b10 ------------------ * added check for "SIMPLE = ..." keyword/line at beginning of FITS files * rtdimage: "Open File" now recognizes suffixes for compression: hfits (H_COMPRESS), gfits, gzfits (GZIP), cfits (UNIX_COMPRESS) * fixed bug when FITS keyword "CTYPE1" was not "RA --", as described in mail from Alberto Micol (just removed restriction in CTYPE1 being "RA--") * rtilib: class ImageData: added a new class "LookupTable" to make it easier to share and manage color lookup tables. Also changed the way the "Blank" pixel is implemented (more efficient now). * Cut levels and transformations (flipXY, rotate, scale) are now kept even when a new image is loaded. * rapid frame: embedded rapid frames (in main image) get the cut levels and transformations (but no image data) from the main image. Popup rapid frames (in separate window) can have their own transformations and cut levels (but transformations from the main image still propagate). * It is now allowed to set the cut levels outside of the min/max pixel range. * added new "View" menu item "Hide Control Panel" to toggle the visibility of the top control panel. * added new "View" menu item "Magnification" to set the image scale when the control panel is not visible. * changed default bindings in canvas so that you can scroll with button <2> when the control panel is not visible. * added support for "mmap" in Mem class (rtdutl), using code from the ACE class library (modified by Kim Gillies). mmap is now used to read files more efficiently for local catalogs and decompression. Later it will also be used to load image files (need to first start using new sao-wcslib). ---------------- 6 Aug 96 released rtd as part of skycat-1.0b9 ------------------ * added decompression algorithms (H-compress, gzip, unix) the PREVIEW field in catalog query results is now interpreted as an image OR a tab table to plot, based on the "Content-type" field of the preview data returned. The current implementation is based on the document: http://arch-http.hq.eso.org/~amicol/asu_94.html If the "Content-type" of the preview is recognized, it is plotted as a graph or loaded as an image... ---------------- 1 Aug 96 released rtd as part of skycat-1.0b8 ------------------ * Added an interface for selecting an object/star in the image and calculating the center, FWHM and angle (see View menu, "Pick object") * Fixed problems with world coordinates where (hour == -0.0). (0:0:1 -0:0:1) should work correctly now. * removed the "wcs2pix" and "pix2wcs" tcl subcommands (use the "convert coords" subcommand instead...) * Graphic items are now clipped to (about) the size of the image (incuding rapid frame rect and panning rect) * Cut levels for rapid frames are no longer set from the master image. Rapid frames can have thier own cut levels and transformations. ---------------- 24 Jul 96 released as part of skycat-1.0b6 ------------------ * rapid frames are now assumed to start at 0,0 * you can set the cut levels separately for rapid frames * you can rotate/flip/scale rapid frames separately * you can no longer move a rapid frame outside of the image * I added a test utility for rapid frames that you can access as follows: rtd -debug 1 This uses a test program (tRtd) that is installed with rtd. You can change the update interval by specifying the -interval option: rtd -debug 1 -interval 200 The default is 100 ms. ---------------- 28 May 96 released as part of skycat-1.0a10 ------------------ * The main visible changes are some new menu items and support for a private colormap... ---------------- 23 May 96 released as part of skycat-1.0a9 ------------------ * private colormaps are used when there are not enough colors. The default minimum amount of colors is 30 and the default max is 60. You can set these via the -min_color and -max_color options. If min_colors colors are not found, a private colormap is installed. I tried to save the GUI colors to avoid flashing... * There is a new menu item under File for "cloning" the main window. The main windows share the same colors, but otherwise are like 2 different applications. * I added a menu item to the View menu to hide/show the popup windows. ---------------- 12 Apr 96 released as part of skycat-1.0a8 ------------------ * added pop up rapid frame window with zoom controls * added a new zoom window (the old one is still available with an option) which works over any rtd image (pan window, rapid frame,...) * added a remote control interface (see man page rtdRemote(3)) * added some new Rtd commands to allow remote access to the image and header in shared memory (see RtdImage(n), commands: shm, remote) * new Rtd subcommands for converting between any 2 coordinate systems (see RtdImage(n): convert command). * RtdImage now understands the following coordinate systems: canvas coordinates screen coordinates image coordinates world coordinates (H:M:S and degrees, any equinox) For example, coordinates may now be specified as: $x $y canvas or: $ra $dec "wcs 1950" ---------------- 21 Feb 96 released as part of skycat-1.0a4 ------------------ * negative world coordinates are now handled correctly * bzero and bscale Fits keywords are now used * support for the BLANK fits keyword for blank pixels * the Pixel table has been implemented in C++ * We are now using the new saoimage-1.18 wcslib (mixed with the DSS plate code from 1-15, due to problems in the new version) ---------------- 6 Feb 96 released rtd as part of skycat-1.0a2 ------------------ * lots of bug fixes * added a menu item for viewing the FITS header ---------------- 25 Feb 96 released rtd as part of skycat-1.0a1 ------------------ * Added versions for Solaris (with shared libs) and HP ----------- Sep 18, 1995: begin change log for RTD ---------- skycat-3.1.2-starlink-1b/rtd/Makefile.in000077500000000000000000000423411215713201500200020ustar00rootroot00000000000000# Makefile.in -- # # This file is a Makefile for Sample TEA Extension. If it has the name # "Makefile.in" then it is a template for a Makefile; to generate the # actual Makefile, run "./configure", which is a configuration script # generated by the "autoconf" program (constructs like "@foo@" will get # replaced in the actual Makefile). # # Copyright (c) 1999 Scriptics Corporation. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: Makefile.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that # have been added in a customized configure script. #======================================================================== #SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@ # Install these scripts PROGS = rtd tRtd # Extra static library and binaries for real-time image servers and clients RTDEVT_LIB = librtdImgEvt.a RTDEVT_OBJ = rtdClient.o rtd_server.o rtdSERVER.o rtdCLNT.o rtdSem.o rtdImageEvent.o rtdCubeDisplay.o rtdLOG.o RTD_SERVER = rtdServer RTD_SERVER_OBJS = rtd_server.o rtdSERVER.o rtdCLNT.o rtdLOG.o RTDEVT_DEMOS = rtdClient rtdCubeDisplay # Extra static C library for remote RTD access RTD_REMOTE_LIB = librtdRemote.a RTD_REMOTE_OBJ = rtd_remote.o # Testing applications TEST_APPS = tImageEvent tRtd trtdRemote # For convenience (and backward compatibility), merge in the required package objects MERGE_OBJECTS = @MERGE_OBJECTS@ #======================================================================== # Nothing of the variables below this line should need to be changed. # Please check the TARGETS section below to make sure the make targets # are correct. #======================================================================== #======================================================================== # The names of the source files is defined in the configure script. # The object files are used for linking into the final library. # This will be used when a dist target is added to the Makefile. # It is not important to specify the directory, as long as it is the # $(srcdir) or in the generic, win or unix subdirectory. #======================================================================== PKG_SOURCES = @PKG_SOURCES@ PKG_OBJECTS = @PKG_OBJECTS@ PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ #======================================================================== # PKG_TCL_SOURCES identifies Tcl runtime files that are associated with # this package that need to be installed, if any. #======================================================================== PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ #======================================================================== # This is a list of public header files to be installed, if any. #======================================================================== PKG_HEADERS = @PKG_HEADERS@ #======================================================================== # "PKG_LIB_FILE" refers to the library (dynamic or static as per # configuration options) composed of the named objects. #======================================================================== PKG_LIB_FILE = @PKG_LIB_FILE@ PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ PKG_BIN_FILE = bin_BINARIES = $(PKG_BIN_FILE) $(RTD_SERVER) $(RTDEVT_DEMOS) $(PROGS) lib_BINARIES = $(PKG_LIB_FILE) $(RTDEVT_LIB) $(RTD_REMOTE_LIB) BINARIES = $(lib_BINARIES) $(bin_BINARIES) SHELL = @SHELL@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ mandir = @mandir@ includedir = @includedir@ DESTDIR = PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) pkgdatadir = $(datadir)/$(PKG_DIR) pkglibdir = $(libdir)/$(PKG_DIR) pkgincludedir = $(includedir)/$(PACKAGE_NAME) top_builddir = . INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ CC = @CC@ CXX = @CXX@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ #CFLAGS_WARNING = @CFLAGS_WARNING@ CLEANFILES = @CLEANFILES@ $(TEST_APPS) *.o tests/*.o EXEEXT = @EXEEXT@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ MAKE_LIB = @MAKE_LIB@ $(MERGE_OBJECTS) MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ OBJEXT = @OBJEXT@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @PKG_LIBS@ @SHLIB_LD_LIBS@ @SHLIB_LD_CXX_LIBS@ STLIB_LD = @STLIB_LD@ #TCL_DEFS = @TCL_DEFS@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_SRC_DIR = @TCL_SRC_DIR@ #TK_BIN_DIR = @TK_BIN_DIR@ #TK_SRC_DIR = @TK_SRC_DIR@ # Not used, but retained for reference of what libs Tcl required #TCL_LIBS = @TCL_LIBS@ #======================================================================== # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our # package without installing. The other environment variables allow us # to test against an uninstalled Tcl. Add special env vars that you # require for testing here (like TCLX_LIBRARY). #======================================================================== EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) #EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) TCLLIBPATH = $(top_builddir) TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ PATH="$(EXTRA_PATH):$(PATH)" \ TCLLIBPATH="$(TCLLIBPATH)" # TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` TCLSH_PROG = @TCLSH_PROG@ TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) #WISH_PROG = @WISH_PROG@ #WISH = $(TCLSH_ENV) $(WISH_PROG) SHARED_BUILD = @SHARED_BUILD@ #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ PKG_CFLAGS = @PKG_CFLAGS@ # TCL_DEFS is not strictly need here, but if you remove it, then you # must make sure that configure.in checks for the necessary components # that your library may use. TCL_DEFS can actually be a problem if # you do not compile with a similar machine setup as the Tcl core was # compiled with. #DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) DEFS = @DEFS@ $(PKG_CFLAGS) CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl ${PACKAGE_NAME}Config.sh ${PACKAGE_NAME}.sh ${PACKAGE_NAME}_version.tcl CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ AR = @AR@ CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CXXFLAGS) #======================================================================== # Start of user-definable TARGETS section #======================================================================== #======================================================================== # TEA TARGETS. Please note that the "libraries:" target refers to platform # independent files, and the "binaries:" target inclues executable programs and # platform-dependent libraries. Modify these targets so that they install # the various pieces of your package. The make and install rules # for the BINARIES that you specified above have already been done. #======================================================================== all: binaries libraries doc tclIndex #======================================================================== # The binaries target builds executable programs, Windows .dll's, unix # shared/static libraries, and any other platform-dependent files. # The list of targets to build for "binaries:" is specified at the top # of the Makefile, in the "BINARIES" variable. #======================================================================== binaries: $(BINARIES) libraries: tclIndex: (cd $(srcdir)/library; $(TCLSH_PROG) mkIndex.tcl) # Scripts created by configure depend on their .in files and config.status # (since they are cleaned). rtd: rtd.in config.status ./config.status #======================================================================== # Your doc target should differentiate from doc builds (by the developer) # and doc installs (see install-doc), which just install the docs on the # end user machine when building from source. #======================================================================== doc: # generate man pages for itcl classes gendoc: (cd $(srcdir)/library; $(TCLSH) itcldoc [A-Z]*.tcl) # remove generated man pages cleandoc: rm -f $(srcdir)/man/[A-Z]*.mann install: all install-binaries install-libraries install-doc install-binaries: binaries install-lib-binaries install-bin-binaries #======================================================================== # This rule installs platform-independent files, such as header files. # The list=...; for p in $$list handles the empty list case x-platform. #======================================================================== install-libraries: libraries @test -d $(DESTDIR)$(pkgincludedir) || mkdir -p $(DESTDIR)$(pkgincludedir) @echo "Installing header files in $(DESTDIR)$(pkgincludedir)" @list='$(PKG_HEADERS)'; for i in $$list; do \ echo "Installing $(srcdir)/$$i" ; \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(pkgincludedir) ; \ done; #======================================================================== # Install documentation. Unix manpages should go in the $(mandir) # directory. #======================================================================== install-doc: #install-doc: doc # @mkdir -p $(DESTDIR)$(mandir)/mann # @echo "Installing documentation in $(DESTDIR)$(mandir)" # @list='$(srcdir)/doc/*.n'; for i in $$list; do \ # echo "Installing $$i"; \ # rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ # $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ # done shell: binaries libraries @$(TCLSH) $(SCRIPT) gdb: $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) depend: #======================================================================== # $(PKG_LIB_FILE) should be listed as part of the BINARIES variable # mentioned above. That will ensure that this target is built when you # run "make binaries". # # The $(PKG_OBJECTS) objects are created and linked into the final # library. In most cases these object files will correspond to the # source files above. #======================================================================== $(PKG_LIB_FILE): $(PKG_OBJECTS) $(MERGE_OBJECTS) -rm -f $(PKG_LIB_FILE) ${MAKE_LIB} $(RANLIB) $(PKG_LIB_FILE) #$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) # -rm -f $(PKG_STUB_LIB_FILE) # ${MAKE_STUB_LIB} # $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) #======================================================================== # We need to enumerate the list of .c to .o lines here. # # In the following lines, $(srcdir) refers to the toplevel directory # containing your extension. If your sources are in a subdirectory, # you will have to modify the paths to reflect this: # # sample.$(OBJEXT): $(srcdir)/generic/sample.c # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@ # # Setting the VPATH variable to a list of paths will cause the makefile # to look into these paths when resolving .c to .obj dependencies. # As necessary, add $(srcdir):$(srcdir)/compat:.... #======================================================================== VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/rtdevt:$(srcdir)/tests .c.@OBJEXT@: $(COMPILE) -c `@CYGPATH@ $<` -o $@ .C.@OBJEXT@: $(CXXCOMPILE) -c `@CYGPATH@ $<` -o $@ #======================================================================== # End of user-definable section #======================================================================== #======================================================================== # Don't modify the file to clean here. Instead, set the "CLEANFILES" # variable in configure.in #======================================================================== clean: -test -z "$(BINARIES)" || rm -f $(BINARIES) -rm -f *.$(OBJEXT) core *.core -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean: clean -rm -f *.tab.c -rm -f $(CONFIG_CLEAN_FILES) -rm -rf config.cache config.log config.status autom4te.cache #======================================================================== # Install binary object libraries. On Windows this includes both .dll and # .lib files. Because the .lib files are not explicitly listed anywhere, # we need to deduce their existence from the .dll file of the same name. # Library files go into the lib directory. # In addition, this will generate the pkgIndex.tcl # file in the install location (assuming it can find a usable tclsh shell) # # You should not have to modify this target. #======================================================================== install-lib-binaries: binaries @test -d $(DESTDIR)$(pkglibdir) || mkdir -p $(DESTDIR)$(pkglibdir) @list='$(lib_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p; \ stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ if test "x$$stub" = "xstub"; then \ echo " $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p"; \ $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p; \ else \ echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \ $(RANLIB) $(DESTDIR)$(libdir)/$$p; \ fi; \ ext=`echo $$p|sed -e "s/.*\.//"`; \ if test "x$$ext" = "xdll"; then \ lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ if test -f $$lib; then \ echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib"; \ $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \ fi; \ fi; \ fi; \ done @echo " Install $(PACKAGE_NAME)Config.sh $(DESTDIR)$(libdir)" @$(INSTALL_DATA) $(PACKAGE_NAME)Config.sh $(DESTDIR)$(libdir); @list='$(PKG_TCL_SOURCES) library/tclIndex $(PACKAGE_NAME)_version.tcl'; \ for p in $$list; do \ if test -f $(srcdir)/$$p; then \ destp=`basename $$p`; \ echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ fi; \ done @if test "x$(SHARED_BUILD)" = "x1"; then \ echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ fi # (cd $(DESTDIR)$(pkglibdir); $(TCLSH_PROG) mkIndex.tcl) #======================================================================== # Install binary executables (e.g. .exe files and dependent .dll files) # This is for files that must go in the bin directory (located next to # wish and tclsh), like dependent .dll files on Windows. # # You should not have to modify this target, except to define bin_BINARIES # above if necessary. #======================================================================== install-bin-binaries: binaries @test -d $(DESTDIR)$(bindir) || mkdir -p $(DESTDIR)$(bindir) @list='$(bin_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ fi; \ done .SUFFIXES: .c .$(OBJEXT) .C Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status uninstall-binaries: list='$(lib_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ p=`basename $$p`; \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(bin_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/$$p; \ done .PHONY: all binaries clean depend distclean doc install libraries test # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: #======================================================================== # rtdevt targets for real-time image servers and clients #======================================================================== $(RTDEVT_LIB): $(RTDEVT_OBJ) - $(RM) $@ $(AR) r $@ $(RTDEVT_OBJ) $(RANLIB_STUB) $@ $(RTD_SERVER): $(RTD_SERVER_OBJS) $(CXXCOMPILE) -o $@ $(RTD_SERVER_OBJS) $(RTDEVT_LIB) @LIBS@ rtdClient: rtdClient.o $(CXXCOMPILE) -o $@ $? $(RTDEVT_LIB) @LIBS@ rtdCubeDisplay: rtdCubeDisplay.o $(CXXCOMPILE) -o $@ $? $(RTDEVT_LIB) @LIBS@ #======================================================================== # RTD Remote access C library #======================================================================== $(RTD_REMOTE_LIB): $(RTD_REMOTE_OBJ) - $(RM) $@ $(AR) r $@ $(RTD_REMOTE_OBJ) $(RANLIB_STUB) $@ #======================================================================== # C++ Test cases #======================================================================== test: binaries libraries $(TEST_APPS) tImageEvent: tImageEvent.o $(CXXCOMPILE) -o $@ $@.o $(RTDEVT_LIB) @LIBS@ trtdRemote: trtdRemote.o $(COMPILE) -o $@ $@.o $(RTD_REMOTE_LIB) @LIBS@ tRtd: tRtd.o tRtdEvt.o tRtdEvtData.o $(CXXCOMPILE) -o $@ $@.o tRtdEvt.o tRtdEvtData.o \ @rtd_BUILD_LIB_SPEC@ @TK_LIB_SPEC@ @TCL_LIB_SPEC@ ${LDFLAGS_DEFAULT} ${LIBS} #======================================================================== # Run Tcl test cases #======================================================================== #tcltest: binaries libraries # (cd tests; sh all.tcl) FORCE: skycat-3.1.2-starlink-1b/rtd/README000066400000000000000000000026641215713201500166160ustar00rootroot00000000000000 RTD, A Real-Time Display Widget for Tk -------------------------------------- This directory contains the source code for the ESO/VLT RTD (Real-Time Display), a Tk widget, library and application for viewing FITS images from shared memory or files. -------------------------------------- Contacts: Allan Brighton (abrighton@gemini.edu) Peter Biereichel (pbiereic@eso.org) ESO - European Southern Observatory -------------------------------------- Once installed, you can start the application with the command "rtd". There is also a simulation mode, which may be started with the command rtd -debug 1 This automatically starts the rtdServer and a simulation application, tRtd, that generates dummy images. Rtd always starts the rtdServer background process as needed when you attach a camera. For installation instructions, see the file INSTALL in the parent directory. See the CHANGES file in this directory for a list of recent changes. The following URLs may also be of interest: Skycat home page: http://archive.eso.org/skycat/ Sources and binaries: ftp://ftp.eso.org/pub/archive/skycat/README.html Postscript, PDF, and FrameMaker Documentation: ftp://ftp.eso.org/pub/archive/skycat/doc HTML Docs: http://archive.eso.org/skycat/docs/skycat-man.html -------------------------------------- Contacts: Allan Brighton (abrighto@eso.org) ESO - European Southern Observatory -------------------------------------- skycat-3.1.2-starlink-1b/rtd/VERSION000066400000000000000000000000121215713201500167670ustar00rootroot00000000000000rtd-3.2.1 skycat-3.1.2-starlink-1b/rtd/aclocal.m4000066400000000000000000000130641215713201500175720ustar00rootroot00000000000000builtin(include,../tclconfig/tcl.m4) AC_DEFUN(RTD_CONFIG, [ # ----------------------------------------------------------------------- # Load the Tclutil definitions cf=../tclutil/tclutilConfig.sh if test -f $cf ; then . $cf AC_SUBST(tclutil_VERSION) AC_SUBST(tclutil_LIB_FILE) AC_SUBST(tclutil_BUILD_LIB_SPEC) AC_SUBST(tclutil_BUILD_DIR) AC_SUBST(tclutil_LIB_SPEC) AC_SUBST(BLT_LIB_DIR) AC_SUBST(BLT_LIB_SPEC) AC_SUBST(tclutil_SRC_DIR) AC_SUBST(tclutil_PKG_OBJECTS) AC_SUBST(CFITSIO_LIB_DIR) AC_SUBST(CFITSIO_LIB_SPEC) else AC_MSG_ERROR([$cf doesn't exist]) fi # Load the Astrotcl definitions cf=../astrotcl/astrotclConfig.sh if test -f $cf ; then . $cf AC_SUBST(astrotcl_VERSION) AC_SUBST(astrotcl_LIB_FILE) AC_SUBST(astrotcl_BUILD_LIB_SPEC) AC_SUBST(astrotcl_BUILD_DIR) AC_SUBST(astrotcl_LIB_SPEC) AC_SUBST(astrotcl_SRC_DIR) AC_SUBST(astrotcl_PKG_OBJECTS) else AC_MSG_ERROR([$cf doesn't exist]) fi # ----------------------------------------------------------------------- # Optionally merge object and header files from dependent packages to make one master rtd lib MERGED=1 AC_ARG_ENABLE(merge, [AC_HELP_STRING([--enable-merge],[merge the contents of dependent packages into a master library])], [MERGED=$enableval], [MERGED=no]) tclsources=`cd $srcdir; echo library/*.tcl` changequote(<<, >>) csources=`cd $srcdir; echo generic/*.[Cc] rtdevt/rtdImageEvent.c rtdevt/rtdSem.c` changequote([, ]) rtd_headers=`cd $srcdir; echo generic/*.h generic/*.icc rtdevt/rtdImageEvent.h rtdevt/rtdSem.h` astrotcl_headers=`cd $srcdir; echo ../astrotcl/{generic,press,libwcs,cfitsio}/*.h` tclutil_headers=`cd $srcdir; echo ../tclutil/generic/*.h` rtd_includes="-I$srcdir/generic -I$srcdir/rtdevt -I$srcdir/bitmaps" astrotcl_includes="-I$srcdir/../astrotcl/generic -I$srcdir/../astrotcl/cfitsio -I$srcdir/../astrotcl/libwcs" tclutil_includes="-I$srcdir/../tclutil/generic" cincludes="${rtd_includes} ${astrotcl_includes} ${tclutil_includes}" if test $MERGED = yes ; then echo "Will build merged master rtd library" cheaders="${rtd_headers} ${astrotcl_headers} ${tclutil_headers}" MERGE_OBJECTS="$astrotcl_PKG_OBJECTS $tclutil_PKG_OBJECTS" dnl AC_DEFINE(MERGE_OBJECTS, 1, [merge the contents of dependent packages into a master library]) else echo "Not making a merged master rtd library" cheaders="${rtd_headers}" MERGE_OBJECTS="" fi AC_SUBST(MERGE_OBJECTS) # ----------------------------------------------------------------------- AC_DEFINE(USE_COMPAT_CONST, 1, [For compatibility between tcl8.4 and previous tcl releases]) # ----------------------------------------------------------------------- AC_MSG_CHECKING([sysv shared memory prototypes]) AC_EGREP_HEADER([int.*shmdt.*\(], [sys/shm.h], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); AC_DEFINE(NEED_SHM_PROTO, 1, [Check if we need (or can use) shared memory (sysv/shm) prototypes])]) # ----------------------------------------------------------------------- AC_MSG_CHECKING([gethostname prototype]) AC_EGREP_HEADER([int.*gethostname.*\(], [unistd.h], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); AC_DEFINE(NEED_GETHOSTNAME_PROTO, 1, [Check if we need a prototype for gethostname()])]) # ----------------------------------------------------------------------- AC_CHECK_SIZEOF(long, 4) # ----------------------------------------------------------------------- # there are some idiosyncrasies with semun defs (used in semxxx). Solaris # does not define it at all # ------------------------------------------------------------------------- AC_MSG_CHECKING("do we have union semun defined") AC_TRY_COMPILE( [#include #include #include #include ], [ union semun filler; ], [ AC_DEFINE(HAVE_UNION_SEMUN) AC_MSG_RESULT("yes") ], AC_MSG_RESULT("no") ) AC_DEFINE(HAVE_NET_SERVICES) AC_CHECK_HEADERS(sys/filio.h) # Check if we need (or can use) the socklen_t type. AC_CHECK_TYPES([socklen_t],,,[#include ]) #------------------------------------------------------------------------ AC_LANG(C++) AC_MSG_CHECKING([fd_set]) AC_TRY_COMPILE([ #include #include #include ], [fd_set readFds; select(32, &readFds, 0, 0, 0);], test_ok=yes, test_ok=no) if test $test_ok = yes; then AC_DEFINE(HAVE_SELECT_FD_SET, 1, [See if the select system call uses fd_set arguments]) fi AC_MSG_RESULT($test_ok) #------------------------------------------------------------------------ # Check if we require additional libraries to support C++ shareable # libraries. system=`uname -s`-`uname -r` SHLIB_LD_CXX_LIBS="" export SHLIB_LD_CXX_LIBS case $system in SunOS-5*) SHLIB_LD_CXX_LIBS="-lCrun -lCstd" ;; OSF*) SHLIB_LD_CXX_LIBS="-lcxx -lcxxstd" ;; esac AC_SUBST(SHLIB_LD_CXX_LIBS) #------------------------------------------------------------------------- # The cxx C++ compiler under Tru64 UNIX needs the special # CXXFLAGS "-std gnu -D__USE_STD_IOSTREAM=1". These allow the standard # library streams headers to work and to generate templates that do # not require special handling throughout skycat directories (normally # template object files are created in various cxx_repository subdirectories, # this way the object files are kept embedded the usual object files, see # the cxx man page for details). #------------------------------------------------------------------------- export CXXFLAGS case $system in OSF*) case "x$CXX" in xcxx*) CXXFLAGS="$CXXFLAGS -g3 -std gnu -D__USE_STD_IOSTREAM=1" ;; esac ;; esac ]) skycat-3.1.2-starlink-1b/rtd/bitmaps/000077500000000000000000000000001215713201500173655ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/rtd/bitmaps/README000066400000000000000000000002431215713201500202440ustar00rootroot00000000000000Be sure to run update_bitmaps.sh if you add or modify a bitmap in this directory. This will create ../generic/rtd_bitmaps.C which defines the bitmaps in C code. skycat-3.1.2-starlink-1b/rtd/bitmaps/Right.xbm000066400000000000000000000015561215713201500211610ustar00rootroot00000000000000#define Right_width 32 #define Right_height 32 static char Right_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x01, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x03, 0x00, 0x00, 0xf0, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/rtd/bitmaps/big_right.xbm000066400000000000000000000015721215713201500220400ustar00rootroot00000000000000#define big_right_width 32 #define big_right_height 32 static char big_right_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf0, 0xff, 0x03, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x03, 0xf0, 0xff, 0xff, 0x00, 0xf0, 0xff, 0x3f, 0x00, 0xf0, 0xff, 0x0f, 0x00, 0xf0, 0xff, 0x03, 0x00, 0xf0, 0xff, 0x00, 0x00, 0xf0, 0x3f, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0xf0, 0x03, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/rtd/bitmaps/bitmaps.tcl000066400000000000000000000016441215713201500215350ustar00rootroot00000000000000#!../bin/rtdimage_wish # # E.S.O. - VLT project # # "@(#) $Id: bitmaps.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # script to generate C code declaring X bitmaps so that the (binary) application # doesn't have to be delivered with the bitmap files. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 21 Nov 95 Created puts { /* * E.S.O. - VLT project * "@(#) $Id: bitmaps.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Bitmap definitions for Tk * * This file was generated by ../bitmaps/bitmaps.tcl - DO NO EDIT */ #include #include } puts "void defineRtdBitmaps(Tcl_Interp *interp) {" foreach file [glob *.xbm] { set name [file rootname $file] puts " #include \"$file\"" puts " Tk_DefineBitmap(interp, Tk_GetUid(\"$name\"), (char*)${name}_bits, ${name}_width, ${name}_height);\n" } puts "}" exit 0 skycat-3.1.2-starlink-1b/rtd/bitmaps/double_left.xbm000066400000000000000000000016001215713201500223560ustar00rootroot00000000000000#define double_left_width 32 #define double_left_height 32 static char double_left_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x08, 0x00, 0xc0, 0x00, 0x0c, 0x00, 0xe0, 0x00, 0x0e, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0xf8, 0x80, 0x0f, 0x00, 0xfc, 0xc0, 0x0f, 0x00, 0xfe, 0xe0, 0x0f, 0x00, 0xff, 0xf0, 0x0f, 0x80, 0xff, 0xf8, 0x0f, 0xc0, 0xff, 0xfc, 0x0f, 0xe0, 0xff, 0xfe, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xe0, 0xff, 0xfe, 0x0f, 0xc0, 0xff, 0xfc, 0x0f, 0x80, 0xff, 0xf8, 0x0f, 0x00, 0xff, 0xf0, 0x0f, 0x00, 0xfe, 0xe0, 0x0f, 0x00, 0xfc, 0xc0, 0x0f, 0x00, 0xf8, 0x80, 0x0f, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0xe0, 0x00, 0x0e, 0x00, 0xc0, 0x00, 0x0c, 0x00, 0x80, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/rtd/bitmaps/double_right.xbm000066400000000000000000000016031215713201500225440ustar00rootroot00000000000000#define double_right_width 32 #define double_right_height 32 static char double_right_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x01, 0x00, 0x30, 0x00, 0x03, 0x00, 0x70, 0x00, 0x07, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0xf0, 0x01, 0x1f, 0x00, 0xf0, 0x03, 0x3f, 0x00, 0xf0, 0x07, 0x7f, 0x00, 0xf0, 0x0f, 0xff, 0x00, 0xf0, 0x1f, 0xff, 0x01, 0xf0, 0x3f, 0xff, 0x03, 0xf0, 0x7f, 0xff, 0x07, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0xff, 0xff, 0x0f, 0xf0, 0x7f, 0xff, 0x07, 0xf0, 0x3f, 0xff, 0x03, 0xf0, 0x1f, 0xff, 0x01, 0xf0, 0x0f, 0xff, 0x00, 0xf0, 0x07, 0x7f, 0x00, 0xf0, 0x03, 0x3f, 0x00, 0xf0, 0x01, 0x1f, 0x00, 0xf0, 0x00, 0x0f, 0x00, 0x70, 0x00, 0x07, 0x00, 0x30, 0x00, 0x03, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/rtd/bitmaps/record.xbm000066400000000000000000000015611215713201500213560ustar00rootroot00000000000000#define record_width 32 #define record_height 32 static char record_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xfe, 0x7f, 0x00, 0x00, 0xfc, 0x3f, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/rtd/bitmaps/rect.xbm000066400000000000000000000015531215713201500210360ustar00rootroot00000000000000#define rect_width 32 #define rect_height 32 static char rect_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/rtd/bitmaps/update_bitmaps.sh000077500000000000000000000002051215713201500227220ustar00rootroot00000000000000#!/bin/sh # # This script updates a C source file to contain the bitmaps in this dir. tclsh bitmaps.tcl > ../generic/rtd_bitmaps.C skycat-3.1.2-starlink-1b/rtd/colormaps/000077500000000000000000000000001215713201500177255ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/rtd/colormaps/README000066400000000000000000000002461215713201500206070ustar00rootroot00000000000000Be sure to run update_colormaps.sh if you add or modify a colormap in this directory. This will create ../generic/colormaps.C which defines the colormaps in C code. skycat-3.1.2-starlink-1b/rtd/colormaps/aips0.lasc000066400000000000000000000324001215713201500216040ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.47451 0.00000 0.60784 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.37255 0.65490 0.92549 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.69412 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/backgr.lasc000066400000000000000000000324001215713201500220210ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.01587 0.01587 0.01587 0.03174 0.03174 0.03174 0.04761 0.04761 0.04761 0.06348 0.06348 0.06348 0.07935 0.07935 0.07935 0.09522 0.09522 0.09522 0.11109 0.11109 0.11109 0.12696 0.12696 0.12696 0.14283 0.14283 0.14283 0.15870 0.15870 0.15870 0.17457 0.17457 0.17457 0.19044 0.19044 0.19044 0.20631 0.20631 0.20631 0.22218 0.22218 0.22218 0.23805 0.23805 0.23805 0.25392 0.25392 0.25392 0.26979 0.26979 0.26979 0.28566 0.28566 0.28566 0.30153 0.30153 0.30153 0.31740 0.31740 0.31740 0.33327 0.33327 0.33327 0.34914 0.34914 0.34914 0.36501 0.36501 0.36501 0.38088 0.38088 0.38088 0.39675 0.39675 0.39675 0.41262 0.41262 0.41262 0.42849 0.42849 0.42849 0.44436 0.44436 0.44436 0.46023 0.46023 0.46023 0.47610 0.47610 0.47610 0.49197 0.49197 0.49197 0.50784 0.50784 0.50784 0.52371 0.52371 0.52371 0.53958 0.53958 0.53958 0.55545 0.55545 0.55545 0.57132 0.57132 0.57132 0.58719 0.58719 0.58719 0.60306 0.60306 0.60306 0.61893 0.61893 0.61893 0.63480 0.63480 0.63480 0.65067 0.65067 0.65067 0.66654 0.66654 0.66654 0.68241 0.68241 0.68241 0.69828 0.69828 0.69828 0.71415 0.71415 0.71415 0.73002 0.73002 0.73002 0.74589 0.74589 0.74589 0.76176 0.76176 0.76176 0.77763 0.77763 0.77763 0.79350 0.79350 0.79350 0.80937 0.80937 0.80937 0.82524 0.82524 0.82524 0.84111 0.84111 0.84111 0.85698 0.85698 0.85698 0.87285 0.87285 0.87285 0.88872 0.88872 0.88872 0.90459 0.90459 0.90459 0.92046 0.92046 0.92046 0.93633 0.93633 0.93633 0.95220 0.95220 0.95220 0.96807 0.96807 0.96807 0.98394 0.98394 0.98394 0.99981 0.99981 0.99981 0.00000 0.00000 0.99981 0.00000 0.01587 0.98394 0.00000 0.03174 0.96807 0.00000 0.04761 0.95220 0.00000 0.06348 0.93633 0.00000 0.07935 0.92046 0.00000 0.09522 0.90459 0.00000 0.11109 0.88872 0.00000 0.12696 0.87285 0.00000 0.14283 0.85698 0.00000 0.15870 0.84111 0.00000 0.17457 0.82524 0.00000 0.19044 0.80937 0.00000 0.20631 0.79350 0.00000 0.22218 0.77763 0.00000 0.23805 0.76176 0.00000 0.25392 0.74589 0.00000 0.26979 0.73002 0.00000 0.28566 0.71415 0.00000 0.30153 0.69828 0.00000 0.31740 0.68241 0.00000 0.33327 0.66654 0.00000 0.34914 0.65067 0.00000 0.36501 0.63480 0.00000 0.38088 0.61893 0.00000 0.39675 0.60306 0.00000 0.41262 0.58719 0.00000 0.42849 0.57132 0.00000 0.44436 0.55545 0.00000 0.46023 0.53958 0.00000 0.47610 0.52371 0.00000 0.49197 0.50784 0.00000 0.50784 0.49197 0.00000 0.52371 0.47610 0.00000 0.53958 0.46023 0.00000 0.55545 0.44436 0.00000 0.57132 0.42849 0.00000 0.58719 0.41262 0.00000 0.60306 0.39675 0.00000 0.61893 0.38088 0.00000 0.63480 0.36501 0.00000 0.65067 0.34914 0.00000 0.66654 0.33327 0.00000 0.68241 0.31740 0.00000 0.69828 0.30153 0.00000 0.71415 0.28566 0.00000 0.73002 0.26979 0.00000 0.74589 0.25392 0.00000 0.76176 0.23805 0.00000 0.77763 0.22218 0.00000 0.79350 0.20631 0.00000 0.80937 0.19044 0.00000 0.82524 0.17457 0.00000 0.84111 0.15870 0.00000 0.85698 0.14283 0.00000 0.87285 0.12696 0.00000 0.88872 0.11109 0.00000 0.90459 0.09522 0.00000 0.92046 0.07935 0.00000 0.93633 0.06348 0.00000 0.95220 0.04761 0.00000 0.96807 0.03174 0.00000 0.98394 0.01587 0.00000 0.99981 0.00000 0.00000 1.00000 0.00000 0.01587 1.00000 0.00000 0.03174 1.00000 0.00000 0.04761 1.00000 0.00000 0.06348 1.00000 0.00000 0.07935 1.00000 0.00000 0.09522 1.00000 0.00000 0.11109 1.00000 0.00000 0.12696 1.00000 0.00000 0.14283 1.00000 0.00000 0.15870 1.00000 0.00000 0.17457 1.00000 0.00000 0.19044 1.00000 0.00000 0.20631 1.00000 0.00000 0.22218 1.00000 0.00000 0.23805 1.00000 0.00000 0.25392 1.00000 0.00000 0.26979 1.00000 0.00000 0.28566 1.00000 0.00000 0.30153 1.00000 0.00000 0.31740 1.00000 0.00000 0.33327 1.00000 0.00000 0.34914 1.00000 0.00000 0.36501 1.00000 0.00000 0.38088 1.00000 0.00000 0.39675 1.00000 0.00000 0.41262 1.00000 0.00000 0.42849 1.00000 0.00000 0.44436 1.00000 0.00000 0.46023 1.00000 0.00000 0.47610 1.00000 0.00000 0.49197 1.00000 0.00000 0.50784 1.00000 0.00000 0.52371 1.00000 0.00000 0.53958 1.00000 0.00000 0.55545 1.00000 0.00000 0.57132 1.00000 0.00000 0.58719 1.00000 0.00000 0.60306 1.00000 0.00000 0.61893 1.00000 0.00000 0.63480 1.00000 0.00000 0.65067 1.00000 0.00000 0.66654 1.00000 0.00000 0.68241 1.00000 0.00000 0.69828 1.00000 0.00000 0.71415 1.00000 0.00000 0.73002 1.00000 0.00000 0.74589 1.00000 0.00000 0.76176 1.00000 0.00000 0.77763 1.00000 0.00000 0.79350 1.00000 0.00000 0.80937 1.00000 0.00000 0.82524 1.00000 0.00000 0.84111 1.00000 0.00000 0.85698 1.00000 0.00000 0.87285 1.00000 0.00000 0.88872 1.00000 0.00000 0.90459 1.00000 0.00000 0.92046 1.00000 0.00000 0.93633 1.00000 0.00000 0.95220 1.00000 0.00000 0.96807 1.00000 0.00000 0.98394 1.00000 0.00000 0.99981 1.00000 0.00000 1.00000 0.99981 0.00000 1.00000 0.98394 0.00000 1.00000 0.96807 0.00000 1.00000 0.95220 0.00000 1.00000 0.93633 0.00000 1.00000 0.92046 0.00000 1.00000 0.90459 0.00000 1.00000 0.88872 0.00000 1.00000 0.87285 0.00000 1.00000 0.85698 0.00000 1.00000 0.84111 0.00000 1.00000 0.82524 0.00000 1.00000 0.80937 0.00000 1.00000 0.79350 0.00000 1.00000 0.77763 0.00000 1.00000 0.76176 0.00000 1.00000 0.74589 0.00000 1.00000 0.73002 0.00000 1.00000 0.71415 0.00000 1.00000 0.69828 0.00000 1.00000 0.68241 0.00000 1.00000 0.66654 0.00000 1.00000 0.65067 0.00000 1.00000 0.63480 0.00000 1.00000 0.61893 0.00000 1.00000 0.60306 0.00000 1.00000 0.58719 0.00000 1.00000 0.57132 0.00000 1.00000 0.55545 0.00000 1.00000 0.53958 0.00000 1.00000 0.52371 0.00000 1.00000 0.50784 0.00000 1.00000 0.49197 0.00000 1.00000 0.47610 0.00000 1.00000 0.46023 0.00000 1.00000 0.44436 0.00000 1.00000 0.42849 0.00000 1.00000 0.41262 0.00000 1.00000 0.39675 0.00000 1.00000 0.38088 0.00000 1.00000 0.36501 0.00000 1.00000 0.34914 0.00000 1.00000 0.33327 0.00000 1.00000 0.31740 0.00000 1.00000 0.30153 0.00000 1.00000 0.28566 0.00000 1.00000 0.26979 0.00000 1.00000 0.25392 0.00000 1.00000 0.23805 0.00000 1.00000 0.22218 0.00000 1.00000 0.20631 0.00000 1.00000 0.19044 0.00000 1.00000 0.17457 0.00000 1.00000 0.15870 0.00000 1.00000 0.14283 0.00000 1.00000 0.12696 0.00000 1.00000 0.11109 0.00000 1.00000 0.09522 0.00000 1.00000 0.07935 0.00000 1.00000 0.06348 0.00000 1.00000 0.04761 0.00000 1.00000 0.03174 0.00000 1.00000 0.01587 0.00000 1.00000 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/blue.lasc000066400000000000000000000324001215713201500215170ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00392 0.00000 0.00000 0.00784 0.00000 0.00000 0.01176 0.00000 0.00000 0.01569 0.00000 0.00000 0.01961 0.00000 0.00000 0.02353 0.00000 0.00000 0.02745 0.00000 0.00000 0.03137 0.00000 0.00000 0.03529 0.00000 0.00000 0.03922 0.00000 0.00000 0.04314 0.00000 0.00000 0.04706 0.00000 0.00000 0.05098 0.00000 0.00000 0.05490 0.00000 0.00000 0.05882 0.00000 0.00000 0.06275 0.00000 0.00000 0.06667 0.00000 0.00000 0.07059 0.00000 0.00000 0.07451 0.00000 0.00000 0.07843 0.00000 0.00000 0.08235 0.00000 0.00000 0.08627 0.00000 0.00000 0.09020 0.00000 0.00000 0.09412 0.00000 0.00000 0.09804 0.00000 0.00000 0.10196 0.00000 0.00000 0.10588 0.00000 0.00000 0.10980 0.00000 0.00000 0.11373 0.00000 0.00000 0.11765 0.00000 0.00000 0.12157 0.00000 0.00000 0.12549 0.00000 0.00000 0.12941 0.00000 0.00000 0.13333 0.00000 0.00000 0.13725 0.00000 0.00000 0.14118 0.00000 0.00000 0.14510 0.00000 0.00000 0.14902 0.00000 0.00000 0.15294 0.00000 0.00000 0.15686 0.00000 0.00000 0.16078 0.00000 0.00000 0.16471 0.00000 0.00000 0.16863 0.00000 0.00000 0.17255 0.00000 0.00000 0.17647 0.00000 0.00000 0.18039 0.00000 0.00000 0.18431 0.00000 0.00000 0.18824 0.00000 0.00000 0.19216 0.00000 0.00000 0.19608 0.00000 0.00000 0.20000 0.00000 0.00000 0.20392 0.00000 0.00000 0.20784 0.00000 0.00000 0.21176 0.00000 0.00000 0.21569 0.00000 0.00000 0.21961 0.00000 0.00000 0.22353 0.00000 0.00000 0.22745 0.00000 0.00000 0.23137 0.00000 0.00000 0.23529 0.00000 0.00000 0.23922 0.00000 0.00000 0.24314 0.00000 0.00000 0.24706 0.00000 0.00000 0.25098 0.00000 0.00000 0.25490 0.00000 0.00000 0.25882 0.00000 0.00000 0.26275 0.00000 0.00000 0.26667 0.00000 0.00000 0.27059 0.00000 0.00000 0.27451 0.00000 0.00000 0.27843 0.00000 0.00000 0.28235 0.00000 0.00000 0.28627 0.00000 0.00000 0.29020 0.00000 0.00000 0.29412 0.00000 0.00000 0.29804 0.00000 0.00000 0.30196 0.00000 0.00000 0.30588 0.00000 0.00000 0.30980 0.00000 0.00000 0.31373 0.00000 0.00000 0.31765 0.00000 0.00000 0.32157 0.00000 0.00000 0.32549 0.00000 0.00000 0.32941 0.00000 0.00000 0.33333 0.00000 0.00000 0.33725 0.00000 0.00000 0.34118 0.00000 0.00000 0.34510 0.00000 0.00000 0.34902 0.00000 0.00000 0.35294 0.00000 0.00000 0.35686 0.00000 0.00000 0.36078 0.00000 0.00000 0.36471 0.00000 0.00000 0.36863 0.00000 0.00000 0.37255 0.00000 0.00000 0.37647 0.00000 0.00000 0.38039 0.00000 0.00000 0.38431 0.00000 0.00000 0.38824 0.00000 0.00000 0.39216 0.00000 0.00000 0.39608 0.00000 0.00000 0.40000 0.00000 0.00000 0.40392 0.00000 0.00000 0.40784 0.00000 0.00000 0.41176 0.00000 0.00000 0.41569 0.00000 0.00000 0.41961 0.00000 0.00000 0.42353 0.00000 0.00000 0.42745 0.00000 0.00000 0.43137 0.00000 0.00000 0.43529 0.00000 0.00000 0.43922 0.00000 0.00000 0.44314 0.00000 0.00000 0.44706 0.00000 0.00000 0.45098 0.00000 0.00000 0.45490 0.00000 0.00000 0.45882 0.00000 0.00000 0.46275 0.00000 0.00000 0.46667 0.00000 0.00000 0.47059 0.00000 0.00000 0.47451 0.00000 0.00000 0.47843 0.00000 0.00000 0.48235 0.00000 0.00000 0.48627 0.00000 0.00000 0.49020 0.00000 0.00000 0.49412 0.00000 0.00000 0.49804 0.00000 0.00000 0.50196 0.00000 0.00000 0.50588 0.00000 0.00000 0.50980 0.00000 0.00000 0.51373 0.00000 0.00000 0.51765 0.00000 0.00000 0.52157 0.00000 0.00000 0.52549 0.00000 0.00000 0.52941 0.00000 0.00000 0.53333 0.00000 0.00000 0.53725 0.00000 0.00000 0.54118 0.00000 0.00000 0.54510 0.00000 0.00000 0.54902 0.00000 0.00000 0.55294 0.00000 0.00000 0.55686 0.00000 0.00000 0.56078 0.00000 0.00000 0.56471 0.00000 0.00000 0.56863 0.00000 0.00000 0.57255 0.00000 0.00000 0.57647 0.00000 0.00000 0.58039 0.00000 0.00000 0.58431 0.00000 0.00000 0.58824 0.00000 0.00000 0.59216 0.00000 0.00000 0.59608 0.00000 0.00000 0.60000 0.00000 0.00000 0.60392 0.00000 0.00000 0.60784 0.00000 0.00000 0.61176 0.00000 0.00000 0.61569 0.00000 0.00000 0.61961 0.00000 0.00000 0.62353 0.00000 0.00000 0.62745 0.00000 0.00000 0.63137 0.00000 0.00000 0.63529 0.00000 0.00000 0.63922 0.00000 0.00000 0.64314 0.00000 0.00000 0.64706 0.00000 0.00000 0.65098 0.00000 0.00000 0.65490 0.00000 0.00000 0.65882 0.00000 0.00000 0.66275 0.00000 0.00000 0.66667 0.00000 0.00000 0.67059 0.00000 0.00000 0.67451 0.00000 0.00000 0.67843 0.00000 0.00000 0.68235 0.00000 0.00000 0.68627 0.00000 0.00000 0.69020 0.00000 0.00000 0.69412 0.00000 0.00000 0.69804 0.00000 0.00000 0.70196 0.00000 0.00000 0.70588 0.00000 0.00000 0.70980 0.00000 0.00000 0.71373 0.00000 0.00000 0.71765 0.00000 0.00000 0.72157 0.00000 0.00000 0.72549 0.00000 0.00000 0.72941 0.00000 0.00000 0.73333 0.00000 0.00000 0.73725 0.00000 0.00000 0.74118 0.00000 0.00000 0.74510 0.00000 0.00000 0.74902 0.00000 0.00000 0.75294 0.00000 0.00000 0.75686 0.00000 0.00000 0.76078 0.00000 0.00000 0.76471 0.00000 0.00000 0.76863 0.00000 0.00000 0.77255 0.00000 0.00000 0.77647 0.00000 0.00000 0.78039 0.00000 0.00000 0.78431 0.00000 0.00000 0.78824 0.00000 0.00000 0.79216 0.00000 0.00000 0.79608 0.00000 0.00000 0.80000 0.00000 0.00000 0.80392 0.00000 0.00000 0.80784 0.00000 0.00000 0.81176 0.00000 0.00000 0.81569 0.00000 0.00000 0.81961 0.00000 0.00000 0.82353 0.00000 0.00000 0.82745 0.00000 0.00000 0.83137 0.00000 0.00000 0.83529 0.00000 0.00000 0.83922 0.00000 0.00000 0.84314 0.00000 0.00000 0.84706 0.00000 0.00000 0.85098 0.00000 0.00000 0.85490 0.00000 0.00000 0.85882 0.00000 0.00000 0.86275 0.00000 0.00000 0.86667 0.00000 0.00000 0.87059 0.00000 0.00000 0.87451 0.00000 0.00000 0.87843 0.00000 0.00000 0.88235 0.00000 0.00000 0.88627 0.00000 0.00000 0.89020 0.00000 0.00000 0.89412 0.00000 0.00000 0.89804 0.00000 0.00000 0.90196 0.00000 0.00000 0.90588 0.00000 0.00000 0.90980 0.00000 0.00000 0.91373 0.00000 0.00000 0.91765 0.00000 0.00000 0.92157 0.00000 0.00000 0.92549 0.00000 0.00000 0.92941 0.00000 0.00000 0.93333 0.00000 0.00000 0.93725 0.00000 0.00000 0.94118 0.00000 0.00000 0.94510 0.00000 0.00000 0.94902 0.00000 0.00000 0.95294 0.00000 0.00000 0.95686 0.00000 0.00000 0.96078 0.00000 0.00000 0.96471 0.00000 0.00000 0.96863 0.00000 0.00000 0.97255 0.00000 0.00000 0.97647 0.00000 0.00000 0.98039 0.00000 0.00000 0.98431 0.00000 0.00000 0.98824 0.00000 0.00000 0.99216 0.00000 0.00000 0.99608 0.00000 0.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/blulut.lasc000066400000000000000000000324001215713201500220770ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00392 0.00000 0.00000 0.00784 0.00000 0.00000 0.01176 0.00000 0.00000 0.01569 0.00000 0.00000 0.01961 0.00000 0.00000 0.02353 0.00000 0.00000 0.02745 0.00000 0.00000 0.03137 0.00000 0.00000 0.03529 0.00000 0.00000 0.03922 0.00000 0.00000 0.04314 0.00000 0.00000 0.04706 0.00001 0.00001 0.05098 0.00001 0.00001 0.05490 0.00001 0.00001 0.05882 0.00002 0.00002 0.06275 0.00002 0.00002 0.06667 0.00002 0.00002 0.07059 0.00003 0.00003 0.07451 0.00004 0.00004 0.07843 0.00005 0.00005 0.08235 0.00006 0.00006 0.08627 0.00007 0.00007 0.09020 0.00008 0.00008 0.09412 0.00009 0.00009 0.09804 0.00011 0.00011 0.10196 0.00013 0.00013 0.10588 0.00015 0.00015 0.10980 0.00017 0.00017 0.11373 0.00019 0.00019 0.11765 0.00022 0.00022 0.12157 0.00025 0.00025 0.12549 0.00028 0.00028 0.12941 0.00032 0.00032 0.13333 0.00035 0.00035 0.13725 0.00040 0.00040 0.14118 0.00044 0.00044 0.14510 0.00049 0.00049 0.14902 0.00055 0.00055 0.15294 0.00061 0.00061 0.15686 0.00067 0.00067 0.16078 0.00074 0.00074 0.16471 0.00081 0.00081 0.16863 0.00089 0.00089 0.17255 0.00097 0.00097 0.17647 0.00106 0.00106 0.18039 0.00115 0.00115 0.18431 0.00126 0.00126 0.18824 0.00136 0.00136 0.19216 0.00148 0.00148 0.19608 0.00160 0.00160 0.20000 0.00173 0.00173 0.20392 0.00187 0.00187 0.20784 0.00201 0.00201 0.21176 0.00216 0.00216 0.21569 0.00233 0.00233 0.21961 0.00250 0.00250 0.22353 0.00268 0.00268 0.22745 0.00287 0.00287 0.23137 0.00307 0.00307 0.23529 0.00327 0.00327 0.23922 0.00349 0.00349 0.24314 0.00373 0.00373 0.24706 0.00397 0.00397 0.25098 0.00422 0.00422 0.25490 0.00449 0.00449 0.25882 0.00477 0.00477 0.26275 0.00506 0.00506 0.26667 0.00536 0.00536 0.27059 0.00568 0.00568 0.27451 0.00601 0.00601 0.27843 0.00636 0.00636 0.28235 0.00672 0.00672 0.28627 0.00709 0.00709 0.29020 0.00748 0.00748 0.29412 0.00789 0.00789 0.29804 0.00831 0.00831 0.30196 0.00875 0.00875 0.30588 0.00921 0.00921 0.30980 0.00969 0.00969 0.31373 0.01018 0.01018 0.31765 0.01069 0.01069 0.32157 0.01122 0.01122 0.32549 0.01177 0.01177 0.32941 0.01235 0.01235 0.33333 0.01294 0.01294 0.33725 0.01355 0.01355 0.34118 0.01418 0.01418 0.34510 0.01484 0.01484 0.34902 0.01552 0.01552 0.35294 0.01622 0.01622 0.35686 0.01694 0.01694 0.36078 0.01769 0.01769 0.36471 0.01847 0.01847 0.36863 0.01926 0.01926 0.37255 0.02009 0.02009 0.37647 0.02094 0.02094 0.38039 0.02181 0.02181 0.38431 0.02272 0.02272 0.38824 0.02365 0.02365 0.39216 0.02461 0.02461 0.39608 0.02560 0.02560 0.40000 0.02662 0.02662 0.40392 0.02767 0.02767 0.40784 0.02875 0.02875 0.41176 0.02986 0.02986 0.41569 0.03100 0.03100 0.41961 0.03218 0.03218 0.42353 0.03338 0.03338 0.42745 0.03463 0.03463 0.43137 0.03590 0.03590 0.43529 0.03721 0.03721 0.43922 0.03856 0.03856 0.44314 0.03994 0.03994 0.44706 0.04136 0.04136 0.45098 0.04282 0.04282 0.45490 0.04432 0.04432 0.45882 0.04585 0.04585 0.46275 0.04743 0.04743 0.46667 0.04904 0.04904 0.47059 0.05070 0.05070 0.47451 0.05239 0.05239 0.47843 0.05413 0.05413 0.48235 0.05591 0.05591 0.48627 0.05774 0.05774 0.49020 0.05961 0.05961 0.49412 0.06153 0.06153 0.49804 0.06349 0.06349 0.50196 0.06549 0.06549 0.50588 0.06755 0.06755 0.50980 0.06965 0.06965 0.51373 0.07180 0.07180 0.51765 0.07400 0.07400 0.52157 0.07625 0.07625 0.52549 0.07856 0.07856 0.52941 0.08091 0.08091 0.53333 0.08331 0.08331 0.53725 0.08577 0.08577 0.54118 0.08829 0.08829 0.54510 0.09086 0.09086 0.54902 0.09348 0.09348 0.55294 0.09616 0.09616 0.55686 0.09890 0.09890 0.56078 0.10169 0.10169 0.56471 0.10455 0.10455 0.56863 0.10746 0.10746 0.57255 0.11044 0.11044 0.57647 0.11347 0.11347 0.58039 0.11657 0.11657 0.58431 0.11973 0.11973 0.58824 0.12296 0.12296 0.59216 0.12624 0.12624 0.59608 0.12960 0.12960 0.60000 0.13302 0.13302 0.60392 0.13651 0.13651 0.60784 0.14007 0.14007 0.61176 0.14369 0.14369 0.61569 0.14739 0.14739 0.61961 0.15116 0.15116 0.62353 0.15500 0.15500 0.62745 0.15891 0.15891 0.63137 0.16289 0.16289 0.63529 0.16695 0.16695 0.63922 0.17109 0.17109 0.64314 0.17530 0.17530 0.64706 0.17959 0.17959 0.65098 0.18395 0.18395 0.65490 0.18840 0.18840 0.65882 0.19292 0.19292 0.66275 0.19753 0.19753 0.66667 0.20222 0.20222 0.67059 0.20699 0.20699 0.67451 0.21185 0.21185 0.67843 0.21679 0.21679 0.68235 0.22182 0.22182 0.68627 0.22693 0.22693 0.69020 0.23213 0.23213 0.69412 0.23742 0.23742 0.69804 0.24280 0.24280 0.70196 0.24827 0.24827 0.70588 0.25384 0.25384 0.70980 0.25949 0.25949 0.71373 0.26524 0.26524 0.71765 0.27109 0.27109 0.72157 0.27703 0.27703 0.72549 0.28307 0.28307 0.72941 0.28920 0.28920 0.73333 0.29544 0.29544 0.73725 0.30178 0.30178 0.74118 0.30821 0.30821 0.74510 0.31476 0.31476 0.74902 0.32140 0.32140 0.75294 0.32815 0.32815 0.75686 0.33500 0.33500 0.76078 0.34196 0.34196 0.76471 0.34903 0.34903 0.76863 0.35621 0.35621 0.77255 0.36350 0.36350 0.77647 0.37090 0.37090 0.78039 0.37841 0.37841 0.78431 0.38603 0.38603 0.78824 0.39377 0.39377 0.79216 0.40163 0.40163 0.79608 0.40960 0.40960 0.80000 0.41769 0.41769 0.80392 0.42590 0.42590 0.80784 0.43423 0.43423 0.81176 0.44268 0.44268 0.81569 0.45126 0.45126 0.81961 0.45996 0.45996 0.82353 0.46878 0.46878 0.82745 0.47773 0.47773 0.83137 0.48681 0.48681 0.83529 0.49601 0.49601 0.83922 0.50535 0.50535 0.84314 0.51482 0.51482 0.84706 0.52442 0.52442 0.85098 0.53415 0.53415 0.85490 0.54402 0.54402 0.85882 0.55403 0.55403 0.86275 0.56417 0.56417 0.86667 0.57445 0.57445 0.87059 0.58487 0.58487 0.87451 0.59543 0.59543 0.87843 0.60613 0.60613 0.88235 0.61698 0.61698 0.88627 0.62798 0.62798 0.89020 0.63911 0.63911 0.89412 0.65040 0.65040 0.89804 0.66184 0.66184 0.90196 0.67342 0.67342 0.90588 0.68516 0.68516 0.90980 0.69705 0.69705 0.91373 0.70909 0.70909 0.91765 0.72129 0.72129 0.92157 0.73365 0.73365 0.92549 0.74616 0.74616 0.92941 0.75883 0.75883 0.93333 0.77167 0.77167 0.93725 0.78466 0.78466 0.94118 0.79782 0.79782 0.94510 0.81115 0.81115 0.94902 0.82464 0.82464 0.95294 0.83830 0.83830 0.95686 0.85213 0.85213 0.96078 0.86612 0.86612 0.96471 0.88029 0.88029 0.96863 0.89464 0.89464 0.97255 0.90915 0.90915 0.97647 0.92385 0.92385 0.98039 0.93872 0.93872 0.98431 0.95377 0.95377 0.98824 0.96899 0.96899 0.99216 0.98441 0.98441 0.99608 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/color.lasc000066400000000000000000000324001215713201500217060ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.18431 0.93725 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.37255 0.74902 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.74902 0.30980 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.30980 0.62353 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.49804 0.49804 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.62353 0.30980 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.93725 0.00000 0.00000 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 0.74902 0.00000 0.30980 skycat-3.1.2-starlink-1b/rtd/colormaps/colormaps.tcl000066400000000000000000000027341215713201500224360ustar00rootroot00000000000000#!../bin/rtdimage_wish # # E.S.O. - VLT project # # "@(#) $Id: colormaps.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # script to generate C code including static colormaps, so that the , # (binary) application doesn't have to be delivered with the colormap files. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 19 Nov 97 Created # pbiereic 31/01/05 Fixed: too many open files puts { /* * E.S.O. - VLT project * "@(#) $Id: colormaps.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Colormap definitions for RTD * * This file was generated by ../colormaps/colormaps.tcl - DO NO EDIT */ #include #include } puts "void defineColormaps() {" # colormaps foreach file [glob *.lasc] { set fd [open $file] set name [file tail $file] set root [file rootname $name] set ar ${root}_lasc puts "\tstatic RGBColor $ar\[\] = {" while {[gets $fd line] != -1} { puts "\t\t{[join $line {, }]}," } puts "\t};" puts "\tnew ColorMapInfo((char *)\"$name\", $ar);\n" close $fd } # itts foreach file [glob *.iasc] { set fd [open $file] set name [file tail $file] set root [file rootname $name] set ar ${root}_iasc puts "\tstatic double $ar\[\] = {" while {[gets $fd line] != -1} { puts "\t\t[lindex $line 0]," } puts "\t};" puts "\tnew ITTInfo((char *)\"$name\", $ar);\n" close $fd } puts "}" exit 0 skycat-3.1.2-starlink-1b/rtd/colormaps/equa.iasc000066400000000000000000000154001215713201500215210ustar00rootroot00000000000000 0.06275 0.13725 0.22353 0.30196 0.36078 0.41176 0.46275 0.50588 0.54510 0.57647 0.60392 0.62745 0.64706 0.66275 0.68235 0.69412 0.70588 0.71765 0.72941 0.73725 0.74510 0.75686 0.76471 0.76863 0.77647 0.78039 0.78824 0.79216 0.79608 0.80000 0.80392 0.80784 0.81176 0.81569 0.81961 0.82353 0.82745 0.83137 0.83529 0.83922 0.84314 0.84314 0.84706 0.85098 0.85490 0.85882 0.85882 0.86275 0.86667 0.86667 0.87059 0.87451 0.87451 0.87843 0.87843 0.88235 0.88235 0.88627 0.88627 0.89020 0.89020 0.89412 0.89412 0.89804 0.89804 0.90196 0.90196 0.90588 0.90588 0.90980 0.90980 0.91373 0.91373 0.91765 0.91765 0.92157 0.92157 0.92549 0.92549 0.92941 0.92941 0.93333 0.93333 0.93725 0.93725 0.93725 0.94118 0.94118 0.94510 0.94510 0.94510 0.94902 0.94902 0.95294 0.95294 0.95294 0.95686 0.95686 0.95686 0.96078 0.96078 0.96078 0.96471 0.96471 0.96471 0.96471 0.96863 0.96863 0.96863 0.96863 0.97255 0.97255 0.97255 0.97255 0.97255 0.97255 0.97647 0.97647 0.97647 0.97647 0.97647 0.97647 0.98039 0.98039 0.98039 0.98039 0.98039 0.98039 0.98039 0.98039 0.98039 0.98039 0.98431 0.98431 0.98431 0.98431 0.98431 0.98431 0.98431 0.98431 0.98431 0.98431 0.98431 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.98824 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99216 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 0.99608 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/expo.iasc000066400000000000000000000154001215713201500215410ustar00rootroot00000000000000 0.00458 0.00689 0.00920 0.01152 0.01386 0.01620 0.01855 0.02091 0.02328 0.02565 0.02804 0.03044 0.03285 0.03526 0.03769 0.04012 0.04257 0.04502 0.04748 0.04996 0.05244 0.05493 0.05743 0.05995 0.06247 0.06500 0.06754 0.07010 0.07266 0.07523 0.07781 0.08041 0.08301 0.08562 0.08824 0.09088 0.09352 0.09618 0.09884 0.10152 0.10420 0.10690 0.10960 0.11232 0.11505 0.11779 0.12054 0.12330 0.12607 0.12885 0.13164 0.13445 0.13726 0.14009 0.14293 0.14578 0.14863 0.15151 0.15439 0.15728 0.16019 0.16310 0.16603 0.16897 0.17192 0.17488 0.17786 0.18084 0.18384 0.18685 0.18987 0.19290 0.19595 0.19900 0.20207 0.20515 0.20824 0.21135 0.21447 0.21760 0.22074 0.22389 0.22706 0.23024 0.23343 0.23663 0.23985 0.24308 0.24632 0.24957 0.25284 0.25612 0.25942 0.26272 0.26604 0.26937 0.27272 0.27608 0.27945 0.28283 0.28623 0.28964 0.29307 0.29651 0.29996 0.30342 0.30690 0.31039 0.31390 0.31742 0.32095 0.32450 0.32806 0.33164 0.33523 0.33883 0.34245 0.34608 0.34973 0.35339 0.35707 0.36076 0.36446 0.36818 0.37191 0.37566 0.37942 0.38320 0.38699 0.39080 0.39462 0.39846 0.40231 0.40618 0.41006 0.41396 0.41788 0.42180 0.42575 0.42971 0.43368 0.43767 0.44168 0.44570 0.44974 0.45379 0.45786 0.46195 0.46605 0.47017 0.47430 0.47845 0.48262 0.48680 0.49100 0.49522 0.49945 0.50370 0.50797 0.51225 0.51655 0.52087 0.52520 0.52955 0.53392 0.53830 0.54270 0.54712 0.55156 0.55601 0.56048 0.56497 0.56948 0.57400 0.57855 0.58311 0.58768 0.59228 0.59689 0.60153 0.60618 0.61085 0.61553 0.62024 0.62496 0.62970 0.63447 0.63925 0.64404 0.64886 0.65370 0.65855 0.66343 0.66832 0.67323 0.67817 0.68312 0.68809 0.69308 0.69809 0.70312 0.70817 0.71324 0.71833 0.72344 0.72856 0.73371 0.73888 0.74407 0.74928 0.75451 0.75977 0.76504 0.77033 0.77564 0.78098 0.78633 0.79171 0.79711 0.80253 0.80797 0.81343 0.81891 0.82442 0.82994 0.83549 0.84106 0.84665 0.85226 0.85790 0.86356 0.86924 0.87494 0.88066 0.88641 0.89218 0.89797 0.90379 0.90963 0.91549 0.92137 0.92728 0.93321 0.93916 0.94514 0.95114 0.95716 0.96321 0.96928 0.97538 0.98150 0.98764 0.99381 0.99888 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/gamma.iasc000066400000000000000000000154001215713201500216500ustar00rootroot00000000000000 0.11285 0.13544 0.15416 0.17045 0.18502 0.19831 0.21059 0.22206 0.23284 0.24304 0.25275 0.26202 0.27090 0.27945 0.28768 0.29564 0.30334 0.31081 0.31807 0.32513 0.33201 0.33872 0.34526 0.35167 0.35793 0.36406 0.37007 0.37596 0.38173 0.38741 0.39298 0.39846 0.40385 0.40915 0.41437 0.41952 0.42458 0.42957 0.43449 0.43935 0.44414 0.44887 0.45353 0.45814 0.46270 0.46720 0.47165 0.47604 0.48039 0.48469 0.48894 0.49315 0.49732 0.50144 0.50552 0.50957 0.51357 0.51754 0.52146 0.52536 0.52922 0.53304 0.53683 0.54059 0.54432 0.54801 0.55168 0.55531 0.55892 0.56250 0.56605 0.56958 0.57307 0.57655 0.57999 0.58342 0.58681 0.59019 0.59354 0.59686 0.60017 0.60345 0.60671 0.60995 0.61317 0.61637 0.61955 0.62271 0.62584 0.62896 0.63206 0.63515 0.63821 0.64126 0.64429 0.64730 0.65029 0.65327 0.65623 0.65918 0.66211 0.66502 0.66792 0.67080 0.67367 0.67652 0.67936 0.68218 0.68499 0.68778 0.69057 0.69333 0.69609 0.69883 0.70156 0.70427 0.70697 0.70966 0.71234 0.71501 0.71766 0.72030 0.72293 0.72555 0.72815 0.73075 0.73333 0.73591 0.73847 0.74102 0.74356 0.74609 0.74861 0.75112 0.75361 0.75610 0.75858 0.76105 0.76351 0.76596 0.76840 0.77083 0.77325 0.77566 0.77806 0.78046 0.78284 0.78522 0.78759 0.78994 0.79229 0.79464 0.79697 0.79929 0.80161 0.80392 0.80622 0.80851 0.81079 0.81307 0.81534 0.81760 0.81985 0.82210 0.82434 0.82657 0.82879 0.83101 0.83322 0.83542 0.83762 0.83980 0.84198 0.84416 0.84633 0.84849 0.85064 0.85279 0.85493 0.85706 0.85919 0.86131 0.86343 0.86553 0.86764 0.86973 0.87182 0.87391 0.87598 0.87806 0.88012 0.88218 0.88424 0.88628 0.88833 0.89036 0.89239 0.89442 0.89644 0.89845 0.90046 0.90246 0.90446 0.90645 0.90844 0.91042 0.91240 0.91437 0.91634 0.91830 0.92025 0.92221 0.92415 0.92609 0.92803 0.92996 0.93189 0.93381 0.93572 0.93763 0.93954 0.94144 0.94334 0.94523 0.94712 0.94901 0.95088 0.95276 0.95463 0.95649 0.95836 0.96021 0.96206 0.96391 0.96576 0.96760 0.96943 0.97126 0.97309 0.97491 0.97673 0.97854 0.98035 0.98216 0.98396 0.98576 0.98755 0.98934 0.99113 0.99291 0.99469 0.99646 0.99823 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/green.lasc000066400000000000000000000324001215713201500216700ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00392 0.00000 0.00000 0.00784 0.00000 0.00000 0.01176 0.00000 0.00000 0.01569 0.00000 0.00000 0.01961 0.00000 0.00000 0.02353 0.00000 0.00000 0.02745 0.00000 0.00000 0.03137 0.00000 0.00000 0.03529 0.00000 0.00000 0.03922 0.00000 0.00000 0.04314 0.00000 0.00000 0.04706 0.00000 0.00000 0.05098 0.00000 0.00000 0.05490 0.00000 0.00000 0.05882 0.00000 0.00000 0.06275 0.00000 0.00000 0.06667 0.00000 0.00000 0.07059 0.00000 0.00000 0.07451 0.00000 0.00000 0.07843 0.00000 0.00000 0.08235 0.00000 0.00000 0.08627 0.00000 0.00000 0.09020 0.00000 0.00000 0.09412 0.00000 0.00000 0.09804 0.00000 0.00000 0.10196 0.00000 0.00000 0.10588 0.00000 0.00000 0.10980 0.00000 0.00000 0.11373 0.00000 0.00000 0.11765 0.00000 0.00000 0.12157 0.00000 0.00000 0.12549 0.00000 0.00000 0.12941 0.00000 0.00000 0.13333 0.00000 0.00000 0.13725 0.00000 0.00000 0.14118 0.00000 0.00000 0.14510 0.00000 0.00000 0.14902 0.00000 0.00000 0.15294 0.00000 0.00000 0.15686 0.00000 0.00000 0.16078 0.00000 0.00000 0.16471 0.00000 0.00000 0.16863 0.00000 0.00000 0.17255 0.00000 0.00000 0.17647 0.00000 0.00000 0.18039 0.00000 0.00000 0.18431 0.00000 0.00000 0.18824 0.00000 0.00000 0.19216 0.00000 0.00000 0.19608 0.00000 0.00000 0.20000 0.00000 0.00000 0.20392 0.00000 0.00000 0.20784 0.00000 0.00000 0.21176 0.00000 0.00000 0.21569 0.00000 0.00000 0.21961 0.00000 0.00000 0.22353 0.00000 0.00000 0.22745 0.00000 0.00000 0.23137 0.00000 0.00000 0.23529 0.00000 0.00000 0.23922 0.00000 0.00000 0.24314 0.00000 0.00000 0.24706 0.00000 0.00000 0.25098 0.00000 0.00000 0.25490 0.00000 0.00000 0.25882 0.00000 0.00000 0.26275 0.00000 0.00000 0.26667 0.00000 0.00000 0.27059 0.00000 0.00000 0.27451 0.00000 0.00000 0.27843 0.00000 0.00000 0.28235 0.00000 0.00000 0.28627 0.00000 0.00000 0.29020 0.00000 0.00000 0.29412 0.00000 0.00000 0.29804 0.00000 0.00000 0.30196 0.00000 0.00000 0.30588 0.00000 0.00000 0.30980 0.00000 0.00000 0.31373 0.00000 0.00000 0.31765 0.00000 0.00000 0.32157 0.00000 0.00000 0.32549 0.00000 0.00000 0.32941 0.00000 0.00000 0.33333 0.00000 0.00000 0.33725 0.00000 0.00000 0.34118 0.00000 0.00000 0.34510 0.00000 0.00000 0.34902 0.00000 0.00000 0.35294 0.00000 0.00000 0.35686 0.00000 0.00000 0.36078 0.00000 0.00000 0.36471 0.00000 0.00000 0.36863 0.00000 0.00000 0.37255 0.00000 0.00000 0.37647 0.00000 0.00000 0.38039 0.00000 0.00000 0.38431 0.00000 0.00000 0.38824 0.00000 0.00000 0.39216 0.00000 0.00000 0.39608 0.00000 0.00000 0.40000 0.00000 0.00000 0.40392 0.00000 0.00000 0.40784 0.00000 0.00000 0.41176 0.00000 0.00000 0.41569 0.00000 0.00000 0.41961 0.00000 0.00000 0.42353 0.00000 0.00000 0.42745 0.00000 0.00000 0.43137 0.00000 0.00000 0.43529 0.00000 0.00000 0.43922 0.00000 0.00000 0.44314 0.00000 0.00000 0.44706 0.00000 0.00000 0.45098 0.00000 0.00000 0.45490 0.00000 0.00000 0.45882 0.00000 0.00000 0.46275 0.00000 0.00000 0.46667 0.00000 0.00000 0.47059 0.00000 0.00000 0.47451 0.00000 0.00000 0.47843 0.00000 0.00000 0.48235 0.00000 0.00000 0.48627 0.00000 0.00000 0.49020 0.00000 0.00000 0.49412 0.00000 0.00000 0.49804 0.00000 0.00000 0.50196 0.00000 0.00000 0.50588 0.00000 0.00000 0.50980 0.00000 0.00000 0.51373 0.00000 0.00000 0.51765 0.00000 0.00000 0.52157 0.00000 0.00000 0.52549 0.00000 0.00000 0.52941 0.00000 0.00000 0.53333 0.00000 0.00000 0.53725 0.00000 0.00000 0.54118 0.00000 0.00000 0.54510 0.00000 0.00000 0.54902 0.00000 0.00000 0.55294 0.00000 0.00000 0.55686 0.00000 0.00000 0.56078 0.00000 0.00000 0.56471 0.00000 0.00000 0.56863 0.00000 0.00000 0.57255 0.00000 0.00000 0.57647 0.00000 0.00000 0.58039 0.00000 0.00000 0.58431 0.00000 0.00000 0.58824 0.00000 0.00000 0.59216 0.00000 0.00000 0.59608 0.00000 0.00000 0.60000 0.00000 0.00000 0.60392 0.00000 0.00000 0.60784 0.00000 0.00000 0.61176 0.00000 0.00000 0.61569 0.00000 0.00000 0.61961 0.00000 0.00000 0.62353 0.00000 0.00000 0.62745 0.00000 0.00000 0.63137 0.00000 0.00000 0.63529 0.00000 0.00000 0.63922 0.00000 0.00000 0.64314 0.00000 0.00000 0.64706 0.00000 0.00000 0.65098 0.00000 0.00000 0.65490 0.00000 0.00000 0.65882 0.00000 0.00000 0.66275 0.00000 0.00000 0.66667 0.00000 0.00000 0.67059 0.00000 0.00000 0.67451 0.00000 0.00000 0.67843 0.00000 0.00000 0.68235 0.00000 0.00000 0.68627 0.00000 0.00000 0.69020 0.00000 0.00000 0.69412 0.00000 0.00000 0.69804 0.00000 0.00000 0.70196 0.00000 0.00000 0.70588 0.00000 0.00000 0.70980 0.00000 0.00000 0.71373 0.00000 0.00000 0.71765 0.00000 0.00000 0.72157 0.00000 0.00000 0.72549 0.00000 0.00000 0.72941 0.00000 0.00000 0.73333 0.00000 0.00000 0.73725 0.00000 0.00000 0.74118 0.00000 0.00000 0.74510 0.00000 0.00000 0.74902 0.00000 0.00000 0.75294 0.00000 0.00000 0.75686 0.00000 0.00000 0.76078 0.00000 0.00000 0.76471 0.00000 0.00000 0.76863 0.00000 0.00000 0.77255 0.00000 0.00000 0.77647 0.00000 0.00000 0.78039 0.00000 0.00000 0.78431 0.00000 0.00000 0.78824 0.00000 0.00000 0.79216 0.00000 0.00000 0.79608 0.00000 0.00000 0.80000 0.00000 0.00000 0.80392 0.00000 0.00000 0.80784 0.00000 0.00000 0.81176 0.00000 0.00000 0.81569 0.00000 0.00000 0.81961 0.00000 0.00000 0.82353 0.00000 0.00000 0.82745 0.00000 0.00000 0.83137 0.00000 0.00000 0.83529 0.00000 0.00000 0.83922 0.00000 0.00000 0.84314 0.00000 0.00000 0.84706 0.00000 0.00000 0.85098 0.00000 0.00000 0.85490 0.00000 0.00000 0.85882 0.00000 0.00000 0.86275 0.00000 0.00000 0.86667 0.00000 0.00000 0.87059 0.00000 0.00000 0.87451 0.00000 0.00000 0.87843 0.00000 0.00000 0.88235 0.00000 0.00000 0.88627 0.00000 0.00000 0.89020 0.00000 0.00000 0.89412 0.00000 0.00000 0.89804 0.00000 0.00000 0.90196 0.00000 0.00000 0.90588 0.00000 0.00000 0.90980 0.00000 0.00000 0.91373 0.00000 0.00000 0.91765 0.00000 0.00000 0.92157 0.00000 0.00000 0.92549 0.00000 0.00000 0.92941 0.00000 0.00000 0.93333 0.00000 0.00000 0.93725 0.00000 0.00000 0.94118 0.00000 0.00000 0.94510 0.00000 0.00000 0.94902 0.00000 0.00000 0.95294 0.00000 0.00000 0.95686 0.00000 0.00000 0.96078 0.00000 0.00000 0.96471 0.00000 0.00000 0.96863 0.00000 0.00000 0.97255 0.00000 0.00000 0.97647 0.00000 0.00000 0.98039 0.00000 0.00000 0.98431 0.00000 0.00000 0.98824 0.00000 0.00000 0.99216 0.00000 0.00000 0.99608 0.00000 0.00000 1.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/greenlut.lasc000066400000000000000000000140001215713201500224110ustar00rootroot000000000000000.00000 0.00000 0.00000 0.00000 0.00392 0.00000 0.00000 0.00784 0.00000 0.00000 0.01176 0.00000 0.00000 0.01569 0.00000 0.00000 0.01961 0.00000 0.00000 0.02353 0.00000 0.00000 0.02745 0.00000 0.00000 0.03137 0.00000 0.00000 0.03529 0.00000 0.00000 0.03922 0.00000 0.00000 0.04314 0.00000 0.00000 0.04706 0.00000 0.00001 0.05098 0.00001 0.00001 0.05490 0.00001 0.00001 0.05882 0.00001 0.00002 0.06275 0.00002 0.00002 0.06667 0.00002 0.00002 0.07059 0.00002 0.00003 0.07451 0.00003 0.00004 0.07843 0.00004 0.00005 0.08235 0.00005 0.00006 0.08627 0.00006 0.00007 0.09020 0.00007 0.00008 0.09412 0.00008 0.00009 0.09804 0.00009 0.00011 0.10196 0.00011 0.00013 0.10588 0.00013 0.00015 0.10980 0.00015 0.00017 0.11373 0.00017 0.00019 0.11765 0.00019 0.00022 0.12157 0.00022 0.00025 0.12549 0.00025 0.00028 0.12941 0.00028 0.00032 0.13333 0.00032 0.00035 0.13725 0.00035 0.00040 0.14118 0.00040 0.00044 0.14510 0.00044 0.00049 0.14902 0.00049 0.00055 0.15294 0.00055 0.00061 0.15686 0.00061 0.00067 0.16078 0.00067 0.00074 0.16471 0.00074 0.00081 0.16863 0.00081 0.00089 0.17255 0.00089 0.00097 0.17647 0.00097 0.00106 0.18039 0.00106 0.00115 0.18431 0.00115 0.00126 0.18824 0.00126 0.00136 0.19216 0.00136 0.00148 0.19608 0.00148 0.00160 0.20000 0.00160 0.00173 0.20392 0.00173 0.00187 0.20784 0.00187 0.00201 0.21176 0.00201 0.00216 0.21569 0.00216 0.00233 0.21961 0.00233 0.00250 0.22353 0.00250 0.00268 0.22745 0.00268 0.00287 0.23137 0.00287 0.00307 0.23529 0.00307 0.00327 0.23922 0.00327 0.00349 0.24314 0.00349 0.00373 0.24706 0.00373 0.00397 0.25098 0.00397 0.00422 0.25490 0.00422 0.00449 0.25882 0.00449 0.00477 0.26275 0.00477 0.00506 0.26667 0.00506 0.00536 0.27059 0.00536 0.00568 0.27451 0.00568 0.00601 0.27843 0.00601 0.00636 0.28235 0.00636 0.00672 0.28627 0.00672 0.00709 0.29020 0.00709 0.00748 0.29412 0.00748 0.00789 0.29804 0.00789 0.00831 0.30196 0.00831 0.00875 0.30588 0.00875 0.00921 0.30980 0.00921 0.00969 0.31373 0.00969 0.01018 0.31765 0.01018 0.01069 0.32157 0.01069 0.01122 0.32549 0.01122 0.01177 0.32941 0.01177 0.01235 0.33333 0.01235 0.01294 0.33725 0.01294 0.01355 0.34118 0.01355 0.01418 0.34510 0.01418 0.01484 0.34902 0.01484 0.01552 0.35294 0.01552 0.01622 0.35686 0.01622 0.01694 0.36078 0.01694 0.01769 0.36471 0.01769 0.01847 0.36863 0.01847 0.01926 0.37255 0.01926 0.02009 0.37647 0.02009 0.02094 0.38039 0.02094 0.02181 0.38431 0.02181 0.02272 0.38824 0.02272 0.02365 0.39216 0.02365 0.02461 0.39608 0.02461 0.02560 0.40000 0.02560 0.02662 0.40392 0.02662 0.02767 0.40784 0.02767 0.02875 0.41176 0.02875 0.02986 0.41569 0.02986 0.03100 0.41961 0.03100 0.03218 0.42353 0.03218 0.03338 0.42745 0.03338 0.03463 0.43137 0.03463 0.03590 0.43529 0.03590 0.03721 0.43922 0.03721 0.03856 0.44314 0.03856 0.03994 0.44706 0.03994 0.04136 0.45098 0.04136 0.04282 0.45490 0.04282 0.04432 0.45882 0.04432 0.04585 0.46275 0.04585 0.04743 0.46667 0.04743 0.04904 0.47059 0.04904 0.05070 0.47451 0.05070 0.05239 0.47843 0.05239 0.05413 0.48235 0.05413 0.05591 0.48627 0.05591 0.05774 0.49020 0.05774 0.05961 0.49412 0.05961 0.06153 0.49804 0.06153 0.06349 0.50196 0.06349 0.06549 0.50588 0.06549 0.06755 0.50980 0.06755 0.06965 0.51373 0.06965 0.07180 0.51765 0.07180 0.07400 0.52157 0.07400 0.07625 0.52549 0.07625 0.07856 0.52941 0.07856 0.08091 0.53333 0.08091 0.08331 0.53725 0.08331 0.08577 0.54118 0.08577 0.08829 0.54510 0.08829 0.09086 0.54902 0.09086 0.09348 0.55294 0.09348 0.09616 0.55686 0.09616 0.09890 0.56078 0.09890 0.10169 0.56471 0.10169 0.10455 0.56863 0.10455 0.10746 0.57255 0.10746 0.11044 0.57647 0.11044 0.11347 0.58039 0.11347 0.11657 0.58431 0.11657 0.11973 0.58824 0.11973 0.12296 0.59216 0.12296 0.12624 0.59608 0.12624 0.12960 0.60000 0.12960 0.13302 0.60392 0.13302 0.13651 0.60784 0.13651 0.14007 0.61176 0.14007 0.14369 0.61569 0.14369 0.14739 0.61961 0.14739 0.15116 0.62353 0.15116 0.15500 0.62745 0.15500 0.15891 0.63137 0.15891 0.16289 0.63529 0.16289 0.16695 0.63922 0.16695 0.17109 0.64314 0.17109 0.17530 0.64706 0.17530 0.17959 0.65098 0.17959 0.18395 0.65490 0.18395 0.18840 0.65882 0.18840 0.19292 0.66275 0.19292 0.19753 0.66667 0.19753 0.20222 0.67059 0.20222 0.20699 0.67451 0.20699 0.21185 0.67843 0.21185 0.21679 0.68235 0.21679 0.22182 0.68627 0.22182 0.22693 0.69020 0.22693 0.23213 0.69412 0.23213 0.23742 0.69804 0.23742 0.24280 0.70196 0.24280 0.24827 0.70588 0.24827 0.25384 0.70980 0.25384 0.25949 0.71373 0.25949 0.26524 0.71765 0.26524 0.27109 0.72157 0.27109 0.27703 0.72549 0.27703 0.28307 0.72941 0.28307 0.28920 0.73333 0.28920 0.29544 0.73725 0.29544 0.30178 0.74118 0.30178 0.30821 0.74510 0.30821 0.31476 0.74902 0.31476 0.32140 0.75294 0.32140 0.32815 0.75686 0.32815 0.33500 0.76078 0.33500 0.34196 0.76471 0.34196 0.34903 0.76863 0.34903 0.35621 0.77255 0.35621 0.36350 0.77647 0.36350 0.37090 0.78039 0.37090 0.37841 0.78431 0.37841 0.38603 0.78824 0.38603 0.39377 0.79216 0.39377 0.40163 0.79608 0.40163 0.40960 0.80000 0.40960 0.41769 0.80392 0.41769 0.42590 0.80784 0.42590 0.43423 0.81176 0.43423 0.44268 0.81569 0.44268 0.45126 0.81961 0.45126 0.45996 0.82353 0.45996 0.46878 0.82745 0.46878 0.47773 0.83137 0.47773 0.48681 0.83529 0.48681 0.49601 0.83922 0.49601 0.50535 0.84314 0.50535 0.51482 0.84706 0.51482 0.52442 0.85098 0.52442 0.53415 0.85490 0.53415 0.54402 0.85882 0.54402 0.55403 0.86275 0.55403 0.56417 0.86667 0.56417 0.57445 0.87059 0.57445 0.58487 0.87451 0.58487 0.59543 0.87843 0.59543 0.60613 0.88235 0.60613 0.61698 0.88627 0.61698 0.62798 0.89020 0.62798 0.63911 0.89412 0.63911 0.65040 0.89804 0.65040 0.66184 0.90196 0.66184 0.67342 0.90588 0.67342 0.68516 0.90980 0.68516 0.69705 0.91373 0.69705 0.70909 0.91765 0.70909 0.72129 0.92157 0.72129 0.73365 0.92549 0.73365 0.74616 0.92941 0.74616 0.75883 0.93333 0.75883 0.77167 0.93725 0.77167 0.78466 0.94118 0.78466 0.79782 0.94510 0.79782 0.81115 0.94902 0.81115 0.82464 0.95294 0.82464 0.83830 0.95686 0.83830 0.85213 0.96078 0.85213 0.86612 0.96471 0.86612 0.88029 0.96863 0.88029 0.89464 0.97255 0.89464 0.90915 0.97647 0.90915 0.92385 0.98039 0.92385 0.93872 0.98431 0.93872 0.95377 0.98824 0.95377 0.96899 0.99216 0.96899 0.98441 0.99608 0.98441 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/heat.lasc000066400000000000000000000324001215713201500215110ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.01176 0.00392 0.00000 0.02353 0.00784 0.00000 0.03529 0.01176 0.00000 0.04706 0.01569 0.00000 0.05882 0.01961 0.00000 0.07059 0.02353 0.00000 0.08235 0.02745 0.00000 0.09412 0.03137 0.00000 0.10588 0.03529 0.00000 0.11765 0.03922 0.00000 0.12941 0.04314 0.00000 0.14118 0.04706 0.00000 0.15294 0.05098 0.00000 0.16471 0.05490 0.00000 0.17647 0.05882 0.00000 0.18824 0.06275 0.00000 0.20000 0.06667 0.00000 0.21176 0.07059 0.00000 0.22353 0.07451 0.00000 0.23529 0.07843 0.00000 0.24706 0.08235 0.00000 0.25882 0.08627 0.00000 0.27059 0.09020 0.00000 0.28235 0.09412 0.00000 0.29412 0.09804 0.00000 0.30588 0.10196 0.00000 0.31765 0.10588 0.00000 0.32941 0.10980 0.00000 0.34118 0.11373 0.00000 0.35294 0.11765 0.00000 0.36471 0.12157 0.00000 0.37647 0.12549 0.00000 0.38824 0.12941 0.00000 0.40000 0.13333 0.00000 0.41176 0.13725 0.00000 0.42353 0.14118 0.00000 0.43529 0.14510 0.00000 0.44706 0.14902 0.00000 0.45882 0.15294 0.00000 0.47059 0.15686 0.00000 0.48235 0.16078 0.00000 0.49412 0.16471 0.00000 0.50588 0.16863 0.00000 0.51765 0.17255 0.00000 0.52941 0.17647 0.00000 0.54118 0.18039 0.00000 0.55294 0.18431 0.00000 0.56471 0.18824 0.00000 0.57647 0.19216 0.00000 0.58824 0.19608 0.00000 0.60000 0.20000 0.00000 0.61176 0.20392 0.00000 0.62353 0.20784 0.00000 0.63529 0.21176 0.00000 0.64706 0.21569 0.00000 0.65882 0.21961 0.00000 0.67059 0.22353 0.00000 0.68235 0.22745 0.00000 0.69412 0.23137 0.00000 0.70588 0.23529 0.00000 0.71765 0.23922 0.00000 0.72941 0.24314 0.00000 0.74118 0.24706 0.00000 0.75294 0.25098 0.00000 0.76471 0.25490 0.00000 0.77647 0.25882 0.00000 0.78824 0.26275 0.00000 0.80000 0.26667 0.00000 0.81176 0.27059 0.00000 0.82353 0.27451 0.00000 0.83529 0.27843 0.00000 0.84706 0.28235 0.00000 0.85882 0.28627 0.00000 0.87059 0.29020 0.00000 0.88235 0.29412 0.00000 0.89412 0.29804 0.00000 0.90588 0.30196 0.00000 0.91765 0.30588 0.00000 0.92941 0.30980 0.00000 0.94118 0.31373 0.00000 0.95294 0.31765 0.00000 0.96471 0.32157 0.00000 0.97647 0.32549 0.00000 0.98824 0.32941 0.00000 1.00000 0.33333 0.00000 1.00000 0.33725 0.00000 1.00000 0.34118 0.00000 1.00000 0.34510 0.00000 1.00000 0.34902 0.00000 1.00000 0.35294 0.00000 1.00000 0.35686 0.00000 1.00000 0.36078 0.00000 1.00000 0.36471 0.00000 1.00000 0.36863 0.00000 1.00000 0.37255 0.00000 1.00000 0.37647 0.00000 1.00000 0.38039 0.00000 1.00000 0.38431 0.00000 1.00000 0.38824 0.00000 1.00000 0.39216 0.00000 1.00000 0.39608 0.00000 1.00000 0.40000 0.00000 1.00000 0.40392 0.00000 1.00000 0.40784 0.00000 1.00000 0.41176 0.00000 1.00000 0.41569 0.00000 1.00000 0.41961 0.00000 1.00000 0.42353 0.00000 1.00000 0.42745 0.00000 1.00000 0.43137 0.00000 1.00000 0.43529 0.00000 1.00000 0.43922 0.00000 1.00000 0.44314 0.00000 1.00000 0.44706 0.00000 1.00000 0.45098 0.00000 1.00000 0.45490 0.00000 1.00000 0.45882 0.00000 1.00000 0.46275 0.00000 1.00000 0.46667 0.00000 1.00000 0.47059 0.00000 1.00000 0.47451 0.00000 1.00000 0.47843 0.00000 1.00000 0.48235 0.00000 1.00000 0.48627 0.00000 1.00000 0.49020 0.00000 1.00000 0.49412 0.00000 1.00000 0.49804 0.00000 1.00000 0.50196 0.00000 1.00000 0.50588 0.00000 1.00000 0.50980 0.00000 1.00000 0.51373 0.00000 1.00000 0.51765 0.00000 1.00000 0.52157 0.00000 1.00000 0.52549 0.00000 1.00000 0.52941 0.00000 1.00000 0.53333 0.00000 1.00000 0.53725 0.00000 1.00000 0.54118 0.00000 1.00000 0.54510 0.00000 1.00000 0.54902 0.00000 1.00000 0.55294 0.00000 1.00000 0.55686 0.00000 1.00000 0.56078 0.00000 1.00000 0.56471 0.00000 1.00000 0.56863 0.00000 1.00000 0.57255 0.00000 1.00000 0.57647 0.00000 1.00000 0.58039 0.00000 1.00000 0.58431 0.00000 1.00000 0.58824 0.00000 1.00000 0.59216 0.00000 1.00000 0.59608 0.00000 1.00000 0.60000 0.00000 1.00000 0.60392 0.00000 1.00000 0.60784 0.00000 1.00000 0.61176 0.00000 1.00000 0.61569 0.00000 1.00000 0.61961 0.00000 1.00000 0.62353 0.00000 1.00000 0.62745 0.00000 1.00000 0.63137 0.00000 1.00000 0.63529 0.00000 1.00000 0.63922 0.00000 1.00000 0.64314 0.00000 1.00000 0.64706 0.00000 1.00000 0.65098 0.01176 1.00000 0.65490 0.02353 1.00000 0.65882 0.03529 1.00000 0.66275 0.04706 1.00000 0.66667 0.05882 1.00000 0.67059 0.07059 1.00000 0.67451 0.08235 1.00000 0.67843 0.09412 1.00000 0.68235 0.10588 1.00000 0.68627 0.11765 1.00000 0.69020 0.12941 1.00000 0.69412 0.14118 1.00000 0.69804 0.15294 1.00000 0.70196 0.16471 1.00000 0.70588 0.17647 1.00000 0.70980 0.18824 1.00000 0.71373 0.20000 1.00000 0.71765 0.21176 1.00000 0.72157 0.22353 1.00000 0.72549 0.23529 1.00000 0.72941 0.24706 1.00000 0.73333 0.25882 1.00000 0.73725 0.27059 1.00000 0.74118 0.28235 1.00000 0.74510 0.29412 1.00000 0.74902 0.30588 1.00000 0.75294 0.31765 1.00000 0.75686 0.32941 1.00000 0.76078 0.34118 1.00000 0.76471 0.35294 1.00000 0.76863 0.36471 1.00000 0.77255 0.37647 1.00000 0.77647 0.38824 1.00000 0.78039 0.40000 1.00000 0.78431 0.41176 1.00000 0.78824 0.42353 1.00000 0.79216 0.43529 1.00000 0.79608 0.44706 1.00000 0.80000 0.45882 1.00000 0.80392 0.47059 1.00000 0.80784 0.48235 1.00000 0.81176 0.49412 1.00000 0.81569 0.50588 1.00000 0.81961 0.51765 1.00000 0.82353 0.52941 1.00000 0.82745 0.54118 1.00000 0.83137 0.55294 1.00000 0.83529 0.56471 1.00000 0.83922 0.57647 1.00000 0.84314 0.58824 1.00000 0.84706 0.60000 1.00000 0.85098 0.61176 1.00000 0.85490 0.62353 1.00000 0.85882 0.63529 1.00000 0.86275 0.64706 1.00000 0.86667 0.65882 1.00000 0.87059 0.67059 1.00000 0.87451 0.68235 1.00000 0.87843 0.69412 1.00000 0.88235 0.70588 1.00000 0.88627 0.71765 1.00000 0.89020 0.72941 1.00000 0.89412 0.74118 1.00000 0.89804 0.75294 1.00000 0.90196 0.76471 1.00000 0.90588 0.77647 1.00000 0.90980 0.78824 1.00000 0.91373 0.80000 1.00000 0.91765 0.81176 1.00000 0.92157 0.82353 1.00000 0.92549 0.83529 1.00000 0.92941 0.84706 1.00000 0.93333 0.85882 1.00000 0.93725 0.87059 1.00000 0.94118 0.88235 1.00000 0.94510 0.89412 1.00000 0.94902 0.90588 1.00000 0.95294 0.91765 1.00000 0.95686 0.92941 1.00000 0.96078 0.94118 1.00000 0.96471 0.95294 1.00000 0.96863 0.96471 1.00000 0.97255 0.97647 1.00000 0.97647 0.98824 1.00000 0.98039 1.00000 1.00000 0.98431 1.00000 1.00000 0.98824 1.00000 1.00000 0.99216 1.00000 1.00000 0.99608 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/idl11.lasc000066400000000000000000000324001215713201500215020ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00392 0.00392 0.00000 0.00784 0.00784 0.00000 0.01176 0.01176 0.00000 0.01569 0.01569 0.00000 0.03137 0.03137 0.00000 0.04706 0.04706 0.00000 0.06275 0.06275 0.00000 0.08235 0.08235 0.00000 0.09804 0.09804 0.00000 0.11373 0.11373 0.00000 0.12941 0.12941 0.00000 0.14902 0.14902 0.00000 0.16471 0.16471 0.00000 0.18039 0.18039 0.00000 0.19608 0.19608 0.00000 0.21569 0.21569 0.00000 0.23137 0.23137 0.00000 0.24706 0.24706 0.00000 0.26275 0.26275 0.00000 0.28235 0.28235 0.00000 0.29804 0.29804 0.00000 0.31373 0.31373 0.00000 0.32941 0.32941 0.00000 0.34902 0.34902 0.00000 0.36471 0.36471 0.00000 0.38039 0.38039 0.00000 0.39608 0.39608 0.00000 0.41569 0.41569 0.00000 0.43137 0.43137 0.00000 0.44706 0.44706 0.00000 0.46275 0.46275 0.00000 0.48235 0.48235 0.00000 0.49804 0.49804 0.00000 0.51373 0.51373 0.00000 0.52941 0.52941 0.00000 0.54902 0.54902 0.00000 0.56471 0.56471 0.00000 0.58039 0.58039 0.00000 0.59608 0.59608 0.00000 0.61569 0.61569 0.00000 0.63137 0.63137 0.00000 0.64706 0.64706 0.00000 0.66275 0.66275 0.00000 0.68235 0.68235 0.00000 0.69804 0.69804 0.00000 0.71373 0.71373 0.00000 0.72941 0.72941 0.00000 0.74902 0.74902 0.00000 0.76471 0.76471 0.00000 0.78039 0.78039 0.00000 0.79608 0.79608 0.00000 0.81569 0.81569 0.00000 0.83137 0.83137 0.00000 0.84706 0.84706 0.00000 0.86275 0.86275 0.00000 0.88235 0.88235 0.00000 0.89804 0.89804 0.00000 0.91373 0.91373 0.00000 0.92941 0.92941 0.00000 0.94902 0.94902 0.00000 0.96471 0.96471 0.00000 0.98039 0.98039 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.98431 1.00000 0.00000 0.96863 1.00000 0.00000 0.95294 1.00000 0.00000 0.93725 1.00000 0.00000 0.92157 1.00000 0.00000 0.90588 1.00000 0.00000 0.89020 1.00000 0.00000 0.87451 1.00000 0.00000 0.85882 1.00000 0.00000 0.84314 1.00000 0.00000 0.82745 1.00000 0.00000 0.81176 1.00000 0.00000 0.79608 1.00000 0.00000 0.78039 1.00000 0.00000 0.76471 1.00000 0.00000 0.74902 1.00000 0.00000 0.73333 1.00000 0.00000 0.71765 1.00000 0.00000 0.70196 1.00000 0.00000 0.68627 1.00000 0.00000 0.66667 1.00000 0.00000 0.65098 1.00000 0.00000 0.63529 1.00000 0.00000 0.61961 1.00000 0.00000 0.60392 1.00000 0.00000 0.58824 1.00000 0.00000 0.57255 1.00000 0.00000 0.55686 1.00000 0.00000 0.54118 1.00000 0.00000 0.52549 1.00000 0.00000 0.50980 1.00000 0.00000 0.49412 1.00000 0.00000 0.47843 1.00000 0.00000 0.46275 1.00000 0.00000 0.44706 1.00000 0.00000 0.43137 1.00000 0.00000 0.41569 1.00000 0.00000 0.40000 1.00000 0.00000 0.38431 1.00000 0.00000 0.36863 1.00000 0.00000 0.35294 1.00000 0.00000 0.33333 1.00000 0.00000 0.31765 1.00000 0.00000 0.30196 1.00000 0.00000 0.28627 1.00000 0.00000 0.27059 1.00000 0.00000 0.25490 1.00000 0.00000 0.23922 1.00000 0.00000 0.22353 1.00000 0.00000 0.20784 1.00000 0.00000 0.19216 1.00000 0.00000 0.17647 1.00000 0.00000 0.16078 1.00000 0.00000 0.14510 1.00000 0.00000 0.12941 1.00000 0.00000 0.11373 1.00000 0.00000 0.09804 1.00000 0.00000 0.08235 1.00000 0.00000 0.06667 1.00000 0.00000 0.05098 1.00000 0.00000 0.03529 1.00000 0.00000 0.01961 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.01569 0.00000 1.00000 0.03137 0.00000 1.00000 0.04706 0.00000 1.00000 0.06275 0.00000 1.00000 0.07843 0.00000 1.00000 0.09412 0.00000 1.00000 0.10980 0.00000 1.00000 0.12549 0.00000 1.00000 0.14118 0.00000 1.00000 0.15686 0.00000 1.00000 0.17255 0.00000 1.00000 0.18824 0.00000 1.00000 0.20392 0.00000 1.00000 0.21961 0.00000 1.00000 0.23529 0.00000 1.00000 0.25098 0.00000 1.00000 0.26667 0.00000 1.00000 0.28235 0.00000 1.00000 0.29804 0.00000 1.00000 0.31373 0.00000 1.00000 0.33333 0.00000 1.00000 0.34902 0.00000 1.00000 0.36471 0.00000 1.00000 0.38039 0.00000 1.00000 0.39608 0.00000 1.00000 0.41176 0.00000 1.00000 0.42745 0.00000 1.00000 0.44314 0.00000 1.00000 0.45882 0.00000 1.00000 0.47451 0.00000 1.00000 0.49020 0.00000 1.00000 0.50588 0.00000 1.00000 0.52157 0.00000 1.00000 0.53725 0.00000 1.00000 0.55294 0.00000 1.00000 0.56863 0.00000 1.00000 0.58431 0.00000 1.00000 0.60000 0.00000 1.00000 0.61569 0.00000 1.00000 0.63137 0.00000 1.00000 0.64706 0.00000 1.00000 0.66667 0.00000 1.00000 0.68235 0.00000 1.00000 0.69804 0.00000 1.00000 0.71373 0.00000 1.00000 0.72941 0.00000 1.00000 0.74510 0.00000 1.00000 0.76078 0.00000 1.00000 0.77647 0.00000 1.00000 0.79216 0.00000 1.00000 0.80784 0.00000 1.00000 0.82353 0.00000 1.00000 0.83922 0.00000 1.00000 0.85490 0.00000 1.00000 0.87059 0.00000 1.00000 0.88627 0.00000 1.00000 0.90196 0.00000 1.00000 0.91765 0.00000 1.00000 0.93333 0.00000 1.00000 0.94902 0.00000 1.00000 0.96471 0.00000 1.00000 0.98039 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.98431 1.00000 0.00000 0.96863 1.00000 0.00000 0.95294 1.00000 0.00000 0.93725 1.00000 0.00000 0.92157 1.00000 0.00000 0.90588 1.00000 0.00000 0.89020 1.00000 0.00000 0.87451 1.00000 0.00000 0.85490 1.00000 0.00000 0.83922 1.00000 0.00000 0.82353 1.00000 0.00000 0.80784 1.00000 0.00000 0.79216 1.00000 0.00000 0.77647 1.00000 0.00000 0.76078 1.00000 0.00000 0.74510 1.00000 0.00000 0.72941 1.00000 0.00000 0.70980 1.00000 0.00000 0.69412 1.00000 0.00000 0.67843 1.00000 0.00000 0.66275 1.00000 0.00000 0.64706 1.00000 0.00000 0.63137 1.00000 0.00000 0.61569 1.00000 0.00000 0.60000 1.00000 0.00000 0.58431 1.00000 0.00000 0.56471 1.00000 0.00000 0.54902 1.00000 0.00000 0.53333 1.00000 0.00000 0.51765 1.00000 0.00000 0.50196 1.00000 0.00000 0.48627 1.00000 0.00000 0.47059 1.00000 0.00000 0.45490 1.00000 0.00000 0.43922 1.00000 0.00000 0.41961 1.00000 0.00000 0.40392 1.00000 0.00000 0.38824 1.00000 0.00000 0.37255 1.00000 0.00000 0.35686 1.00000 0.00000 0.34118 1.00000 0.00000 0.32549 1.00000 0.00000 0.30980 1.00000 0.00000 0.29412 1.00000 0.00000 0.27451 1.00000 0.00000 0.25882 1.00000 0.00000 0.24314 1.00000 0.00000 0.22745 1.00000 0.00000 0.21176 1.00000 0.00000 0.19608 1.00000 0.00000 0.18039 1.00000 0.00000 0.16471 1.00000 0.00000 0.14902 1.00000 0.00000 0.12941 1.00000 0.00000 0.11373 1.00000 0.00000 0.09804 1.00000 0.00000 0.08235 1.00000 0.00000 0.06667 1.00000 0.00000 0.05098 1.00000 0.00000 0.03529 1.00000 0.00000 0.01961 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/idl12.lasc000066400000000000000000000324001215713201500215030ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.32941 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 0.65882 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.32941 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 0.65882 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 0.50196 0.00000 1.00000 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.86275 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.50196 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.25098 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 0.86275 0.74510 0.74510 0.86275 0.74510 0.74510 0.86275 0.74510 0.74510 0.86275 0.74510 0.74510 0.86275 0.74510 0.74510 0.86667 0.74510 0.74510 0.86667 0.74510 0.74510 0.86667 0.74510 0.74510 0.86667 0.74510 0.74510 0.86667 0.74510 0.74510 0.87059 0.74510 0.74510 0.87059 0.74510 0.74510 0.87059 0.74510 0.74510 0.87059 0.74510 0.74510 0.87059 0.74510 0.74510 0.87451 0.74510 0.74510 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 0.86275 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/idl14.lasc000066400000000000000000000324001215713201500215050ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.16471 0.00000 0.00000 0.33333 0.00000 0.00000 0.49804 0.00000 0.00000 0.66667 0.00000 0.00000 0.83137 0.00000 0.00000 1.00000 0.00000 0.00000 0.96471 0.00000 0.00000 0.92549 0.00000 0.00000 0.88627 0.00000 0.00000 0.84706 0.00000 0.00000 0.80784 0.00000 0.00000 0.77255 0.00000 0.00000 0.73333 0.00000 0.00000 0.69412 0.00000 0.00000 0.65490 0.00000 0.00000 0.61569 0.00000 0.00000 0.58039 0.00000 0.00000 0.54118 0.00000 0.00000 0.50196 0.00000 0.00000 0.46275 0.00000 0.00000 0.42353 0.00000 0.00000 0.38824 0.00000 0.00000 0.34902 0.00000 0.00000 0.30980 0.00000 0.00000 0.27059 0.00000 0.00000 0.23137 0.00000 0.00000 0.19608 0.00000 0.00000 0.15686 0.00000 0.00000 0.11765 0.00000 0.00000 0.07843 0.00000 0.00000 0.03922 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.03137 0.00000 0.00000 0.06275 0.00000 0.00000 0.09412 0.00000 0.00000 0.12549 0.00000 0.00000 0.16078 0.00000 0.00000 0.19216 0.00000 0.00000 0.22353 0.00000 0.00000 0.25490 0.00000 0.00000 0.29020 0.00000 0.00000 0.32157 0.00000 0.00000 0.35294 0.00000 0.00000 0.38431 0.00000 0.00000 0.41569 0.00000 0.00000 0.45098 0.00000 0.00000 0.48235 0.00000 0.00000 0.51373 0.00000 0.00000 0.54510 0.00000 0.00000 0.58039 0.00000 0.00000 0.61176 0.00000 0.00000 0.64314 0.00000 0.00000 0.67451 0.00000 0.00000 0.70588 0.00000 0.00000 0.74118 0.00000 0.00000 0.77255 0.00000 0.00000 0.80392 0.00000 0.00000 0.83529 0.00000 0.00000 0.87059 0.00000 0.00000 0.90196 0.00000 0.00000 0.93333 0.00000 0.00000 0.96471 0.00000 0.00000 1.00000 0.00000 0.00000 0.00000 0.02745 0.00000 0.01961 0.05882 0.00000 0.03922 0.09020 0.00000 0.05882 0.12157 0.00000 0.08235 0.15294 0.00000 0.10196 0.18431 0.00000 0.12157 0.21569 0.00000 0.14510 0.24706 0.00000 0.16471 0.27451 0.00000 0.18431 0.30588 0.00000 0.20784 0.33725 0.00000 0.22745 0.36863 0.00000 0.24706 0.40000 0.00000 0.27059 0.43137 0.00000 0.29020 0.46275 0.00000 0.30980 0.49412 0.00000 0.33333 0.52549 0.00000 0.34902 0.55686 0.00000 0.36863 0.59216 0.00000 0.38431 0.62353 0.00000 0.40392 0.65882 0.00000 0.42353 0.69020 0.00000 0.43922 0.72157 0.00000 0.45882 0.75686 0.00000 0.47451 0.78824 0.00000 0.49412 0.82353 0.00000 0.51373 0.85490 0.00000 0.52941 0.88627 0.00000 0.54902 0.92157 0.00000 0.56471 0.95294 0.00000 0.58431 0.98824 0.00000 0.60392 0.00000 0.00000 0.00000 0.00392 0.00000 0.00000 0.00784 0.00000 0.00000 0.01176 0.00000 0.00000 0.01569 0.00000 0.00000 0.01961 0.00000 0.00000 0.02353 0.00000 0.00000 0.02745 0.00000 0.00000 0.03137 0.00000 0.00000 0.03529 0.00000 0.00000 0.03922 0.00000 0.00000 0.04314 0.00000 0.00000 0.04706 0.00000 0.00000 0.05490 0.00000 0.00000 0.06275 0.00000 0.00000 0.07059 0.00000 0.00000 0.07843 0.00000 0.00000 0.09020 0.00000 0.00000 0.09804 0.00000 0.00000 0.10588 0.00000 0.00000 0.11373 0.00000 0.00000 0.12549 0.00000 0.00000 0.13333 0.00000 0.00000 0.14118 0.00000 0.00000 0.14902 0.00000 0.00000 0.16078 0.00000 0.00000 0.17255 0.00000 0.00000 0.18431 0.00000 0.00000 0.19608 0.00000 0.00000 0.20784 0.00000 0.00000 0.21961 0.00000 0.00000 0.23137 0.00000 0.00000 0.24706 0.00000 0.00000 0.25882 0.00000 0.00000 0.27059 0.00000 0.00000 0.28235 0.00000 0.00000 0.29412 0.00000 0.00000 0.30588 0.00000 0.00000 0.32157 0.00000 0.00392 0.33333 0.00000 0.00392 0.34902 0.00000 0.00392 0.36471 0.00000 0.00392 0.38039 0.00000 0.00392 0.39608 0.00000 0.00392 0.41176 0.00000 0.00392 0.42353 0.00000 0.00392 0.43922 0.00000 0.00392 0.45490 0.00000 0.00392 0.47059 0.00000 0.00392 0.48627 0.00000 0.00392 0.50196 0.00392 0.00392 0.51373 0.00392 0.00392 0.52941 0.00392 0.00392 0.54510 0.00392 0.00392 0.56078 0.00392 0.00392 0.57647 0.00392 0.00392 0.59216 0.00392 0.00392 0.60784 0.00392 0.00392 0.62353 0.00392 0.00392 0.63922 0.00392 0.00392 0.65490 0.00392 0.00392 0.67059 0.00392 0.00392 0.68627 0.00392 0.00392 0.69804 0.00392 0.00392 0.70980 0.00392 0.00392 0.72549 0.00392 0.00392 0.73725 0.00392 0.00392 0.75294 0.00392 0.00392 0.76471 0.00392 0.00392 0.77647 0.00392 0.00392 0.79216 0.00392 0.00392 0.80392 0.00392 0.00392 0.81961 0.00392 0.00392 0.83137 0.00392 0.00392 0.84706 0.00392 0.00784 0.85490 0.00392 0.00784 0.86275 0.00392 0.00784 0.87451 0.00392 0.00784 0.88235 0.00392 0.00784 0.89020 0.00392 0.00784 0.90196 0.00392 0.00784 0.90980 0.00392 0.00784 0.91765 0.00392 0.00784 0.92941 0.00392 0.00784 0.93725 0.00392 0.00784 0.94510 0.00392 0.00784 0.95686 0.00784 0.00784 0.95686 0.00784 0.00784 0.96078 0.00784 0.00784 0.96471 0.00784 0.00784 0.96863 0.00784 0.00784 0.96863 0.00784 0.00784 0.97255 0.00784 0.00784 0.97647 0.00784 0.00784 0.98039 0.00784 0.00784 0.98039 0.00784 0.00784 0.98431 0.00784 0.00784 0.98824 0.00784 0.00784 0.99216 0.00784 0.00784 0.99608 0.00392 0.00784 0.99608 0.00392 0.00784 0.99608 0.01176 0.00784 0.99608 0.01961 0.00784 0.99608 0.03137 0.00784 0.99608 0.03922 0.00784 0.99608 0.04706 0.00784 0.99608 0.05882 0.00784 0.99608 0.06667 0.00784 0.99608 0.07451 0.00784 0.99608 0.08627 0.00784 0.99608 0.09412 0.00784 0.99608 0.10196 0.00784 0.99608 0.11373 0.00784 0.99608 0.12157 0.00784 0.99608 0.12941 0.00784 0.99608 0.14118 0.00784 0.99608 0.14118 0.00784 0.99608 0.14902 0.01176 0.99608 0.15686 0.01569 0.99608 0.16471 0.01961 1.00000 0.17647 0.02745 1.00000 0.18824 0.03529 1.00000 0.20000 0.04706 1.00000 0.21176 0.05490 1.00000 0.22745 0.06667 1.00000 0.23922 0.07843 1.00000 0.25098 0.09020 1.00000 0.26275 0.10588 1.00000 0.27451 0.11765 1.00000 0.28627 0.13333 1.00000 0.30196 0.15294 1.00000 0.32157 0.17255 1.00000 0.34118 0.19216 1.00000 0.36078 0.21569 1.00000 0.37647 0.23529 1.00000 0.39216 0.25490 1.00000 0.40784 0.27843 1.00000 0.42353 0.29804 1.00000 0.44314 0.32157 1.00000 0.46667 0.34902 1.00000 0.49020 0.38039 1.00000 0.51373 0.40784 1.00000 0.54118 0.43922 1.00000 0.56471 0.47059 1.00000 0.59216 0.50196 1.00000 0.61569 0.53333 1.00000 0.64314 0.56863 1.00000 0.67059 0.60000 1.00000 0.69804 0.63529 1.00000 0.72549 0.67059 1.00000 0.75686 0.70588 1.00000 0.78431 0.74118 1.00000 0.81569 0.77647 1.00000 0.84314 0.81176 1.00000 0.87451 0.85098 1.00000 0.89804 0.87843 1.00000 0.92157 0.90980 1.00000 0.94902 0.93725 1.00000 0.97255 0.96863 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/idl15.lasc000066400000000000000000000324001215713201500215060ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.07059 0.00392 0.00392 0.14118 0.00784 0.01176 0.21176 0.01176 0.01961 0.28235 0.01569 0.02745 0.35294 0.01961 0.03529 0.42353 0.02353 0.04314 0.49804 0.02745 0.05098 0.56863 0.03137 0.05882 0.63922 0.03529 0.06667 0.70980 0.03922 0.07451 0.78039 0.04314 0.08235 0.85098 0.04706 0.09020 0.92157 0.05098 0.09804 0.99608 0.05490 0.10588 0.97647 0.05882 0.11373 0.95686 0.06275 0.12157 0.93725 0.06667 0.12941 0.91765 0.07059 0.13725 0.89804 0.07451 0.14510 0.87451 0.07843 0.15294 0.85490 0.08235 0.16078 0.83529 0.08627 0.16863 0.81569 0.09020 0.17647 0.79608 0.09412 0.18431 0.77255 0.09804 0.19216 0.75294 0.10196 0.20000 0.73333 0.10588 0.20784 0.71373 0.10980 0.21569 0.69412 0.11373 0.22353 0.67451 0.11765 0.23137 0.65098 0.12157 0.23922 0.63137 0.12549 0.24706 0.61176 0.12941 0.25490 0.59216 0.13333 0.26275 0.57255 0.13725 0.27059 0.54902 0.14118 0.27843 0.52941 0.14510 0.28627 0.50980 0.14902 0.29412 0.49020 0.15294 0.30196 0.47059 0.15686 0.30980 0.45098 0.16078 0.31765 0.42745 0.16471 0.32549 0.40784 0.16863 0.33333 0.38824 0.17255 0.34118 0.36863 0.17647 0.34902 0.34902 0.18039 0.35686 0.32549 0.18431 0.36471 0.30588 0.18824 0.37255 0.28627 0.19216 0.38039 0.26667 0.19608 0.38824 0.24706 0.20000 0.39608 0.22745 0.20392 0.40392 0.20392 0.20784 0.41176 0.18431 0.21176 0.41961 0.16471 0.21569 0.42745 0.14510 0.21961 0.43529 0.12549 0.22353 0.44314 0.10196 0.22745 0.45098 0.08235 0.23137 0.45882 0.06275 0.23529 0.46667 0.04314 0.23922 0.47451 0.02353 0.24314 0.48235 0.00000 0.24706 0.49020 0.25098 0.25098 0.49804 0.25490 0.25490 0.50588 0.25882 0.25882 0.51373 0.26275 0.26275 0.52157 0.26667 0.26667 0.52941 0.27059 0.27059 0.53725 0.27451 0.27451 0.54510 0.27843 0.27843 0.55294 0.28235 0.28235 0.56078 0.28627 0.28627 0.56863 0.29020 0.29020 0.57647 0.29412 0.29412 0.58431 0.29804 0.29804 0.59216 0.30196 0.30196 0.60000 0.30588 0.30588 0.60784 0.30980 0.30980 0.61569 0.31373 0.31373 0.62353 0.31765 0.31765 0.63137 0.32157 0.32157 0.63922 0.32549 0.32549 0.64706 0.32941 0.32941 0.65490 0.33333 0.33333 0.66275 0.33725 0.33725 0.67059 0.34118 0.34118 0.67843 0.34510 0.34510 0.68627 0.34902 0.34902 0.69412 0.35294 0.35294 0.70196 0.35686 0.35686 0.70980 0.36078 0.36078 0.71765 0.36471 0.36471 0.72549 0.36863 0.36863 0.73333 0.37255 0.37255 0.74118 0.37647 0.37647 0.74902 0.38039 0.38039 0.75686 0.38431 0.38431 0.76471 0.38824 0.38824 0.77255 0.39216 0.39216 0.78039 0.39608 0.39608 0.78824 0.40000 0.40000 0.79608 0.40392 0.40392 0.80392 0.40784 0.40784 0.81176 0.41176 0.41176 0.81961 0.41569 0.41569 0.82745 0.41961 0.41961 0.83529 0.42353 0.42353 0.84314 0.42745 0.42745 0.85098 0.43137 0.43137 0.85882 0.43529 0.43529 0.86667 0.43922 0.43922 0.87451 0.44314 0.44314 0.88235 0.44706 0.44706 0.89020 0.45098 0.45098 0.89804 0.45490 0.45490 0.90588 0.45882 0.45882 0.91373 0.46275 0.46275 0.92157 0.46667 0.46667 0.92941 0.47059 0.47059 0.93725 0.47451 0.47451 0.94510 0.47843 0.47843 0.95294 0.48235 0.48235 0.96078 0.48627 0.48627 0.96863 0.49020 0.49020 0.97647 0.49412 0.49412 0.98431 0.49804 0.49804 0.99216 0.50196 0.50196 1.00000 0.50588 0.50588 0.98431 0.50980 0.50980 0.96863 0.51373 0.51373 0.95294 0.51765 0.51765 0.93333 0.52157 0.52157 0.91765 0.52549 0.52549 0.90196 0.52941 0.52941 0.88627 0.53333 0.53333 0.86667 0.53725 0.53725 0.85098 0.54118 0.54118 0.83529 0.54510 0.54510 0.81961 0.54902 0.54902 0.80000 0.55294 0.55294 0.78431 0.55686 0.55686 0.76863 0.56078 0.56078 0.75294 0.56471 0.56471 0.73333 0.56863 0.56863 0.71765 0.57255 0.57255 0.70196 0.57647 0.57647 0.68627 0.58039 0.58039 0.66667 0.58431 0.58431 0.65098 0.58824 0.58824 0.63529 0.59216 0.59216 0.61961 0.59608 0.59608 0.60000 0.60000 0.60000 0.58431 0.60392 0.60392 0.56863 0.60784 0.60784 0.55294 0.61176 0.61176 0.53333 0.61569 0.61569 0.51765 0.61961 0.61961 0.50196 0.62353 0.62353 0.48627 0.62745 0.62745 0.46667 0.63137 0.63137 0.45098 0.63529 0.63529 0.43529 0.63922 0.63922 0.41961 0.64314 0.64314 0.40000 0.64706 0.64706 0.38431 0.65098 0.65098 0.36863 0.65490 0.65490 0.35294 0.65882 0.65882 0.33333 0.66275 0.66275 0.31765 0.66667 0.66667 0.30196 0.67059 0.67059 0.28627 0.67451 0.67451 0.26667 0.67843 0.67843 0.25098 0.68235 0.68235 0.23529 0.68627 0.68627 0.21961 0.69020 0.69020 0.20000 0.69412 0.69412 0.18431 0.69804 0.69804 0.16863 0.70196 0.70196 0.15294 0.70588 0.70588 0.13333 0.70980 0.70980 0.11765 0.71373 0.71373 0.10196 0.71765 0.71765 0.08627 0.72157 0.72157 0.06667 0.72549 0.72549 0.05098 0.72941 0.72941 0.03529 0.73333 0.73333 0.01961 0.73725 0.73725 0.00000 0.74118 0.74118 0.01176 0.74510 0.74510 0.02745 0.74902 0.74902 0.04314 0.75294 0.75294 0.05882 0.75686 0.75686 0.07451 0.76078 0.76078 0.08627 0.76471 0.76471 0.10196 0.76863 0.76863 0.11765 0.77255 0.77255 0.13333 0.77647 0.77647 0.14902 0.78039 0.78039 0.16078 0.78431 0.78431 0.17647 0.78824 0.78824 0.19216 0.79216 0.79216 0.20784 0.79608 0.79608 0.22353 0.80000 0.80000 0.23529 0.80392 0.80392 0.25098 0.80784 0.80784 0.26667 0.81176 0.81176 0.28235 0.81569 0.81569 0.29804 0.81961 0.81961 0.30980 0.82353 0.82353 0.32549 0.82745 0.82745 0.34118 0.83137 0.83137 0.35686 0.83529 0.83529 0.37255 0.83922 0.83922 0.38431 0.84314 0.84314 0.40000 0.84706 0.84706 0.41569 0.85098 0.85098 0.43137 0.85490 0.85490 0.44706 0.85882 0.85882 0.45882 0.86275 0.86275 0.47451 0.86667 0.86667 0.49020 0.87059 0.87059 0.50588 0.87451 0.87451 0.52157 0.87843 0.87843 0.53725 0.88235 0.88235 0.54902 0.88627 0.88627 0.56471 0.89020 0.89020 0.58039 0.89412 0.89412 0.59608 0.89804 0.89804 0.61176 0.90196 0.90196 0.62353 0.90588 0.90588 0.63922 0.90980 0.90980 0.65490 0.91373 0.91373 0.67059 0.91765 0.91765 0.68627 0.92157 0.92157 0.69804 0.92549 0.92549 0.71373 0.92941 0.92941 0.72941 0.93333 0.93333 0.74510 0.93725 0.93725 0.76078 0.94118 0.94118 0.77255 0.94510 0.94510 0.78824 0.94902 0.94902 0.80392 0.95294 0.95294 0.81961 0.95686 0.95686 0.83529 0.96078 0.96078 0.84706 0.96471 0.96471 0.86275 0.96863 0.96863 0.87843 0.97255 0.97255 0.89412 0.97647 0.97647 0.90980 0.98039 0.98039 0.92157 0.98431 0.98431 0.93725 0.98824 0.98824 0.95294 0.99216 0.99216 0.96863 0.99608 0.99608 0.98431 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/idl2.lasc000066400000000000000000000324001215713201500214220ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.14118 0.00000 0.00000 0.28235 0.00000 0.00000 0.29412 0.00000 0.00000 0.30980 0.00000 0.00000 0.32157 0.00000 0.00000 0.33725 0.00000 0.00000 0.35294 0.00000 0.00000 0.36471 0.00000 0.00000 0.38039 0.00000 0.00000 0.39216 0.00000 0.00000 0.40784 0.00000 0.00000 0.42353 0.00000 0.00000 0.45882 0.00000 0.00000 0.49412 0.00000 0.00000 0.52941 0.00000 0.00000 0.56471 0.00000 0.00000 0.60000 0.00000 0.00000 0.63529 0.00000 0.00000 0.67059 0.00000 0.00000 0.70588 0.00000 0.00000 0.74118 0.00000 0.00000 0.77647 0.00000 0.00000 0.81176 0.00000 0.00000 0.84706 0.00000 0.00000 0.88235 0.00000 0.00000 0.91765 0.00000 0.00000 0.95294 0.00000 0.00000 0.98824 0.00000 0.02353 0.97647 0.00000 0.04706 0.96471 0.00000 0.07059 0.95294 0.00000 0.09412 0.94118 0.00000 0.11765 0.91765 0.00000 0.14118 0.89412 0.00000 0.16471 0.87059 0.00000 0.18824 0.84706 0.00000 0.21176 0.82353 0.00000 0.23529 0.80000 0.00000 0.25882 0.77647 0.00000 0.28235 0.75294 0.00000 0.30588 0.72941 0.00000 0.32941 0.70588 0.00000 0.35294 0.68235 0.00000 0.37647 0.65882 0.00000 0.40000 0.63529 0.00000 0.42353 0.61176 0.00000 0.44706 0.58824 0.00000 0.47059 0.56471 0.00000 0.49412 0.54118 0.00000 0.51765 0.51765 0.00000 0.54118 0.49412 0.00000 0.56471 0.47059 0.00000 0.58824 0.44706 0.00000 0.61176 0.42353 0.00000 0.63529 0.40000 0.00000 0.65882 0.37647 0.00000 0.68235 0.35294 0.00000 0.70588 0.32941 0.00000 0.72941 0.30588 0.00000 0.75294 0.28235 0.00000 0.77647 0.25882 0.00000 0.80000 0.23529 0.00000 0.82353 0.21176 0.00000 0.84706 0.18824 0.00000 0.87059 0.16471 0.00000 0.89412 0.14118 0.00000 0.91765 0.11765 0.00000 0.94118 0.09412 0.00000 0.95294 0.07059 0.00000 0.96471 0.04706 0.00000 0.97647 0.02353 0.00000 0.98824 0.00000 0.00000 0.98824 0.00000 0.00000 0.98824 0.00000 0.00000 0.98824 0.00000 0.00000 0.98824 0.00000 0.00392 0.98431 0.00000 0.01176 0.98039 0.00000 0.01961 0.97647 0.00000 0.02745 0.97255 0.00000 0.03529 0.97255 0.00000 0.03922 0.97255 0.00000 0.04706 0.97255 0.00000 0.05490 0.97255 0.00000 0.06275 0.96863 0.00000 0.07059 0.96471 0.00000 0.07843 0.96078 0.00000 0.08627 0.95686 0.00000 0.09804 0.95294 0.00000 0.10588 0.94902 0.00000 0.11373 0.94510 0.00000 0.12157 0.94118 0.00000 0.13333 0.94118 0.00000 0.13725 0.93725 0.00000 0.14510 0.93333 0.00000 0.15294 0.92941 0.00000 0.16078 0.92549 0.00000 0.16863 0.92549 0.00000 0.17647 0.92549 0.00000 0.18431 0.92549 0.00000 0.19608 0.92157 0.00000 0.20392 0.91765 0.00000 0.21176 0.91373 0.00000 0.21961 0.90980 0.00000 0.23137 0.90588 0.00000 0.23922 0.90196 0.00000 0.24706 0.89804 0.00000 0.25490 0.89412 0.00000 0.26275 0.89412 0.00000 0.26667 0.89412 0.00000 0.27451 0.89412 0.00000 0.28235 0.89412 0.00000 0.29020 0.89020 0.00000 0.29804 0.88627 0.00000 0.30588 0.88235 0.00000 0.31373 0.87843 0.00000 0.32549 0.87451 0.00000 0.33333 0.87059 0.00000 0.34118 0.86667 0.00000 0.34902 0.86275 0.00392 0.36078 0.85882 0.00392 0.36863 0.85490 0.00392 0.37647 0.85098 0.00392 0.38431 0.84706 0.00000 0.39608 0.84706 0.00000 0.40000 0.84706 0.00000 0.40784 0.84706 0.00000 0.41569 0.84706 0.00000 0.42353 0.84314 0.00000 0.43137 0.83922 0.00000 0.43922 0.83529 0.00000 0.44706 0.83137 0.00000 0.45490 0.82745 0.00000 0.46275 0.82353 0.00000 0.47059 0.81961 0.00000 0.47843 0.81569 0.00000 0.49020 0.81176 0.00000 0.49804 0.80784 0.00000 0.50588 0.80392 0.00000 0.51373 0.80000 0.00000 0.52549 0.80000 0.00000 0.52941 0.80000 0.00000 0.53725 0.80000 0.00000 0.54510 0.80000 0.00000 0.55294 0.79608 0.00000 0.56078 0.79216 0.00000 0.56863 0.78824 0.00000 0.57647 0.78431 0.00000 0.58824 0.78039 0.00000 0.59608 0.77647 0.00000 0.60392 0.77255 0.00000 0.61176 0.76863 0.00000 0.62353 0.76863 0.00000 0.62745 0.76863 0.00000 0.63529 0.76863 0.00000 0.63922 0.76863 0.00000 0.64706 0.76471 0.00000 0.65490 0.76078 0.00000 0.66275 0.75686 0.00000 0.67059 0.75294 0.00000 0.68235 0.74902 0.00000 0.69020 0.74510 0.00000 0.69804 0.74118 0.00000 0.70588 0.73725 0.00000 0.71765 0.73333 0.00000 0.72549 0.72941 0.00000 0.73333 0.72549 0.00000 0.74118 0.72157 0.00000 0.75294 0.72157 0.00000 0.75686 0.72157 0.00000 0.76471 0.72157 0.00000 0.77255 0.72157 0.00000 0.78039 0.71765 0.00000 0.78824 0.71373 0.00000 0.79608 0.70980 0.00000 0.80392 0.70588 0.00000 0.81569 0.70196 0.00000 0.82353 0.69804 0.00000 0.83137 0.69412 0.00000 0.83922 0.69020 0.00000 0.84706 0.69020 0.00000 0.85098 0.69020 0.00000 0.85882 0.69020 0.00000 0.86667 0.69020 0.00000 0.87451 0.68627 0.00000 0.88235 0.68235 0.00000 0.89020 0.67843 0.00000 0.89804 0.67451 0.00000 0.90980 0.67059 0.00000 0.91765 0.66667 0.00000 0.92549 0.66275 0.00000 0.93333 0.65882 0.00000 0.94510 0.65490 0.00000 0.95294 0.65098 0.00000 0.96078 0.64706 0.00000 0.96863 0.64314 0.00000 0.98039 0.64314 0.00000 0.98431 0.64314 0.00000 0.98824 0.64314 0.00000 0.99216 0.64314 0.00000 1.00000 0.63922 0.00000 1.00000 0.63529 0.00000 1.00000 0.63137 0.00000 1.00000 0.62745 0.00000 1.00000 0.62353 0.00000 1.00000 0.61961 0.00000 1.00000 0.61569 0.00000 1.00000 0.61176 0.00000 1.00000 0.60784 0.00000 1.00000 0.60392 0.00000 1.00000 0.60000 0.00000 1.00000 0.59608 0.00000 1.00000 0.59608 0.00000 1.00000 0.59608 0.00000 1.00000 0.59608 0.00000 1.00000 0.59608 0.00000 1.00000 0.59216 0.00000 1.00000 0.58824 0.00000 1.00000 0.58431 0.00000 1.00000 0.58039 0.00000 1.00000 0.59216 0.03137 1.00000 0.60392 0.06275 1.00000 0.61569 0.09412 1.00000 0.62745 0.12549 1.00000 0.63922 0.15686 1.00000 0.65098 0.18824 1.00000 0.66275 0.21961 1.00000 0.67451 0.25098 1.00000 0.69020 0.28235 1.00000 0.70588 0.31373 1.00000 0.72157 0.34510 1.00000 0.73725 0.37647 1.00000 0.74902 0.40784 1.00000 0.76078 0.43922 1.00000 0.77255 0.47059 1.00000 0.78431 0.50196 1.00000 0.79608 0.52941 1.00000 0.80784 0.55686 1.00000 0.81961 0.58431 1.00000 0.83137 0.61176 1.00000 0.84314 0.64314 1.00000 0.85490 0.67451 1.00000 0.86667 0.70588 1.00000 0.87843 0.73725 1.00000 0.89412 0.76863 1.00000 0.90980 0.80000 1.00000 0.92549 0.83137 1.00000 0.94118 0.86275 1.00000 0.95294 0.89412 1.00000 0.96471 0.92549 1.00000 0.97647 0.95686 1.00000 0.98824 0.98824 1.00000 0.99216 0.99216 1.00000 0.99608 0.99608 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/idl4.lasc000066400000000000000000000324001215713201500214240ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00784 0.00000 0.00000 0.01569 0.00000 0.00000 0.02353 0.00000 0.00000 0.03137 0.00000 0.00000 0.03922 0.00000 0.00000 0.04706 0.00000 0.00000 0.05490 0.00000 0.00000 0.06275 0.00000 0.00000 0.07059 0.00000 0.00000 0.07843 0.00000 0.00000 0.08627 0.00000 0.00000 0.09804 0.00000 0.00000 0.10588 0.00000 0.00000 0.11373 0.00000 0.00000 0.12157 0.00000 0.00000 0.12941 0.00000 0.00000 0.13725 0.00000 0.00000 0.14510 0.00000 0.00000 0.15294 0.00000 0.00000 0.16078 0.00000 0.00000 0.16863 0.00000 0.00000 0.17647 0.00000 0.00000 0.18431 0.00000 0.00000 0.19608 0.00000 0.00000 0.20392 0.00000 0.00000 0.21176 0.00000 0.00000 0.21961 0.00000 0.00000 0.22745 0.00000 0.00000 0.23529 0.00000 0.00000 0.24314 0.00000 0.00000 0.25098 0.00000 0.00000 0.25882 0.00000 0.01176 0.26667 0.00000 0.02353 0.27451 0.00000 0.03529 0.28235 0.00000 0.04706 0.29412 0.00000 0.05882 0.30196 0.00000 0.07059 0.30980 0.00000 0.08235 0.31765 0.00000 0.09804 0.32549 0.00000 0.10980 0.33333 0.00000 0.12157 0.34118 0.00000 0.13333 0.34902 0.00000 0.14510 0.35686 0.00000 0.15686 0.36471 0.00000 0.16863 0.37255 0.00000 0.18039 0.38039 0.00000 0.19608 0.39216 0.00000 0.20784 0.39216 0.00000 0.21961 0.39216 0.00000 0.23137 0.39216 0.00000 0.24314 0.39216 0.00000 0.25490 0.39216 0.00000 0.26667 0.39216 0.00000 0.27843 0.39216 0.00000 0.29412 0.39216 0.00000 0.30588 0.39216 0.00000 0.31765 0.39216 0.00000 0.32941 0.39216 0.00000 0.34118 0.39216 0.00000 0.35294 0.39216 0.00000 0.36471 0.39216 0.00000 0.37647 0.39216 0.00000 0.39216 0.39216 0.00000 0.40392 0.39216 0.00000 0.41569 0.39216 0.00000 0.42745 0.39216 0.00000 0.43922 0.39216 0.00000 0.45098 0.39216 0.00000 0.46275 0.39216 0.00000 0.47451 0.39216 0.00000 0.49020 0.39216 0.00000 0.50196 0.39216 0.00000 0.51373 0.39216 0.00000 0.52549 0.39216 0.00000 0.53725 0.39216 0.00000 0.54902 0.39216 0.00000 0.56078 0.39216 0.00000 0.57255 0.39216 0.00000 0.58824 0.39216 0.00000 0.58824 0.37647 0.00000 0.58824 0.36471 0.00000 0.58824 0.35294 0.00000 0.58824 0.34118 0.00000 0.58824 0.32941 0.00000 0.58824 0.31765 0.00000 0.58824 0.30588 0.00000 0.58824 0.29412 0.00000 0.58824 0.27843 0.00000 0.58824 0.26667 0.00000 0.58824 0.25490 0.00000 0.58824 0.24314 0.00000 0.58824 0.23137 0.00000 0.58824 0.21961 0.00000 0.58824 0.20784 0.00000 0.58824 0.19608 0.00000 0.58431 0.18039 0.00000 0.58039 0.16863 0.00000 0.58039 0.15686 0.00000 0.57647 0.14510 0.00000 0.57255 0.13333 0.00000 0.57255 0.12157 0.00000 0.56863 0.10980 0.00000 0.56863 0.09804 0.00000 0.56471 0.08235 0.00000 0.56078 0.07059 0.00000 0.56078 0.05882 0.00000 0.55686 0.04706 0.00000 0.55294 0.03529 0.00000 0.55294 0.02353 0.00000 0.54902 0.01176 0.00000 0.54902 0.00000 0.02745 0.53725 0.00000 0.05882 0.52941 0.00000 0.08627 0.51765 0.00000 0.11765 0.50980 0.00000 0.14510 0.49804 0.00000 0.17647 0.49020 0.00000 0.20392 0.47843 0.00000 0.23529 0.47059 0.00000 0.26275 0.45882 0.00000 0.29412 0.45098 0.00000 0.32157 0.43922 0.00000 0.35294 0.43137 0.00000 0.38039 0.41961 0.00000 0.41176 0.41176 0.00000 0.43922 0.40000 0.00000 0.47059 0.39216 0.00000 0.49020 0.36471 0.00000 0.50980 0.34118 0.00000 0.52941 0.31765 0.00000 0.54902 0.29412 0.00000 0.56863 0.26667 0.00000 0.58824 0.24314 0.00000 0.60784 0.21961 0.00000 0.62745 0.19608 0.00000 0.64706 0.16863 0.00000 0.66667 0.14510 0.00000 0.68627 0.12157 0.00000 0.70588 0.09804 0.00000 0.72549 0.07059 0.00000 0.74510 0.04706 0.00000 0.76471 0.02353 0.00000 0.78431 0.00000 0.00000 0.78431 0.00784 0.00000 0.78824 0.01569 0.00000 0.78824 0.02353 0.00000 0.79216 0.03529 0.00000 0.79216 0.04314 0.00000 0.79608 0.05098 0.00000 0.79608 0.06275 0.00000 0.80000 0.07059 0.00000 0.80000 0.07843 0.00000 0.80392 0.09020 0.00000 0.80392 0.09804 0.00000 0.80784 0.10588 0.00000 0.80784 0.11373 0.00000 0.81176 0.12549 0.00000 0.81176 0.13333 0.00000 0.81569 0.14118 0.00000 0.81569 0.15294 0.00000 0.81961 0.16078 0.00000 0.81961 0.16863 0.00000 0.82353 0.18039 0.00000 0.82353 0.18824 0.00000 0.82745 0.19608 0.00000 0.82745 0.20784 0.00000 0.83137 0.21569 0.00000 0.83137 0.22353 0.00000 0.83529 0.23137 0.00000 0.83529 0.24314 0.00000 0.83922 0.25098 0.00000 0.83922 0.25882 0.00000 0.84314 0.27059 0.00000 0.84314 0.27843 0.00000 0.84706 0.28627 0.00000 0.84706 0.29804 0.00000 0.85098 0.30588 0.00000 0.85098 0.31373 0.00000 0.85490 0.32549 0.00000 0.85490 0.33333 0.00000 0.85882 0.34118 0.00000 0.85882 0.34902 0.00000 0.86275 0.36078 0.00000 0.86275 0.36863 0.00000 0.86667 0.37647 0.00000 0.86667 0.38824 0.00000 0.87059 0.39608 0.00000 0.87059 0.40392 0.00000 0.87451 0.41569 0.00000 0.87451 0.42353 0.00000 0.87843 0.43137 0.00000 0.87843 0.44314 0.00000 0.88235 0.45098 0.00000 0.88235 0.45882 0.00000 0.88627 0.46667 0.00000 0.88627 0.47843 0.00000 0.89020 0.48627 0.00000 0.89020 0.49412 0.00000 0.89412 0.50588 0.00000 0.89412 0.51373 0.00000 0.89804 0.52157 0.00000 0.89804 0.53333 0.00000 0.90196 0.54118 0.00000 0.90196 0.54902 0.00000 0.90588 0.55686 0.00000 0.90588 0.56863 0.00000 0.90980 0.57647 0.00000 0.90980 0.58431 0.00000 0.91373 0.59608 0.00000 0.91373 0.60392 0.00000 0.91765 0.61176 0.00000 0.91765 0.62353 0.00000 0.92157 0.63137 0.00000 0.92157 0.63922 0.00000 0.92549 0.65098 0.00000 0.92549 0.65882 0.00000 0.92941 0.66667 0.00000 0.92941 0.67451 0.00000 0.93333 0.68627 0.00000 0.93333 0.69412 0.00000 0.93725 0.70196 0.00000 0.93725 0.71373 0.00000 0.94118 0.72157 0.00000 0.94118 0.72941 0.00000 0.94510 0.74118 0.00000 0.94510 0.74902 0.00000 0.94902 0.75686 0.00000 0.94902 0.76863 0.00000 0.95294 0.77647 0.00000 0.95294 0.78431 0.00000 0.95686 0.79216 0.00000 0.95686 0.80392 0.00000 0.96078 0.81176 0.00000 0.96078 0.81961 0.00000 0.96471 0.83137 0.00000 0.96471 0.83922 0.00000 0.96863 0.84706 0.00000 0.96863 0.85882 0.00000 0.97255 0.86667 0.00000 0.97255 0.87451 0.00000 0.97647 0.88627 0.00000 0.97647 0.89412 0.00000 0.98039 0.90196 0.00000 0.98039 0.90980 0.00000 0.98431 0.92157 0.00000 0.98431 0.92941 0.00000 0.98824 0.93725 0.00000 0.98824 0.94902 0.00000 0.99216 0.95686 0.00000 0.99216 0.96471 0.00000 0.99608 0.97647 0.00000 0.99608 0.98431 0.00000 1.00000 0.99216 0.00000 1.00000 1.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/idl5.lasc000066400000000000000000000324001215713201500214250ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.01961 0.00000 0.00000 0.03922 0.00000 0.00000 0.05882 0.00000 0.00000 0.07843 0.00000 0.00000 0.10196 0.00000 0.00000 0.12157 0.00000 0.00000 0.14118 0.00000 0.00000 0.16078 0.00000 0.00000 0.18039 0.00000 0.00000 0.20392 0.00000 0.00000 0.22353 0.00000 0.00000 0.24314 0.00000 0.00000 0.26275 0.00000 0.00000 0.28235 0.00000 0.00000 0.30588 0.00000 0.00000 0.32549 0.00000 0.00000 0.34510 0.00000 0.00000 0.36471 0.00000 0.00000 0.38431 0.00000 0.00000 0.40784 0.00000 0.00000 0.42745 0.00000 0.00000 0.44706 0.00000 0.00000 0.46667 0.00000 0.00000 0.48627 0.00000 0.00000 0.50980 0.00000 0.00000 0.52941 0.00000 0.00000 0.54902 0.00000 0.00000 0.56863 0.00000 0.00000 0.58824 0.00000 0.00000 0.61176 0.00000 0.00000 0.63137 0.00000 0.00000 0.65098 0.00000 0.00000 0.67059 0.00000 0.00000 0.69020 0.00000 0.00000 0.71373 0.00000 0.00000 0.73333 0.00000 0.00000 0.75294 0.00000 0.00000 0.77255 0.00000 0.00000 0.79216 0.00000 0.00000 0.81569 0.00000 0.00000 0.83529 0.00000 0.00000 0.85490 0.00000 0.00000 0.87451 0.00000 0.00000 0.89412 0.00000 0.00000 0.91765 0.00000 0.00000 0.93725 0.00000 0.00000 0.95686 0.01569 0.00000 0.97647 0.03529 0.00000 1.00000 0.05490 0.00000 0.98039 0.07451 0.00000 0.96078 0.09020 0.00000 0.93725 0.10980 0.00000 0.91765 0.12941 0.00000 0.89412 0.14902 0.00000 0.87451 0.16471 0.00000 0.85490 0.18431 0.00000 0.83137 0.20392 0.00000 0.81176 0.22353 0.00000 0.78824 0.23922 0.00000 0.76863 0.25882 0.00000 0.74510 0.27843 0.00000 0.72549 0.29804 0.00000 0.70588 0.31765 0.00000 0.68235 0.31765 0.00000 0.66275 0.31765 0.00000 0.63922 0.31765 0.00000 0.61961 0.31765 0.00000 0.59608 0.31765 0.00000 0.57647 0.31765 0.00000 0.55686 0.31765 0.00000 0.53333 0.31373 0.00000 0.51373 0.31373 0.00000 0.49020 0.31373 0.00000 0.47059 0.31373 0.00000 0.44706 0.31373 0.00000 0.42745 0.31373 0.00000 0.40784 0.31373 0.00000 0.38431 0.30980 0.00000 0.36471 0.32941 0.00000 0.34118 0.34902 0.00000 0.32157 0.36863 0.00000 0.29804 0.38824 0.00000 0.27843 0.40784 0.00000 0.25882 0.42745 0.00000 0.23529 0.44706 0.00000 0.21569 0.46667 0.00000 0.19216 0.48627 0.00000 0.17255 0.50588 0.00000 0.14902 0.52549 0.00000 0.12941 0.54510 0.00000 0.10980 0.56471 0.00000 0.08627 0.58431 0.00000 0.06667 0.60392 0.00000 0.04314 0.62353 0.00000 0.02353 0.64314 0.00000 0.00000 0.66275 0.00000 0.00000 0.68235 0.00000 0.00000 0.70588 0.00000 0.00000 0.72549 0.00000 0.00000 0.74510 0.00000 0.00000 0.76863 0.00000 0.00000 0.78824 0.00000 0.00000 0.80784 0.00000 0.00000 0.83137 0.00000 0.00000 0.85098 0.00000 0.00000 0.87059 0.00000 0.00000 0.89412 0.00000 0.00000 0.91373 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.01961 0.00000 1.00000 0.03922 0.00000 1.00000 0.06275 0.00000 1.00000 0.08235 0.00000 1.00000 0.10588 0.00000 1.00000 0.12549 0.00000 1.00000 0.14510 0.00000 1.00000 0.16863 0.00000 1.00000 0.18824 0.00000 1.00000 0.21176 0.00000 1.00000 0.23137 0.00000 1.00000 0.25098 0.00000 1.00000 0.27451 0.00000 1.00000 0.29412 0.00000 1.00000 0.31765 0.00000 1.00000 0.33333 0.01569 1.00000 0.35294 0.03529 1.00000 0.37255 0.05490 1.00000 0.39216 0.07451 1.00000 0.41176 0.09412 1.00000 0.42745 0.10980 1.00000 0.44706 0.12941 1.00000 0.46667 0.14902 1.00000 0.48627 0.16863 1.00000 0.50588 0.18824 1.00000 0.52549 0.20784 1.00000 0.54118 0.22353 1.00000 0.56078 0.24314 1.00000 0.58039 0.26275 1.00000 0.60000 0.28235 1.00000 0.61961 0.30196 1.00000 0.63922 0.32157 1.00000 0.63922 0.30196 1.00000 0.63922 0.27843 1.00000 0.63922 0.25490 1.00000 0.63922 0.23137 1.00000 0.63922 0.20784 1.00000 0.63922 0.18431 1.00000 0.63922 0.16078 1.00000 0.63922 0.14118 1.00000 0.63922 0.11765 1.00000 0.63922 0.09412 1.00000 0.63922 0.07059 1.00000 0.63922 0.04706 1.00000 0.63922 0.02353 1.00000 0.63922 0.00000 1.00000 0.63922 0.00000 1.00000 0.63922 0.00000 1.00000 0.63922 0.00000 0.97255 0.63922 0.00000 0.94118 0.63922 0.00000 0.90980 0.63922 0.00000 0.88235 0.63922 0.00000 0.85098 0.63922 0.00000 0.81961 0.63922 0.00000 0.79216 0.63922 0.00000 0.76078 0.63922 0.00000 0.72941 0.63922 0.00000 0.70196 0.63922 0.00000 0.67059 0.63922 0.00000 0.63922 0.63922 0.00000 0.65882 0.63922 0.00000 0.67843 0.63922 0.00000 0.69804 0.66275 0.01176 0.71765 0.68627 0.02353 0.73725 0.70980 0.03529 0.75686 0.73333 0.04706 0.77647 0.75686 0.06275 0.79608 0.78039 0.07451 0.81961 0.80392 0.08627 0.83922 0.83137 0.09804 0.85882 0.85490 0.11373 0.87843 0.87843 0.12549 0.89804 0.90196 0.13725 0.91765 0.92549 0.14902 0.93725 0.94902 0.16078 0.95686 0.97255 0.17647 0.97647 1.00000 0.18824 1.00000 1.00000 0.20000 1.00000 1.00000 0.21176 1.00000 1.00000 0.22745 1.00000 1.00000 0.23922 1.00000 1.00000 0.25098 1.00000 1.00000 0.26275 1.00000 1.00000 0.27843 1.00000 1.00000 0.29020 1.00000 1.00000 0.30196 1.00000 1.00000 0.31373 1.00000 1.00000 0.32549 1.00000 1.00000 0.34118 1.00000 1.00000 0.35294 1.00000 1.00000 0.36471 1.00000 1.00000 0.37647 1.00000 1.00000 0.39216 1.00000 1.00000 0.40392 1.00000 1.00000 0.41569 1.00000 1.00000 0.42745 1.00000 1.00000 0.43922 1.00000 1.00000 0.45490 1.00000 1.00000 0.46667 1.00000 1.00000 0.47843 1.00000 1.00000 0.49020 1.00000 1.00000 0.50588 1.00000 1.00000 0.51765 1.00000 1.00000 0.52941 1.00000 1.00000 0.54118 1.00000 1.00000 0.55686 1.00000 1.00000 0.56863 1.00000 1.00000 0.58039 1.00000 1.00000 0.59216 1.00000 1.00000 0.60392 1.00000 1.00000 0.61961 1.00000 1.00000 0.63137 1.00000 1.00000 0.64314 1.00000 1.00000 0.65490 1.00000 1.00000 0.67059 1.00000 1.00000 0.68235 1.00000 1.00000 0.69412 1.00000 1.00000 0.70588 1.00000 1.00000 0.71765 1.00000 1.00000 0.73333 1.00000 1.00000 0.74510 1.00000 1.00000 0.75686 1.00000 1.00000 0.76863 1.00000 1.00000 0.78431 1.00000 1.00000 0.79608 1.00000 1.00000 0.80784 1.00000 1.00000 0.81961 1.00000 1.00000 0.83529 1.00000 1.00000 0.84706 1.00000 1.00000 0.85882 1.00000 1.00000 0.87059 1.00000 1.00000 0.88235 1.00000 1.00000 0.89804 1.00000 1.00000 0.90980 1.00000 1.00000 0.92157 1.00000 1.00000 0.93333 1.00000 1.00000 0.94902 1.00000 1.00000 0.96078 1.00000 1.00000 0.97255 1.00000 1.00000 0.98431 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/idl6.lasc000066400000000000000000000324001215713201500214260ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.01176 0.00000 0.00000 0.02745 0.00000 0.00000 0.04314 0.00000 0.00000 0.05882 0.00000 0.00000 0.07451 0.00000 0.00000 0.08627 0.00000 0.00000 0.10196 0.00000 0.00000 0.11765 0.00000 0.00000 0.13333 0.00000 0.00000 0.14902 0.00000 0.00000 0.16078 0.00000 0.00000 0.17647 0.00000 0.00000 0.19216 0.00000 0.00000 0.20784 0.00000 0.00000 0.22353 0.00000 0.00000 0.23529 0.00000 0.00000 0.25098 0.00000 0.00000 0.26667 0.00000 0.00000 0.28235 0.00000 0.00000 0.29804 0.00000 0.00000 0.30980 0.00000 0.00000 0.32549 0.00000 0.00000 0.34118 0.00000 0.00000 0.35686 0.00000 0.00000 0.37255 0.00000 0.00000 0.38431 0.00000 0.00000 0.40000 0.00000 0.00000 0.41569 0.00000 0.00000 0.43137 0.00000 0.00000 0.44706 0.00000 0.00000 0.45882 0.00000 0.00000 0.47451 0.00000 0.00000 0.49020 0.00000 0.00000 0.50588 0.00000 0.00000 0.52157 0.00000 0.00000 0.53725 0.00000 0.00000 0.54902 0.00000 0.00000 0.56471 0.00000 0.00000 0.58039 0.00000 0.00000 0.59608 0.00000 0.00000 0.61176 0.00000 0.00000 0.62353 0.00000 0.00000 0.63922 0.00000 0.00000 0.65490 0.00000 0.00000 0.67059 0.00000 0.00000 0.68627 0.00000 0.00000 0.69804 0.00000 0.00000 0.71373 0.00000 0.00000 0.72941 0.00000 0.00000 0.74510 0.00000 0.00000 0.76078 0.00000 0.00000 0.77255 0.00000 0.00000 0.78824 0.00000 0.00000 0.80392 0.00000 0.00000 0.81961 0.00000 0.00000 0.83529 0.00000 0.00000 0.84706 0.00000 0.00000 0.86275 0.00000 0.00000 0.87843 0.00000 0.00000 0.89412 0.00000 0.00000 0.90980 0.00000 0.00000 0.92157 0.00000 0.00000 0.93725 0.00000 0.00000 0.95294 0.00000 0.00000 0.96863 0.01176 0.00000 0.98431 0.02745 0.00000 1.00000 0.04314 0.00000 0.98431 0.05882 0.00000 0.96863 0.07451 0.00000 0.95294 0.09020 0.00000 0.93725 0.10588 0.00000 0.92157 0.12157 0.00000 0.90196 0.13725 0.00000 0.88627 0.15294 0.00000 0.87059 0.16863 0.00000 0.85490 0.18431 0.00000 0.83922 0.20000 0.00000 0.82353 0.21569 0.00000 0.80392 0.23137 0.00000 0.78824 0.24706 0.00000 0.77255 0.26275 0.00000 0.75686 0.27843 0.00000 0.74118 0.29412 0.00000 0.72157 0.30980 0.00000 0.70588 0.32549 0.00000 0.69020 0.34118 0.00000 0.67451 0.35686 0.00000 0.65882 0.37255 0.00000 0.64314 0.38824 0.00000 0.62353 0.40392 0.00000 0.60784 0.41961 0.00000 0.59216 0.43529 0.00000 0.57647 0.45098 0.00000 0.56078 0.46667 0.00000 0.54118 0.48235 0.00000 0.52549 0.49804 0.00000 0.50980 0.51373 0.00000 0.49412 0.52941 0.00000 0.47843 0.54510 0.00000 0.46275 0.56078 0.00000 0.44314 0.57647 0.00000 0.42745 0.59216 0.00000 0.41176 0.60784 0.00000 0.39608 0.62353 0.00000 0.38039 0.63922 0.00000 0.36078 0.65490 0.00000 0.34510 0.67059 0.00000 0.32941 0.68627 0.00000 0.31373 0.70196 0.00000 0.29804 0.71765 0.00000 0.28235 0.73333 0.00000 0.26275 0.74902 0.00000 0.24706 0.76471 0.00000 0.23137 0.78039 0.00000 0.21569 0.79608 0.00000 0.20000 0.81176 0.00000 0.18039 0.82745 0.00000 0.16471 0.84314 0.00000 0.14902 0.85882 0.00000 0.13333 0.87451 0.00000 0.11765 0.89020 0.00000 0.10196 0.90588 0.00000 0.08235 0.92157 0.00000 0.06667 0.93725 0.00000 0.05098 0.95294 0.00000 0.03529 0.96863 0.00000 0.01961 0.98431 0.01176 0.00000 1.00000 0.02745 0.00000 0.98431 0.04314 0.00000 0.96863 0.05882 0.00000 0.95294 0.07451 0.00000 0.93725 0.09020 0.00000 0.92157 0.10588 0.00000 0.90588 0.11765 0.00000 0.89020 0.13333 0.00000 0.87451 0.14902 0.00000 0.85882 0.16471 0.00000 0.84314 0.18039 0.00000 0.82745 0.19608 0.00000 0.81176 0.21176 0.00000 0.79608 0.22353 0.00000 0.78039 0.23922 0.00000 0.76471 0.25490 0.00000 0.74902 0.27059 0.00000 0.73333 0.28627 0.00000 0.71765 0.30196 0.00000 0.70196 0.31765 0.00000 0.68627 0.33333 0.00000 0.66667 0.34510 0.00000 0.65098 0.36078 0.00000 0.63529 0.37647 0.00000 0.61961 0.39216 0.00000 0.60392 0.40784 0.00000 0.58824 0.42353 0.00000 0.57255 0.43922 0.00000 0.55686 0.45098 0.00000 0.54118 0.46667 0.00000 0.52549 0.48235 0.00000 0.50980 0.49804 0.00000 0.49412 0.51373 0.00000 0.47843 0.52941 0.00000 0.46275 0.54510 0.00000 0.44706 0.55686 0.00000 0.43137 0.57255 0.00000 0.41569 0.58824 0.00000 0.40000 0.60392 0.00000 0.38431 0.61961 0.00000 0.36863 0.63529 0.00000 0.35294 0.65098 0.00000 0.33333 0.66667 0.00000 0.31765 0.67843 0.00000 0.30196 0.69412 0.00000 0.28627 0.70980 0.00000 0.27059 0.72549 0.00000 0.25490 0.74118 0.00000 0.23922 0.75686 0.00000 0.22353 0.77255 0.00000 0.20784 0.78431 0.00000 0.19216 0.80000 0.00000 0.17647 0.81569 0.00000 0.16078 0.83137 0.00000 0.14510 0.84706 0.00000 0.12941 0.86275 0.00000 0.11373 0.87843 0.00000 0.09804 0.89020 0.00000 0.08235 0.90588 0.00000 0.06667 0.92157 0.00000 0.05098 0.93725 0.00000 0.03529 0.95294 0.00000 0.01961 0.96863 0.00000 0.00000 0.98431 0.00000 0.00000 1.00000 0.00000 0.00000 0.98431 0.00000 0.00000 0.96863 0.00000 0.00000 0.95294 0.00000 0.00000 0.93725 0.00000 0.00000 0.92157 0.00000 0.00000 0.90588 0.00000 0.00000 0.89020 0.00000 0.00000 0.87451 0.00000 0.00000 0.85882 0.00000 0.00000 0.84314 0.00000 0.00000 0.82745 0.00000 0.00000 0.81176 0.00000 0.00000 0.79608 0.00000 0.00000 0.78039 0.00000 0.00000 0.76471 0.00000 0.00000 0.74902 0.00000 0.00000 0.73333 0.00000 0.00000 0.71765 0.00000 0.00000 0.70196 0.00000 0.00000 0.68627 0.00000 0.00000 0.66667 0.00000 0.00000 0.65098 0.00000 0.00000 0.63529 0.00000 0.00000 0.61961 0.00000 0.00000 0.60392 0.00000 0.00000 0.58824 0.00000 0.00000 0.57255 0.00000 0.00000 0.55686 0.00000 0.00000 0.54118 0.00000 0.00000 0.52549 0.00000 0.00000 0.50980 0.00000 0.00000 0.49412 0.00000 0.00000 0.47843 0.00000 0.00000 0.46275 0.00000 0.00000 0.44706 0.00000 0.00000 0.43137 0.00000 0.00000 0.41569 0.00000 0.00000 0.40000 0.00000 0.00000 0.38431 0.00000 0.00000 0.36863 0.00000 0.00000 0.35294 0.00000 0.00000 0.33333 0.00000 0.00000 0.31765 0.00000 0.00000 0.30196 0.00000 0.00000 0.28627 0.00000 0.00000 0.27059 0.00000 0.00000 0.25490 0.00000 0.00000 0.23922 0.00000 0.00000 0.22353 0.00000 0.00000 0.20784 0.00000 0.00000 0.19216 0.00000 0.00000 0.17647 0.00000 0.00000 0.16078 0.00000 0.00000 0.14510 0.00000 0.00000 0.12941 0.00000 0.00000 0.11373 0.00000 0.00000 0.09804 0.00000 0.00000 0.08235 0.00000 0.00000 0.06667 0.00000 0.00000 0.05098 0.00000 0.00000 0.03529 0.00000 0.00000 0.01961 0.00000 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/isophot.lasc000066400000000000000000000324001215713201500222550ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.03922 0.00000 0.00000 0.07843 0.00000 0.00000 0.11765 0.00000 0.00000 0.15686 0.00000 0.00000 0.19608 0.00000 0.00000 0.23529 0.00000 0.00000 0.27843 0.00000 0.00000 0.31765 0.00000 0.00000 0.35686 0.00000 0.00000 0.39608 0.00000 0.00000 0.43529 0.00000 0.00000 0.47451 0.00000 0.00000 0.51765 0.00000 0.00000 0.55686 0.00000 0.00000 0.59608 0.00000 0.00000 0.63529 0.00000 0.00000 0.67451 0.00000 0.00000 0.71765 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.00000 0.00000 0.87843 0.00000 0.00000 0.91765 0.00000 0.00000 0.95686 0.00000 0.00000 1.00000 0.00000 0.03137 1.00000 0.00000 0.06275 1.00000 0.00000 0.09412 1.00000 0.00000 0.12549 1.00000 0.00000 0.15686 1.00000 0.00000 0.18824 1.00000 0.00000 0.21961 1.00000 0.00000 0.25490 1.00000 0.00000 0.28627 1.00000 0.00000 0.31765 1.00000 0.00000 0.34902 1.00000 0.00000 0.38039 1.00000 0.00000 0.41176 1.00000 0.00000 0.44314 1.00000 0.00000 0.47843 1.00000 0.00000 0.49804 1.00000 0.00000 0.51765 1.00000 0.00000 0.53725 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.00000 0.61961 1.00000 0.00000 0.63922 1.00000 0.00000 0.65882 1.00000 0.00000 0.67843 1.00000 0.00000 0.70196 1.00000 0.00000 0.72157 1.00000 0.00000 0.74118 1.00000 0.00000 0.76078 1.00000 0.00000 0.78431 1.00000 0.00000 0.79608 1.00000 0.00000 0.81176 1.00000 0.00000 0.82353 1.00000 0.00000 0.83922 1.00000 0.00000 0.85490 1.00000 0.00000 0.86667 1.00000 0.00000 0.88235 1.00000 0.00000 0.89412 1.00000 0.00000 0.90980 1.00000 0.00000 0.92549 1.00000 0.00000 0.93725 1.00000 0.00000 0.95294 1.00000 0.00000 0.96863 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.00000 1.00000 0.96078 0.00000 1.00000 0.94118 0.00000 1.00000 0.92157 0.00000 1.00000 0.90196 0.00000 1.00000 0.88235 0.00000 1.00000 0.86275 0.00000 1.00000 0.84314 0.00000 1.00000 0.82353 0.00000 1.00000 0.80392 0.00000 1.00000 0.78431 0.00000 1.00000 0.76471 0.00000 1.00000 0.74510 0.00000 1.00000 0.72549 0.00000 1.00000 0.70588 0.00000 1.00000 0.65490 0.00000 1.00000 0.60784 0.00000 1.00000 0.56078 0.00000 1.00000 0.51373 0.00000 1.00000 0.46667 0.00000 1.00000 0.41961 0.00000 1.00000 0.37255 0.00000 1.00000 0.32549 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.00000 1.00000 0.13725 0.00000 1.00000 0.09020 0.00000 1.00000 0.04314 0.00000 1.00000 0.00000 0.04706 1.00000 0.00000 0.09412 1.00000 0.00000 0.14118 1.00000 0.00000 0.18824 1.00000 0.00000 0.23529 1.00000 0.00000 0.28235 1.00000 0.00000 0.32941 1.00000 0.00000 0.37647 1.00000 0.00000 0.42353 1.00000 0.00000 0.47059 1.00000 0.00000 0.51765 1.00000 0.00000 0.56471 1.00000 0.00000 0.61176 1.00000 0.00000 0.65882 1.00000 0.00000 0.70588 1.00000 0.00000 0.72549 1.00000 0.00000 0.74510 1.00000 0.00000 0.76471 1.00000 0.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.84314 1.00000 0.00000 0.86275 1.00000 0.00000 0.88235 1.00000 0.00000 0.90196 1.00000 0.00000 0.92157 1.00000 0.00000 0.94118 1.00000 0.00000 0.96078 1.00000 0.00000 0.98039 1.00000 0.00000 1.00000 1.00000 0.00000 0.99608 0.98039 0.00000 0.99608 0.96078 0.00000 0.99608 0.94118 0.00000 0.99608 0.92549 0.00000 0.99216 0.90588 0.00000 0.99216 0.88627 0.00000 0.99216 0.87059 0.00000 0.99216 0.85098 0.00000 0.98824 0.83137 0.00000 0.98824 0.81569 0.00000 0.98824 0.79608 0.00000 0.98824 0.77647 0.00000 0.98824 0.76078 0.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.98824 0.69020 0.00000 0.98824 0.67059 0.00000 0.98824 0.65490 0.00000 0.98824 0.63922 0.00000 0.98824 0.61961 0.00000 0.99216 0.60392 0.00000 0.99216 0.58824 0.00000 0.99216 0.56863 0.00000 0.99216 0.55294 0.00000 0.99608 0.53725 0.00000 0.99608 0.51765 0.00000 0.99608 0.50196 0.00000 0.99608 0.48627 0.00000 1.00000 0.47059 0.00000 1.00000 0.43529 0.00000 1.00000 0.40392 0.00000 1.00000 0.37255 0.00000 1.00000 0.34118 0.00000 1.00000 0.30980 0.00000 1.00000 0.27843 0.00000 1.00000 0.24706 0.00000 1.00000 0.21569 0.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.09020 0.00000 1.00000 0.05882 0.00000 1.00000 0.02745 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.04706 1.00000 0.00000 0.09412 1.00000 0.00000 0.14118 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.00000 0.32941 1.00000 0.00000 0.37647 1.00000 0.00000 0.42353 1.00000 0.00000 0.47059 1.00000 0.00000 0.51765 1.00000 0.00000 0.56471 1.00000 0.00000 0.61176 1.00000 0.00000 0.65882 1.00000 0.00000 0.70588 1.00000 0.00000 0.72549 1.00000 0.00000 0.74902 1.00000 0.00000 0.77255 1.00000 0.00000 0.79608 1.00000 0.00000 0.81569 1.00000 0.00000 0.83922 1.00000 0.00000 0.86275 1.00000 0.00000 0.88627 1.00000 0.00000 0.90588 1.00000 0.00000 0.92941 1.00000 0.00000 0.95294 1.00000 0.00000 0.97647 1.00000 0.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.14118 1.00000 1.00000 0.17647 1.00000 1.00000 0.21176 1.00000 1.00000 0.25098 1.00000 1.00000 0.28627 1.00000 1.00000 0.32157 1.00000 1.00000 0.36078 1.00000 1.00000 0.39608 1.00000 1.00000 0.43137 1.00000 1.00000 0.47059 1.00000 1.00000 0.48627 1.00000 1.00000 0.50588 1.00000 1.00000 0.52157 1.00000 1.00000 0.54118 1.00000 1.00000 0.56078 1.00000 1.00000 0.57647 1.00000 1.00000 0.59608 1.00000 1.00000 0.61176 1.00000 1.00000 0.63137 1.00000 1.00000 0.65098 1.00000 1.00000 0.66667 1.00000 1.00000 0.68627 1.00000 1.00000 0.70588 1.00000 1.00000 0.74510 1.00000 1.00000 0.78824 1.00000 1.00000 0.83137 1.00000 1.00000 0.87059 1.00000 1.00000 0.91373 1.00000 1.00000 0.95686 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/itt.fmt000066400000000000000000000000441215713201500212330ustar00rootroot00000000000000DEFINE/FIELD 15 26 R F12.5 :ITT END skycat-3.1.2-starlink-1b/rtd/colormaps/ittasc.prg000066400000000000000000000010771215713201500217330ustar00rootroot00000000000000! @(#)ittasc.prg 8.1.1.1 (ESO-IPG) 8/31/94 15:51:57 ! ++++++++++++++ ! ! Midas procedure ittasc.prg ! to convert Midas ITT to ASCII file which can later be used to regenerate ! that ITT via: CREATE/TABLE using itt.fmt as Format file ! ! xyz.itt -> xyz.iasc ! ! KB 910315 ! ! ++++++++++++++ ! ASSIGN/PRINT FILE itt.lis ! -COPY 'P1'.itt temp.tbl NAME/COLUMN temp :ITT F12.5 PRINT/TABLE temp :ITT ! $ sh $MIDASHOME/$MIDVERS/systab/ascii/display/ittasc.sh itt.lis 'P1'.iasc ASSIGN/PRINT T ! $ rm itt.lis $ rm temp.tbl ! WRITE/OUT table 'P1'.itt processed ... skycat-3.1.2-starlink-1b/rtd/colormaps/ittasc.sh000066400000000000000000000006541215713201500215550ustar00rootroot00000000000000# "@(#) $Id: ittasc.sh,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # @(#)ittasc.sh 8.1.1.1 (ESO-IPG) 8/31/94 15:51:58 # Bourne shell script ittasc.sh # to delete lines 1-4 and last line of ascii table file # and to remove 1. field # sed '1,4d $d' $1 >temp.temp # # now we use awk to throw out the sequence field # awk '{ printf " %s\n", $2 }' temp.temp >temp.final # mv temp.final $2 rm temp.temp skycat-3.1.2-starlink-1b/rtd/colormaps/jigsaw.iasc000066400000000000000000000154001215713201500220520ustar00rootroot00000000000000 0.00000 0.01569 0.03137 0.04706 0.06275 0.07843 0.09412 0.10980 0.12549 0.14118 0.15686 0.17255 0.18824 0.20392 0.21961 0.23529 0.25098 0.26667 0.28235 0.29804 0.31373 0.33333 0.34902 0.36471 0.38039 0.39608 0.41176 0.42745 0.44314 0.45882 0.47451 0.49020 0.50588 0.52157 0.53725 0.55294 0.56863 0.58431 0.60000 0.61569 0.63137 0.64706 0.66667 0.68235 0.69804 0.71373 0.72941 0.74510 0.76078 0.77647 0.79216 0.80784 0.82353 0.83922 0.85490 0.87059 0.88627 0.90196 0.91765 0.93333 0.94902 0.96471 0.98039 0.99608 0.00000 0.01569 0.03137 0.04706 0.06275 0.07843 0.09412 0.10980 0.12549 0.14118 0.15686 0.17255 0.18824 0.20392 0.21961 0.23529 0.25098 0.26667 0.28235 0.29804 0.31373 0.33333 0.34902 0.36471 0.38039 0.39608 0.41176 0.42745 0.44314 0.45882 0.47451 0.49020 0.50588 0.52157 0.53725 0.55294 0.56863 0.58431 0.60000 0.61569 0.63137 0.64706 0.66667 0.68235 0.69804 0.71373 0.72941 0.74510 0.76078 0.77647 0.79216 0.80784 0.82353 0.83922 0.85490 0.87059 0.88627 0.90196 0.91765 0.93333 0.94902 0.96471 0.98039 0.99608 0.00000 0.01569 0.03137 0.04706 0.06275 0.07843 0.09412 0.10980 0.12549 0.14118 0.15686 0.17255 0.18824 0.20392 0.21961 0.23529 0.25098 0.26667 0.28235 0.29804 0.31373 0.33333 0.34902 0.36471 0.38039 0.39608 0.41176 0.42745 0.44314 0.45882 0.47451 0.49020 0.50588 0.52157 0.53725 0.55294 0.56863 0.58431 0.60000 0.61569 0.63137 0.64706 0.66667 0.68235 0.69804 0.71373 0.72941 0.74510 0.76078 0.77647 0.79216 0.80784 0.82353 0.83922 0.85490 0.87059 0.88627 0.90196 0.91765 0.93333 0.94902 0.96471 0.98039 0.99608 0.00000 0.01569 0.03137 0.04706 0.06275 0.07843 0.09412 0.10980 0.12549 0.14118 0.15686 0.17255 0.18824 0.20392 0.21961 0.23529 0.25098 0.26667 0.28235 0.29804 0.31373 0.33333 0.34902 0.36471 0.38039 0.39608 0.41176 0.42745 0.44314 0.45882 0.47451 0.49020 0.50588 0.52157 0.53725 0.55294 0.56863 0.58431 0.60000 0.61569 0.63137 0.64706 0.66667 0.68235 0.69804 0.71373 0.72941 0.74510 0.76078 0.77647 0.79216 0.80784 0.82353 0.83922 0.85490 0.87059 0.88627 0.90196 0.91765 0.93333 0.94902 0.96471 0.98039 0.99608 skycat-3.1.2-starlink-1b/rtd/colormaps/lasritt.iasc000066400000000000000000000154001215713201500222500ustar00rootroot00000000000000 0.05882 0.12157 0.18431 0.24706 0.30980 0.37255 0.43529 0.49804 0.56078 0.62353 0.68627 0.74902 0.81176 0.87451 0.93725 1.00000 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.12157 0.12157 0.12157 0.12157 0.12157 0.12157 0.12157 0.12157 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.24706 0.24706 0.24706 0.24706 0.24706 0.24706 0.24706 0.24706 0.30980 0.30980 0.30980 0.30980 0.30980 0.30980 0.30980 0.30980 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.43529 0.43529 0.43529 0.43529 0.43529 0.43529 0.43529 0.43529 0.49804 0.49804 0.49804 0.49804 0.49804 0.49804 0.49804 0.49804 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.62353 0.62353 0.62353 0.62353 0.62353 0.62353 0.62353 0.62353 0.68627 0.68627 0.68627 0.68627 0.68627 0.68627 0.68627 0.68627 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.81176 0.81176 0.81176 0.81176 0.81176 0.81176 0.81176 0.81176 0.87451 0.87451 0.87451 0.87451 0.87451 0.87451 0.87451 0.87451 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.12157 0.12157 0.12157 0.12157 0.12157 0.12157 0.12157 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.18431 0.24706 0.24706 0.24706 0.24706 0.24706 0.24706 0.24706 0.30980 0.30980 0.30980 0.30980 0.30980 0.30980 0.30980 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.37255 0.43529 0.43529 0.43529 0.43529 0.43529 0.43529 0.43529 0.49804 0.49804 0.49804 0.49804 0.49804 0.49804 0.49804 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.56078 0.62353 0.62353 0.62353 0.62353 0.62353 0.62353 0.62353 0.68627 0.68627 0.68627 0.68627 0.68627 0.68627 0.68627 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.74902 0.81176 0.81176 0.81176 0.81176 0.81176 0.81176 0.81176 0.87451 0.87451 0.87451 0.87451 0.87451 0.87451 0.87451 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 0.93725 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/light.lasc000066400000000000000000000324001215713201500216770ustar00rootroot00000000000000 0.00000 0.00392 0.00000 0.00000 0.00784 0.01961 0.00000 0.01176 0.05490 0.00000 0.01569 0.08627 0.00000 0.01961 0.10980 0.00000 0.02353 0.13725 0.00000 0.02745 0.15686 0.00000 0.03137 0.18039 0.00000 0.03529 0.20000 0.00000 0.03922 0.21569 0.00000 0.04314 0.23529 0.00000 0.04706 0.25098 0.00000 0.05098 0.26275 0.00000 0.05490 0.28235 0.00000 0.05882 0.29412 0.00000 0.06275 0.30588 0.00000 0.06667 0.31765 0.00000 0.07059 0.33333 0.00000 0.07451 0.34118 0.00000 0.07843 0.35294 0.00000 0.08235 0.36078 0.00000 0.08627 0.37255 0.00000 0.09020 0.38431 0.00000 0.09412 0.39216 0.00392 0.09804 0.40000 0.00784 0.10196 0.41176 0.01176 0.10588 0.41961 0.01569 0.10980 0.43137 0.01569 0.11373 0.43529 0.01961 0.11765 0.44314 0.02353 0.12157 0.45098 0.02745 0.12549 0.45882 0.02745 0.12941 0.46667 0.03137 0.13333 0.47059 0.03529 0.13725 0.48235 0.04314 0.14118 0.48627 0.04706 0.14510 0.49412 0.05098 0.14902 0.50196 0.05882 0.15294 0.50588 0.06667 0.15686 0.50980 0.07451 0.16078 0.51765 0.08235 0.16471 0.52157 0.09020 0.16863 0.53333 0.09804 0.17255 0.53725 0.10588 0.17647 0.54118 0.11765 0.18039 0.54902 0.12941 0.18431 0.55294 0.14118 0.18824 0.55686 0.15294 0.19216 0.56078 0.16471 0.19608 0.56471 0.18039 0.20000 0.57255 0.18824 0.20392 0.58039 0.20000 0.20784 0.58431 0.21569 0.21176 0.58824 0.23137 0.21569 0.59216 0.24706 0.21961 0.59608 0.26275 0.22353 0.60000 0.27843 0.22745 0.60392 0.29412 0.23137 0.60784 0.30980 0.23529 0.61176 0.32941 0.23922 0.61569 0.34902 0.24314 0.61961 0.36863 0.24706 0.62745 0.38431 0.25098 0.63137 0.40392 0.25490 0.63529 0.41569 0.25882 0.63922 0.43529 0.26275 0.64314 0.45490 0.26667 0.64706 0.47059 0.27059 0.65098 0.48627 0.27451 0.65490 0.50196 0.27843 0.65490 0.51765 0.28235 0.65882 0.52941 0.28627 0.66275 0.54902 0.29020 0.66667 0.56471 0.29412 0.67059 0.58039 0.29804 0.67843 0.59216 0.30196 0.67843 0.60392 0.30588 0.68235 0.61961 0.30980 0.68627 0.63137 0.31373 0.69020 0.63922 0.31765 0.69020 0.65098 0.32157 0.69412 0.65882 0.32549 0.69804 0.67059 0.32941 0.70196 0.67843 0.33333 0.70196 0.69020 0.33725 0.70588 0.69804 0.34118 0.70980 0.70588 0.34510 0.71373 0.71373 0.34902 0.71373 0.72157 0.35294 0.71765 0.72941 0.35686 0.72157 0.73725 0.36078 0.72157 0.74510 0.36471 0.72941 0.75294 0.36863 0.73333 0.76078 0.37255 0.73333 0.76863 0.37647 0.73725 0.77647 0.38039 0.74118 0.78039 0.38431 0.74118 0.78824 0.38824 0.74510 0.79608 0.39216 0.74510 0.80392 0.39608 0.74902 0.80784 0.40000 0.75294 0.81176 0.40392 0.75294 0.81961 0.40784 0.75686 0.82353 0.41176 0.76078 0.82745 0.41569 0.76078 0.83529 0.41961 0.76471 0.83922 0.42353 0.76471 0.84314 0.42745 0.76863 0.84706 0.43137 0.76863 0.85098 0.43529 0.77255 0.85490 0.43922 0.78039 0.85882 0.44314 0.78039 0.86275 0.44706 0.78431 0.86667 0.45098 0.78431 0.87059 0.45490 0.78824 0.87451 0.45882 0.78824 0.87843 0.46275 0.79216 0.88235 0.46667 0.79216 0.88627 0.47059 0.79608 0.89020 0.47451 0.79608 0.89412 0.47843 0.80000 0.89804 0.48235 0.80000 0.89804 0.48627 0.80392 0.90196 0.49020 0.80392 0.90588 0.49412 0.80784 0.90980 0.49804 0.80784 0.91373 0.50196 0.81176 0.91373 0.50588 0.81176 0.91765 0.50980 0.81569 0.92157 0.51373 0.81569 0.92157 0.51765 0.81961 0.92549 0.52157 0.81961 0.92941 0.52549 0.82745 0.92941 0.52941 0.82745 0.93333 0.53333 0.83137 0.93725 0.53725 0.83137 0.93725 0.54118 0.83529 0.93725 0.54510 0.83529 0.94118 0.54902 0.83922 0.94118 0.55294 0.83922 0.94510 0.55686 0.83922 0.94510 0.56078 0.84314 0.94902 0.56471 0.84314 0.94902 0.56863 0.84706 0.95294 0.57255 0.84706 0.95294 0.57647 0.85098 0.95294 0.58039 0.85098 0.95686 0.58431 0.85490 0.95686 0.58824 0.85490 0.96078 0.59216 0.85490 0.96078 0.59608 0.85882 0.96078 0.60000 0.85882 0.96471 0.60392 0.86275 0.96471 0.60784 0.86275 0.96471 0.61176 0.86275 0.96863 0.61569 0.86667 0.96863 0.61961 0.86667 0.97255 0.62353 0.87059 0.97255 0.62745 0.87059 0.97255 0.63137 0.87059 0.97647 0.63529 0.87843 0.97647 0.63922 0.87843 0.98039 0.64314 0.88235 0.98039 0.64706 0.88235 0.98039 0.65098 0.88235 0.98431 0.65490 0.88627 0.98431 0.65882 0.88627 0.98431 0.66275 0.89020 0.98824 0.66667 0.89020 0.98824 0.67059 0.89020 0.98824 0.67451 0.89412 0.99216 0.67843 0.89412 0.99216 0.68235 0.89412 0.99216 0.68627 0.89804 0.99216 0.69020 0.89804 0.99216 0.69412 0.89804 0.99608 0.69804 0.90196 0.99608 0.70196 0.90196 0.99608 0.70588 0.90588 0.99608 0.70980 0.90588 0.99608 0.71373 0.90588 0.99608 0.71765 0.90980 0.99608 0.72157 0.90980 0.99608 0.72549 0.90980 0.99608 0.72941 0.91373 0.99608 0.73333 0.91373 0.99608 0.73725 0.91373 0.99608 0.74118 0.91765 0.99608 0.74510 0.91765 0.99608 0.74902 0.91765 0.99608 0.75294 0.92157 0.99608 0.75686 0.92157 0.99608 0.76078 0.92157 0.99608 0.76471 0.92941 0.99608 0.76863 0.92941 0.99608 0.77255 0.92941 0.99608 0.77647 0.93333 0.99608 0.78039 0.93333 0.99608 0.78431 0.93333 0.99608 0.78824 0.93725 1.00000 0.79216 0.93725 1.00000 0.79608 0.93725 1.00000 0.80000 0.94118 1.00000 0.80392 0.94118 1.00000 0.80784 0.94118 1.00000 0.81176 0.94118 1.00000 0.81569 0.94510 1.00000 0.81961 0.94510 1.00000 0.82353 0.94510 1.00000 0.82745 0.94902 1.00000 0.83137 0.94902 1.00000 0.83529 0.94902 1.00000 0.83922 0.95294 1.00000 0.84314 0.95294 1.00000 0.84706 0.95294 1.00000 0.85098 0.95686 1.00000 0.85490 0.95686 1.00000 0.85882 0.95686 1.00000 0.86275 0.95686 1.00000 0.86667 0.96078 1.00000 0.87059 0.96078 1.00000 0.87451 0.96078 1.00000 0.87843 0.96471 1.00000 0.88235 0.96471 1.00000 0.88627 0.96471 1.00000 0.89020 0.96471 1.00000 0.89412 0.96863 1.00000 0.89804 0.96863 1.00000 0.90196 0.96863 1.00000 0.90588 0.97255 1.00000 0.90980 0.97255 1.00000 0.91373 0.97255 1.00000 0.91765 0.97255 1.00000 0.92157 0.98039 1.00000 0.92549 0.98039 1.00000 0.92941 0.98039 1.00000 0.93333 0.98039 1.00000 0.93725 0.98431 1.00000 0.94118 0.98431 1.00000 0.94510 0.98431 1.00000 0.94902 0.98824 1.00000 0.95294 0.98824 1.00000 0.95686 0.98824 1.00000 0.96078 0.98824 1.00000 0.96471 0.99216 1.00000 0.96863 0.99216 1.00000 0.97255 0.99216 1.00000 0.97647 0.99216 1.00000 0.98039 0.99608 1.00000 0.98431 0.99608 1.00000 0.98824 0.99608 1.00000 0.99216 0.99608 1.00000 0.99608 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/log.iasc000066400000000000000000000154001215713201500213470ustar00rootroot00000000000000 0.00000 0.01961 0.05490 0.08627 0.10980 0.13725 0.15686 0.18039 0.20000 0.21569 0.23529 0.25098 0.26275 0.28235 0.29412 0.30588 0.31765 0.33333 0.34118 0.35294 0.36078 0.37255 0.38431 0.39216 0.40000 0.41176 0.41961 0.43137 0.43529 0.44314 0.45098 0.45882 0.46667 0.47059 0.48235 0.48627 0.49412 0.50196 0.50588 0.50980 0.51765 0.52157 0.53333 0.53725 0.54118 0.54902 0.55294 0.55686 0.56078 0.56471 0.57255 0.58039 0.58431 0.58824 0.59216 0.59608 0.60000 0.60392 0.60784 0.61176 0.61569 0.61961 0.62745 0.63137 0.63529 0.63922 0.64314 0.64706 0.65098 0.65490 0.65490 0.65882 0.66275 0.66667 0.67059 0.67843 0.67843 0.68235 0.68627 0.69020 0.69020 0.69412 0.69804 0.70196 0.70196 0.70588 0.70980 0.71373 0.71373 0.71765 0.72157 0.72157 0.72941 0.73333 0.73333 0.73725 0.74118 0.74118 0.74510 0.74510 0.74902 0.75294 0.75294 0.75686 0.76078 0.76078 0.76471 0.76471 0.76863 0.76863 0.77255 0.78039 0.78039 0.78431 0.78431 0.78824 0.78824 0.79216 0.79216 0.79608 0.79608 0.80000 0.80000 0.80392 0.80392 0.80784 0.80784 0.81176 0.81176 0.81569 0.81569 0.81961 0.81961 0.82745 0.82745 0.83137 0.83137 0.83529 0.83529 0.83922 0.83922 0.83922 0.84314 0.84314 0.84706 0.84706 0.85098 0.85098 0.85490 0.85490 0.85490 0.85882 0.85882 0.86275 0.86275 0.86275 0.86667 0.86667 0.87059 0.87059 0.87059 0.87843 0.87843 0.88235 0.88235 0.88235 0.88627 0.88627 0.89020 0.89020 0.89020 0.89412 0.89412 0.89412 0.89804 0.89804 0.89804 0.90196 0.90196 0.90588 0.90588 0.90588 0.90980 0.90980 0.90980 0.91373 0.91373 0.91373 0.91765 0.91765 0.91765 0.92157 0.92157 0.92157 0.92941 0.92941 0.92941 0.93333 0.93333 0.93333 0.93725 0.93725 0.93725 0.94118 0.94118 0.94118 0.94118 0.94510 0.94510 0.94510 0.94902 0.94902 0.94902 0.95294 0.95294 0.95294 0.95686 0.95686 0.95686 0.95686 0.96078 0.96078 0.96078 0.96471 0.96471 0.96471 0.96471 0.96863 0.96863 0.96863 0.97255 0.97255 0.97255 0.97255 0.98039 0.98039 0.98039 0.98039 0.98431 0.98431 0.98431 0.98824 0.98824 0.98824 0.98824 0.99216 0.99216 0.99216 0.99216 0.99608 0.99608 0.99608 0.99608 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/lut.fmt000066400000000000000000000001471215713201500212430ustar00rootroot00000000000000DEFINE/FIELD 15 26 R F12.5 :RED DEFINE/FIELD 28 39 R F12.5 :GREEN DEFINE/FIELD 41 52 R F12.5 :BLUE END skycat-3.1.2-starlink-1b/rtd/colormaps/lutasc.prg000066400000000000000000000012101215713201500217240ustar00rootroot00000000000000! @(#)lutasc.prg 8.1.1.1 (ESO-IPG) 8/31/94 15:51:21 ! ++++++++++++++ ! ! Midas procedure lutasc.prg ! to convert Midas LUT to ASCII file which can later be used to regenerate ! that LUT via: CREATE/TABLE using lut.fmt as Format file ! ! xyz.lut -> xyz.lasc ! ! KB 910315 ! ! ++++++++++++++ ! ASSIGN/PRINT FILE lut.lis ! -COPY 'P1'.lut temp.tbl NAME/COLUMN temp :RED F12.5 NAME/COLUMN temp :GREEN F12.5 NAME/COLUMN temp :BLUE F12.5 PRINT/TABLE temp :RED :GREEN :BLUE ! $ sh $MIDASHOME/$MIDVERS/systab/ascii/display/lutasc.sh lut.lis 'P1'.lasc ASSIGN/PRINT T ! $ rm lut.lis $ rm temp.tbl ! WRITE/OUT table 'P1'.lut processed ... skycat-3.1.2-starlink-1b/rtd/colormaps/lutasc.sh000066400000000000000000000006701215713201500215570ustar00rootroot00000000000000# "@(#) $Id: lutasc.sh,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # @(#)lutasc.sh 8.1.1.1 (ESO-IPG) 8/31/94 15:51:22 # Bourne shell script # to delete lines 1-4 and last line of ascii table file # and to remove 1. field # sed '1,4d $d' $1 >temp.temp # # now we use awk to throw out the sequence field # awk '{ printf " %s %s %s\n", $2, $3, $4 }' temp.temp >temp.final # mv temp.final $2 rm temp.temp skycat-3.1.2-starlink-1b/rtd/colormaps/manycol.lasc000066400000000000000000000324001215713201500222320ustar00rootroot00000000000000 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.34902 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.44706 0.78431 0.92549 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 0.00000 0.69020 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 0.69020 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.00000 0.88235 0.00000 0.72549 0.00000 0.72549 0.72549 0.00000 0.72549 skycat-3.1.2-starlink-1b/rtd/colormaps/neg.iasc000066400000000000000000000154001215713201500213370ustar00rootroot00000000000000 1.00000 0.99608 0.99216 0.98824 0.98431 0.98039 0.97647 0.97255 0.96863 0.96471 0.96078 0.95686 0.95294 0.94902 0.94510 0.94118 0.93725 0.93333 0.92941 0.92549 0.92157 0.91765 0.91373 0.90980 0.90588 0.90196 0.89804 0.89412 0.89020 0.88627 0.88235 0.87843 0.87451 0.87059 0.86667 0.86275 0.85882 0.85490 0.85098 0.84706 0.84314 0.83922 0.83529 0.83137 0.82745 0.82353 0.81961 0.81569 0.81176 0.80784 0.80392 0.80000 0.79608 0.79216 0.78824 0.78431 0.78039 0.77647 0.77255 0.76863 0.76471 0.76078 0.75686 0.75294 0.74902 0.74510 0.74118 0.73725 0.73333 0.72941 0.72549 0.72157 0.71765 0.71373 0.70980 0.70588 0.70196 0.69804 0.69412 0.69020 0.68627 0.68235 0.67843 0.67451 0.67059 0.66667 0.66275 0.65882 0.65490 0.65098 0.64706 0.64314 0.63922 0.63529 0.63137 0.62745 0.62353 0.61961 0.61569 0.61176 0.60784 0.60392 0.60000 0.59608 0.59216 0.58824 0.58431 0.58039 0.57647 0.57255 0.56863 0.56471 0.56078 0.55686 0.55294 0.54902 0.54510 0.54118 0.53725 0.53333 0.52941 0.52549 0.52157 0.51765 0.51373 0.50980 0.50588 0.50196 0.49804 0.49412 0.49020 0.48627 0.48235 0.47843 0.47451 0.47059 0.46667 0.46275 0.45882 0.45490 0.45098 0.44706 0.44314 0.43922 0.43529 0.43137 0.42745 0.42353 0.41961 0.41569 0.41176 0.40784 0.40392 0.40000 0.39608 0.39216 0.38824 0.38431 0.38039 0.37647 0.37255 0.36863 0.36471 0.36078 0.35686 0.35294 0.34902 0.34510 0.34118 0.33725 0.33333 0.32941 0.32549 0.32157 0.31765 0.31373 0.30980 0.30588 0.30196 0.29804 0.29412 0.29020 0.28627 0.28235 0.27843 0.27451 0.27059 0.26667 0.26275 0.25882 0.25490 0.25098 0.24706 0.24314 0.23922 0.23529 0.23137 0.22745 0.22353 0.21961 0.21569 0.21176 0.20784 0.20392 0.20000 0.19608 0.19216 0.18824 0.18431 0.18039 0.17647 0.17255 0.16863 0.16471 0.16078 0.15686 0.15294 0.14902 0.14510 0.14118 0.13725 0.13333 0.12941 0.12549 0.12157 0.11765 0.11373 0.10980 0.10588 0.10196 0.09804 0.09412 0.09020 0.08627 0.08235 0.07843 0.07451 0.07059 0.06667 0.06275 0.05882 0.05490 0.05098 0.04706 0.04314 0.03922 0.03529 0.03137 0.02745 0.02353 0.01961 0.01569 0.01176 0.00784 0.00392 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/neglog.iasc000066400000000000000000000154001215713201500220410ustar00rootroot00000000000000 1.00000 0.98039 0.94510 0.91373 0.89020 0.86275 0.84314 0.81961 0.80000 0.78431 0.76471 0.74902 0.73725 0.71765 0.70588 0.69412 0.68235 0.66667 0.65882 0.64706 0.63922 0.62745 0.61569 0.60784 0.60000 0.58824 0.58039 0.56863 0.56471 0.55686 0.54902 0.54118 0.53333 0.52941 0.51765 0.51373 0.50588 0.49804 0.49412 0.49020 0.48235 0.47843 0.46667 0.46275 0.45882 0.45098 0.44706 0.44314 0.43922 0.43529 0.42745 0.41961 0.41569 0.41176 0.40784 0.40392 0.40000 0.39608 0.39216 0.38824 0.38431 0.38039 0.37255 0.36863 0.36471 0.36078 0.35686 0.35294 0.34902 0.34510 0.34510 0.34118 0.33725 0.33333 0.32941 0.32157 0.32157 0.31765 0.31373 0.30980 0.30980 0.30588 0.30196 0.29804 0.29804 0.29412 0.29020 0.28627 0.28627 0.28235 0.27843 0.27843 0.27059 0.26667 0.26667 0.26275 0.25882 0.25882 0.25490 0.25490 0.25098 0.24706 0.24706 0.24314 0.23922 0.23922 0.23529 0.23529 0.23137 0.23137 0.22745 0.21961 0.21961 0.21569 0.21569 0.21176 0.21176 0.20784 0.20784 0.20392 0.20392 0.20000 0.20000 0.19608 0.19608 0.19216 0.19216 0.18824 0.18824 0.18431 0.18431 0.18039 0.18039 0.17255 0.17255 0.16863 0.16863 0.16471 0.16471 0.16078 0.16078 0.16078 0.15686 0.15686 0.15294 0.15294 0.14902 0.14902 0.14510 0.14510 0.14510 0.14118 0.14118 0.13725 0.13725 0.13725 0.13333 0.13333 0.12941 0.12941 0.12941 0.12157 0.12157 0.11765 0.11765 0.11765 0.11373 0.11373 0.10980 0.10980 0.10980 0.10588 0.10588 0.10588 0.10196 0.10196 0.10196 0.09804 0.09804 0.09412 0.09412 0.09412 0.09020 0.09020 0.09020 0.08627 0.08627 0.08627 0.08235 0.08235 0.08235 0.07843 0.07843 0.07843 0.07059 0.07059 0.07059 0.06667 0.06667 0.06667 0.06275 0.06275 0.06275 0.05882 0.05882 0.05882 0.05882 0.05490 0.05490 0.05490 0.05098 0.05098 0.05098 0.04706 0.04706 0.04706 0.04314 0.04314 0.04314 0.04314 0.03922 0.03922 0.03922 0.03529 0.03529 0.03529 0.03529 0.03137 0.03137 0.03137 0.02745 0.02745 0.02745 0.02745 0.01961 0.01961 0.01961 0.01961 0.01569 0.01569 0.01569 0.01176 0.01176 0.01176 0.01176 0.00784 0.00784 0.00784 0.00784 0.00392 0.00392 0.00392 0.00392 0.00000 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/null.iasc000066400000000000000000000154001215713201500215400ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/pastel.lasc000066400000000000000000000324001215713201500220600ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 1.00000 0.01961 0.00000 0.98039 0.05490 0.00000 0.94510 0.08627 0.00392 0.91373 0.10980 0.00392 0.89020 0.13725 0.00392 0.86275 0.15686 0.00392 0.84314 0.18039 0.00392 0.81961 0.20000 0.00784 0.80000 0.21569 0.00784 0.78431 0.23529 0.00784 0.76471 0.25098 0.00784 0.74902 0.26275 0.01176 0.73725 0.28235 0.01176 0.71765 0.29412 0.01176 0.70588 0.30588 0.01176 0.69412 0.31765 0.01176 0.68235 0.33333 0.01569 0.66667 0.34118 0.01569 0.65882 0.35294 0.01569 0.64706 0.36078 0.01569 0.63922 0.37255 0.01961 0.62745 0.38431 0.01961 0.61569 0.39216 0.01961 0.60784 0.40000 0.01961 0.60000 0.41176 0.02353 0.58824 0.41961 0.02353 0.58039 0.43137 0.02353 0.56863 0.43529 0.02745 0.56471 0.44314 0.02745 0.55686 0.45098 0.02745 0.54902 0.45882 0.02745 0.54118 0.46667 0.03137 0.53333 0.47059 0.03137 0.52941 0.48235 0.03137 0.51765 0.48627 0.03529 0.51373 0.49412 0.03529 0.50588 0.50196 0.03529 0.49804 0.50588 0.03529 0.49412 0.50980 0.04314 0.49020 0.51765 0.04314 0.48235 0.52157 0.04314 0.47843 0.53333 0.04706 0.46667 0.53725 0.04706 0.46275 0.54118 0.04706 0.45882 0.54902 0.05098 0.45098 0.55294 0.05098 0.44706 0.55686 0.05098 0.44314 0.56078 0.05490 0.43922 0.56471 0.05490 0.43529 0.57255 0.05490 0.42745 0.58039 0.05882 0.41961 0.58431 0.05882 0.41569 0.58824 0.05882 0.41176 0.59216 0.06275 0.40784 0.59608 0.06275 0.40392 0.60000 0.06275 0.40000 0.60392 0.06667 0.39608 0.60784 0.06667 0.39216 0.61176 0.06667 0.38824 0.61569 0.07059 0.38431 0.61961 0.07059 0.38039 0.62745 0.07451 0.37255 0.63137 0.07451 0.36863 0.63529 0.07451 0.36471 0.63922 0.07843 0.36078 0.64314 0.07843 0.35686 0.64706 0.08235 0.35294 0.65098 0.08235 0.34902 0.65490 0.08235 0.34510 0.65490 0.08627 0.34510 0.65882 0.08627 0.34118 0.66275 0.09020 0.33725 0.66667 0.09020 0.33333 0.67059 0.09020 0.32941 0.67843 0.09412 0.32157 0.67843 0.09412 0.32157 0.68235 0.09804 0.31765 0.68627 0.09804 0.31373 0.69020 0.10196 0.30980 0.69020 0.10196 0.30980 0.69412 0.10588 0.30588 0.69804 0.10588 0.30196 0.70196 0.10980 0.29804 0.70196 0.10980 0.29804 0.70588 0.10980 0.29412 0.70980 0.11765 0.29020 0.71373 0.11765 0.28627 0.71373 0.12157 0.28627 0.71765 0.12157 0.28235 0.72157 0.12549 0.27843 0.72157 0.12549 0.27843 0.72941 0.12941 0.27059 0.73333 0.12941 0.26667 0.73333 0.13333 0.26667 0.73725 0.13725 0.26275 0.74118 0.13725 0.25882 0.74118 0.14118 0.25882 0.74510 0.14118 0.25490 0.74510 0.14510 0.25490 0.74902 0.14510 0.25098 0.75294 0.14902 0.24706 0.75294 0.14902 0.24706 0.75686 0.15294 0.24314 0.76078 0.15686 0.23922 0.76078 0.15686 0.23922 0.76471 0.16078 0.23529 0.76471 0.16078 0.23529 0.76863 0.16471 0.23137 0.76863 0.16863 0.23137 0.77255 0.16863 0.22745 0.78039 0.17255 0.21961 0.78039 0.17255 0.21961 0.78431 0.17647 0.21569 0.78431 0.18039 0.21569 0.78824 0.18039 0.21176 0.78824 0.18431 0.21176 0.79216 0.18824 0.20784 0.79216 0.18824 0.20784 0.79608 0.19608 0.20392 0.79608 0.20000 0.20392 0.80000 0.20000 0.20000 0.80000 0.20392 0.20000 0.80392 0.20784 0.19608 0.80392 0.20784 0.19608 0.80784 0.21176 0.19216 0.80784 0.21569 0.19216 0.81176 0.21961 0.18824 0.81176 0.21961 0.18824 0.81569 0.22353 0.18431 0.81569 0.22745 0.18431 0.81961 0.23137 0.18039 0.81961 0.23137 0.18039 0.82745 0.23529 0.17255 0.82745 0.23922 0.17255 0.83137 0.24314 0.16863 0.83137 0.24314 0.16863 0.83529 0.24706 0.16471 0.83529 0.25098 0.16471 0.83922 0.25490 0.16078 0.83922 0.25882 0.16078 0.83922 0.26275 0.16078 0.84314 0.26275 0.15686 0.84314 0.27059 0.15686 0.84706 0.27451 0.15294 0.84706 0.27843 0.15294 0.85098 0.28235 0.14902 0.85098 0.28627 0.14902 0.85490 0.29020 0.14510 0.85490 0.29412 0.14510 0.85490 0.29804 0.14510 0.85882 0.29804 0.14118 0.85882 0.30196 0.14118 0.86275 0.30588 0.13725 0.86275 0.30980 0.13725 0.86275 0.31373 0.13725 0.86667 0.31765 0.13333 0.86667 0.32157 0.13333 0.87059 0.32549 0.12941 0.87059 0.33333 0.12941 0.87059 0.33725 0.12941 0.87843 0.34118 0.12157 0.87843 0.34510 0.12157 0.88235 0.34902 0.11765 0.88235 0.35294 0.11765 0.88235 0.35686 0.11765 0.88627 0.36078 0.11373 0.88627 0.36471 0.11373 0.89020 0.37255 0.10980 0.89020 0.37647 0.10980 0.89020 0.38039 0.10980 0.89412 0.38431 0.10588 0.89412 0.38824 0.10588 0.89412 0.39216 0.10588 0.89804 0.40000 0.10196 0.89804 0.40392 0.10196 0.89804 0.40784 0.10196 0.90196 0.41176 0.09804 0.90196 0.41961 0.09804 0.90588 0.42353 0.09412 0.90588 0.42745 0.09412 0.90588 0.43529 0.09412 0.90980 0.43922 0.09020 0.90980 0.44314 0.09020 0.90980 0.45098 0.09020 0.91373 0.45490 0.08627 0.91373 0.45882 0.08627 0.91373 0.46667 0.08627 0.91765 0.47059 0.08235 0.91765 0.47843 0.08235 0.91765 0.48235 0.08235 0.92157 0.49020 0.07843 0.92157 0.49412 0.07843 0.92157 0.50196 0.07843 0.92941 0.50588 0.07059 0.92941 0.51373 0.07059 0.92941 0.51765 0.07059 0.93333 0.52549 0.06667 0.93333 0.52941 0.06667 0.93333 0.53725 0.06667 0.93725 0.54118 0.06275 0.93725 0.54902 0.06275 0.93725 0.55686 0.06275 0.94118 0.56078 0.05882 0.94118 0.56863 0.05882 0.94118 0.57647 0.05882 0.94118 0.58039 0.05882 0.94510 0.58824 0.05490 0.94510 0.59608 0.05490 0.94510 0.60000 0.05490 0.94902 0.60784 0.05098 0.94902 0.61569 0.05098 0.94902 0.62353 0.05098 0.95294 0.63137 0.04706 0.95294 0.63529 0.04706 0.95294 0.64314 0.04706 0.95686 0.65098 0.04314 0.95686 0.65882 0.04314 0.95686 0.66667 0.04314 0.95686 0.67451 0.04314 0.96078 0.68235 0.03922 0.96078 0.69020 0.03922 0.96078 0.69804 0.03922 0.96471 0.70588 0.03529 0.96471 0.71373 0.03529 0.96471 0.72157 0.03529 0.96471 0.72941 0.03529 0.96863 0.73725 0.03137 0.96863 0.74510 0.03137 0.96863 0.75294 0.03137 0.97255 0.76078 0.02745 0.97255 0.77255 0.02745 0.97255 0.78039 0.02745 0.97255 0.78824 0.02745 0.98039 0.79608 0.01961 0.98039 0.80392 0.01961 0.98039 0.81569 0.01961 0.98039 0.82353 0.01961 0.98431 0.83137 0.01569 0.98431 0.84314 0.01569 0.98431 0.85098 0.01569 0.98824 0.86275 0.01176 0.98824 0.87059 0.01176 0.98824 0.87843 0.01176 0.98824 0.89020 0.01176 0.99216 0.89804 0.00784 0.99216 0.90980 0.00784 0.99216 0.91765 0.00784 0.99216 0.92941 0.00784 0.99608 0.94118 0.00392 0.99608 0.94902 0.00392 0.99608 0.96078 0.00392 0.99608 0.97255 0.00392 1.00000 0.98039 0.00000 1.00000 0.99216 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/rainbow.lasc000066400000000000000000000324001215713201500222310ustar00rootroot00000000000000 0.00000 0.00000 0.16471 0.02745 0.00000 0.18431 0.05882 0.00000 0.20000 0.08627 0.00000 0.21961 0.11373 0.00000 0.23922 0.14510 0.00000 0.25882 0.17647 0.00000 0.27843 0.20392 0.00000 0.29804 0.23137 0.00000 0.31765 0.26275 0.00000 0.33725 0.29412 0.00000 0.35686 0.32157 0.00000 0.37647 0.35294 0.00000 0.39608 0.38039 0.00000 0.41569 0.41176 0.00000 0.43529 0.43922 0.00000 0.45490 0.47059 0.00000 0.47451 0.49804 0.00000 0.49412 0.52941 0.00000 0.51373 0.55686 0.00000 0.53725 0.58824 0.00000 0.55686 0.55686 0.00000 0.57647 0.52941 0.00000 0.59608 0.49804 0.00000 0.61569 0.47059 0.00000 0.63922 0.43922 0.00000 0.65882 0.41176 0.00000 0.67843 0.38039 0.00000 0.70196 0.35294 0.00000 0.72157 0.32157 0.00000 0.74118 0.29412 0.00000 0.76471 0.26275 0.00000 0.78431 0.23137 0.00000 0.80392 0.20392 0.00000 0.82745 0.17647 0.00000 0.84706 0.14510 0.00000 0.87059 0.11373 0.00000 0.89020 0.08627 0.00000 0.91373 0.05882 0.00000 0.93333 0.02745 0.00000 0.95686 0.00000 0.00000 0.97647 0.00000 0.00000 1.00000 0.00000 0.02353 0.97647 0.00000 0.04706 0.95686 0.00000 0.06275 0.93333 0.00000 0.08235 0.91373 0.00000 0.09804 0.89020 0.00000 0.11373 0.87059 0.00000 0.12941 0.84706 0.00000 0.14118 0.82745 0.00000 0.15686 0.80392 0.00000 0.16863 0.78431 0.00000 0.18431 0.76471 0.00000 0.19608 0.74118 0.00000 0.21176 0.72157 0.00000 0.22353 0.70196 0.00000 0.23529 0.67843 0.00000 0.25098 0.65882 0.00000 0.26275 0.63922 0.00000 0.27451 0.61569 0.00000 0.28627 0.59608 0.00000 0.29804 0.57647 0.00000 0.30980 0.55686 0.00000 0.32157 0.53725 0.00000 0.33333 0.51373 0.00000 0.34510 0.49412 0.00000 0.35686 0.47451 0.00000 0.36863 0.45490 0.00000 0.38039 0.43529 0.00000 0.39216 0.41569 0.00000 0.40392 0.39608 0.00000 0.41176 0.37647 0.00000 0.42353 0.35686 0.00000 0.43529 0.33725 0.00000 0.44706 0.31765 0.00000 0.45882 0.29804 0.00000 0.46667 0.27843 0.00000 0.47843 0.25882 0.00000 0.49020 0.23922 0.00000 0.49804 0.21961 0.00000 0.50980 0.20000 0.00000 0.52157 0.18431 0.00000 0.52941 0.16471 0.00000 0.54118 0.14510 0.00000 0.55294 0.12941 0.00000 0.56078 0.10980 0.00000 0.57255 0.09412 0.00000 0.58431 0.07451 0.00000 0.59216 0.05882 0.00000 0.60392 0.04314 0.00000 0.61176 0.02745 0.00000 0.62353 0.01176 0.00000 0.63137 0.00000 0.00000 0.64314 0.00000 0.00000 0.65098 0.00000 0.00000 0.66275 0.00000 0.00000 0.67059 0.00000 0.00000 0.68235 0.00000 0.00000 0.69020 0.00000 0.00000 0.70196 0.00000 0.00000 0.70980 0.00000 0.00000 0.72157 0.00000 0.00000 0.72941 0.00000 0.00000 0.74118 0.00000 0.00000 0.74902 0.00000 0.00000 0.76078 0.00000 0.00000 0.76863 0.00000 0.00000 0.77647 0.00000 0.00000 0.78824 0.00000 0.00000 0.79608 0.00000 0.00000 0.80784 0.00000 0.00000 0.81569 0.00000 0.00000 0.82353 0.00000 0.00000 0.83529 0.00000 0.00000 0.84314 0.00000 0.00000 0.85490 0.00000 0.00000 0.86275 0.00000 0.00000 0.87059 0.00000 0.00000 0.88235 0.00000 0.00000 0.89020 0.00000 0.00000 0.89804 0.00000 0.00000 0.90980 0.00000 0.00000 0.91765 0.00000 0.00000 0.92549 0.00000 0.00000 0.93725 0.00000 0.00000 0.94510 0.00000 0.00000 0.95294 0.00000 0.00000 0.96078 0.00000 0.00000 0.97255 0.00000 0.00000 0.98039 0.00000 0.00000 0.98824 0.00000 0.00000 1.00000 0.00000 0.00000 0.98824 0.00000 0.00000 0.98039 0.00000 0.00000 0.97255 0.00000 0.00000 0.96078 0.00000 0.00000 0.95294 0.00000 0.00000 0.94510 0.00000 0.00000 0.93725 0.00000 0.00000 0.92549 0.00000 0.00000 0.91765 0.00000 0.00000 0.90980 0.00000 0.00000 0.89804 0.00000 0.00000 0.89020 0.00000 0.00000 0.88235 0.00000 0.00000 0.87059 0.00000 0.00000 0.86275 0.00000 0.00000 0.85490 0.00000 0.00000 0.84314 0.00000 0.00000 0.83529 0.00000 0.00000 0.82353 0.00000 0.00000 0.81569 0.00000 0.00000 0.80784 0.00000 0.00000 0.79608 0.00000 0.00000 0.78824 0.00000 0.00000 0.77647 0.00000 0.00784 0.76863 0.00000 0.03529 0.77647 0.00000 0.06667 0.78824 0.00000 0.09804 0.80000 0.00000 0.12941 0.81176 0.00000 0.16471 0.82745 0.00000 0.20000 0.84314 0.00000 0.23529 0.85882 0.00000 0.26667 0.87059 0.00000 0.30588 0.89020 0.00000 0.34118 0.90196 0.00000 0.37647 0.92157 0.00000 0.41176 0.93333 0.00000 0.44706 0.95294 0.00000 0.48627 0.96863 0.00000 0.52157 0.98824 0.00000 0.56078 1.00000 0.00000 0.59608 1.00000 0.00000 0.63529 1.00000 0.00000 0.67059 1.00000 0.00000 0.70980 1.00000 0.00000 0.74902 1.00000 0.00000 0.78431 1.00000 0.00000 0.82353 1.00000 0.00000 0.85882 1.00000 0.00000 0.89804 1.00000 0.00000 0.93333 1.00000 0.00000 0.97647 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.99608 1.00000 0.00000 0.98039 1.00000 0.00000 0.96078 0.97647 0.00000 0.94510 0.93725 0.00000 0.92549 0.89804 0.00000 0.90980 0.85882 0.00000 0.89412 0.81961 0.00000 0.87451 0.78039 0.00000 0.85882 0.74118 0.00000 0.83922 0.70196 0.00000 0.82353 0.66275 0.00000 0.80392 0.62353 0.00000 0.78824 0.58431 0.00000 0.76863 0.54510 0.00000 0.75686 0.50980 0.00000 0.74118 0.46667 0.00000 0.72549 0.43137 0.00000 0.70980 0.39216 0.00000 0.69412 0.35294 0.00000 0.68235 0.31765 0.00000 0.66275 0.27451 0.00000 0.65098 0.23922 0.00000 0.63529 0.20000 0.00000 0.62745 0.16863 0.00000 0.61569 0.12941 0.00000 0.60784 0.09804 0.00000 0.61961 0.08235 0.00000 0.62745 0.06275 0.00000 0.63922 0.04706 0.00000 0.64706 0.02353 0.00000 0.65882 0.00000 0.00000 0.66667 0.00000 0.00000 0.67843 0.00000 0.00000 0.68627 0.00000 0.00000 0.69804 0.00000 0.00000 0.70980 0.00000 0.00000 0.71765 0.00000 0.00000 0.72941 0.00000 0.00000 0.73725 0.00000 0.00000 0.74902 0.00000 0.00000 0.75686 0.00000 0.00000 0.76863 0.00000 0.00000 0.77647 0.00000 0.00000 0.78824 0.00000 0.00000 0.80000 0.00784 0.00784 0.80784 0.02745 0.02745 0.81961 0.05098 0.05098 0.82745 0.08235 0.08235 0.83922 0.11373 0.11373 0.84706 0.14902 0.14902 0.85882 0.19216 0.19216 0.86667 0.23137 0.23137 0.87843 0.27843 0.27843 0.88627 0.32549 0.32549 0.89804 0.37647 0.37647 0.90980 0.43137 0.43137 0.91765 0.48627 0.48627 0.92941 0.54118 0.54118 0.93725 0.60000 0.60000 0.94902 0.66275 0.66275 0.95686 0.72549 0.72549 0.96863 0.79216 0.79216 0.97647 0.85882 0.85882 0.98824 0.92941 0.92941 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/rainbow1.lasc000066400000000000000000000324001215713201500223120ustar00rootroot00000000000000 0.00000 0.00000 0.16471 0.02745 0.00000 0.18431 0.05882 0.00000 0.20000 0.08627 0.00000 0.21961 0.11373 0.00000 0.23922 0.14510 0.00000 0.25882 0.17647 0.00000 0.27843 0.20392 0.00000 0.29804 0.23137 0.00000 0.31765 0.26275 0.00000 0.33725 0.29412 0.00000 0.35686 0.32157 0.00000 0.37647 0.35294 0.00000 0.39608 0.38039 0.00000 0.41569 0.41176 0.00000 0.43529 0.43922 0.00000 0.45490 0.47059 0.00000 0.47451 0.49804 0.00000 0.49412 0.52941 0.00000 0.51373 0.55686 0.00000 0.53725 0.58824 0.00000 0.55686 0.55686 0.00000 0.57647 0.52941 0.00000 0.59608 0.49804 0.00000 0.61569 0.47059 0.00000 0.63922 0.43922 0.00000 0.65882 0.41176 0.00000 0.67843 0.38039 0.00000 0.70196 0.35294 0.00000 0.72157 0.32157 0.00000 0.74118 0.29412 0.00000 0.76471 0.26275 0.00000 0.78431 0.23137 0.00000 0.80392 0.20392 0.00000 0.82745 0.17647 0.00000 0.84706 0.14510 0.00000 0.87059 0.11373 0.00000 0.89020 0.08627 0.00000 0.91373 0.05882 0.00000 0.93333 0.02745 0.00000 0.95686 0.00000 0.00000 0.97647 0.00000 0.00000 1.00000 0.00000 0.00000 0.97647 0.00000 0.00784 0.95686 0.00000 0.01569 0.93333 0.00000 0.02353 0.91373 0.00000 0.03137 0.89020 0.00000 0.03922 0.87059 0.00000 0.05098 0.85098 0.00000 0.06275 0.83137 0.00000 0.07843 0.81176 0.00000 0.09804 0.79216 0.00000 0.11765 0.77255 0.00000 0.13725 0.75294 0.00000 0.15686 0.73333 0.00000 0.17647 0.71373 0.00000 0.19608 0.69412 0.00000 0.21569 0.67451 0.00000 0.23529 0.65882 0.00000 0.25490 0.64314 0.00000 0.27059 0.62745 0.00000 0.28627 0.61176 0.00000 0.30196 0.59608 0.00000 0.32157 0.58039 0.00000 0.33333 0.56471 0.00000 0.34510 0.54902 0.00000 0.35686 0.53333 0.00000 0.36863 0.51765 0.00000 0.38039 0.50196 0.00000 0.39216 0.48627 0.00000 0.40392 0.47059 0.00000 0.41176 0.45882 0.00000 0.42353 0.44706 0.00000 0.43529 0.43529 0.00000 0.44706 0.42353 0.00000 0.45882 0.41176 0.00000 0.46667 0.40000 0.00000 0.47843 0.38824 0.00000 0.49020 0.37647 0.00000 0.49804 0.36471 0.00000 0.50980 0.35294 0.00000 0.52157 0.34118 0.00000 0.52941 0.32941 0.00000 0.54118 0.31765 0.00000 0.55294 0.30588 0.00000 0.56078 0.29412 0.00000 0.57255 0.28235 0.00000 0.58431 0.27059 0.00000 0.59216 0.25882 0.00000 0.60392 0.24706 0.00000 0.61176 0.23529 0.00000 0.62353 0.22353 0.00000 0.63137 0.21176 0.00000 0.64314 0.20000 0.00000 0.65098 0.18824 0.00000 0.66275 0.17647 0.00000 0.67059 0.16471 0.00000 0.68235 0.15294 0.00000 0.69020 0.14118 0.00000 0.70196 0.12941 0.00000 0.70980 0.11765 0.00000 0.72157 0.10196 0.00000 0.72941 0.08627 0.00000 0.74118 0.07059 0.00000 0.74902 0.05490 0.00000 0.76078 0.03922 0.00000 0.76863 0.02353 0.00000 0.77647 0.00000 0.00000 0.78824 0.00000 0.00000 0.79608 0.00000 0.00000 0.80784 0.00000 0.00000 0.81569 0.00000 0.00000 0.82353 0.00000 0.00000 0.83529 0.00000 0.00000 0.84314 0.00000 0.00000 0.85490 0.00000 0.00000 0.86275 0.00000 0.00000 0.87059 0.00000 0.00000 0.88235 0.00000 0.00000 0.89020 0.00000 0.00000 0.89804 0.00000 0.00000 0.90980 0.00000 0.00000 0.91765 0.00000 0.00000 0.92549 0.00000 0.00000 0.93725 0.00000 0.00000 0.94510 0.00000 0.00000 0.95294 0.00000 0.00000 0.96078 0.00000 0.00000 0.97255 0.00000 0.00000 0.98039 0.00000 0.00000 0.98824 0.00000 0.00784 1.00000 0.00000 0.01569 0.98824 0.00000 0.02353 0.98039 0.00000 0.03137 0.97255 0.00000 0.04314 0.96078 0.00000 0.05490 0.95294 0.00000 0.06667 0.94510 0.00000 0.07843 0.93725 0.00000 0.09020 0.92549 0.00000 0.10196 0.91765 0.00000 0.11373 0.90980 0.00000 0.12549 0.89804 0.00000 0.13725 0.89020 0.00000 0.14902 0.88235 0.00000 0.16471 0.87059 0.00000 0.20000 0.86275 0.00000 0.23529 0.85490 0.00000 0.26667 0.84314 0.00000 0.30588 0.83529 0.00000 0.34118 0.82353 0.00000 0.37647 0.81569 0.00000 0.41176 0.80784 0.00000 0.44706 0.79608 0.00000 0.48627 0.78824 0.00000 0.52157 0.77647 0.00000 0.56078 0.76863 0.00000 0.59608 0.77647 0.00000 0.63529 0.78824 0.00000 0.67059 0.80000 0.00000 0.70980 0.81176 0.00000 0.74902 0.82745 0.00000 0.78431 0.84314 0.00000 0.82353 0.85882 0.00000 0.85882 0.87059 0.00000 0.89804 0.89020 0.00000 0.93333 0.90196 0.00000 0.97647 0.92157 0.00000 1.00000 0.93333 0.00000 1.00000 0.95294 0.00000 1.00000 0.96863 0.00000 1.00000 0.98824 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.99608 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.97647 0.00000 1.00000 0.93725 0.00000 1.00000 0.89804 0.00000 1.00000 0.85882 0.00000 1.00000 0.81961 0.00000 1.00000 0.78039 0.00000 1.00000 0.74118 0.00000 1.00000 0.70196 0.00000 1.00000 0.66275 0.00000 1.00000 0.62353 0.00000 1.00000 0.58431 0.00000 1.00000 0.54510 0.00000 1.00000 0.50980 0.00000 1.00000 0.46667 0.00000 1.00000 0.43137 0.00000 1.00000 0.39216 0.00000 1.00000 0.35294 0.00000 1.00000 0.31765 0.00000 1.00000 0.27451 0.00000 1.00000 0.23922 0.00000 1.00000 0.20000 0.00000 1.00000 0.16863 0.00000 1.00000 0.12941 0.00000 1.00000 0.09804 0.00000 1.00000 0.08235 0.00000 1.00000 0.06275 0.00000 1.00000 0.04706 0.00000 1.00000 0.02353 0.00000 1.00000 0.00000 0.00000 0.99216 0.00000 0.00000 0.98431 0.00000 0.00000 0.97647 0.00000 0.00000 0.96863 0.00000 0.00000 0.96078 0.00000 0.00000 0.95294 0.00000 0.00000 0.94510 0.00000 0.00000 0.93725 0.00000 0.00000 0.92941 0.00000 0.00000 0.92157 0.00000 0.00000 0.91373 0.00000 0.00000 0.90588 0.00000 0.00000 0.89804 0.00000 0.00000 0.89020 0.00000 0.00000 0.88235 0.00000 0.00000 0.87451 0.00000 0.00000 0.86667 0.00000 0.00000 0.85882 0.00000 0.00000 0.85098 0.00000 0.00000 0.84314 0.00000 0.00000 0.83529 0.00000 0.00000 0.82745 0.00000 0.00000 0.81961 0.00000 0.00000 0.81176 0.00000 0.00000 0.80392 0.00000 0.00000 0.79608 0.00000 0.00000 0.78824 0.00000 0.00000 0.78039 0.00000 0.00000 0.77255 0.00000 0.00000 0.76471 0.00000 0.00000 0.75686 0.00000 0.00000 0.74902 0.00000 0.00000 0.74118 0.00000 0.00000 0.73333 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/rainbow2.lasc000066400000000000000000000324001215713201500223130ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.03137 0.00000 0.03137 0.06275 0.00000 0.06275 0.09412 0.00000 0.09412 0.12549 0.00000 0.12549 0.15686 0.00000 0.15686 0.18824 0.00000 0.18824 0.21961 0.00000 0.21961 0.25098 0.00000 0.25098 0.28235 0.00000 0.28235 0.31373 0.00000 0.31373 0.34510 0.00000 0.34510 0.37647 0.00000 0.37647 0.40784 0.00000 0.40784 0.43922 0.00000 0.43922 0.47059 0.00000 0.47059 0.50196 0.00000 0.50196 0.53333 0.00000 0.53333 0.56471 0.00000 0.56471 0.59608 0.00000 0.59608 0.62745 0.00000 0.62745 0.65882 0.00000 0.65882 0.69020 0.00000 0.69020 0.72157 0.00000 0.72157 0.75294 0.00000 0.75294 0.78431 0.00000 0.78431 0.81569 0.00000 0.81569 0.84706 0.00000 0.84706 0.87843 0.00000 0.87843 0.90980 0.00000 0.90980 0.94118 0.00000 0.94118 0.97255 0.00000 0.97255 1.00000 0.00000 1.00000 0.96863 0.00000 1.00000 0.93725 0.00000 1.00000 0.90588 0.00000 1.00000 0.87451 0.00000 1.00000 0.84314 0.00000 1.00000 0.81176 0.00000 1.00000 0.78039 0.00000 1.00000 0.74902 0.00000 1.00000 0.71765 0.00000 1.00000 0.68627 0.00000 1.00000 0.65490 0.00000 1.00000 0.62353 0.00000 1.00000 0.59216 0.00000 1.00000 0.56078 0.00000 1.00000 0.52941 0.00000 1.00000 0.49804 0.00000 1.00000 0.46667 0.00000 1.00000 0.43529 0.00000 1.00000 0.40392 0.00000 1.00000 0.37255 0.00000 1.00000 0.34118 0.00000 1.00000 0.30980 0.00000 1.00000 0.27843 0.00000 1.00000 0.24706 0.00000 1.00000 0.21569 0.00000 1.00000 0.18431 0.00000 1.00000 0.15294 0.00000 1.00000 0.12157 0.00000 1.00000 0.09020 0.00000 1.00000 0.05882 0.00000 1.00000 0.02745 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.03137 1.00000 0.00000 0.06275 1.00000 0.00000 0.09412 1.00000 0.00000 0.12549 1.00000 0.00000 0.15686 1.00000 0.00000 0.18824 1.00000 0.00000 0.21961 1.00000 0.00000 0.25098 1.00000 0.00000 0.28235 1.00000 0.00000 0.31373 1.00000 0.00000 0.34510 1.00000 0.00000 0.37647 1.00000 0.00000 0.40784 1.00000 0.00000 0.43922 1.00000 0.00000 0.47059 1.00000 0.00000 0.50196 1.00000 0.00000 0.53333 1.00000 0.00000 0.56471 1.00000 0.00000 0.59608 1.00000 0.00000 0.62745 1.00000 0.00000 0.65882 1.00000 0.00000 0.69020 1.00000 0.00000 0.72157 1.00000 0.00000 0.75294 1.00000 0.00000 0.78431 1.00000 0.00000 0.81569 1.00000 0.00000 0.84706 1.00000 0.00000 0.87843 1.00000 0.00000 0.90980 1.00000 0.00000 0.94118 1.00000 0.00000 0.97255 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.96863 0.00000 1.00000 0.93725 0.00000 1.00000 0.90588 0.00000 1.00000 0.87451 0.00000 1.00000 0.84314 0.00000 1.00000 0.81176 0.00000 1.00000 0.78039 0.00000 1.00000 0.74902 0.00000 1.00000 0.71765 0.00000 1.00000 0.68627 0.00000 1.00000 0.65490 0.00000 1.00000 0.62353 0.00000 1.00000 0.59216 0.00000 1.00000 0.56078 0.00000 1.00000 0.52941 0.00000 1.00000 0.49804 0.00000 1.00000 0.46667 0.00000 1.00000 0.43529 0.00000 1.00000 0.40392 0.00000 1.00000 0.37255 0.00000 1.00000 0.34118 0.00000 1.00000 0.30980 0.00000 1.00000 0.27843 0.00000 1.00000 0.24706 0.00000 1.00000 0.21569 0.00000 1.00000 0.18431 0.00000 1.00000 0.15294 0.00000 1.00000 0.12157 0.00000 1.00000 0.09020 0.00000 1.00000 0.05882 0.00000 1.00000 0.02745 0.00000 1.00000 0.00000 0.03137 1.00000 0.00000 0.06275 1.00000 0.00000 0.09412 1.00000 0.00000 0.12549 1.00000 0.00000 0.15686 1.00000 0.00000 0.18824 1.00000 0.00000 0.21961 1.00000 0.00000 0.25098 1.00000 0.00000 0.28235 1.00000 0.00000 0.31373 1.00000 0.00000 0.34510 1.00000 0.00000 0.37647 1.00000 0.00000 0.40784 1.00000 0.00000 0.43922 1.00000 0.00000 0.47059 1.00000 0.00000 0.50196 1.00000 0.00000 0.53333 1.00000 0.00000 0.56471 1.00000 0.00000 0.59608 1.00000 0.00000 0.62745 1.00000 0.00000 0.65882 1.00000 0.00000 0.69020 1.00000 0.00000 0.72157 1.00000 0.00000 0.75294 1.00000 0.00000 0.78431 1.00000 0.00000 0.81569 1.00000 0.00000 0.84706 1.00000 0.00000 0.87843 1.00000 0.00000 0.90980 1.00000 0.00000 0.94118 1.00000 0.00000 0.97255 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.98431 0.00000 1.00000 0.96863 0.00000 1.00000 0.95294 0.00000 1.00000 0.93725 0.00000 1.00000 0.92157 0.00000 1.00000 0.90588 0.00000 1.00000 0.89020 0.00000 1.00000 0.87451 0.00000 1.00000 0.85882 0.00000 1.00000 0.84314 0.00000 1.00000 0.82745 0.00000 1.00000 0.81176 0.00000 1.00000 0.79608 0.00000 1.00000 0.78039 0.00000 1.00000 0.76471 0.00000 1.00000 0.74902 0.00000 1.00000 0.73333 0.00000 1.00000 0.71765 0.00000 1.00000 0.70196 0.00000 1.00000 0.68627 0.00000 1.00000 0.67059 0.00000 1.00000 0.65490 0.00000 1.00000 0.63922 0.00000 1.00000 0.62353 0.00000 1.00000 0.60784 0.00000 1.00000 0.59216 0.00000 1.00000 0.57647 0.00000 1.00000 0.56078 0.00000 1.00000 0.54510 0.00000 1.00000 0.52941 0.00000 1.00000 0.51373 0.00000 1.00000 0.49804 0.00000 1.00000 0.48235 0.00000 1.00000 0.46667 0.00000 1.00000 0.45098 0.00000 1.00000 0.43529 0.00000 1.00000 0.41961 0.00000 1.00000 0.40392 0.00000 1.00000 0.38824 0.00000 1.00000 0.37255 0.00000 1.00000 0.35686 0.00000 1.00000 0.34118 0.00000 1.00000 0.32549 0.00000 1.00000 0.30980 0.00000 1.00000 0.29412 0.00000 1.00000 0.27843 0.00000 1.00000 0.26275 0.00000 1.00000 0.24706 0.00000 1.00000 0.23137 0.00000 1.00000 0.21569 0.00000 1.00000 0.20000 0.00000 1.00000 0.18431 0.00000 1.00000 0.16863 0.00000 1.00000 0.15294 0.00000 1.00000 0.13725 0.00000 1.00000 0.12157 0.00000 1.00000 0.10588 0.00000 1.00000 0.09020 0.00000 1.00000 0.07451 0.00000 1.00000 0.05882 0.00000 1.00000 0.04314 0.00000 1.00000 0.02745 0.00000 1.00000 0.01176 0.00000 1.00000 0.00000 0.00000 1.00000 0.03137 0.03137 1.00000 0.06275 0.06275 1.00000 0.09412 0.09412 1.00000 0.12549 0.12549 1.00000 0.15686 0.15686 1.00000 0.18824 0.18824 1.00000 0.21961 0.21961 1.00000 0.25098 0.25098 1.00000 0.28235 0.28235 1.00000 0.31373 0.31373 1.00000 0.34510 0.34510 1.00000 0.37647 0.37647 1.00000 0.40784 0.40784 1.00000 0.43922 0.43922 1.00000 0.47059 0.47059 1.00000 0.50196 0.50196 1.00000 0.53333 0.53333 1.00000 0.56471 0.56471 1.00000 0.59608 0.59608 1.00000 0.62745 0.62745 1.00000 0.65882 0.65882 1.00000 0.69020 0.69020 1.00000 0.72157 0.72157 1.00000 0.75294 0.75294 1.00000 0.78431 0.78431 1.00000 0.81569 0.81569 1.00000 0.84706 0.84706 1.00000 0.87843 0.87843 1.00000 0.90980 0.90980 1.00000 0.94118 0.94118 1.00000 0.97255 0.97255 skycat-3.1.2-starlink-1b/rtd/colormaps/rainbow3.lasc000066400000000000000000000324001215713201500223140ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.03922 0.00000 0.00000 0.07843 0.00000 0.00000 0.11765 0.00000 0.00000 0.15686 0.00000 0.00000 0.20000 0.00000 0.00000 0.23922 0.00000 0.00000 0.27843 0.00000 0.00000 0.31765 0.00000 0.00000 0.35686 0.00000 0.00000 0.40000 0.00000 0.00000 0.43922 0.00000 0.00000 0.47843 0.00000 0.00000 0.51765 0.00000 0.00000 0.55686 0.00000 0.00000 0.60000 0.00000 0.00000 0.63922 0.00000 0.00000 0.67843 0.00000 0.00000 0.71765 0.00000 0.00000 0.75686 0.00000 0.00000 0.80000 0.00000 0.00000 0.83922 0.00000 0.00000 0.87843 0.00000 0.00000 0.91765 0.00000 0.00000 0.95686 0.00000 0.00000 1.00000 0.00000 0.03137 1.00000 0.00000 0.06275 1.00000 0.00000 0.09412 1.00000 0.00000 0.12549 1.00000 0.00000 0.15686 1.00000 0.00000 0.18824 1.00000 0.00000 0.21961 1.00000 0.00000 0.25490 1.00000 0.00000 0.28627 1.00000 0.00000 0.31765 1.00000 0.00000 0.34902 1.00000 0.00000 0.38039 1.00000 0.00000 0.41176 1.00000 0.00000 0.44314 1.00000 0.00000 0.47843 1.00000 0.00000 0.49804 1.00000 0.00000 0.51765 1.00000 0.00000 0.53725 1.00000 0.00000 0.55686 1.00000 0.00000 0.58039 1.00000 0.00000 0.60000 1.00000 0.00000 0.61961 1.00000 0.00000 0.63922 1.00000 0.00000 0.65882 1.00000 0.00000 0.68235 1.00000 0.00000 0.70196 1.00000 0.00000 0.72157 1.00000 0.00000 0.74118 1.00000 0.00000 0.76078 1.00000 0.00000 0.78431 1.00000 0.00000 0.79608 1.00000 0.00000 0.81176 1.00000 0.00000 0.82745 1.00000 0.00000 0.83922 1.00000 0.00000 0.85490 1.00000 0.00000 0.87059 1.00000 0.00000 0.88235 1.00000 0.00000 0.89804 1.00000 0.00000 0.91373 1.00000 0.00000 0.92549 1.00000 0.00000 0.94118 1.00000 0.00000 0.95686 1.00000 0.00000 0.96863 1.00000 0.00000 0.98431 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.98039 0.00000 1.00000 0.96078 0.00000 1.00000 0.94118 0.00000 1.00000 0.92157 0.00000 1.00000 0.90196 0.00000 1.00000 0.88235 0.00000 1.00000 0.86275 0.00000 1.00000 0.84314 0.00000 1.00000 0.82353 0.00000 1.00000 0.80392 0.00000 1.00000 0.78431 0.00000 1.00000 0.76471 0.00000 1.00000 0.74510 0.00000 1.00000 0.72549 0.00000 1.00000 0.70588 0.00000 1.00000 0.65882 0.00000 1.00000 0.61176 0.00000 1.00000 0.56471 0.00000 1.00000 0.51765 0.00000 1.00000 0.47059 0.00000 1.00000 0.42353 0.00000 1.00000 0.37647 0.00000 1.00000 0.32549 0.00000 1.00000 0.27843 0.00000 1.00000 0.23137 0.00000 1.00000 0.18431 0.00000 1.00000 0.13725 0.00000 1.00000 0.09020 0.00000 1.00000 0.04314 0.00000 1.00000 0.00000 0.04706 1.00000 0.00000 0.09412 1.00000 0.00000 0.14118 1.00000 0.00000 0.18824 1.00000 0.00000 0.23529 1.00000 0.00000 0.28235 1.00000 0.00000 0.32941 1.00000 0.00000 0.37647 1.00000 0.00000 0.42353 1.00000 0.00000 0.47059 1.00000 0.00000 0.51765 1.00000 0.00000 0.56471 1.00000 0.00000 0.61176 1.00000 0.00000 0.65882 1.00000 0.00000 0.70588 1.00000 0.00000 0.72549 1.00000 0.00000 0.74510 1.00000 0.00000 0.76471 1.00000 0.00000 0.78431 1.00000 0.00000 0.80392 1.00000 0.00000 0.82353 1.00000 0.00000 0.84314 1.00000 0.00000 0.86275 1.00000 0.00000 0.88235 1.00000 0.00000 0.90196 1.00000 0.00000 0.92157 1.00000 0.00000 0.94118 1.00000 0.00000 0.96078 1.00000 0.00000 0.98039 1.00000 0.00000 1.00000 1.00000 0.00000 0.99608 0.98039 0.00000 0.99608 0.96078 0.00000 0.99608 0.94510 0.00000 0.99608 0.92549 0.00000 0.99608 0.90588 0.00000 0.99216 0.89020 0.00000 0.99216 0.87059 0.00000 0.99216 0.85098 0.00000 0.99216 0.83529 0.00000 0.99216 0.81569 0.00000 0.98824 0.79608 0.00000 0.98824 0.78039 0.00000 0.98824 0.76078 0.00000 0.98824 0.74118 0.00000 0.98824 0.72549 0.00000 0.98824 0.70588 0.00000 0.98824 0.69020 0.00000 0.98824 0.67451 0.00000 0.98824 0.65490 0.00000 0.99216 0.63922 0.00000 0.99216 0.62353 0.00000 0.99216 0.60392 0.00000 0.99216 0.58824 0.00000 0.99216 0.57255 0.00000 0.99608 0.55294 0.00000 0.99608 0.53725 0.00000 0.99608 0.52157 0.00000 0.99608 0.50196 0.00000 0.99608 0.48627 0.00000 1.00000 0.47059 0.00000 1.00000 0.43922 0.00000 1.00000 0.40784 0.00000 1.00000 0.37647 0.00000 1.00000 0.34510 0.00000 1.00000 0.31373 0.00000 1.00000 0.28235 0.00000 1.00000 0.25098 0.00000 1.00000 0.21569 0.00000 1.00000 0.18431 0.00000 1.00000 0.15294 0.00000 1.00000 0.12157 0.00000 1.00000 0.09020 0.00000 1.00000 0.05882 0.00000 1.00000 0.02745 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.04706 1.00000 0.00000 0.09412 1.00000 0.00000 0.14118 1.00000 0.00000 0.18824 1.00000 0.00000 0.23529 1.00000 0.00000 0.28235 1.00000 0.00000 0.32941 1.00000 0.00000 0.37647 1.00000 0.00000 0.42353 1.00000 0.00000 0.47059 1.00000 0.00000 0.51765 1.00000 0.00000 0.56471 1.00000 0.00000 0.61176 1.00000 0.00000 0.65882 1.00000 0.00000 0.70588 1.00000 0.00000 0.72549 1.00000 0.00000 0.74902 1.00000 0.00000 0.77255 1.00000 0.00000 0.79608 1.00000 0.00000 0.81569 1.00000 0.00000 0.83922 1.00000 0.00000 0.86275 1.00000 0.00000 0.88627 1.00000 0.00000 0.90588 1.00000 0.00000 0.92941 1.00000 0.00000 0.95294 1.00000 0.00000 0.97647 1.00000 0.00000 1.00000 1.00000 0.03529 1.00000 1.00000 0.07059 1.00000 1.00000 0.10588 1.00000 1.00000 0.14118 1.00000 1.00000 0.18039 1.00000 1.00000 0.21569 1.00000 1.00000 0.25098 1.00000 1.00000 0.28627 1.00000 1.00000 0.32549 1.00000 1.00000 0.36078 1.00000 1.00000 0.39608 1.00000 1.00000 0.43137 1.00000 1.00000 0.47059 1.00000 1.00000 0.48627 1.00000 1.00000 0.50588 1.00000 1.00000 0.52157 1.00000 1.00000 0.54118 1.00000 1.00000 0.56078 1.00000 1.00000 0.57647 1.00000 1.00000 0.59608 1.00000 1.00000 0.61176 1.00000 1.00000 0.63137 1.00000 1.00000 0.65098 1.00000 1.00000 0.66667 1.00000 1.00000 0.68627 1.00000 1.00000 0.70588 1.00000 1.00000 0.74510 1.00000 1.00000 0.78824 1.00000 1.00000 0.83137 1.00000 1.00000 0.87059 1.00000 1.00000 0.91373 1.00000 1.00000 0.95686 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/rainbow4.lasc000066400000000000000000000324001215713201500223150ustar00rootroot00000000000000 0.00000 0.00000 0.01176 0.00000 0.00000 0.02745 0.00000 0.00000 0.04314 0.00000 0.00000 0.05882 0.00000 0.00000 0.07451 0.00000 0.00000 0.09020 0.00000 0.00000 0.10588 0.00000 0.00000 0.12157 0.00000 0.00000 0.13725 0.00000 0.00000 0.15294 0.00000 0.00000 0.16863 0.00000 0.00000 0.18431 0.00000 0.00000 0.20000 0.00000 0.00000 0.21176 0.00000 0.00000 0.22745 0.00000 0.00000 0.24314 0.00000 0.00000 0.25882 0.00000 0.00000 0.27451 0.00000 0.00000 0.29020 0.00000 0.00000 0.30588 0.00000 0.00000 0.32157 0.00000 0.00000 0.33725 0.00000 0.00000 0.35294 0.00000 0.00000 0.36863 0.00000 0.00000 0.38431 0.00000 0.00000 0.40000 0.00000 0.00000 0.41176 0.00000 0.00000 0.42745 0.00000 0.00000 0.44314 0.00000 0.00000 0.45882 0.00000 0.00000 0.47451 0.00000 0.00000 0.49020 0.00000 0.00000 0.50588 0.00000 0.00000 0.52157 0.00000 0.00000 0.53725 0.00000 0.00000 0.55294 0.00000 0.00000 0.56863 0.00000 0.00000 0.58431 0.00000 0.00000 0.60000 0.00000 0.00000 0.61176 0.00000 0.00000 0.62745 0.00000 0.00000 0.64314 0.00000 0.00000 0.65882 0.00000 0.00000 0.67451 0.00000 0.00000 0.69020 0.00000 0.00000 0.70588 0.00000 0.00000 0.72157 0.00000 0.00000 0.73725 0.00000 0.00000 0.75294 0.00000 0.00000 0.76863 0.00000 0.00000 0.78431 0.00000 0.00000 0.80000 0.00000 0.00000 0.81176 0.00000 0.00000 0.82745 0.00000 0.00000 0.84314 0.00000 0.00000 0.85882 0.00000 0.00000 0.87451 0.00000 0.00000 0.89020 0.00000 0.00000 0.90588 0.00000 0.00000 0.92157 0.00000 0.00000 0.93725 0.00000 0.00000 0.95294 0.00000 0.00000 0.96863 0.00000 0.00000 0.98431 0.00000 0.00000 1.00000 0.00000 0.03529 1.00000 0.00000 0.07059 1.00000 0.00000 0.10980 1.00000 0.00000 0.14510 1.00000 0.00000 0.18039 1.00000 0.00000 0.21961 1.00000 0.00000 0.25490 1.00000 0.00000 0.29412 1.00000 0.00000 0.32941 1.00000 0.00000 0.36471 1.00000 0.00000 0.40392 1.00000 0.00000 0.43922 1.00000 0.00000 0.47843 1.00000 0.00000 0.50196 1.00000 0.00000 0.52549 1.00000 0.00000 0.54902 1.00000 0.00000 0.57255 1.00000 0.00000 0.59608 1.00000 0.00000 0.61961 1.00000 0.00000 0.64314 1.00000 0.00000 0.66667 1.00000 0.00000 0.69020 1.00000 0.00000 0.71373 1.00000 0.00000 0.73725 1.00000 0.00000 0.76078 1.00000 0.00000 0.78431 1.00000 0.00000 0.80000 1.00000 0.00000 0.81569 1.00000 0.00000 0.83137 1.00000 0.00000 0.84706 1.00000 0.00000 0.86667 1.00000 0.00000 0.88235 1.00000 0.00000 0.89804 1.00000 0.00000 0.91373 1.00000 0.00000 0.93333 1.00000 0.00000 0.94902 1.00000 0.00000 0.96471 1.00000 0.00000 0.98039 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.97647 0.00000 1.00000 0.95294 0.00000 1.00000 0.92941 0.00000 1.00000 0.90588 0.00000 1.00000 0.88627 0.00000 1.00000 0.86275 0.00000 1.00000 0.83922 0.00000 1.00000 0.81569 0.00000 1.00000 0.79608 0.00000 1.00000 0.77255 0.00000 1.00000 0.74902 0.00000 1.00000 0.72549 0.00000 1.00000 0.70588 0.00000 1.00000 0.65098 0.00000 1.00000 0.59608 0.00000 1.00000 0.54118 0.00000 1.00000 0.48627 0.00000 1.00000 0.43137 0.00000 1.00000 0.37647 0.00000 1.00000 0.32549 0.00000 1.00000 0.27059 0.00000 1.00000 0.21569 0.00000 1.00000 0.16078 0.00000 1.00000 0.10588 0.00000 1.00000 0.05098 0.00000 1.00000 0.00000 0.05098 1.00000 0.00000 0.10588 1.00000 0.00000 0.16078 1.00000 0.00000 0.21569 1.00000 0.00000 0.27059 1.00000 0.00000 0.32549 1.00000 0.00000 0.37647 1.00000 0.00000 0.43137 1.00000 0.00000 0.48627 1.00000 0.00000 0.54118 1.00000 0.00000 0.59608 1.00000 0.00000 0.65098 1.00000 0.00000 0.70588 1.00000 0.00000 0.72549 1.00000 0.00000 0.74902 1.00000 0.00000 0.77255 1.00000 0.00000 0.79608 1.00000 0.00000 0.81569 1.00000 0.00000 0.83922 1.00000 0.00000 0.86275 1.00000 0.00000 0.88627 1.00000 0.00000 0.90588 1.00000 0.00000 0.92941 1.00000 0.00000 0.95294 1.00000 0.00000 0.97647 1.00000 0.00000 1.00000 1.00000 0.00000 0.99608 0.97647 0.00000 0.99608 0.95686 0.00000 0.99608 0.93333 0.00000 0.99608 0.91373 0.00000 0.99216 0.89412 0.00000 0.99216 0.87059 0.00000 0.99216 0.85098 0.00000 0.99216 0.82745 0.00000 0.98824 0.80784 0.00000 0.98824 0.78824 0.00000 0.98824 0.76471 0.00000 0.98824 0.74510 0.00000 0.98824 0.72549 0.00000 0.98824 0.70588 0.00000 0.98824 0.68627 0.00000 0.98824 0.66667 0.00000 0.98824 0.64706 0.00000 0.99216 0.62745 0.00000 0.99216 0.60784 0.00000 0.99216 0.58824 0.00000 0.99216 0.56863 0.00000 0.99608 0.54902 0.00000 0.99608 0.52941 0.00000 0.99608 0.50980 0.00000 0.99608 0.49020 0.00000 1.00000 0.47059 0.00000 1.00000 0.43137 0.00000 1.00000 0.39608 0.00000 1.00000 0.36078 0.00000 1.00000 0.32549 0.00000 1.00000 0.28627 0.00000 1.00000 0.25098 0.00000 1.00000 0.21569 0.00000 1.00000 0.18039 0.00000 1.00000 0.14118 0.00000 1.00000 0.10588 0.00000 1.00000 0.07059 0.00000 1.00000 0.03529 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.05098 1.00000 0.00000 0.10588 1.00000 0.00000 0.16078 1.00000 0.00000 0.21569 1.00000 0.00000 0.27059 1.00000 0.00000 0.32549 1.00000 0.00000 0.37647 1.00000 0.00000 0.43137 1.00000 0.00000 0.48627 1.00000 0.00000 0.54118 1.00000 0.00000 0.59608 1.00000 0.00000 0.65098 1.00000 0.00000 0.70588 1.00000 0.00000 0.72549 1.00000 0.00000 0.74902 1.00000 0.00000 0.77255 1.00000 0.00000 0.79608 1.00000 0.00000 0.81569 1.00000 0.00000 0.83922 1.00000 0.00000 0.86275 1.00000 0.00000 0.88627 1.00000 0.00000 0.90588 1.00000 0.00000 0.92941 1.00000 0.00000 0.95294 1.00000 0.00000 0.97647 1.00000 0.00000 1.00000 1.00000 0.03529 1.00000 1.00000 0.07059 1.00000 1.00000 0.10588 1.00000 1.00000 0.14118 1.00000 1.00000 0.18039 1.00000 1.00000 0.21569 1.00000 1.00000 0.25098 1.00000 1.00000 0.28627 1.00000 1.00000 0.32549 1.00000 1.00000 0.36078 1.00000 1.00000 0.39608 1.00000 1.00000 0.43137 1.00000 1.00000 0.47059 1.00000 1.00000 0.48627 1.00000 1.00000 0.50588 1.00000 1.00000 0.52157 1.00000 1.00000 0.54118 1.00000 1.00000 0.56078 1.00000 1.00000 0.57647 1.00000 1.00000 0.59608 1.00000 1.00000 0.61176 1.00000 1.00000 0.63137 1.00000 1.00000 0.65098 1.00000 1.00000 0.66667 1.00000 1.00000 0.68627 1.00000 1.00000 0.70588 1.00000 1.00000 0.74510 1.00000 1.00000 0.78824 1.00000 1.00000 0.83137 1.00000 1.00000 0.87059 1.00000 1.00000 0.91373 1.00000 1.00000 0.95686 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/ramp.iasc000066400000000000000000000060001215713201500215210ustar00rootroot00000000000000 0.00000 0.00392 0.00784 0.01176 0.01569 0.01961 0.02353 0.02745 0.03137 0.03529 0.03922 0.04314 0.04706 0.05098 0.05490 0.05882 0.06275 0.06667 0.07059 0.07451 0.07843 0.08235 0.08627 0.09020 0.09412 0.09804 0.10196 0.10588 0.10980 0.11373 0.11765 0.12157 0.12549 0.12941 0.13333 0.13725 0.14118 0.14510 0.14902 0.15294 0.15686 0.16078 0.16471 0.16863 0.17255 0.17647 0.18039 0.18431 0.18824 0.19216 0.19608 0.20000 0.20392 0.20784 0.21177 0.21569 0.21961 0.22353 0.22745 0.23137 0.23529 0.23922 0.24314 0.24706 0.25098 0.25490 0.25882 0.26275 0.26667 0.27059 0.27451 0.27843 0.28235 0.28628 0.29020 0.29412 0.29804 0.30196 0.30588 0.30980 0.31372 0.31765 0.32157 0.32549 0.32941 0.33333 0.33726 0.34118 0.34510 0.34902 0.35294 0.35686 0.36078 0.36471 0.36863 0.37255 0.37647 0.38039 0.38431 0.38823 0.39216 0.39608 0.40000 0.40392 0.40784 0.41176 0.41569 0.41961 0.42353 0.42745 0.43137 0.43529 0.43922 0.44314 0.44706 0.45098 0.45490 0.45882 0.46275 0.46667 0.47059 0.47451 0.47843 0.48235 0.48628 0.49020 0.49412 0.49804 0.50196 0.50588 0.50980 0.51372 0.51765 0.52157 0.52549 0.52941 0.53333 0.53726 0.54118 0.54510 0.54902 0.55294 0.55686 0.56078 0.56471 0.56863 0.57255 0.57647 0.58039 0.58431 0.58823 0.59216 0.59608 0.60000 0.60392 0.60784 0.61177 0.61569 0.61961 0.62353 0.62745 0.63137 0.63529 0.63922 0.64314 0.64706 0.65098 0.65490 0.65882 0.66275 0.66667 0.67059 0.67451 0.67843 0.68235 0.68627 0.69020 0.69412 0.69804 0.70196 0.70588 0.70980 0.71373 0.71765 0.72157 0.72549 0.72941 0.73333 0.73725 0.74118 0.74510 0.74902 0.75294 0.75686 0.76078 0.76471 0.76863 0.77255 0.77647 0.78039 0.78431 0.78824 0.79216 0.79608 0.80000 0.80392 0.80784 0.81176 0.81569 0.81961 0.82353 0.82745 0.83137 0.83529 0.83922 0.84314 0.84706 0.85098 0.85490 0.85882 0.86274 0.86667 0.87059 0.87451 0.87843 0.88235 0.88628 0.89020 0.89412 0.89804 0.90196 0.90588 0.90980 0.91373 0.91765 0.92157 0.92549 0.92941 0.93333 0.93725 0.94118 0.94510 0.94902 0.95294 0.95686 0.96078 0.96471 0.96863 0.97255 0.97647 0.98039 0.98431 0.98823 0.99216 0.99608 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/ramp.lasc000066400000000000000000000220001215713201500215220ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00392 0.00392 0.00392 0.00784 0.00784 0.00784 0.01176 0.01176 0.01176 0.01569 0.01569 0.01569 0.01961 0.01961 0.01961 0.02353 0.02353 0.02353 0.02745 0.02745 0.02745 0.03137 0.03137 0.03137 0.03529 0.03529 0.03529 0.03922 0.03922 0.03922 0.04314 0.04314 0.04314 0.04706 0.04706 0.04706 0.05098 0.05098 0.05098 0.05490 0.05490 0.05490 0.05882 0.05882 0.05882 0.06275 0.06275 0.06275 0.06667 0.06667 0.06667 0.07059 0.07059 0.07059 0.07451 0.07451 0.07451 0.07843 0.07843 0.07843 0.08235 0.08235 0.08235 0.08627 0.08627 0.08627 0.09020 0.09020 0.09020 0.09412 0.09412 0.09412 0.09804 0.09804 0.09804 0.10196 0.10196 0.10196 0.10588 0.10588 0.10588 0.10980 0.10980 0.10980 0.11373 0.11373 0.11373 0.11765 0.11765 0.11765 0.12157 0.12157 0.12157 0.12549 0.12549 0.12549 0.12941 0.12941 0.12941 0.13333 0.13333 0.13333 0.13725 0.13725 0.13725 0.14118 0.14118 0.14118 0.14510 0.14510 0.14510 0.14902 0.14902 0.14902 0.15294 0.15294 0.15294 0.15686 0.15686 0.15686 0.16078 0.16078 0.16078 0.16471 0.16471 0.16471 0.16863 0.16863 0.16863 0.17255 0.17255 0.17255 0.17647 0.17647 0.17647 0.18039 0.18039 0.18039 0.18431 0.18431 0.18431 0.18824 0.18824 0.18824 0.19216 0.19216 0.19216 0.19608 0.19608 0.19608 0.20000 0.20000 0.20000 0.20392 0.20392 0.20392 0.20784 0.20784 0.20784 0.21177 0.21177 0.21177 0.21569 0.21569 0.21569 0.21961 0.21961 0.21961 0.22353 0.22353 0.22353 0.22745 0.22745 0.22745 0.23137 0.23137 0.23137 0.23529 0.23529 0.23529 0.23922 0.23922 0.23922 0.24314 0.24314 0.24314 0.24706 0.24706 0.24706 0.25098 0.25098 0.25098 0.25490 0.25490 0.25490 0.25882 0.25882 0.25882 0.26275 0.26275 0.26275 0.26667 0.26667 0.26667 0.27059 0.27059 0.27059 0.27451 0.27451 0.27451 0.27843 0.27843 0.27843 0.28235 0.28235 0.28235 0.28628 0.28628 0.28628 0.29020 0.29020 0.29020 0.29412 0.29412 0.29412 0.29804 0.29804 0.29804 0.30196 0.30196 0.30196 0.30588 0.30588 0.30588 0.30980 0.30980 0.30980 0.31372 0.31372 0.31372 0.31765 0.31765 0.31765 0.32157 0.32157 0.32157 0.32549 0.32549 0.32549 0.32941 0.32941 0.32941 0.33333 0.33333 0.33333 0.33726 0.33726 0.33726 0.34118 0.34118 0.34118 0.34510 0.34510 0.34510 0.34902 0.34902 0.34902 0.35294 0.35294 0.35294 0.35686 0.35686 0.35686 0.36078 0.36078 0.36078 0.36471 0.36471 0.36471 0.36863 0.36863 0.36863 0.37255 0.37255 0.37255 0.37647 0.37647 0.37647 0.38039 0.38039 0.38039 0.38431 0.38431 0.38431 0.38823 0.38823 0.38823 0.39216 0.39216 0.39216 0.39608 0.39608 0.39608 0.40000 0.40000 0.40000 0.40392 0.40392 0.40392 0.40784 0.40784 0.40784 0.41176 0.41176 0.41176 0.41569 0.41569 0.41569 0.41961 0.41961 0.41961 0.42353 0.42353 0.42353 0.42745 0.42745 0.42745 0.43137 0.43137 0.43137 0.43529 0.43529 0.43529 0.43922 0.43922 0.43922 0.44314 0.44314 0.44314 0.44706 0.44706 0.44706 0.45098 0.45098 0.45098 0.45490 0.45490 0.45490 0.45882 0.45882 0.45882 0.46275 0.46275 0.46275 0.46667 0.46667 0.46667 0.47059 0.47059 0.47059 0.47451 0.47451 0.47451 0.47843 0.47843 0.47843 0.48235 0.48235 0.48235 0.48628 0.48628 0.48628 0.49020 0.49020 0.49020 0.49412 0.49412 0.49412 0.49804 0.49804 0.49804 0.50196 0.50196 0.50196 0.50588 0.50588 0.50588 0.50980 0.50980 0.50980 0.51372 0.51372 0.51372 0.51765 0.51765 0.51765 0.52157 0.52157 0.52157 0.52549 0.52549 0.52549 0.52941 0.52941 0.52941 0.53333 0.53333 0.53333 0.53726 0.53726 0.53726 0.54118 0.54118 0.54118 0.54510 0.54510 0.54510 0.54902 0.54902 0.54902 0.55294 0.55294 0.55294 0.55686 0.55686 0.55686 0.56078 0.56078 0.56078 0.56471 0.56471 0.56471 0.56863 0.56863 0.56863 0.57255 0.57255 0.57255 0.57647 0.57647 0.57647 0.58039 0.58039 0.58039 0.58431 0.58431 0.58431 0.58823 0.58823 0.58823 0.59216 0.59216 0.59216 0.59608 0.59608 0.59608 0.60000 0.60000 0.60000 0.60392 0.60392 0.60392 0.60784 0.60784 0.60784 0.61177 0.61177 0.61177 0.61569 0.61569 0.61569 0.61961 0.61961 0.61961 0.62353 0.62353 0.62353 0.62745 0.62745 0.62745 0.63137 0.63137 0.63137 0.63529 0.63529 0.63529 0.63922 0.63922 0.63922 0.64314 0.64314 0.64314 0.64706 0.64706 0.64706 0.65098 0.65098 0.65098 0.65490 0.65490 0.65490 0.65882 0.65882 0.65882 0.66275 0.66275 0.66275 0.66667 0.66667 0.66667 0.67059 0.67059 0.67059 0.67451 0.67451 0.67451 0.67843 0.67843 0.67843 0.68235 0.68235 0.68235 0.68627 0.68627 0.68627 0.69020 0.69020 0.69020 0.69412 0.69412 0.69412 0.69804 0.69804 0.69804 0.70196 0.70196 0.70196 0.70588 0.70588 0.70588 0.70980 0.70980 0.70980 0.71373 0.71373 0.71373 0.71765 0.71765 0.71765 0.72157 0.72157 0.72157 0.72549 0.72549 0.72549 0.72941 0.72941 0.72941 0.73333 0.73333 0.73333 0.73725 0.73725 0.73725 0.74118 0.74118 0.74118 0.74510 0.74510 0.74510 0.74902 0.74902 0.74902 0.75294 0.75294 0.75294 0.75686 0.75686 0.75686 0.76078 0.76078 0.76078 0.76471 0.76471 0.76471 0.76863 0.76863 0.76863 0.77255 0.77255 0.77255 0.77647 0.77647 0.77647 0.78039 0.78039 0.78039 0.78431 0.78431 0.78431 0.78824 0.78824 0.78824 0.79216 0.79216 0.79216 0.79608 0.79608 0.79608 0.80000 0.80000 0.80000 0.80392 0.80392 0.80392 0.80784 0.80784 0.80784 0.81176 0.81176 0.81176 0.81569 0.81569 0.81569 0.81961 0.81961 0.81961 0.82353 0.82353 0.82353 0.82745 0.82745 0.82745 0.83137 0.83137 0.83137 0.83529 0.83529 0.83529 0.83922 0.83922 0.83922 0.84314 0.84314 0.84314 0.84706 0.84706 0.84706 0.85098 0.85098 0.85098 0.85490 0.85490 0.85490 0.85882 0.85882 0.85882 0.86274 0.86274 0.86274 0.86667 0.86667 0.86667 0.87059 0.87059 0.87059 0.87451 0.87451 0.87451 0.87843 0.87843 0.87843 0.88235 0.88235 0.88235 0.88628 0.88628 0.88628 0.89020 0.89020 0.89020 0.89412 0.89412 0.89412 0.89804 0.89804 0.89804 0.90196 0.90196 0.90196 0.90588 0.90588 0.90588 0.90980 0.90980 0.90980 0.91373 0.91373 0.91373 0.91765 0.91765 0.91765 0.92157 0.92157 0.92157 0.92549 0.92549 0.92549 0.92941 0.92941 0.92941 0.93333 0.93333 0.93333 0.93725 0.93725 0.93725 0.94118 0.94118 0.94118 0.94510 0.94510 0.94510 0.94902 0.94902 0.94902 0.95294 0.95294 0.95294 0.95686 0.95686 0.95686 0.96078 0.96078 0.96078 0.96471 0.96471 0.96471 0.96863 0.96863 0.96863 0.97255 0.97255 0.97255 0.97647 0.97647 0.97647 0.98039 0.98039 0.98039 0.98431 0.98431 0.98431 0.98823 0.98823 0.98823 0.99216 0.99216 0.99216 0.99608 0.99608 0.99608 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/random.lasc000066400000000000000000000324001215713201500220500ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.51765 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98431 0.81176 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.76863 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 0.89804 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 0.92157 0.61961 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.65882 0.59608 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.26275 0.87843 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.74118 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.65490 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.36078 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.98431 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.99608 0.97647 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98824 0.77647 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.36863 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.46667 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.91373 0.00000 0.97255 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.53333 0.00000 0.87451 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.80392 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.13725 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/random1.lasc000066400000000000000000000324001215713201500221310ustar00rootroot00000000000000 0.00000 0.00000 0.16471 0.00000 0.00000 0.16471 0.00000 0.00000 0.16471 0.00000 0.00000 0.16471 0.00000 0.00000 0.16471 0.00000 0.00000 0.16471 0.00000 0.00000 0.16471 0.00000 0.00000 0.16471 0.23137 0.00000 0.31765 0.23137 0.00000 0.31765 0.23137 0.00000 0.31765 0.23137 0.00000 0.31765 0.23137 0.00000 0.31765 0.23137 0.00000 0.31765 0.23137 0.00000 0.31765 0.23137 0.00000 0.31765 0.47059 0.00000 0.47451 0.47059 0.00000 0.47451 0.47059 0.00000 0.47451 0.47059 0.00000 0.47451 0.47059 0.00000 0.47451 0.47059 0.00000 0.47451 0.47059 0.00000 0.47451 0.47059 0.00000 0.47451 0.47059 0.00000 0.63922 0.47059 0.00000 0.63922 0.47059 0.00000 0.63922 0.47059 0.00000 0.63922 0.47059 0.00000 0.63922 0.47059 0.00000 0.63922 0.47059 0.00000 0.63922 0.47059 0.00000 0.63922 0.23137 0.00000 0.80392 0.23137 0.00000 0.80392 0.23137 0.00000 0.80392 0.23137 0.00000 0.80392 0.23137 0.00000 0.80392 0.23137 0.00000 0.80392 0.23137 0.00000 0.80392 0.23137 0.00000 0.80392 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.05098 0.85098 0.00000 0.05098 0.85098 0.00000 0.05098 0.85098 0.00000 0.05098 0.85098 0.00000 0.05098 0.85098 0.00000 0.05098 0.85098 0.00000 0.05098 0.85098 0.00000 0.05098 0.85098 0.00000 0.19608 0.69412 0.00000 0.19608 0.69412 0.00000 0.19608 0.69412 0.00000 0.19608 0.69412 0.00000 0.19608 0.69412 0.00000 0.19608 0.69412 0.00000 0.19608 0.69412 0.00000 0.19608 0.69412 0.00000 0.33333 0.56471 0.00000 0.33333 0.56471 0.00000 0.33333 0.56471 0.00000 0.33333 0.56471 0.00000 0.33333 0.56471 0.00000 0.33333 0.56471 0.00000 0.33333 0.56471 0.00000 0.33333 0.56471 0.00000 0.42353 0.44706 0.00000 0.42353 0.44706 0.00000 0.42353 0.44706 0.00000 0.42353 0.44706 0.00000 0.42353 0.44706 0.00000 0.42353 0.44706 0.00000 0.42353 0.44706 0.00000 0.42353 0.44706 0.00000 0.50980 0.35294 0.00000 0.50980 0.35294 0.00000 0.50980 0.35294 0.00000 0.50980 0.35294 0.00000 0.50980 0.35294 0.00000 0.50980 0.35294 0.00000 0.50980 0.35294 0.00000 0.50980 0.35294 0.00000 0.59216 0.25882 0.00000 0.59216 0.25882 0.00000 0.59216 0.25882 0.00000 0.59216 0.25882 0.00000 0.59216 0.25882 0.00000 0.59216 0.25882 0.00000 0.59216 0.25882 0.00000 0.59216 0.25882 0.00000 0.67059 0.16471 0.00000 0.67059 0.16471 0.00000 0.67059 0.16471 0.00000 0.67059 0.16471 0.00000 0.67059 0.16471 0.00000 0.67059 0.16471 0.00000 0.67059 0.16471 0.00000 0.67059 0.16471 0.00000 0.74902 0.05490 0.00000 0.74902 0.05490 0.00000 0.74902 0.05490 0.00000 0.74902 0.05490 0.00000 0.74902 0.05490 0.00000 0.74902 0.05490 0.00000 0.74902 0.05490 0.00000 0.74902 0.05490 0.00000 0.82353 0.00000 0.00000 0.82353 0.00000 0.00000 0.82353 0.00000 0.00000 0.82353 0.00000 0.00000 0.82353 0.00000 0.00000 0.82353 0.00000 0.00000 0.82353 0.00000 0.00000 0.82353 0.00000 0.00000 0.89804 0.00000 0.00000 0.89804 0.00000 0.00000 0.89804 0.00000 0.00000 0.89804 0.00000 0.00000 0.89804 0.00000 0.00000 0.89804 0.00000 0.00000 0.89804 0.00000 0.00000 0.89804 0.00000 0.00000 0.97255 0.00000 0.00000 0.97255 0.00000 0.00000 0.97255 0.00000 0.00000 0.97255 0.00000 0.00000 0.97255 0.00000 0.00000 0.97255 0.00000 0.00000 0.97255 0.00000 0.00000 0.97255 0.00000 0.05490 0.95294 0.00000 0.05490 0.95294 0.00000 0.05490 0.95294 0.00000 0.05490 0.95294 0.00000 0.05490 0.95294 0.00000 0.05490 0.95294 0.00000 0.05490 0.95294 0.00000 0.05490 0.95294 0.00000 0.14902 0.88235 0.00000 0.14902 0.88235 0.00000 0.14902 0.88235 0.00000 0.14902 0.88235 0.00000 0.14902 0.88235 0.00000 0.14902 0.88235 0.00000 0.14902 0.88235 0.00000 0.14902 0.88235 0.00000 0.41176 0.80784 0.00000 0.41176 0.80784 0.00000 0.41176 0.80784 0.00000 0.41176 0.80784 0.00000 0.41176 0.80784 0.00000 0.41176 0.80784 0.00000 0.41176 0.80784 0.00000 0.41176 0.80784 0.00000 0.70980 0.81176 0.00000 0.70980 0.81176 0.00000 0.70980 0.81176 0.00000 0.70980 0.81176 0.00000 0.70980 0.81176 0.00000 0.70980 0.81176 0.00000 0.70980 0.81176 0.00000 0.70980 0.81176 0.00000 1.00000 0.93333 0.00000 1.00000 0.93333 0.00000 1.00000 0.93333 0.00000 1.00000 0.93333 0.00000 1.00000 0.93333 0.00000 1.00000 0.93333 0.00000 1.00000 0.93333 0.00000 1.00000 0.93333 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.70196 0.00000 1.00000 0.70196 0.00000 1.00000 0.70196 0.00000 1.00000 0.70196 0.00000 1.00000 0.70196 0.00000 1.00000 0.70196 0.00000 1.00000 0.70196 0.00000 1.00000 0.70196 0.00000 1.00000 0.39216 0.00000 1.00000 0.39216 0.00000 1.00000 0.39216 0.00000 1.00000 0.39216 0.00000 1.00000 0.39216 0.00000 1.00000 0.39216 0.00000 1.00000 0.39216 0.00000 1.00000 0.39216 0.00000 1.00000 0.09804 0.00000 1.00000 0.09804 0.00000 1.00000 0.09804 0.00000 1.00000 0.09804 0.00000 1.00000 0.09804 0.00000 1.00000 0.09804 0.00000 1.00000 0.09804 0.00000 1.00000 0.09804 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.97647 0.00000 0.00000 0.91373 0.00000 0.00000 0.91373 0.00000 0.00000 0.91373 0.00000 0.00000 0.91373 0.00000 0.00000 0.91373 0.00000 0.00000 0.91373 0.00000 0.00000 0.91373 0.00000 0.00000 0.91373 0.00000 0.00000 0.85098 0.00000 0.00000 0.85098 0.00000 0.00000 0.85098 0.00000 0.00000 0.85098 0.00000 0.00000 0.85098 0.00000 0.00000 0.85098 0.00000 0.00000 0.85098 0.00000 0.00000 0.85098 0.00000 0.00000 0.78824 0.00000 0.00000 0.78824 0.00000 0.00000 0.78824 0.00000 0.00000 0.78824 0.00000 0.00000 0.78824 0.00000 0.00000 0.78824 0.00000 0.00000 0.78824 0.00000 0.00000 0.78824 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/random2.lasc000066400000000000000000000324001215713201500221320ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00392 0.47059 0.00392 0.00392 0.47059 0.00392 0.00392 0.47059 0.00392 0.00392 0.47059 0.00392 0.00392 0.47059 0.00392 0.00392 0.47059 0.00392 0.00392 0.47059 0.00392 0.00392 0.47059 0.00392 0.00392 0.47059 0.00392 0.00392 0.47059 0.00392 0.00392 0.62745 0.00392 0.00392 0.62745 0.00392 0.00392 0.62745 0.00392 0.00392 0.62745 0.00392 0.00392 0.62745 0.00392 0.00392 0.62745 0.00392 0.00392 0.62745 0.00392 0.00392 0.62745 0.00392 0.00392 0.62745 0.00392 0.00392 0.62745 0.00392 0.00392 0.78431 0.00392 0.00392 0.78431 0.00392 0.00392 0.78431 0.00392 0.00392 0.78431 0.00392 0.00392 0.78431 0.00392 0.00392 0.78431 0.00392 0.00392 0.78431 0.00392 0.00392 0.78431 0.00392 0.00392 0.78431 0.00392 0.00392 0.78431 0.00392 0.00392 1.00000 0.00392 0.00392 1.00000 0.00392 0.00392 1.00000 0.00392 0.00392 1.00000 0.00392 0.00392 1.00000 0.00392 0.00392 1.00000 0.00392 0.00392 1.00000 0.00392 0.00392 1.00000 0.00392 0.00392 1.00000 0.00392 0.00392 1.00000 0.00392 0.00392 0.86275 0.47059 0.00392 0.86275 0.47059 0.00392 0.86275 0.47059 0.00392 0.86275 0.47059 0.00392 0.86275 0.47059 0.00392 0.86275 0.47059 0.00392 0.86275 0.47059 0.00392 0.86275 0.47059 0.00392 0.86275 0.47059 0.00392 0.86275 0.47059 0.00000 0.78431 0.62745 0.00000 0.78431 0.62745 0.00000 0.78431 0.62745 0.00000 0.78431 0.62745 0.00000 0.78431 0.62745 0.00000 0.78431 0.62745 0.00000 0.78431 0.62745 0.00000 0.78431 0.62745 0.00000 0.78431 0.62745 0.00000 0.78431 0.62745 0.00000 0.70588 0.78431 0.00000 0.70588 0.78431 0.00000 0.70588 0.78431 0.00000 0.70588 0.78431 0.00000 0.70588 0.78431 0.00000 0.70588 0.78431 0.00000 0.70588 0.78431 0.00000 0.70588 0.78431 0.00000 0.70588 0.78431 0.00000 0.70588 0.78431 0.00000 0.62745 1.00000 0.00000 0.62745 1.00000 0.00000 0.62745 1.00000 0.00000 0.62745 1.00000 0.00000 0.62745 1.00000 0.00000 0.62745 1.00000 0.00000 0.62745 1.00000 0.00000 0.62745 1.00000 0.00000 0.62745 1.00000 0.00000 0.62745 1.00000 0.23529 0.47059 1.00000 0.23529 0.47059 1.00000 0.23529 0.47059 1.00000 0.23529 0.47059 1.00000 0.23529 0.47059 1.00000 0.23529 0.47059 1.00000 0.23529 0.47059 1.00000 0.23529 0.47059 1.00000 0.23529 0.47059 1.00000 0.23529 0.47059 1.00000 0.23529 0.00392 1.00000 0.23529 0.00392 1.00000 0.23529 0.00392 1.00000 0.23529 0.00392 1.00000 0.23529 0.00392 1.00000 0.23529 0.00392 1.00000 0.23529 0.00392 1.00000 0.23529 0.00392 1.00000 0.23529 0.00392 1.00000 0.23529 0.00392 1.00000 0.47059 0.00392 0.78431 0.47059 0.00392 0.78431 0.47059 0.00392 0.78431 0.47059 0.00392 0.78431 0.47059 0.00392 0.78431 0.47059 0.00392 0.78431 0.47059 0.00392 0.78431 0.47059 0.00392 0.78431 0.47059 0.00392 0.78431 0.47059 0.00392 0.78431 0.62745 0.00392 0.62745 0.62745 0.00392 0.62745 0.62745 0.00392 0.62745 0.62745 0.00392 0.62745 0.62745 0.00392 0.62745 0.62745 0.00392 0.62745 0.62745 0.00392 0.62745 0.62745 0.00392 0.62745 0.62745 0.00392 0.62745 0.62745 0.00392 0.62745 0.78431 0.00392 0.47059 0.78431 0.00392 0.47059 0.78431 0.00392 0.47059 0.78431 0.00392 0.47059 0.78431 0.00392 0.47059 0.78431 0.00392 0.47059 0.78431 0.00392 0.47059 0.78431 0.00392 0.47059 0.78431 0.00392 0.47059 0.78431 0.00392 0.47059 0.90196 0.11765 0.23529 0.90196 0.11765 0.23529 0.90196 0.11765 0.23529 0.90196 0.11765 0.23529 0.90196 0.11765 0.23529 0.90196 0.11765 0.23529 0.90196 0.11765 0.23529 0.90196 0.11765 0.23529 0.90196 0.11765 0.23529 0.90196 0.11765 0.23529 1.00000 0.23529 0.00000 1.00000 0.23529 0.00000 1.00000 0.23529 0.00000 1.00000 0.23529 0.00000 1.00000 0.23529 0.00000 1.00000 0.23529 0.00000 1.00000 0.23529 0.00000 1.00000 0.23529 0.00000 1.00000 0.23529 0.00000 1.00000 0.23529 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 0.99216 0.59608 0.00000 0.99216 0.59608 0.00000 0.99216 0.59608 0.00000 0.99216 0.59608 0.00000 0.99216 0.59608 0.00000 0.99216 0.59608 0.00000 0.99216 0.59608 0.00000 0.99216 0.59608 0.00000 0.99216 0.59608 0.00000 0.99216 0.59608 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98039 0.90196 0.00000 0.98039 0.90196 0.00000 0.98039 0.90196 0.00000 0.98039 0.90196 0.00000 0.98039 0.90196 0.00000 0.98039 0.90196 0.00000 0.98039 0.90196 0.00000 0.98039 0.90196 0.00000 0.98039 0.90196 0.00000 0.98039 0.90196 0.00000 0.98039 0.98039 0.47059 0.98039 0.98039 0.47059 0.98039 0.98039 0.47059 0.98039 0.98039 0.47059 0.98039 0.98039 0.47059 0.98039 0.98039 0.47059 0.98039 0.98039 0.47059 0.98039 0.98039 0.47059 0.98039 0.98039 0.47059 0.98039 0.98039 0.47059 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/random3.lasc000066400000000000000000000324001215713201500221330ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.47059 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.47059 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 0.78431 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.47059 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/random4.lasc000066400000000000000000000324001215713201500221340ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.70588 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.00000 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.47059 0.00000 0.86275 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 0.70588 0.00000 0.90196 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 1.00000 0.47059 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98824 0.72549 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 0.98431 0.85098 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.70588 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 0.70588 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.47059 0.78431 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.62745 0.62745 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 0.78431 0.47059 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.70588 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 0.86275 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/random5.lasc000066400000000000000000000324001215713201500221350ustar00rootroot00000000000000 0.00000 0.00000 1.00000 0.00000 0.00000 0.99216 0.00000 0.00000 0.98824 0.00392 0.00000 0.98431 0.00392 0.00000 0.98039 0.00784 0.00000 0.97647 0.00784 0.00000 0.96863 0.01176 0.00000 0.96471 0.01569 0.00000 0.96078 0.01569 0.00000 0.95686 0.01961 0.00000 0.95294 0.01961 0.00000 0.94510 0.02353 0.00784 0.94118 0.02745 0.01569 0.93725 0.02745 0.02745 0.93333 0.03137 0.03922 0.92941 0.03529 0.05098 0.92157 0.03529 0.06667 0.91765 0.03922 0.08235 0.91373 0.04314 0.09804 0.90980 0.04706 0.11765 0.90588 0.04706 0.09804 0.90196 0.05098 0.08235 0.89412 0.05490 0.06667 0.89020 0.05490 0.05098 0.88627 0.05882 0.03922 0.88235 0.06275 0.02745 0.87843 0.06667 0.01569 0.87059 0.07059 0.00784 0.86667 0.07059 0.00000 0.86275 0.07451 0.00000 0.85882 0.07843 0.00392 0.85490 0.08235 0.01176 0.85098 0.08235 0.02353 0.84314 0.08627 0.03922 0.83922 0.09020 0.05490 0.83529 0.09412 0.07059 0.83137 0.09804 0.09020 0.82745 0.09804 0.10980 0.82353 0.10196 0.13333 0.81569 0.10588 0.15686 0.81176 0.10980 0.13333 0.80784 0.11373 0.10980 0.80392 0.11765 0.09020 0.80000 0.11765 0.07059 0.79608 0.12157 0.05490 0.79216 0.12549 0.03922 0.78431 0.12941 0.02353 0.78039 0.13333 0.01176 0.77647 0.13725 0.00392 0.77255 0.14118 0.00000 0.76863 0.14118 0.00392 0.76471 0.14510 0.01569 0.75686 0.14902 0.03137 0.75294 0.15294 0.04706 0.74902 0.15686 0.06667 0.74510 0.16078 0.09020 0.74118 0.16471 0.11373 0.73725 0.16863 0.13725 0.73333 0.17255 0.16471 0.72549 0.17255 0.19608 0.72157 0.17647 0.16471 0.71765 0.18039 0.13725 0.71373 0.18431 0.11373 0.70980 0.18824 0.09020 0.70588 0.19216 0.06667 0.70196 0.19608 0.04706 0.69804 0.20000 0.03137 0.69020 0.20392 0.01569 0.68627 0.20784 0.00392 0.68235 0.21176 0.00000 0.67843 0.21176 0.00784 0.67451 0.21569 0.02353 0.67059 0.21961 0.04314 0.66667 0.22353 0.06667 0.66275 0.22745 0.09412 0.65490 0.23137 0.12549 0.65098 0.23529 0.15686 0.64706 0.23922 0.19608 0.64314 0.24314 0.23137 0.63922 0.24706 0.27451 0.63529 0.25098 0.23137 0.63137 0.25490 0.19608 0.62745 0.25882 0.15686 0.61961 0.26275 0.12549 0.61569 0.26667 0.09412 0.61176 0.27059 0.06667 0.60784 0.27451 0.04314 0.60392 0.27843 0.02353 0.60000 0.28235 0.00784 0.59608 0.28627 0.00000 0.59216 0.29020 0.00784 0.58824 0.29412 0.03137 0.58431 0.29804 0.05490 0.57647 0.29804 0.08627 0.57255 0.30196 0.12157 0.56863 0.30588 0.16078 0.56471 0.30980 0.20392 0.56078 0.31373 0.25098 0.55686 0.31765 0.29804 0.55294 0.32157 0.35294 0.54902 0.32549 0.29804 0.54510 0.32941 0.25098 0.54118 0.33333 0.20392 0.53725 0.33725 0.16078 0.52941 0.34118 0.12157 0.52549 0.34510 0.08627 0.52157 0.34902 0.05490 0.51765 0.35294 0.03137 0.51373 0.35686 0.00784 0.50980 0.36078 0.00000 0.50588 0.36471 0.01176 0.50196 0.37255 0.03529 0.49804 0.37647 0.07059 0.49412 0.38039 0.10588 0.49020 0.38431 0.14902 0.48627 0.38824 0.20000 0.48235 0.39216 0.25098 0.47843 0.39608 0.30588 0.47059 0.40000 0.36471 0.46667 0.40392 0.43137 0.46275 0.40784 0.36471 0.45882 0.41176 0.30588 0.45490 0.41569 0.25098 0.45098 0.41961 0.20000 0.44706 0.42353 0.14902 0.44314 0.42745 0.10588 0.43922 0.43137 0.07059 0.43529 0.43529 0.03529 0.43137 0.43922 0.01176 0.42745 0.44314 0.00000 0.42353 0.44706 0.01569 0.41961 0.45098 0.04314 0.41569 0.45490 0.08235 0.41176 0.45882 0.12549 0.40784 0.46275 0.17647 0.40392 0.46667 0.23529 0.40000 0.47059 0.29804 0.39608 0.47843 0.36471 0.39216 0.48235 0.43137 0.38824 0.48627 0.50980 0.38431 0.49020 0.43137 0.38039 0.49412 0.36471 0.37647 0.49804 0.29804 0.37255 0.50196 0.23529 0.36471 0.50588 0.17647 0.36078 0.50980 0.12549 0.35686 0.51373 0.08235 0.35294 0.51765 0.04314 0.34902 0.52157 0.01569 0.34510 0.52549 0.00000 0.34118 0.52941 0.01569 0.33725 0.53725 0.05098 0.33333 0.54118 0.09412 0.32941 0.54510 0.14510 0.32549 0.54902 0.20784 0.32157 0.55294 0.27059 0.31765 0.55686 0.34118 0.31373 0.56078 0.41961 0.30980 0.56471 0.50196 0.30588 0.56863 0.58824 0.30196 0.57255 0.50196 0.29804 0.57647 0.41961 0.29804 0.58431 0.34118 0.29412 0.58824 0.27059 0.29020 0.59216 0.20784 0.28627 0.59608 0.14510 0.28235 0.60000 0.09412 0.27843 0.60392 0.05098 0.27451 0.60784 0.01569 0.27059 0.61176 0.00000 0.26667 0.61569 0.01961 0.26275 0.61961 0.05882 0.25882 0.62745 0.10588 0.25490 0.63137 0.16863 0.25098 0.63529 0.23529 0.24706 0.63922 0.30980 0.24314 0.64314 0.38824 0.23922 0.64706 0.47451 0.23529 0.65098 0.56863 0.23137 0.65490 0.66667 0.22745 0.66275 0.56863 0.22353 0.66667 0.47451 0.21961 0.67059 0.38824 0.21569 0.67451 0.30980 0.21176 0.67843 0.23529 0.21176 0.68235 0.16863 0.20784 0.68627 0.10588 0.20392 0.69020 0.05882 0.20000 0.69804 0.01961 0.19608 0.70196 0.00000 0.19216 0.70588 0.02353 0.18824 0.70980 0.06275 0.18431 0.71373 0.12157 0.18039 0.71765 0.18824 0.17647 0.72157 0.26275 0.17255 0.72549 0.34510 0.17255 0.73333 0.43529 0.16863 0.73725 0.52941 0.16471 0.74118 0.63529 0.16078 0.74510 0.74510 0.15686 0.74902 0.63529 0.15294 0.75294 0.52941 0.14902 0.75686 0.43529 0.14510 0.76471 0.34510 0.14118 0.76863 0.26275 0.14118 0.77255 0.18824 0.13725 0.77647 0.12157 0.13333 0.78039 0.06275 0.12941 0.78431 0.02353 0.12549 0.79216 0.00000 0.12157 0.79608 0.02353 0.11765 0.80000 0.07059 0.11765 0.80392 0.13333 0.11373 0.80784 0.20784 0.10980 0.81176 0.29020 0.10588 0.81569 0.38039 0.10196 0.82353 0.47843 0.09804 0.82745 0.58824 0.09804 0.83137 0.70196 0.09412 0.83529 0.82353 0.09020 0.83922 0.70196 0.08627 0.84314 0.58824 0.08235 0.85098 0.47843 0.08235 0.85490 0.38039 0.07843 0.85882 0.29020 0.07451 0.86275 0.20784 0.07059 0.86667 0.13333 0.07059 0.87059 0.07059 0.06667 0.87843 0.02353 0.06275 0.88235 0.00000 0.05882 0.88627 0.02745 0.05490 0.89020 0.07843 0.05490 0.89412 0.14510 0.05098 0.90196 0.22745 0.04706 0.90588 0.31765 0.04706 0.90980 0.41569 0.04314 0.91373 0.52549 0.03922 0.91765 0.64314 0.03529 0.92157 0.76863 0.03529 0.92941 0.90196 0.03137 0.93333 0.76863 0.02745 0.93725 0.64314 0.02745 0.94118 0.52549 0.02353 0.94510 0.41569 0.01961 0.95294 0.31765 0.01961 0.95686 0.25882 0.01569 0.96078 0.23137 0.01569 0.96471 0.23922 0.01176 0.96863 0.27843 0.00784 0.97647 0.35294 0.00784 0.98039 0.46275 0.00392 0.98431 0.58431 0.00392 0.98824 0.71373 0.00000 0.99216 0.85098 0.00000 1.00000 1.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/random6.lasc000066400000000000000000000324001215713201500221360ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.14118 0.00000 0.00000 0.28235 0.00000 0.00000 0.42353 0.00000 0.00000 0.56471 0.00000 0.00000 0.70588 0.00000 0.00000 0.84706 0.00000 0.00000 0.98824 0.00000 0.00000 0.00000 0.14118 0.00000 0.14118 0.14118 0.00000 0.28235 0.14118 0.00000 0.42353 0.14118 0.00000 0.56471 0.14118 0.00000 0.70588 0.14118 0.00000 0.84706 0.14118 0.00000 0.98824 0.14118 0.00000 0.00000 0.28235 0.00000 0.14118 0.28235 0.00000 0.28235 0.28235 0.00000 0.42353 0.28235 0.00000 0.56471 0.28235 0.00000 0.70588 0.28235 0.00000 0.84706 0.28235 0.00000 0.98824 0.28235 0.00000 0.00000 0.42353 0.00000 0.14118 0.42353 0.00000 0.28235 0.42353 0.00000 0.42353 0.42353 0.00000 0.56471 0.42353 0.00000 0.70588 0.42353 0.00000 0.84706 0.42353 0.00000 0.98824 0.42353 0.00000 0.00000 0.56471 0.00000 0.14118 0.56471 0.00000 0.28235 0.56471 0.00000 0.42353 0.56471 0.00000 0.56471 0.56471 0.00000 0.70588 0.56471 0.00000 0.84706 0.56471 0.00000 0.98824 0.56471 0.00000 0.00000 0.70588 0.00000 0.14118 0.70588 0.00000 0.28235 0.70588 0.00000 0.42353 0.70588 0.00000 0.56471 0.70588 0.00000 0.70588 0.70588 0.00000 0.84706 0.70588 0.00000 0.98824 0.70588 0.00000 0.00000 0.84706 0.00000 0.14118 0.84706 0.00000 0.28235 0.84706 0.00000 0.42353 0.84706 0.00000 0.56471 0.84706 0.00000 0.70588 0.84706 0.00000 0.84706 0.84706 0.00000 0.98824 0.84706 0.00000 0.00000 0.98824 0.00000 0.14118 0.98824 0.00000 0.28235 0.98824 0.00000 0.42353 0.98824 0.00000 0.56471 0.98824 0.00000 0.70588 0.98824 0.00000 0.84706 0.98824 0.00000 0.98824 0.98824 0.00000 0.00000 0.00000 0.32941 0.14118 0.00000 0.32941 0.28235 0.00000 0.32941 0.42353 0.00000 0.32941 0.56471 0.00000 0.32941 0.70588 0.00000 0.32941 0.84706 0.00000 0.32941 0.98824 0.00000 0.32941 0.00000 0.14118 0.32941 0.14118 0.14118 0.32941 0.28235 0.14118 0.32941 0.42353 0.14118 0.32941 0.56471 0.14118 0.32941 0.70588 0.14118 0.32941 0.84706 0.14118 0.32941 0.98824 0.14118 0.32941 0.00000 0.28235 0.32941 0.14118 0.28235 0.32941 0.28235 0.28235 0.32941 0.42353 0.28235 0.32941 0.56471 0.28235 0.32941 0.70588 0.28235 0.32941 0.84706 0.28235 0.32941 0.98824 0.28235 0.32941 0.00000 0.42353 0.32941 0.14118 0.42353 0.32941 0.28235 0.42353 0.32941 0.42353 0.42353 0.32941 0.56471 0.42353 0.32941 0.70588 0.42353 0.32941 0.84706 0.42353 0.32941 0.98824 0.42353 0.32941 0.00000 0.56471 0.32941 0.14118 0.56471 0.32941 0.28235 0.56471 0.32941 0.42353 0.56471 0.32941 0.56471 0.56471 0.32941 0.70588 0.56471 0.32941 0.84706 0.56471 0.32941 0.98824 0.56471 0.32941 0.00000 0.70588 0.32941 0.14118 0.70588 0.32941 0.28235 0.70588 0.32941 0.42353 0.70588 0.32941 0.56471 0.70588 0.32941 0.70588 0.70588 0.32941 0.84706 0.70588 0.32941 0.98824 0.70588 0.32941 0.00000 0.84706 0.32941 0.14118 0.84706 0.32941 0.28235 0.84706 0.32941 0.42353 0.84706 0.32941 0.56471 0.84706 0.32941 0.70588 0.84706 0.32941 0.84706 0.84706 0.32941 0.98824 0.84706 0.32941 0.00000 0.98824 0.32941 0.14118 0.98824 0.32941 0.28235 0.98824 0.32941 0.42353 0.98824 0.32941 0.56471 0.98824 0.32941 0.70588 0.98824 0.32941 0.84706 0.98824 0.32941 0.98824 0.98824 0.32941 0.00000 0.00000 0.65882 0.14118 0.00000 0.65882 0.28235 0.00000 0.65882 0.42353 0.00000 0.65882 0.56471 0.00000 0.65882 0.70588 0.00000 0.65882 0.84706 0.00000 0.65882 0.98824 0.00000 0.65882 0.00000 0.14118 0.65882 0.14118 0.14118 0.65882 0.28235 0.14118 0.65882 0.42353 0.14118 0.65882 0.56471 0.14118 0.65882 0.70588 0.14118 0.65882 0.84706 0.14118 0.65882 0.98824 0.14118 0.65882 0.00000 0.28235 0.65882 0.14118 0.28235 0.65882 0.28235 0.28235 0.65882 0.42353 0.28235 0.65882 0.56471 0.28235 0.65882 0.70588 0.28235 0.65882 0.84706 0.28235 0.65882 0.98824 0.28235 0.65882 0.00000 0.42353 0.65882 0.14118 0.42353 0.65882 0.28235 0.42353 0.65882 0.42353 0.42353 0.65882 0.56471 0.42353 0.65882 0.70588 0.42353 0.65882 0.84706 0.42353 0.65882 0.98824 0.42353 0.65882 0.00000 0.56471 0.65882 0.14118 0.56471 0.65882 0.28235 0.56471 0.65882 0.42353 0.56471 0.65882 0.56471 0.56471 0.65882 0.70588 0.56471 0.65882 0.84706 0.56471 0.65882 0.98824 0.56471 0.65882 0.00000 0.70588 0.65882 0.14118 0.70588 0.65882 0.28235 0.70588 0.65882 0.42353 0.70588 0.65882 0.56471 0.70588 0.65882 0.70588 0.70588 0.65882 0.84706 0.70588 0.65882 0.98824 0.70588 0.65882 0.00000 0.84706 0.65882 0.14118 0.84706 0.65882 0.28235 0.84706 0.65882 0.42353 0.84706 0.65882 0.56471 0.84706 0.65882 0.70588 0.84706 0.65882 0.84706 0.84706 0.65882 0.98824 0.84706 0.65882 0.00000 0.98824 0.65882 0.14118 0.98824 0.65882 0.28235 0.98824 0.65882 0.42353 0.98824 0.65882 0.56471 0.98824 0.65882 0.70588 0.98824 0.65882 0.84706 0.98824 0.65882 0.98824 0.98824 0.65882 0.00000 0.00000 0.98824 0.14118 0.00000 0.98824 0.28235 0.00000 0.98824 0.42353 0.00000 0.98824 0.56471 0.00000 0.98824 0.70588 0.00000 0.98824 0.84706 0.00000 0.98824 0.98824 0.00000 0.98824 0.00000 0.14118 0.98824 0.14118 0.14118 0.98824 0.28235 0.14118 0.98824 0.42353 0.14118 0.98824 0.56471 0.14118 0.98824 0.70588 0.14118 0.98824 0.84706 0.14118 0.98824 0.98824 0.14118 0.98824 0.00000 0.28235 0.98824 0.14118 0.28235 0.98824 0.28235 0.28235 0.98824 0.42353 0.28235 0.98824 0.56471 0.28235 0.98824 0.70588 0.28235 0.98824 0.84706 0.28235 0.98824 0.98824 0.28235 0.98824 0.00000 0.42353 0.98824 0.14118 0.42353 0.98824 0.28235 0.42353 0.98824 0.42353 0.42353 0.98824 0.56471 0.42353 0.98824 0.70588 0.42353 0.98824 0.84706 0.42353 0.98824 0.98824 0.42353 0.98824 0.00000 0.56471 0.98824 0.14118 0.56471 0.98824 0.28235 0.56471 0.98824 0.42353 0.56471 0.98824 0.56471 0.56471 0.98824 0.70588 0.56471 0.98824 0.84706 0.56471 0.98824 0.98824 0.56471 0.98824 0.00000 0.70588 0.98824 0.14118 0.70588 0.98824 0.28235 0.70588 0.98824 0.42353 0.70588 0.98824 0.56471 0.70588 0.98824 0.70588 0.70588 0.98824 0.84706 0.70588 0.98824 0.98824 0.70588 0.98824 0.00000 0.84706 0.98824 0.14118 0.84706 0.98824 0.28235 0.84706 0.98824 0.42353 0.84706 0.98824 0.56471 0.84706 0.98824 0.70588 0.84706 0.98824 0.84706 0.84706 0.98824 0.98824 0.84706 0.98824 0.00000 0.98824 0.98824 0.14118 0.98824 0.98824 0.28235 0.98824 0.98824 0.42353 0.98824 0.98824 0.56471 0.98824 0.98824 0.70588 0.98824 0.98824 0.84706 0.98824 0.98824 0.98824 0.98824 skycat-3.1.2-starlink-1b/rtd/colormaps/real.lasc000066400000000000000000000324001215713201500215130ustar00rootroot00000000000000 0.00784 0.00392 0.00000 0.01569 0.00784 0.00000 0.02353 0.01176 0.00000 0.03137 0.01569 0.00000 0.03922 0.01961 0.00000 0.04706 0.02353 0.00000 0.05490 0.02745 0.00000 0.06275 0.03137 0.00000 0.07059 0.03529 0.00000 0.07843 0.03922 0.00000 0.08627 0.04314 0.00000 0.09412 0.04706 0.00000 0.10196 0.05098 0.00000 0.10980 0.05490 0.00000 0.11765 0.05882 0.00000 0.12549 0.06275 0.00000 0.13333 0.06667 0.00000 0.14118 0.07059 0.00000 0.14902 0.07451 0.00000 0.15686 0.07843 0.00000 0.16471 0.08235 0.00000 0.17255 0.08627 0.00000 0.18039 0.09020 0.00000 0.18824 0.09412 0.00000 0.19608 0.09804 0.00000 0.20392 0.10196 0.00000 0.21176 0.10588 0.00000 0.21961 0.10980 0.00000 0.22745 0.11373 0.00000 0.23529 0.11765 0.00000 0.24314 0.12157 0.00000 0.25098 0.12549 0.00000 0.25882 0.12941 0.00000 0.26667 0.13333 0.00000 0.27451 0.13725 0.00000 0.28235 0.14118 0.00000 0.29020 0.14510 0.00000 0.29804 0.14902 0.00000 0.30588 0.15294 0.00000 0.31373 0.15686 0.00000 0.32157 0.16078 0.00000 0.32941 0.16471 0.00000 0.33725 0.16863 0.00000 0.34510 0.17255 0.00000 0.35294 0.17647 0.00000 0.36078 0.18039 0.00000 0.36863 0.18431 0.00000 0.37647 0.18824 0.00000 0.38431 0.19216 0.00000 0.39216 0.19608 0.00000 0.40000 0.20000 0.00000 0.40784 0.20392 0.00000 0.41569 0.20784 0.00000 0.42353 0.21176 0.00000 0.43137 0.21569 0.00000 0.43922 0.21961 0.00000 0.44706 0.22353 0.00000 0.45490 0.22745 0.00000 0.46275 0.23137 0.00000 0.47059 0.23529 0.00000 0.47843 0.23922 0.00000 0.48627 0.24314 0.00000 0.49412 0.24706 0.00000 0.50196 0.25098 0.00000 0.50980 0.25490 0.00000 0.51765 0.25882 0.00000 0.52549 0.26275 0.00000 0.53333 0.26667 0.00000 0.54118 0.27059 0.00000 0.54902 0.27451 0.00000 0.55686 0.27843 0.00000 0.56471 0.28235 0.00000 0.57255 0.28627 0.00000 0.58039 0.29020 0.00000 0.58824 0.29412 0.00000 0.59608 0.29804 0.00000 0.60392 0.30196 0.00000 0.61176 0.30588 0.00000 0.61961 0.30980 0.00000 0.62745 0.31373 0.00000 0.63529 0.31765 0.00000 0.64314 0.32157 0.00000 0.65098 0.32549 0.00000 0.65882 0.32941 0.00000 0.66667 0.33333 0.00000 0.67451 0.33725 0.00000 0.68235 0.34118 0.00000 0.69020 0.34510 0.00000 0.69804 0.34902 0.00000 0.70588 0.35294 0.00000 0.71373 0.35686 0.00000 0.72157 0.36078 0.00000 0.72941 0.36471 0.00000 0.73725 0.36863 0.00000 0.74510 0.37255 0.00000 0.75294 0.37647 0.00000 0.76078 0.38039 0.00000 0.76863 0.38431 0.00000 0.77647 0.38824 0.00000 0.78431 0.39216 0.00000 0.79216 0.39608 0.00000 0.80000 0.40000 0.00000 0.80784 0.40392 0.00000 0.81569 0.40784 0.00000 0.82353 0.41176 0.00000 0.83137 0.41569 0.00000 0.83922 0.41961 0.00000 0.84706 0.42353 0.00000 0.85490 0.42745 0.00000 0.86275 0.43137 0.00000 0.87059 0.43529 0.00000 0.87843 0.43922 0.00000 0.88627 0.44314 0.00000 0.89412 0.44706 0.00000 0.90196 0.45098 0.00000 0.90980 0.45490 0.00000 0.91765 0.45882 0.00000 0.92549 0.46275 0.00000 0.93333 0.46667 0.00000 0.94118 0.47059 0.00000 0.94902 0.47451 0.00000 0.95686 0.47843 0.00000 0.96471 0.48235 0.00000 0.97255 0.48627 0.00000 0.98039 0.49020 0.00000 0.98824 0.49412 0.00000 0.99608 0.49804 0.00000 1.00000 0.50196 0.00000 1.00000 0.50588 0.00784 1.00000 0.50980 0.01569 1.00000 0.51373 0.02353 1.00000 0.51765 0.03137 1.00000 0.52157 0.03922 1.00000 0.52549 0.04706 1.00000 0.52941 0.05490 1.00000 0.53333 0.06275 1.00000 0.53725 0.07059 1.00000 0.54118 0.07843 1.00000 0.54510 0.08627 1.00000 0.54902 0.09412 1.00000 0.55294 0.10196 1.00000 0.55686 0.10980 1.00000 0.56078 0.11765 1.00000 0.56471 0.12549 1.00000 0.56863 0.13333 1.00000 0.57255 0.14118 1.00000 0.57647 0.14902 1.00000 0.58039 0.15686 1.00000 0.58431 0.16471 1.00000 0.58824 0.17255 1.00000 0.59216 0.18039 1.00000 0.59608 0.18824 1.00000 0.60000 0.19608 1.00000 0.60392 0.20392 1.00000 0.60784 0.21176 1.00000 0.61176 0.21961 1.00000 0.61569 0.22745 1.00000 0.61961 0.23529 1.00000 0.62353 0.24314 1.00000 0.62745 0.25098 1.00000 0.63137 0.25882 1.00000 0.63529 0.26667 1.00000 0.63922 0.27451 1.00000 0.64314 0.28235 1.00000 0.64706 0.29020 1.00000 0.65098 0.29804 1.00000 0.65490 0.30588 1.00000 0.65882 0.31373 1.00000 0.66275 0.32157 1.00000 0.66667 0.32941 1.00000 0.67059 0.33725 1.00000 0.67451 0.34510 1.00000 0.67843 0.35294 1.00000 0.68235 0.36078 1.00000 0.68627 0.36863 1.00000 0.69020 0.37647 1.00000 0.69412 0.38431 1.00000 0.69804 0.39216 1.00000 0.70196 0.40000 1.00000 0.70588 0.40784 1.00000 0.70980 0.41569 1.00000 0.71373 0.42353 1.00000 0.71765 0.43137 1.00000 0.72157 0.43922 1.00000 0.72549 0.44706 1.00000 0.72941 0.45490 1.00000 0.73333 0.46275 1.00000 0.73725 0.47059 1.00000 0.74118 0.47843 1.00000 0.74510 0.48627 1.00000 0.74902 0.49412 1.00000 0.75294 0.50196 1.00000 0.75686 0.50980 1.00000 0.76078 0.51765 1.00000 0.76471 0.52549 1.00000 0.76863 0.53333 1.00000 0.77255 0.54118 1.00000 0.77647 0.54902 1.00000 0.78039 0.55686 1.00000 0.78431 0.56471 1.00000 0.78824 0.57255 1.00000 0.79216 0.58039 1.00000 0.79608 0.58824 1.00000 0.80000 0.59608 1.00000 0.80392 0.60392 1.00000 0.80784 0.61176 1.00000 0.81176 0.61961 1.00000 0.81569 0.62745 1.00000 0.81961 0.63529 1.00000 0.82353 0.64314 1.00000 0.82745 0.65098 1.00000 0.83137 0.65882 1.00000 0.83529 0.66667 1.00000 0.83922 0.67451 1.00000 0.84314 0.68235 1.00000 0.84706 0.69020 1.00000 0.85098 0.69804 1.00000 0.85490 0.70588 1.00000 0.85882 0.71373 1.00000 0.86275 0.72157 1.00000 0.86667 0.72941 1.00000 0.87059 0.73725 1.00000 0.87451 0.74510 1.00000 0.87843 0.75294 1.00000 0.88235 0.76078 1.00000 0.88627 0.76863 1.00000 0.89020 0.77647 1.00000 0.89412 0.78431 1.00000 0.89804 0.79216 1.00000 0.90196 0.80000 1.00000 0.90588 0.80784 1.00000 0.90980 0.81569 1.00000 0.91373 0.82353 1.00000 0.91765 0.83137 1.00000 0.92157 0.83922 1.00000 0.92549 0.84706 1.00000 0.92941 0.85490 1.00000 0.93333 0.86275 1.00000 0.93725 0.87059 1.00000 0.94118 0.87843 1.00000 0.94510 0.88627 1.00000 0.94902 0.89412 1.00000 0.95294 0.90196 1.00000 0.95686 0.90980 1.00000 0.96078 0.91765 1.00000 0.96471 0.92549 1.00000 0.96863 0.93333 1.00000 0.97255 0.94118 1.00000 0.97647 0.94902 1.00000 0.98039 0.95686 1.00000 0.98431 0.96471 1.00000 0.98824 0.97255 1.00000 0.99216 0.98039 1.00000 0.99608 0.98824 1.00000 1.00000 0.99608 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/red.lasc000066400000000000000000000324001215713201500213420ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00392 0.00000 0.00000 0.00784 0.00000 0.00000 0.01176 0.00000 0.00000 0.01569 0.00000 0.00000 0.01961 0.00000 0.00000 0.02353 0.00000 0.00000 0.02745 0.00000 0.00000 0.03137 0.00000 0.00000 0.03529 0.00000 0.00000 0.03922 0.00000 0.00000 0.04314 0.00000 0.00000 0.04706 0.00000 0.00000 0.05098 0.00000 0.00000 0.05490 0.00000 0.00000 0.05882 0.00000 0.00000 0.06275 0.00000 0.00000 0.06667 0.00000 0.00000 0.07059 0.00000 0.00000 0.07451 0.00000 0.00000 0.07843 0.00000 0.00000 0.08235 0.00000 0.00000 0.08627 0.00000 0.00000 0.09020 0.00000 0.00000 0.09412 0.00000 0.00000 0.09804 0.00000 0.00000 0.10196 0.00000 0.00000 0.10588 0.00000 0.00000 0.10980 0.00000 0.00000 0.11373 0.00000 0.00000 0.11765 0.00000 0.00000 0.12157 0.00000 0.00000 0.12549 0.00000 0.00000 0.12941 0.00000 0.00000 0.13333 0.00000 0.00000 0.13725 0.00000 0.00000 0.14118 0.00000 0.00000 0.14510 0.00000 0.00000 0.14902 0.00000 0.00000 0.15294 0.00000 0.00000 0.15686 0.00000 0.00000 0.16078 0.00000 0.00000 0.16471 0.00000 0.00000 0.16863 0.00000 0.00000 0.17255 0.00000 0.00000 0.17647 0.00000 0.00000 0.18039 0.00000 0.00000 0.18431 0.00000 0.00000 0.18824 0.00000 0.00000 0.19216 0.00000 0.00000 0.19608 0.00000 0.00000 0.20000 0.00000 0.00000 0.20392 0.00000 0.00000 0.20784 0.00000 0.00000 0.21176 0.00000 0.00000 0.21569 0.00000 0.00000 0.21961 0.00000 0.00000 0.22353 0.00000 0.00000 0.22745 0.00000 0.00000 0.23137 0.00000 0.00000 0.23529 0.00000 0.00000 0.23922 0.00000 0.00000 0.24314 0.00000 0.00000 0.24706 0.00000 0.00000 0.25098 0.00000 0.00000 0.25490 0.00000 0.00000 0.25882 0.00000 0.00000 0.26275 0.00000 0.00000 0.26667 0.00000 0.00000 0.27059 0.00000 0.00000 0.27451 0.00000 0.00000 0.27843 0.00000 0.00000 0.28235 0.00000 0.00000 0.28627 0.00000 0.00000 0.29020 0.00000 0.00000 0.29412 0.00000 0.00000 0.29804 0.00000 0.00000 0.30196 0.00000 0.00000 0.30588 0.00000 0.00000 0.30980 0.00000 0.00000 0.31373 0.00000 0.00000 0.31765 0.00000 0.00000 0.32157 0.00000 0.00000 0.32549 0.00000 0.00000 0.32941 0.00000 0.00000 0.33333 0.00000 0.00000 0.33725 0.00000 0.00000 0.34118 0.00000 0.00000 0.34510 0.00000 0.00000 0.34902 0.00000 0.00000 0.35294 0.00000 0.00000 0.35686 0.00000 0.00000 0.36078 0.00000 0.00000 0.36471 0.00000 0.00000 0.36863 0.00000 0.00000 0.37255 0.00000 0.00000 0.37647 0.00000 0.00000 0.38039 0.00000 0.00000 0.38431 0.00000 0.00000 0.38824 0.00000 0.00000 0.39216 0.00000 0.00000 0.39608 0.00000 0.00000 0.40000 0.00000 0.00000 0.40392 0.00000 0.00000 0.40784 0.00000 0.00000 0.41176 0.00000 0.00000 0.41569 0.00000 0.00000 0.41961 0.00000 0.00000 0.42353 0.00000 0.00000 0.42745 0.00000 0.00000 0.43137 0.00000 0.00000 0.43529 0.00000 0.00000 0.43922 0.00000 0.00000 0.44314 0.00000 0.00000 0.44706 0.00000 0.00000 0.45098 0.00000 0.00000 0.45490 0.00000 0.00000 0.45882 0.00000 0.00000 0.46275 0.00000 0.00000 0.46667 0.00000 0.00000 0.47059 0.00000 0.00000 0.47451 0.00000 0.00000 0.47843 0.00000 0.00000 0.48235 0.00000 0.00000 0.48627 0.00000 0.00000 0.49020 0.00000 0.00000 0.49412 0.00000 0.00000 0.49804 0.00000 0.00000 0.50196 0.00000 0.00000 0.50588 0.00000 0.00000 0.50980 0.00000 0.00000 0.51373 0.00000 0.00000 0.51765 0.00000 0.00000 0.52157 0.00000 0.00000 0.52549 0.00000 0.00000 0.52941 0.00000 0.00000 0.53333 0.00000 0.00000 0.53725 0.00000 0.00000 0.54118 0.00000 0.00000 0.54510 0.00000 0.00000 0.54902 0.00000 0.00000 0.55294 0.00000 0.00000 0.55686 0.00000 0.00000 0.56078 0.00000 0.00000 0.56471 0.00000 0.00000 0.56863 0.00000 0.00000 0.57255 0.00000 0.00000 0.57647 0.00000 0.00000 0.58039 0.00000 0.00000 0.58431 0.00000 0.00000 0.58824 0.00000 0.00000 0.59216 0.00000 0.00000 0.59608 0.00000 0.00000 0.60000 0.00000 0.00000 0.60392 0.00000 0.00000 0.60784 0.00000 0.00000 0.61176 0.00000 0.00000 0.61569 0.00000 0.00000 0.61961 0.00000 0.00000 0.62353 0.00000 0.00000 0.62745 0.00000 0.00000 0.63137 0.00000 0.00000 0.63529 0.00000 0.00000 0.63922 0.00000 0.00000 0.64314 0.00000 0.00000 0.64706 0.00000 0.00000 0.65098 0.00000 0.00000 0.65490 0.00000 0.00000 0.65882 0.00000 0.00000 0.66275 0.00000 0.00000 0.66667 0.00000 0.00000 0.67059 0.00000 0.00000 0.67451 0.00000 0.00000 0.67843 0.00000 0.00000 0.68235 0.00000 0.00000 0.68627 0.00000 0.00000 0.69020 0.00000 0.00000 0.69412 0.00000 0.00000 0.69804 0.00000 0.00000 0.70196 0.00000 0.00000 0.70588 0.00000 0.00000 0.70980 0.00000 0.00000 0.71373 0.00000 0.00000 0.71765 0.00000 0.00000 0.72157 0.00000 0.00000 0.72549 0.00000 0.00000 0.72941 0.00000 0.00000 0.73333 0.00000 0.00000 0.73725 0.00000 0.00000 0.74118 0.00000 0.00000 0.74510 0.00000 0.00000 0.74902 0.00000 0.00000 0.75294 0.00000 0.00000 0.75686 0.00000 0.00000 0.76078 0.00000 0.00000 0.76471 0.00000 0.00000 0.76863 0.00000 0.00000 0.77255 0.00000 0.00000 0.77647 0.00000 0.00000 0.78039 0.00000 0.00000 0.78431 0.00000 0.00000 0.78824 0.00000 0.00000 0.79216 0.00000 0.00000 0.79608 0.00000 0.00000 0.80000 0.00000 0.00000 0.80392 0.00000 0.00000 0.80784 0.00000 0.00000 0.81176 0.00000 0.00000 0.81569 0.00000 0.00000 0.81961 0.00000 0.00000 0.82353 0.00000 0.00000 0.82745 0.00000 0.00000 0.83137 0.00000 0.00000 0.83529 0.00000 0.00000 0.83922 0.00000 0.00000 0.84314 0.00000 0.00000 0.84706 0.00000 0.00000 0.85098 0.00000 0.00000 0.85490 0.00000 0.00000 0.85882 0.00000 0.00000 0.86275 0.00000 0.00000 0.86667 0.00000 0.00000 0.87059 0.00000 0.00000 0.87451 0.00000 0.00000 0.87843 0.00000 0.00000 0.88235 0.00000 0.00000 0.88627 0.00000 0.00000 0.89020 0.00000 0.00000 0.89412 0.00000 0.00000 0.89804 0.00000 0.00000 0.90196 0.00000 0.00000 0.90588 0.00000 0.00000 0.90980 0.00000 0.00000 0.91373 0.00000 0.00000 0.91765 0.00000 0.00000 0.92157 0.00000 0.00000 0.92549 0.00000 0.00000 0.92941 0.00000 0.00000 0.93333 0.00000 0.00000 0.93725 0.00000 0.00000 0.94118 0.00000 0.00000 0.94510 0.00000 0.00000 0.94902 0.00000 0.00000 0.95294 0.00000 0.00000 0.95686 0.00000 0.00000 0.96078 0.00000 0.00000 0.96471 0.00000 0.00000 0.96863 0.00000 0.00000 0.97255 0.00000 0.00000 0.97647 0.00000 0.00000 0.98039 0.00000 0.00000 0.98431 0.00000 0.00000 0.98824 0.00000 0.00000 0.99216 0.00000 0.00000 0.99608 0.00000 0.00000 1.00000 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/redlut.lasc000066400000000000000000000140001215713201500220630ustar00rootroot000000000000000.00000 0.00000 0.00000 0.00392 0.00000 0.00000 0.00784 0.00000 0.00000 0.01176 0.00000 0.00000 0.01569 0.00000 0.00000 0.01961 0.00000 0.00000 0.02353 0.00000 0.00000 0.02745 0.00000 0.00000 0.03137 0.00000 0.00000 0.03529 0.00000 0.00000 0.03922 0.00000 0.00000 0.04314 0.00000 0.00000 0.04706 0.00000 0.00000 0.05098 0.00001 0.00001 0.05490 0.00001 0.00001 0.05882 0.00001 0.00001 0.06275 0.00002 0.00002 0.06667 0.00002 0.00002 0.07059 0.00002 0.00002 0.07451 0.00003 0.00003 0.07843 0.00004 0.00004 0.08235 0.00005 0.00005 0.08627 0.00006 0.00006 0.09020 0.00007 0.00007 0.09412 0.00008 0.00008 0.09804 0.00009 0.00009 0.10196 0.00011 0.00011 0.10588 0.00013 0.00013 0.10980 0.00015 0.00015 0.11373 0.00017 0.00017 0.11765 0.00019 0.00019 0.12157 0.00022 0.00022 0.12549 0.00025 0.00025 0.12941 0.00028 0.00028 0.13333 0.00032 0.00032 0.13725 0.00035 0.00035 0.14118 0.00040 0.00040 0.14510 0.00044 0.00044 0.14902 0.00049 0.00049 0.15294 0.00055 0.00055 0.15686 0.00061 0.00061 0.16078 0.00067 0.00067 0.16471 0.00074 0.00074 0.16863 0.00081 0.00081 0.17255 0.00089 0.00089 0.17647 0.00097 0.00097 0.18039 0.00106 0.00106 0.18431 0.00115 0.00115 0.18824 0.00126 0.00126 0.19216 0.00136 0.00136 0.19608 0.00148 0.00148 0.20000 0.00160 0.00160 0.20392 0.00173 0.00173 0.20784 0.00187 0.00187 0.21176 0.00201 0.00201 0.21569 0.00216 0.00216 0.21961 0.00233 0.00233 0.22353 0.00250 0.00250 0.22745 0.00268 0.00268 0.23137 0.00287 0.00287 0.23529 0.00307 0.00307 0.23922 0.00327 0.00327 0.24314 0.00349 0.00349 0.24706 0.00373 0.00373 0.25098 0.00397 0.00397 0.25490 0.00422 0.00422 0.25882 0.00449 0.00449 0.26275 0.00477 0.00477 0.26667 0.00506 0.00506 0.27059 0.00536 0.00536 0.27451 0.00568 0.00568 0.27843 0.00601 0.00601 0.28235 0.00636 0.00636 0.28627 0.00672 0.00672 0.29020 0.00709 0.00709 0.29412 0.00748 0.00748 0.29804 0.00789 0.00789 0.30196 0.00831 0.00831 0.30588 0.00875 0.00875 0.30980 0.00921 0.00921 0.31373 0.00969 0.00969 0.31765 0.01018 0.01018 0.32157 0.01069 0.01069 0.32549 0.01122 0.01122 0.32941 0.01177 0.01177 0.33333 0.01235 0.01235 0.33725 0.01294 0.01294 0.34118 0.01355 0.01355 0.34510 0.01418 0.01418 0.34902 0.01484 0.01484 0.35294 0.01552 0.01552 0.35686 0.01622 0.01622 0.36078 0.01694 0.01694 0.36471 0.01769 0.01769 0.36863 0.01847 0.01847 0.37255 0.01926 0.01926 0.37647 0.02009 0.02009 0.38039 0.02094 0.02094 0.38431 0.02181 0.02181 0.38824 0.02272 0.02272 0.39216 0.02365 0.02365 0.39608 0.02461 0.02461 0.40000 0.02560 0.02560 0.40392 0.02662 0.02662 0.40784 0.02767 0.02767 0.41176 0.02875 0.02875 0.41569 0.02986 0.02986 0.41961 0.03100 0.03100 0.42353 0.03218 0.03218 0.42745 0.03338 0.03338 0.43137 0.03463 0.03463 0.43529 0.03590 0.03590 0.43922 0.03721 0.03721 0.44314 0.03856 0.03856 0.44706 0.03994 0.03994 0.45098 0.04136 0.04136 0.45490 0.04282 0.04282 0.45882 0.04432 0.04432 0.46275 0.04585 0.04585 0.46667 0.04743 0.04743 0.47059 0.04904 0.04904 0.47451 0.05070 0.05070 0.47843 0.05239 0.05239 0.48235 0.05413 0.05413 0.48627 0.05591 0.05591 0.49020 0.05774 0.05774 0.49412 0.05961 0.05961 0.49804 0.06153 0.06153 0.50196 0.06349 0.06349 0.50588 0.06549 0.06549 0.50980 0.06755 0.06755 0.51373 0.06965 0.06965 0.51765 0.07180 0.07180 0.52157 0.07400 0.07400 0.52549 0.07625 0.07625 0.52941 0.07856 0.07856 0.53333 0.08091 0.08091 0.53725 0.08331 0.08331 0.54118 0.08577 0.08577 0.54510 0.08829 0.08829 0.54902 0.09086 0.09086 0.55294 0.09348 0.09348 0.55686 0.09616 0.09616 0.56078 0.09890 0.09890 0.56471 0.10169 0.10169 0.56863 0.10455 0.10455 0.57255 0.10746 0.10746 0.57647 0.11044 0.11044 0.58039 0.11347 0.11347 0.58431 0.11657 0.11657 0.58824 0.11973 0.11973 0.59216 0.12296 0.12296 0.59608 0.12624 0.12624 0.60000 0.12960 0.12960 0.60392 0.13302 0.13302 0.60784 0.13651 0.13651 0.61176 0.14007 0.14007 0.61569 0.14369 0.14369 0.61961 0.14739 0.14739 0.62353 0.15116 0.15116 0.62745 0.15500 0.15500 0.63137 0.15891 0.15891 0.63529 0.16289 0.16289 0.63922 0.16695 0.16695 0.64314 0.17109 0.17109 0.64706 0.17530 0.17530 0.65098 0.17959 0.17959 0.65490 0.18395 0.18395 0.65882 0.18840 0.18840 0.66275 0.19292 0.19292 0.66667 0.19753 0.19753 0.67059 0.20222 0.20222 0.67451 0.20699 0.20699 0.67843 0.21185 0.21185 0.68235 0.21679 0.21679 0.68627 0.22182 0.22182 0.69020 0.22693 0.22693 0.69412 0.23213 0.23213 0.69804 0.23742 0.23742 0.70196 0.24280 0.24280 0.70588 0.24827 0.24827 0.70980 0.25384 0.25384 0.71373 0.25949 0.25949 0.71765 0.26524 0.26524 0.72157 0.27109 0.27109 0.72549 0.27703 0.27703 0.72941 0.28307 0.28307 0.73333 0.28920 0.28920 0.73725 0.29544 0.29544 0.74118 0.30178 0.30178 0.74510 0.30821 0.30821 0.74902 0.31476 0.31476 0.75294 0.32140 0.32140 0.75686 0.32815 0.32815 0.76078 0.33500 0.33500 0.76471 0.34196 0.34196 0.76863 0.34903 0.34903 0.77255 0.35621 0.35621 0.77647 0.36350 0.36350 0.78039 0.37090 0.37090 0.78431 0.37841 0.37841 0.78824 0.38603 0.38603 0.79216 0.39377 0.39377 0.79608 0.40163 0.40163 0.80000 0.40960 0.40960 0.80392 0.41769 0.41769 0.80784 0.42590 0.42590 0.81176 0.43423 0.43423 0.81569 0.44268 0.44268 0.81961 0.45126 0.45126 0.82353 0.45996 0.45996 0.82745 0.46878 0.46878 0.83137 0.47773 0.47773 0.83529 0.48681 0.48681 0.83922 0.49601 0.49601 0.84314 0.50535 0.50535 0.84706 0.51482 0.51482 0.85098 0.52442 0.52442 0.85490 0.53415 0.53415 0.85882 0.54402 0.54402 0.86275 0.55403 0.55403 0.86667 0.56417 0.56417 0.87059 0.57445 0.57445 0.87451 0.58487 0.58487 0.87843 0.59543 0.59543 0.88235 0.60613 0.60613 0.88627 0.61698 0.61698 0.89020 0.62798 0.62798 0.89412 0.63911 0.63911 0.89804 0.65040 0.65040 0.90196 0.66184 0.66184 0.90588 0.67342 0.67342 0.90980 0.68516 0.68516 0.91373 0.69705 0.69705 0.91765 0.70909 0.70909 0.92157 0.72129 0.72129 0.92549 0.73365 0.73365 0.92941 0.74616 0.74616 0.93333 0.75883 0.75883 0.93725 0.77167 0.77167 0.94118 0.78466 0.78466 0.94510 0.79782 0.79782 0.94902 0.81115 0.81115 0.95294 0.82464 0.82464 0.95686 0.83830 0.83830 0.96078 0.85213 0.85213 0.96471 0.86612 0.86612 0.96863 0.88029 0.88029 0.97255 0.89464 0.89464 0.97647 0.90915 0.90915 0.98039 0.92385 0.92385 0.98431 0.93872 0.93872 0.98824 0.95377 0.95377 0.99216 0.96899 0.96899 0.99608 0.98441 0.98441 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/smooth.lasc000066400000000000000000000324001215713201500221010ustar00rootroot00000000000000 0.00000 0.00000 1.00000 0.01569 0.00000 0.98431 0.03529 0.00000 0.96471 0.05098 0.00000 0.94902 0.06667 0.00000 0.93333 0.08627 0.00000 0.91373 0.10196 0.00000 0.89804 0.11765 0.00000 0.88235 0.13725 0.00000 0.86275 0.15294 0.00000 0.84706 0.16863 0.00000 0.83137 0.18824 0.00000 0.81176 0.20392 0.00000 0.79608 0.21961 0.00000 0.78039 0.23922 0.00000 0.76078 0.25490 0.00000 0.74510 0.27059 0.00000 0.72941 0.28627 0.00000 0.71373 0.30588 0.00000 0.69412 0.32157 0.00000 0.67843 0.33725 0.00000 0.66275 0.35686 0.00000 0.64314 0.37255 0.00000 0.62745 0.38824 0.00000 0.61176 0.40784 0.00000 0.59216 0.42353 0.00000 0.57647 0.43922 0.00000 0.56078 0.45882 0.00000 0.54118 0.47451 0.00000 0.52549 0.49020 0.00000 0.50980 0.50980 0.00000 0.49020 0.52549 0.00000 0.47451 0.54118 0.00000 0.45882 0.56078 0.00000 0.43922 0.57647 0.00000 0.42353 0.59216 0.00000 0.40784 0.61176 0.00000 0.38824 0.62745 0.00000 0.37255 0.64314 0.00000 0.35686 0.66275 0.00000 0.33725 0.67843 0.00000 0.32157 0.69412 0.00000 0.30588 0.71373 0.00000 0.28627 0.72941 0.00000 0.27059 0.74510 0.00000 0.25490 0.76078 0.00000 0.23922 0.78039 0.00000 0.21961 0.79608 0.00000 0.20392 0.81176 0.00000 0.18824 0.83137 0.00000 0.16863 0.84706 0.00000 0.15294 0.86275 0.00000 0.13725 0.88235 0.00000 0.11765 0.89804 0.00000 0.10196 0.91373 0.00000 0.08627 0.93333 0.00000 0.06667 0.94902 0.00000 0.05098 0.96471 0.00000 0.03529 0.98431 0.00000 0.01569 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.01176 0.00000 1.00000 0.01961 0.00000 1.00000 0.03137 0.00000 1.00000 0.03922 0.00000 1.00000 0.05098 0.00000 1.00000 0.05882 0.00000 1.00000 0.07059 0.00000 1.00000 0.08235 0.00000 1.00000 0.09020 0.00000 1.00000 0.10196 0.00000 1.00000 0.10980 0.00000 1.00000 0.12157 0.00000 1.00000 0.12941 0.00000 1.00000 0.14118 0.00000 0.99608 0.15294 0.00000 0.99608 0.16078 0.00000 0.99608 0.17255 0.00000 0.99608 0.18039 0.00000 0.99608 0.19216 0.00000 0.99608 0.20392 0.00000 0.99608 0.21176 0.00000 0.99608 0.22353 0.00000 0.99608 0.23137 0.00000 0.99608 0.24314 0.00000 0.99608 0.25098 0.00000 0.99608 0.26275 0.00000 0.99608 0.27451 0.00000 0.99608 0.28235 0.00000 0.99608 0.29412 0.00000 0.99608 0.30196 0.00000 0.99608 0.31373 0.00000 0.99608 0.32157 0.00000 0.99608 0.33333 0.00000 0.99608 0.34510 0.00000 0.99608 0.35294 0.00000 0.99608 0.36471 0.00000 0.99608 0.37255 0.00000 0.99608 0.38431 0.00000 0.99608 0.39216 0.00000 0.99608 0.40392 0.00000 0.99608 0.41569 0.00000 0.99608 0.42353 0.00000 0.99608 0.43529 0.00000 0.99608 0.44314 0.00000 0.99216 0.45490 0.00000 0.99216 0.46667 0.00000 0.99216 0.47451 0.00000 0.99216 0.48627 0.00000 0.99216 0.49412 0.00000 0.99216 0.50588 0.00000 0.99216 0.51373 0.00000 0.99216 0.52549 0.00000 0.99216 0.53725 0.00000 0.99216 0.54510 0.00000 0.99216 0.55686 0.00000 0.99216 0.56471 0.00000 0.99216 0.57647 0.00000 0.99216 0.58431 0.00000 0.99216 0.59608 0.00000 0.99216 0.60000 0.00000 0.99216 0.60784 0.00000 0.99216 0.61176 0.00000 0.99216 0.61569 0.00000 0.99216 0.61961 0.00000 0.99216 0.62745 0.00000 0.99216 0.63137 0.00000 0.99216 0.63529 0.00000 0.99216 0.64314 0.00000 0.98824 0.64706 0.00000 0.98824 0.65098 0.00000 0.98824 0.65882 0.00000 0.98824 0.66275 0.00000 0.98824 0.66667 0.00000 0.98824 0.67451 0.00000 0.98824 0.67843 0.00000 0.98824 0.68235 0.00000 0.98824 0.68627 0.00000 0.98824 0.69412 0.00000 0.98824 0.69804 0.00000 0.98824 0.70196 0.00000 0.98824 0.70980 0.00000 0.98824 0.71373 0.00000 0.98824 0.71765 0.00000 0.98824 0.72549 0.00000 0.98824 0.72941 0.00000 0.98824 0.73333 0.00000 0.98824 0.73725 0.00000 0.98824 0.74510 0.00000 0.98824 0.74902 0.00000 0.98431 0.75294 0.00000 0.98431 0.76078 0.00000 0.98431 0.76471 0.00000 0.98431 0.76863 0.00000 0.98431 0.77255 0.00000 0.98431 0.78039 0.00000 0.98431 0.78431 0.00000 0.98431 0.78824 0.00000 0.98431 0.79608 0.00000 0.98431 0.80000 0.00000 0.98431 0.80392 0.00000 0.98431 0.81176 0.00000 0.98431 0.81569 0.00000 0.98431 0.81961 0.00000 0.98431 0.82745 0.00000 0.98431 0.83137 0.00000 0.98431 0.83529 0.00000 0.98431 0.83922 0.00000 0.98431 0.84706 0.00000 0.98431 0.85098 0.00000 0.98039 0.85490 0.00000 0.98039 0.86275 0.00000 0.98039 0.86667 0.00000 0.98039 0.87059 0.00000 0.98039 0.87843 0.00000 0.98039 0.88235 0.00000 0.98039 0.88627 0.00000 0.98039 0.89020 0.00000 0.98039 0.89804 0.00000 0.98039 0.90196 0.00000 0.98039 0.90196 0.00000 0.96471 0.88627 0.00000 0.94902 0.87059 0.00000 0.92941 0.85490 0.00000 0.91373 0.83922 0.00000 0.89804 0.82745 0.00000 0.88235 0.81176 0.00000 0.86275 0.79608 0.00000 0.84706 0.78039 0.00000 0.83137 0.76471 0.00000 0.81569 0.74902 0.00000 0.79608 0.73333 0.00000 0.78039 0.71765 0.00000 0.76471 0.70196 0.00000 0.74902 0.68627 0.00000 0.72941 0.67451 0.00000 0.71373 0.65882 0.00000 0.69804 0.64314 0.00000 0.68235 0.62745 0.00000 0.66275 0.61176 0.00000 0.64706 0.59608 0.00000 0.63137 0.58039 0.00000 0.61569 0.56471 0.00000 0.60000 0.54902 0.00000 0.58039 0.53333 0.00000 0.56471 0.52157 0.00000 0.54902 0.50588 0.00000 0.53333 0.49020 0.00000 0.51373 0.47451 0.00000 0.49804 0.45882 0.00000 0.48235 0.44314 0.00000 0.46667 0.42745 0.00000 0.44706 0.41176 0.00000 0.43137 0.39608 0.00000 0.41569 0.38039 0.00000 0.40000 0.36863 0.00000 0.38039 0.35294 0.00000 0.36471 0.33725 0.00000 0.34902 0.32157 0.00000 0.33333 0.30588 0.00000 0.31765 0.29020 0.00000 0.29804 0.27451 0.00000 0.28235 0.25882 0.00000 0.26667 0.24314 0.00000 0.25098 0.22745 0.00000 0.23137 0.21569 0.00000 0.21569 0.20000 0.00000 0.20000 0.18431 0.00000 0.18431 0.16863 0.00000 0.16471 0.15294 0.00000 0.14902 0.13725 0.00000 0.13333 0.12157 0.00000 0.11765 0.10588 0.00000 0.09804 0.09020 0.00000 0.08235 0.07451 0.00000 0.06667 0.06275 0.00000 0.05098 0.04706 0.00000 0.03137 0.03137 0.00000 0.01569 0.01569 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/smooth1.lasc000066400000000000000000000324001215713201500221620ustar00rootroot00000000000000 0.30980 0.29020 0.22353 0.32157 0.30196 0.23922 0.33333 0.31765 0.25490 0.34510 0.32941 0.27059 0.35686 0.34510 0.29020 0.36863 0.36078 0.30588 0.38039 0.37647 0.32549 0.39216 0.38824 0.34510 0.40392 0.40392 0.36471 0.41569 0.41961 0.38431 0.42745 0.43529 0.40392 0.43922 0.45098 0.42353 0.45098 0.46667 0.44314 0.46275 0.48235 0.46667 0.47451 0.49804 0.48627 0.49020 0.51765 0.50980 0.50196 0.53333 0.53333 0.51373 0.54902 0.55686 0.52549 0.56863 0.58039 0.54118 0.58431 0.60392 0.55294 0.60000 0.62745 0.56863 0.61961 0.65098 0.58039 0.63529 0.67843 0.59216 0.65490 0.70196 0.60784 0.67059 0.72941 0.61961 0.69020 0.75686 0.63529 0.70980 0.78431 0.64706 0.72549 0.75686 0.66275 0.74510 0.72941 0.67843 0.76471 0.70588 0.69020 0.78431 0.68235 0.70588 0.80392 0.65882 0.71765 0.82353 0.64314 0.73333 0.80392 0.62353 0.74902 0.78824 0.60392 0.76471 0.77255 0.58824 0.77647 0.75686 0.57255 0.79216 0.74118 0.55686 0.80784 0.73333 0.54118 0.82353 0.71765 0.52941 0.83922 0.70588 0.51373 0.85490 0.69804 0.50588 0.87059 0.68235 0.49412 0.85490 0.67451 0.48627 0.83922 0.66667 0.47843 0.82745 0.65882 0.47059 0.81569 0.65098 0.46275 0.80392 0.63922 0.45882 0.79216 0.63529 0.45490 0.78431 0.62745 0.45098 0.77255 0.61961 0.44706 0.76078 0.61176 0.44706 0.74902 0.60784 0.44706 0.74510 0.60392 0.44706 0.73333 0.60000 0.44706 0.72941 0.59608 0.45098 0.71765 0.59216 0.45490 0.70980 0.58824 0.45882 0.70588 0.58824 0.46275 0.69412 0.58431 0.47059 0.69020 0.58039 0.47843 0.68235 0.58039 0.48627 0.67843 0.58039 0.49412 0.67451 0.57647 0.50588 0.66667 0.58039 0.51373 0.66275 0.57647 0.52941 0.65490 0.58039 0.54118 0.65098 0.58039 0.55686 0.64706 0.58039 0.57255 0.64314 0.58431 0.58824 0.63529 0.58824 0.60392 0.63529 0.58824 0.62353 0.63137 0.59216 0.64314 0.62745 0.59608 0.65882 0.62745 0.60000 0.68235 0.62353 0.60392 0.70588 0.62353 0.60784 0.72941 0.61961 0.61176 0.75686 0.61961 0.61961 0.78431 0.61569 0.62745 0.75686 0.61569 0.63529 0.72941 0.61176 0.63922 0.70588 0.61176 0.65098 0.68235 0.61176 0.65882 0.65882 0.61176 0.66667 0.64314 0.61176 0.67451 0.62353 0.61176 0.68235 0.60392 0.61176 0.69804 0.58824 0.61176 0.70588 0.57255 0.61569 0.71765 0.55686 0.61569 0.73333 0.54118 0.61961 0.74118 0.52941 0.61961 0.75686 0.51373 0.62353 0.77255 0.50588 0.62353 0.78824 0.49412 0.62745 0.80392 0.48627 0.62745 0.82353 0.47843 0.63137 0.80392 0.47059 0.63529 0.78824 0.46275 0.63529 0.77255 0.45882 0.64314 0.75686 0.45490 0.64706 0.74118 0.45098 0.65098 0.73333 0.44706 0.65490 0.71765 0.44706 0.66275 0.70588 0.44706 0.66667 0.69804 0.44706 0.67451 0.68235 0.44706 0.67843 0.67451 0.45098 0.68235 0.66667 0.45490 0.69020 0.65882 0.45882 0.69412 0.65098 0.46275 0.70588 0.63922 0.47059 0.70980 0.63529 0.47843 0.71765 0.62745 0.48627 0.72941 0.61961 0.49412 0.73333 0.61176 0.50588 0.74510 0.60784 0.51373 0.74902 0.60392 0.52941 0.76078 0.60000 0.54118 0.77647 0.59608 0.55686 0.79216 0.59216 0.57255 0.80392 0.58824 0.58824 0.81961 0.58824 0.60392 0.83922 0.58431 0.62353 0.85490 0.58039 0.64314 0.87451 0.58039 0.65882 0.89804 0.58039 0.68235 0.92157 0.57647 0.70588 0.91373 0.58039 0.72941 0.90588 0.57647 0.75686 0.89804 0.58039 0.78431 0.89412 0.58039 0.75686 0.88627 0.58039 0.72941 0.88235 0.58431 0.70588 0.87843 0.58824 0.68235 0.87451 0.58824 0.65882 0.87059 0.59216 0.64314 0.86275 0.59608 0.62353 0.86275 0.60000 0.60392 0.85882 0.60392 0.58824 0.85882 0.60784 0.57255 0.85490 0.61176 0.55686 0.85098 0.61961 0.54118 0.85490 0.62745 0.52941 0.85098 0.63529 0.51373 0.85098 0.63922 0.50588 0.85098 0.65490 0.49412 0.85098 0.67059 0.48627 0.85490 0.68235 0.47843 0.85098 0.69804 0.47059 0.85490 0.71373 0.46275 0.85098 0.74118 0.45882 0.85490 0.75686 0.45490 0.85882 0.78039 0.45098 0.86275 0.80392 0.44706 0.86275 0.82353 0.44706 0.86667 0.85098 0.44706 0.87059 0.87843 0.44706 0.87451 0.90980 0.44706 0.87843 0.93725 0.45098 0.88235 0.97255 0.45490 0.88627 0.96471 0.45882 0.89020 0.96078 0.46275 0.89804 0.95686 0.47059 0.90196 0.95294 0.47843 0.90588 0.94902 0.48627 0.91373 0.94902 0.49412 0.91765 0.94510 0.50588 0.92549 0.94118 0.51373 0.92941 0.94510 0.52941 0.94118 0.94118 0.54118 0.94902 0.94510 0.55686 0.95294 0.94510 0.57255 0.96078 0.94510 0.58824 0.97255 0.94902 0.60392 0.98039 0.94902 0.62745 0.98824 0.95294 0.65098 0.99608 0.95686 0.67451 1.00000 0.95686 0.70588 1.00000 0.96078 0.73333 1.00000 0.96863 0.76863 1.00000 0.97255 0.80392 1.00000 0.98039 0.84314 1.00000 0.98431 0.82353 0.98824 0.99216 0.80784 0.96078 0.99608 0.79608 0.93333 1.00000 0.78431 0.90980 1.00000 0.77255 0.88235 1.00000 0.76471 0.85882 1.00000 0.75686 0.83137 1.00000 0.74902 0.80784 1.00000 0.74118 0.78039 1.00000 0.73725 0.75686 1.00000 0.73333 0.73333 1.00000 0.72941 0.70588 1.00000 0.72941 0.69020 1.00000 0.72941 0.66667 0.97255 0.72941 0.64314 0.93725 0.73333 0.62353 0.90196 0.73725 0.60392 0.86667 0.74118 0.58431 0.83137 0.74510 0.56078 0.79608 0.75294 0.54510 0.76078 0.75686 0.52941 0.73333 0.76863 0.51373 0.69804 0.77647 0.50196 0.67059 0.78824 0.48627 0.63922 0.80392 0.47059 0.61176 0.81569 0.45490 0.58039 0.83137 0.44314 0.55294 0.84706 0.43529 0.52941 0.86667 0.42353 0.50588 0.88235 0.41569 0.47843 0.90196 0.41176 0.45490 0.92549 0.40392 0.43529 0.87843 0.40000 0.41569 0.83922 0.39216 0.39216 0.79608 0.38824 0.37647 0.75686 0.38431 0.35686 0.72157 0.38039 0.34118 0.67843 0.38039 0.32941 0.65098 0.37255 0.31765 0.61569 0.37255 0.30588 0.58431 0.37255 0.29804 0.55686 0.37255 0.29412 0.52549 0.37647 0.28627 0.50196 0.37647 0.28235 0.47843 0.38039 0.28235 0.45882 0.38431 0.27843 0.43922 0.38824 0.27843 0.41961 0.39608 0.27843 0.40784 0.40000 0.28235 0.40000 0.40784 0.28627 0.38824 0.41569 0.29020 0.38431 0.42353 0.29804 0.38039 0.43529 0.30588 0.37647 0.44706 0.31765 0.37647 0.45882 0.32549 0.38039 0.47059 0.34118 0.38431 0.48235 0.35294 0.39216 0.50196 0.37255 0.40000 0.51765 0.39216 0.40784 0.53725 0.41176 0.42353 0.55686 0.43922 0.43529 0.57647 0.46667 0.45098 0.60000 0.49804 0.47451 0.62745 0.52941 0.49804 0.65490 0.56078 0.52549 0.68235 0.59216 0.54902 0.70980 0.62745 0.58431 0.74118 0.66275 0.61569 0.77255 0.70196 0.65098 0.80392 0.74118 0.69020 0.83529 0.78039 0.73333 0.87059 0.82353 0.78431 skycat-3.1.2-starlink-1b/rtd/colormaps/smooth2.lasc000066400000000000000000000324001215713201500221630ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.06667 0.00000 0.00000 0.06667 0.00000 0.00000 0.06667 0.00000 0.00000 0.06667 0.00000 0.00000 0.06667 0.00000 0.00000 0.06667 0.00000 0.00000 0.06667 0.00000 0.00000 0.06667 0.00000 0.00000 0.13333 0.00000 0.00000 0.13333 0.00000 0.00000 0.13333 0.00000 0.00000 0.13333 0.00000 0.00000 0.13333 0.00000 0.00000 0.13333 0.00000 0.00000 0.13333 0.00000 0.00000 0.13333 0.00000 0.00000 0.20000 0.00000 0.00000 0.20000 0.00000 0.00000 0.20000 0.00000 0.00000 0.20000 0.00000 0.00000 0.20000 0.00000 0.00000 0.20000 0.00000 0.00000 0.20000 0.00000 0.00000 0.20000 0.00000 0.00000 0.26667 0.00000 0.00000 0.26667 0.00000 0.00000 0.26667 0.00000 0.00000 0.26667 0.00000 0.00000 0.26667 0.00000 0.00000 0.26667 0.00000 0.00000 0.26667 0.00000 0.00000 0.26667 0.00000 0.00000 0.33333 0.00000 0.00000 0.33333 0.00000 0.00000 0.33333 0.00000 0.00000 0.33333 0.00000 0.00000 0.33333 0.00000 0.00000 0.33333 0.00000 0.00000 0.33333 0.00000 0.00000 0.33333 0.00000 0.00000 0.40000 0.00000 0.00000 0.40000 0.00000 0.00000 0.40000 0.00000 0.00000 0.40000 0.00000 0.00000 0.40000 0.00000 0.00000 0.40000 0.00000 0.00000 0.40000 0.00000 0.00000 0.40000 0.00000 0.00000 0.46667 0.00000 0.00000 0.46667 0.00000 0.00000 0.46667 0.00000 0.00000 0.46667 0.00000 0.00000 0.46667 0.00000 0.00000 0.46667 0.00000 0.00000 0.46667 0.00000 0.00000 0.46667 0.00000 0.00000 0.53333 0.00000 0.00000 0.53333 0.00000 0.00000 0.53333 0.00000 0.00000 0.53333 0.00000 0.00000 0.53333 0.00000 0.00000 0.53333 0.00000 0.00000 0.53333 0.00000 0.00000 0.53333 0.06667 0.00000 0.53333 0.06667 0.00000 0.53333 0.06667 0.00000 0.53333 0.06667 0.00000 0.53333 0.06667 0.00000 0.53333 0.06667 0.00000 0.53333 0.06667 0.00000 0.53333 0.06667 0.00000 0.53333 0.13333 0.00000 0.53333 0.13333 0.00000 0.53333 0.13333 0.00000 0.53333 0.13333 0.00000 0.53333 0.13333 0.00000 0.53333 0.13333 0.00000 0.53333 0.13333 0.00000 0.53333 0.13333 0.00000 0.53333 0.20000 0.00000 0.53333 0.20000 0.00000 0.53333 0.20000 0.00000 0.53333 0.20000 0.00000 0.53333 0.20000 0.00000 0.53333 0.20000 0.00000 0.53333 0.20000 0.00000 0.53333 0.20000 0.00000 0.53333 0.26667 0.00000 0.53333 0.26667 0.00000 0.53333 0.26667 0.00000 0.53333 0.26667 0.00000 0.53333 0.26667 0.00000 0.53333 0.26667 0.00000 0.53333 0.26667 0.00000 0.53333 0.26667 0.00000 0.53333 0.33333 0.00000 0.53333 0.33333 0.00000 0.53333 0.33333 0.00000 0.53333 0.33333 0.00000 0.53333 0.33333 0.00000 0.53333 0.33333 0.00000 0.53333 0.33333 0.00000 0.53333 0.33333 0.00000 0.53333 0.40000 0.00000 0.53333 0.40000 0.00000 0.53333 0.40000 0.00000 0.53333 0.40000 0.00000 0.53333 0.40000 0.00000 0.53333 0.40000 0.00000 0.53333 0.40000 0.00000 0.53333 0.40000 0.00000 0.53333 0.46667 0.00000 0.53333 0.46667 0.00000 0.53333 0.46667 0.00000 0.53333 0.46667 0.00000 0.53333 0.46667 0.00000 0.53333 0.46667 0.00000 0.53333 0.46667 0.00000 0.53333 0.46667 0.00000 0.53333 0.53333 0.00000 0.53333 0.53333 0.00000 0.53333 0.53333 0.00000 0.53333 0.53333 0.00000 0.53333 0.53333 0.00000 0.46667 0.53333 0.00000 0.46667 0.53333 0.00000 0.46667 0.53333 0.00000 0.46667 0.60000 0.00000 0.40000 0.60000 0.00000 0.40000 0.60000 0.00000 0.40000 0.60000 0.00000 0.40000 0.60000 0.00000 0.33333 0.60000 0.00000 0.33333 0.60000 0.00000 0.33333 0.60000 0.00000 0.33333 0.66667 0.00000 0.26667 0.66667 0.00000 0.26667 0.66667 0.00000 0.26667 0.66667 0.00000 0.26667 0.66667 0.00000 0.20000 0.66667 0.00000 0.20000 0.66667 0.00000 0.20000 0.66667 0.00000 0.20000 0.73333 0.00000 0.13333 0.73333 0.00000 0.13333 0.73333 0.00000 0.13333 0.73333 0.00000 0.13333 0.73333 0.00000 0.06667 0.73333 0.00000 0.06667 0.73333 0.00000 0.06667 0.73333 0.00000 0.06667 0.80000 0.00000 0.00000 0.80000 0.00000 0.00000 0.80000 0.00000 0.00000 0.80000 0.00000 0.00000 0.80000 0.00000 0.00000 0.80000 0.00000 0.00000 0.80000 0.00000 0.00000 0.80000 0.00000 0.00000 0.86667 0.00000 0.00000 0.86667 0.00000 0.00000 0.86667 0.00000 0.00000 0.86667 0.00000 0.00000 0.86667 0.00000 0.00000 0.86667 0.00000 0.00000 0.86667 0.00000 0.00000 0.86667 0.00000 0.00000 0.93333 0.00000 0.00000 0.93333 0.00000 0.00000 0.93333 0.00000 0.00000 0.93333 0.00000 0.00000 0.93333 0.00000 0.00000 0.93333 0.00000 0.00000 0.93333 0.00000 0.00000 0.93333 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.06667 0.00000 1.00000 0.06667 0.00000 1.00000 0.13333 0.00000 1.00000 0.13333 0.00000 1.00000 0.20000 0.00000 1.00000 0.20000 0.00000 1.00000 0.26667 0.00000 1.00000 0.26667 0.00000 1.00000 0.33333 0.00000 1.00000 0.33333 0.00000 1.00000 0.40000 0.00000 1.00000 0.40000 0.00000 1.00000 0.46667 0.00000 1.00000 0.46667 0.00000 1.00000 0.53333 0.00000 1.00000 0.53333 0.00000 1.00000 0.60000 0.00000 1.00000 0.60000 0.00000 1.00000 0.66667 0.00000 1.00000 0.66667 0.00000 1.00000 0.73333 0.00000 1.00000 0.73333 0.00000 1.00000 0.80000 0.00000 1.00000 0.80000 0.00000 1.00000 0.86667 0.00000 1.00000 0.86667 0.00000 1.00000 0.93333 0.00000 1.00000 0.93333 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.06667 1.00000 1.00000 0.06667 1.00000 1.00000 0.13333 1.00000 1.00000 0.13333 1.00000 1.00000 0.20000 1.00000 1.00000 0.20000 1.00000 1.00000 0.26667 1.00000 1.00000 0.26667 1.00000 1.00000 0.33333 1.00000 1.00000 0.33333 1.00000 1.00000 0.40000 1.00000 1.00000 0.40000 1.00000 1.00000 0.46667 1.00000 1.00000 0.46667 1.00000 1.00000 0.53333 1.00000 1.00000 0.53333 1.00000 1.00000 0.60000 1.00000 1.00000 0.60000 1.00000 1.00000 0.66667 1.00000 1.00000 0.66667 1.00000 1.00000 0.73333 1.00000 1.00000 0.73333 1.00000 1.00000 0.80000 1.00000 1.00000 0.80000 1.00000 1.00000 0.86667 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/smooth3.lasc000066400000000000000000000324001215713201500221640ustar00rootroot00000000000000 0.00000 0.00000 0.00784 0.00000 0.00000 0.01795 0.00000 0.00000 0.03087 0.00000 0.00000 0.04434 0.00000 0.00000 0.05781 0.00000 0.00000 0.07128 0.00000 0.00000 0.08475 0.00000 0.00000 0.09822 0.00000 0.00000 0.11170 0.00000 0.00000 0.12231 0.00000 0.00000 0.13472 0.00000 0.00000 0.14819 0.00000 0.00000 0.16166 0.00000 0.00000 0.17513 0.00000 0.00000 0.18851 0.00000 0.00000 0.19862 0.00000 0.00000 0.21163 0.00000 0.00000 0.22510 0.00000 0.00000 0.23857 0.00000 0.00000 0.25080 0.00000 0.00000 0.26228 0.00000 0.00000 0.27885 0.00000 0.00000 0.28895 0.00000 0.00000 0.30201 0.00000 0.00000 0.31308 0.00000 0.00000 0.32503 0.00000 0.00000 0.33850 0.00000 0.00000 0.35197 0.00000 0.00000 0.36526 0.00000 0.00000 0.37536 0.00000 0.00000 0.39146 0.00000 0.00000 0.40341 0.00000 0.00000 0.41541 0.00000 0.00000 0.42754 0.00000 0.00000 0.43922 0.00000 0.00000 0.45559 0.00000 0.00000 0.46570 0.00000 0.00000 0.47885 0.00000 0.00000 0.49232 0.00000 0.00000 0.50579 0.00000 0.00000 0.51788 0.00000 0.00000 0.52881 0.00000 0.00000 0.54228 0.00000 0.00000 0.55576 0.00000 0.00000 0.56923 0.00000 0.00000 0.58016 0.00397 0.00000 0.59225 0.01356 0.00000 0.60572 0.02791 0.00000 0.61919 0.04507 0.00000 0.63234 0.06528 0.00000 0.64245 0.08235 0.00000 0.65569 0.10178 0.00000 0.66916 0.12198 0.00000 0.68263 0.14219 0.00000 0.69462 0.16240 0.00000 0.70565 0.18261 0.00000 0.71912 0.20281 0.00000 0.73259 0.21984 0.00000 0.74607 0.23668 0.00000 0.75954 0.25559 0.00000 0.77093 0.27580 0.00000 0.78256 0.29504 0.00000 0.79603 0.31063 0.00000 0.80909 0.31737 0.00000 0.81919 0.31765 0.00000 0.83575 0.31765 0.00000 0.84992 0.31765 0.00000 0.86339 0.31765 0.00000 0.87686 0.31765 0.00000 0.88932 0.31719 0.00000 0.89942 0.31382 0.00000 0.90953 0.31373 0.00000 0.92291 0.31373 0.00000 0.93638 0.31373 0.00000 0.94985 0.31373 0.00000 0.96332 0.31373 0.00000 0.97573 0.40250 0.05175 0.86307 0.99189 0.39528 0.05813 1.00000 0.40000 0.04706 0.84776 0.30312 0.04983 0.55402 0.11438 0.05319 0.38644 0.00000 0.05988 0.40664 0.00000 0.07442 0.42685 0.00000 0.09799 0.44706 0.00000 0.12157 0.46727 0.00000 0.13841 0.48466 0.00000 0.15806 0.50376 0.00000 0.17827 0.52397 0.00000 0.20018 0.54417 0.00000 0.22261 0.56438 0.00000 0.24281 0.58459 0.00000 0.26302 0.60480 0.00000 0.28323 0.62501 0.00000 0.30344 0.64521 0.00000 0.32364 0.66542 0.00000 0.34385 0.68563 0.00000 0.36406 0.70584 0.00000 0.38491 0.72604 0.00000 0.40840 0.74625 0.00000 0.42860 0.76937 0.00000 0.44881 0.79059 0.00000 0.46667 0.81260 0.00000 0.48711 0.83493 0.00000 0.50944 0.85513 0.00000 0.52964 0.87576 0.00000 0.54985 0.90607 0.00000 0.57006 0.93933 0.00000 0.59027 0.96821 0.00000 0.61047 0.98777 0.00000 0.63068 0.99737 0.00000 0.65089 1.00000 0.00000 0.67110 1.00000 0.00092 0.69149 1.00000 0.01776 0.71506 1.00000 0.03760 0.73564 1.00000 0.05781 0.75585 1.00000 0.07802 0.77606 1.00000 0.09822 0.79626 1.00000 0.11922 0.81647 1.00000 0.14279 0.83668 1.00000 0.16637 0.85689 1.00000 0.18690 0.88014 1.00000 0.20960 0.90122 1.00000 0.23124 0.92143 1.00000 0.25144 0.94164 1.00000 0.27165 0.96185 1.00000 0.29214 0.98178 1.00000 0.31571 0.99862 1.00000 0.33310 0.98454 1.00000 0.35248 0.96517 1.00000 0.37269 0.94496 1.00000 0.39290 0.92332 1.00000 0.41223 0.89974 1.00000 0.42907 0.87649 1.00000 0.44591 0.85628 1.00000 0.46588 0.83294 1.00000 0.48609 0.81195 1.00000 0.50630 0.79174 1.00000 0.52503 0.77006 1.00000 0.54279 0.74740 1.00000 0.56263 0.72720 1.00000 0.57947 0.70699 1.00000 0.59949 0.68360 1.00000 0.61707 0.66265 1.00000 0.62976 0.64037 1.00000 0.63682 0.61831 1.00000 0.63922 0.59811 1.00000 0.63922 0.57790 1.00000 0.63922 0.55769 1.00000 0.63922 0.53425 1.00000 0.63922 0.51335 1.00000 0.63922 0.49102 1.00000 0.63922 0.46902 1.00000 0.63922 0.44881 1.00000 0.63922 0.42860 1.00000 0.63922 0.40839 1.00000 0.63922 0.38491 1.00000 0.63922 0.36406 1.00000 0.63922 0.34168 0.99838 0.63922 0.31972 0.99077 0.63922 0.29845 0.97241 0.63922 0.27589 0.94546 0.63922 0.25905 0.91520 0.63922 0.23557 0.88489 0.63922 0.21476 0.85457 0.63922 0.19234 0.82426 0.63922 0.16876 0.79395 0.63922 0.14629 0.76309 0.63922 0.12664 0.72941 0.63922 0.10980 0.70583 0.63922 0.08622 0.69070 0.63922 0.06265 0.67949 0.63922 0.04133 0.67793 0.64092 0.02113 0.68582 0.64545 0.00554 0.69772 0.65278 0.00000 0.71793 0.66307 0.00000 0.73814 0.68665 0.00000 0.75834 0.71022 0.00000 0.77855 0.73380 0.00000 0.79876 0.75738 0.00000 0.81897 0.78095 0.00000 0.83982 0.80517 0.00000 0.86330 0.83202 0.00000 0.88351 0.85560 0.00000 0.90372 0.88208 0.00000 0.92393 0.90667 0.00000 0.94413 0.93025 0.00000 0.96434 0.95382 0.00000 0.98386 0.97740 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00305 1.00000 1.00000 0.01638 1.00000 1.00000 0.03322 1.00000 1.00000 0.05006 1.00000 1.00000 0.06773 1.00000 1.00000 0.08794 1.00000 1.00000 0.10815 1.00000 1.00000 0.12526 1.00000 1.00000 0.14464 1.00000 1.00000 0.16485 1.00000 1.00000 0.18506 1.00000 1.00000 0.20439 1.00000 1.00000 0.22155 1.00000 1.00000 0.24176 1.00000 1.00000 0.25883 1.00000 1.00000 0.27567 1.00000 1.00000 0.28642 1.00000 1.00000 0.28872 1.00000 1.00000 0.28350 1.00000 1.00000 0.27229 1.00000 1.00000 0.25208 1.00000 1.00000 0.22869 1.00000 1.00000 0.20511 1.00000 1.00000 0.18154 1.00000 1.00000 0.15796 1.00000 1.00000 0.13536 1.00000 1.00000 0.11473 1.00000 1.00000 0.09116 1.00000 1.00000 0.06435 1.00000 1.00000 0.04008 1.00000 1.00000 0.02076 1.00000 1.00000 0.00706 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.09305 1.00000 1.00000 0.33136 1.00000 1.00000 0.60966 1.00000 1.00000 0.83605 0.96674 1.00000 0.96343 0.75749 1.00000 1.00000 0.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/staircase.lasc000066400000000000000000000324001215713201500225460ustar00rootroot00000000000000 0.00392 0.00392 0.31373 0.00784 0.00784 0.31373 0.01176 0.01176 0.31373 0.01569 0.01569 0.31373 0.01961 0.01961 0.31373 0.02353 0.02353 0.31373 0.02745 0.02745 0.31373 0.03137 0.03137 0.31373 0.03529 0.03529 0.31373 0.03922 0.03922 0.31373 0.04314 0.04314 0.31373 0.04706 0.04706 0.31373 0.05098 0.05098 0.31373 0.05490 0.05490 0.31373 0.05882 0.05882 0.31373 0.06275 0.06275 0.31373 0.06667 0.06667 0.47059 0.07059 0.07059 0.47059 0.07451 0.07451 0.47059 0.07843 0.07843 0.47059 0.08235 0.08235 0.47059 0.08627 0.08627 0.47059 0.09020 0.09020 0.47059 0.09412 0.09412 0.47059 0.09804 0.09804 0.47059 0.10196 0.10196 0.47059 0.10588 0.10588 0.47059 0.10980 0.10980 0.47059 0.11373 0.11373 0.47059 0.11765 0.11765 0.47059 0.12157 0.12157 0.47059 0.12549 0.12549 0.47059 0.12941 0.12941 0.62745 0.13333 0.13333 0.62745 0.13725 0.13725 0.62745 0.14118 0.14118 0.62745 0.14510 0.14510 0.62745 0.14902 0.14902 0.62745 0.15294 0.15294 0.62745 0.15686 0.15686 0.62745 0.16078 0.16078 0.62745 0.16471 0.16471 0.62745 0.16863 0.16863 0.62745 0.17255 0.17255 0.62745 0.17647 0.17647 0.62745 0.18039 0.18039 0.62745 0.18431 0.18431 0.62745 0.18824 0.18824 0.62745 0.19216 0.19216 0.78431 0.19608 0.19608 0.78431 0.20000 0.20000 0.78431 0.20392 0.20392 0.78431 0.20784 0.20784 0.78431 0.21176 0.21176 0.78431 0.21569 0.21569 0.78431 0.21961 0.21961 0.78431 0.22353 0.22353 0.78431 0.22745 0.22745 0.78431 0.23137 0.23137 0.78431 0.23529 0.23529 0.78431 0.23922 0.23922 0.78431 0.24314 0.24314 0.78431 0.24706 0.24706 0.78431 0.25098 0.25098 0.78431 0.25490 0.25490 0.94118 0.25882 0.25882 0.94118 0.26275 0.26275 0.94118 0.26667 0.26667 0.94118 0.27059 0.27059 0.94118 0.27451 0.27451 0.94118 0.27843 0.27843 0.94118 0.28235 0.28235 0.94118 0.28627 0.28627 0.94118 0.29020 0.29020 0.94118 0.29412 0.29412 0.94118 0.29804 0.29804 0.94118 0.30196 0.30196 0.94118 0.30588 0.30588 0.94118 0.30980 0.30980 0.94118 0.31373 0.31373 0.94118 0.31765 0.31765 0.95294 0.32157 0.32157 0.96471 0.32549 0.32549 0.97647 0.32941 0.32941 0.98824 0.33333 0.33333 1.00000 0.00392 0.31373 0.00392 0.00784 0.31373 0.00784 0.01176 0.31373 0.01176 0.01569 0.31373 0.01569 0.01961 0.31373 0.01961 0.02353 0.31373 0.02353 0.02745 0.31373 0.02745 0.03137 0.31373 0.03137 0.03529 0.31373 0.03529 0.03922 0.31373 0.03922 0.04314 0.31373 0.04314 0.04706 0.31373 0.04706 0.05098 0.31373 0.05098 0.05490 0.31373 0.05490 0.05882 0.31373 0.05882 0.06275 0.31373 0.06275 0.06667 0.47059 0.06667 0.07059 0.47059 0.07059 0.07451 0.47059 0.07451 0.07843 0.47059 0.07843 0.08235 0.47059 0.08235 0.08627 0.47059 0.08627 0.09020 0.47059 0.09020 0.09412 0.47059 0.09412 0.09804 0.47059 0.09804 0.10196 0.47059 0.10196 0.10588 0.47059 0.10588 0.10980 0.47059 0.10980 0.11373 0.47059 0.11373 0.11765 0.47059 0.11765 0.12157 0.47059 0.12157 0.12549 0.47059 0.12549 0.12941 0.62745 0.12941 0.13333 0.62745 0.13333 0.13725 0.62745 0.13725 0.14118 0.62745 0.14118 0.14510 0.62745 0.14510 0.14902 0.62745 0.14902 0.15294 0.62745 0.15294 0.15686 0.62745 0.15686 0.16078 0.62745 0.16078 0.16471 0.62745 0.16471 0.16863 0.62745 0.16863 0.17255 0.62745 0.17255 0.17647 0.62745 0.17647 0.18039 0.62745 0.18039 0.18431 0.62745 0.18431 0.18824 0.62745 0.18824 0.19216 0.78431 0.19216 0.19608 0.78431 0.19608 0.20000 0.78431 0.20000 0.20392 0.78431 0.20392 0.20784 0.78431 0.20784 0.21176 0.78431 0.21176 0.21569 0.78431 0.21569 0.21961 0.78431 0.21961 0.22353 0.78431 0.22353 0.22745 0.78431 0.22745 0.23137 0.78431 0.23137 0.23529 0.78431 0.23529 0.23922 0.78431 0.23922 0.24314 0.78431 0.24314 0.24706 0.78431 0.24706 0.25098 0.78431 0.25098 0.25490 0.94118 0.25490 0.25882 0.94118 0.25882 0.26275 0.94118 0.26275 0.26667 0.94118 0.26667 0.27059 0.94118 0.27059 0.27451 0.94118 0.27451 0.27843 0.94118 0.27843 0.28235 0.94118 0.28235 0.28627 0.94118 0.28627 0.29020 0.94118 0.29020 0.29412 0.94118 0.29412 0.29804 0.94118 0.29804 0.30196 0.94118 0.30196 0.30588 0.94118 0.30588 0.30980 0.94118 0.30980 0.31373 0.94118 0.31373 0.31765 0.95294 0.31765 0.32157 0.96471 0.32157 0.32549 0.97647 0.32549 0.32941 0.98824 0.32941 0.33333 1.00000 0.33333 0.31373 0.00392 0.00392 0.31373 0.00784 0.00784 0.31373 0.01176 0.01176 0.31373 0.01569 0.01569 0.31373 0.01961 0.01961 0.31373 0.02353 0.02353 0.31373 0.02745 0.02745 0.31373 0.03137 0.03137 0.31373 0.03529 0.03529 0.31373 0.03922 0.03922 0.31373 0.04314 0.04314 0.31373 0.04706 0.04706 0.31373 0.05098 0.05098 0.31373 0.05490 0.05490 0.31373 0.05882 0.05882 0.31373 0.06275 0.06275 0.47059 0.06667 0.06667 0.47059 0.07059 0.07059 0.47059 0.07451 0.07451 0.47059 0.07843 0.07843 0.47059 0.08235 0.08235 0.47059 0.08627 0.08627 0.47059 0.09020 0.09020 0.47059 0.09412 0.09412 0.47059 0.09804 0.09804 0.47059 0.10196 0.10196 0.47059 0.10588 0.10588 0.47059 0.10980 0.10980 0.47059 0.11373 0.11373 0.47059 0.11765 0.11765 0.47059 0.12157 0.12157 0.47059 0.12549 0.12549 0.62745 0.12941 0.12941 0.62745 0.13333 0.13333 0.62745 0.13725 0.13725 0.62745 0.14118 0.14118 0.62745 0.14510 0.14510 0.62745 0.14902 0.14902 0.62745 0.15294 0.15294 0.62745 0.15686 0.15686 0.62745 0.16078 0.16078 0.62745 0.16471 0.16471 0.62745 0.16863 0.16863 0.62745 0.17255 0.17255 0.62745 0.17647 0.17647 0.62745 0.18039 0.18039 0.62745 0.18431 0.18431 0.62745 0.18824 0.18824 0.78431 0.19216 0.19216 0.78431 0.19608 0.19608 0.78431 0.20000 0.20000 0.78431 0.20392 0.20392 0.78431 0.20784 0.20784 0.78431 0.21176 0.21176 0.78431 0.21569 0.21569 0.78431 0.21961 0.21961 0.78431 0.22353 0.22353 0.78431 0.22745 0.22745 0.78431 0.23137 0.23137 0.78431 0.23529 0.23529 0.78431 0.23922 0.23922 0.78431 0.24314 0.24314 0.78431 0.24706 0.24706 0.78431 0.25098 0.25098 0.94118 0.25490 0.25490 0.94118 0.25882 0.25882 0.94118 0.26275 0.26275 0.94118 0.26667 0.26667 0.94118 0.27059 0.27059 0.94118 0.27451 0.27451 0.94118 0.27843 0.27843 0.94118 0.28235 0.28235 0.94118 0.28627 0.28627 0.94118 0.29020 0.29020 0.94118 0.29412 0.29412 0.94118 0.29804 0.29804 0.94118 0.30196 0.30196 0.94118 0.30588 0.30588 0.94118 0.30980 0.30980 0.94118 0.31373 0.31373 0.94902 0.39216 0.39216 0.96078 0.52941 0.52941 0.97255 0.66667 0.66667 0.98431 0.80392 0.80392 0.99216 0.80000 0.80000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/stairs.iasc000066400000000000000000000154001215713201500220730ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.05882 0.11765 0.11765 0.11765 0.11765 0.11765 0.11765 0.11765 0.11765 0.11765 0.11765 0.11765 0.11765 0.11765 0.11765 0.11765 0.17647 0.17647 0.17647 0.17647 0.17647 0.17647 0.17647 0.17647 0.17647 0.17647 0.17647 0.17647 0.17647 0.17647 0.17647 0.23529 0.23529 0.23529 0.23529 0.23529 0.23529 0.23529 0.23529 0.23529 0.23529 0.23529 0.23529 0.23529 0.23529 0.23529 0.29412 0.29412 0.29412 0.29412 0.29412 0.29412 0.29412 0.29412 0.29412 0.29412 0.29412 0.29412 0.29412 0.29412 0.29412 0.35294 0.35294 0.35294 0.35294 0.35294 0.35294 0.35294 0.35294 0.35294 0.35294 0.35294 0.35294 0.35294 0.35294 0.35294 0.41176 0.41176 0.41176 0.41176 0.41176 0.41176 0.41176 0.41176 0.41176 0.41176 0.41176 0.41176 0.41176 0.41176 0.41176 0.47059 0.47059 0.47059 0.47059 0.47059 0.47059 0.47059 0.47059 0.47059 0.47059 0.47059 0.47059 0.47059 0.47059 0.47059 0.52941 0.52941 0.52941 0.52941 0.52941 0.52941 0.52941 0.52941 0.52941 0.52941 0.52941 0.52941 0.52941 0.52941 0.52941 0.58824 0.58824 0.58824 0.58824 0.58824 0.58824 0.58824 0.58824 0.58824 0.58824 0.58824 0.58824 0.58824 0.58824 0.58824 0.64706 0.64706 0.64706 0.64706 0.64706 0.64706 0.64706 0.64706 0.64706 0.64706 0.64706 0.64706 0.64706 0.64706 0.64706 0.70588 0.70588 0.70588 0.70588 0.70588 0.70588 0.70588 0.70588 0.70588 0.70588 0.70588 0.70588 0.70588 0.70588 0.70588 0.76471 0.76471 0.76471 0.76471 0.76471 0.76471 0.76471 0.76471 0.76471 0.76471 0.76471 0.76471 0.76471 0.76471 0.76471 0.82353 0.82353 0.82353 0.82353 0.82353 0.82353 0.82353 0.82353 0.82353 0.82353 0.82353 0.82353 0.82353 0.82353 0.82353 0.88235 0.88235 0.88235 0.88235 0.88235 0.88235 0.88235 0.88235 0.88235 0.88235 0.88235 0.88235 0.88235 0.88235 0.88235 0.94118 0.94118 0.94118 0.94118 0.94118 0.94118 0.94118 0.94118 0.94118 0.94118 0.94118 0.94118 0.94118 0.94118 0.94118 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/stairs8.lasc000066400000000000000000000324001215713201500221650ustar00rootroot00000000000000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 0.76471 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.49804 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/stairs9.lasc000066400000000000000000000324001215713201500221660ustar00rootroot00000000000000 0.00000 0.00000 0.00000 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.19608 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.60784 0.00000 0.47451 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.78431 0.00000 0.00000 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.92549 0.65490 0.37255 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.56863 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 0.96471 0.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 1.00000 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.69412 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 0.00000 0.00000 1.00000 skycat-3.1.2-starlink-1b/rtd/colormaps/standard.lasc000066400000000000000000000324001215713201500223700ustar00rootroot00000000000000 0.00392 0.00392 0.33333 0.00784 0.00784 0.34118 0.01176 0.01176 0.34902 0.01569 0.01569 0.35686 0.01961 0.01961 0.36471 0.02353 0.02353 0.37255 0.02745 0.02745 0.38039 0.03137 0.03137 0.38824 0.03529 0.03529 0.39608 0.03922 0.03922 0.40392 0.04314 0.04314 0.41176 0.04706 0.04706 0.41961 0.05098 0.05098 0.42745 0.05490 0.05490 0.43529 0.05882 0.05882 0.44314 0.06275 0.06275 0.45098 0.06667 0.06667 0.45882 0.07059 0.07059 0.46667 0.07451 0.07451 0.47451 0.07843 0.07843 0.48235 0.08235 0.08235 0.49020 0.08627 0.08627 0.49804 0.09020 0.09020 0.50588 0.09412 0.09412 0.51373 0.09804 0.09804 0.52157 0.10196 0.10196 0.52941 0.10588 0.10588 0.53725 0.10980 0.10980 0.54510 0.11373 0.11373 0.55294 0.11765 0.11765 0.56078 0.12157 0.12157 0.56863 0.12549 0.12549 0.57647 0.12941 0.12941 0.58431 0.13333 0.13333 0.59216 0.13725 0.13725 0.60000 0.14118 0.14118 0.60784 0.14510 0.14510 0.61569 0.14902 0.14902 0.62353 0.15294 0.15294 0.63137 0.15686 0.15686 0.63922 0.16078 0.16078 0.64706 0.16471 0.16471 0.65490 0.16863 0.16863 0.66275 0.17255 0.17255 0.67059 0.17647 0.17647 0.67843 0.18039 0.18039 0.68627 0.18431 0.18431 0.69412 0.18824 0.18824 0.70196 0.19216 0.19216 0.70980 0.19608 0.19608 0.71765 0.20000 0.20000 0.72549 0.20392 0.20392 0.73333 0.20784 0.20784 0.74118 0.21176 0.21176 0.74902 0.21569 0.21569 0.75686 0.21961 0.21961 0.76471 0.22353 0.22353 0.77255 0.22745 0.22745 0.78039 0.23137 0.23137 0.78824 0.23529 0.23529 0.79608 0.23922 0.23922 0.80392 0.24314 0.24314 0.81176 0.24706 0.24706 0.81961 0.25098 0.25098 0.82745 0.25490 0.25490 0.83529 0.25882 0.25882 0.84314 0.26275 0.26275 0.85098 0.26667 0.26667 0.85882 0.27059 0.27059 0.86667 0.27451 0.27451 0.87451 0.27843 0.27843 0.88235 0.28235 0.28235 0.89020 0.28627 0.28627 0.89804 0.29020 0.29020 0.90588 0.29412 0.29412 0.91373 0.29804 0.29804 0.92157 0.30196 0.30196 0.92941 0.30588 0.30588 0.93725 0.30980 0.30980 0.94510 0.31373 0.31373 0.95294 0.31765 0.31765 0.96078 0.32157 0.32157 0.96863 0.32549 0.32549 0.97647 0.32941 0.32941 0.98431 0.33333 0.33333 0.99216 0.00392 0.33333 0.00392 0.00784 0.34118 0.00784 0.01176 0.34902 0.01176 0.01569 0.35686 0.01569 0.01961 0.36471 0.01961 0.02353 0.37255 0.02353 0.02745 0.38039 0.02745 0.03137 0.38824 0.03137 0.03529 0.39608 0.03529 0.03922 0.40392 0.03922 0.04314 0.41176 0.04314 0.04706 0.41961 0.04706 0.05098 0.42745 0.05098 0.05490 0.43529 0.05490 0.05882 0.44314 0.05882 0.06275 0.45098 0.06275 0.06667 0.45882 0.06667 0.07059 0.46667 0.07059 0.07451 0.47451 0.07451 0.07843 0.48235 0.07843 0.08235 0.49020 0.08235 0.08627 0.49804 0.08627 0.09020 0.50588 0.09020 0.09412 0.51373 0.09412 0.09804 0.52157 0.09804 0.10196 0.52941 0.10196 0.10588 0.53725 0.10588 0.10980 0.54510 0.10980 0.11373 0.55294 0.11373 0.11765 0.56078 0.11765 0.12157 0.56863 0.12157 0.12549 0.57647 0.12549 0.12941 0.58431 0.12941 0.13333 0.59216 0.13333 0.13725 0.60000 0.13725 0.14118 0.60784 0.14118 0.14510 0.61569 0.14510 0.14902 0.62353 0.14902 0.15294 0.63137 0.15294 0.15686 0.63922 0.15686 0.16078 0.64706 0.16078 0.16471 0.65490 0.16471 0.16863 0.66275 0.16863 0.17255 0.67059 0.17255 0.17647 0.67843 0.17647 0.18039 0.68627 0.18039 0.18431 0.69412 0.18431 0.18824 0.70196 0.18824 0.19216 0.70980 0.19216 0.19608 0.71765 0.19608 0.20000 0.72549 0.20000 0.20392 0.73333 0.20392 0.20784 0.74118 0.20784 0.21176 0.74902 0.21176 0.21569 0.75686 0.21569 0.21961 0.76471 0.21961 0.22353 0.77255 0.22353 0.22745 0.78039 0.22745 0.23137 0.78824 0.23137 0.23529 0.79608 0.23529 0.23922 0.80392 0.23922 0.24314 0.81176 0.24314 0.24706 0.81961 0.24706 0.25098 0.82745 0.25098 0.25490 0.83529 0.25490 0.25882 0.84314 0.25882 0.26275 0.85098 0.26275 0.26667 0.85882 0.26667 0.27059 0.86667 0.27059 0.27451 0.87451 0.27451 0.27843 0.88235 0.27843 0.28235 0.89020 0.28235 0.28627 0.89804 0.28627 0.29020 0.90588 0.29020 0.29412 0.91373 0.29412 0.29804 0.92157 0.29804 0.30196 0.92941 0.30196 0.30588 0.93725 0.30588 0.30980 0.94510 0.30980 0.31373 0.95294 0.31373 0.31765 0.96078 0.31765 0.32157 0.96863 0.32157 0.32549 0.97647 0.32549 0.32941 0.98431 0.32941 0.33333 0.99216 0.33333 0.33333 0.00392 0.00392 0.34118 0.00784 0.00784 0.34902 0.01176 0.01176 0.35686 0.01569 0.01569 0.36471 0.01961 0.01961 0.37255 0.02353 0.02353 0.38039 0.02745 0.02745 0.38824 0.03137 0.03137 0.39608 0.03529 0.03529 0.40392 0.03922 0.03922 0.41176 0.04314 0.04314 0.41961 0.04706 0.04706 0.42745 0.05098 0.05098 0.43529 0.05490 0.05490 0.44314 0.05882 0.05882 0.45098 0.06275 0.06275 0.45882 0.06667 0.06667 0.46667 0.07059 0.07059 0.47451 0.07451 0.07451 0.48235 0.07843 0.07843 0.49020 0.08235 0.08235 0.49804 0.08627 0.08627 0.50588 0.09020 0.09020 0.51373 0.09412 0.09412 0.52157 0.09804 0.09804 0.52941 0.10196 0.10196 0.53725 0.10588 0.10588 0.54510 0.10980 0.10980 0.55294 0.11373 0.11373 0.56078 0.11765 0.11765 0.56863 0.12157 0.12157 0.57647 0.12549 0.12549 0.58431 0.12941 0.12941 0.59216 0.13333 0.13333 0.60000 0.13725 0.13725 0.60784 0.14118 0.14118 0.61569 0.14510 0.14510 0.62353 0.14902 0.14902 0.63137 0.15294 0.15294 0.63922 0.15686 0.15686 0.64706 0.16078 0.16078 0.65490 0.16471 0.16471 0.66275 0.16863 0.16863 0.67059 0.17255 0.17255 0.67843 0.17647 0.17647 0.68627 0.18039 0.18039 0.69412 0.18431 0.18431 0.70196 0.18824 0.18824 0.70980 0.19216 0.19216 0.71765 0.19608 0.19608 0.72549 0.20000 0.20000 0.73333 0.20392 0.20392 0.74118 0.20784 0.20784 0.74902 0.21176 0.21176 0.75686 0.21569 0.21569 0.76471 0.21961 0.21961 0.77255 0.22353 0.22353 0.78039 0.22745 0.22745 0.78824 0.23137 0.23137 0.79608 0.23529 0.23529 0.80392 0.23922 0.23922 0.81176 0.24314 0.24314 0.81961 0.24706 0.24706 0.82745 0.25098 0.25098 0.83529 0.25490 0.25490 0.84314 0.25882 0.25882 0.85098 0.26275 0.26275 0.85882 0.26667 0.26667 0.86667 0.27059 0.27059 0.87451 0.27451 0.27451 0.88235 0.27843 0.27843 0.89020 0.28235 0.28235 0.89804 0.28627 0.28627 0.90588 0.29020 0.29020 0.91373 0.29412 0.29412 0.92157 0.29804 0.29804 0.92941 0.30196 0.30196 0.93725 0.30588 0.30588 0.94510 0.30980 0.30980 0.95294 0.31373 0.31373 0.96078 0.31765 0.31765 0.96863 0.32157 0.32157 0.97647 0.32549 0.32549 0.98431 0.32941 0.32941 0.99216 0.33333 0.33333 1.00000 0.33725 0.33725 skycat-3.1.2-starlink-1b/rtd/colormaps/update_colormaps.sh000066400000000000000000000002071215713201500236210ustar00rootroot00000000000000#!/bin/sh # # This script updates a C source file to contain the colormaps in this dir. tclsh colormaps.tcl > ../generic/colormaps.C skycat-3.1.2-starlink-1b/rtd/configure000077500000000000000000014113561215713201500176500ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Starlink Autoconf 2.59 for rtd 3.2.1. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='rtd' PACKAGE_TARNAME='rtd' PACKAGE_VERSION='3.2.1' PACKAGE_STRING='rtd 3.2.1' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_LIBS TK_XINCLUDES CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP CXX CXXFLAGS ac_ct_CXX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS tclutil_VERSION tclutil_LIB_FILE tclutil_BUILD_LIB_SPEC tclutil_BUILD_DIR tclutil_LIB_SPEC BLT_LIB_DIR BLT_LIB_SPEC tclutil_SRC_DIR tclutil_PKG_OBJECTS CFITSIO_LIB_DIR CFITSIO_LIB_SPEC astrotcl_VERSION astrotcl_LIB_FILE astrotcl_BUILD_LIB_SPEC astrotcl_BUILD_DIR astrotcl_LIB_SPEC astrotcl_SRC_DIR astrotcl_PKG_OBJECTS MERGE_OBJECTS SHLIB_LD_CXX_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TK_INCLUDES CXXCPP TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS SHLIB_SUFFIX DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_CFLAGS SHLIB_LD_LIBS LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LD_LIBRARY_PATH_VAR TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG WISH_PROG rtd_LIB_FILE rtd_BUILD_LIB_SPEC rtd_BUILD_DIR rtd_LIB_SPEC rtd_PKG_OBJECTS rtd_SRC_DIR LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS ac_env_CXXCPP_set=${CXXCPP+set} ac_env_CXXCPP_value=$CXXCPP ac_cv_env_CXXCPP_set=${CXXCPP+set} ac_cv_env_CXXCPP_value=$CXXCPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures rtd 3.2.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of rtd 3.2.1:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-merge merge the contents of dependent packages into a master library --enable-threads build with threads --enable-shared build and link with shared libraries --enable-shared --enable-64bit enable 64bit support (where applicable) --enable-64bit-vis enable 64bit Sparc VIS support --enable-wince enable Win/CE support (where applicable) --disable-load disallow dynamic loading and "load" command --enable-symbols build with debugging symbols --disable-symbols Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) --with-tclinclude directory containing the public Tcl header files --with-tkinclude directory containing the public Tk header files. --with-x use the X Window System --with-celib=DIR use Windows/CE support library from DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF rtd configure 3.2.1 generated by Starlink Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by rtd $as_me 3.2.1, which was generated by Starlink Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.4" echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 if test x"${PACKAGE_NAME}" = x ; then { { echo "$as_me:$LINENO: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 echo "$as_me: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} { (exit 1); exit 1; }; } fi if test x"3.4" = x ; then { { echo "$as_me:$LINENO: error: TEA version not specified." >&5 echo "$as_me: error: TEA version not specified." >&2;} { (exit 1); exit 1; }; } elif test "3.4" != "${TEA_VERSION}" ; then echo "$as_me:$LINENO: result: warning: requested TEA version \"3.4\", have \"${TEA_VERSION}\"" >&5 echo "${ECHO_T}warning: requested TEA version \"3.4\", have \"${TEA_VERSION}\"" >&6 else echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CYGPATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -w" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then echo "$as_me:$LINENO: result: $CYGPATH" >&5 echo "${ECHO_T}$CYGPATH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi # This package name must be replaced statically for AC_SUBST to work # Substitute STUB_LIB_FILE in case package creates a stub library too. # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" with_tclconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tcl configuration" >&5 echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 if test "${ac_cv_c_tclconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d ${TCLTK_ROOT}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" { echo "$as_me:$LINENO: WARNING: \"Cannot find Tcl configuration definitions\"" >&5 echo "$as_me: WARNING: \"Cannot find Tcl configuration definitions\"" >&2;} exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6 fi fi echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . $TCL_BIN_DIR/tclConfig.sh else echo "$as_me:$LINENO: result: file not found" >&5 echo "${ECHO_T}file not found" >&6 fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" #AC_SUBST(TCL_BUILD_LIB_SPEC) #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true # Check whether --with-tk or --without-tk was given. if test "${with_tk+set}" = set; then withval="$with_tk" with_tkconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tk configuration" >&5 echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6 if test "${ac_cv_c_tkconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case ${with_tkconfig} in */tkConfig.sh ) if test -f ${with_tkconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;} with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5 echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d ${TCLTK_ROOT}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" { echo "$as_me:$LINENO: WARNING: \"Cannot find Tk configuration definitions\"" >&5 echo "$as_me: WARNING: \"Cannot find Tk configuration definitions\"" >&2;} exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} echo "$as_me:$LINENO: result: found $TK_BIN_DIR/tkConfig.sh" >&5 echo "${ECHO_T}found $TK_BIN_DIR/tkConfig.sh" >&6 fi fi echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6 if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . $TK_BIN_DIR/tkConfig.sh else echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6 fi # # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TK_BIN_DIR/Makefile ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} fi # Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) cat >>confdefs.h <<\_ACEOF #define MAC_OSX_TK 1 _ACEOF TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi # # eval is required to do the TK_DBGX substitution # eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} prefix=${TCL_PREFIX} else { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 echo "$as_me: --prefix defaulting to /usr/local" >&6;} prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then #if test x"${TCL_EXEC_PREFIX}" != x; then #AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) #exec_prefix=${TCL_EXEC_PREFIX} #else { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} exec_prefix=$prefix #fi fi #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_cv_c_compiler_gnu = yes; then GCC=yes fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 OLDCC="$CC" CC="$CC -pipe" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC="$OLDCC" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi #-------------------------------------------------------------------- # Pick up flags from the environment (user). #-------------------------------------------------------------------- CC="${CC} $CFLAGS" CXX="${CXX} $CXXFLAGS $CFLAGS" #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac if test "${TEA_PLATFORM}" = "unix" ; then #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for sin" >&5 echo $ECHO_N "checking for sin... $ECHO_C" >&6 if test "${ac_cv_func_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sin to an innocuous variant, in case declares sin. For example, HP-UX 11i declares gettimeofday. */ #define sin innocuous_sin /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sin /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sin (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_sin) || defined (__stub___sin) choke me #else char (*f) () = sin; #endif #ifdef __cplusplus } #endif int main () { return f != sin; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sin=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sin=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 echo "${ECHO_T}$ac_cv_func_sin" >&6 if test $ac_cv_func_sin = yes; then MATH_LIBS="" else MATH_LIBS="-lm" fi echo "$as_me:$LINENO: checking for main in -lieee" >&5 echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 if test "${ac_cv_lib_ieee_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ieee_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 if test $ac_cv_lib_ieee_main = yes; then MATH_LIBS="-lieee $MATH_LIBS" fi #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for main in -linet" >&5 echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_inet_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 if test $ac_cv_lib_inet_main = yes; then LIBS="$LIBS -linet" fi if test "${ac_cv_header_net_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking net/errno.h usability" >&5 echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking net/errno.h presence" >&5 echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_net_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 fi if test $ac_cv_header_net_errno_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_ERRNO_H 1 _ACEOF fi #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_connect) || defined (__stub___connect) choke me #else char (*f) () = connect; #endif #ifdef __cplusplus } #endif int main () { return f != connect; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = yes; then tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then echo "$as_me:$LINENO: checking for setsockopt" >&5 echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 if test "${ac_cv_func_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define setsockopt to an innocuous variant, in case declares setsockopt. For example, HP-UX 11i declares gettimeofday. */ #define setsockopt innocuous_setsockopt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setsockopt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef setsockopt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_setsockopt) || defined (__stub___setsockopt) choke me #else char (*f) () = setsockopt; #endif #ifdef __cplusplus } #endif int main () { return f != setsockopt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 if test $ac_cv_func_setsockopt = yes; then : else echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); int main () { setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 if test $ac_cv_lib_socket_setsockopt = yes; then LIBS="$LIBS -lsocket" else tcl_checkBoth=1 fi fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo "$as_me:$LINENO: checking for accept" >&5 echo $ECHO_N "checking for accept... $ECHO_C" >&6 if test "${ac_cv_func_accept+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define accept to an innocuous variant, in case declares accept. For example, HP-UX 11i declares gettimeofday. */ #define accept innocuous_accept /* System header to define __stub macros and hopefully few prototypes, which can conflict with char accept (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef accept /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char accept (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_accept) || defined (__stub___accept) choke me #else char (*f) () = accept; #endif #ifdef __cplusplus } #endif int main () { return f != accept; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_accept=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_accept=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 echo "${ECHO_T}$ac_cv_func_accept" >&6 if test $ac_cv_func_accept = yes; then tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) choke me #else char (*f) () = gethostbyname; #endif #ifdef __cplusplus } #endif int main () { return f != gethostbyname; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = yes; then : else echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then LIBS="$LIBS -lnsl" fi fi # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' echo "$as_me:$LINENO: checking dirent.h" >&5 echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 if test "${tcl_cv_dirent_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_dirent_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_dirent_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test $tcl_cv_dirent_h = no; then cat >>confdefs.h <<\_ACEOF #define NO_DIRENT_H 1 _ACEOF fi echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking errno.h usability" >&5 echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking errno.h presence" >&5 echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 fi if test $ac_cv_header_errno_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_ERRNO_H 1 _ACEOF fi if test "${ac_cv_header_float_h+set}" = set; then echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking float.h usability" >&5 echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking float.h presence" >&5 echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_float_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 fi if test $ac_cv_header_float_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_FLOAT_H 1 _ACEOF fi if test "${ac_cv_header_values_h+set}" = set; then echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking values.h usability" >&5 echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking values.h presence" >&5 echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_values_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 fi if test $ac_cv_header_values_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_VALUES_H 1 _ACEOF fi if test "${ac_cv_header_limits_h+set}" = set; then echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking limits.h usability" >&5 echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking limits.h presence" >&5 echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_limits_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 fi if test $ac_cv_header_limits_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIMITS_H 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define NO_LIMITS_H 1 _ACEOF fi if test "${ac_cv_header_stdlib_h+set}" = set; then echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking stdlib.h usability" >&5 echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking stdlib.h presence" >&5 echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stdlib_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 fi if test $ac_cv_header_stdlib_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtol" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtoul" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtod" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STDLIB_H 1 _ACEOF fi if test "${ac_cv_header_string_h+set}" = set; then echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking string.h usability" >&5 echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking string.h presence" >&5 echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_string_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 fi if test $ac_cv_header_string_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strstr" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STRING_H 1 _ACEOF fi if test "${ac_cv_header_sys_wait_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_wait_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 fi if test $ac_cv_header_sys_wait_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_SYS_WAIT_H 1 _ACEOF fi if test "${ac_cv_header_dlfcn_h+set}" = set; then echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 fi if test $ac_cv_header_dlfcn_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_DLFCN_H 1 _ACEOF fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). for ac_header in sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi #-------------------------------------------------------------------- # Do application specific checks (see aclocal.m4) #-------------------------------------------------------------------- # ----------------------------------------------------------------------- # Load the Tclutil definitions cf=../tclutil/tclutilConfig.sh if test -f $cf ; then . $cf else { { echo "$as_me:$LINENO: error: $cf doesn't exist" >&5 echo "$as_me: error: $cf doesn't exist" >&2;} { (exit 1); exit 1; }; } fi # Load the Astrotcl definitions cf=../astrotcl/astrotclConfig.sh if test -f $cf ; then . $cf else { { echo "$as_me:$LINENO: error: $cf doesn't exist" >&5 echo "$as_me: error: $cf doesn't exist" >&2;} { (exit 1); exit 1; }; } fi # ----------------------------------------------------------------------- # Optionally merge object and header files from dependent packages to make one master rtd lib MERGED=1 # Check whether --enable-merge or --disable-merge was given. if test "${enable_merge+set}" = set; then enableval="$enable_merge" MERGED=$enableval else MERGED=no fi; tclsources=`cd $srcdir; echo library/*.tcl` csources=`cd $srcdir; echo generic/*.[Cc] rtdevt/rtdImageEvent.c rtdevt/rtdSem.c` rtd_headers=`cd $srcdir; echo generic/*.h generic/*.icc rtdevt/rtdImageEvent.h rtdevt/rtdSem.h` astrotcl_headers=`cd $srcdir; echo ../astrotcl/{generic,press,libwcs,cfitsio}/*.h` tclutil_headers=`cd $srcdir; echo ../tclutil/generic/*.h` rtd_includes="-I$srcdir/generic -I$srcdir/rtdevt -I$srcdir/bitmaps" astrotcl_includes="-I$srcdir/../astrotcl/generic -I$srcdir/../astrotcl/cfitsio -I$srcdir/../astrotcl/libwcs" tclutil_includes="-I$srcdir/../tclutil/generic" cincludes="${rtd_includes} ${astrotcl_includes} ${tclutil_includes}" if test $MERGED = yes ; then echo "Will build merged master rtd library" cheaders="${rtd_headers} ${astrotcl_headers} ${tclutil_headers}" MERGE_OBJECTS="$astrotcl_PKG_OBJECTS $tclutil_PKG_OBJECTS" else echo "Not making a merged master rtd library" cheaders="${rtd_headers}" MERGE_OBJECTS="" fi # ----------------------------------------------------------------------- cat >>confdefs.h <<\_ACEOF #define USE_COMPAT_CONST 1 _ACEOF # ----------------------------------------------------------------------- echo "$as_me:$LINENO: checking sysv shared memory prototypes" >&5 echo $ECHO_N "checking sysv shared memory prototypes... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "int.*shmdt.*\(" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; cat >>confdefs.h <<\_ACEOF #define NEED_SHM_PROTO 1 _ACEOF fi rm -f conftest* # ----------------------------------------------------------------------- echo "$as_me:$LINENO: checking gethostname prototype" >&5 echo $ECHO_N "checking gethostname prototype... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "int.*gethostname.*\(" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; cat >>confdefs.h <<\_ACEOF #define NEED_GETHOSTNAME_PROTO 1 _ACEOF fi rm -f conftest* # ----------------------------------------------------------------------- echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6 if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((long *) 0) return 0; if (sizeof (long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6 echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6 if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (long)); } unsigned long ulongval () { return (long) (sizeof (long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (long))) < 0) { long i = longval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_long=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # ----------------------------------------------------------------------- # there are some idiosyncrasies with semun defs (used in semxxx). Solaris # does not define it at all # ------------------------------------------------------------------------- echo "$as_me:$LINENO: checking \"do we have union semun defined\"" >&5 echo $ECHO_N "checking \"do we have union semun defined\"... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { union semun filler; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNION_SEMUN 1 _ACEOF echo "$as_me:$LINENO: result: \"yes\"" >&5 echo "${ECHO_T}\"yes\"" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: \"no\"" >&5 echo "${ECHO_T}\"no\"" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >>confdefs.h <<\_ACEOF #define HAVE_NET_SERVICES 1 _ACEOF for ac_header in sys/filio.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Check if we need (or can use) the socklen_t type. echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { if ((socklen_t *) 0) return 0; if (sizeof (socklen_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test $ac_cv_type_socklen_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SOCKLEN_T 1 _ACEOF fi #------------------------------------------------------------------------ ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking fd_set" >&5 echo $ECHO_N "checking fd_set... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { fd_set readFds; select(32, &readFds, 0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then test_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 test_ok=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $test_ok = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SELECT_FD_SET 1 _ACEOF fi echo "$as_me:$LINENO: result: $test_ok" >&5 echo "${ECHO_T}$test_ok" >&6 #------------------------------------------------------------------------ # Check if we require additional libraries to support C++ shareable # libraries. system=`uname -s`-`uname -r` SHLIB_LD_CXX_LIBS="" export SHLIB_LD_CXX_LIBS case $system in SunOS-5*) SHLIB_LD_CXX_LIBS="-lCrun -lCstd" ;; OSF*) SHLIB_LD_CXX_LIBS="-lcxx -lcxxstd" ;; esac #------------------------------------------------------------------------- # The cxx C++ compiler under Tru64 UNIX needs the special # CXXFLAGS "-std gnu -D__USE_STD_IOSTREAM=1". These allow the standard # library streams headers to work and to generate templates that do # not require special handling throughout skycat directories (normally # template object files are created in various cxx_repository subdirectories, # this way the object files are kept embedded the usual object files, see # the cxx man page for details). #------------------------------------------------------------------------- export CXXFLAGS case $system in OSF*) case "x$CXX" in xcxx*) CXXFLAGS="$CXXFLAGS -g3 -std gnu -D__USE_STD_IOSTREAM=1" ;; esac ;; esac #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- vars="${csources}" for i in $vars; do case $i in \$*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 echo "$as_me: error: could not find source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done vars="${cheaders}" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_HEADERS="$PKG_HEADERS $i" done vars="${cincludes}" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done if test $MERGED = yes ; then vars="${BLT_LIB_SPEC} ${CFITSIO_LIB_SPEC}" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done else vars="$astrotcl_BUILD_LIB_SPEC $tclutil_BUILD_LIB_SPEC ${BLT_LIB_SPEC} ${CFITSIO_LIB_SPEC}" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done fi PKG_CFLAGS="$PKG_CFLAGS " vars="" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 echo "$as_me: error: could not find stub source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done vars="${tclsources}" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then cat >>confdefs.h <<\_ACEOF #define BUILD_rtd 1 _ACEOF CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi #------------------------------------------------------------------------ # See if we can include tkCanvas.h, an internal tk header file needed # to work around a problem with clipping canvas coordinates on large # images. #------------------------------------------------------------------------ if test -f $TK_SRC_DIR/generic/tkCanvas.h ; then cat >>confdefs.h <<\_ACEOF #define HAVE_TKCANVAS_H 1 _ACEOF vars="-I$TK_SRC_DIR/generic" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done fi #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for Tcl public headers" >&5 echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" with_tclinclude=${withval} fi; if test "${ac_cv_c_tclh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} { (exit 1); exit 1; }; } fi else # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; *) list="" ;; esac # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "$TCL_BIN_DIR/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 echo "${ECHO_T}${ac_cv_c_tclh}" >&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" #TEA_PRIVATE_TCL_HEADERS echo "$as_me:$LINENO: checking for Tk public headers" >&5 echo $ECHO_N "checking for Tk public headers... $ECHO_C" >&6 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" with_tkinclude=${withval} fi; if test "${ac_cv_c_tkh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else { { echo "$as_me:$LINENO: error: ${with_tkinclude} directory does not contain tk.h" >&5 echo "$as_me: error: ${with_tkinclude} directory does not contain tk.h" >&2;} { (exit 1); exit 1; }; } fi else # If Tk was built as a framework, attempt to use # the framework's Headers directory. case ${TK_DEFS} in *TK_FRAMEWORK*) list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" ;; *) list="" ;; esac # Look in the source dir only if Tk is not installed, # and in that situation, look there before installed locations. if test -f "$TK_BIN_DIR/Makefile" ; then list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tk's --prefix location, # relative to directory of tkConfig.sh, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then { { echo "$as_me:$LINENO: error: tk.h not found. Please specify its location with --with-tkinclude" >&5 echo "$as_me: error: tk.h not found. Please specify its location with --with-tkinclude" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ${ac_cv_c_tkh}" >&5 echo "${ECHO_T}${ac_cv_c_tkh}" >&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then # On Windows and Aqua, we need the X compat headers echo "$as_me:$LINENO: checking for X11 header files" >&5 echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" fi echo "$as_me:$LINENO: result: ${INCLUDE_DIR_NATIVE}" >&5 echo "${ECHO_T}${INCLUDE_DIR_NATIVE}" >&6 fi #TEA_PRIVATE_TK_HEADERS ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi echo "$as_me:$LINENO: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then withval="$with_x" fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then # Both variables are already set. have_x=yes else if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -fr conftest.dir if mkdir conftest.dir; then cd conftest.dir # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' _ACEOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -fr conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XtMalloc (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then # Didn't find X anywhere. Cache the known absence of X. ac_cv_have_x="have_x=no" else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 not_really_there="yes" fi rm -f conftest.err conftest.$ac_ext else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then echo "$as_me:$LINENO: checking for X11 header files" >&5 echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 XINCLUDES="# no special path needed" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 XINCLUDES="nope" fi rm -f conftest.err conftest.$ac_ext if test "$XINCLUDES" = nope; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then echo "$as_me:$LINENO: result: $i" >&5 echo "${ECHO_T}$i" >&6 XINCLUDES=" -I$i" break fi done fi else if test "$x_includes" != ""; then XINCLUDES=-I$x_includes else XINCLUDES="# no special path needed" fi fi if test "$XINCLUDES" = nope; then echo "$as_me:$LINENO: result: could not find any!" >&5 echo "${ECHO_T}could not find any!" >&6 XINCLUDES="# no include files found" fi if test "$no_x" = yes; then echo "$as_me:$LINENO: checking for X11 libraries" >&5 echo $ECHO_N "checking for X11 libraries... $ECHO_C" >&6 XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.dylib -o -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then echo "$as_me:$LINENO: result: $i" >&5 echo "${ECHO_T}$i" >&6 XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then echo "$as_me:$LINENO: checking for XCreateWindow in -lXwindow" >&5 echo $ECHO_N "checking for XCreateWindow in -lXwindow... $ECHO_C" >&6 if test "${ac_cv_lib_Xwindow_XCreateWindow+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXwindow $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char XCreateWindow (); int main () { XCreateWindow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_Xwindow_XCreateWindow=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xwindow_XCreateWindow=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 echo "${ECHO_T}$ac_cv_lib_Xwindow_XCreateWindow" >&6 if test $ac_cv_lib_Xwindow_XCreateWindow = yes; then XLIBSW=-lXwindow fi fi if test "$XLIBSW" = nope ; then echo "$as_me:$LINENO: result: could not find any! Using -lX11." >&5 echo "${ECHO_T}could not find any! Using -lX11." >&6 XLIBSW=-lX11 fi if test x"${XLIBSW}" != x ; then PKG_LIBS="${PKG_LIBS} ${XLIBSW}" fi fi #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants. cat >>confdefs.h <<\_ACEOF #define USE_THREAD_ALLOC 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _THREAD_SAFE 1 _ACEOF echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the # same library, as some systems hide it there until # pthread.h is defined. We could alternatively do an # AC_TRY_COMPILE with pthread.h, but that will work with # libpthread really doesn't exist, like AIX 4.2. # [Bug: 4359] echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __pthread_mutex_init (); int main () { __pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread___pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthreads_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 if test $ac_cv_lib_c_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_r_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 { echo "$as_me:$LINENO: WARNING: \"Don t know how to find pthread lib on your system - thread support disabled\"" >&5 echo "$as_me: WARNING: \"Don t know how to find pthread lib on your system - thread support disabled\"" >&2;} fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output echo "$as_me:$LINENO: checking for building with threads" >&5 echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 if test "${TCL_THREADS}" = "1"; then cat >>confdefs.h <<\_ACEOF #define TCL_THREADS 1 _ACEOF #LIBS="$LIBS $THREADS_LIBS" echo "$as_me:$LINENO: result: yes (default)" >&5 echo "${ECHO_T}yes (default)" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then { echo "$as_me:$LINENO: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&5 echo "$as_me: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&2;} fi ;; *) if test "${TCL_THREADS}" = "1"; then { echo "$as_me:$LINENO: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&5 echo "$as_me: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&2;} fi ;; esac #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking how to build libraries" >&5 echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$as_me:$LINENO: result: shared" >&5 echo "${ECHO_T}shared" >&6 SHARED_BUILD=1 else echo "$as_me:$LINENO: result: static" >&5 echo "${ECHO_T}static" >&6 SHARED_BUILD=0 cat >>confdefs.h <<\_ACEOF #define STATIC_BUILD 1 _ACEOF fi #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- # Step 0: Enable 64 bit support? echo "$as_me:$LINENO: checking if 64bit support is enabled" >&5 echo $ECHO_N "checking if 64bit support is enabled... $ECHO_C" >&6 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" do64bit=$enableval else do64bit=no fi; echo "$as_me:$LINENO: result: $do64bit" >&5 echo "${ECHO_T}$do64bit" >&6 # Step 0.b: Enable Solaris 64 bit VIS support? echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" do64bitVIS=$enableval else do64bitVIS=no fi; echo "$as_me:$LINENO: result: $do64bitVIS" >&5 echo "${ECHO_T}$do64bitVIS" >&6 if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 0.c: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = "windows" ; then echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 # Check whether --enable-wince or --disable-wince was given. if test "${enable_wince+set}" = set; then enableval="$enable_wince" doWince=$enableval else doWince=no fi; echo "$as_me:$LINENO: result: $doWince" >&5 echo "${ECHO_T}$doWince" >&6 fi # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. echo "$as_me:$LINENO: checking system version (for dynamic loading)" >&5 echo $ECHO_N "checking system version (for dynamic loading)... $ECHO_C" >&6 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then echo "$as_me:$LINENO: result: unknown (can't find uname command)" >&5 echo "${ECHO_T}unknown (can't find uname command)" >&6 system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print }' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi if test "${TEA_PLATFORM}" = "windows" ; then system=windows fi echo "$as_me:$LINENO: result: $system" >&5 echo "${ECHO_T}$system" >&6 fi fi # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then have_dl=yes else have_dl=no fi # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case and CC_SEARCH_FLAGS becomes LD_SEARCH_FLAGS for us # (and we have no CC_SEARCH_FLAGS). do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g if test "$GCC" = "yes" ; then CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" else CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} { (exit 1); exit 1; }; } fi if test "$GCC" = "yes" ; then { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} { (exit 1); exit 1; }; } fi # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true # Check whether --with-celib or --without-celib was given. if test "${with_celib+set}" = set; then withval="$with_celib" with_celibconfig=${withval} fi; echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 if test "${ac_cv_c_celibconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi fi if test x"${ac_cv_c_celibconfig}" = x ; then { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 echo "$as_me: error: Cannot find celib support library directory" >&2;} { (exit 1); exit 1; }; } else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 echo "${ECHO_T}found $CELIB_DIR" >&6 fi fi # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} { (exit 1); exit 1; }; } doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 vars="bufferoverflowU.lib" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower($0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do cat >>confdefs.h <<_ACEOF #define $i 1 _ACEOF done cat >>confdefs.h <<_ACEOF #define _WIN32_WCE $CEVERSION _ACEOF cat >>confdefs.h <<_ACEOF #define UNDER_CE $CEVERSION _ACEOF CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2" SHLIB_LD="$CXX -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 echo "${ECHO_T}Using $CC for compiling with threads" >&6 fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then #LIBOBJS="$LIBOBJS tclLoadAix.o" case $LIBOBJS in "tclLoadAix.$ac_objext" | \ *" tclLoadAix.$ac_objext" | \ "tclLoadAix.$ac_objext "* | \ *" tclLoadAix.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; esac DL_LIBS="-lld" fi # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: \"64bit mode not supported with GCC on $system\"" >&5 echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS="$LDFLAGS -q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi else if test "$GCC" = "yes" ; then SHLIB_LD="$CXX -shared" else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gettimeofday (); int main () { gettimeofday (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gettimeofday=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then libbsd=yes else libbsd=no fi if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" cat >>confdefs.h <<\_ACEOF #define USE_DELTA_FOR_TZ 1 _ACEOF fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CXX} -nostart" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="$CXX -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then SHLIB_LD="$CXX -shared -fPIC" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="${CXX} -shared -fPIC" SHLIB_LD_LIBS='${LIBS}' ;; *) { echo "$as_me:$LINENO: WARNING: \"64bit mode not supported with GCC on $system\"" >&5 echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;} ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS="$LDFLAGS +DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi LD_LIBRARY_PATH_VAR="SHLIB_PATH" ;; IRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS="$LDFLAGS -64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" if test "$have_dl" = yes; then SHLIB_LD="${CXX} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' else if test "${ac_cv_header_dld_h+set}" = set; then echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dld.h usability" >&5 echo $ECHO_N "checking dld.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dld.h presence" >&5 echo $ECHO_N "checking dld.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dld.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dld.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dld.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dld.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dld.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dld_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 fi if test $ac_cv_header_dld_h = yes; then SHLIB_LD="ld -shared" DL_OBJS="tclLoadDld.o" DL_LIBS="-ldld" LD_SEARCH_FLAGS="" fi fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x ; then CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" if test "$have_dl" = yes; then SHLIB_LD="${CXX} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" LD_SEARCH_FLAGS="" else if test "${ac_cv_header_dld_h+set}" = set; then echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dld.h usability" >&5 echo $ECHO_N "checking dld.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dld.h presence" >&5 echo $ECHO_N "checking dld.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dld.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dld.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dld.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dld.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dld.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dld_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 fi if test $ac_cv_header_dld_h = yes; then SHLIB_LD="ld -shared" DL_OBJS="" DL_LIBS="-ldld" LD_SEARCH_FLAGS="" fi fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[1-2].*) # Not available on all versions: check for include file. if test "${ac_cv_header_dlfcn_h+set}" = set; then echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_cxx_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------ ## ## Report this to the rtd lists. ## ## ------------------------------ ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 fi if test $ac_cv_header_dlfcn_h = yes; then # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi rm -f conftest* else SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' fi # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) SHLIB_LD="${CXX} -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi rm -f conftest* # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" if test $do64bit = yes; then do64bit_ok=yes CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" fi SHLIB_LD='${CXX} -dynamiclib ${CFLAGS} ${LDFLAGS}' echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 if test "${tcl_cv_ld_single_module+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_single_module=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_single_module=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: test -z "${MACOSX_DEPLOYMENT_TARGET}" || \ test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print $2}'`" -lt 4 && \ LDFLAGS="$LDFLAGS -prebind" LDFLAGS="$LDFLAGS -headerpad_max_install_names" echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 if test "${tcl_cv_ld_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_search_paths_first=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_search_paths_first=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="$CXX -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy cat >>confdefs.h <<\_ACEOF #define _OE_SOCKETS 1 _ACEOF ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export :' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" # PWD: don't need this. #LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" LD_SEARCH_FLAGS="" ;; RISCos-*) SHLIB_CFLAGS="-G 0" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[0-6]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC" SHLIB_LD="$CXX -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else SHLIB_LD="$CXX -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' SHLIB_CFLAGS="-KPIC" fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then if test "`gcc -dumpversion` | awk -F. '{print }'" -lt "3" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" fi else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS="$LDFLAGS -xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS="$LDFLAGS -xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi elif test "$arch" = "amd64 i386" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" fi else { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC" SHLIB_LD="$CXX -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' if test "$do64bit" = "yes" ; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS},-R,$v9gcclibdir" fi else SHLIB_CFLAGS="-KPIC" SHLIB_LD="$CXX -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' if test "$GCC" != "yes" ; then CFLAGS="$CFLAGS -DHAVE_TZSET -std1" fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 LDFLAGS="$LDFLAGS -Wl,-Bexport" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LDFLAGS=$hold_ldflags found=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $found" >&5 echo "${ECHO_T}$found" >&6 LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" != "no" -a "$do64bit_ok" = "no" ; then { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need # to determine which of several header files defines the a.out file # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we # support only a file format that is more or less version-7-compatible. # In particular, # - a.out files must begin with `struct exec'. # - the N_TXTOFF on the `struct exec' must compute the seek address # of the text segment # - The `struct exec' must contain a_magic, a_text, a_data, a_bss # and a_entry fields. # The following compilation should succeed if and only if either sys/exec.h # or a.out.h is usable for the purpose. # # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the # `struct exec' includes a second header that contains information that # duplicates the v7 fields that are needed. if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo "$as_me:$LINENO: checking sys/exec.h" >&5 echo $ECHO_N "checking sys/exec.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_SYS_EXEC_H 1 _ACEOF else echo "$as_me:$LINENO: checking a.out.h" >&5 echo $ECHO_N "checking a.out.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_A_OUT_H 1 _ACEOF else echo "$as_me:$LINENO: checking sys/exec_aout.h" >&5 echo $ECHO_N "checking sys/exec_aout.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_midmag == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_SYS_EXEC_AOUT_H 1 _ACEOF else DL_OBJS="" fi fi fi fi # Step 5: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load or --disable-load was given. if test "${enable_load+set}" = set; then enableval="$enable_load" tcl_ok=$enableval else tcl_ok=yes fi; if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; RISCos-*) ;; SCO_SV-3.2*) ;; ULTRIX-4.*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary echo "$as_me:$LINENO: checking for required early compiler flags" >&5 echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 tcl_flags="" if test "${tcl_cv_flag__isoc99_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__isoc99_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _ISOC99_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if test "${tcl_cv_flag__largefile64_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__largefile64_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if test "x${tcl_flags}" = "x" ; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 else echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 echo "${ECHO_T}${tcl_flags}" >&6 fi echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 if test "${tcl_cv_type_64bit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { __int64 value = (__int64) 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_type_64bit=__int64 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_type_64bit="long long" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; } ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_64bit=${tcl_type_64bit} else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then cat >>confdefs.h <<\_ACEOF #define TCL_WIDE_INT_IS_LONG 1 _ACEOF echo "$as_me:$LINENO: result: using long" >&5 echo "${ECHO_T}using long" >&6 elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # We actually want to use the default tcl.h checks in this # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 echo "${ECHO_T}using Tcl header defaults" >&6 else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 # Now check for auxiliary declarations echo "$as_me:$LINENO: checking for struct dirent64" >&5 echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 if test "${tcl_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct dirent64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_dirent64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_dirent64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_DIRENT64 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_struct_dirent64}" >&5 echo "${ECHO_T}${tcl_cv_struct_dirent64}" >&6 echo "$as_me:$LINENO: checking for struct stat64" >&5 echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 if test "${tcl_cv_struct_stat64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_stat64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_stat64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_struct_stat64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_STAT64 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_struct_stat64}" >&5 echo "${ECHO_T}${tcl_cv_struct_stat64}" >&6 echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 if test "${tcl_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { off64_t offset; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_type_off64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_TYPE_OFF64_T 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_type_off64_t}" >&5 echo "${ECHO_T}${tcl_cv_type_off64_t}" >&6 fi #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- DBGX="" echo "$as_me:$LINENO: checking for build with symbols" >&5 echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" tcl_ok=$enableval else tcl_ok=no fi; if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 echo "${ECHO_T}yes (standard debugging)" >&6 fi fi if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then cat >>confdefs.h <<\_ACEOF #define TCL_MEM_DEBUG 1 _ACEOF fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 echo "${ECHO_T}enabled symbols mem debugging" >&6 else echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 echo "${ECHO_T}enabled $tcl_ok debugging" >&6 fi fi #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- # allan: can't use stubs, due to BLT dependency #AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- # rtd needs -lXext PKG_LIBS="${PKG_LIBS} -lXext" if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${LDFLAGS_DEFAULT} \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for tclsh" >&5 echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_PREFIX}/bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}" fi echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 echo "${ECHO_T}${TCLSH_PROG}" >&6 echo "$as_me:$LINENO: checking for wish" >&5 echo $ECHO_N "checking for wish... $ECHO_C" >&6 if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="${TK_BIN_DIR}/wish" fi else # tkConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" fi list="`ls -d ${TK_PREFIX}/bin 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../bin 2>/dev/null`" for i in $list ; do if test -f "$i/${WISH_PROG}" ; then REAL_TK_BIN_DIR="`cd "$i"; pwd`" break fi done WISH_PROG="${REAL_TK_BIN_DIR}/${WISH_PROG}" fi echo "$as_me:$LINENO: result: ${WISH_PROG}" >&5 echo "${ECHO_T}${WISH_PROG}" >&6 #-------------------------------------------------------------------- # These are for rtdConfig.sh #-------------------------------------------------------------------- rtd_LIB_FILE=${PKG_LIB_FILE} eval pkglibdir="${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval rtd_LIB_FLAG="-lrtd${PACKAGE_VERSION}" else eval rtd_LIB_FLAG="-lrtd`echo ${PACKAGE_VERSION} | tr -d .`" fi rtd_BUILD_LIB_SPEC="-L`pwd` ${rtd_LIB_FLAG}" rtd_BUILD_DIR="`pwd`" rtd_LIB_SPEC="-L${pkglibdir} ${rtd_LIB_FLAG}" for i in ${PKG_OBJECTS} ; do rtd_PKG_OBJECTS="$rtd_PKG_OBJECTS ../rtd/$i" done # rtd_SRC_DIR must be a fully qualified path eval rtd_SRC_DIR="$srcdir" rtd_SRC_DIR=`cd "${rtd_SRC_DIR}"; pwd` #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- ac_config_files="$ac_config_files Makefile pkgIndex.tcl rtdConfig.sh rtd rtd_version.tcl" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by rtd $as_me 3.2.1, which was generated by Starlink Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ rtd config.status 3.2.1 configured by $0, generated by Starlink Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgIndex.tcl" ) CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; "rtdConfig.sh" ) CONFIG_FILES="$CONFIG_FILES rtdConfig.sh" ;; "rtd" ) CONFIG_FILES="$CONFIG_FILES rtd" ;; "rtd_version.tcl" ) CONFIG_FILES="$CONFIG_FILES rtd_version.tcl" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CYGPATH@,$CYGPATH,;t t s,@EXEEXT@,$EXEEXT,;t t s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t s,@PKG_HEADERS@,$PKG_HEADERS,;t t s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t s,@PKG_LIBS@,$PKG_LIBS,;t t s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t s,@TCL_VERSION@,$TCL_VERSION,;t t s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t s,@TCL_LIBS@,$TCL_LIBS,;t t s,@TCL_DEFS@,$TCL_DEFS,;t t s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t s,@TK_VERSION@,$TK_VERSION,;t t s,@TK_BIN_DIR@,$TK_BIN_DIR,;t t s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t s,@TK_LIBS@,$TK_LIBS,;t t s,@TK_XINCLUDES@,$TK_XINCLUDES,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@EGREP@,$EGREP,;t t s,@MATH_LIBS@,$MATH_LIBS,;t t s,@tclutil_VERSION@,$tclutil_VERSION,;t t s,@tclutil_LIB_FILE@,$tclutil_LIB_FILE,;t t s,@tclutil_BUILD_LIB_SPEC@,$tclutil_BUILD_LIB_SPEC,;t t s,@tclutil_BUILD_DIR@,$tclutil_BUILD_DIR,;t t s,@tclutil_LIB_SPEC@,$tclutil_LIB_SPEC,;t t s,@BLT_LIB_DIR@,$BLT_LIB_DIR,;t t s,@BLT_LIB_SPEC@,$BLT_LIB_SPEC,;t t s,@tclutil_SRC_DIR@,$tclutil_SRC_DIR,;t t s,@tclutil_PKG_OBJECTS@,$tclutil_PKG_OBJECTS,;t t s,@CFITSIO_LIB_DIR@,$CFITSIO_LIB_DIR,;t t s,@CFITSIO_LIB_SPEC@,$CFITSIO_LIB_SPEC,;t t s,@astrotcl_VERSION@,$astrotcl_VERSION,;t t s,@astrotcl_LIB_FILE@,$astrotcl_LIB_FILE,;t t s,@astrotcl_BUILD_LIB_SPEC@,$astrotcl_BUILD_LIB_SPEC,;t t s,@astrotcl_BUILD_DIR@,$astrotcl_BUILD_DIR,;t t s,@astrotcl_LIB_SPEC@,$astrotcl_LIB_SPEC,;t t s,@astrotcl_SRC_DIR@,$astrotcl_SRC_DIR,;t t s,@astrotcl_PKG_OBJECTS@,$astrotcl_PKG_OBJECTS,;t t s,@MERGE_OBJECTS@,$MERGE_OBJECTS,;t t s,@SHLIB_LD_CXX_LIBS@,$SHLIB_LD_CXX_LIBS,;t t s,@PKG_SOURCES@,$PKG_SOURCES,;t t s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t s,@CLEANFILES@,$CLEANFILES,;t t s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t s,@TK_INCLUDES@,$TK_INCLUDES,;t t s,@CXXCPP@,$CXXCPP,;t t s,@TCL_THREADS@,$TCL_THREADS,;t t s,@SHARED_BUILD@,$SHARED_BUILD,;t t s,@AR@,$AR,;t t s,@CELIB_DIR@,$CELIB_DIR,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t s,@DL_LIBS@,$DL_LIBS,;t t s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t s,@STLIB_LD@,$STLIB_LD,;t t s,@SHLIB_LD@,$SHLIB_LD,;t t s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t s,@TCL_DBGX@,$TCL_DBGX,;t t s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t s,@MAKE_LIB@,$MAKE_LIB,;t t s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t s,@RANLIB_STUB@,$RANLIB_STUB,;t t s,@TCLSH_PROG@,$TCLSH_PROG,;t t s,@WISH_PROG@,$WISH_PROG,;t t s,@rtd_LIB_FILE@,$rtd_LIB_FILE,;t t s,@rtd_BUILD_LIB_SPEC@,$rtd_BUILD_LIB_SPEC,;t t s,@rtd_BUILD_DIR@,$rtd_BUILD_DIR,;t t s,@rtd_LIB_SPEC@,$rtd_LIB_SPEC,;t t s,@rtd_PKG_OBJECTS@,$rtd_PKG_OBJECTS,;t t s,@rtd_SRC_DIR@,$rtd_SRC_DIR,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi chmod ugo+rx rtd skycat-3.1.2-starlink-1b/rtd/configure.in000066400000000000000000000226271215713201500202500ustar00rootroot00000000000000# E.S.O. - VLT project # $Id: configure.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is used with GNU autoconf to generate a configure script # # usage: % autoconf # only if configure.in changed # % configure # % make # % make install # # who when what # -------------- -------- --------------------------------------------- # Allan Brighton 15/12/05 Rewrote using TCL TEA standard # ----------------------------------------------------------------------- #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- AC_INIT([rtd], [3.2.1]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- TEA_INIT([3.4]) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- TEA_PATH_TKCONFIG TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER #-------------------------------------------------------------------- # Do application specific checks (see aclocal.m4) #-------------------------------------------------------------------- RTD_CONFIG #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- TEA_ADD_SOURCES([${csources}]) TEA_ADD_HEADERS([${cheaders}]) TEA_ADD_INCLUDES([${cincludes}]) if test $MERGED = yes ; then TEA_ADD_LIBS([${BLT_LIB_SPEC} ${CFITSIO_LIB_SPEC}]) else TEA_ADD_LIBS([$astrotcl_BUILD_LIB_SPEC $tclutil_BUILD_LIB_SPEC ${BLT_LIB_SPEC} ${CFITSIO_LIB_SPEC}]) fi TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([]) TEA_ADD_TCL_SOURCES([${tclsources}]) #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then AC_DEFINE(BUILD_rtd, 1, [Build windows export dll]) CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi AC_SUBST(CLEANFILES) #------------------------------------------------------------------------ # See if we can include tkCanvas.h, an internal tk header file needed # to work around a problem with clipping canvas coordinates on large # images. #------------------------------------------------------------------------ if test -f $TK_SRC_DIR/generic/tkCanvas.h ; then AC_DEFINE(HAVE_TKCANVAS_H, 1, [See if we can include tkCanvas.h, an internal tk header]) TEA_ADD_INCLUDES([-I$TK_SRC_DIR/generic]) fi #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- TEA_PUBLIC_TCL_HEADERS #TEA_PRIVATE_TCL_HEADERS TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- # allan: can't use stubs, due to BLT dependency #AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- # rtd needs -lXext PKG_LIBS="${PKG_LIBS} -lXext" TEA_MAKE_LIB #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- TEA_PROG_TCLSH TEA_PROG_WISH #-------------------------------------------------------------------- # These are for rtdConfig.sh #-------------------------------------------------------------------- rtd_LIB_FILE=${PKG_LIB_FILE} eval pkglibdir="${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval rtd_LIB_FLAG="-lrtd${PACKAGE_VERSION}" else eval rtd_LIB_FLAG="-lrtd`echo ${PACKAGE_VERSION} | tr -d .`" fi rtd_BUILD_LIB_SPEC="-L`pwd` ${rtd_LIB_FLAG}" rtd_BUILD_DIR="`pwd`" rtd_LIB_SPEC="-L${pkglibdir} ${rtd_LIB_FLAG}" for i in ${PKG_OBJECTS} ; do rtd_PKG_OBJECTS="$rtd_PKG_OBJECTS ../rtd/$i" done AC_SUBST(rtd_LIB_FILE) AC_SUBST(rtd_BUILD_LIB_SPEC) AC_SUBST(rtd_BUILD_DIR) AC_SUBST(rtd_LIB_SPEC) AC_SUBST(rtd_PKG_OBJECTS) # rtd_SRC_DIR must be a fully qualified path eval rtd_SRC_DIR="$srcdir" rtd_SRC_DIR=`cd "${rtd_SRC_DIR}"; pwd` AC_SUBST(rtd_SRC_DIR) #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- AC_OUTPUT([Makefile pkgIndex.tcl rtdConfig.sh rtd rtd_version.tcl]) chmod ugo+rx rtd skycat-3.1.2-starlink-1b/rtd/generic/000077500000000000000000000000001215713201500173425ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/rtd/generic/BiasData.C000066400000000000000000000127431215713201500211250ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: BiasData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * BiasData.C - member functions for class BiasData * * BiasData is a class for mananging the bias data which can be * subtracted from the image data * * who when what * -------- -------- ---------------------------------------- * pbiereic 22/03/99 Created * pbiereic 16/10/02 Byte order for shm data * pbiereic 14/09/07 Fixed: BiasData::file keeps the filename in a buffer again */ #include #include "BiasData.h" #include "error.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" BiasData::BiasData() : biasImage_(NULL), idxBias_(0) { for (int i=0; i< MAXBIAS; i++) { biasImages_[i] = NULL; files_[i][0] = '\0'; } clear(0); } /* * return status: selected bias image !loaded, on or off */ int BiasData::status() { if (! biasImage_) return -1; if (biasinfo_.on) return 1; return 0; } /* * switch bias subtraction on */ int BiasData::on() { if (! biasImage_) { error("selected bias image not loaded"); return 1; } biasinfo_.on = 1; return 0; } /* * switch bias subtraction off */ int BiasData::off() { if (! biasinfo_.on) return 1; biasinfo_.on = 0; return 0; } /* * return filename or objectname of a bias image */ char* BiasData::file(int nr) { if (nr < 0 || nr >=MAXBIAS) return '\0'; return &files_[nr][0]; } /* * load bias frame from file */ int BiasData::file(char *file, int nr) { FitsIO* fits = NULL; double bzero, bitpix; // if not '-' (stdin) check that it is a file if (strcmp(file, "-") != 0) { struct stat buf; if (stat(file, &buf) != 0 || S_ISREG(buf.st_mode) == 0) { error("expected a file, but got: ", file); return 1; } } int on = biasinfo_.on; clear(nr); // read the FITS image fits = FitsIO::read(file, O_RDONLY | S_IRUSR); if (!fits || fits->status() != 0) return 1; biasinfo_.usingNetBO = 1; /* * ushort images are a special case since FitsIO writes them * as short image with BZERO=32768. For bias subtraction we need * the true type back. */ fits->get("BITPIX", bitpix); fits->get("BZERO", bzero); if (bitpix == 16 && bzero == 32768) { int width, height; // copy the fits object fits->get("NAXIS1", width); fits->get("NAXIS2", height); int length = width * height * 2; Mem data(length, 0), header; if (data.status() != 0) return 1; FitsIO* fits2 = new FitsIO(width, height, -16, 0.0, 1.0, header, data); if (!fits2 || fits2->status() != 0) return 1; fits2->usingNetBO(BIGENDIAN); memcpy((char *)data.ptr(), (char *)fits->data().ptr(), length); delete fits; // convert short's to ushort's (native byte order) int i = width * height; unsigned short *pus = (unsigned short *)data.ptr(), us; short *pss = (short *)data.ptr(), ss; if (BIGENDIAN) { // native byte order? while (i--) { us = *pus++; *pss++ = (short)(us - 32768); } } else { while (i--) { us = *pus++; *pss++ = SWAP16(us) - 32768; } } biasImages_[nr] = ImageData::makeImage(BIASNAME, fits2 , &biasinfo_, 0); // Remember the byte order (=native) for the image. biasinfo_.usingNetBO = BIGENDIAN; } else { biasImages_[nr] = ImageData::makeImage(BIASNAME, fits , &biasinfo_, 0); } if (! biasImages_[nr]) return 1; if (nr == idxBias_) { biasinfo_.on = on; select(nr); } strcpy(&files_[nr][0], file); return 0; } /* * copy image to a bias frame */ int BiasData::copy(ImageData* image, char* filename, int nr) { if (! image || nr < 0 || nr >=MAXBIAS) return 1; int on = biasinfo_.on; clear(nr); int length = image->data().length(); Mem data(length, 0), header; if (data.status() != 0) return 1; FitsIO* fits = new FitsIO(image->width(), image->height(), image->dataType(), 0.0, 1.0, header, data); if (!fits || fits->status() != 0) return 1; // Remember the byte order for the image. biasinfo_.usingNetBO = image->image().usingNetBO(); fits->usingNetBO(biasinfo_.usingNetBO); biasImages_[nr] = ImageData::makeImage(BIASNAME, fits, &biasinfo_, 0); if (! biasImages_[nr]) return 1; memcpy((char *)data.ptr(), (char *)image->data().ptr(), length); biasImages_[nr]->object(image->object()); strcpy(&files_[nr][0], filename); if (nr == idxBias_) { biasinfo_.on = on; select(nr); } return 0; } /* * select a bias frame */ int BiasData::select(int nr) { if (nr < 0 || nr >= MAXBIAS) return 1; idxBias_ = nr; if (biasImages_[nr] != NULL) { biasImage_ = biasImages_[nr]; biasinfo_.ptr = (char *)biasImage_->image().dataPtr(); biasinfo_.width = biasImage_->image().width(); biasinfo_.height = biasImage_->image().height(); biasinfo_.type = biasImage_->dataType(); biasinfo_.usingNetBO = biasImage_->image().usingNetBO(); } else clear(nr); return 0; } /* * return number for selected bias frame */ int BiasData::select() { if (! biasImages_[idxBias_]) return -1; return idxBias_; } /* * clear bias frame */ void BiasData::clear(int nr) { if (nr < 0 || nr >=MAXBIAS) return; if (nr == idxBias_) { biasImage_ = NULL; biasinfo_.on = 0; biasinfo_.ptr = NULL; biasinfo_.width = 0; biasinfo_.height = 0; biasinfo_.type = -1; biasinfo_.usingNetBO = 0; } files_[nr][0] = '\0'; if (biasImages_[nr]) { delete biasImages_[nr]; biasImages_[nr] = NULL; } } skycat-3.1.2-starlink-1b/rtd/generic/BiasData.h000066400000000000000000000023511215713201500211640ustar00rootroot00000000000000#ifndef _BiasData_h_ #define _BiasData_h_ /* * E.S.O. - VLT project * * "@(#) $Id: BiasData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * BiasData.h - class definitions for managing bias subtraction * * who when what * -------------- -------- ---------------------------------------- * P. Biereichel 22/03/99 Created */ #include #include #include "ImageData.h" #include "ImageIO.h" #include "Fits_IO.h" // max. number of bias frames #define MAXBIAS 5 #define BIASNAME "Bias" class BiasData { private: ImageData* biasImage_; // current bias image int idxBias_; // index to biasImages_[] ImageData* biasImages_[MAXBIAS]; biasINFO biasinfo_; char files_[MAXBIAS][1024]; public: // constructor, destructor BiasData(); ~BiasData(); int on(); int off(); void clear(int nr); int status(); char* file(int nr); int file(char *file, int nr); int copy(ImageData* image, char *filename, int nr); int select(int nr); int select(); ImageData* image() {return biasImage_;} biasINFO* biasInfo() {return &biasinfo_;} protected: }; #endif /* _BiasData_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/ByteImageData.C000066400000000000000000000035421215713201500221120ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: ByteImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ByteImageData.C - member functions for class ByteImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 15/03/99 Blank bin is always 128 * pbiereic 17/02/03 Added 'using namespace std'. * Peter W. Draper 23/06/09 Added parseBlank to get blank value in this type. */ static const char* const rcsId="@(#) $Id: ByteImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include "ByteImageData.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" /* * This method is called from the parent class to convert the high and * low cut values to short range. In this case, there is no conversion * needed, since bytes are already in range. */ void ByteImageData::initShortConversion() { scaledLowCut_ = (int)lowCut_; scaledHighCut_ = (int)highCut_; if (haveBlank_) scaledBlankPixelValue_ = 128; } /* * Set the blank value from a given string. Return 1 if successful. */ int ByteImageData::parseBlank(const char* value) { long l; int n = sscanf(value, "%ld", &l); if ( n > 0 ) { blank_ = l; } return n; } /* * Include some standard methods as (cpp macro) templates: * These are methods that are the same for all derived classes of ImageData, * except that they work on a different raw data type */ #define CLASS_NAME ByteImageData #define DATA_TYPE byte #define NTOH(x) (x) #include "ImageTemplates.icc" #undef CLASS_NAME #undef DATA_TYPE #undef NTOH skycat-3.1.2-starlink-1b/rtd/generic/ByteImageData.h000066400000000000000000000051331215713201500221550ustar00rootroot00000000000000// -*-c++-*- #ifndef _ByteImageData_h_ #define _ByteImageData_h_ /* * E.S.O. - VLT project * * "@(#) $Id: ByteImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ByteImageData.h - class definitions for class ByteImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 05/03/98 Added llookup * 14/07/98 Added check for blanks in lookup. * P.Biereichel 22/03/99 Added parameters for bias frame */ #include #include "ImageData.h" // This class is used for images where the raw data is made up of bytes class ByteImageData : public ImageData { private: // value of blank pixel, if known (if haveBlankPixel_ is nonzero) long blank_; // get value as unsigned short inline ushort convertToUshort(byte b) { return (ushort)b; } // return X image pixel value for raw image value inline byte lookup(byte b) { if ( !haveBlank_ ) return lookup_[(ushort)b]; if ( b != blank_ ) return lookup_[(ushort)b]; return lookup_[128]; } inline unsigned long llookup(byte b) { if ( !haveBlank_ ) return lookup_[(ushort)b]; if ( b != blank_ ) return lookup_[(ushort)b]; return lookup_[128]; } // return NTOH converted value evtl. subtracted with corresponding bias value byte getVal(byte* p, int idx); int getXsamples(byte *rawImage, int idx, int wbox, byte *samples); int getBsamples(byte *rawImage, int idx, int wbox, byte *samples); int getCsamples(byte *rawImage, int idx, int wbox, byte *samples); byte getMedian(byte *samples, int n); byte getBoxVal(byte *rawImage, int idx, int wbox, byte *samples, int xs); byte getRMS(byte *samples, int n); protected: // convert cut values to short range void initShortConversion(); public: // constructor ByteImageData(const char* name, const ImageIO& imio, int verbose) : ImageData(name, imio, verbose, 256 /* use a smaller lookup table */), blank_(128) { } // return class name as a string virtual const char* classname() { return "ByteImageData"; } // return the data type of the raw data int dataType() {return BYTE_IMAGE;} // return true if the data type is signed int isSigned() {return 0;} // return a copy of this object ImageData* copy() {return new ByteImageData(*this);} // include declarations for methods that differ only in raw data type # include "ImageTemplates.h" }; #endif /* _ByteImageData_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/ColorMapInfo.C000066400000000000000000000116311215713201500220000ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: ColorMapInfo.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ColorMapInfo.C - member routines for class ColorMapInfo * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 14/07/98 Changed interpolate to get last colorcell * (so pure white/black is available in principle). * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. * Peter W. Draper 28/05/08 Stop leak of name from ::get. */ static const char* const rcsId="@(#) $Id: ColorMapInfo.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include "ColorMapInfo.h" #include "util.h" #include "error.h" // linked list, cache of colormap files ColorMapInfo* cmaps_ = NULL; /* * constructor - arguments are the name of the colormap * and an array of RGB color values. Both are assumed to * have been allocated. */ ColorMapInfo::ColorMapInfo(char* name, RGBColor* rgb) : name_(name), rgb_(rgb), next_(cmaps_), nameowner_(0) { // make this the head of the list of colormaps cmaps_ = this; } /* * constructor - main arguments are the name of the colormap and an array of * RGB color values. Both are assumed to have been allocated, but if nameowner * is 1 then the memory will be freed on destruction. */ ColorMapInfo::ColorMapInfo(char* name, RGBColor* rgb, int nameowner) : name_(name), rgb_(rgb), next_(cmaps_), nameowner_(nameowner) { // make this the head of the list of colormaps cmaps_ = this; } /* * destructor */ ColorMapInfo::~ColorMapInfo() { // remove from list if (this == cmaps_) { cmaps_ = next_; } else { for (ColorMapInfo* m = cmaps_; m; m = m->next_) { if (m->next_ == this) { m->next_ = next_; break; } } } // release the name_ pointer, if we've been given ownership if ( nameowner_ ) { free( name_ ); } } /* * read a ColorMap from a file and return a new instance for it */ ColorMapInfo* ColorMapInfo::get(char* filename) { // just use the basename to identify the colormap char* name = strdup(fileBasename(filename)); // see if we read this one already ColorMapInfo* m; for (m = cmaps_; m; m = m->next()) if (strcmp(m->name(), name) == 0) break; if (m) { free(name); return m; } // have to read in file ifstream f(filename); if (! f) { error("could not open colormap file: ", filename); free(name); return (ColorMapInfo*) NULL; } RGBColor* rgb = new RGBColor[MAX_COLOR]; if (! rgb) { error("could not allocate colormap"); free(name); return (ColorMapInfo*) NULL; } for (int i = 0; i < MAX_COLOR; i++) { f >> rgb[i]; } if (! f) { error("error reading colormap file: ", filename); free(name); return (ColorMapInfo*) NULL; } m = new ColorMapInfo(name, rgb, 1); if (! m) error("could not create colormap"); return m; } /* * write a list of loaded colormap files to the given stream * separated by spaces */ void ColorMapInfo::list(ostream& os) { ColorMapInfo* m; for (m = cmaps_; m; m = m->next()) os << m->name() << " "; } /* * set the red, green and blue values for the the colormap * and interpolate based on the count of available colors */ void ColorMapInfo::interpolate(XColor* colorCells, int colorCount) { int index; for (int i=0; i= colorCount) index = colorCount - 1; dest[i].red = src[index].red; dest[i].green = src[index].green; dest[i].blue = src[index].blue; } } skycat-3.1.2-starlink-1b/rtd/generic/ColorMapInfo.h000066400000000000000000000050021215713201500220400ustar00rootroot00000000000000// -*-c++-*- #ifndef _ColorMapInfo_h_ #define _ColorMapInfo_h_ /* * E.S.O. - VLT project * "@(#) $Id: ColorMapInfo.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ColorMapInfo.h - class definitions for reading in color map files * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. * Peter W. Draper 19/09/07 Added rgbcolor member. */ using namespace std; #include #include #include #include /* color management */ enum {MAX_COLOR=256}; /* work with 8bit color */ // RGB color info struct RGBColor { float red, green, blue; // read an RGB entry friend istream& operator>>(istream& is, RGBColor& rgb) { is >> rgb.red >> rgb.green >> rgb.blue; return is; } }; // one of these is used to hold colormap info for each colormap // file read class ColorMapInfo { private: char* name_; // filename RGBColor* rgb_; // array of RGB values ColorMapInfo* next_; // pointer to next colormap int nameowner_; // true if we "own" the name_ memory pointer // copy constructor (not defined) ColorMapInfo(const ColorMapInfo&); public: // constructor - arguments are the name of the colormap // and an array of RGB color values. Both are assumed to // have been allocated. If second form we take ownership // of the name memory (allocated by malloc). ColorMapInfo(char* name, RGBColor* rgb); ColorMapInfo(char* name, RGBColor* rgb, int nameowner); // destructor ~ColorMapInfo(); // create and return ColorMap from a file description static ColorMapInfo* get(char* filename); // write a list of colormap files static void list(ostream&); // member access const char* name() const {return name_;} ColorMapInfo* next() {return next_;} const RGBColor* rgbcolor() {return rgb_;} // set the red, green and blue values from the colormap data // and interpolate based on the count of available colors void interpolate(XColor* colorCells, int colorCount); // rotate the colormap by the given amount void rotate(int amount, XColor* src, XColor* dest, int colorCount); // shift the colormap by the given amount void shift(int amount, XColor* src, XColor* dest, int colorCount); }; #endif /* _ColorMapInfo_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/CompoundImageData.C000066400000000000000000000642331215713201500227770ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id" * * CompoundImageData.C - member functions for class CompoundImageData * * This class is used for images that are divided into multiple HDUs * (FITS header/data units, FITS image extensions). The idea here * is to make it appear to the using class as if there is a single image. * The image extensions are combined based on the WCS information in * each header. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 14/02/00 Created * Peter W. Draper 14/12/05 Remove local knowledge of FitsIO class so * that other ImageIORep implementations can be * used. * 25/04/08 Add growAndShrink(). * 19/01/12 change setCutLevels to define highCut_ and * lowCut_ to be the same as the first extension, * otherwise we assume primary HDU has same bscale * and bzero. */ #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "ImageIO.h" #include "error.h" #include "CompoundImageData.h" /* * Constructor: Create an array of image objects, one for each * image extension and initialize the image size to be the * complete size of all of the images. * * name - the name of the image (for logging/debugging * imio - the object representing the image file * hduList - the list of image HDU indexes to use * numHDUs - the number of image HDU indexes in hduList * biasInfo - used when calculating bias info * verbose - print diagnostic messages */ CompoundImageData::CompoundImageData(const char* name, const ImageIO& imio, int* hduList, int numHDUs, biasINFO* biasInfo, int verbose) : ImageData(name, imio, verbose) { numImages_ = numHDUs; images_ = new ImageData*[numImages_]; minX_ = maxX_ = minY_ = maxY_ = 0.; ImageIORep* imioRep = (ImageIORep*)imio.rep(); // create images and note the min/max coordinates for(int i = 0; i < numImages_; i++) { // need a (reference counted) copy so we can change the current HDU ImageIORep* imioRepExt = imioRep->copy(); if ((status_ = imioRepExt->setHDU(hduList[i])) != 0) { delete imioRepExt; return; // error } images_[i] = ImageData::makeImage(name, imioRepExt, biasInfo, verbose); double x0 = -images_[i]->crpix1_, y0 = -images_[i]->crpix2_, x1 = x0 + images_[i]->width_ - 1, y1 = y0 + images_[i]->height_ - 1; if (i == 0) { minX_ = min(x0, x1); minY_ = min(y0, y1); maxX_ = max(x0, x1); maxY_ = max(y0, y1); } else { minX_ = min(min(x0, x1), minX_); minY_ = min(min(y0, y1), minY_); maxX_ = max(max(x0, x1), maxX_); maxY_ = max(max(y0, y1), maxY_); } } // reset image dimensions to imclude the entire collection of images dispWidth_ = width_ = int(maxX_ - minX_ + 1); dispHeight_ = height_ = int(maxY_ - minY_ + 1); area_ = width_*height_; } /* * copy constructor * * Note that the classes managing the image data (ImageIO, Mem, ...) use * reference counting, so that the data is not actually copied normally, * but shared as long as possible. */ CompoundImageData::CompoundImageData(const CompoundImageData& im) : ImageData(im), numImages_(im.numImages_), minX_(im.minX_), maxX_(im.maxX_), minY_(im.minY_), maxY_(im.maxY_) { // copy the images_ array images_ = new ImageData*[numImages_]; for(int i = 0; i < numImages_; i++) { images_[i] = im.images_[i]->copy(); } } /* * Destructor: delete the image array. */ CompoundImageData::~CompoundImageData() { for(int i = 0; i < numImages_; i++) { delete images_[i]; } delete[] images_; } /* * Set x0, y0, x1, y1 to the bounds of the given image data in FITS image coordinates. */ void CompoundImageData::getBounds(ImageData* imageData, double& x0, double& y0, double& x1, double& y1) { x0 = -imageData->crpix1_ - minX_; y0 = -imageData->crpix2_ - minY_; x1 = x0 + imageData->width_ - 1; y1 = y0 + imageData->height_ - 1; } /* * Specify a new lookup table to use for this image and its size. * Redefined from parent class to pass on to each image extension. */ int CompoundImageData::lookupTable(LookupTable lookup) { if (ImageData::lookupTable(lookup) != 0) return 1; // error for(int i = 0; i < numImages_; i++) { if (images_[i]->lookupTable(lookup) != 0) return 1; // error } return 0; } /* * This method is used to save color information for pos. later use * * Note that the first and last colors are reserved for special use: * The first color should be black and the last color can be set to * some saturation color. */ void CompoundImageData::setColors(int ncolors, unsigned long* colors) { ImageData::setColors(ncolors, colors); for(int i = 0; i < numImages_; i++) { images_[i]->setColors(ncolors, colors); } } /* * Set the destination XImage buffer and the dimensions of the XImage in * pixels. (This class copies the rawimage to xImage, doing any necessary * transformations along the way.) */ void CompoundImageData::setXImage(ImageDisplay* xImage) { ImageData::setXImage(xImage); for(int i = 0; i < numImages_; i++) { images_[i]->setXImage(xImage); } } /* * Save the contents of the given region of this image to the given file. * The coordinates are expected in image pixel units. */ int CompoundImageData::write(const char* filename, double rx0, double ry0, double rx1, double ry1) { // XXX to be implemented return error("Sorry: saving a region is not supported for compound images yet"); } /* * Copy the cutlevels, scale, rotate and flip parameters from the * given struct to this image (see saveParams()). * If restoreCutLevels is non-zero (default), the saved cut-levels are restored * otherwise they are not and the cutlevels are left as they were * initialized (to the approx. min/max pixel value). * * Redefined from parent class to propagate to the image extensions. */ void CompoundImageData::restoreParams(ImageDataParams& p, int restoreCutLevels) { if (p.status != 0) return; // don't use if status != 0 ImageData::restoreParams(p, restoreCutLevels); for(int i = 0; i < numImages_; i++) { images_[i]->restoreParams(p, restoreCutLevels); } } /* * create the color scale lookup table for the image. * The arguments are: * * ncolors - the number of available colors * colors - an array of pixel values for the available colors * * The color scaling algorithm used is determined by the value of * colorScaleType_, which defaults to LINEAR_SCALE. */ void CompoundImageData::colorScale(int ncolors, unsigned long* colors) { int i; for(i = 0; i < numImages_; i++) { if (i == 0) { scaledLowCut_ = images_[i]->scaledLowCut_; scaledHighCut_ = images_[i]->scaledHighCut_; } else { scaledLowCut_ = min(images_[i]->scaledLowCut_, scaledLowCut_); scaledHighCut_ = max(images_[i]->scaledHighCut_, scaledHighCut_); } } ImageData::colorScale(ncolors, colors); for(i = 0; i < numImages_; i++) { images_[i]->lookupTable(lookup_); } } /* * set the scaling (zoom) factor */ void CompoundImageData::setScale(int xScale, int yScale) { ImageData::setScale(xScale, yScale); for(int i = 0; i < numImages_; i++) { images_[i]->setScale(xScale, yScale); } } /* * rotate the image by the given angle * (actually exchange the x/y axes if angle not 0) */ void CompoundImageData::rotate(int angle) { ImageData::rotate(angle); for(int i = 0; i < numImages_; i++) { images_[i]->rotate(angle); } } /* * flip the image X axis if b is non-zero */ void CompoundImageData::flipX(int b) { ImageData::flipX(b); for(int i = 0; i < numImages_; i++) { images_[i]->flipX(b); } } /* * flip the image Y axis if b is non-zero */ void CompoundImageData::flipY(int b) { ImageData::flipY(b); for(int i = 0; i < numImages_; i++) { images_[i]->flipY(b); } } /* * set the cut levels to the given values. * If scaled is 1, the low and high values should be already "scaled" with * bzero and bscale. */ void CompoundImageData::setCutLevels(double low, double high, int scaled) { ImageData::setCutLevels(low, high, scaled); for(int i = 0; i < numImages_; i++) { images_[i]->setCutLevels(low, high, scaled); } // Unscaling of cuts uses first extension HDU methods, so match those // (otherwise we assume primary HDU has same bscale and bzero as first // extension). if (scaled) { highCut_ = images_[0]->unScaleValue(high); lowCut_ = images_[0]->unScaleValue(low); } else { highCut_ = high; lowCut_ = low; } } /* Just pass on to the parent class and image extensions */ void CompoundImageData::subsample(int b) { ImageData::subsample(b); for(int i = 0; i < numImages_; i++) { images_[i]->subsample(b); } } /* Just pass on to the parent class and image extensions */ void CompoundImageData::sampmethod(int b) { ImageData::sampmethod(b); for(int i = 0; i < numImages_; i++) { images_[i]->sampmethod(b); } } /* Just pass on to the parent class and image extensions */ void CompoundImageData::verbose(int b) { ImageData::verbose(b); for(int i = 0; i < numImages_; i++) { images_[i]->verbose(b); } } /* Just pass on to the parent class and image extensions */ void CompoundImageData::name(const char* name) { ImageData::name(name); for(int i = 0; i < numImages_; i++) { images_[i]->name(name); } } /* Just pass on to the parent class and image extensions */ void CompoundImageData::object(const char* object) { ImageData::object(object); for(int i = 0; i < numImages_; i++) { images_[i]->object(object); } } /* * Return non-zero if the rectangle given by (ax0,ay0 ax1,ay1) intersects * the rectangle given by (bx0,by0 bx1,by1). */ inline int intersects(double ax0, double ay0, double ax1, double ay1, double bx0, double by0, double bx1, double by1) { return !((ax1 <= bx0) || (ay1 <= by0) || (ax0 >= bx1) || (ay0 >= by1)); } /* * Return non-zero if the point given by (x,y) intersects * the rectangle given by (x0,y0 x1,y1). */ inline int intersects(double x, double y, double x0, double y0, double x1, double y1) { return !((x <= x0) || (y <= y0) || (x >= x1) || (y >= y1)); } /* * Update the X image area starting at the given offset and continuing * to the end of the raw image or the end of the X image data, which * ever comes first. * * This method is used when the X Image is the same size as the visible * window (or image, if smaller) and displays the part of the image at * some x,y scroll offset. * * Redefined from the parent class to always clear teh XImage. */ void CompoundImageData::updateOffset(double x, double y) { if (!xImage_ || width_ <= 0 || height_ <= 0 || (update_pending_ == 0 && x == prevX_ && y == prevY_)) return; if (clear_) { // temp clear image xImage_->clear(color0_); clear_ = 0; return; } prevX_ = x; prevY_ = y; int x0 = int(x), y0 = int(y), x1 = width_-1, y1 = height_-1, dest_x = 0, dest_y = 0; // handle case where x0,y0 are negative (i.e.: image starts in the // middle of the window somewhere rather than the window starting at // the middle of the image) if (x < 0) { dest_x = -x0 + 1; x0 = 0; } if (y < 0) { dest_y = -y0 + 1; y0 = 0; } // always clear the XImage, since there may be different dest offsets xImage_->clear(color0_); // copy raw to X image while doing transformations toXImage(x0, y0, x1, y1, dest_x, dest_y); } /* * copy the raw image to the xImage, doing any transformations as * necessary. * * The arguments x0, y0, x1 and y1 are the bounding box of the region of * the raw image that needs to be copied (origin at (0,0)) * * dest_x and dest_y give the coordinates in the XImage where copying * should start. These are normally either (-x0,-y0) or (0,0). * * This method adjust the coordinates, if necessary and then calls * the virtual methods in derived classes to do the real work. * * As a side effect, the member variables x0_, y0_, x1_, y1_ are set to * the bounding box of the visible area of the image in FITS image * coordinates. */ void CompoundImageData::toXImage(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { // set and clip the member variables x0_, y0_, x1_, y1_ setBounds(x0, y0, x1, y1, dest_x, dest_y); // Draw each image extension as needed for(int i = 0; i < numImages_; i++) { // Get the offset of the image extension in the complete image (dx, dy). // Note: crpix is by convention negative, y-axis reversed (origin at (1,1) ???), // but here we need positive values, with origin at (0,0) //int dx = -int(images_[i]->crpix1_) + 1, // dy = -int(images_[i]->crpix2_) + 1; int w = images_[i]->width_, h = images_[i]->height_; int dx =(int)(-images_[i]->crpix1_ - minX_), dy =(int)(-images_[i]->crpix2_ - minY_); if (! flipY_) dy = height_ - dy - h; // y-axis reversed here if (flipX_) dx = width_ - dx - w; if (intersects(x0_, y0_, x1_, y1_, dx, dy, dx+w-1, dy+h-1)) { int idest_x = dest_x + max(dx - x0_, 0); int idest_y = dest_y + max(dy - y0_, 0); // translate to the coordinates of the image extension x0 = max(x0_ - dx, 0); y0 = max(y0_ - dy, 0); x1 = w - 1; y1 = h - 1; if (x1 > x0 && y1 > y0) { images_[i]->toXImage(x0, y0, x1, y1, idest_x, idest_y); } } } // x0_, y0_, x1_ and y1_ are the coordinates of the visible part of // the image and are needed later for setting cut levels and calculating // the min/max pixel for the displayed image area. The display routines // called above (rawToXImage, grow, shrink) expect the coordinates to have // the origin at upper left (0,0) (XImage type coordinates), while the rest // of the code deals with FITS image coordinates (origin at lower left // (1, 1) at mag 1). flip(x0_, y0_, x1_, y1_); update_pending_ = 0; } /*---------------------------------------------------------------------------- * The methods below access the actual image data and are normally implemented * in ImageTemplates.icc. Here we need to define the methods to access the * correct image extensions, based on the visible area, or requested area * of the image. *----------------------------------------------------------------------------*/ /* * Scan the image to find the min and max values and set the member * variables accordingly. To save time, only the visible area of the * image is examined (x0_, y0_, x1_ and y1_ are set each time the * image is updated, however they are initially set to the entire * image). * The result is that the member variables minValue_ and maxValue_ * are set. */ void CompoundImageData::getMinMax() { int n = 0; for(int i = 0; i < numImages_; i++) { double x0, y0, x1, y1; getBounds(images_[i], x0, y0, x1, y1); if (intersects(x0_, y0_, x1_, y1_, x0, y0, x1, y1)) { images_[i]->getMinMax(); if (n++ == 0) { minValue_ = images_[i]->minValue_; maxValue_ = images_[i]->maxValue_; } else { minValue_ = min(images_[i]->minValue_, minValue_); maxValue_ = max(images_[i]->maxValue_, maxValue_); } } } } /* * print the coordinates and raw data value at the given x,y image * coords to the buffer * * A "-" is printed if the x,y coords are out of range. * "blank" is printed if the pixel is blank. */ char* CompoundImageData::getValue(char* buf, double x, double y) { for(int i = 0; i < numImages_; i++) { // get bounding box of this image extension double x0, y0, x1, y1; getBounds(images_[i], x0, y0, x1, y1); if (intersects(x, y, x0, y0, x1, y1)) { return images_[i]->getValue(buf, x-x0, y-y0); } } sprintf(buf, "%.1f %.1f -", x, y); return buf; } /* * return the value at the x,y image coords as a double. * * The input x,y is assumed to be in image coords. * If the coords are out of range, 0.0 is returned. */ double CompoundImageData::getValue(double x, double y) { for(int i = 0; i < numImages_; i++) { // get bounding box of this image extension double x0, y0, x1, y1; getBounds(images_[i], x0, y0, x1, y1); if (intersects(x, y, x0, y0, x1, y1)) { return images_[i]->getValue(x-x0, y-y0); } } return 0.0; } /* * print the X, Y coordinates, raw data value and World Coordinates * at the given x,y image coords to the given buffers. * * rx and ry are the image coordinates to use to access the pixel value. This might * be different than x,y, since x,y are the logical image coordinates, assuming the * image starts at 1,1, which might not actually be the case. * * A blank value is printed if the rx,ry coords are out of range. * * note: x, y and rx,ry are expected in image coords, while in the result, * xStr and yStr are in "chip" coords, since they should be displayed. */ void CompoundImageData::getValues(double x, double y, double rx, double ry, char* xStr, char* yStr, char* valueStr, char* raStr, char* decStr, char* equinoxStr) { *valueStr = '\0'; *xStr = '\0'; *yStr = '\0'; *raStr = '\0'; *decStr = '\0'; *equinoxStr = '\0'; for(int i = 0; i < numImages_; i++) { // get bounding box of this image extension double x0, y0, x1, y1; getBounds(images_[i], x0, y0, x1, y1); if (intersects(rx, ry, x0, y0, x1, y1)) { images_[i]->getValues(x-x0, y-y0, rx-x0, ry-y0, xStr, yStr, valueStr, raStr, decStr, equinoxStr); // display global chip coords for x and y double cx = x, cy = y; imageToChipCoords(cx, cy); sprintf(xStr, "%.1f", cx); sprintf(yStr, "%.1f", cy); return; } } } /* * Fill the given array with the pixel values surrounding the given point. * nrows and ncols give the dimensions of the array. Any values that are outside * of the image or are blank (BLANK keyword) are set to -HUGE_VAL. * * Note: it is assumed that nrows and ncols are odd numbers and that the array * is one row and column larger (nrows+1 x ncols+1), so that it can hold the * X and Y index headings. * * rx and ry are the image coordinates to use to access the pixel value. This might * be different than x,y, since x,y are the logical image coordinates, assuming the * image starts at 1,1, which might not actually be the case. * * note: x, y and rx,ry are expected in image coords, however the coordinates in the * result are "chip" coords, since they should be displayed. */ void CompoundImageData::getValues(double x, double y, double rx, double ry, double* ar, int nrows, int ncols, int flag) { // clear out array first int nn = (nrows+1)*(ncols+1); int i; for(i = 0; i < nn; i++) ar[i] = -HUGE_VAL; for(i = 0; i < numImages_; i++) { // get bounding box of this image extension double x0, y0, x1, y1; getBounds(images_[i], x0, y0, x1, y1); double m = ncols/2, n = nrows/2; if (intersects(rx-m, ry-n, rx+m, ry+n, x0, y0, x1, y1)) { images_[i]->getValues(x-x0, y-y0, rx-x0, ry-y0, ar, nrows, ncols, 1); } } } /* * Fill the given array with the pixel values (converted to floats as needed) * at the given x,y image pos, width and height. * * The array should be large enough for at least (w x h) floats. * * Any values that are outside of the image are set to blank or 0, if there * is no blank pixel value defined (If "flag" is non-zero, values outside * the image are not changed). * * Note: x and y are expected in image coordinates */ void CompoundImageData::getValues(double x, double y, int w, int h, float* ar, int flag) { // clear out array first int nn = w*h; int i; for(i = 0; i < nn; i++) ar[i] = 0; for(i = 0; i < numImages_; i++) { // get bounding box of this image extension double x0, y0, x1, y1; getBounds(images_[i], x0, y0, x1, y1); double m = w/2, n = h/2; if (intersects(x-m, y-n, x+m, y+n, x0, y0, x1, y1)) { images_[i]->getValues(x-x0, y-y0, w, h, ar, 1); } } } /* * Copy raw image data from this image to the given image data area, * starting at the image coordinates (x, y) and with the dimentions (w,h) * in pixels. Since this is a copy from one raw image to another, no * data conversion is done. */ void CompoundImageData::copyImageArea(void* data, double x, double y, int w, int h) { // XXX to be implemented error("Sorry: copying a region is not supported for compound images yet"); } /* * copy the raw image to the xImage * * The arguments x0, y0, x1 and y1 are the bounding box of the region of * the raw image that needs to be copied. * * dest_x and dest_y give the coordinates in the XImage where copying * should start. These are normally either (x0,y0) or (0,0). */ void CompoundImageData::rawToXImage(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { return; // see toXImage() above } /* * This method is called to magnify the image by factors >= 2 * The arguments x0, y0, x1 and y1 are the bounding box of the region * that needs to be copied. * * dest_x and dest_y give the coordinates in the XImage where copying * should start. These are normally either (x0,y0) or (0,0). */ void CompoundImageData::grow(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { return; // see toXImage() above } /* * This method is called to scale image when factor have different signs. * The arguments x0, y0, x1 and y1 are the bounding box of the region * that needs to be copied. * * dest_x and dest_y give the coordinates in the XImage where copying * should start. These are normally either (x0,y0) or (0,0). */ void CompoundImageData::growAndShrink(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { return; // see toXImage() above } /* * This method is called to shrink the image. If subsample_ is 1, just * take every nth pixel as a sample, otherwise take the max of the * surrounding pixels * * dest_x and dest_y give the coordinates in the XImage where copying * should start. These are normally either (x0,y0) or (0,0). * * Note: there is a (non-fatal) bug here that shows up when dest_x,dest_y are non-zero, * (the image display gets split or mixed up somehow...) - needs some * testing to see what the cause is. */ void CompoundImageData::shrink(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { return; // see toXImage() above } /* * Set the cut levels using a median filtering algorithm. * To save time, only the visible area of the image is examined * (x0_, y0_, x1_ and y1_ are set each time the image is updated). */ void CompoundImageData::medianFilter() { int n = 0; for(int i = 0; i < numImages_; i++) { double x0, y0, x1, y1; getBounds(images_[i], x0, y0, x1, y1); if (intersects(x0_, y0_, x1_, y1_, x0, y0, x1, y1)) { images_[i]->medianFilter(); if (n++ == 0) { lowCut_ = images_[i]->lowCut_; highCut_ = images_[i]->highCut_; } else { lowCut_ = min(images_[i]->lowCut_, lowCut_); highCut_ = max(images_[i]->highCut_, highCut_); } } } setCutLevels(lowCut_, highCut_, 0); } /* * scan the image to find the distribution of pixel values * and set the cut levels so that the given percent of pixels * are within the low and high cut values. */ void CompoundImageData::autoSetCutLevels(double percent) { int n = 0; for(int i = 0; i < numImages_; i++) { double x0, y0, x1, y1; getBounds(images_[i], x0, y0, x1, y1); if (intersects(x0_, y0_, x1_, y1_, x0, y0, x1, y1)) { images_[i]->autoSetCutLevels(percent); if (n++ == 0) { lowCut_ = images_[i]->lowCut_; highCut_ = images_[i]->highCut_; } else { lowCut_ = min(images_[i]->lowCut_, lowCut_); highCut_ = max(images_[i]->highCut_, highCut_); } } } setCutLevels(lowCut_, highCut_, 0); } /* * Fill the given array (xyvalues) with statistics about the distribution * of pixels in the visible image area (given by x0_, y0_, x1_, y1_). * xyvalues[n*2+1] is set to the number of pixels with value at or near n. * The factor is used to fit the information in the given size aray. */ void CompoundImageData::getPixDist(int numValues, double* xyvalues, double factor) { for(int i = 0; i < numImages_; i++) { double x0, y0, x1, y1; getBounds(images_[i], x0, y0, x1, y1); if (intersects(x0_, y0_, x1_, y1_, x0, y0, x1, y1)) { images_[i]->getPixDist(numValues, xyvalues, factor); } } } /* * Fill the given histogram with the distribution of pixels in the * visible image area (given by x0_, y0_, x1_, y1_). h.histogram[n] is * set to the number of pixels with a value of n (after conversion to * short if needed). */ void CompoundImageData::getHistogram(ImageDataHistogram& h) { for(int i = 0; i < numImages_; i++) { double x0, y0, x1, y1; getBounds(images_[i], x0, y0, x1, y1); if (intersects(x0_, y0_, x1_, y1_, x0, y0, x1, y1)) { images_[i]->getHistogram(h); } } } /* * If there is a special value for blank pixels, get it. * * Note that the blank pixel value is not scaled by bscale, since we * compare pixels values with this value before scaling. */ void CompoundImageData::initBlankPixel() { for(int i = 0; i < numImages_; i++) { images_[i]->initBlankPixel(); } } /* * initialize conversion from base type to short (trivial in this case) * and scale the low and high cut levels to short range */ void CompoundImageData::initShortConversion() { for(int i = 0; i < numImages_; i++) { images_[i]->initShortConversion(); scaledLowCut_ = images_[i]->scaledLowCut_; scaledHighCut_ = images_[i]->scaledHighCut_; } } /* * return the data type of the raw data */ int CompoundImageData::dataType() { return images_[0]->dataType(); } /* * return true if the data type is signed */ int CompoundImageData::isSigned() { return images_[0]->isSigned(); } /* * return a copy of this object */ ImageData* CompoundImageData::copy() { return new CompoundImageData(*this); } /* * return a blank pixel value. Assume same for all images and cast to * safest type (makes this call practically useless). */ double CompoundImageData::getBlank() { return (double) images_[0]->getBlank(); } skycat-3.1.2-starlink-1b/rtd/generic/CompoundImageData.h000066400000000000000000000152421215713201500230400ustar00rootroot00000000000000// -*-c++-*- #ifndef _CompoundImageData_h_ #define _CompoundImageData_h_ /* * E.S.O. - VLT project * * "@(#) $Id: CompoundImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * CompoundImageData.h - class definitions for class CompoundImageData * * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 14/02/00 Created * Peter W. Draper 15/11/05 Added getBlank() and haveBlank(). * 25/04/08 Add growAndShrink(). */ #include "ImageData.h" /* * This class is used for images that are divided into multiple HDUs * (FITS header/data units, FITS image extensions). The idea here * is to make it appear to the using class as if there is a single image. * The image extensions are combined based on the WCS information in * each header. */ class CompoundImageData : public ImageData { protected: // Number of images in the images_ array int numImages_; // Array of image extensions to be combined to one image for display ImageData** images_; // bounds of the compound image double minX_, minY_, maxX_, maxY_; // value of blank pixel, if known (if haveBlankPixel_ is nonzero) float blank_; protected: // initialize conversion from base type void initShortConversion(); // check args and call virtual methods to copy raw data to xImage virtual void toXImage(int x0, int y0, int x1, int y1, int dest_x, int dest_y); // copy raw data to xImage, pos. with transformations (defined in derived class) void rawToXImage(int x0, int y0, int x1, int y1, int dest_x, int dest_y); void grow(int x0, int y0, int x1, int y1, int dest_x, int dest_y); void shrink(int x0, int y0, int x1, int y1, int dest_x, int dest_y); void growAndShrink(int x0, int y0, int x1, int y1, int dest_x, int dest_y); // Set x0, y0, x1, y1 to the bounds of the given image data in FITS image coordinates. void getBounds(ImageData* imageData, double& x0, double& y0, double& x1, double& y1); public: // constructor CompoundImageData(const char* name, const ImageIO& imio, int* hduList, int numHDUs, biasINFO* biasInfo, int verbose); // copy constructor (called by copy() member function) CompoundImageData(const CompoundImageData&); // destructor ~CompoundImageData(); // return class name as a string virtual const char* classname() { return "CompoundImageData"; } // return a copy of this object ImageData* copy(); // return the data type of the raw data int dataType(); // return true if the data type is signed int isSigned(); // set the image color lookup table int lookupTable(LookupTable); // set the image colormap void setColors(int ncolors, unsigned long* colors); // set the destination X image buffer, dimensions and raw image offset void setXImage(ImageDisplay* xImage); // Save the contents of the given region of this image to the given file. // The coordinates are expected in image pixel units. int write(const char* filename, double x0, double y0, double x1, double y1); // restore saved transformation parameters void restoreParams(ImageDataParams&, int restoreCutLevels = 1); // set the colors to use for the image void colorScale(int ncolors, unsigned long* colors); // set the scaling factor void setScale(int xScale, int yScale); // rotate the image (actually exchange the x/y axes) void rotate(int); // flip the image X axis if b is non-zero void flipX(int b); // flip the image Y axis if b is non-zero void flipY(int b); // manually set the cut levels (if scaled is true, min and max are "bscaled") void setCutLevels(double min, double max, int scaled); // just pass these on to the parent class and image extensions void subsample(int b); void sampmethod(int b); void verbose(int b); void name(const char* name); void object(const char *object); int getNumImages() {return numImages_;} // The methods below access the actual image data and are normally implemented // in ImageTemplates.icc. Here we need to define the methods to access the // correct image extensions, based on the visible area, or requested area // of the image. // calculate min and max pixel values void getMinMax(); // print raw data value at x,y coords to buffer char* getValue(char* buf, double x, double y); // return the value at the x,y coords as a double double getValue(double x, double y); // print the values at the given x,y coords to the buffers for display void getValues(double x, double y, double rx, double ry, char* xStr, char* yStr, char* valueStr, char* raStr, char* decStr, char* equinoxStr); // get array of image pixel values and x,y coords around a point void getValues(double x, double y, double rx, double ry, double* ar, int nrows, int ncols, int flag = 0); // get array of image pixel values at a given offset with given dimensions void getValues(double x, double y, int w, int h, float* ar, int flag = 0); // Copy raw image data from this image to the given image data area, // starting at the image coordinates (x, y) and with the dimentions (w, h) // in pixels. Since this is a copy from one raw image to another, no // data conversion is done. void copyImageArea(void* data, double x, double y, int w, int h); // update image from raw data starting at the given x,y offset void updateOffset(double x, double y); // automatically set the cut levels using median filtering void medianFilter(); // automatically set the cut levels to leave percent visible void autoSetCutLevels(double percent = 98.0); // get array with information about the pixel value distribution void getPixDist(int numValues, double* xyvalues, double factor); // If there is a special value for blank pixels, get it and set the // values of haveBlankPixel_ and scaledBlankPixelValue_. void initBlankPixel(); // Fill the given histogram with the distribution of pixels in the // visible image area void getHistogram(ImageDataHistogram&); // These need to be redefined to use the first image extension, // since the primary doesn't normally define BZERO and BSCALE.. double highCut() {return images_[0]->scaleValue(highCut_);} double lowCut() {return images_[0]->scaleValue(lowCut_);} double minValue() {return images_[0]->scaleValue(minValue_);} double maxValue() {return images_[0]->scaleValue(maxValue_);} // return the blank value. int haveBlank() {return haveBlank_;} double getBlank(); }; #endif /* _CompoundImageData_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/DoubleImageData.C000066400000000000000000000065011215713201500224170ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: DoubleImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * DoubleImageData.C - member functions for class DoubleImageData * * who when what * -------------- -------- ---------------------------------------- * Peter W. Draper 30/05/01 Created. * 29/10/07 Add colorScale so that a bin for NaN pixels * is always available (shared with blank). * Peter W. Draper 23/06/09 Added parseBlank to get blank value in this type. * pbiereic 12/08/07 Created * Peter W. Draper 17/05/12 Merged skycat version created by pbiereic. */ #include #include #include #include #include #include #include "DoubleImageData.h" #include "define.h" /* * Convert the given double to short by adding the bias, scaling, * rounding if necessary and checking the range. */ short DoubleImageData::scaleToShort( double d ) { if ( isnan(d) ) { return LOOKUP_BLANK; } // Blank pixel value is is special lookup table position. Note // Starlink uses a special value for floating point too (not a NaN). if ( haveBlank_ ) { if ( blank_ == d ) { return LOOKUP_BLANK; } } short s; d = (d + bias_) * scale_; if (d < 0.0 ) { if( ( d -= 0.5 ) < LOOKUP_MIN ) { s = LOOKUP_MIN; } else { s = (short)d; } } else { if( ( d += 0.5 ) > LOOKUP_MAX) { s = LOOKUP_MAX; } else { s = (short)d; } } return s; } /* * Initialize conversion from base type float to short * and scale the low and high cut levels to short range. * * Method: 2 member variables, bias_ and scale_, are set here and * used later to convert the float raw image data to short, which is * then used as an index in the lookup table: */ void DoubleImageData::initShortConversion() { bias_ = -((lowCut_ + highCut_) * 0.5); if( (highCut_ - lowCut_) > 0.0 ) { scale_ = LOOKUP_WIDTH / (highCut_ - lowCut_); } else { scale_ = 1.0; } scaledLowCut_ = scaleToShort(lowCut_); scaledHighCut_ = scaleToShort(highCut_); scaledBlankPixelValue_ = LOOKUP_BLANK; } /* * Define a scaledBlankPixelValue_ so that we have a blank bin for NaN's * not just blanks (both use same color). */ void DoubleImageData::colorScale(int ncolors, unsigned long* colors) { ImageData::colorScale(ncolors, colors); // Always set value for blank pixel in case we have NaNs, not just // when blank is set. lookup_.setPixelColor( scaledBlankPixelValue_, color0_ ); } /* * Set the blank value from a given string. Return 1 if successful. */ int DoubleImageData::parseBlank(const char* value) { double d; int n = sscanf(value, "%lf", &d); if ( n > 0 ) { blank_ = (double) d; } return n; } /* * Include some standard methods as (cpp macro) templates: * These are methods that are the same for all derived classes of ImageData, * except that they work on a different raw data type */ #define CLASS_NAME DoubleImageData #define DATA_TYPE double #ifndef NTOH # define NTOH(x) SWAP_DOUBLE(x) #endif // return true is the value x is a NAN (define to 0 for non-float types) #define ISNAN(x) isnan(x) #include "ImageTemplates.icc" #undef CLASS_NAME #undef DATA_TYPE #undef NTOH #undef ISNAN skycat-3.1.2-starlink-1b/rtd/generic/DoubleImageData.h000066400000000000000000000061041215713201500224630ustar00rootroot00000000000000// -*-c++-*- /* * E.S.O. - VLT project * * "@(#) $Id: DoubleImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * DoubleImageData.h - class definitions for class DoubleImageData * * who when what * -------------- -------- ---------------------------------------- * Peter W. Draper 30/05/01 Created * 14/11/05 Added bias subtraction members. * Peter W. Draper 29/10/07 Added colorScale * pbiereic 12/08/07 Created * Peter W. Draper 17/05/12 Merged skycat version created by pbiereic. */ #include #include "ImageData.h" // This class is used for images where the raw data is made up of doubles. class DoubleImageData : public ImageData { private: // value of blank pixel, if known (if haveBlankPixel_ is nonzero) double blank_; double bias_; // offset for conversion to short lookup index double scale_; // factor for conversion to short lookup index // local methods used to get short index in lookup table short scaleToShort( double ); // as above, but unsigned inline ushort convertToUshort( double f ) { return ushort( scaleToShort( f ) ); } // Return X image pixel value for raw image value. // Convert the given double image value to byte, scaling to short // first and then using the short value as an index in the color // lookup table. inline byte lookup( double f ) { return lookup_[(ushort)scaleToShort(f)]; } inline unsigned long llookup( double f ) { return lookup_[(ushort)scaleToShort(f)]; } // return NTOH converted value evtl. subtracted with corresponding bias value double getVal(double* p, int idx); protected: // initialize conversion from base type to short, void initShortConversion(); // sprintf format for (x y value) virtual char* getXYValueFmt() {return (char *)"%.1f %.1f %.2f";} // sprintf format for image pixel value virtual char* getValueFmt() {return (char *)"%.2f";} int getXsamples(double *rawImage, int idx, int wbox, double *samples); int getBsamples(double *rawImage, int idx, int wbox, double *samples); int getCsamples(double *rawImage, int idx, int wbox, double *samples); double getMedian(double *samples, int n); double getBoxVal(double *rawImage, int idx, int wbox, double *samples, int xs); double getRMS(double *samples, int n); void colorScale(int ncolors, unsigned long* colors); public: // constructor DoubleImageData(const char* name, const ImageIO& imio, int verbose) : ImageData(name, imio, verbose), blank_(0), bias_(0.0), scale_(1.0) {} // return class name as a string virtual const char* classname() { return "DoubleImageData"; } // return the data type of the raw data int dataType() {return DOUBLE_IMAGE;} // return true if the data type is signed int isSigned() {return 1;} // return a copy of this object ImageData* copy() {return new DoubleImageData(*this);} // include declarations for methods that differ only in raw data type # include "ImageTemplates.h" }; skycat-3.1.2-starlink-1b/rtd/generic/FloatImageData.C000066400000000000000000000065471215713201500222640ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: FloatImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * FloatImageData.C - member functions for class FloatImageData * * See the man page RTI(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 15/03/99 Modified to use LOOKUP_BLANK for blank pixels. * 29/10/07 Add colorScale so that a bin for NaN pixels * is always available (shared with blank). * Peter W. Draper 23/06/09 Added parseBlank to get blank value in this type. */ #include #include #include #include #include #include #include "FloatImageData.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" /* * convert the given float to short by adding the bias, * scaling, rounding if necessary and checking the range */ short FloatImageData::scaleToShort(float d) { if ( isnan(d) ) { return LOOKUP_BLANK; } // Blank pixel value is is special lookup table position. Note // Starlink uses a special value for floating point too (not a NaN). if ( haveBlank_ ) { if ( blank_ == d ) { return LOOKUP_BLANK; } } short s; d = (d + bias_) * scale_; if (d < 0.0 ) { if((d -= 0.5) < LOOKUP_MIN) s = LOOKUP_MIN; else s = (short)d; } else { if((d += 0.5) > LOOKUP_MAX) s = LOOKUP_MAX; else s = (short)d; } return s; } /* * initialize conversion from base type float to short * and scale the low and high cut levels to short range * * Method: 2 member variables, bias_ and scale_, are set here and * used later to convert the float raw image data to short, which is * then used as an index in the lookup table: */ void FloatImageData::initShortConversion() { bias_ = -((lowCut_ + highCut_) * 0.5); if( (highCut_ - lowCut_) > 0.0 ) { scale_ = LOOKUP_WIDTH / (highCut_ - lowCut_); } else { scale_ = 1.0; } scaledLowCut_ = scaleToShort(lowCut_); scaledHighCut_ = scaleToShort(highCut_); scaledBlankPixelValue_ = LOOKUP_BLANK; } /* * Define a scaledBlankPixelValue_ so that we have a blank bin for NaN's * not just blanks (both use same color). */ void FloatImageData::colorScale(int ncolors, unsigned long* colors) { ImageData::colorScale(ncolors, colors); // Always set value for blank pixel in case we have NaNs, not just // when blank is set. lookup_.setPixelColor( scaledBlankPixelValue_, color0_ ); } /* * Set the blank value from a given string. Return 1 if successful. */ int FloatImageData::parseBlank(const char* value) { double d; int n = sscanf(value, "%lf", &d); if ( n > 0 ) { blank_ = (float) d; } return n; } /* * Include some standard methods as (cpp macro) templates: * These are methods that are the same for all derived classes of ImageData, * except that they work on a different raw data type */ #define CLASS_NAME FloatImageData #define DATA_TYPE float #ifndef NTOH # define NTOH(x) SWAP_FLOAT(x) #endif // return true is the value x is a NAN (define to 0 for non-float types) #define ISNAN(x) isnan(x) #include "ImageTemplates.icc" #undef CLASS_NAME #undef DATA_TYPE #undef NTOH #undef ISNAN skycat-3.1.2-starlink-1b/rtd/generic/FloatImageData.h000066400000000000000000000060341215713201500223200ustar00rootroot00000000000000// -*-c++-*- /* * E.S.O. - VLT project * * "@(#) $Id: FloatImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * FloatImageData.h - class definitions for class FloatImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 04/03/98 Added llookup * P.Biereichel 22/03/99 Added definitions for bias subtraction * Peter W. Draper 29/10/07 Added colorScale */ #include #include "ImageData.h" // This class is used for images where the raw data is made up of ints class FloatImageData : public ImageData { private: // value of blank pixel, if known (if haveBlankPixel_ is nonzero) float blank_; double bias_; // offset for conversion to short lookup index double scale_; // factor for conversion to short lookup index // local methods used to get short index in lookup table short scaleToShort(float); // as above, but unsigned inline ushort convertToUshort(float f) { return ushort(scaleToShort(f)); } // Return X image pixel value for raw image value. // Convert the given float image value to byte, scaling to short // first and then using the short value as an index in the color // lookup table. inline byte lookup(float f) {return lookup_[(ushort)scaleToShort(f)];} inline unsigned long llookup(float f) {return lookup_[(ushort)scaleToShort(f)];} // return NTOH converted value evtl. subtracted with corresponding bias value float getVal(float* p, int idx); protected: // initialize conversion from base type to short, void initShortConversion(); // sprintf format for (x y value) virtual char* getXYValueFmt() {return (char *)"%.1f %.1f %.2f";} // sprintf format for image pixel value virtual char* getValueFmt() {return (char *)"%.2f";} int getXsamples(float *rawImage, int idx, int wbox, float *samples); int getBsamples(float *rawImage, int idx, int wbox, float *samples); int getCsamples(float *rawImage, int idx, int wbox, float *samples); float getMedian(float *samples, int n); float getBoxVal(float *rawImage, int idx, int wbox, float *samples, int xs); float getRMS(float *samples, int n); void colorScale(int ncolors, unsigned long* colors); public: // constructor FloatImageData(const char* name, const ImageIO& imio, int verbose) : ImageData(name, imio, verbose), blank_(0), bias_(0.0), scale_(1.0) {} // return class name as a string virtual const char* classname() { return "FloatImageData"; } // return the data type of the raw data int dataType() {return FLOAT_IMAGE;} // return true if the data type is signed int isSigned() {return 1;} // return a copy of this object ImageData* copy() {return new FloatImageData(*this);} // include declarations for methods that differ only in raw data type # include "ImageTemplates.h" }; skycat-3.1.2-starlink-1b/rtd/generic/ITTInfo.C000066400000000000000000000102561215713201500207260ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: ITTInfo.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ITTInfo.C - member routines for class ITTInfo * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 14/07/98 Modified interpolate to use last value * (makes last colour pure). * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ static const char* const rcsId="@(#) $Id: ITTInfo.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include #include #include "ITTInfo.h" #include "error.h" #include "util.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" // list of itts, used for cache ITTInfo* itts_ = NULL; /* * constructor - arguments are the name of the itt * and an array of itt values. Both are assumed to * have been allocated. */ ITTInfo::ITTInfo(char* name, double* value) : value_(value), name_(name), next_(itts_) { // make this the head of the list itts_ = this; } /* * destructor */ ITTInfo::~ITTInfo() { // remove from list if (this == itts_) { itts_ = next_; } else { for (ITTInfo* m = itts_; m; m = m->next_) { if (m->next_ == this) { m->next_ = next_; break; } } } } /* * read a ITT from a file (if needed) and return a new instance for it */ ITTInfo* ITTInfo::get(char* filename) { // just use the basename to identify the colormap char* name = strdup(fileBasename(filename)); // see if we read this one already ITTInfo* m; for (m = itts_; m; m = m->next()) if (strcmp(m->name(), name) == 0) break; if (m) { free( name ); return m; } // have to read file ifstream f(filename); if (! f) { free( name ); error("could not open ITT file: ", filename); return (ITTInfo*) NULL; } double* value = new double[MAX_ITT]; if (! value) { free( name ); error("could not allocate ITT color table"); return (ITTInfo*) NULL; } for (int i = 0; i < MAX_ITT; i++) { f >> value[i]; } if (! f) { free( name ); error("error reading ITT file: ", filename); return (ITTInfo*) NULL; } m = new ITTInfo(name, value); if (! m) { error("could not create ITT"); } free( name ); return m; } /* * write a list of loaded itt files to the given stream * separated by spaces */ void ITTInfo::list(ostream& os) { ITTInfo* m; for (m = itts_; m; m = m->next()) os << m->name() << " "; } /* * Copy the rgb color values from src to dest and interpolate based * on the ITT table and the count of available colors */ void ITTInfo::interpolate(XColor* src, XColor* dest, int colorCount) { int c = colorCount - 1; int index, value; for (int i=0; i= start && i <= end) { index = ((i-start)*n)/dist; if (index < 0) index = 0; else if (index > n) index = n; } else if (i < start) { index = 0; } else { index = n; } value = (unsigned char)(value_[index]*c); dest[i].red = src[value].red; dest[i].green = src[value].green; dest[i].blue = src[value].blue; } } skycat-3.1.2-starlink-1b/rtd/generic/ITTInfo.h000066400000000000000000000032711215713201500207720ustar00rootroot00000000000000// -*-c++-*- #ifndef _ITTInfo_h_ #define _ITTInfo_h_ /* * E.S.O. - VLT project * "@(#) $Id: ITTInfo.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ITTInfo.h - class definitions for reading in ITT * (intensity transfer table) files * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ using namespace std; #include #include enum {MAX_ITT=256}; /* work with 8bit color */ // one of these is used to hold ITT info for each ITT // file read class ITTInfo { private: char* name_; // filename double* value_; // array of ITT values ITTInfo* next_; // pointer to next ITT // copy constructor (not defined) ITTInfo(const ITTInfo&); public: // constructor ITTInfo(char* name, double* value); // destructor ~ITTInfo(); // create and return ITT from a file description static ITTInfo* get(char* filename); // write a list of ITT files static void list(ostream&); // member access const char* name() const {return name_;} ITTInfo* next() {return next_;} // Copy the rgb color values from src to dest and interpolate based // on the ITT table and the count of available colors void interpolate(XColor* src, XColor* dest, int colorCount); // Copy the rgb color values from src to dest as above, // and also scale the ITT values by the given amount void scale(int amount, XColor* src, XColor* dest, int colorCount); }; #endif /* _ITTInfo_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/ImageColor.C000066400000000000000000000277221215713201500215010ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: ImageColor.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ImageColor.C - member routines for class ImageColor * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 05/03/98 Added full support for X visuals in addition * to pseudocolor (merged my changes from GAIA). * 08/12/08 Don't overwrite pixelval_[0] in storeColors, * that's the background colour (black or a * user-defined value). * 03/11/09 Initialize all of pixelval_ in constructor. * Stops valgrind warnings in Tcl color allocs. * 19/08/11 Don't interpolate when using truecolor visuals. */ static const char* const rcsId="@(#) $Id: ImageColor.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include "ErrorHandler.h" #include "ImageColor.h" #include "error.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" /* * constructor: passed the X Display handle and the number of * colors to allocate initially. */ ImageColor::ImageColor(Display* display, Visual* visual, int depth, int numColors) : display_(display), visual_(visual), screen_(DefaultScreen(display_)), depth_(depth), cmapSize_(XCellsOfScreen(DefaultScreenOfDisplay(display_))), defaultCmap_(DefaultColormap(display_, DefaultScreen(display_))), colormap_(DefaultColormap(display_, DefaultScreen(display_))), colorCount_(0), freeCount_(0), cmaps_(NULL), cmap_(NULL), itts_(NULL), itt_(NULL), status_(0) { // Check if the visual we're dealing with is readonly, or if it // can be modified (XXX need to deal with DirectColor). if ( visual_->c_class == PseudoColor || visual_->c_class == DirectColor || visual_->c_class == GrayScale ) { readOnly_ = 0; } else { readOnly_ = 1; // Assume all colours are available, and use them. cmapSize_ = min(MAX_COLOR,int(pow( 2.0, depth_))); } // If default visual isn't the same then create a local colormap. Visual *defvis = DefaultVisual(display_, screen_); if ( defvis->c_class != visual_->c_class ) { colormap_ = XCreateColormap(display_, XRootWindow(display_, screen_), visual_, AllocNone); } // Initialisations. memset(pixelval_, '\0', sizeof(pixelval_)); memset(colorCells_, '\0', sizeof(colorCells_)); memset(ittCells_, '\0', sizeof(ittCells_)); memset(windowList_, '\0', sizeof(windowList_)); allocate(numColors); } /* * return the number of free color cells available (up to MAX_COLOR) */ int ImageColor::numFreeColors() { ErrorHandler errorHandler(display_); // catch X errors if ( ! readOnly_ ) { int i; for (i = MAX_COLOR-1; i > 0; i--) { if (XAllocColorCells(display_, colormap_, False, 0, 0, pixelval_, i) != 0) { XFreeColors(display_, colormap_, pixelval_, i, 0); // (note: here 0 return means error) return i; } } } else { // Readonly so all colors are free. return min(MAX_COLOR,int(pow( 2.0, depth_))); } return 0; } /* * free and then re-allocate at most numColors color cells */ int ImageColor::reallocate(int numColors) { if (readOnly_) { colorCount_ = cmapSize_; return 0; } if (colorCount_) { XFreeColors(display_, colormap_, pixelval_, colorCount_, 0); colorCount_ = 0; } if (allocate(numColors) == 0) { if (cmap_) if (loadColorMap(cmap_) != 0) return 1; } return 0; } /* * If we are using a 8-bit pseudocolor visual, this method allocates at most * numColors read/write color cells in the colormap. */ int ImageColor::allocate(int numColors) { if (readOnly_) { colorCount_ = cmapSize_; return 0; } // for 8-bit color, allocate read-write color cells if (colorCount_) { // free colors allocated in the default colormap XFreeColors(display_, colormap_, pixelval_, colorCount_, 0); colorCount_ = 0; } freeCount_ = numFreeColors(); if (numColors < freeCount_) colorCount_ = numColors; else colorCount_ = freeCount_; freeCount_ -= colorCount_; if (freeCount_ < 0) freeCount_ = 0; if (colorCount_ <= 0) return error("no more colors available"); if (XAllocColorCells(display_, colormap_, False, 0, 0, pixelval_, colorCount_) == 0) { colormap_ = defaultCmap_; freeCount_ = 0; colorCount_ = 0; return error("error allocating colors for colormap"); } for (int i=0; iinterpolate(colorCells_, colorCount_); // set first color to black, usually used for blank pixels colorCells_[0].red = colorCells_[0].green = colorCells_[0].blue = XBlackPixelOfScreen(DefaultScreenOfDisplay(display_)); // set last color default to white int n1 = colorCount_ - 1; colorCells_[n1].red = colorCells_[n1].green = colorCells_[n1].blue = XWhitePixelOfScreen(DefaultScreenOfDisplay(display_)); // re-install the ITT if necessary if (itt_) return loadITT(itt_); return storeColors(colorCells_); } /* * rotate the current colormap/ITT by the given amount */ int ImageColor::rotateColorMap(int amount) { if (!cmap_) return 0; if (!itt_) memcpy(ittCells_, colorCells_, sizeof(ittCells_)); // rotate, but reserve first and last cell cmap_->rotate(amount, ittCells_+1, colorCells_+1, colorCount_-2); if (itt_) memcpy(ittCells_, colorCells_, sizeof(ittCells_)); storeColors(colorCells_); return 0; } /* * shift the current colormap/ITT by the given amount */ int ImageColor::shiftColorMap(int amount) { if (!cmap_) return 0; // shift, but reserve first and last cell cmap_->shift(amount, colorCells_+1, ittCells_+1, colorCount_-2); storeColors(ittCells_); return 0; } /* * load an intensity transfer table (ITT) from the given file * where file contains MAX_COLOR ITT values, one per line */ int ImageColor::loadITT(char* filename) { ITTInfo* m = ITTInfo::get(filename); if (!m) return 1; return loadITT(m); } /* * load or re-load an intensity transfer table (ITT) */ int ImageColor::loadITT(ITTInfo* m) { itt_ = m; memcpy(ittCells_, colorCells_, sizeof(ittCells_)); // set the color values based on the itt map, but reserve // the first and last colors for special use m->interpolate(colorCells_+1, ittCells_+1, colorCount_-2); storeColors(ittCells_); return 0; } /* * scale (squeeze or stretch) the current colormap/ITT by the given amount */ int ImageColor::scaleITT(int amount) { if (!itt_) return 0; memcpy(ittCells_, colorCells_, sizeof(ittCells_)); // scale, but reserve first and last colors itt_->scale(amount, colorCells_+1, ittCells_+1, colorCount_-2); storeColors(ittCells_); return 0; } /* * reset colormap to original state */ int ImageColor::reset() { if (!cmap_) return 0; return loadColorMap(cmap_); } /* * If we are using a private colormap, set it for the given window. */ int ImageColor::setColormap(Tk_Window w) { if (colormap_ != defaultCmap_) Tk_SetWindowColormap(w, colormap_); return 0; } skycat-3.1.2-starlink-1b/rtd/generic/ImageColor.h000066400000000000000000000071261215713201500215420ustar00rootroot00000000000000// -*-c++-*- #ifndef _ImageColor_h_ #define _ImageColor_h_ /* * E.S.O. - VLT project * "@(#) $Id: ImageColor.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ImageColor.h - class definitions for class ImageColor * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 02/03/98 Added code to deal with none-pseudocolor * visuals. */ #include #include #include #include #include "ColorMapInfo.h" #include "ITTInfo.h" /* * An instance of this class is used to manage colors and colormaps * for RtdImage and derived widgets */ class ImageColor { private: Display* display_; // X display info Visual* visual_; // X visual int screen_; // default screen int depth_; // screen visual depth (8, 16, 24, ...) int readOnly_; // flag: true if we are using read-only colors int cmapSize_; // size of colormap Colormap defaultCmap_; // default colormap Colormap colormap_; // current colormap int colorCount_; // count of allocated colors int freeCount_; // number of colors to leave free // color pixel values unsigned long pixelval_[MAX_COLOR]; // colormap cells XColor colorCells_[MAX_COLOR]; XColor ittCells_[MAX_COLOR]; // cells after applying ITT // list of colormap info read from files ColorMapInfo* cmaps_; // current colormap ColorMapInfo* cmap_; // list of ITT info read from files ITTInfo* itts_; // current ITT ITTInfo* itt_; // keep a list of windows, whose colormaps are managed Tk_Window windowList_[126]; // status after constructor int status_; // -- private methods -- // reload existing colormap/itt int loadColorMap(ColorMapInfo*); int loadITT(ITTInfo*); int storeColors(XColor* colors); public: // constructor ImageColor(Display*, Visual*, int depth, int numColors); // member functions int numFreeColors(); int allocate(int numFreeColors); int reallocate(int numFreeColors); // load (reload) a color map from the given file int loadColorMap(char* filename); // load (reload) an ITT from the given file int loadITT(char* filename); // rotate the colormap by the given amount int rotateColorMap(int amount); // shift the colormap by the given amount int shiftColorMap(int amount); // scale the current colormap/ITT by the given amount int scaleITT(int amount); // reset colormap to original state int reset(); // start using a private colormap int usePrivateCmap(); // return true if we are using a private colormap int usingPrivateCmap() {return (colormap_ != defaultCmap_);} // if we are using a private colormap, set it for the given window int setColormap(Tk_Window); // member access int freeCount() const {return freeCount_;} int colorCount() const {return colorCount_;} unsigned long* pixelval() {return pixelval_;} unsigned long pixelval(int i) const {return pixelval_[i];} XColor* colorCells() {return itt_ ? ittCells_ : colorCells_;} int depth() const {return depth_;} const ColorMapInfo* cmap() const {return cmap_;} const ITTInfo* itt() const {return itt_;} int status() const {return status_;} int readOnly() const {return readOnly_;} // set the background color void setBackground( unsigned long pixval ) { pixelval_[0] = pixval ;} }; #endif /* _ImageColor_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/ImageData.C000066400000000000000000001324221215713201500212660ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: ImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ImageData.C - member functions for class ImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * * Peter W. Draper 02/07/96 Corrected autoSetCutLevels to set cutoff * according to number of pixels actually counted * Peter W. Draper 17/12/97 Modified setScale so that dispWidth and * dispHeight cannot be zero when using very * large negative scales (this happens for * extremely thin images, i.e. 5000x37). * * Peter W. Draper 03/02/97 Modified flip(int,int,int,int) to remove * -1 introduced by array coordinates. * Modified autoSetCutLevels to take account * of blank pixels. * * Allan Brighton 12/03/98 Removed ImageData::read, use makeImage instead, * since it allows different image types through * subclassing. * Moved WSC object (wcs_) to class ImageIO (does not * change the public interface). This makes it easier * to derive new image types or replace the WCS * implementation in a derived class of ImageIORep. * * Peter W. Draper 23/02/98 Added code to interpolate between the * autoSetCutLevels bins, increased the * number of bins to 2048 (from 256). * * Peter W. Draper 04/03/98 Added changes to support multiple display * visuals. Renamed setXImageData to setXImage. * * Peter W. Draper 13/01/99 Merged my changes into SkyCat 2.2. * pbiereic 22/03/99 Added code for bias frame * pbiereic 27/04/00 New Midas routine iqefunc.c * pbiereic 25/05/00 Added method 'fillToFit' * pbiereic 15/06/01 Added methods 'getYline4', 'getXline4', 'getBbox' and 'getMinMax' * Peter W. Draper 19/03/01 Stopped use of DATAMIN and DATAMAX * keywords, these are often incorrect, a * fact which cannot be worked around. * Peter W. Draper 30/05/01 Added support for double precision. * pbiereic 27/06/01 Added method 'noiseStatistics' * pbiereic 10/07/04 Added method 'getXline4' with specified x ranges * Peter W. Draper 08/01/07 Return a fake range in autoSetCutLevels for a * one pixel image. * pbiereic 09/10/05 fixed bug in 'getYline4' * Peter W. Draper 09/09/07 changed getIndex so that it rounds carefully * in the range 1 to -1. This clips at the image * edge, rather than one pixel further. * 16/04/08 Support xScale_ and yScale_ not having same sign * by decoupling when needed and adding a new * growAndShrink() member to handle this when * resampling/picking. * 08/07/08 When clearing in updateOffset (for zoomed images) * clear to black, not the blank color, which * can be another color. * 21/11/08 In flip do not apply the xScale>1 fudge. In fact * the limits are zero-based in getMinMax(). In * getDist treat bin width factor differently for * integers and others. Wasn't right for either case. * 23/06/09 Initialise new blankValue_ member. * 19/08/11 Make log and sqrt scalings use different * powers. This differentiates them and makes * them more like other display tools. * pbiereic 12/08/07 added support for data types double and long long int * Peter W. Draper 17/05/12 Merged skycat version for doubles created by * pbiereic. */ static const char* const rcsId="@(#) $Id: ImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include #include "error.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "Fits_IO.h" #include "fitshead.h" #include "NativeImageData.h" #include "ByteImageData.h" #include "XImageData.h" #include "ShortImageData.h" #include "UShortImageData.h" #include "LongImageData.h" #include "FloatImageData.h" #include "LongLongImageData.h" #include "DoubleImageData.h" #include "CompoundImageData.h" #include "ImageDisplay.h" // initialize static member variables // Note: these are static since there is only one static color map // or bias frame for all images of this class int ImageData::ncolors_ = 0; // number of available colors unsigned long* ImageData::colors_ = NULL; // array of color values unsigned long ImageData::color0_ = 0; // reserved color for blank pixels unsigned long ImageData::colorn_ = 0; // reserved color for saturated pixels biasINFO* ImageData::biasInfo_ = NULL; // ptr to description of bias frame // C routine used to get image statistics extern "C" { int iqe(float *pfm, float *pwm, int mx, int my, float *parm, float *sdev); } /* * constructor: initialize the image with the given name from the ImageIO * object holding the image data and description. * * If verbose is true, print debugging messages. * * lookup_size is optional and defaults to LOOKUP_SIZE (short range). It * can be specified as 256 for Byte images, for example. */ ImageData::ImageData(const char* imageName, const ImageIO& image, int verbose, int lookup_size) : image_(image), width_(image.width()), height_(image.height()), prevX_(0.0), prevY_(0.0), x0_(0), y0_(0), x1_(width_-1), y1_(height_-1), dispWidth_(width_), dispHeight_(height_), area_(width_*height_), xImage_(NULL), xImageData_(NULL), xImageBytesPerLine_(0), xImageSize_(0), xImageBytesPerPixel_(1), xImageMaxX_(width_-1), xImageMaxY_(height_-1), colorScaleType_(LINEAR_SCALE), haveBlank_(0), lowCut_(0.0), highCut_(0.0), scaledLowCut_(0), scaledHighCut_(0), scaledBlankPixelValue_(0), minValue_(0.0), maxValue_(0.0), logexpo_(6.0), sqrtexpo_(2.0), xScale_(1), yScale_(1), rotate_(0), flipX_(0), flipY_(0), startX_(0), startY_(0), binX_(1), binY_(1), prescanX_(0), prescanY_(0), overscanX_(0), overscanY_(0), crpix1_(0), crpix2_(0), subsample_(1), sampmethod_(0), update_pending_(1), verbose_(verbose), lookup_(lookup_size), clear_(0) { name(imageName); object(""); setBlank(""); } /* * copy constructor: copy the image * * Note that the classes managing the image data (ImageIO, Mem, ...) use * reference counting, so that the data is not actually copied normally, * but shared as long as possible. */ ImageData::ImageData(const ImageData& im) : image_(im.image_), width_(im.width_), height_(im.height_), prevX_(0.0), prevY_(0.0), x0_(0), y0_(0), x1_(width_-1), y1_(height_-1), dispWidth_(im.dispWidth_), dispHeight_(im.dispHeight_), area_(im.area_), xImage_(NULL), // will be set later xImageData_(NULL), xImageBytesPerLine_(0), xImageSize_(0), xImageMaxX_(0), xImageMaxY_(0), xImageBytesPerPixel_(1), colorScaleType_(im.colorScaleType_), haveBlank_(im.haveBlank_), lowCut_(im.lowCut_), highCut_(im.highCut_), scaledLowCut_(im.scaledLowCut_), scaledHighCut_(im.scaledHighCut_), scaledBlankPixelValue_(im.scaledBlankPixelValue_), minValue_(im.minValue_), maxValue_(im.maxValue_), logexpo_(im.logexpo_), sqrtexpo_(im.sqrtexpo_), xScale_(im.xScale_), yScale_(im.yScale_), rotate_(im.rotate_), flipX_(im.flipX_), flipY_(im.flipY_), startX_(im.startX_), startY_(im.startY_), binX_(im.binX_), binY_(im.binY_), prescanX_(im.prescanX_), prescanY_(im.prescanY_), overscanX_(im.overscanX_), overscanY_(im.overscanY_), crpix1_(im.crpix1_), crpix2_(im.crpix2_), subsample_(im.subsample_), sampmethod_(im.sampmethod_), update_pending_(1), verbose_(im.verbose_), lookup_(im.lookup_), clear_(0) { name(""); // new name should be set from outside object(im.object_); setBlank(im.blankValue_); } /* * Specify a new lookup table to use for this image and its size. * Note: only allowed if this is a copy of another image. */ int ImageData::lookupTable(LookupTable lookup) { if (lookup.size() != lookup_.size()) return error("warning: tried to copy lookup table with wrong size"); lookup_ = lookup; update_pending_++; return 0; } /* * This method is used to save color information for pos. later use * * Note that the first and last colors are reserved for special use: * The first color should be black and the last color can be set to * some saturation color. */ void ImageData::setColors(int ncolors, unsigned long* colors) { ncolors_ = ncolors - 2; colors_ = colors + 1; color0_ = colors[0]; colorn_ = colors[ncolors-1]; } /* * Set the destination XImage buffer and the dimensions of the XImage in * pixels. (This class copies the rawimage to xImage, doing any necessary * transformations along the way.) */ void ImageData::setXImage(ImageDisplay* xImage) { // save XImage info xImage_ = xImage; if ( xImage == NULL ) return; xImageData_ = xImage_->data(); xImageBytesPerPixel_ = xImage_->depth()/8; xImageBytesPerLine_ = xImage_->bytesPerLine(); // get XImage size in bytes xImageSize_ = xImageBytesPerLine_ * xImage_->height() * xImageBytesPerPixel_; // get the highest x,y indexes in the XImage double x = xImage_->width(); double y = xImage_->height(); undoTrans(x, y, 1); xImageMaxX_ = int(x)-1; xImageMaxY_ = int(y)-1; update_pending_++; } /* * Replace the current image data with new data of the same size and type */ void ImageData::data(const Mem& data) { image_.data(data); // make sure image is regenerated update_pending_++; } /* * Replace the current header with a new header */ void ImageData::header(const Mem& header) { // XXX reinitialize wcs() here ? image_.header(header); } /* * save the contents of this image to the given file */ int ImageData::write(const char* filename) { return image_.write(filename); } /* * Save the contents of the given region of this image to the given file. * The coordinates are expected in image pixel units. */ int ImageData::write(const char* filename, double rx0, double ry0, double rx1, double ry1) { double x0 = min(rx0,rx1), y0 = min(ry0,ry1); double x1 = max(rx0,rx1), y1 = max(ry0,ry1); int ix0, iy0, ix1, iy1; getIndex(x0, y0, ix0, iy0); getIndex(x1, y1, ix1, iy1); int w = ix1-ix0, h = iy1-iy0; // copy the original header and reset the relevant keywords const Mem& origHeader = image_.header(); int origHeaderSize = origHeader.length(); char* origHeaderPtr = (char*)origHeader.ptr(); Mem header(origHeaderSize, 0); if (header.status() != 0) return 1; // error char* head = (char*)header.ptr(); memcpy(head, origHeaderPtr, origHeaderSize); // Update the FITS keywords for the new image size. // Note: we can't use FitsIO for this, since we already have the header, // but the NAXIS keyword are wrong still, so fall back on wcssubs hget() // XXX to avoid crash for real-time images if (origHeaderSize > 0) { hlength(head, origHeaderSize); hputi4(head, "NAXIS1", w); hputcom(head, "NAXIS1", "Length X axis"); hputi4(head, "NAXIS2", h); hputcom(head, "NAXIS2", "Length Y axis"); } // update WCS keywords if needed if (origHeaderSize > 0 && wcs().isWcs()) { double cx = w/2.0, cy = h/2.0; hputr8(head, "CRPIX1", cx); hputcom(head, "CRPIX1", "Refpix of first axis"); hputr8(head, "CRPIX2", cy); hputcom(head, "CRPIX2", "Refpix of second axis"); double ra, dec; if (wcs().pix2wcs(ix0+cx, iy0+cy, ra, dec) != 0) return 1; hputr8(head, "CRVAL1", ra); hputcom(head, "CRVAL1", "RA at Ref pix in decimal degrees"); hputr8(head, "CRVAL2", dec); hputcom(head, "CRVAL2", "DEC at Ref pix in decimal degrees"); } // get and copy data for the specified image area int newDataSize = w*h*image_.pixelSize(); Mem data(newDataSize, 0); if (data.status() != 0) return 1; // error // copy the selected area copyImageArea(data.ptr(), x0, y0, w, h); // write the file so that FitsIO can edit it (keywords are incorrect still) // XXX Note: this is a bit tricky since class FitsIO is using the cfitsio // library and will complain if not editing a FITS file. FitsIO fits(w, h, image_.bitpix(), image_.bzero(), image_.bscale(), header, data); if (fits.status() != 0 || fits.write(filename) != 0) return 1; // error return 0; } /* * Make a new image from the given ImageIO object and return a pointer to * a derived class of this class specialized in that type of file/image. * * Note that pointers to classes such as FitsIO are automatically converted * to an ImageIO object through a special constructor. In this way, you can * add new image types by deriving a new classes in the same way as the * FitsIO class (from ImageIORep). * * name - is an arbitrary name for the image. * imio - is a reference to an ImageIO object for the image (or ptr, see above). * verbose - is a flag, if true, print out diagnostic messages. */ ImageData* ImageData::makeImage(const char* name, const ImageIO& imio, biasINFO* biasInfo, int verbose) { if (imio.status() != 0) return NULL; ImageData* image = NULL; // if this flag is true, use native byte order. int native = (BIGENDIAN == imio.usingNetBO()); switch (imio.bitpix()) { case BYTE_IMAGE: image = new ByteImageData(name, imio, verbose); break; case X_IMAGE: image = new XImageData(name, imio, verbose); break; case USHORT_IMAGE: if (native) image = new NativeUShortImageData(name, imio, verbose); else image = new UShortImageData(name, imio, verbose); break; case SHORT_IMAGE: if (native) image = new NativeShortImageData(name, imio, verbose); else image = new ShortImageData(name, imio, verbose); break; case LONG_IMAGE: if (native) image = new NativeLongImageData(name, imio, verbose); else image = new LongImageData(name, imio, verbose); break; case FLOAT_IMAGE: if (native) image = new NativeFloatImageData(name, imio, verbose); else image = new FloatImageData(name, imio, verbose); break; case LONGLONG_IMAGE: if (native) image = new NativeLongLongImageData(name, imio, verbose); else image = new LongLongImageData(name, imio, verbose); break; case DOUBLE_IMAGE: if (native) image = new NativeDoubleImageData(name, imio, verbose); else image = new DoubleImageData(name, imio, verbose); break; default: char buf[32]; sprintf(buf, "%d", imio.bitpix()); error("unsupported image BITPIX value: ", buf); } if (image) { image->setBiasInfo(biasInfo); return image->initImage(); } return image; } /* * Make a new compound image by combining the given image extensions * in the given ImageIO object and return a pointer to a derived class * of this class specialized in handling compound images, or null * if there is an error. * * The image extensions are combined based on the world coordinates * information in each header. An error is returned if this can't be * done. * * We only deal with FITS image extensions here, so an error is returned * if the ImageIO object is not a FITS file. * * name - is an arbitrary name for the image. * imio - is a reference to an ImageIO object for the FITS file. * hduList - is an array of image HDU indexes for the images to be combined * numHDUs - is the number of indexes in the hduList array * verbose - is a flag, if true, print out diagnostic messages. */ ImageData* ImageData::makeCompoundImage(const char* name, const ImageIO& imio, int* hduList, int numHDUs, biasINFO* biasInfo, int verbose) { ImageData* image = new CompoundImageData(name, imio, hduList, numHDUs, biasInfo, verbose); if (image) { if (image->status() != 0) { delete image; return NULL; } image->setBiasInfo(biasInfo); return image->initImage(); } return NULL; } /* * Initialize a new image. Determine the min and max pixel values, * set the default cut levels and get some keyword values that we * will need later. Returns a pointer to this image. */ ImageData* ImageData::initImage() { // See if there is a special value for blank pixels. // Note that the blank pixel value is not scaled by bscale, since // we compare pixels values with this value before scaling. initBlankPixel(); // get the values of the image keywords we need here char* s = image_.get("OBJECT"); if (s) { char* p = strchr(s, '\''); if (p) *p = '\0'; // make up for minor bug in (XXX old) wcslib - remove quotes object(s); // save object name } // save the values of CRPIX1 and CRPIX2 (for placing compound images) image_.get("CRPIX1", crpix1_, 1.); image_.get("CRPIX2", crpix2_, 1.); // save the values of DET.WIN.STRX and DET.WIN.STRY, needed to calculate // the chip coords image_.get("HIERARCH ESO DET WIN1 STRX", startX_, 1); image_.get("HIERARCH ESO DET WIN1 STRY", startY_, 1); // assume STRX and STRY start at (1,1), however we want just the offset from (0,0) startX_--; startY_--; if (startX_ < 0) startX_ = 0; if (startY_ < 0) startY_ = 0; // save the values of DET.WIN.BINX and DET.WIN.BINY for detector binning // settings for calculating the chip coordinates image_.get("HIERARCH ESO DET WIN1 BINX", binX_, 1); image_.get("HIERARCH ESO DET WIN1 BINY", binY_, 1); // assume BINX=1 and BINY=1 means no binning if (binX_ < 1) binX_ = 1; if (binY_ < 1) binY_ = 1; // save the values of DET.WIN.BINX and DET.WIN.BINY for detector binning // settings for calculating the chip coordinates image_.get("HIERARCH ESO DET OUT PRSCX", prescanX_, 0); image_.get("HIERARCH ESO DET OUT PRSCY", prescanY_, 0); image_.get("HIERARCH ESO DET OUT OVSCX", overscanX_, 0); image_.get("HIERARCH ESO DET OUT OVSCY", overscanY_, 0); if (prescanX_ < 0) prescanX_ = 0; if (prescanY_ < 0) prescanY_ = 0; if (overscanX_ < 0) overscanX_ = 0; if (overscanY_ < 0) overscanY_ = 0; // get min/max pixel and use to set default cut levels setDefaultCutLevels(); // initialize world coordinates, if the caller did not already if (! wcs().initialized()) { image_.wcsinit(); } return this; } /* * reinitialize the image after a change (such as moving to a new HDU) */ int ImageData::reinit() { initImage(); return 0; } /* * Copy the cutlevels, scale, rotate and flip parameters from the * this image to the given struct. */ void ImageData::saveParams(ImageDataParams& p) { p.status = 0; p.flipX = flipX_; p.flipY = flipY_; p.rotate = rotate_; p.xScale = xScale_; p.yScale = yScale_; p.dataType = dataType(); p.lowCut = lowCut_; p.highCut = highCut_; p.colorScale = colorScaleType_; } /* * Copy the cutlevels, scale, rotate and flip parameters from the * given struct to this image (see above). * If restoreCutLevels is non-zero (default), the saved cut-levels are restored * otherwise they are not and the cutlevels are left as they were * initialized (to the approx. min/max pixel value). */ void ImageData::restoreParams(ImageDataParams& p, int restoreCutLevels) { if (p.status != 0) return; // don't use if status != 0 flipX(p.flipX); flipY(p.flipY); rotate(p.rotate); setScale(p.xScale, p.yScale); if (restoreCutLevels && p.lowCut != p.highCut) setCutLevels(p.lowCut, p.highCut, 0); colorScaleType_ = p.colorScale; } /* * create the color scale lookup table for the image. * The arguments are: * * ncolors - the number of available colors * colors - an array of pixel values for the available colors * * The color scaling algorithm used is determined by the value of * colorScaleType_, which defaults to LINEAR_SCALE. */ void ImageData::colorScale(int ncolors, unsigned long* colors) { // save the color info for pos. later use setColors(ncolors, colors); // reset the lookup table lookup_.reset(colors_[0]); // call a method to create a lookup table for speedy access switch(colorScaleType_) { case LINEAR_SCALE: lookup_.linearScale(scaledLowCut_, scaledHighCut_, isSigned(), ncolors_, colors_); break; case LOG_SCALE: lookup_.logScale(scaledLowCut_, scaledHighCut_, isSigned(), ncolors_, colors_, logexpo_); break; case SQRT_SCALE: lookup_.sqrtScale(scaledLowCut_, scaledHighCut_, isSigned(), ncolors_, colors_, sqrtexpo_); break; case HISTEQ_SCALE: ImageDataHistogram h; getHistogram(h); lookup_.histeqScale(scaledLowCut_, scaledHighCut_, isSigned(), ncolors_, colors_, h.histogram, h.area); break; } // set value for blank pixel if (haveBlank_) lookup_.setPixelColor(scaledBlankPixelValue_, color0_); // make sure image is regenerated update_pending_++; } /* * set the scaling (zoom) factor */ void ImageData::setScale(int xScale, int yScale) { if (xScale == xScale_ && yScale == yScale_) return; xScale_ = xScale; yScale_ = yScale; if (xScale > 0) { dispWidth_ = width_ * xScale_; } else if (xScale < 0) { dispWidth_ = width_ / (-xScale_); if (dispWidth_ == 0) dispWidth_ = 1; } if (yScale > 0) { dispHeight_ = height_ * yScale_; } else if (yScale < 0) { dispHeight_ = height_ / (-yScale_); if (dispHeight_ == 0) dispHeight_ = 1; } area_ = width_*height_; if (rotate_) swap(dispWidth_, dispHeight_); update_pending_++; } /* * rotate the image by the given angle * (actually exchange the x/y axes if angle not 0) */ void ImageData::rotate(int angle) { angle = (angle != 0); // make boolean, since there is only one angle... if (rotate_ != angle) { rotate_ = angle; swap(dispWidth_, dispHeight_); swap(xImageMaxX_, xImageMaxY_); update_pending_++; } } /* * Flip the x,y coordinates according to the current transformations. * If width and height are given, they are used for flipping as needed. */ void ImageData::flip(double& x, double& y, int width, int height) { int c = (xScale_ > 1) ? 0 : 1; if (!flipY_) // raw image has y axis reversed y = ((height ? height : height_) - c) - y; if (flipX_) x = ((width ? width : width_) - c) - x; } /* * Flip both pairs of x,y coordinates according to the current transformations * and swap x0,x1 and y0,y1 resp. if flipped. */ void ImageData::flip(int& x0, int& y0, int& x1, int& y1) { // PWD: note these bounds remain in a 0,0 based system, which is // different to what is used elsewhere. if (!flipY_) { // raw image has y axis reversed int y = y0; int h = height_ - 1; y0 = h - y1; y1 = h - y; } if (flipX_) { int x = x0; int w = width_ - 1; x0 = w - x1; x1 = w - x; } } /* * apply the current transformations to the given coordinates * If distFlag is 1, x and y are treated as a distance, otherwise * they are treated as a point and flipped as needed. * If x and y offsets are specified, they are subtracted from x and y. * If width and height are given, they are used for flipping as needed. */ void ImageData::doTrans(double& x, double& y, int distFlag, double xOffset, double yOffset, int width, int height) { if (! distFlag) { // fits starts at 1,1 (0.5 is left side of pixel when zoomed) double f = (xScale_ > 1) ? 0.5 : 1.0; x -= f; y -= f; flip(x, y, width, height); x -= xOffset; y -= yOffset; } if (rotate_) swap(x, y); if (xScale_ > 1) { x *= xScale_; } else if (xScale_ < 0) { x /= -xScale_; } if (yScale_ > 1) { y *= yScale_; } else if (yScale_ < 0) { y /= -yScale_; } } /* * undo the current transformations on the given coordinates. * If distFlag is 1, x and y are treated as a distance, otherwise * they are treated as a point and flipped as needed. * If x and y offsets are specified, they are add to x and y. * If width and height are given, they are used for flipping as needed. */ void ImageData::undoTrans(double& x, double& y, int distFlag, double xOffset, double yOffset, int width, int height) { if (xScale_ > 1) { x /= xScale_; } else if (xScale_ < 0) { x *= -xScale_; } if (yScale_ > 1) { y /= yScale_; } else if (yScale_ < 0) { y *= -yScale_; } if (rotate_) swap(x, y); if (! distFlag) { x += xOffset; y += yOffset; flip(x, y, width, height); // fits starts at 1,1 (0.5 is left side of pixel when zoomed) double f = (xScale_ > 1) ? 0.5 : 1.0; x += f; y += f; } } /* * convert x,y image coords to a distance (from the origin) by flipping * where needed If width and height are given, they are used for flipping * as needed. */ void ImageData::coordsToDist(double& x, double& y, int width, int height) { // fits starts at 1,1 (0.5 is left side of pixel when zoomed) double f = (xScale_ > 1) ? 0.5 : 1.0; x -= f; y -= f; flip(x, y, width, height); } /* * convert an x,y distance (from the origin) to x,y image coords by * flipping where needed If width and height are given, they are used for * flipping as needed. */ void ImageData::distToCoords(double& x, double& y, int width, int height) { flip(x, y, width, height); // fits starts at 1,1 (0.5 is left side of pixel when zoomed) double f = (xScale_ > 1) ? 0.5 : 1.0; x += f; y += f; } /* * Convert the given image coordinates to detector chip/CCD coordinates. * While image coordinates start at 1,1 (.5,.5), chip coordinates might * have a different origin and/or binning. The the member variables * startX_ and startY_ give the offsets of the image origin. These are * set from the FITS keywords HIERARCH ESO DET WIN1 STRX and STRY, if * found, but may also be set via member methods. */ void ImageData::imageToChipCoords(double& x, double& y) { x = x * binX_ + startX_; y = y * binY_ + startY_; } /* * Convert the given detector chip/CCD coordinates to image coordinates. * (see comments above for imageToChipCoords). */ void ImageData::chipToImageCoords(double& x, double& y) { x = (x - startX_) / binX_; y = (y - startY_) / binY_; } /* * single argument versions of the above methods */ void ImageData::imageToChipCoords(double& x) { x += startX_; } void ImageData::chipToImageCoords(double& x) { x -= startX_; } /* * Convert floating point image coords to integer image array index. * (Image coords start at 1,1 at mag 1, array index is 0,0...) * * Return 0 if the index is in range, 1 otherwise. */ int ImageData::getIndex(double x, double y, int& ix, int& iy) { // get integer index in raw image for pixel value if (xScale_ > 1) { ix = int(x+0.5)-1; iy = int(y+0.5)-1; } else { ix = int(x-1.0); iy = int(y-1.0); } // return 0 if in range, otherwise 1 return (ix < 0 || iy < 0 || ix >= width_ || iy >= height_); //return 0; } /* * set the scaling factor so that the image will fit in the given box */ void ImageData::shrinkToFit(int width, int height) { int factor = -max((width_-1)/width+1, (height_-1)/height+1); if (factor >= -1) factor = 1; setScale(factor, factor); } /* * set the scaling factor so that the image will fill the given box */ void ImageData::fillToFit(int width, int height) { if (width_ <= 2 || height_ <=2) return; int factor = min(width/width_, height/height_); if (factor == 0) shrinkToFit(width, height); else setScale(factor, factor); } /* * set the default cut levels for the image to the min/max pixel * value. If DATAMIN and DATAMAX are defined in the FITS header, * use them, otherwise scan the image for the approx. min/max * values. * * PWD: remove DATAMIN and DATAMAX dependence. When these are * incorrect (happens too often) there's no way around it. */ void ImageData::setDefaultCutLevels() { // double d1, d2; // if (image_.get("DATAMIN", d1) == 0 && image_.get("DATAMAX", d2) == 0 && d1 < d2) { // // note that DATAMIN and MAX are AFTER adding bzero and multiplying // // by bscale. We only use these values to display to the user, but // // not internally, since we are going to scale everything to bytes // // in the end anyway. // minValue_ = unScaleValue(d1); // maxValue_ = unScaleValue(d2); // } // else { // scan image for min/max pixel value. Note that at this point, // we don't know how much of the image we will actually display, // so if the image is really huge, just take a 1k x 1k area in // the center. int xc = width_/2, yc = height_/2; if (xc > 512) { x0_ = xc-512; x1_ = xc+512; } if (yc > 512) { y0_ = yc-512; y1_ = yc+512; } getMinMax(); // } // set default cut levels setCutLevels(minValue_, maxValue_, 0); } /* * set the cut levels to the given values. * If scaled is 1, the low and high values should be already "scaled" with * bzero and bscale. */ void ImageData::setCutLevels(double low, double high, int scaled) { if (scaled) { highCut_ = unScaleValue(high); lowCut_ = unScaleValue(low); } else { highCut_ = high; lowCut_ = low; } // initialize conversion from base type to short, // used by color scaling algorithms as index in lookup table initShortConversion(); // make sure image is re-made update_pending_++; } /* * scan the image to find the distribution of pixel values * and set the cut levels so that the given percent of pixels * are within the low and high cut values. */ void ImageData::autoSetCutLevels(double percent) { // set initial default values getMinMax(); // get min/max pixel estimate for visible area double low = minValue_; double high = maxValue_; // xyvalues is an array of X,Y pairs where: // the X values are the pixel values (rounded to nearest factor) // the Y values are the number of pixels in a given range int numValues = 2048; double xyvalues[2048*2]; // get a rough distribution of the data getDist(numValues, xyvalues); // find out how many pixel we actually counted (may be significant // numbers of blanks) int npixels = 0; int i; for (i=0 ; i 0 ) { // change percent to cut off and split between low and high int cutoff = int((double(npixels)*(100.0-percent)/100.0)/2.0); // set low cut value npixels = 0; int nprev = 0; for (i=0 ; i= cutoff) { low = xyvalues[i*2]; if ( i != 0 ) { // Interpolate between the relevant bins. double interp = (double(cutoff)-double(nprev))/(double(npixels)-double(nprev)); low = xyvalues[(i-1)*2] + (low-xyvalues[(i-1)*2])*interp; } break; } } // set high cut value npixels = 0; nprev = 0; for (i=numValues-1 ; i>=0; i--) { nprev = npixels; npixels += (int)(xyvalues[i*2+1]); if (npixels >= cutoff) { high = xyvalues[i*2]; if ( i != numValues-1 ) { // Interpolate between the relevant bins. double interp = (double(cutoff)-double(nprev))/(double(npixels)-double(nprev)); high = xyvalues[(i+1)*2] + (xyvalues[(i+1)*2]-high)*interp; } break; } } } else { // Fake a range when there are no valid pixels (or just one). high = maxValue_ + 1.0; low = minValue_ - 1.0;; } if (high > low) setCutLevels(low, high, 1); } /* * Update the entire X image data, if necessary, from the raw data, * with transformations */ void ImageData::update() { if (xImage_ && update_pending_ && width_ > 0 && height_ > 0) { toXImage(0, 0, width_-1, height_-1, 0, 0); } } /* * Update the X image area starting at the given offset and continuing * to the end of the raw image or the end of the X image data, which * ever comes first. * * (This method is used when the X Image is the same size as the visible * window (or image, if smaller) and displays the part of the image at * some x,y scroll offset.) */ void ImageData::updateOffset(double x, double y) { if (!xImage_ || width_ <= 0 || height_ <= 0 || (update_pending_ == 0 && x == prevX_ && y == prevY_)) return; if (clear_) { // temp clear image xImage_->clear(0); // PWD: clear to black, not blank pixel color. clear_ = 0; return; } prevX_ = x; prevY_ = y; int x0 = int(x), y0 = int(y), x1 = width_-1, y1 = height_-1, dest_x = 0, dest_y = 0; // handle case where x0,y0 are negative (i.e.: image starts in the // middle of the window somewhere rather than the window starting at // the middle of the image) if (x < 0) { dest_x = -x0 + 1; x0 = 0; } if (y < 0) { dest_y = -y0 + 1; y0 = 0; } // we have to clear out the XImage if the new image doesn't cover it // up completely if (dest_x || dest_y || x1-x0 < xImageMaxX_ || y1-y0 < xImageMaxY_) { // if (verbose_) // printf("%s: clear ximage before update\n", name_); xImage_->clear(0); // PWD: clear to black, not blank pixel color. } // copy raw to X image while doing transformations toXImage(x0, y0, x1, y1, dest_x, dest_y); } /* * Clip and set the bounds of the visible portion of the image (x0_, y0_, x1_, y1_). * These are used by some operations, such as getMinMax() to save time. */ void ImageData::setBounds(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { int maxx = width_ - 1, maxy = height_ - 1; x0_ = min(max(x0, 0), maxx); y0_ = min(max(y0, 0), maxy); x1_ = min(min(x1, maxx), x0_ + xImageMaxX_ - dest_x); y1_ = min(min(y1, maxy), y0_ + xImageMaxY_ - dest_y); } /* * copy the raw image to the xImage, doing any transformations as * necessary. * * The arguments x0, y0, x1 and y1 are the bounding box of the region of * the raw image that needs to be copied (origin at (0,0)) * * dest_x and dest_y give the coordinates in the XImage where copying * should start. These are normally either (-x0,-y0) or (0,0). * * This method adjust the coordinates, if necessary and then calls * the virtual methods in derived classes to do the real work. */ void ImageData::toXImage(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { // no bias subtraction for colorramp int biasOn = biasInfo_->on; if (strcmp(this->name(), "Ramp") == 0) biasInfo_->on = 0; // set and clip the member variables x0_, y0_, x1_, y1_ setBounds(x0, y0, x1, y1, dest_x, dest_y); if (x0 > x1 || y0 > y1) return; // copy the relevant area of the raw image to the X image if ( (xScale_ == 0 || xScale_ == 1) && (yScale_ == 0 || yScale_ == 1) ) { rawToXImage(x0_, y0_, x1_, y1_, dest_x, dest_y); } else if ( (xScale_ > 1 && yScale_ >= 1) || (xScale_ >= 1 && yScale_ > 1) ) { grow(x0_, y0_, x1_, y1_, dest_x, dest_y); } else if (xScale_ < 0 && yScale_ < 0) { shrink(x0_, y0_, x1_, y1_, dest_x, dest_y); } else { growAndShrink(x0_, y0_, x1_, y1_, dest_x, dest_y); } // x0_, y0_, x1_ and y1_ are the coordinates of the visible part of // the image and are needed later for setting cut levels and calculating // the min/max pixel for the displayed image area. The display routines // called above (rawToXImage, grow, shrink) expect the coordinates to have // the origin at upper left (0,0) (XImage type coordinates), while the rest // of the code deals with FITS image coordinates (origin at lower left (1, 1)). flip(x0_, y0_, x1_, y1_); update_pending_ = 0; biasInfo_->on = biasOn; } /* * scan the raw image along the line (x0,y0) to (x1,y1) (image coords) * and generate an array with (index, pixel value) information. * * Return the number of (index,value) pairs generated for the line. * */ int ImageData::getSpectrum(double* xyvalues, int x0, int y0, int x1, int y1) { int i = 0; if (y1 == y0) { // horizontal line int startx = min(x0, x1); int endx = max(x0, x1); for (int x = startx; x <= endx; x++) { xyvalues[i*2] = i; xyvalues[i*2+1] = getValue(x, y0); i++; } return i; } if (x1 == x0) { // vertical line int starty = min(y0, y1); int endy = max(y0, y1); for (int y = starty; y <= endy; y++) { xyvalues[i*2] = i; xyvalues[i*2+1] = getValue(x0, y); i++; } return i; } // sloped line // use Bresenham midpoint line scan-conversion algorithm // see: Computer Graphics Princ. a. Pract., 2nd Ed., p. 78 // also see x11r5/mit/server/ddx/cfb/cfbline.c, cfbbres.c int x = x0; int y = y0; int e, e1, e2, e3; // bresenham error and increments int len; // length of segment int adx = x1 - x0; // abs values of dx and dy int ady = y1 - y0; int signdx = 1; // sign of dx and dy int signdy = 1; if (adx < 0) { adx = -adx; signdx = -1; } if (ady < 0) { ady = -ady; signdy = -1; } // start pixel xyvalues[i*2] = i; xyvalues[i*2+1] = getValue(x, y); i++; if (adx > ady) { // X major axis; e1 = ady << 1; e2 = e1 - (adx << 1); e3 = e2 - e1; e = -adx; len = adx; while (len--) { e += e1; x += signdx; if (e >= 0) { y += signdy; e += e3; } xyvalues[i*2] = i; xyvalues[i*2+1] = getValue(x, y); i++; } } else { // Y major axis e1 = adx << 1; e2 = e1 - (ady << 1); e3 = e2 - e1; e = -ady; len = ady; while(len--) { e += e1; y += signdy; if (e >= 0) { x += signdx; e += e3; } xyvalues[i*2] = i; xyvalues[i*2+1] = getValue(x, y); i++; } } // return the number of (index,value) pairs generated return i; } /* * get statistics on specified area of image by calling the function * "iqe" (Image Quality Estimate) and passing it the requested part * of the image as an array of doubles. * * x,y - are the x and y offsets in image coords in the image * w,h - indicate the size of the image square to examine * * The rest of the values are return parameters passed back from 'iqe': * * meanX = mean X position within array, first pixel = 0 * meanY = mean Y position within array, first pixel = 0 * fwhmX = FWHM in X * fwhmY = FWHM in Y * symetryAngle = angle of major axis, degrees, along X = 0 * objectPeak = peak value of object above background * meanBackground = mean background level * * The return value is 0 if all is OK. */ int ImageData::getStatistics(double x, double y, int w, int h, double& meanX, double& meanY, double& fwhmX, double& fwhmY, double& symetryAngle, double& objectPeak, double& meanBackground) { // Get the image data for the area into an array. // Use floats because the midas C routines use them... float* ar = new float[w*h]; getValues(x, y, w, h, ar); float parm[8], sdev[8]; // The old Midas routine had an "array out of bounds" which crashed rtd. // The new one has been checked with Purify. int status = (iqe(ar, NULL, w, h, parm, sdev) != 0); delete []ar; meanX = parm[0]; meanY = parm[2]; fwhmX = parm[1]; fwhmY = parm[3]; symetryAngle = parm[4]; objectPeak = parm[5]; meanBackground = parm[6]; if (status != 0) error("Could not calculate statistics on specified area of image. Please make another selection."); return status; } /* * get noise statistics on specified area of the image. * * x0,y0 - is the lower left corner of the image * w,h - indicate the size of the image to examine * * Returns: * dmin = minimum value * dmax = maximum value * av = average value * rms = RMS value * n = number of samples used * xs, ys = lower left corner (image coordinates) of area * xe, ye = upper right corner (image coordinates) of area * * The return value of the method is 0 if all is OK. */ int ImageData::noiseStatistics(double rx0, double ry0, int w, int h, double *dmin, double *dmax, double *av, double *rms, int *xs, int *xe, int *ys, int *ye) { int ix, iy, numVal = 0; double x0 = 0., y0 = 0., minv, maxv, cv, sum = 0., sumsq = 0.; minv = maxv = getValue(rx0, ry0); for (int y = 0; y < h ; y++) { y0 = ry0 + y; for (int x = 0; x < w; x++) { x0 = rx0 + x; if (getIndex(x0, y0, ix, iy) != 0) continue; if (numVal == 0) { *xs = (int)x0; *ys = (int)y0; } numVal++; cv = getValue(x0, y0); sum += cv; sumsq += cv * cv; if (cv < minv) minv = cv; if (cv > maxv) maxv = cv; } } *xe = (int)x0; *ye = (int)y0; *dmin = minv; *dmax = maxv; *av = sum / numVal; *rms = sqrt(sumsq / numVal - *av * *av); return numVal; } /* * scan the image and generate X,Y values to show the distribution of * pixel values in the image. "numValues" is the max number of X,Y pairs * to put in xyvalues (if there are not enough values, numValues is modified * to reflect the actual, smaller number of values) */ void ImageData::getDist(int& numValues, double* xyvalues) { double n = maxValue_ - minValue_; if (n <= 0) { numValues = 0; return; } // PWD: for integers we have a bin per-value, that requires n+1. double factor; if (n < numValues && ( dataType() != FLOAT_IMAGE && dataType() != DOUBLE_IMAGE ) ) { numValues = int(n + 1); factor = (n + 1)/numValues; } else { // PWD: for floating point values to get from min to max. factor = n/(numValues-1); } // the X values are the pixel values double m = minValue_; for (int i=0; i= 0.0) getPixDist(numValues, xyvalues, factor); } /* * Return the image coords of the visible image area (bounding box) */ void ImageData::getBbox(double *x0, double *x1, double *y0, double *y1) { *x0 = x0_ + 0.5; *x1 = x1_ + 0.5; *y0 = y0_ + 0.5; *y1 = y1_ + 0.5; } /* * Get meander coords of a horizontal line at position y (origin starting at 0.5). * The size of vector xyvalues must be allocated 4 times the size of the line. */ int ImageData::getXline4(int y, int from, int to, double *xyvalues) { int ix, iy, numVal = 0; double cy; for (int x = from; x <= to; x++, numVal++) { if (getIndex(x, y, ix, iy) != 0) continue; cy = getValue(x, y); // y axis value *xyvalues++ = (double) x - 0.5; // x axis value *xyvalues++ = cy; *xyvalues++ = (double) x + 0.5; *xyvalues++ = cy; } return numVal; } /* * Same as getXline4 but with specified x range (start xr0, delta dxr) */ int ImageData::getXline4(int y, int from, int to, double *xyvalues, double xr0, double dxr) { int ix, iy, numVal = 0; double cy, xr = xr0, dx = dxr/2.0; for (int x = from; x <= to; x++, xr += dxr, numVal++) { if (getIndex(x, y, ix, iy) != 0) continue; cy = getValue(x, y); // y axis value *xyvalues++ = (double) xr - dx; // x axis value *xyvalues++ = cy; *xyvalues++ = (double) xr + dx; *xyvalues++ = cy; } return numVal; } /* * Get min/max values on a specified area of the image (origin at (1,1)) */ int ImageData::getMinMax(double rx0, double ry0, int w, int h, double *minval, double *maxval) { int ix, iy, numVal = 0; double x0, y0, minv, maxv, cv; minv = maxv = getValue(rx0, ry0); for (int y = 0; y < h ; y++) { y0 = ry0 + y; for (int x = 0; x < w; x++) { x0 = rx0 + x; if (getIndex(x0, y0, ix, iy) != 0) continue; numVal++; cv = getValue(x0, y0); if (cv < minv) minv = cv; if (cv > maxv) maxv = cv; } } *minval = minv; *maxval = maxv; return numVal; } /* * get meander coords of a vertical line at position x (index starting at 0) */ int ImageData::getYline4(int x, int y0, int y1, double *xyvalues) { int numVal = 0; double cx; if (x < 0 || x >= width_ || y0 < 0 || y0 >= height_ || y1 < 0 || y1 >= height_) return 0; for (int y = y0; y < y1; y++, numVal++) { cx = getValue(x, y); // y axis value *xyvalues++ = (double) y - 0.5; // x axis value *xyvalues++ = cx; *xyvalues++ = (double) y + 0.5; *xyvalues++ = cx; } return numVal; } /* * Initialize flag for speeding up bias subtraction */ void ImageData::initGetVal() { biasINFO* bias = ImageData::biasInfo_; bias->sameTypeAndDims = (bias->width == width_ && bias->height == height_ && bias->type == dataType()); /* * if the byte order of the main- and bias frame is different * then set a flag to swap the bytes of the bias frame. */ bias_swap_bytes_ = (bias->usingNetBO != BIGENDIAN); } skycat-3.1.2-starlink-1b/rtd/generic/ImageData.h000066400000000000000000000523031215713201500213320ustar00rootroot00000000000000#ifndef _ImageData_h_ #define _ImageData_h_ /* * E.S.O. - VLT project * "@(#) $Id: ImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Image.h - class definitions for drawing images in Tk/Tcl * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * * T. Herlin 06/12/95 Added set_object for camera objects * * Allan Brighton 12/03/98 Removed ImageData::read, use makeImage instead, * since it allows different image types through * subclassing. * Moved WSC object (wcs_) to class ImageIO (does not * change the public interface). This makes it easier * to derive new image types or replace the WCS * implementation in a derived class of ImageIORep. * P.W. Draper 03/03/98 Added changes for display depths > 8 bits. * 14/07/98 Added LOOKUP_BLANK to use last bin for * blank pixel (otherwise comes out at * scaled colour). * pbiereic 22/03/99 Added parameters for bias frame * P.W. Draper 12/07/99 Added haveBlank() and getBlank() members * to allow return of blank_ value as a double. * pbiereic 25/05/00 Added method 'fillToFit' * pbiereic 27/06/01 Added method 'noiseStatistics' * pbiereic 10/02/03 Native byte order routines revised * P.W. Draper 16/01/07 Make sure object_ is null terminated. * 24/04/08 Added growAndShrink(). * 19/06/09 Add setBlank member to handle case when BLANK * isn't set, but should be. * 19 Aug 11 Make log and sqrt scalings use different * powers. This differentiates them and makes * them more like other display tools. */ #include #include #include "WCSRep.h" #include "LookupTable.h" #include "ImageIO.h" #include "ImageDisplay.h" #ifndef isnan #define isnan(x) ((x) != (x)) #endif typedef unsigned char byte; // type of XImage data (no longer ...) struct ImageDataParams; // forward ref struct ImageDataHistogram; // forward ref typedef struct { int on; // flag for bias subtraction on/off char* ptr; // pointer to bias data int width; // width of bias frame int height; // height of bias frame int type; // data type int usingNetBO; // byte ordering int sameTypeAndDims; // same image type and dimensions, flag } biasINFO; /* * This is the base class for managing image data. There is a subclass for * each of the base data types (byte, short, ushort, int, float). Most * of the methods are the same for each data type, any many are implemented * in ImageTemplates.icc, which uses macros to avoid duplicating code * for each data type. * * CompoundImageData is used when there are multiple FITS extensions that * should be displayed as a single image. It is a friend class, since it * needs to access some protected members in an array of ImageData objects. */ class ImageData { friend class CompoundImageData; public: // types of color scaling enum ImageColorScaleType { LINEAR_SCALE, // linear scale LOG_SCALE, // logarithmic or exponential scale SQRT_SCALE, // square root scale HISTEQ_SCALE // histogram equalization }; // values for color lookup table (from saoimage) enum { LOOKUP_SIZE = 65536, // default size of buffer (full range of short 0x10000) LOOKUP_WIDTH = 65534, // range of image values allowed in histogram LOOKUP_MIN = -32767, // minimum image value allowed LOOKUP_MAX = 32767, // maximum image value allowed LOOKUP_OFF = 32768, // offset from allocated array to zero (0x8000) LOOKUP_BLANK = -32768 // end bin for blank pixel }; protected: // arbitrary name of this image, used to identify the image in messages char name_[32]; // status after constructor int status_; // pointers to the caller's XImage and data, which this class writes to ImageDisplay* xImage_; byte* xImageData_; // this represents the contents of the image file or other source // (uses reference counting so we can share this with other views) ImageIO image_; // dimensions of image in pixels int width_, height_; // value in "OBJECT" header field: name of astronomical object char object_[81]; // saved x, y values from last call to updateOffset(x, y) double prevX_, prevY_; // saved bounding box in raw image array of last image update // (used later for calculating cut levels) int x0_, y0_, x1_, y1_; // XImage info int xImageBytesPerLine_; int xImageSize_; // size in bytes = width*height*bytesPerPixel int xImageBytesPerPixel_; // Number of bytes per pixel in xImage (1 for 8 // bit displays). // max x image x,y coords scaled to image coords int xImageMaxX_, xImageMaxY_; // lookup table mapping unsigned short to byte LookupTable lookup_; // type of color scaling to do ImageColorScaleType colorScaleType_; // these can be static for now, since all images share a static colormap static int ncolors_; // number of available colors static unsigned long* colors_; // array of color values static unsigned long color0_; // reserved color for black pixels static unsigned long colorn_; // reserved color for saturated pixels static biasINFO* biasInfo_; // description of bias frame int bias_swap_bytes_; // flag: if true, bytes swap is needed int clear_; // flag: if true, clear out the image once // minimum and maximum pixel values double minValue_; double maxValue_; // color cut values and blank pixel value scaled to short (or ushort) // range. Used in color scaling algorithms to generate lookup table int scaledHighCut_; int scaledLowCut_; int scaledBlankPixelValue_; int haveBlank_; // flag: true if the BLANK keyword was found char blankValue_[32]; // character string with BLANK value // color cut values double highCut_; double lowCut_; // min image value scaled to short or ushort range // (used in color scaling algorithms to generate lookup table) int scaledMinValue_; // optional exponents for LOGARITHMIC and SQRT color scale (def: 6 & 2) double logexpo_; double sqrtexpo_; // X,Y amount image should be scaled int xScale_, yScale_; // flag: true if x and y coords should be swapped (rotate 90 deg.) int rotate_; // flag: true if image should be flipped in the X or Y direction int flipX_, flipY_; // values from ESO/VLT FITS keywords used to calculate detector coordinates. int startX_, startY_; int binX_, binY_; int prescanX_, prescanY_; int overscanX_, overscanY_; // CRPIX values from the FITS header double crpix1_, crpix2_; // display width and height (after scaling) int dispWidth_, dispHeight_; // area of image = width_ * height_ int area_; // flag: true when the image needs updating int update_pending_; // flag: if true, do a quick dirty job when shrinking image int subsample_; // sampling method int sampmethod_; // flag: if true, print diagnostic messages int verbose_; protected: // check args and call virtual methods to copy raw data to xImage virtual void toXImage(int x0, int y0, int x1, int y1, int dest_x, int dest_y); // Clip and set the bounds of the visible portion of the image (x0_, y0_, x1_, y1_). virtual void setBounds(int x0, int y0, int x1, int y1, int dest_x, int dest_y); // copy raw data to xImage, pos. with transformations (defined in derived class) virtual void rawToXImage(int x0, int y0, int x1, int y1, int dest_x, int dest_y) = 0; virtual void shrink(int x0, int y0, int x1, int y1, int dest_x, int dest_y) = 0; virtual void grow(int x0, int y0, int x1, int y1, int dest_x, int dest_y) = 0; virtual void growAndShrink(int x0, int y0, int x1, int y1, int dest_x, int dest_y) = 0; // initialize conversion from base type to short, // used by color scaling algorithms as index in lookup table // (defined in a derived class, not needed for byte images) virtual void initShortConversion() = 0; // scan the image for the min and max values virtual void getMinMax() = 0; // flip x,y coords about default or specified image width,height void flip(double& x, double& y, int width = 0, int height = 0); void flip(int& x0, int& y0, int& x1, int& y1); // apply bzero and bscale to the value double scaleValue(double d) {return image_.scaleValue(d);} // reverse the effect of bzero and bscale double unScaleValue(double d) {return image_.unScaleValue(d);} // get pixel value distribution info (internal version) virtual void getPixDist(int numValues, double* xyvalues, double factor) = 0; // Fill the given histogram with the distribution of pixels in the // visible image area virtual void getHistogram(ImageDataHistogram&) = 0; // set default cut levels to min/max pixel values void setDefaultCutLevels(); // initialize a new image, set default cut levels, etc. virtual ImageData* initImage(); // constructor (only called by derived clases) ImageData(const char* name, const ImageIO&, int verbose, int lookup_size = LOOKUP_SIZE); // copy constructor (called by copy() member function) ImageData(const ImageData&); public: // destructor virtual ~ImageData() {} // return class name as a string virtual const char* classname() { return "ImageData"; } // save image to a file int write(const char* filename); // Save the contents of the given region of this image to the given file. // The coordinates are expected in image pixel units. virtual int write(const char* filename, double x0, double y0, double x1, double y1); // return a pointer to a derived class of this class specialized in the given // type of image, as given by the ImageIO reference. // Note: ImageIO is a reference counted class. New image types can be added // by subclassing the internal class ImageIORep. static ImageData* makeImage(const char* name, const ImageIO&, biasINFO* biasInfo, int verbose = 0); // Make a new compound image by combining the given image extensions // in the given ImageIO object and return a pointer to a derived class // of this class specialized in handling compound images, or null // if there is an error. static ImageData* makeCompoundImage(const char* name, const ImageIO& imio, int* hduList, int numHDUs, biasINFO* biasInfo, int verbose); // reinitialize the image after a change (such as moving to a new HDU) int reinit(); // apply/reverse transformations on coordinates (scale, rotate, flip, etc...) void doTrans(double& x, double& y, int distFlag = 0, double xOffset = 0.0, double yOffset = 0.0, int width = 0, int height = 0); void undoTrans(double& x, double& y, int distFlag = 0, double xOffset = 0.0, double yOffset = 0.0, int width = 0, int height = 0); // convert x,y coords to a distance by flipping where needed void coordsToDist(double& x, double& y, int width = 0, int height = 0); // convert distance to coords (reverse of above) void distToCoords(double& x, double& y, int width = 0, int height = 0); // Convert the given image coordinates to detector chip/CCD coordinates. void imageToChipCoords(double& x, double& y); // Convert the given detector chip/CCD coordinates to image coordinates. void chipToImageCoords(double& x, double& y); // single arg versions of the above methods void imageToChipCoords(double& x); void chipToImageCoords(double& x); // get pixel index from image coords int getIndex(double x, double y, int& ix, int& iy); // set the destination X image buffer, dimensions and raw image offset virtual void setXImage(ImageDisplay* xImage); // set the scaling factor virtual void setScale(int xScale, int yScale); // set the scaling factor so that the image will fit in the given box void shrinkToFit(int width, int height); // set the scaling factor so that the image will fill the given box void fillToFit(int width, int height); // update the entire image from the raw image if necessary void update(); // update image from raw data starting at the given x,y offset virtual void updateOffset(double x, double y); // get array with information about the pixel value distribution void getDist(int& numValues, double* xyvalues); // initialize flag for speeding up bias subtraction void initGetVal(); // scan the image along the given line and generate an array // with pixel value information int getSpectrum(double* xyvalues, int x0, int y0, int x1, int y1); // get meander coords of a horizontal line at position y (index starting at 0) int getXline4(int y, int x0, int x1, double *xyvalues); // same as getXline4 but with specified x ranges (start xr0, delta dxr) int getXline4(int y, int x0, int x1, double *xyvalues, double xr0, double dxr); // get meander coords of a vertical line at position x (index starting at 0) int getYline4(int x, int y0, int y1, double *xyvalues); // Return the image coords of the visible image area (bounding box) void getBbox(double *x0, double *x1, double *y0, double *y1); // get min and max values of an image area int getMinMax(double rx0, double ry0, int w, int h, double *minval, double *maxval); // manually set the cut levels (if scaled is true, min and max are "bscaled") virtual void setCutLevels(double min, double max, int scaled); // automatically set the cut levels to leave percent visible virtual void autoSetCutLevels(double percent = 98.0); // automatically set the cut levels using median filtering virtual void medianFilter() {} // set the colors to use for the image virtual void colorScale(int ncolors, unsigned long* colors); // return the type of the raw data virtual int dataType() = 0; // return true if the data type is signed virtual int isSigned() = 0; // return a copy of the image virtual ImageData* copy() = 0; // save/restore transformation parameters virtual void saveParams(ImageDataParams&); virtual void restoreParams(ImageDataParams&, int restoreCutLevels = 1); // print x,y coords and raw data value at x,y coords to buffer virtual char* getValue(char* buf, double x, double y) = 0; // print the values at the given x,y coords to the buffers for display virtual void getValues(double x, double y, double rx, double ry, char* xStr, char* yStr, char* valueStr, char* raStr, char* decStr, char* equinoxStr) = 0; // get array of image pixel values and x,y coords around a point virtual void getValues(double x, double y, double rx, double ry, double* ar, int nrows, int ncols, int flag = 0) = 0; // get array of image pixel values at a given offset with given dimensions virtual void getValues(double x, double y, int w, int h, float* ar, int flag = 0) = 0; // return the value at the x,y coords as a double virtual double getValue(double x, double y) = 0; // Copy raw image data from this image to the given image data area, // starting at the image coordinates (x, y) and with the dimentions (w, h) // in pixels. Since this is a copy from one raw image to another, no // data conversion is done. virtual void copyImageArea(void* data, double x, double y, int w, int h) = 0; // get statistics for "pick object" on a specified area of the image virtual int getStatistics(double x, double y, int w, int h, double& meanX, double& meanY, double& fwhmX, double& fwhmY, double& symetryAngle, double& objectPeak, double& meanBackground); // get noise statistics on a specified area of the image virtual int noiseStatistics(double rx0, double ry0, int w, int h, double *dmin, double *dmax, double *av, double *rms, int *xs, int *xe, int *ys, int *ye); // member access int status() {return status_;} // get the image data or header Mem& data() {return (Mem&)image_.data();} Mem& header() {return (Mem&)image_.header();} // write a (ASCII formatted) copy of the FITS header to the given stream int getFitsHeader(ostream& os) {return image_.getFitsHeader(os); } // set new data or header void data(const Mem& data); void header(const Mem& header); // access the world coordinate info object for the image WCS& wcs() {return image_.wcs();} ImageDisplay* xImage() {return xImage_;} const ImageIO& image() {return image_;} void colorScaleType(ImageColorScaleType t) {colorScaleType_ = t;} ImageColorScaleType colorScaleType() {return colorScaleType_;} int ncolors() {return ncolors_;} unsigned long* colors() {return colors_;} unsigned long color0() {return color0_;} unsigned long colorn() {return colorn_;} virtual void setColors(int ncolors, unsigned long* colors); void setBiasInfo(biasINFO* ptr) {biasInfo_ = ptr;} void logexpo(double e) {logexpo_ = e;} double logexpo() {return logexpo_;} void sqrtexpo(double e) {sqrtexpo_ = e;} double sqrtexpo() {return sqrtexpo_;} int width() {return width_;} int height() {return height_;} int dispWidth() {return dispWidth_;} int dispHeight() {return dispHeight_;} int xScale() {return xScale_;} int yScale() {return yScale_;} int flipX() {return flipX_;} virtual void flipX(int b) {flipX_ = (b != 0); update_pending_++;} int flipY() {return flipY_;} virtual void flipY(int b) {flipY_ = (b != 0); update_pending_++;} int rotate() {return rotate_;} virtual void rotate(int); double crpix1() {return crpix1_;} double crpix2() {return crpix2_;} int startX() {return startX_;} int startY() {return startY_;} void startX(int x) {startX_ = x;} void startY(int y) {startY_ = y;} int binX() {return binX_;} int binY() {return binY_;} void binX(int x) {binX_ = x;} void binY(int y) {binY_ = y;} int prescanX() {return prescanX_;} int prescanY() {return prescanY_;} void prescanX(int x) {prescanX_ = x;} void prescanY(int y) {prescanY_ = y;} int overscanX() {return overscanX_;} int overscanY() {return overscanY_;} void overscanX(int x) {overscanX_ = x;} void overscanY(int y) {overscanY_ = y;} virtual double highCut() {return scaleValue(highCut_);} virtual double lowCut() {return scaleValue(lowCut_);} virtual double minValue() {return scaleValue(minValue_);} virtual double maxValue() {return scaleValue(maxValue_);} virtual void subsample(int b) {subsample_ = b;} virtual int subsample() {return subsample_;} virtual void sampmethod(int b) {sampmethod_ = b;} virtual int sampmethod() {return sampmethod_;} virtual int getNumImages() {return 1;} virtual void verbose(int b) {verbose_ = b;} virtual void name(const char* name) {strncpy(name_, name, sizeof(name_)-1);} char* name() {return name_;} virtual void object(const char *object) { strncpy(object_, object, sizeof(object_)); object_[80] = '\0'; } char* object() {return object_;} int update_pending() {return update_pending_;} void update_pending(int b) {update_pending_ = b;} LookupTable lookupTable() {return lookup_;} virtual int lookupTable(LookupTable); void clear() {clear_ = 1; update_pending_++;} // return the blank value as a double virtual double getBlank() = 0; virtual int haveBlank() = 0; // If there is a special value for blank pixels, get it and set the // values of haveBlankPixel_ and scaledBlankPixelValue_. virtual void initBlankPixel() = 0; // set the blank value string void setBlank(const char* value) { strncpy(blankValue_, value, sizeof(blankValue_)-1); } }; // struct used to save transformation parameters of image for use in new image struct ImageDataParams { int status; // only restore if status is 0 int flipX, flipY; // true if image is flipped int rotate; // true if x,y axis swapped int xScale, yScale; // scale factors int dataType; // data type of image data double lowCut, highCut; // cut levels ImageData::ImageColorScaleType colorScale; // color scale type // constructor ImageDataParams() : status(1) {} }; // struct used to generate a histogram of the image data, where the pixels // are first converted to shorts. struct ImageDataHistogram { int histogram[ImageData::LOOKUP_SIZE]; // count of pixels having this value // after conversion to short int area; // area of image used to create histogram, ImageDataHistogram() { memset(histogram, '\0', sizeof(histogram)); } int size() {return sizeof(histogram);} }; #endif /* _ImageData_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/ImageData.man3000066400000000000000000000404701215713201500217430ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: ImageData.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created # 21 Feb 96 Renamed from RTI to ImageData # 30 Sep 96 updated # NAME ImageData - C++ Base Class for Managing Image Data SYNOPSIS #include "ImageData.h" class ImageData { ... public: // maximum scale factor enum {MAX_IMAGE_SCALE = 50}; // types of color scaling enum ImageColorScaleType { LINEAR_SCALE, // linear scale LOG_SCALE, // logarithmic or exponential scale SQRT_SCALE, // square root scale HISTEQ_SCALE // histogram equalization }; virtual ~ImageData(); static ImageData* makeImage(const char* name, const ImageIO&, int verbose = 0); int write(const char* filename); void doTrans(double& x, double& y, int distFlag = 0, double xOffset = 0.0, double yOffset = 0.0, int width = 0, int height = 0); void undoTrans(double& x, double& y, int distFlag = 0, double xOffset = 0.0, double yOffset = 0.0, int width = 0, int height = 0); void coordsToDist(double& x, double& y, int width = 0, int height = 0); void distToCoords(double& x, double& y, int width = 0, int height = 0); int getIndex(double x, double y, int& ix, int& iy); void setXImageData(byte* xImage, int width, int height); void setScale(int xScale, int yScale); void shrinkToFit(int width, int height); void update(); void updateOffset(double x, double y); virtual void getDist(int& numValues, double* xyvalues); int getSpectrum(double* xyvalues, int x0, int y0, int x1, int y1); virtual void setCutLevels(double min, double max, int scaled); virtual void autoSetCutLevels(double percent = 98.0); virtual void medianFilter(double* pattern = NULL); virtual void colorScale(int ncolors, unsigned long* colors); virtual int dataType() = 0; virtual ImageData* copy() = 0; void saveParams(ImageDataParams&); void restoreParams(ImageDataParams&); virtual char* getValue(char* buf, double x, double y) = 0; virtual void getValues(double x, double y, double rx, double ry, char* xStr, char* yStr, char* valueStr, char* raStr, char* decStr, char* equinoxStr) = 0; virtual void getValues(double x, double y, double* ar, int nrows, int ncols) = 0; virtual void getValues(double x, double y, int w, int h, float* ar) = 0; virtual double getValue(double x, double y) = 0; virtual int getStatistics(double x, double y, int w, int h, double& meanX, double& meanY, double& fwhmX, double& fwhmY, double& symetryAngle, double& objectPeak, double& meanBackground); Mem& data(); Mem& header(); int getFitsHeader(ostream& os); void data(const Mem& data); void header(const Mem& header); WCS& wcs(); byte* xImage(); const ImageIO& image(); void colorScaleType(ImageColorScaleType t); ImageColorScaleType colorScaleType(); int ncolors(); unsigned long* colors(); unsigned long color0(); unsigned long colorn(); void setColors(int ncolors, unsigned long* colors); void expo(double e); double expo(); int width(); int height(); int dispWidth(); int dispHeight(); int xScale(); int yScale(); int flipX(); void flipX(int b); int flipY(); void flipY(int b); int rotate(); void rotate(int); double highCut(); double lowCut(); double minValue(); double maxValue(); void subsample(int b); void verbose(int b); void name(const char* name); char* name(); void object(const char *object); char* object(); int update_pending(); void update_pending(int b); LookupTable lookup(); int lookup(LookupTable); void clear(); }; DESCRIPTION This class is part of the RTI or Real-Time Image library and is independent of X and Tcl/Tk, so it could, in principle, be used by a separate process from the one displaying the image. Class ImageData is used for managing the image data and the conversion of the raw image data to X image data with transformations (scaling, flipping and rotating). Note that the term "X image", in this case refers to a pointer to an array of bytes and not the XImage struct itself, which is used to actually display the image later. The base class ImageData is the only class visible to the outside, however, there is one subclass for each underlying raw image data type. These subclasses implement the type specific operations on the raw image. Here is the class hierarchy: ImageData Base class, only class visible outside. ShortImageData UShortImageData ByteImageData LongImageData FloatImageData Derived classed for images with the raw data types: short, ushort, byte, long and float XImageData This class is like ByteImageData, except that the raw image is already in XImage format (i.e.: different Y axis direction and no need for color scaling or cut levels). CREATING AN IMAGE OBJECT The ImageData class is designed to work, in principle, independently of the actual image format, although in the end, something resembling FITS format is expected. An ImageData object can be created with the "makeImage()" method. ImageData::makeImage() takes an arbitrary image name, an ImageIO object, and a verbose flag and returns a pointer to an object that is a subclass of ImageData specialized in the data type for that image (ShortImageData, FloatImageData, etc.). The caller creates the ImageIO object and can control how the image is constructed. ImageIO is a reference counted class that can be initialized with a pointer to a subclass of ImageIORep. The astrotcl package currently defines only one subclass called FitsIO, however other packages may add other subclasses to implement support for new image types. You can create an ImageIO object by passing the constructor a pointer to a FitsIO object, and then use this for the ImageData::makeImage() call: ImageIO imio(new FitsIO(width, height, type, 0.0, 1.0, header, data)); image = ImageData::makeImage("myimage", imio, 0); Or you can do it all in one step and let the compiler do the conversion: image = ImageData::makeImage("myimage", new FitsIO(...), 0); Note that the internal image format is always FITS. Other formats may be converted to FITS internally (see ImageIO). WORKING WITH IMAGES The main task of the the ImageData class is to transform raw image data of some type to data that can be displayed in an application window. This includes transformations, such as scaling, rotating and flipping and color scaling, or the mapping of pixel values to a limited number of colormap values. Since applications don't always display the entire image at once, methods are available to transform only a given section of the image. Whenever a part of the raw image is to be copied to the X image, the current transformations and color scaling algorithm are taken into account. The transformations are controlled by flags. These can be accessed through the inline member functions rotate(), flipX(), flipY(), xScale() and yScale(). The color scaling algorithms (linear, logarithmic, square root and histogram equalization) are used to create a lookup table that is used when transforming the image. Basically, the lookup tables (taken from saoimage) convert shorts to bytes. Each subclass defines the method to convert the raw image pixel values to shorts, which are then converted to bytes via the lookup table, according to the current color scaling algorithm. COORDINATES Arguments representing coordinates and dimensions are generally expected to be in image coordinates. Since the caller usually has screen coordinates, these must be converted first to image coordinates by reversing the transformations using the method "undoTrans". METHODS makeImage(name, imageIo, verbose) Return a pointer to a derived class of ImageData specialized in the given type of image. See also above and class ImageIO. write(filename) Save the image to a file. For FITS images, if a header was present, it is reused, otherwise FITS keywords are inserted indicating the image type, width and height along with the date and a number of numbered "blank cards" or FITS keyword fields that can be modified by other applications as needed. The fields have names starting with BLANK followed by 2 digits (from BLANK00 to BLANK28). See FitsIO for more information. doTrans(x, y, dist_flag) undoTrans(x, y, dist_flag) apply (doTrans) or reverse (undoTrans) the transformations on given coordinates (scale, rotate, flipX and flipY). If dist_flag is non-zero, x and y are treated as a distance, so that "flipX" and "flipY" are not done. Note that both methods also reverse the Y axis (when dist_flag is 0), since image coordinates have the origin at lower left rather than upper left as for canvas coordinates. These methods essentially convert between canvas (displayed) coordinates and image coordinates. setXImageData(xImage, width, height) Set the destination XImage buffer and dimensions. This class copies the rawimage to xImage, doing any necessary transformations along the way. setScale(xScale, yScale) Set the scaling factor. The scaling factors are positive or negative integers (default 1). Positive integers are used to zoom in on the image (2 means twice the original size). Negative integers are used to zoom out (-2 means 1/2 the original size). The software imposes an arbitrary limit on the scaling factor of +-MAX_IMAGE_SCALE. shrinkToFit(width, height) Set the scaling factor so that the image will fit within the given dimensions. update() Update the entire image from the raw image if necessary. If nothing has changed since the image was last updated, this call does nothing, otherwise the entire raw image is copied to the X image with transformations. updateOffset(x, y) Update the image area starting at the given offset and continuing to the end of the raw image or the end of the X image data, which ever comes first. The raw data starting at the offset (x,y) is copied to the X image starting at (0,0) with transformations. Note that x and y are in image coordinates. This method is used when the X Image is the same size as the visible window and displays the part of the image at some x,y scroll offset. getDist(numValues, xyvalues) Scan the image and generate X,Y values to show the distribution of pixel values in the image. "numValues" is the max number of X,Y pairs to put in xyvalues (if there are not enough values, numValues is modified to reflect the actual, smaller number of values). This method is used to generate a BLT(n) graph of the pixel value distribution in the image. getSpectrum(xyvalues, x0, y0, x1, y1) Scan the raw image along the line given by x0,y0 and x1,y1 and generate an array of (index, pixel value) information. Return the number of (index,value) pairs generated for the line. This method is used to generate a BLT(n) graph of the pixel values in an arbitrary line in the image. As always, the arguments are expected in image coordinates. setCutLevels(min, max) Manually set the cut levels. This affects color scaling (see colorScale()). autoSetCutLevels(percent) Scan the image to find the distribution of pixel values (using getDist()) and set the cut levels so that the given percent of pixels are within the low and high cut values. medianFilter(pattern) Automatically set the cut levels using a median filtering algorithm. The optional "pattern" parameter may be specified as a pointer to an array containing a fixed pattern of pixels (the same size as the image), which is used by the algorithm. colorScale(ncolors, colors) Create the color scale lookup table for the image. "ncolors" is the number of available colors in the colormap. "colors" is an array of pixel values for the available colors. The color scaling algorithm used is set with the (inline) method colorScaleType(), and defaults to ImageData::LINEAR_SCALE. dataType() Return the type of the raw image data as an enumeration value (see enum ImageDataType above). copy() This virtual method returns an allocated copy of the image. The copy will share the same raw image pointer and color lookup table. Normally, a new X image pointer is assigned after this call, so that the same raw image can be transformed in different ways. This is used by the rtdimage widget to implement "views", such as the panning window and zoom window. copyParamsFrom(image) Copy the cut levels and transformation params from the given image. getValue(buf, x, y) Print the coordinates and raw data value at the given x,y image coords to the given char* buffer. A "-" is printed if the x,y coords are out of range. getValue(x, y) Return the raw image value at the given x,y coordinates as a double. The input x,y is assumed to be in image coordinates. If the coordinates are out of range, 0.0 is returned. getValues(x, y, xStr, yStr, valueStr, raStr, decStr, equinoxStr) Print the values at the given x,y coordinates to the given buffers for display. X and Y are specified in image coordinates and the values written to the buffers are in image and world coordinates, resp. If the given point is out of range, the buffers are set to the empty string. getValues(x, y, ar, nrows, ncols) Fill the given array with the pixel values surrounding the given image coordinate point. nrows and ncols give the dimensions of the array. Any values that are outside of the image are set to HUGE_VAL. Note: it is assumed that nrows and ncols are odd numbers and that the array is one row and column larger (nrows+1 x ncols+1), so that it can hold the X and Y index headings. The X heading is in the first row of the 2 dimensional array and contains the X coordinate values. The Y coordinate values are in the first column. header() data() Return a reference to the class "Mem" object used to represent the FITS image header (or data). header(m) data(m) Set a new (FITS) image header or image data object (of class Mem). xImage() Get a pointer to the X image data. colorScaleType() colorScaleType(type) Get/set the current color scale algorithm (see enum ImageColorScaleType above). ncolors() colors() Get the number of colors in the colormap or the pointer to the color values (set with colorScale() or setColors()). setColors(ncolors, colors) Set the number of colors in the colormap or the pointer to the color values. color0() colorn() These two methods return the color values for blank pixels (color0()) and saturated pixels (colorn()). These two color cells are normally reserved for this purpose and are not otherwise used in the image. color0 is normally black and colorn is normally white. See ImageColor. expo(e) expo() Set/get the exponent used for logarithmic or square root color scaling. width() height() Get the dimensions of the raw image. dispWidth() dispHeight() Get the dimensions of the image after transformations. xScale() yScale() Get the X and Y scale (magnification) factors (Set with setScale()). flipX() flipX(bool) flipY() flipY(bool) rotate() rotate(bool) Turn flipping in the X or Y direction or rotating on or off for the image. highCut() lowCut() Get the high or low cut value (set with setCutLevels()). minValue() maxValue() Get the minimum or maximum raw image value. subsample(bool) Set the subsample flag, to true to use every nth pixel when shrinking an image, or false to use the maximum pixel. verbose(bool) Sets a flag: if true, diagnostic messages are printed out at run time. name(name) name() Set/get the name of the image. This is some arbitrary string used to identify the image. The set routine makes a local copy of the string, wcs() This method returns a reference to the WCS class object for this image. This object provides a number of methods for working with world coordinates and converting between pixel and world coordinates. clear() Temporarilly clear the X image data to make the image blank (until the next call to "update" or "updateOffset"). SEE ALSO rtdimage(n), RtdImage, ImageColor(3C++), ImageDisplay(3C++), WCS, BLT(n) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/generic/ImageDisplay.C000066400000000000000000000162051215713201500220220ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: ImageDisplay.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ImageDisplay.C - member routines for class ImageDisplay, * for managing XImage to Pixmap display including * optional X shared memory extension usage * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 04/03/98 Added putpixel member. Fixed allocation * of data to bytes_per_line*width when not * using shared memory. * 18/06/03 Some changes to attempt cleanup when * shared memory cannot be attached (Solaris * limit is 6 segments!). */ static const char* const rcsId="@(#) $Id: ImageDisplay.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; // #define DEBUG // #define XXXDEBUG #include #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "error.h" #include "ErrorHandler.h" #include "ImageDisplay.h" #ifdef NEED_SHM_PROTO // missing prototypes (on SunOS at least) /*extern "C" { // should be in sys/shm.h void *shmat(int shmid, const void* shmaddr, int shmflg); int shmdt(const void* shmaddr); int shmget(key_t, size_t, int); int shmctl(int shmid, int cmd, shmid_ds *buf); }*/ #endif /* * constructor - create an object to manage the XImage * * args: * display, visual, gc - standard X env * width, height, depth - dimensions of image * useXShm - flag: true if we should try to use X Shared Memory * verbose - flag: if true, print diagnostic messages */ ImageDisplay::ImageDisplay(Display *display, Visual *visual, GC gc, int depth, int useXShm, int verbose) : xImage_(NULL), display_(display), visual_(visual), gc_(gc), depth_(depth), bytesPerPixel_(depth/8), useXShm_(useXShm), usingXShm_(0), verbose_(verbose) { if (depth_ == 24) bytesPerPixel_ = 4; } /* * Destructor - clean up XImage */ ImageDisplay::~ImageDisplay() { destroyXImage(); } /* * destroy the XImage and free any allocated shared memory * if necessary */ void ImageDisplay::destroyXImage() { if (xImage_) { if (usingXShm_) { XShmDetach(display_, &shmInfo_); XDestroyImage(xImage_); shmdt(shmInfo_.shmaddr); } else { XDestroyImage(xImage_); } xImage_ = NULL; } } /* * flush X output buffer and wait until all requests were processed * by the X server. */ void ImageDisplay::flushX() { if (! xImage_) return; XSync(display_, False); } /* * do an XPutImage or XShmPutImage, depending on the current flags */ void ImageDisplay::put(Drawable d, int src_x, int src_y, int dest_x, int dest_y, int width, int height) { if (! xImage_) return; // make sure arguments are in range if (src_x < 0) src_x = 0; if (src_y < 0) src_y = 0;; width = min(width, xImage_->width - src_x); height = min(height, xImage_->height - src_y); if (width <= 0 || height <= 0) return; if (usingXShm_) { XShmPutImage(display_, d, gc_, xImage_, src_x, src_y, dest_x, dest_y, width, height, False /*True = send event*/); } else { XPutImage(display_, d, gc_, xImage_, src_x, src_y, dest_x, dest_y, width, height); } return; } /* * create or update the XImage using X shared memory * so that it has the given width and height and return TCL_OK if all * is TCL_OK. */ int ImageDisplay::updateShm(int width, int height) { // use this to catch X errors ErrorHandler errorHandler(display_, verbose_); // create an XImage in shared memory xImage_ = XShmCreateImage(display_, visual_, depth_, ZPixmap, NULL, &shmInfo_, width, height); if (!xImage_) { #ifdef DEBUG if (verbose_) cout << "XShmCreateImage failed\n"; #endif return TCL_ERROR; } // allocate enough shared memory to hold the image // (plus a fudge factor to keep the X server on HP happy) shmInfo_.shmid = shmget(IPC_PRIVATE, (xImage_->bytes_per_line * (height+1)), IPC_CREAT | 0777); if (shmInfo_.shmid < 0) { XDestroyImage(xImage_); xImage_ = NULL; #ifdef DEBUG if (verbose_) { perror("shmget failed for X shared memory"); } #endif return TCL_ERROR; } shmInfo_.shmaddr = (char *) shmat(shmInfo_.shmid, 0, 0); if (shmInfo_.shmaddr == ((char *) -1)) { XDestroyImage(xImage_); shmctl(shmInfo_.shmid, IPC_RMID, 0); shmdt(shmInfo_.shmaddr); xImage_ = NULL; #ifdef DEBUG if (verbose_) perror("shmat failed for X shared memory"); #endif return TCL_ERROR; } xImage_->data = shmInfo_.shmaddr; shmInfo_.readOnly = False; XShmAttach(display_, &shmInfo_); // check for X errors if (errorHandler.errors()) { XShmDetach(display_, &shmInfo_); XDestroyImage(xImage_); shmctl(shmInfo_.shmid, IPC_RMID, 0); shmdt(shmInfo_.shmaddr); xImage_ = NULL; #ifdef DEBUG if (verbose_) cout << "X shared memory error\n"; #endif return TCL_ERROR; } // this will cause the shared memory to be automatically deleted shmctl(shmInfo_.shmid, IPC_RMID, 0); #ifdef XXXDEBUG if (verbose_) cout << "Sharing memory\n"; #endif return TCL_OK; } /* * create or update the XImage so that it has the given width and height */ int ImageDisplay::update(int width, int height) { if (xImage_) { // reuse old XImage if it has the same dimensions if (xImage_->width == width && xImage_->height == height) { return TCL_OK; } destroyXImage(); xImage_ = NULL; } if (useXShm_) { // try to create a shared memory XImage if (updateShm(width, height) == TCL_OK) { usingXShm_ = 1; return TCL_OK; } usingXShm_ = 0; #ifdef DEBUG if (verbose_) cout << "Couldn't create X shared memory: reverting to standard X Image\n"; #endif } // fallback: create a normal XImage xImage_ = XCreateImage(display_, visual_, depth_, ZPixmap, 0, (char *) NULL, width, height, BitmapPad(display_), 0); // now allocate the image data (which must use the appropriate padding). xImage_->data = (char *)malloc(xImage_->bytes_per_line * height); if (xImage_->data == NULL) { #ifdef DEBUG if (verbose_) cout << "out of memory for XImage\n"; #endif XDestroyImage(xImage_); return error("not enough memory for an image this size"); } #ifdef XXXDEBUG if (verbose_) cout << "Not Sharing memory\n"; #endif return TCL_OK; } /* * clear out the image by setting all pixels to the given value */ void ImageDisplay::clear(unsigned long val) { if (!xImage_) return; // byte data if (depth_ == 8) { memset(xImage_->data, val, xImage_->bytes_per_line * xImage_->height); } else { // XImage has depth greater than a byte for (int i=0; iwidth; i++) { for (int j=0; jheight; j++) { XPutPixel(xImage_, i, j, val); } } } } skycat-3.1.2-starlink-1b/rtd/generic/ImageDisplay.h000066400000000000000000000060741215713201500220720ustar00rootroot00000000000000// -*-c++-*- #ifndef _ImageDisplay_H_ #define _ImageDisplay_H_ /* * E.S.O. - VLT project * "@(#) $Id: ImageDisplay.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ImageDisplay.h - class managing XImage to Pixmap display including * optional X shared memory extension usage * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * T. Herlin 06/12/95 Casted NULL return from ImageDisplay::data * P.W. Draper 04/03/98 Added putpixel member. */ #include #include #include #include #include class ImageDisplay { protected: XImage* xImage_; // XImage for the basic image Display *display_; // X token for the window's display Visual *visual_; // X visual for window GC gc_; // Graphics context for copying to screen int depth_; // bits per pixel int bytesPerPixel_; // bytes per pixel // note: it might be that we can use XShm only on smaller images due to // system limits on shared memory usage (on SunOS, for example) int useXShm_; // flag: true if we WANT to use X shared memory int usingXShm_; // flag: true if we ARE using X shared memory XShmSegmentInfo shmInfo_; // X shared memory Segment info for xImage_ int verbose_; // flag: if true, print diagnostic messages // destroy the XImage and free any shared memory void destroyXImage(); // try to create an XImage in shared memory int updateShm(int width, int height); public: // constructor ImageDisplay(Display *display, Visual *visual, GC gc, int depth, int useXShm, int verbose); // destructor ~ImageDisplay(); // create or update an XImage with the given size int update(int width, int height); // copy the XImage to a Drawable in the X Server void put(Drawable, int src_x, int src_y, int dest_x, int dest_y, int width, int height); // return a pointer to the XImage data unsigned char* data() { return xImage_ ? (unsigned char*)xImage_->data : (unsigned char*)NULL; } // clear out the image by setting all pixels to the given value void clear(unsigned long val); // Assign a value to a pixel (This is the "safe" method for non-byte XImages) void putpixel(int x, int y, unsigned long value) { // assert(xImage_ != NULL); XPutPixel(xImage_, x, y, value); } // flush X output buffer void flushX(); // other info int width() {return xImage_ ? xImage_->width : 0;} int height() {return xImage_ ? xImage_->height : 0;} int bitmapPad() {return xImage_ ? xImage_->bitmap_pad : 0;} int bytesPerLine() {return xImage_ ? xImage_->bytes_per_line : 0;} int depth() {return depth_;} int bitsPerPixel() {return bytesPerPixel_*8;} int bytesPerPixel() {return bytesPerPixel_;} // return true if we are really using X shared memory int usingXShm() {return usingXShm_;} }; #endif /* _ImageDisplay_H_ */ skycat-3.1.2-starlink-1b/rtd/generic/ImageTemplates.h000066400000000000000000000101421215713201500224120ustar00rootroot00000000000000// -*-c++-*- /* * E.S.O. - VLT project * # * # "@(#) $Id: ImageTemplates.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ImageTemplates.h - template class method definitions for classes derived * from class ImageData and defined in ImageTemplates.C * * This file is included in the header files for the different image data * types. ImageTemplates.C is included in the body files to define some * methods that differ only in the raw image data type. * * See the man page ImageData(3) and the RTD User's Guide for a complete * description of this class hierarchy. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * P.Biereichel 30/06/97 Changed parameters in getValues() for pixel table * Peter W. Draper 12/07/99 Added getBlank(); * 16/04/08 Added growAndShrink() * 19/06/09 Added parseBlank() */ #define SAMP_METHOD_MAX 0 /* max value of all pixels in a NxN box (default) */ #define SAMP_METHOD_MIN 1 /* min value of all pixels in a NxN box */ #define SAMP_METHOD_MEAN 2 /* mean value of all pixels in a NxN box */ #define SAMP_METHOD_MEDIAN 3 /* median value of all pixels in a NxN box */ #define SAMP_METHOD_MAX_CROSS 4 /* max value of pixels on a diagonal cross in a NxN box */ #define SAMP_METHOD_MIN_CROSS 5 /* min value of pixels on a diagonal cross in a NxN box */ #define SAMP_METHOD_MEAN_CROSS 6 /* mean value of pixels on a diagonal cross in a NxN box */ #define SAMP_METHOD_MEDIAN_CROSS 7 /* median value of pixels on a diagonal cross in a NxN box */ #define SAMP_METHOD_MEDIAN_CHESS 8 /* median value of pixels in a chess-board like box */ #define SAMP_METHOD_MEDIAN_9 9 /* median value of a 3x3 box */ #define SAMP_METHOD_RMS 10 /* RMS value of all pixels in a NxN box */ protected: // calculate min and max pixel values void getMinMax(); // print raw data value at x,y coords to buffer char* getValue(char* buf, double x, double y); // return the value at the x,y coords as a double double getValue(double x, double y); // print the values at the given x,y coords to the buffers for display void getValues(double x, double y, double rx, double ry, char* xStr, char* yStr, char* valueStr, char* raStr, char* decStr, char* equinoxStr); // get array of image pixel values and x,y coords around a point void getValues(double x, double y, double rx, double ry, double* ar, int nrows, int ncols, int flag = 0); // get array of image pixel values at a given offset with given dimensions void getValues(double x, double y, int w, int h, float* ar, int flag = 0); // Copy raw image data from this image to the given image data area, // starting at the image coordinates (x, y) and with the dimentions (w, h) // in pixels. Since this is a copy from one raw image to another, no // data conversion is done. void copyImageArea(void* data, double x, double y, int w, int h); // copy raw data to xImage, pos. with transformations (defined in derived class) void rawToXImage(int x0, int y0, int x1, int y1, int dest_x, int dest_y); void grow(int x0, int y0, int x1, int y1, int dest_x, int dest_y); void shrink(int x0, int y0, int x1, int y1, int dest_x, int dest_y); // version of grow that can deal with a shrinked axis void growAndShrink(int x0, int y0, int x1, int y1, int dest_x, int dest_y); // automatically set the cut levels using median filtering void medianFilter(); // get array with information about the pixel value distribution void getPixDist(int numValues, double* xyvalues, double factor); // If there is a special value for blank pixels, get it and set the // values of haveBlankPixel_ and scaledBlankPixelValue_. void initBlankPixel(); // Fill the given histogram with the distribution of pixels in the // visible image area void getHistogram(ImageDataHistogram&); // return the blank value. int haveBlank() {return haveBlank_;} double getBlank() {return (double) blank_;} // set blank value from a string int parseBlank(const char* value); skycat-3.1.2-starlink-1b/rtd/generic/ImageTemplates.icc000066400000000000000000001223071215713201500227300ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: ImageTemplates.icc,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ImageTemplates.C - template member functions for classes derived from * class ImageData (not C++ templates, uses cpp macros) * * See the man page ImageData(3) for a complete description of this class * hierarchy. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 29/01/97 Added FITS_LONG changes (for alpha 64 longs) * P.Biereichel 30/06/97 Changed parameters in getValues() for pixel table * Peter W. Draper 23/02/98 Changed min/max calculations to use more * pixels (too many occurences of "strange" limits). * 06/03/98 Added changes to support XImage depths * greater than one byte. * pbiereic 22/03/99 Added on-the-fly subtraction. * Peter W. Draper 17/08/00 Changed getMinMax slightly. This now * checks if the total height of the image * is shown, rather than just testing * y0_. This could be wrong for zoomed * pbiereic 21/06/00 Fixed "array out of bounds" in getMinMax() * Peter W. Draper 19/03/01 Made sure that x1 and y1 in getMinMax, * never run off the edges of image. * pbiereic 17/02/03 Native byte order routines revised * Peter W. Draper 30/05/03 Skip runs of blank pixels in median estimate * pbiereic 18/06/04 Added experimental sampling methods * Peter W. Draper 01/11/06 Changed getMinMax to deal with images that * have a dimension of 1 (but not both). * 08/01/07 Changed getMinMax to deal with 1x1 case too. * 16/07/07 When first pixel is blank or NaN make sure * failed check for a valid pixel tests both * blank and NaN, not just NaN. * 16/04/08 Added growAndShrink() to allow scales * to have positive and negative values * at the same time. * 19/06/09 Change initBlankValue to use the cached * blankValue_ and make public (allows change). * pbiereic 12/08/07 added support for data types double and long long int * Peter W. Draper 17/05/12 Merged skycat double version created by pbiereic. * * This file is included in the .C files for classes derived from class * ImageData. The file defines a number of member functions that are * always the same, except for the underlying raw image data type. The * member functions are implemented in the derived classes for speed * (otherwise we would have to call virtual functions on each pixel...) * * Before including, the following #defines need to be made: * * #define CLASS_NAME <...> - as the name of the derived class * #define DATA_TYPE as the raw image data type (short, long, float,...) * #define NTOH(x) to be just (x) if you're sure your type never requires * byte-swapping. Otherwise leave it undefined and the * code below should do the right thing. * #define ISNAN(x) Only for floating point types, returns true if x is a NAN */ /* * For all member functions within this file use the inline function getVal() * instead of referencing the raw image directly. getVal() returns the raw * image pixel value or the subtracted value if a bias frame was selected. * Before using getVal() initialize this function with initGetVal(). */ #include #include #include "define.h" // This is a no-op for non-floating point data types. This macro is // defined as isnan(x) for floating point types. #ifndef ISNAN #define ISNAN(x) 0 #endif /* * getVal() is an inline function which subtracts on-the-fly a * bias pixel if a bias frame is selected. * p - is a pointer to the raw image * idx - is an index to the image * * looks "big" but it isn't (gcc assembler code was checked). */ inline DATA_TYPE CLASS_NAME::getVal(DATA_TYPE* p, int idx) { // return pixel value if bias subtraction is off if (! ImageData::biasInfo_->on) return (DATA_TYPE)NTOH(*(p + idx)); if ( ! bias_swap_bytes_) { // return faster if image dimensions and types are the same if (ImageData::biasInfo_->sameTypeAndDims) return ((DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((DATA_TYPE)(*((DATA_TYPE*)ImageData::biasInfo_->ptr + idx)))); register biasINFO* bias = ImageData::biasInfo_; register int x = idx % width_ + startX_; register int y = idx / width_ + startY_; // if pixel is not within the boundary of the bias image return pixel value if (x < 0 || x >= bias->width || y < 0 || y >= bias->height) return NTOH(*(p + idx)); register int biasIdx = y * bias->width + x; switch (bias->type) { case BYTE_IMAGE: case X_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((byte)(*((byte *)bias->ptr + biasIdx))); case USHORT_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((ushort)(*((ushort *)bias->ptr + biasIdx))); case SHORT_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((short)(*((short *)bias->ptr + biasIdx))); case LONG_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((int)(*((int *)bias->ptr + biasIdx))); case FLOAT_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((float)(*((float *)bias->ptr + biasIdx))); case DOUBLE_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((double)(*((double *)bias->ptr + biasIdx))); case LONGLONG_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((long long)(*((long long *)bias->ptr + biasIdx))); default: return (DATA_TYPE)NTOH(*(p + idx)); } } else { register biasINFO* bias = ImageData::biasInfo_; register int x = idx % width_ + startX_; register int y = idx / width_ + startY_; // if pixel is not within the boundary of the bias image return pixel value if (x < 0 || x >= bias->width || y < 0 || y >= bias->height) return NTOH(*(p + idx)); register int biasIdx = y * bias->width + x; switch (bias->type) { case BYTE_IMAGE: case X_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((byte)(*((byte *)bias->ptr + biasIdx))); case USHORT_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((ushort)SWAP16(*((ushort *)bias->ptr + biasIdx))); case SHORT_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((short)SWAP16(*((short *)bias->ptr + biasIdx))); case LONG_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((int)SWAP32(*((int *)bias->ptr + biasIdx))); case FLOAT_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((float)SWAP_FLOAT(*((float *)bias->ptr + biasIdx))); case DOUBLE_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((double)SWAP_DOUBLE(*((double *)bias->ptr + biasIdx))); case LONGLONG_IMAGE: return (DATA_TYPE)NTOH(*(p + idx)) - (DATA_TYPE)((long long)SWAP64(*((long long *)bias->ptr + biasIdx))); default: return (DATA_TYPE)NTOH(*(p + idx)); } } } /* * Scan the image to find the min and max values and set the member * variables accordingly. To save time, only the visible area of the * image is examined (x0_, y0_, x1_ and y1_ are set each time the * image is updated, however they are initially set to the entire * image). * The result is that the member variables minValue_ and maxValue_ * are set. */ void CLASS_NAME::getMinMax() { DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); int p; register DATA_TYPE value; initGetVal(); // init flag for speeding up bias subtraction // use area of image that is visible. // if we are looking at the whole image, ignore the margin int w = x1_ - x0_ + 1, h = y1_ - y0_ + 1; int xmargin = 0, ymargin = 0; if (w == width_) xmargin = int(w * 0.02); if ( h == height_ ) // PWD: change here, test was y0_ == 0 ymargin = int(h * 0.02); int x0 = x0_ + xmargin; int y0 = y0_ + ymargin; int x1 = min( x1_ - xmargin, width_ - 1 ); // PWD: stop running int y1 = min( y1_ - ymargin, height_ - 1 );// off edges w = x1 - x0 + 1; h = y1 - y0 + 1; if ( w < 1 || h < 1 || ( w == 1 && h == 1 )) { if (area_ > 0) { minValue_ = maxValue_ = getVal(rawImage, 0); } else { minValue_ = maxValue_ = 0; } return; } // set the x, y increments so that not every pixel or line is // examined on large images int xincr = w/256; if (xincr == 0) xincr++; int yincr = h/256; if (yincr == 0) yincr++; if (x1 >= x1_ - xincr) { x1 = x1_ - xincr; if ( x1 < 0 ) { x1 = 1; } } if (y1 >= y1_ - yincr) { y1 = y1_ - yincr; if ( y1 < 0 ) { y1 = 1; } } // try to speed things up a bit on large images: // don't examine every pixel, just look at a few sample lines p = y0*width_+x0; // first pixel in region to examine value = getVal(rawImage, p); // ignore BLANK pixels. For efficiency, we only check the flag once int end = area_; if (haveBlank_) { // make sure starting min/max values are not the BLANK pixel while(value == blank_ || ISNAN(value)) { p += 10; // check another pixel if (p >= end) break; value = getVal(rawImage, p); } if (value == blank_ || ISNAN(value)) value = 0; minValue_ = maxValue_ = value; for (int y = y0; y <= y1; y+=yincr) { p = y*width_+x0; if (p >= end) break; for (int x = x0; x <= x1; x+=xincr, p+=xincr) { if ((value = getVal(rawImage, p)) == blank_ || ISNAN(value)) continue; if (value < minValue_) minValue_ = value; else if (value > maxValue_) maxValue_ = value; } } } else { // note that for non-float types, the ISNAN call is optimized away while(ISNAN(value)) { p += 10; // check another pixel if (p >= end) break; value = getVal(rawImage, p); } if (ISNAN(value)) value = 0; minValue_ = maxValue_ = value; for (int y = y0; y <= y1; y+=yincr) { p = y*width_+x0; if (p >= end) break; for (int x = x0; x <= x1; x+=xincr, p+=xincr) { value = getVal(rawImage, p); if (ISNAN(value)) continue; if (value < minValue_) minValue_ = value; else if (value > maxValue_) maxValue_ = value; } } } } /* * print the coordinates and raw data value at the given x,y image * coords to the buffer * * A "-" is printed if the x,y coords are out of range. * "blank" is printed if the pixel is blank. */ char* CLASS_NAME::getValue(char* buf, double x, double y) { DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); DATA_TYPE value; initGetVal(); // init flag for bias subtraction int ix, iy; if (getIndex(x, y, ix, iy) != 0) sprintf(buf, "%.1f %.1f -", x, y); else { value = getVal(rawImage, iy*width_+ix); if (haveBlank_ && value == blank_) sprintf(buf, "%.1f %.1f blank", x, y); else sprintf(buf, "%.1f %.1f %g", x, y, scaleValue(value)); } return buf; } /* * return the value at the x,y image coords as a double. * * The input x,y is assumed to be in image coords. * If the coords are out of range, 0.0 is returned. */ double CLASS_NAME::getValue(double x, double y) { DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); int ix, iy; initGetVal(); // init flag for bias subtraction if (getIndex(x, y, ix, iy) != 0) return 0.0; return scaleValue(getVal(rawImage, iy*width_+ix)); } /* * print the X, Y coordinates, raw data value and World Coordinates * at the given x,y image coords to the given buffers. * * rx and ry are the image coordinates to use to access the pixel value. This might * be different than x,y, since x,y are the logical image coordinates, assuming the * image starts at 1,1, which might not actually be the case. * * A blank value is printed if the rx,ry coords are out of range. * * note: x, y and rx,ry are expected in image coords, while in the result, * xStr and yStr are in "chip" coords, since they should be displayed. */ void CLASS_NAME::getValues(double x, double y, double rx, double ry, char* xStr, char* yStr, char* valueStr, char* raStr, char* decStr, char* equinoxStr) { initGetVal(); // init flag for speeding up bias subtraction // display chip coords for x and y double cx = x, cy = y; imageToChipCoords(cx, cy); sprintf(xStr, "%.1f", cx); sprintf(yStr, "%.1f", cy); *raStr = '\0'; *decStr = '\0'; *equinoxStr = '\0'; if (wcs().isWcs()) { char buf[80]; wcs().pix2wcs(x, y, buf, sizeof(buf), 1); sscanf(buf, "%s %s %s", raStr, decStr, equinoxStr); } // get integer index in raw image for pixel value int ix, iy; *valueStr = '\0'; if (getIndex(rx, ry, ix, iy) == 0) { DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); DATA_TYPE value = getVal(rawImage, iy*width_+ix); if (haveBlank_ && value == blank_) strcpy(valueStr, "blank"); else sprintf(valueStr, "%g", scaleValue(value)); } } /* * Fill the given array with the pixel values surrounding the given point. * nrows and ncols give the dimensions of the array. Any values that are outside * of the image or are blank (BLANK keyword) are set to -HUGE_VAL (If "flag" * is non-zero, values outside the image are not changed). * * Note: it is assumed that nrows and ncols are odd numbers and that the array * is one row and column larger (nrows+1 x ncols+1), so that it can hold the * X and Y index headings. * * rx and ry are the image coordinates to use to access the pixel value. This might * be different than x,y, since x,y are the logical image coordinates, assuming the * image starts at 1,1, which might not actually be the case. * * note: x, y and rx,ry are expected in image coords, however the coordinates in the * result are "chip" coords, since they should be displayed. * */ void CLASS_NAME::getValues(double x, double y, double rx, double ry, double* ar, int nrows, int ncols, int flag) { DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); initGetVal(); // init flag for speeding up bias subtraction int m = ncols/2; int n = nrows/2; int w = ncols+1; int i, j; // get pixel index int ix, iy; // insert the x coord headings for (i = 0; i < ncols; i++) { double cx = x+(i-m); imageToChipCoords(cx); ar[i+1] = cx; // X coord top heading } for (j = 0; j < nrows; j++) { double cy = y+(j-n); imageToChipCoords(cy); ar[(j+1)*w] = cy; // Y coord left heading for (i = 0; i < ncols; i++) { if (getIndex(rx+(i-m), ry+(j-n), ix, iy) == 0) { DATA_TYPE value = getVal(rawImage, iy*width_+ix); if (haveBlank_ && value == blank_) ar[(j+1)*w+i+1] = -HUGE_VAL; else ar[(j+1)*w+i+1] = scaleValue(value); } else if (! flag) { ar[(j+1)*w+i+1] = -HUGE_VAL; } } } } /* * Fill the given array with the pixel values (converted to floats as needed) * at the given x,y image pos, width and height. * * The array should be large enough for at least (w x h) floats. * * Any values that are outside of the image are set to blank or 0, if there * is no blank pixel value defined (If "flag" is non-zero, values outside * the image are not changed). * * Note: x and y are expected in image coordinates */ void CLASS_NAME::getValues(double x, double y, int w, int h, float* ar, int flag) { DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); int i, j; int ix, iy; DATA_TYPE value; initGetVal(); // init flag for speeding up bias subtraction getIndex(x, y, ix, iy); for (j = 0; j < h; j++) { for (i = 0; i < w; i++) { int rx = ix+i, ry = iy+j; if (rx >= 0 && ry >= 0 && rx < width_ && ry < height_) { value = getVal(rawImage, ry*width_+rx); if (haveBlank_ && value == blank_) { // ar[j*w+i] = 0; ar[j*w+i] = blank_; } else { ar[j*w+i] = scaleValue(value); } } else if (!flag) { ar[j*w+i] = blank_; } } } } /* * Copy raw image data from this image to the given image data area, * starting at the image coordinates (x, y) and with the dimentions (w,h) * in pixels. Since this is a copy from one raw image to another, no * data conversion is done. */ void CLASS_NAME::copyImageArea(void* data, double x, double y, int w, int h) { DATA_TYPE* fromImage = (DATA_TYPE*)image_.dataPtr(); DATA_TYPE* toImage = (DATA_TYPE*)data; int i, j; int ix, iy; getIndex(x, y, ix, iy); for (j = 0; j < h; j++) { for (i = 0; i < w; i++) { int rx = ix+i, ry = iy+j; if (rx >= 0 && ry >= 0 && rx < width_ && ry < height_) { toImage[j*w+i] = fromImage[ry*width_+rx]; } else { toImage[j*w+i] = blank_; } } } } /* * copy the raw image to the xImage * * The arguments x0, y0, x1 and y1 are the bounding box of the region of * the raw image that needs to be copied (origin at upper left (0,0)). * * dest_x and dest_y give the coordinates in the XImage where copying * should start. These are normally either (x0,y0) or (0,0). */ void CLASS_NAME::rawToXImage(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { // if (verbose_) // printf("%s: rawToXImage: %d,%d %d,%d +(%d,%d), flip: %d,%d, rotate: %d\n", // name_, x0, y0, x1, y1, dest_x, dest_y, flipX_, flipY_, rotate_); register int i, j; // row/col increments register int src_x_inc, src_y_inc; register int dest_x_inc, dest_y_inc; // source/dest images register DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); register int src; register byte* dest = xImageData_; initGetVal(); // init flag for speeding up bias subtraction // width of image area to update int w = x1 - x0 + 1; // set loop increments for based on current transformations switch (flipX_<<1|flipY_) { case 0: // none src = (height_ - 1 - y0) * width_ + x0; src_x_inc = 1; src_y_inc = -width_ - w; break; case 1: // flipY src = y0 * width_ + x0; src_x_inc = 1; src_y_inc = width_ - w; break; case 2: // flipX src = (height_ - 1 - y0) * width_ + (width_ - 1 - x0); src_x_inc = -1; src_y_inc = -(width_ - w); break; case 3: // flipX and flipY src = y0 * width_ + (width_ - 1 - x0); src_x_inc = -1; src_y_inc = width_ + w; break; } // need to take care with non-byte depths, so branch according to // this if ( xImageBytesPerPixel_ == 1 ) { // set args for rotate in dest image if (rotate_) { dest_x_inc = xImageBytesPerLine_; dest_y_inc = -(w * xImageBytesPerLine_ - 1); dest += xImageBytesPerLine_ * dest_x + dest_y; } else { dest_x_inc = 1; dest_y_inc = xImageBytesPerLine_ - w; dest += xImageBytesPerLine_ * dest_y + dest_x; } // copy the raw data to the X image... for (i=y0; i<=y1; i++) { for (j=x0; j<=x1; j++) { *dest = lookup(getVal(rawImage, src)); dest += dest_x_inc; src += src_x_inc; } src += src_y_inc; dest += dest_y_inc; } } else { // XImage has depth greater than a byte, need to take care with // these (byte swapping etc. to server format) register int k = dest_x; register int l = dest_y; for (i=y0; i<=y1; i++) { for (j=x0; j<=x1; j++) { if ( rotate_ ) { xImage_->putpixel( l, k, llookup(getVal(rawImage, src))); } else { xImage_->putpixel( k, l, llookup(getVal(rawImage, src))); } src += src_x_inc; k++; } src += src_y_inc; l++; k = dest_x; } } } /* * This method is called to magnify the image by factors >= 2. * * The arguments x0, y0, x1 and y1 are the bounding box of the region * of the raw image that needs to be copied (origin at upper left (0,0)). * * dest_x and dest_y give the coordinates in the XImage where copying * should start. These are normally either (x0,y0) or (0,0). */ void CLASS_NAME::grow(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { register byte *p, *q; register byte c; register int i, j, n, m; register int xs = xScale_, ys = yScale_; // row/col increments register int src_x_inc, src_y_inc; register int dest_x_inc, dest_y_inc; // source/dest images register DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); register int src; register byte* dest = xImageData_; register byte* end = xImageData_ + xImageSize_; initGetVal(); // init flag for speeding up bias subtraction // width of image area to update int w = x1 - x0 + 1; // set loop increments based on current transformations switch (flipX_<<1|flipY_) { case 0: // none src = (height_ - 1 - y0) * width_ + x0; src_x_inc = 1; src_y_inc = -width_ - w; break; case 1: // flipY src = y0 * width_ + x0; src_x_inc = 1; src_y_inc = width_ - w; break; case 2: // flipX src = (height_ - 1 - y0) * width_ + (width_ - 1 - x0); src_x_inc = -1; src_y_inc = -(width_ - w); break; case 3: // flipX and flipY src = y0 * width_ + (width_ - 1 - x0); src_x_inc = -1; src_y_inc = width_ + w; break; } // need to take care with non-byte depths, so branch according to // this if ( xImageBytesPerPixel_ == 1 ) { // set args for rotate in dest image if (rotate_) { dest_x_inc = xImageBytesPerLine_ * xs; dest_y_inc = -(w * xs * xImageBytesPerLine_ - ys); dest += xImageBytesPerLine_ * xs * dest_x + dest_y * ys; } else { dest_x_inc = xs; dest_y_inc = xImageBytesPerLine_ * ys - w * xs; dest += xImageBytesPerLine_ * ys * dest_y + dest_x * xs; } // copy the raw data to the X image... for (i=y0; i<=y1; i++) { for (j=x0; j<=x1; j++) { c = lookup(getVal(rawImage, src)); q = p = dest; src += src_x_inc; dest += dest_x_inc; // replicate the source pixel to an xs x ys box in the dest for (n=0; n= end) { break; } *p++ = c; } p = q += xImageBytesPerLine_; } } src += src_y_inc; dest += dest_y_inc; } return; } // XImage has depth greater than a byte. Need to take care with // these (byte swapping etc. to server format, if really // pushed for performance could use ImageByteOrder() and wing it). int k = dest_x * xs; int l = dest_y * ys; unsigned long cl; int width; int height; if ( rotate_ ) { height = xImage_->width(); width = xImage_->height(); } else { width = xImage_->width(); height = xImage_->height(); } for ( i = y0; i <= y1; i++ ) { for ( j = x0; j <= x1; j++ ) { cl = llookup(getVal(rawImage, src)); // replicate the source pixel to an xs x ys box int maxN = min(l+ys,height), maxM = min(k+xs,width); for ( n = l; n < maxN; n++ ) { for ( m = k; m < maxM; m++ ) { if ( rotate_ ) { xImage_->putpixel( n, m, cl ); } else { xImage_->putpixel( m, n, cl ); } } } k += xs; src += src_x_inc; } k = dest_x * xs; l += ys; src += src_y_inc; } } /* * This method is called when the image scales require grow and shrink. * * The arguments x0, y0, x1 and y1 are the bounding box of the region * of the raw image that needs to be copied (origin at upper left (0,0)). * * dest_x and dest_y give the coordinates in the XImage where copying * should start. These are normally either (x0,y0) or (0,0). */ void CLASS_NAME::growAndShrink(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { register int i, j, n, m; register int xs = xScale_, ys = yScale_; register int rxs = xScale_, rys = yScale_; // One of these is negative, the other not. if ( xs < 0 ) xs = 1; if ( ys < 0 ) ys = 1; // row/col increments register int src_x_inc, src_y_inc; // source/dest images register DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); register int src; initGetVal(); // init flag for speeding up bias subtraction // width of image area to update int w = x1 - x0 + 1; // set loop increments based on current transformations switch (flipX_<<1|flipY_) { case 0: // none src = (height_ - 1 - y0) * width_ + x0; src_x_inc = 1; src_y_inc = -width_ - w; break; case 1: // flipY src = y0 * width_ + x0; src_x_inc = 1; src_y_inc = width_ - w; break; case 2: // flipX src = (height_ - 1 - y0) * width_ + (width_ - 1 - x0); src_x_inc = -1; src_y_inc = -(width_ - w); break; case 3: // flipX and flipY src = y0 * width_ + (width_ - 1 - x0); src_x_inc = -1; src_y_inc = width_ + w; break; } int k = dest_x * xs; int l = dest_y * ys; unsigned long cl; int width; int height; if ( rotate_ ) { height = xImage_->width(); width = xImage_->height(); } else { width = xImage_->width(); height = xImage_->height(); } // For the axis that is shrank, we need to stop the pick for a number of // times that gets a step along that axis of the right number. int yskip = 0; int xskip = 0; if ( rys < 0 ) { yskip = -rys; } if ( rxs < 0 ) { xskip = -rxs; } // Skip counters. int xc = 0; int yc = 0; for ( i = y0; i <= y1; i++ ) { xc = 0; for ( j = x0; j <= x1; j++ ) { cl = llookup(getVal(rawImage, src)); // replicate the source pixel to an xs x ys box int maxN = min(l+ys,height), maxM = min(k+xs,width); for ( n = l; n < maxN; n++ ) { for ( m = k; m < maxM; m++ ) { if ( rotate_ ) { xImage_->putpixel( n, m, cl ); } else { xImage_->putpixel( m, n, cl ); } } } // When xScale_ < 0 need to use same pixel again... xc++; if ( xc >= xskip ) { k += xs; xc = 0; } src += src_x_inc; } k = dest_x * xs; // When yScale_ < 0 need to use same pixel again... yc++; if ( yc >= yskip ) { l += ys; yc = 0; } src += src_y_inc; } } /* * get samples of a square box * rawImage : input array * idx : offset in array * wbox : width of box * samples : output vector * returns the number of pixels in the output array samples */ inline int CLASS_NAME::getBsamples(DATA_TYPE *rawImage, int idx, int wbox, DATA_TYPE *samples) { int i, k, src; for (k = 0; k < wbox; k++) { src = idx + k * width_; for (i = 0; i < wbox; i++) { *samples++ = getVal(rawImage, src++); } } return (wbox * wbox); } /* * get samples of a square box (only "black" values on chess-board) * rawImage : input array * idx : offset in array * wbox : width of box * samples : output vector * returns the number of pixels in the output array samples */ inline int CLASS_NAME::getCsamples(DATA_TYPE *rawImage, int idx, int wbox, DATA_TYPE *samples) { int i, k, src; for (k = 0; k < wbox; k++) { src = idx + k * width_ + k%2; for (i = 0; i < wbox; i += 2) { *samples++ = getVal(rawImage, src+i); } } return ((wbox * wbox) / 2 + wbox%2); } /* * get samples on a diagonal cross of a square box * rawImage : input array * idx : offset in array * wbox : width of box * samples : output vector * returns the number of pixels in the output array samples */ inline int CLASS_NAME::getXsamples(DATA_TYPE *rawImage, int idx, int wbox, DATA_TYPE *samples) { int i, n = 0, m = wbox/2; int offs = wbox -1; int idxo = idx + offs; int woff = width_ * offs; if (wbox %2 != 0) { n++; *samples++ = getVal(rawImage, idx + width_ * m + m); /* center pixel of cross */ } for (i = 0; i < m; i++) { *samples++ = getVal(rawImage, idx); *samples++ = getVal(rawImage, idxo); *samples++ = getVal(rawImage, idx + woff); *samples++ = getVal(rawImage, idxo + woff); idx += width_ + 1; offs -= 2; idxo = idx + offs; woff = width_ * offs; } return (n + m * 4); } /* * get median value of array samples * samples : data vector * n : number of pixels in vector samples * returns the median value of vector samples */ inline DATA_TYPE CLASS_NAME::getMedian(DATA_TYPE *samples, int n) { int i, k; DATA_TYPE *pi, *pk = samples, tmp; for (k = 0; k < n; k++, pk++) { pi = samples + k+1; for (i = k+1; i < n; i++, pi++) { if (*pk < *pi) { tmp = *pk; *pk = *pi; *pi = tmp; } } } return (*(samples + n/2)); } /* * get RMS value of array samples * samples : data vector * n : number of pixels in vector samples * returns the RMS value of vector samples */ inline DATA_TYPE CLASS_NAME::getRMS(DATA_TYPE *samples, int n) { int i, cnt = 0; double sum = 0.0, sumsq = 0.0; DATA_TYPE value; for (i = 0; i < n; i++) { value = *samples++; cnt++; sumsq += value * value; sum += value; } if (cnt < 2) return ((DATA_TYPE) 0); value = (DATA_TYPE)sqrt((sumsq - ((sum * sum) / cnt)) / (cnt -1)); return (value); } /* * get value of a shrunk image which is not subsampled * rawImage : input array * idx : offset in array * wbox : width of box * samples : allocated temporary array * xs : scale factor * returns the value according to the sampling method */ inline DATA_TYPE CLASS_NAME::getBoxVal(DATA_TYPE *rawImage, int idx, int wbox, DATA_TYPE *samples, int xs) { DATA_TYPE value; DATA_TYPE *psamples = samples; int n, m; double sum; switch (sampmethod_) { case SAMP_METHOD_MIN: m = getBsamples(rawImage, idx, wbox, samples); for (n = 1, value = *psamples++; n < m; n++, psamples++) { if (*psamples < value) value = *psamples; } return (value); case SAMP_METHOD_MEAN: m = getBsamples(rawImage, idx, wbox, samples); for (n = 0, sum = 0.0; n < m; n++) { sum += *psamples++; } return ((DATA_TYPE) (sum / m)); case SAMP_METHOD_MEDIAN: m = getBsamples(rawImage, idx, wbox, samples); return (getMedian(samples, m)); case SAMP_METHOD_RMS: m = getBsamples(rawImage, idx, wbox, samples); return ((DATA_TYPE)getRMS(samples, m)); case SAMP_METHOD_MAX_CROSS: m = getXsamples(rawImage, idx, wbox, samples); for (n = 1, value = *psamples++; n < m; n++, psamples++) { if (*psamples > value) value = *psamples; } return (value); case SAMP_METHOD_MIN_CROSS: m = getXsamples(rawImage, idx, wbox, samples); for (n = 1, value = *psamples++; n < m; n++, psamples++) { if (*psamples < value) value = *psamples; } return (value); case SAMP_METHOD_MEAN_CROSS: m = getXsamples(rawImage, idx, wbox, samples); for (n = 0, sum = 0.0; n < m; n++) { sum += *psamples++; } return ((DATA_TYPE) (sum / m)); case SAMP_METHOD_MEDIAN_CROSS: m = getXsamples(rawImage, idx, wbox, samples); return (getMedian(samples, m)); case SAMP_METHOD_MEDIAN_CHESS: m = getCsamples(rawImage, idx, wbox, samples); return (getMedian(samples, m)); case SAMP_METHOD_MEDIAN_9: wbox = (xs < 3) ? 1 : 3; m = getBsamples(rawImage, idx, wbox, samples); return (getMedian(samples, m)); default: /* SAMP_METHOD_MAX */ m = getBsamples(rawImage, idx, wbox, samples); for (n = 1, value = *psamples++; n < m; n++, psamples++) { if (*psamples > value) value = *psamples; } return (value); } return (0); } /* * This method is called to shrink the image. If subsample_ is 1, just * take every nth pixel as a sample, otherwise take the max of the * surrounding pixels * * The arguments x0, y0, x1 and y1 are the bounding box of the region * of the raw image that needs to be copied (origin at upper left (0,0)). * * dest_x and dest_y give the coordinates in the XImage where copying * should start. These are normally either (x0,y0) or (0,0). * * Note: there is a (non-fatal) bug here that shows up when dest_x,dest_y are non-zero, * (the image display gets split or mixed up somehow...) - needs some * testing to see what the cause is. */ void CLASS_NAME::shrink(int x0, int y0, int x1, int y1, int dest_x, int dest_y) { int p=0, q=0; int i, j, n, m; int xs = -xScale_, ys = -yScale_; initGetVal(); // init flag for speeding up bias subtraction // for odd shrink factors, we have to be carefull about the end conditions x1 -= (x1-x0+1)%xs; y1 -= (y1-y0+1)%ys; int w = x1-x0+1; // row/col increments int src_x_inc, src_y_inc; int dest_x_inc, dest_y_inc; // source/dest images DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); int src; byte* dest = xImageData_; byte* end = xImageData_ + xImageSize_ - 1; DATA_TYPE maxval = 0; // set loop increments based on current transformations switch (flipX_<<1|flipY_) { case 0: // none src = (height_ - ys - y0) * width_ + x0; src_x_inc = xs; src_y_inc = -width_ * ys - w; break; case 1: // flipY src = y0 * width_ + x0; src_x_inc = xs; src_y_inc = width_ * ys - w; break; case 2: // flipX src = (height_ - ys - y0) * width_ + (width_ - xs - x0); src_x_inc = -xs; src_y_inc = -(width_ * ys - w); break; case 3: // flipX and flipY src = y0 * width_ + (width_ - xs - x0); src_x_inc = -xs; src_y_inc = width_ * ys + w; break; } if ( xImageBytesPerPixel_ == 1 ) { // use faster methods for byte xImages // set args for rotate in dest image if (rotate_) { dest_x_inc = xImageBytesPerLine_; dest_y_inc = -(w/xs * xImageBytesPerLine_ - 1); dest += xImageBytesPerLine_ * (dest_x/xs) + (dest_y/ys); } else { dest_x_inc = 1; dest_y_inc = xImageBytesPerLine_ - w/xs; dest += xImageBytesPerLine_ * (dest_y/ys) + (dest_x/xs); } // copy the raw data to the X image... if (subsample_) { // use faster "subsample" algorithm for (i=y0; i<=y1; i+=ys) { for (j=x0; j<=x1; j+=xs) { if (dest > end) { break; } *dest = lookup(getVal(rawImage, src)); dest += dest_x_inc; src += src_x_inc; } src += src_y_inc; dest += dest_y_inc; } } else { // don't subsample: take max pixel for (i=y0; i<=y1; i+=ys) { for (j=x0; j<=x1; j+=xs) { if (dest > end) { break; } q = p = src; for (n=0; n maxval) maxval = getVal(rawImage, p); } p = q += width_; } *dest = lookup(maxval); maxval = 0; dest += dest_x_inc; src += src_x_inc; } src += src_y_inc; dest += dest_y_inc; } } return; } // XImage depth greater than a byte. Use careful methods to // keep byte order etc. correct for server. int k = dest_x / xs; int l = dest_y / ys; if (subsample_ || xs < 2 || ys < 2) { // use faster "subsample" algorithm for (i=y0; i<=y1; i+=ys) { for (j=x0; j<=x1; j+=xs) { if ( rotate_ ) { xImage_->putpixel( l, k, llookup(getVal(rawImage, src))); } else { xImage_->putpixel( k, l, llookup(getVal(rawImage, src))); } k++; src += src_x_inc; } src += src_y_inc; k = dest_x / xs; l++; } return; } // don't subsample: take pixel defined by sampling method DATA_TYPE *samples = new DATA_TYPE[xs * ys]; DATA_TYPE vsamp; int wbox = xs < ys ? xs : ys; for (i = y0; i < y1; i += ys, src += src_y_inc, k = dest_x / xs, l++) { for (j = x0; j < x1; j += xs, src += src_x_inc) { vsamp = getBoxVal(rawImage, src, wbox, samples, xs); if ( rotate_ ) xImage_->putpixel(l, k++, llookup(vsamp)); else xImage_->putpixel(k++, l, llookup(vsamp)); } } delete[] samples; } /* * Set the cut levels using a median filtering algorithm. * To save time, only a center area of the visible image is examined. */ void CLASS_NAME::medianFilter() { getMinMax(); // get min/max pixel estimate for visible area DATA_TYPE *rawImage = (DATA_TYPE*)image_.dataPtr(); // image data const int nmed = 7; // length of median filter int xskip = nmed*3, yskip = 3; // skip pixels for speed int x0 = x0_ + 10; // ignore outside areas int y0 = y0_ + 10; int x1 = x1_ - 10; int y1 = y1_ - 10; int i, j, k, l; int p=0; DATA_TYPE tmp; DATA_TYPE val, lcut, hcut, medary[nmed]; // use this value as a default in place of bad pixels (blank, NAN) DATA_TYPE mval = (DATA_TYPE)((minValue_ + maxValue_)/2); initGetVal(); // init flag for speeding up bias subtraction if (x1-x0 <= nmed || y1-y0 <= nmed) return; for (i=y0; i<=y1; i+=yskip) { for (j=x0; j<=x1; j+=xskip) { p = i*width_ + j; // get array for finding meadian for (k=0; k < nmed; k++) { medary[k] = getVal(rawImage, p++); // ignore blank pixels and NANs if (ISNAN(medary[k]) || (haveBlank_ && medary[k] == blank_)) { medary[k] = mval; } } // get median value for (k=0; k < nmed; k++) { for (l=k; l < nmed; l++) { if (medary[k] < medary[l]) { tmp = medary[l]; medary[l] = medary[k]; medary[k] = tmp; } } } val = medary[nmed/2]; if ( val == mval ) { if ( i == y0 ) { lcut = hcut = 0; // To be safe. } continue; // PWD: Skip runs of blank pixels. } if (i == y0) // set initial low and high cut values lcut = hcut = val; else { // compare meadian with lcut, hcut if (val < lcut) lcut = val; if (val > hcut) hcut = val; } } } setCutLevels(lcut, hcut, 0); } /* * Fill the given array (xyvalues) with statistics about the distribution * of pixels in the visible image area (given by x0_, y0_, x1_, y1_). * xyvalues[n*2+1] is set to the number of pixels with value at or near n. * The factor is used to fit the information in the given size aray. */ void CLASS_NAME::getPixDist(int numValues, double* xyvalues, double factor) { DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); DATA_TYPE mv = (DATA_TYPE)minValue_; DATA_TYPE value; initGetVal(); // init flag for speeding up bias subtraction // the Y values are the number of pixels in a given range // note: to save time, don't check all the pixels, just a // number of sample lines in the visible area of the image. if (x1_ <= x0_ || y1_ <= y0_) return; for (int i=y0_; i= 0 && idx < numValues) xyvalues[idx*2+1]++; } } } /* * Fill the given histogram with the distribution of pixels in the * visible image area (given by x0_, y0_, x1_, y1_). h.histogram[n] is * set to the number of pixels with a value of n (after conversion to * short if needed). */ void CLASS_NAME::getHistogram(ImageDataHistogram& hist) { DATA_TYPE* rawImage = (DATA_TYPE*)image_.dataPtr(); DATA_TYPE value; initGetVal(); // init flag for speeding up bias subtraction // if we are looking at the whole image, ignore the margin int w = x1_ - x0_ + 1, h = y1_ - y0_ + 1; int xmargin = 0, ymargin = 0; if (w == width_) xmargin = int(w * 0.2); if (y0_ == 0) ymargin = int(h * 0.2); int x0 = x0_ + xmargin; int y0 = y0_ + ymargin; int x1 = x1_ - xmargin; int y1 = y1_ - ymargin; // the array values are the number of pixels in a given range // note: to save time, don't check all the pixels, just a // number of sample lines in the visible area of the image. if (x1 <= x0 || y1 <= y0) { hist.area = 0; return; } hist.area = (x1 - x0) * (y1 - y0); for (int i=y0; i #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "ImageDisplay.h" #include "ImageZoom.h" /* * constructor: create the zoom GC and XImage. * * Args: * * tkwin - the Tk window for displaying the zoomed image * * copyGC - X GC used to copy image to zoom window * * width, height - dimensions of tkwin (should be square and a multiple * of the zoom factor) * * zoomFactor - the zoom magnification factor * * usingXShm - flag: true if using X shared memory * * verbose - flag: if true, print diagnostic messages * */ ImageZoom::ImageZoom(Tk_Window tkwin, GC gc, int width, int height, int zoomFactor, int usingXShm, int verbose) : tkwin_(tkwin), gc_(gc), width_(width), height_(height), zoomFactor_(zoomFactor), zoomStep_(width/zoomFactor), status_(TCL_OK) { // make a graphics context using XOR to draw a box marking the pointer hotspot XGCValues gcValues; gcValues.function = GXcopy; gcValues.graphics_exposures = False; Tk_MakeWindowExist(tkwin_); rect_gc_ = XCreateGC(Tk_Display(tkwin_), Tk_WindowId(tkwin_), GCFunction|GCGraphicsExposures, &gcValues); // create a class object to manage the XImage xImage_ = new ImageDisplay(Tk_Display(tkwin_), Tk_Visual(tkwin_), gc, Tk_Depth(tkwin_), usingXShm, verbose); status_ = xImage_->update(width, height); } ImageZoom::~ImageZoom() { if (xImage_) delete xImage_; } /* * Called for motion events in image window when zooming is on. * * Args: * * data - pointer to data being displayed * x, y - coords in displayed image (XImage coords) * w, h - width (bytesPerLine) and height of displayed image * xs, ys - x and y magnification factors * color0 - color to use for blank areas with no image data */ void ImageZoom::zoom(unsigned char* data, int x, int y, int w, int h, int xs, int ys, unsigned long color0) { if (status_ != TCL_OK) return; char pixval = color0; register unsigned char* zoomData = xImage_->data(); int zs = zoomStep_ >> 1; int incr = width_ * (zoomFactor_ - 1); int xz = x - zs; int yz = y - zs; int i, j, k, l; for (i=0; i= w || (yz + i) < 0 || (yz + i) >= h) { pixval = color0; } else { pixval = data[(yz+i)*w + xz + j]; } for (k=0; kput(Tk_WindowId(tkwin_), 0, 0, Tk_X(tkwin_), Tk_Y(tkwin_), width_, height_); /* draw 2 rectangles around the center pixel(s) */ int size = zoomFactor_; int x0 = width_/2 - size/2; int y0 = height_/2 - size/2; Screen* screen = Tk_Screen(tkwin_); XSetForeground(Tk_Display(tkwin_), rect_gc_, WhitePixelOfScreen(screen)); XSetBackground(Tk_Display(tkwin_), rect_gc_, BlackPixelOfScreen(screen)); XDrawRectangle(Tk_Display(tkwin_), Tk_WindowId(tkwin_), rect_gc_, x0, y0, size, size); XSetForeground(Tk_Display(tkwin_), rect_gc_, BlackPixelOfScreen(screen)); XSetBackground(Tk_Display(tkwin_), rect_gc_, WhitePixelOfScreen(screen)); XDrawRectangle(Tk_Display(tkwin_), Tk_WindowId(tkwin_), rect_gc_, x0-1, y0-1, size+2, size+2); } skycat-3.1.2-starlink-1b/rtd/generic/ImageZoom.h000066400000000000000000000030631215713201500214040ustar00rootroot00000000000000// -*-c++-*- #ifndef _ImageZoom_h_ #define _ImageZoom_h_ /* * E.S.O. - VLT project * "@(#) $Id: ImageZoom.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ImageZoom.h - class definitions for RtdImage Zoom Window * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created */ #include /* * Class ImageZoom * * This class implements the Zoom window for the RtdImage class */ class ImageZoom { protected: Tk_Window tkwin_; // zoom window GC gc_; // graphics context for copying pixels GC rect_gc_; // graphics context for drawing box aroung center pixels int width_; // width of displayed image int height_; // height of displayed image int zoomFactor_; // zoom factor (1...n) int zoomStep_; // value used to calculate zoom = width/factor ImageDisplay *xImage_; // class object for zoom window's X image int status_; // return value from constructor public: // constructor: initialize the zoom window ImageZoom(Tk_Window tkwin, GC copyGC, int width, int height, int factor, int usingXShm, int verbose); // destructor: clean up resources ~ImageZoom(); // called for motion events in the image to do the zooming void zoom(unsigned char* data, int x, int y, int w, int h, int xs, int ys, unsigned long color0); // return status after constructor for error checking int status() {return status_;} }; #endif /* _ImageZoom_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/LongImageData.C000066400000000000000000000123011215713201500220770ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: LongImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * LongImageData.C - member functions for class LongImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 24/01/97 Inverted sense of scaled_ test. * Changed to use macro FITS_LONG as long is * 64 bit on alphas and the "long" integers * read in from FITS files are 32 bit. * 12/06/98 Modified derivation of scaled blank value * to avoid problems with bias * over/underflowing the value, when at an * extreme (I set this to -MIN_LONG_INT, * minus the bias and it underflows). * 10/07/98 Stopped convertToShort. Still problems * with blank pixels that I'm able to * resolve. The scaled variant works fine. * 14/07/98 Added checks for blanks in convert and * scale ToShort. * pbiereic 17/02/03 Added 'using namespace std'. * Peter W. Draper 23/06/09 Added parseBlank to get blank value in this type. */ using namespace std; #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "LongImageData.h" /* * convert the given long int to short by adding the integer bias * and checking the range */ short LongImageData::convertToShort(FITS_LONG l) { register FITS_LONG v = l + bias_; short s; // If have blank pixels then test for this as cannot deal with // pixel values at extremes (these wrap and come out in strange // places). if ( haveBlank_ ) { if ( blank_ == l ) { return LOOKUP_BLANK; } } if (v < LOOKUP_MIN ) s = LOOKUP_MIN; else if (v > LOOKUP_MAX ) s = LOOKUP_MAX; else s = (short) v; return s; } /* * convert the given long int to short by adding the integer bias, * scaling, rounding if necessary and checking the range */ short LongImageData::scaleToShort(FITS_LONG l) { // If have blank pixels then test for this as cannot deal with // pixel values at extremes (these wrap and come out in strange // places). if ( haveBlank_ ) { if ( blank_ == l ) { return LOOKUP_BLANK; } } short s; double d = (l + dbias_) * scale_; if (d < 0.0 ) { if((d -= 0.5) < LOOKUP_MIN) s = LOOKUP_MIN; else s = (short)d; } else { if((d += 0.5) > LOOKUP_MAX) s = LOOKUP_MAX; else s = (short)d; } return s; } /* * initialize conversion from base type long to short * and scale the low and high cut levels to short range * * Method: 3 member variables are set here and used later to convert * the long raw image data to short, which is then used as an index * in the lookup table to get the byte value: * * bias_ = offset * dbias_ = double offset, used when scale != 1.0 * scale_ = scale factor for conversion * : */ void LongImageData::initShortConversion() { // PWD: removed this code as under/overflow problems lead to // occasionally strange images. // if ((highCut_ - lowCut_) <= (LOOKUP_WIDTH)) { // // if a simple offset suffices // scale_ = 1.0; // if ((lowCut_ >= LOOKUP_MIN) && (highCut_ <= LOOKUP_MAX)) { // // if possible to truncate to short without bias, do so. // bias_ = 0; // } // else { // // offset by average to center within range // bias_ = (int)(-((lowCut_ + highCut_) / 2.0)); // } // dbias_ = bias_; // scaledLowCut_ = convertToShort((FITS_LONG)lowCut_); // scaledHighCut_ = convertToShort((FITS_LONG)highCut_); // if (haveBlank_) // scaledBlankPixelValue_ = convertToShort(blank_); // } // else { // full-up scaling required. (+/- (tmax-tmin)/2) // offset values to be zero centered scale_ = LOOKUP_WIDTH / (highCut_ - lowCut_); dbias_ = -((lowCut_ + highCut_) * 0.5); bias_ = (int)dbias_; scaledLowCut_ = scaleToShort((FITS_LONG)lowCut_); scaledHighCut_ = scaleToShort((FITS_LONG)highCut_); if (haveBlank_) scaledBlankPixelValue_ = LOOKUP_BLANK; // } // set int flag for later quick check if scale_ != 1.0 scaled_ = (scale_ != 1.0); // Sense inverted - PWD } /* * Set the blank value from a given string. Return 1 if successful. */ int LongImageData::parseBlank(const char* value) { long l; int n = sscanf(value, "%ld", &l); if ( n > 0 ) { blank_ = (FITS_LONG) l; } return n; } /* * Include some standard methods as (cpp macro) templates: * These are methods that are the same for all derived classes of ImageData, * except that they work on a different raw data type */ #define CLASS_NAME LongImageData #define DATA_TYPE FITS_LONG #ifndef NTOH # define NTOH(x) SWAP32(x) #endif #include "ImageTemplates.icc" #undef NTOH #undef CLASS_NAME #undef DATA_TYPE #undef NTOH skycat-3.1.2-starlink-1b/rtd/generic/LongImageData.h000066400000000000000000000062151215713201500221530ustar00rootroot00000000000000// -*-c++-*- /* * E.S.O. - VLT project * * "@(#) $Id: LongImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * $Id: LongImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * LongImageData.h - class definitions for class LongImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 24/01/97 Added FITS_LONG macro changes * P.Biereichel 22/03/99 Added definitions for bias subtraction */ #include #include "ImageData.h" // The type "long" may have up to 64 bits on alpha machines. FITS // defines the long we want to use as 32 bits, so use a macro to // replace the long data type with plain int when appropriate. #if SIZEOF_LONG == 8 #define FITS_LONG int #else #define FITS_LONG long #endif // This class is used for images where the raw data is made up of ints class LongImageData : public ImageData { private: // value of blank pixel, if known (if haveBlankPixel_ is nonzero) FITS_LONG blank_; int bias_; // offset for long to short conversion double dbias_; // used when scale != 1.0 double scale_; // factor for long to short conversion int scaled_; // flag, true if scale_ != 1.0 // local methods used to get short index in lookup table short convertToShort(FITS_LONG); // convert long to short by adding bias short scaleToShort(FITS_LONG); // as above, but with scaling inline ushort convertToUshort(FITS_LONG l) { // unsigned return ushort(scaled_ ? scaleToShort(l) : convertToShort(l)); } // return X image pixel value for raw image value inline byte lookup(FITS_LONG l) { return lookup_[convertToUshort(l)]; } inline unsigned long llookup(FITS_LONG l) { return lookup_[convertToUshort(l)]; } // return NTOH converted value evtl. subtracted with corresponding bias value FITS_LONG getVal(FITS_LONG* p, int idx); int getXsamples(FITS_LONG *rawImage, int idx, int wbox, FITS_LONG *samples); int getBsamples(FITS_LONG *rawImage, int idx, int wbox, FITS_LONG *samples); int getCsamples(FITS_LONG *rawImage, int idx, int wbox, FITS_LONG *samples); FITS_LONG getMedian(FITS_LONG *samples, int n); FITS_LONG getBoxVal(FITS_LONG *rawImage, int idx, int wbox, FITS_LONG *samples, int xs); FITS_LONG getRMS(FITS_LONG *samples, int n); protected: // initialize conversion from base type to short, void initShortConversion(); public: // constructor LongImageData(const char* name, const ImageIO& imio, int verbose) : ImageData(name, imio, verbose), blank_(0) {} // return class name as a string virtual const char* classname() { return "LongImageData"; } // return the data type of the raw data int dataType() {return LONG_IMAGE;} // return true if the data type is signed int isSigned() {return 1;} // return a copy of this object ImageData* copy() {return new LongImageData(*this);} // include declarations for methods that differ only in raw data type # include "ImageTemplates.h" }; skycat-3.1.2-starlink-1b/rtd/generic/LongLongImageData.C000066400000000000000000000067221215713201500227310ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: LongLongImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * LongLongImageData.C - member functions for class LongLongImageData * * who when what * -------------- -------- ---------------------------------------- * pbiereic 12/08/07 Created * Peter W. Draper 23/06/09 Added parseBlank to get blank value in this type. */ using namespace std; #include #include #include #include #include #include #include "LongLongImageData.h" #include "define.h" /* * convert the given long int to short by adding the integer bias * and checking the range */ short LongLongImageData::convertToShort(FITS_LONGLONG l) { register FITS_LONGLONG v = l + bias_; short s; // If have blank pixels then test for this as cannot deal with // pixel values at extremes (these wrap and come out in strange // places). if ( haveBlank_ ) { if ( blank_ == l ) { return LOOKUP_BLANK; } } if (v < LOOKUP_MIN ) s = LOOKUP_MIN; else if (v > LOOKUP_MAX ) s = LOOKUP_MAX; else s = (short) v; return s; } /* * convert the given long int to short by adding the integer bias, * scaling, rounding if necessary and checking the range */ short LongLongImageData::scaleToShort(FITS_LONGLONG l) { // If have blank pixels then test for this as cannot deal with // pixel values at extremes (these wrap and come out in strange // places). if ( haveBlank_ ) { if ( blank_ == l ) { return LOOKUP_BLANK; } } short s; double d = (l + dbias_) * scale_; if (d < 0.0 ) { if((d -= 0.5) < LOOKUP_MIN) s = LOOKUP_MIN; else s = (short)d; } else { if((d += 0.5) > LOOKUP_MAX) s = LOOKUP_MAX; else s = (short)d; } return s; } /* * initialize conversion from base type long to short * and scale the low and high cut levels to short range * * Method: 3 member variables are set here and used later to convert * the long raw image data to short, which is then used as an index * in the lookup table to get the byte value: * * bias_ = offset * dbias_ = double offset, used when scale != 1.0 * scale_ = scale factor for conversion * : */ void LongLongImageData::initShortConversion() { // full-up scaling required. (+/- (tmax-tmin)/2) // offset values to be zero centered scale_ = LOOKUP_WIDTH / (highCut_ - lowCut_); dbias_ = -((lowCut_ + highCut_) * 0.5); bias_ = (int)dbias_; scaledLowCut_ = scaleToShort((FITS_LONGLONG)lowCut_); scaledHighCut_ = scaleToShort((FITS_LONGLONG)highCut_); if (haveBlank_) scaledBlankPixelValue_ = LOOKUP_BLANK; // set int flag for later quick check if scale_ != 1.0 scaled_ = (scale_ != 1.0); // Sense inverted - PWD } /* * Set the blank value from a given string. Return 1 if successful. */ int LongLongImageData::parseBlank(const char* value) { long l; int n = sscanf(value, "%ld", &l); if ( n > 0 ) { blank_ = (FITS_LONGLONG) l; } return n; } /* * Include some standard methods as (cpp macro) templates: * These are methods that are the same for all derived classes of ImageData, * except that they work on a different raw data type */ #define CLASS_NAME LongLongImageData #define DATA_TYPE FITS_LONGLONG #ifndef NTOH # define NTOH(x) SWAP64(x) #endif #include "ImageTemplates.icc" #undef NTOH #undef CLASS_NAME #undef DATA_TYPE #undef NTOH skycat-3.1.2-starlink-1b/rtd/generic/LongLongImageData.h000066400000000000000000000053641215713201500227770ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: LongLongImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * $Id: LongLongImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * LongLongImageData.h - class definitions for class LongLongImageData * * who when what * -------------- -------- ---------------------------------------- * pbiereic 12/08/07 Created */ #include #include "ImageData.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #define FITS_LONGLONG long long // This class is used for images where the raw data is made up of ints class LongLongImageData : public ImageData { private: // value of blank pixel, if known (if haveBlankPixel_ is nonzero) FITS_LONGLONG blank_; int bias_; // offset for long to short conversion double dbias_; // used when scale != 1.0 double scale_; // factor for long to short conversion int scaled_; // flag, true if scale_ != 1.0 // local methods used to get short index in lookup table short convertToShort(FITS_LONGLONG); // convert long to short by adding bias short scaleToShort(FITS_LONGLONG); // as above, but with scaling inline ushort convertToUshort(FITS_LONGLONG l) { // unsigned return ushort(scaled_ ? scaleToShort(l) : convertToShort(l)); } // return X image pixel value for raw image value inline byte lookup(FITS_LONGLONG l) { return lookup_[convertToUshort(l)]; } inline unsigned long llookup(FITS_LONGLONG l) { return lookup_[convertToUshort(l)]; } // return NTOH converted value evtl. subtracted with corresponding bias value FITS_LONGLONG getVal(FITS_LONGLONG* p, int idx); int getXsamples(FITS_LONGLONG *rawImage, int idx, int wbox, FITS_LONGLONG *samples); int getBsamples(FITS_LONGLONG *rawImage, int idx, int wbox, FITS_LONGLONG *samples); int getCsamples(FITS_LONGLONG *rawImage, int idx, int wbox, FITS_LONGLONG *samples); FITS_LONGLONG getMedian(FITS_LONGLONG *samples, int n); FITS_LONGLONG getBoxVal(FITS_LONGLONG *rawImage, int idx, int wbox, FITS_LONGLONG *samples, int xs); FITS_LONGLONG getRMS(FITS_LONGLONG *samples, int n); protected: // initialize conversion from base type to short, void initShortConversion(); public: // constructor LongLongImageData(const char* name, const ImageIO& imio, int verbose) : ImageData(name, imio, verbose), blank_(0) {} // return the data type of the raw data int dataType() {return LONGLONG_IMAGE;} // return true if the data type is signed int isSigned() {return 1;} // return a copy of this object ImageData* copy() {return new LongLongImageData(*this);} // include declarations for methods that differ only in raw data type # include "ImageTemplates.h" }; skycat-3.1.2-starlink-1b/rtd/generic/LookupTable.C000066400000000000000000000230071215713201500216710ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: LookupTable.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * LookupTable.C - method definitions for class LookupTable, managing image * pixel lookup tables for converting pixel values to * XImage bytes, with scaling algorithms applied. * * This class is used to convert image pixel values to bytes, with color * scaling algorithms applied, for displaying in an XImage. For example, * to convert 16-bit shorts to bytes, a lookup table of size 64k is * used. For byte values, a lookup table of size 256 can be used. For * integers, floats and doubles, it is best to scale the values down to * shorts first and then use a 64k sized lookup table to apply the * scaling algorithms (linear, log, sqrt, histeq). Using a large lookup * table takes more memory, but saves time later when converting pixel * values for display. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 09 Aug 96 Created * Peter W. Draper 19 Aug 11 Make log and sqrt scalings use different * powers. This differentiates them and makes * them more like other display tools. */ static const char* const rcsId="@(#) $Id: LookupTable.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "error.h" #include "LookupTable.h" #include "Fits_IO.h" // borrowed this from saoimage extern "C" { #include "histeq.h" } // this is only defined on SUN ? #undef expm1 #define expm1(a) (exp(a)-1) /* * constructor: create new image memory area */ LookupTable::LookupTable(int size) : rep_(new LookupTableRep(size)) { } /* * copy constructor - increment the reference count... */ LookupTable::LookupTable(const LookupTable& im) : rep_(im.rep_) { if (rep_) rep_->refcnt_++; } /* * destructor - delete if there are no more references. */ LookupTable::~LookupTable() { if (rep_ && --rep_->refcnt_ <= 0) delete rep_; } /* * assignment operator */ LookupTable& LookupTable::operator=(const LookupTable& im) { im.rep_->refcnt_++; // protect against "im = im" if (rep_ && --rep_->refcnt_ <= 0) { delete rep_; } rep_ = im.rep_; return *this; } /* ---------- internal rep ----------- */ /* * constructor - internal rep */ LookupTableRep::LookupTableRep(int size) : lookup_(new unsigned long[size]), size_(size), refcnt_(1), status_(0) { if (lookup_ == NULL) status_ = error("no memory for lookup table"); } /* * destructor - internal rep */ LookupTableRep::~LookupTableRep() { delete[] lookup_; } /* * reset to given color */ void LookupTableRep::reset(unsigned long color) { if (lookup_) { for(int i = 0; i < size_; i++) lookup_[i] = color; } } /* -------------- color scaling -------------------- */ /* * fill in the lookup table at the end after the high cut level has been * reached. * * pixval is the color value to use for image values >= imageval. * isSigned is a flag: should be set to true if the pixel values are signed. */ void LookupTableRep::fillLookup(int pixval, int imageval, int isSigned) { // note: unsigned image values fill up the lookup array sequentially // but for signed image values, -1 is at the end due to the cast to // (ushort) to get a positive index. int n = isSigned ? size_/2 : size_; while( imageval < n) { ushort v = (ushort)imageval++; if (v < size_) { lookup_[v] = pixval; } } } /* * local util method: set the values in the lookup table from imageval to * imagelim to the given pixel value and increment imageval to the * new index. * Returns 1 if we've reached the end of the lookup table and should break * the loop. */ int LookupTableRep::setLookup(int& imageval, int imagelim, int pixval) { int ret = 0; // limit to size of lookup table if (imagelim > size_) { imagelim = size_; ret = 1; } while(imageval < imagelim) { ushort v = (ushort)imageval++; if (v < size_) lookup_[v] = pixval; } return ret; } /* * set the color value for a specific pixel value (blank pixel, for example) */ void LookupTableRep::setPixelColor(int pixval, unsigned long color) { ushort v = (ushort)pixval; if (v < size_) lookup_[v] = color; } /* * Set up the color lookup table for linear scaling. * * lcut and hcut are the low and high cut levels (scaled to the short range). * isSigned is a flag: should be set to true if the pixel values are signed. * ncolors is the number of pixel color values in the colors[] array. */ void LookupTableRep::linearScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors) { // input range / output range yields input cells per output cell double scale = (double)(hcut - lcut + 1) / ncolors; // upper bound is ideal edge between colors (offset for rounding) double upper_bound = lcut + 0.5; int maxcolor = ncolors - 1; int imageval = lcut; int level = 0; register int pixval = colors[0]; register int imagelim; while( level++ < maxcolor ) { upper_bound += scale; // limit to size of lookup table imagelim = (int)upper_bound; if (setLookup(imageval, imagelim, pixval)) break; // level was inc'd after loop test, make pixval for next round pixval = colors[level]; } // fill in at top if short of highCut fillLookup(pixval, imageval, isSigned); } /* * set up the color lookup table for logarithmic scaling: * distribute color levels in the map by a logorithmic or * exponential curve (powers of e). * * lcut and hcut are the low and high cut levels (scaled to the short range). * isSigned is a flag: should be set to true if the pixel values are signed. * ncolors is the number of pixel color values in the colors[] array. * expo is the optional exponent (def: 6.0). */ void LookupTableRep::logScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors, double expo) { int level = 0; register int imagelim; register int pixval = colors[0]; int maxcolor = ncolors - 1; int imageval = lcut; double scale; // base distribution on e**n as n goes from 0 to expo if(expo >= 0 ) { scale = (double)(hcut - lcut + 1) / expm1(expo); } else { // negative exponents allocate more levels toward the high values scale = (double)(hcut - lcut + 1) / (1.0 - exp(expo)); } while(level++ < maxcolor) { if (expo > 0) { imagelim = lcut + (int) ((expm1(((double)level / ncolors) * expo) * scale) + 0.5); } else { imagelim = lcut + (int) ((1.0-exp(((double)level / ncolors) * expo) * scale) + 0.5); } // limit map range to image values if (imagelim > hcut) imagelim = hcut; if (setLookup(imageval, imagelim, pixval)) break; // level was inc'd after loop test, make pixval for next round pixval = colors[level]; } // fill in at top if short of highCut fillLookup(pixval, imageval, isSigned); } /* * set up the color lookup table for exponential scaling * * lcut and hcut are the low and high cut levels (scaled to the short range). * isSigned is a flag: should be set to true if the pixel values are signed. * ncolors is the number of pixel color values in the colors[] array. * expo is the optional exponent (def: 2.0). */ void LookupTableRep::sqrtScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors, double expo) { int maxcolor = ncolors - 1; int imageval = lcut; double range = hcut - lcut + 1; int level = 0; register int imagelim; register int pixval = colors[0]; while( level++ < maxcolor ) { imagelim = lcut + (int) ((pow(((double)level / ncolors), expo) * range) + 0.5); // limit map range to image values if ( imagelim > hcut ) imagelim = hcut; if (setLookup(imageval, imagelim, pixval)) break; // level was inc'd after loop test, make pixval for next round pixval = colors[level]; } // fill in at top if short of hcut fillLookup(pixval, imageval, isSigned); } /* * Set up the color lookup table for histogram equalization scaling * * lcut and hcut are the low and high cut levels (scaled to the short * range). * * isSigned is a flag: should be set to true if the pixel values are * signed. * * minval is the min image pixel value. This is needed to map an index in * xyvalues to a pixel value, since xyvalue[0] corresponds to minval. * * ncolors is the number of pixel color values in the colors[] array. * * histogram is an array[SHORT_SIZE] generated from the image and maps * ushort image values to the number of pixels that have that value. * * area is the area (w*h) of the image area examined for the histogram. */ void LookupTableRep::histeqScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors, int* histogram, int area) { // if there are not enought pixel levels to distribute, // (or if it is a small lookup table) do linear scaling instead if ((hcut - lcut) <= ncolors) { linearScale(lcut, hcut, isSigned, ncolors, colors); return; } // Since we don't know how many colours will be used exactly // fill all lookup table with hcut. int llcut = lcut; fillLookup(colors[ncolors-1], llcut, isSigned); // int scaleOffset = SHORT_SIZE/2; // offset from allocated array to zero histogram_equalize(lookup_, histogram, area, lcut, hcut, ncolors, colors); } skycat-3.1.2-starlink-1b/rtd/generic/LookupTable.h000066400000000000000000000106461215713201500217430ustar00rootroot00000000000000// -*-c++-*- #ifndef _LookupTable_h_ #define _LookupTable_h_ /* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: LookupTable.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * LookupTable.h - declarations for class LookupTable, a class for managing * an image color lookup table used to convert image pixel * values to XImage byte values. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 09 Aug 96 Created * Peter W. Draper 03 Mar 98 Converted to use unsigned long values * (need this to support visuals & depths) */ #include #include #include #include typedef unsigned char byte; /* * This class is used internally for reference counting and subclassing. * The public interface is through the LookupTable class. */ class LookupTableRep { friend class LookupTable; protected: unsigned long* lookup_; // lookup table int size_; // size of lookup table int refcnt_; // reference count int status_; // status after constructor // local util methods void fillLookup(int pixval, int imageval, int isSigned); int setLookup(int& imageval, int imagelim, int pixval); public: // constructor (derived classes call this) LookupTableRep(int size); // destructor virtual ~LookupTableRep(); // normally you use either a lookup table for shorts or for bytes enum {SHORT_SIZE = 65536, BYTE_SIZE = 256}; // color scaling methods void linearScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors); void logScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors, double expo); void sqrtScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors, double expo); void histeqScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors, int* histogram, int area); // reset to given color void reset(unsigned long color); // set the color value for a specific pixel value (blank pixel, for example) void setPixelColor(int pixval, unsigned long color); }; /* * This class defines the public interface. It uses reference counting * with the above class to make it easier to implement different views of * the same image data. */ class LookupTable { private: LookupTableRep* rep_; // internal representation for reference counting public: // constructor LookupTable(int size); // copy constructor LookupTable(const LookupTable&); // constructor, from a pointer to a subclass of LookupTableRep LookupTable(LookupTableRep* rep) : rep_(rep) {} // destructor ~LookupTable(); // assignment LookupTable& operator=(const LookupTable&); // color scaling methods void linearScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors) { if (rep_) rep_->linearScale(lcut, hcut, isSigned, ncolors, colors); } void logScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors, double expo = 6.0) { if (rep_) rep_->logScale(lcut, hcut, isSigned, ncolors, colors, expo); } void sqrtScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors, double expo = 2.0) { if (rep_) rep_->sqrtScale(lcut, hcut, isSigned, ncolors, colors, expo); } void histeqScale(int lcut, int hcut, int isSigned, int ncolors, unsigned long* colors, int* histogram, int area) { if (rep_) rep_->histeqScale(lcut, hcut, isSigned, ncolors, colors, histogram, area); } // reset to given color void reset(unsigned long color) { if (rep_) rep_->reset(color); } // set the color value for a specific pixel value (blank pixel, for example) void setPixelColor(int pixval, unsigned long color) { if (rep_) rep_->setPixelColor(pixval, color); } // look up and return a value (this should be a fast, inline operation) // no check, for speed, not needed if using default lookup size unsigned long operator[](unsigned short i) { #ifdef DEBUG assert(rep_ && isize_); #endif return rep_->lookup_[i]; } // note: if status is non-zero, the other methods are undefined int status() const {return rep_ ? rep_->status_ : 1;} int size() const {return rep_->size_;} }; #endif /* _LookupTable_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/NativeImageData.C000066400000000000000000000033531215713201500224350ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: NativeImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * NativeImageData.C - cpp template definitions to support native byte * order images on byte swapped machines (i386, vax, etc.) * * This file uses some #defines to declare native versions of the * ImageData subclasses for use on byte swapped machines. On other * machines, this has no effect and no new classes are created. * * The purpose is to allow derived packages to use image types that are * either in native byte order already or have been read in and * byte-swapped already by a library routine. This can be controlled by a * flag set in a class derived from the ImageIO class (astrotcl/imageio). * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 20/03/98 Created * Peter W. Draper 07/04/05 Added __x86_64 * pbiereic 17/02/03 Native byte order routines revised */ #define NTOH(x) x #define ShortImageData NativeShortImageData #include "ShortImageData.C" #undef ShortImageData #undef NTOH #define NTOH(x) x #define UShortImageData NativeUShortImageData #include "UShortImageData.C" #undef UShortImageData #undef NTOH #define NTOH(x) x #define LongImageData NativeLongImageData #include "LongImageData.C" #undef LongImageData #undef NTOH #define NTOH(x) x #define FloatImageData NativeFloatImageData #include "FloatImageData.C" #undef FloatImageData #undef NTOH #define NTOH(x) x #define LongLongImageData NativeLongLongImageData #include "LongLongImageData.C" #undef LongLongImageData #undef NTOH #define NTOH(x) x #define DoubleImageData NativeDoubleImageData #include "DoubleImageData.C" #undef DoubleImageData #undef NTOH skycat-3.1.2-starlink-1b/rtd/generic/NativeImageData.h000066400000000000000000000023051215713201500224760ustar00rootroot00000000000000#ifndef _NativeImageData_h_ #define _NativeImageData_h_ /* * E.S.O. - VLT project * * "@(#) $Id: NativeImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 20/03/98 Created * pbiereic 17/02/03 Native byte order routines revised * Peter W. Draper 14/11/05 Added double support (back from my patches). * pbiereic 12/08/07 added data types double and long long int * Peter W. Draper 17/05/12 Merged skycat double version created by pbiereic. */ #define ShortImageData NativeShortImageData #include "ShortImageData.h" #undef ShortImageData #define UShortImageData NativeUShortImageData #include "UShortImageData.h" #undef UShortImageData #define LongImageData NativeLongImageData #include "LongImageData.h" #undef LongImageData #define FloatImageData NativeFloatImageData #include "FloatImageData.h" #undef FloatImageData #define LongLongImageData NativeLongLongImageData #include "LongLongImageData.h" #undef LongLongImageData #define DoubleImageData NativeDoubleImageData #include "DoubleImageData.h" #undef DoubleImageData #endif /* _NativeImageData_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/RtdCamera.C000066400000000000000000000172431215713201500213170ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: RtdCamera.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdCamera.C - member routines for class RtdCamera, * manages realtime image update for class RtdImage * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * D.Hopkinson 02/12/96 Added performance test object and timestamp method * P.Biereichel 17/06/97 Call rtdClose() in case of error * P.Biereichel 10/03/01 Removed check on semId = 0 which is a valid ID. * Added constructor argument 'debug' * Revised the whole source code, in particular the * interface to rtdServer. * Removed performance test object (handled by RtdImage()) * pbiereic 12/08/07 added support for data type long long int */ static const char* const rcsId="@(#) $Id: RtdCamera.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "RtdCamera.h" /* * constructor */ RtdCamera::RtdCamera(const char* name, Tcl_Interp* interp, int verbose, int debug, char* image) : name_(strdup(name)), interp_(interp), verbose_(verbose), debug_(debug), image_(image), eventHndl_(NULL), camera_(camBuf_), connected_(0), attached_(0), was_attached_(-1), shmNum_(-1), semId_(-1), dbl_(NULL) { #ifdef DEBUG debug_ = verbose_ = 1; #endif eventHndl_ = new rtdIMAGE_EVT_HNDL; memset(eventHndl_, '\0', sizeof(rtdIMAGE_EVT_HNDL)); camera(""); dbl_ = new RtdDebugLog((char *)"RtdCamera", (int) (debug_ & verbose_)); dbl_->log("Camera object created. RTD client=%s, rtdimage=%s\n", name_, image_); } /* * destructor */ RtdCamera::~RtdCamera() { pause(); disconnect(); } /* * This static method is called when there is a message to read * from the rtdServer: pass it on to member function fileEvent() * and update the Tcl global variables */ void RtdCamera::fileEventProc(ClientData clientData, int mask) { RtdCamera* thisPtr = (RtdCamera*)clientData; thisPtr->fileEvent(); thisPtr->updateGlobals(); } /* * Read the message from the rtdServer and call a virtual method to * display the image and evaluate the tcl event scripts. */ int RtdCamera::fileEvent() { Mem mem; rtdIMAGE_INFO info; int stat; memset(&info, '\0', sizeof(rtdIMAGE_INFO)); info.semId = info.shmNum = -1; stat = rtdRecvImageInfo(eventHndl_, &info, verbose_, buffer_); semId_ = info.semId; shmNum_ = info.shmNum; if (stat != RTD_OK || checkType(info.dataType) != RTD_OK || info.xPixels <=0 || info.yPixels <= 0) { checkStat(); return TCL_ERROR; } if ( ! attached()) { semDecr(); return TCL_OK; } /* * class Mem takes care of possible reusing previous shared memory areas * and cleanup. Choose the constructor depending on whether the * semaphore fields of the image info have been set. */ int bytes = info.xPixels * info.yPixels * (abs(info.dataType) / 8); if (semId_ > 0) mem = Mem(bytes, info.shmId, 0, verbose_, shmNum_, semId_); else mem = Mem(bytes, info.shmId, 0, verbose_); if (mem.status() != 0) { checkStat(); return TCL_ERROR; } dbl_->log("image event: Id=%d, x=%d, y=%d, width=%d, height=%d, " "shmId=%d shmNum=%d semId=%d\n", info.frameId, info.frameX, info.frameY, info.xPixels, info.yPixels, info.shmId, shmNum_, semId_); /* * before displaying the image delete the file handler. This blocks * new image events which must not be handled between camera pre/post commands. */ fileHandler(0); // call the virtual method in a derived class to display the image int disperr = display(info, mem); // re-install the file handler fileHandler(1); // finally decrement the semaphore semDecr(); return disperr; } /* * After failure of an image event decrement the semaphore * and check status of rtdServer */ void RtdCamera::checkStat() { semDecr(); rtdServerCheck(); } /* * create/delete the Tcl file handler */ void RtdCamera::fileHandler(int create) { if (! eventHndl_->socket) return; if (create) Tcl_CreateFileHandler(RTD_TCL_GETFILE_(eventHndl_->socket), TCL_READABLE, fileEventProc, (ClientData)this); else Tcl_DeleteFileHandler(RTD_TCL_GETFILE_(eventHndl_->socket)); } /* * check connection to rtdServer */ void RtdCamera::rtdServerCheck() { if ( ! connected()) return; if (rtdServerPing(eventHndl_, buffer_) == RTD_OK) return; disconnect(); } /* * start accepting images from the named camera. * "camera" is a string that identifies the camera. */ int RtdCamera::start(const char* cameraName) { if (strlen(cameraName) == 0) return error("start needs a camera name"); camera(cameraName); // new camera name dbl_->log("START camera %s\n", cameraName); // first we need to check the connection to rtdServer if (connected()) rtdServerCheck(); attached(0); if (! connected()) { dbl_->log("Connecting to %s: RTD name=%s\n", RTD_SERVICE, name_); if (rtdInitImageEvt(name_, eventHndl_, buffer_) != RTD_OK) { disconnect(); sprintf(buffer_, "could not initialize image event: check if %s is running!\n", RTD_SERVICE); dbl_->log(buffer_); return error(buffer_); } } connected(1); if (rtdAttachImageEvt(eventHndl_, camera(), buffer_) != RTD_OK) { disconnect(); sprintf(buffer_, "detach image event: check if %s is running!\n", RTD_SERVICE); dbl_->log("%s\n", buffer_); return error(buffer_); } // now we are ready to receive image events attached(1); fileHandler(1); return TCL_OK; } /* * stop accepting images from the camera. * This method is kept for backwards compatability. */ int RtdCamera::stop() { return pause(); } /* * pause receiving image events. Tell rtdServer to DETACH. */ int RtdCamera::pause() { dbl_->log("PAUSE\n"); attached(0); if (! connected()) return TCL_OK; if (rtdDetachImageEvt(eventHndl_, camera(), buffer_) != RTD_OK) disconnect(); return TCL_OK; } /* * continue receiving images from camera after a pause */ int RtdCamera::cont() { dbl_->log("CONTINUE\n"); if (! camera()) return error("no start command received yet"); return start(camera()); } /* * break connection to rtdServer */ void RtdCamera::disconnect() { if( ! connected()) return; dbl_->log("disconnect\n"); semDecr(); fileHandler(0); rtdClose(eventHndl_, NULL); eventHndl_->socket = 0; attached(0); connected(0); return; } int RtdCamera::attached() { if (! attached_ || ! connected_ || eventHndl_->socket == 0) return False; return True; } /* * Decrement the semaphore */ void RtdCamera::semDecr() { if (semId_ < 0 || shmNum_ < 0) return; rtdSemDecrement(semId_, shmNum_); // decrement the semaphore dbl_->log("Semaphore decremented, semId=%d, shmNum=%d, val=%d\n", semId_, shmNum_, rtdSemGetVal(semId_, shmNum_)); semId_ = shmNum_ = -1; } /* * update global variables */ int RtdCamera::updateGlobals() { if (was_attached_ != attached()) { was_attached_ = attached(); sprintf(buffer_, "%d %s", attached(), camera()); Tcl_SetVar2(interp_, image_, "ATTACHED", buffer_, TCL_GLOBAL_ONLY); } return TCL_OK; } int RtdCamera::checkType(int type) { if (type == BYTE || type == XIMAGE || type == SHORT || type == USHORT || type == INT || type == FLOAT || type == DOUBLE || type == LONG64) return RTD_OK; return RTD_ERROR; } skycat-3.1.2-starlink-1b/rtd/generic/RtdCamera.h000066400000000000000000000073241215713201500213630ustar00rootroot00000000000000// -*-c++-*- #ifndef _RtdCamera_h_ #define _RtdCamera_h_ /* * E.S.O. - VLT project * "@(#) $Id: RtdCamera.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdCamera.h - class definitions for managing realtime image update * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * D.Hopkinson 02/12/96 Added performance test object and timestamp method * pbiereic 01/03/01 Removed performance test object */ #include #include #include #include #include #include "error.h" #include "define.h" #include "Mem.h" #include "rtdSem.h" #include "rtdImageEvent.h" #include "ImageIO.h" #include "Mem.h" #include "RtdUtils.h" #include // this call changed in tcl8 #if (TCL_MAJOR_VERSION >= 8) #define RTD_TCL_GETFILE_(x) x #else #define RTD_TCL_GETFILE_(x) Tcl_GetFile((void *)x, TCL_UNIX_FD) #endif /* * Class RtdCamera * */ class RtdCamera { public: // constructor RtdCamera( const char* name, Tcl_Interp*, int verbose, int debug=0, char* image = "RtdCamera"); // destructor virtual ~RtdCamera(); // static file handler, called by Tk file handler for realtime image events static void fileEventProc(ClientData, int mask); // start/stop/pause or continue accepting images int start(const char* cameraName); int stop(); int pause(); int cont(); // return camera name char* camera() {return camera_;} // Add timestamp in performance tool. void timeStamp(char *evDesc); // update global variables int updateGlobals(); // check if camera is attached int attached(); protected: // member called by fileEventProc for image events int fileEvent(); // cleanup image events in the socket queue void cleanup(); // called to display new image from shared memory // (defined in a derived class) virtual int display(const rtdIMAGE_INFO&, const Mem& data) = 0; // set camera name void camera(const char *camera) {strcpy(camBuf_, camera);} // create/delete the Tcl file handler void fileHandler(int create); // disconnect from camera void disconnect(); // Decrement the semaphore void semDecr(); // check if rtdServer is alive void rtdServerCheck(); // check status after image event failure void checkStat(); // start accepting events from the camera int attach(const char* camera); // check image type int checkType(int type); Tcl_Interp* interp_; // Tcl interp (for file events, error handling) rtdIMAGE_EVT_HNDL* eventHndl_; // image event handle char* camera_; // camera name RtdDebugLog *dbl_; // debug log object int connected_; // Flag: connected to rtdServer int attached_; // Flag: attached to rtdServer int was_attached_; // Flag for updateGlobals() int verbose_; // verbose and debug flags int debug_; int semId_; // current semaphore id int shmNum_; // current shared memory number char* name_; // some unique name (name of Tk image...) char* image_; // name of RtdImage instance (view master) char camBuf_[RTD_NAMELEN]; // .. and the buffer char buffer_[1024]; // general purpose character buffer // -- short cuts -- int connected() {return connected_;} void connected(int set) {connected_ = set; } void attached(int set) {attached_ = set; } }; #endif /* _RtdCamera_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/RtdCmds.C000066400000000000000000003321601215713201500210130ustar00rootroot00000000000000/******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: RtdCmds.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------- -------- ---------------------------------------------- * A. Brighton 05/10/95 Created in RtdImage.C * pbiereic 01/03/01 copied from RtdImage.C * pbiereic 01/04/01 bltgraph subcommand * pbiereic 27/06/01 added "statistics noise" subcommand * pbiereic 14/08/01 added "hdu fits" subcommand * pbiereic 17/02/03 "autocut" uses autoSetCutLevels(99.5) instead of * medianFilter(). This gives much better results * and is also faster. * pbiereic 19/03/03 The previous change was undone (on request) * Peter W. Draper 14/11/05 Merge my RtdImage changes. * Peter W. Draper 26/10/06 Change mbandCmd so that clipping happens in * centre of last pixel, not previous pixel. * 08/01/07 Mark blank images with an OBJECT keyword * with value RTD_BLANK. Do not use image size. * 18/01/07 Back to mband, clip that at 0.5->width/height+0.5 * so that measurement happens to the edge. * 04/06/07 Increase upper limit of zoom factor (supports * adaptive zoom in GAIA for very small, one pixel, * images). * 09/07/07 Reset zoomFactor_ when stopping a zoomed view. * Will be re-used in reference counted copies * (inappropriately when extra high factors are in * use, leading to memory allocation errors). * 14/12/07 Add option to statisticsCmd so that world * coordinates can be reported in degrees (J2000). * 24/04/08 Allow scales to have differing signs. * 21/05/08 Extend statisticsCmd to append the FWHM in arcsecs. * 15/02/12 Round spectrum end points to nearest integers so * that pixel boundaries are respected. * pbiereic 19/06/06 added subcommand "getvals" * pbiereic 14/09/07 Revised biasimageCmd for tile compression */ /************************************************************************ * NAME * * RtdCmds.C - rtd subimage commands * * SYNOPSIS * * * DESCRIPTION * * This file contains all RtdImage member functions which perform * an image subcommand. These functions were originally contained * in RtdImage.C and moved to this file since RtdImage.C were becoming * much too big. * * FILES * * ENVIRONMENT * * CAUTIONS * * SEE ALSO * RtdImage(3), RTD documentation * * BUGS * *------------------------------------------------------------------------ */ static const char *rcsId="@(#) $Id: RtdCmds.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include "RtdImage.h" #include "define.h" // for max function #include /* * declare a table of image subcommands and the methods that handle them. * * NOTE: keep this table sorted, so we can use a binary search on it ! * (select lines in emacs and use M-x sort-lines) */ static class RtdImageSubCmds { public: char* name; // method name int (RtdImage::*fptr)(int argc, char* argv[]); // ptr to method int min_args; // minimum number of args int max_args; // maximum number of args } subcmds_[] = { {(char *)"alloccolors", &RtdImage::alloccolorsCmd, 0, 1}, {(char *)"autocut", &RtdImage::autocutCmd, 0, 2}, {(char *)"biasimage", &RtdImage::biasimageCmd, 0, 3}, {(char *)"bitpix", &RtdImage::bitpixCmd, 0, 0}, {(char *)"bltgraph", &RtdImage::bltgraphCmd, 6, 10}, {(char *)"camera", &RtdImage::cameraCmd, 1, 4}, {(char *)"clear", &RtdImage::clearCmd, 0, 14}, {(char *)"cmap", &RtdImage::cmapCmd, 1, 2}, {(char *)"colorramp", &RtdImage::colorrampCmd, 0, 0}, {(char *)"colorscale", &RtdImage::colorscaleCmd, 0, 1}, {(char *)"convert", &RtdImage::convertCmd, 7, 7}, {(char *)"cut", &RtdImage::cutCmd, 0, 3}, {(char *)"dispheight", &RtdImage::dispheightCmd, 0, 0}, {(char *)"dispwidth", &RtdImage::dispwidthCmd, 0, 0}, {(char *)"dump", &RtdImage::dumpCmd, 1, 5}, {(char *)"fits", &RtdImage::fitsCmd, 1, 2}, {(char *)"flip", &RtdImage::flipCmd, 0, 2}, {(char *)"frameid", &RtdImage::frameidCmd, 0, 0}, {(char *)"get", &RtdImage::getCmd, 3, 5}, {(char *)"getvals", &RtdImage::getvalsCmd, 3, 5}, {(char *)"graphdist", &RtdImage::graphdistCmd, 5, 5}, {(char *)"hdu", &RtdImage::hduCmd, 0, 6}, {(char *)"height", &RtdImage::heightCmd, 0, 0}, {(char *)"info", &RtdImage::infoCmd, 0, 6}, {(char *)"isclear", &RtdImage::isclearCmd, 0, 0}, {(char *)"itt", &RtdImage::ittCmd, 1, 2}, {(char *)"max", &RtdImage::maxCmd, 0, 0}, {(char *)"mband", &RtdImage::mbandCmd, 6, 6}, {(char *)"min", &RtdImage::minCmd, 0, 0}, {(char *)"mmap", &RtdImage::mmapCmd, 0, 7}, {(char *)"motionevent", &RtdImage::motioneventCmd, 0, 1}, {(char *)"object", &RtdImage::objectCmd, 0, 0}, {(char *)"pan", &RtdImage::panCmd, 1, 3}, {(char *)"perftest", &RtdImage::perfTestCmd, 1, 2}, {(char *)"pixtab", &RtdImage::pixtabCmd, 1, 3}, {(char *)"preview", &RtdImage::previewCmd, 1, 1}, {(char *)"radecbox", &RtdImage::radecboxCmd, 3, 3}, {(char *)"remote", &RtdImage::remoteCmd, 0, 1}, {(char *)"remotetcl", &RtdImage::remoteTclCmd, 1, 1}, {(char *)"rotate", &RtdImage::rotateCmd, 0, 1}, {(char *)"scale", &RtdImage::scaleCmd, 0, 2}, {(char *)"shm", &RtdImage::shmCmd, 0, 7}, {(char *)"spectrum", &RtdImage::spectrumCmd, 9, 9}, {(char *)"statistics", &RtdImage::statisticsCmd, 0, 5}, {(char *)"type", &RtdImage::typeCmd, 0, 0}, {(char *)"update", &RtdImage::updateCmd, 0, 1}, {(char *)"userfreq", &RtdImage::maxFreqCmd, 1, 1}, {(char *)"view", &RtdImage::viewCmd, 2, 11}, {(char *)"warp", &RtdImage::warpCmd, 2, 2}, {(char *)"wcscenter", &RtdImage::wcscenterCmd, 0, 2}, {(char *)"wcsdeltset", &RtdImage::wcsdeltsetCmd, 0, 4}, {(char *)"wcsdist", &RtdImage::wcsdistCmd, 4, 4}, {(char *)"wcsequinox", &RtdImage::wcsequinoxCmd, 0, 0}, {(char *)"wcsheight", &RtdImage::wcsheightCmd, 0, 0}, {(char *)"wcsradius", &RtdImage::wcsradiusCmd, 0, 0}, {(char *)"wcsset", &RtdImage::wcssetCmd, 0, 11}, {(char *)"wcsshift", &RtdImage::wcsshiftCmd, 3, 3}, {(char *)"wcswidth", &RtdImage::wcswidthCmd, 0, 0}, {(char *)"width", &RtdImage::widthCmd, 0, 0}, {(char *)"zoom", &RtdImage::zoomCmd, 1, 3}, {(char *)"zoomview", &RtdImage::zoomviewCmd, 1, 5} }; /* * Call the given method in this class with the given arguments * If the method is not defined here, pass on the search to the * parent class. Since this is a virtual function, the search starts * in the most specific class. */ int RtdImage::call(const char* name, int len, int argc, char* argv[]) { if (dbl_) if (dbl_->setlog()) { char buf[4096]; *buf = '\0'; int l = 0; for(int i = 0; i < argc; i++) { l += strlen(argv[i]); if (l < sizeof(buf) + 2) { strcat(buf, argv[i]); strcat(buf, " "); } } if (dbl_) dbl_->log("subcommand: %s %s\n", name, buf); } // since this tcl command has a lot of subcommands, // we do a binary search on the method table int low = 0; int high = sizeof(subcmds_)/sizeof(*subcmds_) - 1; int mid; int cond; while (low <= high) { mid = (low + high) / 2; if ((cond = strcmp(name, subcmds_[mid].name)) < 0) high = mid - 1; else if (cond > 0) low = mid + 1; else { RtdImageSubCmds& t = subcmds_[mid]; if (check_args(name, argc, t.min_args, t.max_args) != TCL_OK) { return TCL_ERROR; } return (this->*t.fptr)(argc, argv); } } // not found ? extend search to parent class return TkImage::call(name, len, argc, argv); } // -- image subcommands -- /* * Implement the "alloccolors" subcommand * * usage: alloccolors ?numColors? * * With no args, return a Tcl list containing the number of * allocated and the number of free colors, * with one arg reallocate up to numColors colors. */ int RtdImage::alloccolorsCmd(int argc, char* argv[]) { if (argc == 0) { char buf[80]; sprintf(buf, "%d %d", colors_->colorCount(), colors_->freeCount()); return set_result(buf); } int numColors; if (Tcl_GetInt(interp_, argv[0], &numColors) != TCL_OK) { return TCL_ERROR; } if (colors_->reallocate(numColors)) return TCL_ERROR; if (image_) { image_->colorScale(colors_->colorCount(), colors_->pixelval()); return updateImage(); } return TCL_OK; } /* * Implement the "autocut" subcommand to set cut levels automatically to * some reasonable values: * * usage: autocut ?-percent number? * * Two different algorithms are supported. The default is median * filtering. * * If -percent is specified, the argument is a number between 0 and 100, * such as 90 for 90%, where that percent of the image should be visible * within the cut values. i.e.: if you look at the graph (see graphdist * command) of the pixel value distribution, you would take the top 90% * of the graph and set the cut levels to left and right ends of the * graph. */ int RtdImage::autocutCmd(int argc, char* argv[]) { if (!image_ || image_->dataType() == X_IMAGE) return TCL_OK; if (argc == 2) { if (strcmp(argv[0], "-percent") == 0) { double percent; if (Tcl_GetDouble(interp_, argv[1], &percent) != TCL_OK || percent < 0.0 || percent > 100.0) return TCL_ERROR; image_->autoSetCutLevels(percent); } else { return error("expected -percent arg for autocut"); } } else if (argc == 0) { // image_->autoSetCutLevels(99.5); image_->medianFilter(); } else { return error("wrong number of args: expected none or -percent followed by arg"); } image_->colorScale(colors_->colorCount(), colors_->pixelval()); // assume the user has not set the cut levels, so we can change them // if a new image is loaded... autoSetCutLevels_ = 1; // make sure the new lookup table is propagated LookupTable lookup = image_->lookupTable(); for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i] && view_[i]->image_ && !view_[i]->isSeparateRapidFrame()) view_[i]->image_->lookupTable(lookup); } // keep status in a global Tcl variable which can be traced by the Tcl code char* var = (viewMaster_ ? viewMaster_->instname_ : instname_); char sts[100]; sprintf(sts, "%g %g", image_->lowCut(), image_->highCut()); Tcl_SetVar2(interp_, var, "CUT", sts, TCL_GLOBAL_ONLY); return updateViews(1) || updateImage(); } /* * biasimage subcommand * * usage: * $image biasimage * * The available commands are * copy $nr - copy current image to bias image "nr" * file $filename $nr - load bias image "nr" from file "filename" * file $nr - return filename of bias image "nr" * clear $nr - clear bias image "nr" * clear all - clear all bias images * on - switch bias subtraction on * off - switch bias subtraction off * status - return status (-1 no bias image loaded, 0 = off, 1 = on) * update - update the global Tcl status variable * display - display the selected bias image * select $nr - select bias image "nr" * maxbias - return max. number of bias images */ int RtdImage::biasimageCmd(int argc, char* argv[]) { char* usage = (char *)"usage: $image biasimage copy|clear|on|off|status|select|display|file|update|maxbias ?filename? ?nr?"; int nr; char buf[1024]; FitsIO *fits = NULL; if (argc < 1) return error(usage); else if (strcmp(argv[0], "update") == 0) { } else if (strcmp(argv[0], "status") == 0) { sprintf(buf, "%d", biasimage_->status()); return set_result(buf); } else if (strcmp(argv[0], "off") == 0) biasimage_->off(); else if (strcmp(argv[0], "maxbias") == 0) { sprintf(buf, "%d", MAXBIAS); return set_result(buf); } else if (strcmp(argv[0], "clear") == 0) { if (Tcl_GetInt(interp_, argv[1], &nr) != TCL_OK) { for (int i=0; iclear(i); } else biasimage_->clear(nr); } else if (strcmp(argv[0], "on") == 0) { if (biasimage_->on() != 0) return TCL_ERROR; } else if (strcmp(argv[0], "select") == 0) { if (argc < 2) { sprintf(buf, "%d", biasimage_->select()); return set_result(buf); } if (Tcl_GetInt(interp_, argv[1], &nr) != TCL_OK) return error("usage: $image biasimage select nr"); if (biasimage_->select(nr) != 0) { sprintf(buf, "biasimage select: number must be in range 0-%d", MAXBIAS-1); return error(buf); } } else if (strcmp(argv[0], "display") == 0) { if (!biasimage_->image()) return error("selected bias image is not loaded"); ImageDataParams p; if (image_) { image_->saveParams(p); delete image_; image_ = NULL; updateViews(); } image_ = biasimage_->image()->copy(); filename(biasimage_->file(biasimage_->select())); image_->restoreParams(p, 1); return initNewImage(); } else if (strcmp(argv[0], "copy") == 0) { if (isclear()) return error("no image loaded"); if (Tcl_GetInt(interp_, argv[1], &nr) != TCL_OK) return error("usage: $image biasimage copy nr"); if (biasimage_->copy(image_, filename(), nr) != 0) return TCL_ERROR; } else if (strcmp(argv[0], "file") == 0) { if (argc == 2) { if (Tcl_GetInt(interp_, argv[1], &nr) != TCL_OK) return error("usage: $image biasimage file nr"); strcpy (buf, biasimage_->file(nr)); return set_result(buf); } if (argc != 3 || Tcl_GetInt(interp_, argv[2], &nr) != TCL_OK) return error("usage: $image biasimage file filename nr"); if (biasimage_->file(argv[1], nr) != 0) return TCL_ERROR; } else return error(usage); // keep status in a global Tcl variable which can be traced by the Tcl code char* var = (viewMaster_ ? viewMaster_->instname_ : instname_); char sts[10]; sprintf(sts, "%d", biasimage_->status()); Tcl_SetVar2(interp_, var, "BIAS", sts, TCL_GLOBAL_ONLY); return TCL_OK; } /* * Implement the "bitpix" subcommand - returns the * BITPIX field of the image header to indicate the * type of the image (8 - byte, 16 = short, etc). */ int RtdImage::bitpixCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; return set_result(image_->dataType()); } /* * This method implements the "camera" subcommand * * usage: camera attach ?cameraName? ?preCommand? ?postCommand? * camera detach * camera pause * camera continue * * The optional "preCommand" argument to "attach" should be a string * containing a Tcl command to be evaluated whenever a new image event * is received and before it is displayed. The "postCommand" argument * is evaluated after the image event is processed. * * note: for backward compat., "start" and "stop" are also accepted * for "attach" and "detach". */ int RtdImage::cameraCmd(int argc, char* argv[]) { int stat = TCL_OK; char buf[128]; if (! camera_) camera_ = new RtdImageCamera(this); if (strcmp(argv[0],"pause") == 0) stat = camera_->pause(); else if (strcmp(argv[0],"continue") == 0) stat = camera_->cont(); else if (strcmp(argv[0],"attach") == 0 || strcmp(argv[0],"start") == 0) { if (argc < 2) { sprintf(buf, "%d", camera_->attached()); stat = set_result(buf); } else{ if (argc > 2) { if (cameraPreCmd_) free(cameraPreCmd_); cameraPreCmd_ = (strlen(argv[2]) ? strdup(argv[2]) : (char*)NULL); } if (argc > 3) { if (cameraPostCmd_) free(cameraPostCmd_); cameraPostCmd_ = (strlen(argv[3]) ? strdup(argv[3]) : (char*)NULL); } stat = camera_->start(argv[1]); } } else if (strcmp(argv[0],"detach") == 0 || strcmp(argv[0],"stop") == 0) { stat = camera_->stop(); } else { return error("invalid camera subcommand: expected: start, stop, pause or continue"); } camera_->updateGlobals(); return stat; } /* * Generate and load a blank image. * * usage: $image clear * * $image clear ?ximage? * * $image clear ?-reuse $reuse * -ra $ra -dec $dec -equinox $equinox -radius $radius \ * -width $width -height $height? * * In the last case, the optional arguments are used to generate a dummy * image that supports world coordinates, so that you can plot objects on * a blank background. Any missing values are set to a default value. * * If "clear ximage" is specified, only the XImage is cleared out * (temporary clear). * * Optional args: * * ximage - flag: if true, only clear out the XImage (temporary clear) * * reuse - flag: if true, reuse previous image, if it is the same * ra, dec - center point for WCS coords (in decimal degrees) * radius - used to initialize WCS coords (CDELT1 and 2) * equinox - equinox for WCS coords * width - width of generated image in pixels * height - height of generated image in pixels */ int RtdImage::clearCmd(int argc, char* argv[]) { if (argc == 1 && strcmp(argv[0], "ximage") == 0) { if (image_) { image_->clear(); imageChanged(); } return TCL_OK; } double ra = -1.0, dec = 0.0, equinox = 2000.0, radius = 1; int reuse = 0, width = 2, height = 2; // parse options for (int i = 0; i < argc; i+=2) { char* opt = argv[i]; char* arg = argv[i+1]; if ((strcmp(opt, "-reuse") == 0 && Tcl_GetBoolean(interp_, arg, &reuse) != TCL_OK) || (strcmp(opt, "-ra") == 0 && Tcl_GetDouble(interp_, arg, &ra) != TCL_OK) || (strcmp(opt, "-dec") == 0 && Tcl_GetDouble(interp_, arg, &dec) != TCL_OK) || (strcmp(opt, "-radius") == 0 && Tcl_GetDouble(interp_, arg, &radius) != TCL_OK) || (strcmp(opt, "-equinox") == 0 && Tcl_GetDouble(interp_, arg, &equinox) != TCL_OK) || (strcmp(opt, "-width") == 0 && Tcl_GetInt(interp_, arg, &width) != TCL_OK) || (strcmp(opt, "-height") == 0 && Tcl_GetInt(interp_, arg, &height) != TCL_OK)) return TCL_ERROR; } // if -ra and -dec were specified, generate an image with world coords, otherwise // just a plain image with image coords if (ra >= 0) { // for world coords, to make it easier, use an equal width and height width = height = max(width, height); // see if we can reuse the current image. // (only if no file or object is loaded and the coords are the same) double image_ra, image_dec, err = .1; if (reuse && image_ && strlen(file()) == 0 && strlen(image_->object()) == 0 && width == image_->width() && height == image_->height() && fabs(radius - image_->wcs().radius()) < err) { image_->wcs().pix2wcs(width/2, height/2, image_ra, image_dec); if (fabs(ra - image_ra) < err && fabs(dec - image_dec) < err) { return TCL_OK; // its all the same, so reuse it } } } // save previous image parameters so we can restore the settings later ImageDataParams p; if (image_) { image_->saveParams(p); delete image_; image_ = NULL; } filename((char *)""); // generate the blank image FitsIO* fits = FitsIO::blankImage(ra, dec, equinox, radius, width, height, colors_->pixelval(0)); if (fits) { image_ = makeImage(fits); // mark a blank image so we can identify it. if ( width == 2 && height == 2 ) { image_->object( "RTD_BLANK" ); } } // restore transformations, cut levels, etc from the previous image if (image_) image_->restoreParams(p, !autoSetCutLevels_); return initNewImage(); } /* * Implement the "cmap" subcommand * * usage: * cmap file ?? * cmap rotate * cmap shift * cmap set * cmap pixels * cmap reset * cmap list * cmap private * cmap isprivate * cmap isreadonly * * where the file, if specified, should contain 256 lines of R, G, B * values. Each line should contain 3 floating point values between 0.0 * and 1.0, for the reg, grean, and blue color scale values. * If the filename is not specified, the current colormap file name is * returned. * * For rotate and shift, the amount and be any integer. The colormap will be * rotated or shifted by that amount. * * "set" sets the image colormap to be the colormap for the given window. This * can be used for popup windows to avoid color flashing when moving between * popup windows and the image. * * "pixels" returns a Tcl list of the colormap pixel values (for use by external * applications using the RTI library (ImageData)). * * "reset" resets the colormap to its original state. * * "list" returns a list of all of the colormap files currently loaded * * "private" says to start using a private colormap. * "isprivate" returns true if the colormap is private. * * "isreadonly" returns true if the colormap is readonly. */ int RtdImage::cmapCmd(int argc, char* argv[]) { int ret = TCL_OK; if (argc == 2) { if (strcmp(argv[0], "file") == 0) { ret = colors_->loadColorMap(argv[1]); } if (strcmp(argv[0], "rotate") == 0) { int amount; if (Tcl_GetInt(interp_, argv[1], &amount) != TCL_OK) { ret = TCL_ERROR; } else { ret = colors_->rotateColorMap(amount); } } if (strcmp(argv[0], "shift") == 0) { int amount; if (Tcl_GetInt(interp_, argv[1], &amount) != TCL_OK) { ret = TCL_ERROR; } else { ret = colors_->shiftColorMap(amount); } } if (strcmp(argv[0], "set") == 0) { Tk_Window w = Tk_NameToWindow(interp_, argv[1], tkwin_); if (w == NULL) { ret = TCL_ERROR; } else { ret = colors_->setColormap(w); } } // Force image update if colour changes do not transfer // automatically (i.e. non-pseudocolor visual). if ( ret == TCL_OK && colors_->readOnly() ) { return colorUpdate(); } else { return ret; } } if (strcmp(argv[0], "file") == 0) { return set_result(colors_->cmap()->name()); } if (strcmp(argv[0], "reset") == 0) { ret = colors_->reset(); if ( ret == TCL_OK ) { return colorUpdate(); } else { return ret; } } if (strcmp(argv[0], "pixels") == 0) { int n = colors_->colorCount(); unsigned long* p = colors_->pixelval(); ostringstream os; for (int i = 0; i < n; i++) os << *p++ << " "; return set_result(os.str().c_str()); } if (strcmp(argv[0], "list") == 0) { ostringstream os; ColorMapInfo::list(os); set_result(os.str().c_str()); return TCL_OK; } if (strcmp(argv[0], "private") == 0) { return colors_->usePrivateCmap(); } if (strcmp(argv[0], "isprivate") == 0) { return set_result(colors_->usingPrivateCmap()); } if (strcmp(argv[0], "isreadonly") == 0) { return set_result(colors_->readOnly()); } return error("unknown rtdimage cmap subcommand"); } /* * colorramp subcommand: generate an image displaying the colors * in the colormap (no arguments required). */ int RtdImage::colorrampCmd(int argc, char* argv[]) { int w = Tk_Width(tkwin_); int h = Tk_Height(tkwin_); if (w == 1 && h == 1) return TCL_OK; // wait for resize event on image window Mem data(w*h, 0), header; if (data.status() != 0) return TCL_ERROR; double scale = 255.0/w; char* p = (char*)data.ptr(); for (int i = 0; i < w; i++) { p[i] = (int)(i * scale); } for (int j = 0; j < h; j++) { memmove(p+(j*w), p, w); } if (image_) delete image_; FitsIO* fits = new FitsIO(w, h, BYTE_IMAGE, 0.0, 1.0, header, data); if (fits) { image_ = makeImage(fits); image_->name("Ramp"); return initNewImage(); } return ERROR; } /* Implement the "colorscale" image subcommand * * usage: colorscale ?scale_type? * * With 1 arg, color scale the image using the given algorithm * (one of: linear, log, sqrt, histeq) * With no args, return the current color scale type. */ int RtdImage::colorscaleCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; if (argc == 0) { switch(image_->colorScaleType()) { case ImageData::LINEAR_SCALE: return set_result("linear"); case ImageData::LOG_SCALE: return set_result("log"); case ImageData::SQRT_SCALE: return set_result("sqrt"); case ImageData::HISTEQ_SCALE: return set_result("histeq"); default: return set_result("none"); } } if (argc != 1) return error("wrong number of args: should be colorscale ?scale_type?"); // set the color scale type if (strcmp(argv[0], "linear") == 0) image_->colorScaleType(ImageData::LINEAR_SCALE); else if (strcmp(argv[0], "log") == 0) image_->colorScaleType(ImageData::LOG_SCALE); else if (strcmp(argv[0], "sqrt") == 0) image_->colorScaleType(ImageData::SQRT_SCALE); else if (strcmp(argv[0], "histeq") == 0) image_->colorScaleType(ImageData::HISTEQ_SCALE); else return fmt_error("unknown color scale algorithm: %s, %s", argv[0], "should be one of: linear, log, sqrt, histeq"); // color scale the image image_->colorScale(colors_->colorCount(), colors_->pixelval()); // make sure the image is regenerated return updateImage(); } /* * implement the "convert" subcommand to convert between different * coordinate representations. * * usage: * $image convert coords inx iny input_coord_type outx outy output_coord_type * $image convert dist inx iny input_coord_type outx outy output_coord_type * * where inx and iny and the input coords (or distance) in the given * input coordinate system. "convert coords" treats x,y as a point, while * "convert dist" treats it as a distance. outx and outy, if not empty, * are the names of variables that will hold the resulting coordinates. * If outx and outy are empty strings, the values are returned as a tcl * list "x y". * * The available coordinate systems are: * * canvas - canvas coordinates (canvas scroll area) * screen - canvas window coords (visible area) * image - basic image pixel coords (at mag 1, no transformations) * wcs - world coordinates in H:M:S * deg - world coordinates in degrees * * The world coordinate types: "wcs" and "deg" may also include the * equinox (default is 2000): Example: * * $image convert coords $ra $dec "wcs 1950" x y canvas * * Note: the coordinate types may be abbrieviated, since only the first * char is actually checked. */ int RtdImage::convertCmd(int argc, char* argv[]) { if (!image_) return error("no image loaded"); char* usage = (char *)"usage: $image convert [coords|dist] inx iny in_coord_type outx outy out_coord_type"; int dist_flag = 0; if (strcmp(argv[0], "dist") == 0) dist_flag++; else if (strcmp(argv[0], "coords") != 0) return error(usage); char outx_buf[32], outy_buf[32]; char* outx_name = argv[4]; char* outy_name = argv[5]; // if no variable names are specified, return the values as a list if (strlen(outx_name) == 0) outx_name = NULL; if (strlen(outy_name) == 0) outy_name = NULL; double x, y; if (convertCoordsStr(dist_flag, argv[1], argv[2], outx_buf, outy_buf, x, y, argv[3], argv[6]) != TCL_OK) return TCL_ERROR; Tcl_ResetResult(interp_); if (outx_name) Tcl_SetVar(interp_, outx_name, outx_buf, 0); else Tcl_AppendElement(interp_, outx_buf); if (outy_name) Tcl_SetVar(interp_, outy_name, outy_buf, 0); else Tcl_AppendElement(interp_, outy_buf); return TCL_OK; } /* * Implement the "cut" subcommand to set cut levels: * * usage: cut ?fromUser? * or: cut * or: * * If the min and max arguments are specified, the cut levels are set. * * The optional ?fromUser? argument indicates whether or not this is * a result of a user action and defaults to 1 (true). Once a user has * set the cut levels, automatic cut level setting is disabled. * * If no args are given, the current cut levels are returned in a list * of {min max}. * */ int RtdImage::cutCmd(int argc, char* argv[]) { int stat = TCL_OK; if (!image_) return TCL_OK; int fromUser = 1; if (argc == 3 && Tcl_GetInt(interp_, argv[2], &fromUser) != TCL_OK) return TCL_ERROR; if (argc >= 2) { // set the cut levels double min, max; if (Tcl_GetDouble(interp_, argv[0], &min) != TCL_OK || Tcl_GetDouble(interp_, argv[1], &max) != TCL_OK) { return TCL_ERROR; } stat = setCutLevels(min, max, 1, fromUser); } else if (argc == 0) { // return the current cut levels char buf[80]; sprintf(buf, "%g %g", image_->lowCut(), image_->highCut()); return set_result(buf); } // keep status in a global Tcl variable which can be traced by the Tcl code char* var = (viewMaster_ ? viewMaster_->instname_ : instname_); char sts[100]; sprintf(sts, "%g %g", image_->lowCut(), image_->highCut()); Tcl_SetVar2(interp_, var, "CUT", sts, TCL_GLOBAL_ONLY); return stat; } /* * Implement the "info" subcommand * * usage: info bbox * or: minmax x0 y0 x1 y1 */ int RtdImage::infoCmd(int argc, char* argv[]) { char* msg = (char *)"invalid arguments for info subcommand"; if (! image_) return set_result(0); if (argc < 1) return error(msg); if (strcmp(argv[0], "bbox") == 0) { double x0, y0, x1, y1; char buf[80]; image_->getBbox(&x0, &y0, &x1, &y1); sprintf(buf, "%.1f %.1f %.1f %.1f", x0, y0, x1, y1); return set_result(buf); } if (strcmp(argv[0], "minmax") == 0) { if (argc < 5) return error(msg); // get image area double x0, y0, minv = 0.0, maxv = 0.0; int w, h; int numval = 0; if (Tcl_GetDouble(interp_, argv[1], &x0) != TCL_OK || Tcl_GetDouble(interp_, argv[2], &y0) != TCL_OK || Tcl_GetInt(interp_, argv[3], &w) != TCL_OK || Tcl_GetInt(interp_, argv[4], &h) != TCL_OK) { return TCL_ERROR; } image_->getMinMax(x0, y0, w, h, &minv, &maxv); // return the min/max values char buf[80]; sprintf(buf, "%g %g", minv, maxv); return set_result(buf); } return error(msg); } /* * Implement the "dispheight" subcommand - returns the * height of the current image after scaling. */ int RtdImage::dispheightCmd(int argc, char* argv[]) { if (!image_) return set_result(0); double rw = reqWidth_, rh = reqHeight_; doTrans(rw, rh, 1); return set_result(rh ? rh : dispHeight()); } /* * Implement the "dispwidth" subcommand - returns the * width of the current image after scaling. */ int RtdImage::dispwidthCmd(int argc, char* argv[]) { if (!image_) return set_result(0); double rw = reqWidth_, rh = reqHeight_; doTrans(rw, rh, 1); return set_result(rw ? rw : dispWidth()); } /* * This method implements the rtd dump subcommand to dump (save) the * current image or a section of it to the given file in FITS format. * * Usage: $image dump $filename ?x0 y0 x1 y1? * * If the coordinates are specified, the given section of the image (in * image coordinates) is saved in the given file, otherwise the entire * image. The FITS header from the original image is reused and the * relevant values are modified if only a section of the image is being * saved. */ int RtdImage::dumpCmd(int argc, char* argv[]) { if (! image_) return error("no image is currently loaded"); if (argc == 1) { // save whole image return image_->write(argv[0]); } // save image section double x0, y0, x1, y1; if (Tcl_GetDouble(interp_, argv[1], &x0) != TCL_OK || Tcl_GetDouble(interp_, argv[2], &y0) != TCL_OK || Tcl_GetDouble(interp_, argv[3], &x1) != TCL_OK || Tcl_GetDouble(interp_, argv[4], &y1) != TCL_OK) { return TCL_ERROR; } return image_->write(argv[0], x0, y0, x1, y1); } /* * Implement the "fits" image subcommand * * usage: fits get ?keyword? * * If "fits get " is specified, this command returns the value * for the keyword in the FITS header, otherwise "get" with no arguments * returns a formatted copy of the entire header. */ int RtdImage::fitsCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; const ImageIO& imio = image_->image(); if (strcmp(argv[0], "get") == 0) { if (argc == 1 && image_->header().size()) { // return a copy of the FITS header, format it in 80 char lines and // replace any NULL chars with blanks ostringstream os; image_->getFitsHeader(os); set_result(os.str().c_str()); return TCL_OK; } // return the value for the given FITS keyword char* s = imio.get(argv[1]); return set_result(s ? s : ""); } return error("unknown argument: expected \"fits get ?keyword?\""); } /* * Implement the "flip" image subcommand * * usage: flip ?bool? * * where direction is one of x, y, xy or "none" for flipping in the x, y * or x and y directions or neither. * * The boolean value turns flipping on (1) or off (0) in the given * direction(s). * * With one arg, return the current value for the given arg. * With no arg. return the current status of flipX and flipY */ int RtdImage::flipCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; if (argc == 0) { char buf[80]; sprintf(buf, "%d %d", image_->flipX(), image_->flipY()); return set_result(buf); } int flipX = 0, flipY = 0, arg = 1; if (argc == 2) { if (Tcl_GetBoolean(interp_, argv[1], &arg) != TCL_OK) return TCL_ERROR; } if (strcmp(argv[0], "x") == 0 || strcmp(argv[0], "X") == 0) { flipX++; } else if (strcmp(argv[0], "y") == 0 || strcmp(argv[0], "Y") == 0) { flipY++; } else if (strcmp(argv[0], "xy") == 0 || strcmp(argv[0], "XY") == 0) { flipX++; flipY++; } else if (strcmp(argv[0], "none") != 0) return error("expected: flip, followed by: x, y, xy or none"); // if the image is rotated, it is more intuitive to exchange the X and Y axis if (image_->rotate()) swap(flipX, flipY); if (flipX && flipY && argc == 1) { return set_result(image_->flipX() && image_->flipY()); } if (flipX) { if (argc == 2) image_->flipX(arg); else return set_result(image_->flipX()); } if (flipY) { if (image_->dataType() == X_IMAGE) { if (argc == 2) image_->flipY(!arg); else return set_result(!image_->flipY()); } else { if (argc == 2) image_->flipY(arg); else return set_result(image_->flipY()); } } // update other views if (updateViews(1) != TCL_OK) return TCL_ERROR; // make sure the image is regenerated if (resetImage() != TCL_OK) return TCL_ERROR; if (panCommand_) { if (Tk_Width(tkwin_) <= 1) { // pause here until window is displayed, so that the pan // window can determine the size of the window updateRequests(); } autoPan(1); } // keep status in a global Tcl variable which can be traced by the Tcl code char* var = (viewMaster_ ? viewMaster_->instname_ : instname_); char sts[10]; sprintf(sts, "%d %d", image_->flipX(), image_->flipY()); Tcl_SetVar2(interp_, var, "FLIP", sts, TCL_GLOBAL_ONLY); return TCL_OK; } /* * return the frame Id of this image. The frame Id is used to * identify the image to the Rtd Server for use with rapid frames. */ int RtdImage::frameidCmd(int argc, char* argv[]) { return set_result(frameId_); } /* * implement the "get" image command to return a Tcl list of image values * at the given X,Y coordinates * * usage: get $x $y coord_type ?nrows ncols? * * x and y are the coordinates in the image window in the given coordinate * system (one of: canvas, image, screen, wcs, deg). * * The return value is a tcl list where each item consists of a list of * {X Y Value}, where X and Y are the image coords in the raw image * and Value is the raw data value there or "-" if out of range. * * If nrows and ncols are greater than 1, return a Tcl list of n rows * x n cols values each (a list of rows...), centered at the given point. */ int RtdImage::getCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; double x, y; int nrows = 1, ncols = 1; char buf[80]; if (convertCoordsStr(0, argv[0], argv[1], NULL, NULL, x, y, argv[2], "image") != TCL_OK) return TCL_ERROR; if (argc == 5) { if (Tcl_GetInt(interp_, argv[3], &nrows) != TCL_OK || Tcl_GetInt(interp_, argv[4], &ncols) != TCL_OK) { return TCL_ERROR; } } if (nrows == 1 && ncols == 1) { return set_result(image_->getValue(buf, x, y)); } int n = nrows/2; int m = ncols/2; for (int j = -m; j <= m; j++) { Tcl_AppendResult(interp_, " { ", NULL); for (int i = -n; i <= n; i++) { Tcl_AppendResult(interp_, " { ", image_->getValue(buf, x+i, y+j), " } ", NULL); } Tcl_AppendResult(interp_, " } ", NULL); } return TCL_OK; } /* * Implement the "getvals" image command to return a Tcl list of image values * at the given X,Y coordinates. * * This command is similar to the "get" subcommand but uses x, y as lower left * corner for the image window and only returns a tcl list with the Y values. * Furthermore, the values are scanned by row order (1'st row first, then * 2'nd row etc.). * * usage: getvals $x $y coord_type ?nrows ncols? * * x and y are the coordinates in the image window in the given coordinate * system (one of: canvas, image, screen, wcs, deg). * * The return value is a tcl list with the Y values in the raw image * or "-" if out of range. */ int RtdImage::getvalsCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; double x, y, val; int nrows = 1, ncols = 1; char buf[80]; int ix, iy; if (convertCoordsStr(0, argv[0], argv[1], NULL, NULL, x, y, argv[2], "image") != TCL_OK) return TCL_ERROR; if (argc == 5) { if (Tcl_GetInt(interp_, argv[3], &nrows) != TCL_OK || Tcl_GetInt(interp_, argv[4], &ncols) != TCL_OK) { return TCL_ERROR; } } for (int j = 0; j < nrows; j++) { for (int i = 0; i < ncols; i++) { if (image_->getIndex(x+i, y+j, ix, iy) != 0) strcpy(buf, "- "); else { val = image_->getValue(x+i, y+j); sprintf(buf, "%g ", val); } Tcl_AppendResult(interp_, buf, NULL); } } return TCL_OK; } /* * implement the graphdist subcommand to display the distribution * of values in the image. * * usage: * pathName graphdist bltGraph bltElem numValues xVector yVector * * * xVector is the name of the BLT x vector * * yVector is the name of the BLT y vector * * The data for the given element in the given graph will be set * directly from here without going through tcl. */ int RtdImage::graphdistCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; int numValues; if (Tcl_GetInt(interp_, argv[2], &numValues) != TCL_OK) { return TCL_ERROR; } // seems like you can't always depend on being allowed to use a variable // for the array bounds... #ifdef __GNUC__ double xyvalues[numValues*2]; #else double* xyvalues = new double[numValues*2]; #endif image_->getDist(numValues, xyvalues); int status = TCL_OK; if (numValues > 0) status = Blt_GraphElement(interp_, argv[0], argv[1], numValues*2, xyvalues, argv[3], argv[4]); else status = error("all image pixels have the same value"); #ifndef __GNUC__ delete[] xyvalues; #endif return status; } /* * This method implements the "hdu" subcommand, to access different * FITS HDUs (header data units). Each HDU may be of type "image", * "binary" table or "ascii" table. * * usage: hdu count * or: hdu list * or: hdu listheadings * or: hdu type ?number? * or: hdu headings ?$number? * or: hdu fits ?$number? * or: hdu get ?$number? ?$filename? ?$entry? * or: hdu create $type $extname $headings $tform $data * or: hdu delete $number * or: hdu set $number * or: hdu ?$number? * or: hdu display ?hduList? * * If the "hdu count" subcommand is specified, it returns the number of * HDUs in the current image. * * The "hdu type" subcommand returns the type of the current or given HDU * as a string "ascii", "binary" or "image". * * If the "hdu list" subcommand is specified, it returns a Tcl list of * FITS HDU information of the form: * * {{number type extname naxis naxis1 naxis2 naxis3 crpix1 crpix2} ...} * * Where: * * - number is the HDU number * - type is the HDU type: one of "image", "binary table", "ascii table". * - extname is the value of the EXTNAME keyword, if set * - naxis, naxis1, naxis2, naxis3 match the FITS keyword values. * * The "hdu listheadings" subcommand returns a list of the column names * returned by the "hdu list" subcommand. This can be used to set the * title of a table listing of the HDUs in a FITS file. * * The "hdu headings" subcommand returns a list of the column names * in the current or given FITS table. * * The "hdu fits" subcommand returns the FITS header * of the current or given HDU. * * The "hdu get" subcommand with no arguments returns the contents of the * current ASCII or binary table as a Tcl list (a list of rows, where * each row is a list of column values). If the HDU number is given, the * contents of the given HDU are returned. If a filename argument is * given, the FITS table is written to the given file in the form of a * local (tab separated) catalog. If optional "entry" argument is given, * it specifies the catalog config entry as a list of {{keyword value} * {keyword value} ...}, as defined in the catalog config file * (~/.skycat/skycat.cfg). The entry is written to the header of the * local catalog file and is used mainly to specify plot symbol * information for the catalog. * * The "hdu create" command creates a new FITS table in the current image * file. $type maye be "ascii" for an ASCII table or "binary" for a * binary FITS table. The name of the table is given by extname. The * table headings and data correspond to the catalog headings and * data. The tform argument is a list of FITS storage formats, one for * each column, of the form {16A 2D 12A ...} (similar to FORTRAN formats, * see the FITS docs). * * The "hdu delete" command deletes the given HDU. The argument is the HDU * number. The other HDUs in the file following the deleted one are moved to * fill the gap. * * If the "hdu" subcommand is specified with no arguments, it returns the * current HDU number. If a number argument is given, the current HDU is * set to that number. * * The "hdu set" subcommand sets the current HDU to the given number. * The keyword "set" is optional (see below). * * The "hdu display ?hduList?" subcommand displays all of the image HDUs * (or the ones specified) at once, combined in one image, using the * world coordinates information in each HDU header as the reference for * the pixel positions. * * An optional numerical argument may be passed to the "hdu" subcommand, * in which case the "current HDU" is set to the given number. */ int RtdImage::hduCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; // HDU operations: make sure it is a FITS file ImageIO imio = image_->image(); if (!imio.rep() || strcmp(imio.rep()->classname(), "FitsIO") != 0) return error("The \"hdu\" subcommand is only supported for FITS files"); FitsIO* fits = (FitsIO*)imio.rep(); // hdu (return the current HDU number) if (argc == 0) return set_result(fits->getHDUNum()); // hdu count if (strcmp(argv[0], "count") == 0) return set_result(fits->getNumHDUs()); // hdu type ?number? if (strcmp(argv[0], "type") == 0) return hduCmdType(argc, argv, fits); // hdu listheadings // (return a list of table headings matching the "hdu list" output) if (strcmp(argv[0], "listheadings") == 0) return set_result("HDU Type ExtName NAXIS NAXIS1 NAXIS2 NAXIS3 CRPIX1 CRPIX2"); // hdu headings ?$number? if (strcmp(argv[0], "headings") == 0) return hduCmdHeadings(argc, argv, fits); // hdu fits ?$number? if (strcmp(argv[0], "fits") == 0) return hduCmdFits(argc, argv, fits); // hdu get ?number? ?$filename? ?$entry? if (strcmp(argv[0], "get") == 0) return hduCmdGet(argc, argv, fits); // hdu create $type $extname $headings $tform $data if (strcmp(argv[0], "create") == 0) return hduCmdCreate(argc, argv, fits); // hdu delete $number if (strcmp(argv[0], "delete") == 0) return hduCmdDelete(argc, argv, fits); // hdu list if (strcmp(argv[0], "list") == 0) return hduCmdList(argc, argv, fits); // hdu set $number if (strcmp(argv[0], "set") == 0) return hduCmdSet(argc, argv, fits); // hdu display $hduList if (strcmp(argv[0], "display") == 0) return hduCmdDisplay(argc, argv, fits); // hdu $number (Set the current HDU) return hduCmdSet(argc, argv, fits); } /* * Implement the "height" subcommand - returns the * unscaled height of the current image. */ int RtdImage::heightCmd(int argc, char* argv[]) { if (!image_) return set_result(0); return set_result(image_->height()); } /* * implement the "isclear" subcommand to return true if the image is * cleared and 0 if there is an image loaded * * usage: $image isclear */ int RtdImage::isclearCmd(int argc, char* argv[]) { // XXX: we should do something with the -file option ?, camera ? return set_result(isclear()); } /* * Implement the "itt" subcommand * * usage: itt file * itt scale * itt list * * where the file should contain 256 intensity values (0.0..1.0), * one per line. * * "file" sets the itt file, * "scale" scales the itt by the given amount * "list" returns a list of itt files loaded */ int RtdImage::ittCmd(int argc, char* argv[]) { if (argc == 2) { int ret = TCL_OK; if (strcmp(argv[0], "file") == 0) { ret = colors_->loadITT(argv[1]); } else if (strcmp(argv[0], "scale") == 0) { int amount; if (Tcl_GetInt(interp_, argv[1], &amount) != TCL_OK) { ret = TCL_ERROR; } else { ret = colors_->scaleITT(amount); } } // Force image update if colour changes do not transfer // automatically (i.e. non-pseudocolor visual). if ( ret == TCL_OK ) { return colorUpdate(); } else { return ret; } } if (strcmp(argv[0], "file") == 0) { return set_result(colors_->itt()->name()); } if (strcmp(argv[0], "list") == 0) { ostringstream os; ITTInfo::list(os); set_result(os.str().c_str()); return TCL_OK; } return error("expected: \"itt file\" or \"itt scale\""); return TCL_OK; } /* * Implement the "max" subcommand - returns the * highest pixel value in the visible image. * * usage: * max */ int RtdImage::maxCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; return set_result(image_->maxValue()); } /* * mband subcommand - draw a measure band on the canvas to show the * distance in world coordinates (diagonal, vertical and horizontal). * * This method was originaly implemented in Tcl/[incr Tcl], but was * redone here for better performance. The canvas tags used correspond to * items created in the itcl class RtdImageMBand: * * mband all items * mband_line diagonal line * mband_angle angle line (horiz. and vert.) * * mband_width_rect boxs around labels * mband_height_rect * mband_diag_rect * * mband_width_text labels * mband_height_text * mband_diag_text * * Usage: * $image mband x0 y0 x1 y1 cord_type show_angle * * Where x0 and y0 are the starting coordinates of the drag, x1 and y1 * are the coordinates from the motion events, both in the given * coordinate system. * * show_angle is a flag: if true, show the horizontal and vertical * distance, otherwise only the diagonal. */ int RtdImage::mbandCmd(int argc, char* argv[]) { if (!isWcs()) return TCL_OK; // get args double x0, y0, x1, y1; int show_angle; char* from_type = argv[4]; char* to_type = (char *)"canvas"; char buf[1024]; if (Tcl_GetInt(interp_, argv[5], &show_angle) != TCL_OK) return TCL_OK; // convert to canvas coords if (convertCoordsStr(0, argv[0], argv[1], NULL, NULL, x0, y0, from_type, to_type) != TCL_OK || convertCoordsStr(0, argv[2], argv[3], NULL, NULL, x1, y1, from_type, to_type) != TCL_OK) { return TCL_OK; } // clip to image bounds (full) double ix0 = 0.5, iy0 = 0.5, ix1 = 0.5 + image_->width(), iy1 = 0.5 + image_->height(); if (imageToCanvasCoords(ix0, iy0, 0) != TCL_OK || imageToCanvasCoords(ix1, iy1, 0) != TCL_OK) return TCL_OK; clip(x0, ix0, ix1); clip(x1, ix0, ix1); clip(y0, iy0, iy1); clip(y1, iy0, iy1); // note: wcs coords are not linear, so we need all 3 points in wcs double ra0 = x0, dec0 = y0, ra1 = x1, dec1 = y1, ra2 = x1, dec2 = y0; if (canvasToWorldCoords(ra0, dec0, 0) != TCL_OK || canvasToWorldCoords(ra1, dec1, 0) != TCL_OK || canvasToWorldCoords(ra2, dec2, 0) != TCL_OK) return TCL_OK; // get distances in world coords double width, height, dist = WorldCoords::dist(ra0, dec0, ra1, dec1)*60.; char widthStr[32], heightStr[32], distStr[32]; formatHM(dist, distStr); if (show_angle) { width = WorldCoords::dist(ra0, dec0, ra2, dec2)*60.; formatHM(width, widthStr); height = WorldCoords::dist(ra2, dec2, ra1, dec1)*60; formatHM(height, heightStr); } // calculate canvas coords for lines and labels and // try to keep the labels out of the way so they don't block anything double mx = (x0 + x1)/2; double my = (y0 + y1)/2; int offset = 10; // offset of labels from lines char* diag_anchor = (char *)"c"; // label anchors char* width_anchor = (char *)"c"; char* height_anchor = (char *)"c"; int diag_xoffset = 0, // x,y offsets for labels diag_yoffset = 0, width_yoffset = 0, height_xoffset = 0; if (fabs(y0 - y1) < 5) { diag_anchor = (char *)"s"; diag_yoffset = offset; show_angle = 0; } else if (y0 < y1) { width_anchor = (char *)"s"; width_yoffset = -offset; } else { width_anchor = (char *)"n"; width_yoffset = offset; } if (fabs(x0 - x1) < 5) { diag_anchor = (char *)"w"; diag_xoffset = offset; diag_yoffset = 0; show_angle = 0; } else if (x0 < x1) { diag_anchor = (char *)"se"; diag_xoffset = -offset; diag_yoffset = offset; height_anchor = (char *)"w"; height_xoffset = offset; } else { diag_anchor = (char *)"nw"; diag_xoffset = offset; diag_yoffset = -offset; height_anchor = (char *)"e"; height_xoffset = -offset; } // evaluate Tk canvas commands in the image's canvas const char* canvas = canvasName_; // set diagonal line coords sprintf(buf, "%s coords mband_line %g %g %g %g\n", canvas, x0, y0, x1, y1); Tcl_Eval(interp_, buf); // adjust labels sprintf(buf, "%s coords mband_diag_text %g %g\n", canvas, mx+diag_xoffset, my+diag_yoffset); Tcl_Eval(interp_, buf); sprintf(buf, "%s itemconfig mband_diag_text -text %s -anchor %s\n", canvas, distStr, diag_anchor); Tcl_Eval(interp_, buf); sprintf(buf, "%s bbox mband_diag_text\n", canvas); Tcl_Eval(interp_, buf); double rx0, ry0, rx1, ry1; if (sscanf(Tcl_GetStringResult(interp_), "%lf %lf %lf %lf", &rx0, &ry0, &rx1, &ry1) != 4) return TCL_OK; sprintf(buf, "%s coords mband_diag_rect %g %g %g %g\n", canvas, rx0, ry0, rx1, ry1); Tcl_Eval(interp_, buf); if (show_angle) { // set angle line coords sprintf(buf, "%s coords mband_angle %g %g %g %g %g %g\n", canvas, x0, y0, x1, y0, x1, y1); Tcl_Eval(interp_, buf); sprintf(buf, "%s coords mband_width_text %g %g\n", canvas, mx, y0+width_yoffset); Tcl_Eval(interp_, buf); sprintf(buf, "%s itemconfig mband_width_text -text %s -anchor %s\n", canvas, widthStr, width_anchor); Tcl_Eval(interp_, buf); sprintf(buf, "%s bbox mband_width_text\n", canvas); Tcl_Eval(interp_, buf); if (sscanf(Tcl_GetStringResult(interp_), "%lf %lf %lf %lf", &rx0, &ry0, &rx1, &ry1) != 4) return TCL_OK; sprintf(buf, "%s coords mband_width_rect %g %g %g %g\n", canvas, rx0, ry0, rx1, ry1); Tcl_Eval(interp_, buf); sprintf(buf, "%s coords mband_height_text %g %g\n", canvas, x1+height_xoffset, my); Tcl_Eval(interp_, buf); sprintf(buf, "%s itemconfig mband_height_text -text %s -anchor %s\n", canvas, heightStr, height_anchor); Tcl_Eval(interp_, buf); sprintf(buf, "%s bbox mband_height_text\n", canvas); Tcl_Eval(interp_, buf); if (sscanf(Tcl_GetStringResult(interp_), "%lf %lf %lf %lf", &rx0, &ry0, &rx1, &ry1) != 4) return TCL_OK; sprintf(buf, "%s coords mband_height_rect %g %g %g %g\n", canvas, rx0, ry0, rx1, ry1); Tcl_Eval(interp_, buf); } else { // hide the width and height labels and lines x1 = x0 + 1; y1 = y0 + 1; sprintf(buf, "%s coords mband_angle %g %g %g %g\n", canvas, x0, y0, x1, y1); Tcl_Eval(interp_, buf); sprintf(buf, "%s itemconfig mband_width_text -text {}\n", canvas); Tcl_Eval(interp_, buf); sprintf(buf, "%s coords mband_width_rect %g %g %g %g\n", canvas, x0, y0, x1, y1); Tcl_Eval(interp_, buf); sprintf(buf, "%s itemconfig mband_height_text -text {}\n", canvas); Tcl_Eval(interp_, buf); sprintf(buf, "%s coords mband_height_rect %g %g %g %g", canvas, x0, y0, x1, y1); Tcl_Eval(interp_, buf); } return TCL_OK; } /* * Implement the "min" subcommand - returns the * lowest pixel value in the image. */ int RtdImage::minCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; return set_result(image_->minValue()); } /* * implement the "mmap" subcommand: * * usage: $image mmap set $data_filename $data_offset $data_owner \ * ?$header_filename $header_offset $header_owner? * $image mmap get data * $image mmap get header * $image mmap create $filename $size * $image mmap delete $filename * $image mmap update * * This subcommand provides access to the mmap shared memory in which the * FITS image data and header are stored. Image files are always mapped * with mmap by default (since it is faster than reading the * file). Applications can take advantage of this to modify the image * data and then notify the application to update the image. This command * makes it posible to put the image data and header in separate files, * so that they can be more easily updated by other applications. If you * want to put both header and data in the same file in the normal way, * just use "$image config -file". Otherwise you can use this command to * quickly update the image data in a separate file. * * The "set" command allow you to set the files to use to for the image * data and header. The data and header in the specified files should be * in FITS format (i.e.:, a FITS file split in 2 parts). If the header * is not specified, the previous header is reused, if there was one. * The offset arguments indicate an offset in the file where the header * or data start. If the file contains only the data or only the header, * the offset argument should be set to 0. * A flag indicating who "owns" the file may be specified (if true, then * the file will be deleted when no longer needed). * * Example: $image mmap set datafile1 0 0 headerfile1 0 0 * $image mmap set datafile2 0 0 * ... * * The "get" command returns mmap information about the data or header. * If the data or header is not currently mapped, an error is returned. * The return value is a list of the form {filename offset owner}, the * same as the arguments to the "$image mmap set" command. * * The "create" command creates a new mmapped file with the given name * and the given size. The mmaped file/memory should be released with the * "delete" subcommand when no longer needed. * * The "delete" command unmaps the given file and deletes it, if it was * created with the "mmap create" subcommand. * * The "update" command causes the display to be updated to reflect any * changes in the image memory. */ int RtdImage::mmapCmd(int argc, char* argv[]) { char* msg = (char *)"invalid arguments for mmap subcommand"; // this is used to keep track of memory areas for the "create" and // "delete" subcommands here static Mem* mem_areas[10]; const int max_mem_areas = sizeof(mem_areas)/sizeof(Mem*); if (strcmp(argv[0], "set") == 0) { // $image mmap set ... if (argc != 4 && argc != 7) return error(msg); char* data_filename = argv[1]; char* header_filename = NULL; int data_offset = 0, data_owner = 0, data_size = 0, header_offset = 0, header_owner = 0, header_size = 0; if (Tcl_GetInt(interp_, argv[2], &data_offset) == TCL_ERROR || Tcl_GetBoolean(interp_, argv[3], &data_owner) == TCL_ERROR) return TCL_ERROR; if (argc == 7) { header_filename = argv[4]; if (Tcl_GetInt(interp_, argv[5], &header_offset) == TCL_ERROR || Tcl_GetBoolean(interp_, argv[6], &header_owner) == TCL_ERROR) return TCL_ERROR; } Mem data(data_filename, verbose()); if (data.status() != 0) return TCL_ERROR; if (data_offset) data.offset(data_offset); if (data_owner) data.owner(data_owner); Mem header; if (! header_filename) { // if there is no header, check that image has right size at least if (! image_) return error("no current image header to go with mmap data"); if (data.length() < image_->data().length()) return error("mmap data file is too small for current image header"); header = image_->header(); } else { header = Mem(header_filename, verbose()); if (header.status() != 0) return TCL_ERROR; if (header_offset) header.offset(header_offset); if (header_owner) header.owner(header_owner); } // used to save and restore image transformation parameters ImageDataParams p; if (image_) { image_->saveParams(p); delete image_; image_ = NULL; updateViews(); } FitsIO* fits = FitsIO::initialize(header, data); image_ = makeImage(fits); if (! image_) return TCL_ERROR; // restore transformations image_->restoreParams(p, !autoSetCutLevels_); filename(data_filename); // keep filename return initNewImage(); } // $image mmap get ... else if (strcmp(argv[0], "get") == 0) { if (argc != 2) return error(msg); if (! image_) return error("no image is currently loaded"); Mem m; if (strcmp(argv[1], "data") == 0) { if (image_->data().filename() == NULL) return error("image data is not mapped"); m = image_->data(); } else if (strcmp(argv[1], "header") == 0) { if (image_->header().filename() == NULL) return error("image header is not mapped"); m = image_->header(); } else { return error(msg); } reset_result(); append_element(m.filename()); append_element((int)m.offset()); return append_element(m.owner()); } else if (strcmp(argv[0], "update") == 0) { return updateImage(); } else if (strcmp(argv[0], "create") == 0) { if (argc != 3) return error(msg); char* filename = argv[1]; int size = 0; if (Tcl_GetInt(interp_, argv[2], &size) == TCL_ERROR) return TCL_ERROR; for (int i = 0; istatus() == 0) { mem_areas[i] = m; return TCL_OK; } return TCL_ERROR; } } return error("too many mmap files for 'mmap create' subcommand"); } else if (strcmp(argv[0], "delete") == 0) { if (argc != 2) return error(msg); char* filename = argv[1]; for (int i = 0; ifilename(), filename) == 0) { delete mem_areas[i]; mem_areas[i] = NULL; return TCL_OK; } } return error("the specified file was not created with the 'mmap create' subcommand"); } else { return error(msg); } return TCL_OK; } int RtdImage::motioneventCmd(int argc, char* argv[]) { if (argc == 0) // return the current values return set_result(saveMotion_); if (argc != 1) return error("wrong number of args: should be motionevent ?0/1"); int value; if (Tcl_GetInt(interp_, argv[0], &value) != TCL_OK) { return error("invalid argument, expected 0 or 1"); } saveMotion_ = value; } /* * Implement the "object" subcommand - returns the * OBJECT field of the image header to indicate the * name of the astronomical object */ int RtdImage::objectCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; return set_result(image_->object()); } /* * pan subcommand: * * usage: * pan start * pan stop * pan update * * start - arrange to have a tcl command evaluated whenever the image size changes * (due to scaling or loading a new image) or whenever the image position has * changed (due to scrolling) * * pan stop - stop evaluating the tcl command... * * pan upadte - force an update of the pan window (normally done whenever * image size or position changes) * * The tclCommand will be called with 5 arguments: x1 y1 x2 y2, which are the coords * of the visible part of the image, scaled by the given shrinkFactor, and a flag * indicating whether the image is new (1) or an update of the existing image (0). * This can be used to draw the panning rectangle on the panning image. */ int RtdImage::panCmd(int argc, char* argv[]) { if (strcmp(argv[0],"start") == 0) { // pan start subcommand if (argc != 3) return error("wrong # of args: should be \"pathName pan start tclCommand shrinkFactor\""); if (panCommand_) free(panCommand_); panCommand_ = strdup(argv[1]); if (Tcl_GetInt(interp_, argv[2], &panFactor_) != TCL_OK) return TCL_ERROR; if (panFactor_ > -2 && panFactor_ != 1 && panFactor_ != -1) return error("pan shrinkFactor should be -2 for 1/2 size, -3 for 1/3, etc. or 1"); if (panFactor_ == 1) panFactor_ = -1; // for calculations, should be negative // cause panning window to be reset panx1_ = pany1_ = panx2_ = pany2_ = 0; if (image_) autoPan(); } else if (strcmp(argv[0],"stop") == 0) { // pan stop subcommand if (panCommand_) free(panCommand_); panCommand_ = NULL; } else if (strcmp(argv[0],"update") == 0) { // pan update subcommand // cause panning window to be reset panx1_ = pany1_ = panx2_ = pany2_ = 0; if (image_) autoPan(); } else { return error("invalid image pan subcommand: should be \"start\" or \"stop\""); } return TCL_OK; } /* * The following function is called when the interactive performance testing * is enabled or disabled. It sets the required flag, and resets the variables * if required. * * Usage: * perftest off - turn performance testing off * perftest on - turn performance testing on * perftest reset - reset the performance parameters * * Arguments: * int argc, char *argv - argument list */ int RtdImage::perfTestCmd(int argc, char *argv[]) { // Check the arguments and act according to the usage instructions if (strcmp(argv[0], "on") == 0 || strcmp(argv[0], "reset") == 0) { // Set the testing on and reset the various parameters rtdperf_->reset(); if (strcmp(argv[0], "on") == 0) { rtdperf_->verbose(verbose()); rtdperf_->debug(debug()); if (argc > 1) rtdperf_->name(argv[1]); else rtdperf_->name(viewMaster_ ? viewMaster_->instname_ : instname_); rtdperf_->on(); } } else if (strcmp(argv[0], "off") == 0) { rtdperf_->reset(); rtdperf_->off(); } else return error("Unknown argument to perftest command"); return TCL_OK; } /* * implement the pixtab subcommand to support displaying a table of * pixel values around a point. * * usage: $image pixtab start nrows ncols * $image pixtab stop * * All this commmand does is set a flag causing Tcl array variables * to be updated on motion events, which can cause the display to be * updated via the "-textvariable" widget option on the table items. * * The array name is fixed as: RtdPixTab and the elements are indexed as * $RtdPixTab(i,j), where the left and top sides of the table (array) are * the X and Y image coordinates, resp. and the rest are image pixel * values. * */ int RtdImage::pixtabCmd(int argc, char* argv[]) { if (strcmp(argv[0], "start") == 0) { if (argc != 3) return error("expected: $image pixtab start nrows ncols"); int nrows, ncols; if ((Tcl_GetInt(interp_, argv[1], &nrows) == TCL_ERROR) || (Tcl_GetInt(interp_, argv[2], &ncols) == TCL_ERROR)) return TCL_ERROR; if (nrows <= 0 || ncols <= 0) return error("number of rows and columns should be positive"); // force value to be odd so we can center it if ((nrows&1) == 0) nrows++; if ((ncols&1) == 0) ncols++; pixTabRows_ = nrows; pixTabCols_ = ncols; if (pixTab_) delete[] pixTab_; // generate an array of pixel values with left and right headings // for the x/y coordinates pixTab_ = new double[++nrows*++ncols]; if (pixTab_) memset((void*)pixTab_, '\0', nrows*ncols*sizeof(double)); } else if (strcmp(argv[0], "stop") == 0) { if (pixTab_) delete[] pixTab_; pixTab_ = NULL; } else { return error("expected image pixtab 'start nrows ncols' or 'stop'"); } return TCL_OK; } /* * This method implements the "preview" subcommand * * usage: preview * * if boolValue is true, enter preview mode, otherwise go back to * real-time mode. In preview mode, the camera is stopped (if it was * running) and a local copy of the shared memory image is made, * so that it can be freed or modified without affecting the image. * */ int RtdImage::previewCmd(int argc, char* argv[]) { //dbg_->log("%s: previewCmd: camera = %x\n", name(), camera_); if (! camera_) return TCL_OK; int flag; if (Tcl_GetBoolean(interp_, argv[0], &flag) != TCL_OK) return TCL_ERROR; if (flag) { // enter preview mode, get local copy of image data if (camera_->attached()) { image_->data().shared(0); image_->data().shared(shm_data()); // in case a diff shared memory was requested // also preview the rapid frame, if any for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i] && view_[i]->rapidFrame_ && view_[i]->image_ ) { view_[i]->image_->data().shared(0); } } if (camera_->pause() != TCL_OK) return TCL_ERROR; // update zoom window with the new data ? processMotionEvent(); } } else { // resume return camera_->cont(); } return TCL_OK; } /* * This method implements the radecbox subcommand. * * usage: * lassign [$image radecbox $ra $dec $radius] ra0 dec0 ra1 dec1 * * ra and dec are the world coords (h:m:s or decimal deg) and radius is expected in * arcmin. * * The return value in Tcl is a list of 4 values {ra0 dec0 ra1 dec1} that form a * ra,dec box with the given center point and radius */ int RtdImage::radecboxCmd(int argc, char* argv[]) { WorldCoords pos(argv[0], argv[1]); if (pos.status() != 0) return TCL_ERROR; double radius; if (Tcl_GetDouble(interp_, argv[2], &radius) != TCL_OK) return TCL_ERROR; WorldCoords pos1, pos2; pos.box(radius, pos1, pos2); ostringstream os; os << pos1 << ' ' << pos2; return set_result(os.str().c_str()); } /* * implement the "remote" subcommand for remote control of the RTD image * widget. * * usage: $image remote ?$port? * * If a port number argument is specified The widget will start listening * for commands on the given port. If port is 0, a port number will be * chosen. * * If no port number is specified, the current port number is returned, * or "" if there is none. This is a way to determine the port number * at the Tcl level. */ int RtdImage::remoteCmd(int argc, char* argv[]) { if (argc == 0) { if (remote_) return set_result(remote_->port()); return TCL_OK; } char* cmd = (char *)""; int port = 0; if (Tcl_GetInt(interp_, argv[0], &port) == TCL_ERROR) return TCL_ERROR; if (remote_) delete remote_; remote_ = new RtdImageRemote(this, port); if (remote_) return remote_->status(); return TCL_ERROR; } /* * implement the "remotetcl" subcommand to evaluate a Tcl command * in the RTD Tcl interpreter. * * usage: $image remotetcl $command */ int RtdImage::remoteTclCmd(int argc, char* argv[]) { Tcl_Eval(interp_, argv[0]); return set_result(Tcl_GetStringResult(interp_)); } /* * Implement the "rotate" image subcommand * * usage: rotate ?bool? * * currently, rotation is only done by swapping x and y axis (-90 deg.) * If bool is specified, rotation is turned on(1) or off(0). * Otherwise, the current setting is returned. */ int RtdImage::rotateCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; int angle = 0; if (argc == 1) { if (Tcl_GetInt(interp_, argv[0], &angle) != TCL_OK) return TCL_ERROR; } else { return set_result(image_->rotate()); } image_->rotate(angle != 0); // update other views if (updateViews(1) != TCL_OK) return TCL_ERROR; // make sure the image is regenerated if (resetImage() != TCL_OK) return TCL_ERROR; if (panCommand_) { if (Tk_Width(tkwin_) <= 1) { // pause here until window is displayed, so that the pan // window can determine the size of the window updateRequests(); } autoPan(1); } // keep status in a global Tcl variable which can be traced by the Tcl code char* var = (viewMaster_ ? viewMaster_->instname_ : instname_); char sts[10]; sprintf(sts, "%d", image_->rotate()); Tcl_SetVar2(interp_, var, "ROTATE", sts, TCL_GLOBAL_ONLY); return TCL_OK; } /* * Implement the "scale" image subcommand * * usage: scale ?sx sy restFlag? * * With 2 args scale (zoom) the image by the specified X and Y * amount. * * With no args, return the current scaling factors. * */ int RtdImage::scaleCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; int xs = image_->xScale() , ys = image_->yScale(); if (argc == 0) // return the current values return set_result(xs, ys); if (argc != 2) return error("wrong number of args: should be scale ?sx sy?"); // set the scale factor: // 2 means twice the normal size, -2 means 1/2 normal size // don't allow zero scale or shrink in X and grow in Y... int xScale, yScale; if (Tcl_GetInt(interp_, argv[0], &xScale) != TCL_OK || Tcl_GetInt(interp_, argv[1], &yScale) != TCL_OK) { return error("invalid arguments, expected x and y scale factors"); } // check arguments if (xScale == -1 || xScale == 0) xScale = 1; if (yScale == -1 || yScale == 0) yScale = 1; #if 0 // add a check for the Tk limit on canvas coords if (xScale > 0 && xScale * image_->width() > 32767 || yScale > 0 && yScale * image_->height() > 32767) return error("sorry, can't scale image to this size without exceeding maximum Tk canvas coordinate range"); #endif int stat; stat = setScale(xScale, yScale); // keep status in a global Tcl variable which can be traced by the Tcl code char* var = (viewMaster_ ? viewMaster_->instname_ : instname_); char sts[100]; sprintf(sts, "%d %d", image_->xScale(), image_->yScale()); Tcl_SetVar2(interp_, var, "SCALE", sts, TCL_GLOBAL_ONLY); return stat; } /* * implement the "shm" subcommand to manipulate image sysV shared memory: * * usage: $image shm set $data_size $data_id $data_owner \ * ?$header_size $header_id $header_owner? * $image shm get data * $image shm get header * $image shm create $size * $image shm delete $Id * $image shm update * * This subcommand provides access to the sysV shared memory in which the * FITS raw image data and header are stored. The raw image is stored in * sysV shared memory if the -shm_data option was specified when creating * the image and the header is stored in sysV shared memory if the * -shm_headr option was specified. * * The "set" command allow you to set the shared memory Ids to use to * access the image data and header. The data and header in the area * specified should be in FITS format. If the header is not specified, * the previous header is reused. For both data and header, the size of * the area (in bytes) and the shared memory Id must be specified. In * addition a flag indicating who "owns" the shared memory is specified * (if true, then the area will be deleted when no longer needed). * * The "get" command returns the shared memory Id of the data or header * as well as the offset in the shared memory area where the header or * data begins, the length of the header or data and the total size of * the shared memory. The result of the "get header" or "get data" * command is a Tcl list of the 4 numbers {shmId offset length size}, * where length is the length of the header or data and size is the total * size of the shared memory area. If the data or header is not currently * in shared memory, an error is returned. (RTD must be started with * option -shm_data 1 and/or -shm_header 1 for this command to work). * * The "create" command creates a new shared memory area with the given * size and returns the Id. The memory should be deleted with the "delete" * subcommand when no longer needed. * * The "delete" command deletes the shared memory with the given Id (which * should have been returned from the "create" subcommand). * * The "update" command causes the display to be updated to reflect any changes * in the image memory. */ int RtdImage::shmCmd(int argc, char* argv[]) { char* msg = (char *)"invalid arguments for shm subcommand"; // this is used to keep track of memory areas for the "create" and // "delete" subcommands here static Mem* mem_areas[10]; const int max_mem_areas = sizeof(mem_areas)/sizeof(Mem*); if (strcmp(argv[0], "set") == 0) { if (argc != 4 && argc != 7) return error(msg); int data_size = 0, data_id = -1, data_owner = 0, header_size = 0, header_id = -1, header_owner = 0; if (Tcl_GetInt(interp_, argv[1], &data_size) == TCL_ERROR || Tcl_GetInt(interp_, argv[2], &data_id) == TCL_ERROR || Tcl_GetBoolean(interp_, argv[3], &data_owner) == TCL_ERROR) return TCL_ERROR; if (argc == 7) { if (Tcl_GetInt(interp_, argv[4], &header_size) == TCL_ERROR || Tcl_GetInt(interp_, argv[5], &header_id) == TCL_ERROR || Tcl_GetBoolean(interp_, argv[6], &header_owner) == TCL_ERROR) return TCL_ERROR; } Mem data(data_size, data_id, data_owner, verbose()); if (data.status() != 0) return TCL_ERROR; Mem header; if (header_id < 0) { // if there is no header, check that image has right size at least if (! image_) return error("no current image header to go with shm data"); if (data_size < image_->data().length()) return error("shared memory area is to small for current image"); header = image_->header(); } else { header = Mem(header_size, header_id, header_owner, verbose()); } if (header.status() != 0) return TCL_ERROR; // used to save and restore image transformation parameters ImageDataParams p; if (image_) { image_->saveParams(p); delete image_; image_ = NULL; updateViews(); } FitsIO* fits = FitsIO::initialize(header, data); image_ = makeImage(fits); if (! image_) return TCL_ERROR; // restore transformations image_->restoreParams(p, !autoSetCutLevels_); return initNewImage(); } else if (strcmp(argv[0], "get") == 0) { if (argc != 2) return error(msg); if (! image_) return error("no image is currently loaded"); char buf[80]; if (strcmp(argv[1], "data") == 0) { if (!image_->data().shared()) return error("rtd was not started with the -shm_data option"); Mem m = image_->data(); sprintf(buf, "%d %d %d %d", m.shmId(), m.offset(), m.length(), m.size()); return set_result(buf); } else if (strcmp(argv[1], "header") == 0) { if (!image_->header().shared()) return error("rtd was not started with the -shm_header option"); Mem m = image_->header(); sprintf(buf, "%d %d %d %d", m.shmId(), m.offset(), m.length(), m.size()); return set_result(buf); } else { return error(msg); } } else if (strcmp(argv[0], "update") == 0) { return updateImage(); } else if (strcmp(argv[0], "create") == 0) { if (argc != 2) return error(msg); int size = 0; if (Tcl_GetInt(interp_, argv[1], &size) == TCL_ERROR) return TCL_ERROR; for (int i = 0; istatus() == 0) { mem_areas[i] = m; return set_result(m->shmId()); } return TCL_ERROR; } } return error("too many shared memory areas for 'shm create' subcommand"); } else if (strcmp(argv[0], "delete") == 0) { if (argc != 2) return error(msg); int shmId = -1; if (Tcl_GetInt(interp_, argv[1], &shmId) == TCL_ERROR) return TCL_ERROR; for (int i = 0; ishmId() == shmId) { delete mem_areas[i]; mem_areas[i] = NULL; return TCL_OK; } } return error("the specified shared memory area was not created with the 'shm create' subcommand"); } else { return error(msg); } return TCL_OK; } /* * This method implements the spectrum subcommand. * * usage: * * spectrum x0 y0 x1 y1 coord_type xVector yVector * * where: * x0, y0, x1 and y1 are the end points of a line in the image in the * given coordinate system (canvas, image, screen, wcs, deg). * * is the path name of a BLT graph widget to display * the plot of the pixel intensities along the line * * is the name of the element in the graph that should * receive the data * * xVector is the name of the BLT x vector * * yVector is the name of the BLT y vector * * The data is sent directly to the graph for display. * The return value in Tcl is the number of points to plot. */ int RtdImage::spectrumCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; // convert to image coords double rx0, ry0, rx1, ry1; if (convertCoordsStr(0, argv[2], argv[3], NULL, NULL, rx0, ry0, argv[6], "image") != TCL_OK || convertCoordsStr(0, argv[4], argv[5], NULL, NULL, rx1, ry1, argv[6], "image") != TCL_OK) return TCL_ERROR; // get distance between endpoints (add a little to be safe) int x0 = int(rx0+0.5), y0 = int(ry0+0.5), x1 = int(rx1+0.5), y1 = int(ry1+0.5); int w = abs(x1-x0) + 1; int h = abs(y1-y0) + 1; int dist = (int)sqrt((double)w*w + h*h) + 2; double* xyvalues = new double[dist*2]; // fill the xyvalues array and set numValues to the actual number of points int numValues = image_->getSpectrum(xyvalues, x0, y0, x1, y1); assert(numValues <= dist); if (Blt_GraphElement(interp_, argv[0], argv[1], numValues*2, xyvalues, argv[7], argv[8]) != TCL_OK) { delete xyvalues; return TCL_ERROR; } delete[] xyvalues; return set_result(numValues); } /* * statistics subcommand: calculate statistics. * * usage: set list [$image statistics] * set list [$image statistics degrees] * or: set list [$image statistics noise x0 y0 nx ny] * * no args - * With no arguments or an argument of degrees the statistics on the * section of the image being displayed is calculated (used for * "pick object"). The return value in Tcl is a list of the * following values: * * {x y ra dec equinox fwhmX fwhmY angle objectPeak meanBackground * fwmhXa fwhmYa} * * where: * * x = X image coordinate * y = Y image coordinate * ra = RA position (calculated from mean X pos) * dec = DEC position (calculated from mean Y position) * equinox = equinox of RA and DEC * fwhmX = FWHM in X pixels * fwhmY = FWHM in Y pixels * angle = angle of major axis, degrees, along X * objectPeak = peak value of object above background * meanBackground = mean background level * fwhmXa = FWHM in X arcsecs * fwhmYa = FWHM in Y arcsecs * * If the single argument is "degrees" then the ra and dec values * are not formatted into sexagesimal. * * Note: compare results with Midas (center/gauss) when changes are done * * noise - * "noise" computes the noise statistics (RMS) on an image area. * x0, y0 is the lower left corner (in image coordinates) and * nx, ny the width and the height. * The return value in Tcl is a list of the following values: * * {min, max, av, rms, n, xs, xe, ys, ye} * * where: * * min = minimum value * max = maximum value * av = average value * rms = RMS value * n = number of samples used * xs, ys = lower left corner (image coordinates) of area * xe, ye = upper right corner (image coordinates) of area */ int RtdImage::statisticsCmd(int argc, char* argv[]) { char* msg = (char *)"invalid arguments for statistics subcommand"; if (!image_) return error("no image loaded"); if (argc == 0 || ( argc == 1 && strcmp(argv[0], "degrees") == 0 ) ) { double w = reqWidth_, h = reqHeight_; undoTrans(w, h, 1); // get only visible area double x = xOffset_, y = yOffset_; // adapt transformations for getStatistics() switch(image_->flipX() << 1 | image_->flipY()) { case 0: // none y += h; // upper left corner for image area to be examined break; case 1: // flipY break; case 2: // flipX x += w; y += h; break; case 3: // flipX and flipY x += w; break; } distToCoords(x, y); // get coords from offsets double meanX=0., meanY=0., fwhmX=0., fwhmY=0., angle=0., objectPeak=0., meanBackground=0.; if (image_->getStatistics(x, y, int(w), int(h), meanX, meanY, fwhmX, fwhmY, angle, objectPeak, meanBackground) != 0) { // if we could not get the FWHM (because the user clicked on the background // of the image), we still want to return the X,Y values of the area clicked. // allan: 22.4.98, by request x += w / 2.0; y += h / 2.0; } else { // get the image coords from the offsets x = meanX + (int)(x - 0.5) + 1.0; y = meanY + (int)(y - 0.5) + 1.0; } double ix = x, iy = y; // get the world coords position from the image coords WorldCoords pos; double dx, dy; double fwhmXa = 0.0; double fwhmYa = 0.0; if (imageToWorldCoords(x, y, 0) == TCL_OK) { pos = WorldCoords(x, y); if (pos.status() != 0) pos = WorldCoords(); // also report in degrees if asked if ( argc == 1 ) { pos.get( dx, dy, 2000.0 ); } // add FWHM in arcseconds, need image scale to do this. WCS& wcs = image_->wcs(); fwhmXa = fwhmX * wcs.secPix(); fwhmYa = fwhmY * wcs.secPix(); } ostringstream os; os << ix << ' ' << iy << ' '; if (pos.status() == 0 && ! pos.isNull()) { if ( argc == 1 ) { // report in degrees, try to keep precision reasonable char cx[TCL_DOUBLE_SPACE], cy[TCL_DOUBLE_SPACE]; sprintf( cx, "%.9g", dx ); sprintf( cy, "%.9g", dy ); os << cx << ' ' << cy << " J2000 "; // ra, dec, equinox, degrees. } else { os << pos << " J2000 "; // ra, dec, equinox: XXX use default equinox ? } } else { os << "{} {} {} "; // no world coords } os << fwhmX << ' ' << fwhmY << ' ' << angle << ' ' << objectPeak << ' ' << meanBackground << ' '; if ( fwhmXa == 0.0 ) { os << "{} {}"; // no world coords } else { os << fwhmXa << ' ' << fwhmYa; } return set_result(os.str().c_str()); } if (argc == 5 && strcmp(argv[0], "noise") == 0) { /* * $image statistics area x0 y0 nx ny */ double x0 = 0., y0 = 0., nx = 0., ny = 0.; double dmin = 0., dmax = 0., av = 0., rms = 0.; int n = 0, xs = 0, xe = 0, ys = 0, ye = 0; if (Tcl_GetDouble(interp_, argv[1], &x0) == TCL_ERROR || Tcl_GetDouble(interp_, argv[2], &y0) == TCL_ERROR || Tcl_GetDouble(interp_, argv[3], &nx) == TCL_ERROR || Tcl_GetDouble(interp_, argv[4], &ny) == TCL_ERROR) return error(msg); char buf[1024]; n = image_->noiseStatistics(x0, y0, int(nx), int(ny), &dmin, &dmax, &av, &rms, &xs, &xe, &ys, &ye); sprintf (buf, "%g %g %g %g %d %d %d %d %d", dmin, dmax, av, rms, n, xs, xe, ys, ye); return set_result(buf); } return error(msg); } /* * bltgraph subcommand: various commands to display 2-D data * in a blt::graph widget * * usage: * bltgraph xline bltGraph bltElem xVector yVector y xr0 dxr * or: bltgraph yline bltGraph bltElem xVector yVector x * * or: bltgraph spectrum bltGraph bltElem x0 y0 x1 y1 coord_type xVector yVector * or: bltgraph graphdist bltGraph bltElem numValues xVector yVector */ int RtdImage::bltgraphCmd(int argc, char* argv[]) { char* msg = (char *)"invalid arguments for bltgraph subcommand"; int stat, numValues; if (argc < 6) return error(msg); if (!image_) return error("no image loaded"); // for compatibility: if (strcmp(argv[0], "spectrum") == 0) { return spectrumCmd(argc - 1, argv++); } if (strcmp(argv[0], "graphdist") == 0) { return graphdistCmd(argc - 1, argv++); } if (strcmp(argv[0], "yline") == 0) { double x = 0; if (Tcl_GetDouble(interp_, argv[5], &x) == TCL_ERROR) return error(msg); double y0 = 0, y1 = image_->height() - 1; if (argc > 6) { if (Tcl_GetDouble(interp_, argv[6], &y0) == TCL_ERROR) return error(msg); } if (argc > 7) { if (Tcl_GetDouble(interp_, argv[7], &y1) == TCL_ERROR) return error(msg); } double *xyvalues = new double[image_->height()*4]; int numValues = image_->getYline4((int)x, (int)y0, (int)y1, xyvalues); stat = Blt_GraphElement(interp_, argv[1], argv[2], numValues*4, xyvalues, argv[3], argv[4]); delete xyvalues; return stat; } if (strcmp(argv[0], "xline") == 0) { double y = 0, xr0 = 0.0, dxr = 1.0; if (Tcl_GetDouble(interp_, argv[5], &y) == TCL_ERROR) return error(msg); double x0 = 0, x1 = image_->width() - 1; if (argc > 6) { if (Tcl_GetDouble(interp_, argv[6], &x0) == TCL_ERROR) return error(msg); } if (argc > 7) { if (Tcl_GetDouble(interp_, argv[7], &x1) == TCL_ERROR) return error(msg); } if (argc > 8) { if (Tcl_GetDouble(interp_, argv[8], &xr0) == TCL_ERROR) return error(msg); } if (argc > 9) { if (Tcl_GetDouble(interp_, argv[9], &dxr) == TCL_ERROR) return error(msg); } double *xyvalues = new double[image_->width()*4]; if (argc > 9) { numValues = image_->getXline4((int)y, (int)x0, (int)x1, xyvalues, xr0, dxr); } else { numValues = image_->getXline4((int)y, (int)x0, (int)x1, xyvalues); } stat = Blt_GraphElement(interp_, argv[1], argv[2], numValues*4, xyvalues, argv[3], argv[4]); delete xyvalues; return stat; } return error(msg); } /* * Implement the "type" subcommand - returns the * data type of the raw image as a string */ int RtdImage::typeCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; switch (image_->dataType()) { case DOUBLE_IMAGE: return set_result("double"); case FLOAT_IMAGE: return set_result("float"); case SHORT_IMAGE: return set_result("short"); case USHORT_IMAGE: return set_result("ushort"); case LONG_IMAGE: return set_result("long"); case BYTE_IMAGE: return set_result("byte"); case X_IMAGE: return set_result("XImage"); default: break; } return TCL_OK; } /* * Implement the "update" subcommand * * usage: $image update * or: $image update idletasks * * With no arguments, just make sure that the image is up to date with * the raw data (which may have changed via shared memory). * * With 1 arg, do the equivalent of the Tk update idletasks command * (this one is for use via the remote interface). * */ int RtdImage::updateCmd(int argc, char* argv[]) { if (argc == 0) return updateImage(); updateRequests(); return 0; } /* * Set the maximum update frequency for the RTD. */ int RtdImage::maxFreqCmd(int argc, char* argv[]) { double maxFreq; if (argc != 1) { return TCL_ERROR; } if (Tcl_GetDouble(interp_, argv[0], &maxFreq) != TCL_OK) { return TCL_ERROR; } // This becomes the maximum update frequency in the main image, unless it // is negative, which indicates that the feature should be turned off. if (maxFreq < 0.) { options_->rtd_options_->fixUpdateRate = 0; options_->rtd_options_->userUpdateTime = 0.; } else { options_->rtd_options_->fixUpdateRate = 1; options_->rtd_options_->userUpdateTime = 1./maxFreq; } return TCL_OK; } /* * view subcommand: specify a viewing image to view the same * image, possibly at a different size. * * The new view will share data with the original and be updated * when the original is updated. * * This can be used, for example, to build a panning window * or a rapid frame. * * usage: * view add ?propagateScale? ?rapidFrame? * view remove * view update xOffset yOffset width height frameX frameY rapidX rapidY coordType * view update width height coordType * view enter * view leave * * must be the name of a second rtdimage image. The two * images will communicate internally to always display the * same image, possibly scaled to different sizes. * * add - adds a new view to this image * If the optional argument "propagateScale" is true, changes in * the scale factors in the master image will propagate to the * view (this is the default behavior). If "rapidFrame" is specified * as true, then the view is treated as a rapid frame and is only updated * from image events and not from the main image. * * remove - removes the view * * update - updates the frame from this image with the given sizes and offsets: * * xOffset, yOffset - X,Y offset of image frame in image canvas * width, height - dimensions of image * frameX, frameY - X,Y offset of image frame in image canvas * rapidX, rapidY - X,Y offset of rapid frame coresponding to main image. * coordType - type of the input coords (canvas, image, screen, etc) * * enter - if 2 images are in the same canvas, make the current one * (receives motion events, ...) * * leave - undo the enter command * */ int RtdImage::viewCmd(int argc, char* argv[]) { RtdImage* view = getView(argv[1]); if (! view) return TCL_ERROR; if (strcmp(argv[0], "update") == 0) { if (! image_) return TCL_OK; // can't update if image doesn't exist if (argc == 5) { // only update width and height of image double width, height; char* from_type = argv[4]; char* to_type = (char *)"image"; if (convertCoordsStr(1, argv[2], argv[3], NULL, NULL, width, height, from_type, to_type) != TCL_OK) return TCL_ERROR; // add 1 so that there is no space left at right and bottom // when only a partial zoomed pixel is displayed on the left or top view->reqWidth_ = width+1; view->reqHeight_ = height+1; return view->updateView(image_, 1); } else if (argc != 11) return error("usage: $image view update $view xOffset yOffset ", "width height frameX frameY rapidX rapidY coordType"); // get image coords and update image offsets double xOffset, yOffset, width, height, frameX, frameY, rapidX, rapidY; char* from_type = argv[10]; char* to_type = (char *)"image"; if (convertCoordsStr(1, argv[2], argv[3], NULL, NULL, xOffset, yOffset, from_type, to_type) != TCL_OK || convertCoordsStr(1, argv[4], argv[5], NULL, NULL, width, height, from_type, to_type) != TCL_OK || convertCoordsStr(1, argv[6], argv[7], NULL, NULL, frameX, frameY, from_type, to_type) != TCL_OK || convertCoordsStr(1, argv[8], argv[9], NULL, NULL, rapidX, rapidY, from_type, to_type) != TCL_OK) return TCL_ERROR; // dbg_->log("%s: update %s: xyOffset(%g,%g), size(%g,%g), frame(%g,%g), rapid(%g,%g)\n", // name(), view->name(), xOffset, yOffset, width, height, frameX, frameY, // rapidX, rapidY); view->xOffset_ = xOffset; view->yOffset_ = yOffset; // add 1 so that there is no space left at right and bottom // when only a partial zoomed pixel is displayed on the left or top view->reqWidth_ = width+1; view->reqHeight_ = height+1; view->frameX_ = frameX; view->frameY_ = frameY; view->rapidX_ = rapidX; view->rapidY_ = rapidY; return view->updateView(image_, 1); } else if (strcmp(argv[0], "add") == 0) { // add the view to the list int propagateScale = 1, rapidFrame = 0; if (argc >= 3) { if (Tcl_GetBoolean(interp_, argv[2], &propagateScale) != TCL_OK) return TCL_ERROR; } if (argc >= 4) { if (Tcl_GetBoolean(interp_, argv[3], &rapidFrame) != TCL_OK) return TCL_ERROR; } // allow the zoom window to be updated from the new view also // note: the check for displaymode() != 0 is to keep the pan window // from using the zoom window, which can be very slow on huge images. if (view->displaymode() != 0) { view->zoomer_ = zoomer_; view->zoomView_ = zoomView_; view->zoomView2_ = zoomView2_; view->zoomSpeed_ = zoomSpeed_; } // set flags view->propagateScale_ = propagateScale; view->rapidFrame_ = rapidFrame; // we only need one event handler per window if (view->tkwin_ == tkwin_) { Tk_DeleteEventHandler(tkwin_, ButtonMotionMask|StructureNotifyMask, eventProc, (ClientData)view); } return addView(view); } else if (strcmp(argv[0], "remove") == 0) { return removeView(view); } else if (strcmp(argv[0], "enter") == 0) { currentView_ = view; } else if (strcmp(argv[0], "leave") == 0) { currentView_ = this; } else { return error("invalid rtdimage view subcommand"); } return TCL_OK; } /* * warp the mouse pointer by the given x and y amounts: * * usage: $image warp $x $y */ int RtdImage::warpCmd(int argc, char* argv[]) { int x, y; if ((Tcl_GetInt(interp_, argv[0], &x) == TCL_ERROR) || (Tcl_GetInt(interp_, argv[1], &y) == TCL_ERROR)) return TCL_ERROR; XWarpPointer(display_, None, None, 0, 0, 0, 0, x, y); return TCL_OK; } /* * implement the "wcscenter" image command to return the world * coordinates of the center of the image. * * usage: wcscenter ?-format $format? * * The optional format option determines the format of the result: * -format 0 ==> H:M:S [+-]D:M:S Equinox (default) * -format 1 ==> RA DEC Equinox (RA and DEC in degrees) * * The return value is a tcl list, formatted according to the format * option, or an empty string if the coordinates are out of range or WCS * is not supported. */ int RtdImage::wcscenterCmd(int argc, char* argv[]) { if (!isWcs()) return TCL_OK; // get the format int format = 0; if (argc == 2) { if (strcmp(argv[0], "-format") == 0) { if (Tcl_GetInt(interp_, argv[1], &format) != TCL_OK) { return TCL_ERROR; } } } // get x and y double x = image_->width()/2., y = image_->height()/2.; // do the conversion and return the result switch(format) { case 0: char buf[80]; return set_result(image_->wcs().pix2wcs(x, y, buf, sizeof(buf))); case 1: double ra, dec; image_->wcs().pix2wcs(x, y, ra, dec); return set_result(ra, dec); default: return error("unknown format for pix2wcs: try 0 or 1"); } return TCL_OK; } /* * wcsdeltset subcommand * * usage: * $image wcsdeltset $cdelt1 $cdelt2 $rotation * * Set rotation and scaling * * Args: * cdelt1 = scale in degrees/pixel (axis 1); degrees = arcsec/3600. * cdelt2 = scale in degrees/pixel (axis 2) * rotation = rotation angle in degrees * */ int RtdImage::wcsdeltsetCmd(int argc, char* argv[]) { if (!isWcs()) return TCL_OK; double cdelt1, cdelt2, rotation; if (Tcl_GetDouble(interp_, argv[0], &cdelt1) != TCL_OK || Tcl_GetDouble(interp_, argv[1], &cdelt2) != TCL_OK || Tcl_GetDouble(interp_, argv[2], &rotation) != TCL_OK) return TCL_ERROR; return image_->wcs().deltset(cdelt1, cdelt2, rotation); } /* * This method implements the wcsdist subcommand. * * usage: * set dist [$image wcsdist x0 y0 x1 y1] * * The arguments are expected in canvas coords (canvasx, canvasy, * doubles). * The return value in Tcl is the WCS distance in arcsec between 2 * points (after transformations). */ int RtdImage::wcsdistCmd(int argc, char* argv[]) { if (!isWcs()) return TCL_OK; double x0, y0, x1, y1; if (Tcl_GetDouble(interp_, argv[0], &x0) != TCL_OK || Tcl_GetDouble(interp_, argv[1], &y0) != TCL_OK || Tcl_GetDouble(interp_, argv[2], &x1) != TCL_OK || Tcl_GetDouble(interp_, argv[3], &y1) != TCL_OK) { return TCL_ERROR; } #if 0 // XXX use new convert command here ??? undoTrans(x0, y0); undoTrans(x1, y1); // convert to WCS double ra0 = 0.0, dec0 = 0.0, ra1 = 0.0, dec1 = 0.0; if (image_->wcs().pix2wcs((int)x0, (int)y0, ra0, dec0) != 0 || image_->wcs().pix2wcs((int)x1, (int)y1, ra1, dec1) != 0) return TCL_ERROR; // check results if (ra0 == 0.0 || dec0 == 0.0 || ra1 == 0.0 || dec1 == 0.0) return TCL_OK; double dist = WorldCoords::dist(ra0, dec0, ra1, dec1)*60.; #else canvasToWorldCoords(x0, y0, 0); canvasToWorldCoords(x1, y1, 0); double dist = WorldCoords::dist(x0, y0, x1, y1)*60.; #endif return set_result(dist); } /* * This method implements the wcsequinox subcommand. * * usage: * set equinox [$image wcsequinox] * * The return value in Tcl is the world coordinate equinox * for the values of RA and DEC returned by the wcs... * commands. */ int RtdImage::wcsequinoxCmd(int argc, char* argv[]) { if (!isWcs()) return TCL_OK; double equinox = image_->wcs().equinox(); if (equinox != 0.0) { char buf[32]; sprintf(buf, "%.2f", equinox); return set_result(buf); } return TCL_OK; } /* * implement the "wcsheight" image command to return the world * coordinates height of the image * * usage: wcsheight * * The return value in Tcl is the height in arcmin or an empty * string if WCS is not supported. */ int RtdImage::wcsheightCmd(int argc, char* argv[]) { if (!isWcs()) return TCL_OK; return set_result(image_->wcs().height()); } /* * implement the "wcsradius" image command to return the world * coordinates radius of the image - the distance in arc-minutes from the * center point to the origin. * * usage: wcsradius * * The return value in Tcl is the radius in arc-minutes or an empty * string if WCS is not supported. */ int RtdImage::wcsradiusCmd(int argc, char* argv[]) { if (!isWcs()) return TCL_OK; return set_result(image_->wcs().radius()); } /* * wcsset subcommand: * * usage: * * $image wcsset $ra $dec $secpix $xrefpix $yrefpix $nxpix $nypix $rotate \ * $equinox $epoch $proj * $image wcsset * * If arguments are specified, this subcommand sets up the WCS structure * from the given information about the image: * * Args: * ra = Center right ascension in degrees * dec = Center declination in degrees * secpix = Number of arcseconds per pixel * xrefpix = Reference pixel X coordinate * yrefpix = Reference pixel Y coordinate * nxpix = Number of pixels along x-axis * nypix = Number of pixels along y-axis * rotate = Rotation angle (clockwise positive) in degrees * equinox = Equinox of coordinates, 1950 and 2000 supported * epoch = Epoch of coordinates, used for FK4/FK5 conversion no effect if 0 * proj = Projection * * With no arguments, the command returns a list of the basic WCS * parameter values: {ra dec secpix nxpix nypix rotate equinox epoch}. * * */ int RtdImage::wcssetCmd(int argc, char* argv[]) { if (!image_) return TCL_OK; // get a reference to the WCS object for the current image WCS& wcs = image_->wcs(); if (argc == 0) { // no args, return list of values char buf[256]; if (wcs.isWcs()) { // get RA and DEC of the center of the image char raStr[32], decStr[32]; raStr[0] = decStr[0] = '\0'; WorldCoords pos = wcs.center(); if (pos.status() != 0) return TCL_ERROR; pos.print(raStr, decStr, wcs.equinox()); // make the result list sprintf(buf, "%s %s %g %g %g %d %d %g %g %g %s", raStr, decStr, wcs.secPix(), wcs.xRefPix(), wcs.yRefPix(), wcs.pixWidth(), wcs.pixHeight(), wcs.rotate(), wcs.equinox(), wcs.epoch(), wcs.projection()); return set_result(buf); } else { // no WCS, return default info sprintf(buf, "{} {} {} {} {} %d %d 0 2000 2000 {}", image_->width(), image_->height()); return set_result(buf); } } else if (argc == 11) { double ra, dec, secpix, xrefpix, yrefpix, rotate, equinox, epoch; int nxpix, nypix; char* proj = (char *)""; // skip over B in B1950 and J in J2000 if (strcmp(argv[8], "B1950") == 0) equinox = 1950.; else if (strcmp(argv[8], "J2000") == 0) equinox = 2000.; else { if (Tcl_GetDouble(interp_, argv[8], &equinox) != TCL_OK) return TCL_ERROR; if (equinox != 2000. && equinox != 1950.) return error("expected equinox to be 2000. or 1950."); } // expect ra and dec in H:M:S D:M:S format WorldCoords pos(argv[0], argv[1], equinox); if (pos.status() != 0) return TCL_ERROR; pos.get(ra, dec, equinox); // get ra and dec in the right equinox // set WCS info if (Tcl_GetDouble(interp_, argv[2], &secpix) != TCL_OK || Tcl_GetDouble(interp_, argv[3], &xrefpix) != TCL_OK || Tcl_GetDouble(interp_, argv[4], &yrefpix) != TCL_OK || Tcl_GetInt(interp_, argv[5], &nxpix) != TCL_OK || Tcl_GetInt(interp_, argv[6], &nypix) != TCL_OK || Tcl_GetDouble(interp_, argv[7], &rotate) != TCL_OK || Tcl_GetDouble(interp_, argv[9], &epoch) != TCL_OK) return TCL_ERROR; proj = argv[10]; return wcs.set(ra, dec, secpix, xrefpix, yrefpix, nxpix, nypix, rotate, int(equinox), epoch, proj); } return error("wrong number of arguments for wcsset subcommand"); } /* * wcsshift subcommand * * usage: * $image wcsshift $ra $dec $coorsys * * This command resets the center of the WCS structure. * * Args: * ra = New center right ascension in degrees * dec = New center declination in degrees * equinox = (must be 2000 or 1950) * */ int RtdImage::wcsshiftCmd(int argc, char* argv[]) { if (!isWcs()) return TCL_OK; double ra, dec, equinox; if (Tcl_GetDouble(interp_, argv[0], &ra) != TCL_OK || Tcl_GetDouble(interp_, argv[1], &dec) != TCL_OK || Tcl_GetDouble(interp_, argv[2], &equinox) != TCL_OK) return TCL_ERROR; return image_->wcs().shift(ra, dec, equinox); } /* * implement the "wcswidth" image command to return the world * coordinates width of the image * * usage: wcswidth * * The return value in Tcl is the width in arcmin or an empty * string if WCS is not supported. */ int RtdImage::wcswidthCmd(int argc, char* argv[]) { if (!isWcs()) return TCL_OK; return set_result(image_->wcs().width()); } /* * Implement the "width" subcommand - returns the * unscaled width of the current image. */ int RtdImage::widthCmd(int argc, char* argv[]) { if (!image_) return set_result(0); return set_result(image_->width()); } /* * zoom subcommand: * usage: * zoom start * zoom stop * * zoom slow * zoom fast * * "$image zoom slow" can be used to slow down the zoom window * updates so they don't drag down performance, otherwise zoom * window updates are forced to be displayed immediately for better * feedback (zoom fast). */ int RtdImage::zoomCmd(int argc, char* argv[]) { int status = TCL_OK; if (strcmp(argv[0], "start") == 0) { // zoom start subcommand if (argc != 3) return error("wrong # of args: should be \"pathName zoom start win factor\""); int zoomFactor; if (Tcl_GetInt(interp_, argv[2], &zoomFactor) != TCL_OK) return TCL_ERROR; if (zoomFactor < 1 || zoomFactor > 160) return error("zoomFactor should be between 1 and 160"); Tk_Window zoomWin = Tk_NameToWindow(interp_, argv[1], tkwin_); if (zoomWin == NULL) return TCL_ERROR; int width = Tk_Width(zoomWin); int height = Tk_Height(zoomWin); // round off size to be a multiple of the zoom factor width += (zoomFactor - width % zoomFactor); height += (zoomFactor - height % zoomFactor); if (zoomer_) delete zoomer_; zoomer_ = new ImageZoom(zoomWin, gc_, width, height, zoomFactor, usingXShm_, verbose()); status = zoomer_->status(); } else if (strcmp(argv[0], "stop") == 0) { // zoom unset subcommand delete zoomer_; zoomer_ = NULL; } else if (strcmp(argv[0], "slow") == 0) { // zoom slow subcommand zoomSpeed_ = -1; } else if (strcmp(argv[0], "fast") == 0) { // zoom fast subcommand zoomSpeed_ = 1; } else { return error("invalid image zoom subcommand: should be \"start\" or \"stop\""); } // tell the other views to use the zoom window too for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i]) { view_[i]->zoomer_ = zoomer_; view_[i]->zoomSpeed_ = zoomSpeed_; } } return TCL_OK; } /* * zoomview subcommand: alternative zoom window, using rtdimage view, so that * zoom is always accurate, even when image is shrunk. * * usage: * zoomview start ?count? * zoomview stop ?count? * zoom slow * zoom fast * * where view is the name of a second rtdimage. * * start - starts zooming using the given zoom factor magnification. * If 4 && Tcl_GetInt(interp_, argv[4], &count) != TCL_OK) return TCL_ERROR; if (zoomFactor < 1 || zoomFactor > 160) return error("zoomFactor should be between 1 and 160"); // allow an optional second zoom view RtdImage*& view = (count == 1) ? zoomView_ : zoomView2_; view = getView(argv[1]); if (view == NULL) return TCL_ERROR; view->propagateScale_ = propagateScale; view->zoomFactor_ = zoomFactor; if (updateViews(2) != TCL_OK) return TCL_ERROR; } else if (strcmp(argv[0], "stop") == 0) { // zoom unset subcommand int count = 1; if (argc > 1 && Tcl_GetInt(interp_, argv[1], &count) != TCL_OK) return TCL_ERROR; RtdImage*& view = (count == 1) ? zoomView_ : zoomView2_; // Reset zoomfactor for reference counted copies. if ( view != NULL ) { view->zoomFactor_ = 1; } view = NULL; } else if (strcmp(argv[0], "slow") == 0) { // zoom slow subcommand zoomSpeed_ = -1; } else if (strcmp(argv[0], "fast") == 0) { // zoom fast subcommand zoomSpeed_ = 1; } else { return error("invalid image zoomview subcommand: should be \"start\", \"stop\", ..."); } // tell the other views to use the zoom window too // note: the check for displaymode() != 0 is to keep the pan window // from using the zoom window, which can be very slow on huge images. for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i] && view_[i]->displaymode() != 0) { view_[i]->zoomView_ = zoomView_; view_[i]->zoomView2_ = zoomView2_; view_[i]->zoomSpeed_ = zoomSpeed_; } } if (zoomView_) { zoomView_->zoomView_ = NULL; zoomView_->zoomView2_ = NULL; } if (zoomView2_) { zoomView2_->zoomView_ = NULL; zoomView2_->zoomView2_ = NULL; } return TCL_OK; } skycat-3.1.2-starlink-1b/rtd/generic/RtdCmds.icc000066400000000000000000000056261215713201500213730ustar00rootroot00000000000000// -*-c++-*- #ifndef _RtdCmds_h_ #define _RtdCmds_h_ /* * E.S.O. - VLT project * "@(#) $Id: RtdCmds.icc,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdCmds.h - definitions for the RtdImage subcommand methods * * who when what * -------------- -------- ---------------------------------------- * pbiereic 01/03/01 Created */ public: int alloccolorsCmd (int argc, char* argv[]); int autocutCmd (int argc, char* argv[]); int biasimageCmd (int argc, char* argv[]); int bitpixCmd (int argc, char* argv[]); int bltgraphCmd (int argc, char* argv[]); int cameraCmd (int argc, char* argv[]); int clearCmd (int argc, char* argv[]); int cmapCmd (int argc, char* argv[]); int colorrampCmd (int argc, char* argv[]); int colorscaleCmd (int argc, char* argv[]); int convertCmd (int argc, char* argv[]); int cutCmd (int argc, char* argv[]); int dispheightCmd (int argc, char* argv[]); int dispwidthCmd (int argc, char* argv[]); int dumpCmd (int argc, char* argv[]); int fitsCmd (int argc, char* argv[]); int flipCmd (int argc, char* argv[]); int frameidCmd (int argc, char* argv[]); int freqCmd (int argc, char* argv[]); int getCmd (int argc, char* argv[]); int getvalsCmd (int argc, char* argv[]); int graphdistCmd (int argc, char* argv[]); int hduCmd (int argc, char* argv[]); int heightCmd (int argc, char* argv[]); int infoCmd (int argc, char* argv[]); int isclearCmd (int argc, char* argv[]); int ittCmd (int argc, char* argv[]); int maxCmd (int argc, char* argv[]); int maxFreqCmd (int argc, char* argv[]); int mbandCmd (int argc, char* argv[]); int minCmd (int argc, char* argv[]); int mmapCmd (int argc, char* argv[]); int motioneventCmd (int argc, char* argv[]); int objectCmd (int argc, char* argv[]); int panCmd (int argc, char* argv[]); int perfTestCmd (int argc, char* argv[]); int pixtabCmd (int argc, char* argv[]); int previewCmd (int argc, char* argv[]); int radecboxCmd (int argc, char* argv[]); int remoteCmd (int argc, char* argv[]); int remoteTclCmd (int argc, char* argv[]); int rotateCmd (int argc, char* argv[]); int scaleCmd (int argc, char* argv[]); int shmCmd (int argc, char* argv[]); int spectrumCmd (int argc, char* argv[]); int statisticsCmd (int argc, char* argv[]); int typeCmd (int argc, char* argv[]); int updateCmd (int argc, char* argv[]); int viewCmd (int argc, char* argv[]); int warpCmd (int argc, char* argv[]); int wcssetCmd (int argc, char* argv[]); int wcsshiftCmd (int argc, char* argv[]); int wcsdeltsetCmd (int argc, char* argv[]); int wcscenterCmd (int argc, char* argv[]); int wcsdistCmd (int argc, char* argv[]); int wcsequinoxCmd (int argc, char* argv[]); int wcsheightCmd (int argc, char* argv[]); int wcsradiusCmd (int argc, char* argv[]); int wcswidthCmd (int argc, char* argv[]); int widthCmd (int argc, char* argv[]); int zoomCmd (int argc, char* argv[]); int zoomviewCmd (int argc, char* argv[]); #endif /* _RtdCmds_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/RtdCoords.C000066400000000000000000000461221215713201500213560ustar00rootroot00000000000000/******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: RtdCoords.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * pbiereic 01/03/01 created (copied from RtdImage.C) */ /************************************************************************ * NAME * * RtdCoords.C - methods for Rtdimage coordinate conversion * * SYNOPSIS * * * DESCRIPTION * * This file contains all RtdImage member functions needed for * Rtdimage coordinate conversion * * FILES * * ENVIRONMENT * * CAUTIONS * * SEE ALSO * RtdImage(3), RTD documentation * * BUGS * *------------------------------------------------------------------------ */ static const char *rcsId="@(#) $Id: RtdCoords.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include "RtdImage.h" /* * Return the equinox (or coordinate system) portion of the given * coordinate type string. The input arg is of the form * "wcs 2000" or "deg B1950", for example. The return value is the part * after "wcs " or "deg ", and defaults to "2000". */ static const char* getEquinoxStr(const char* coordType) { if (coordType && strlen(coordType) > 4 && (strncmp(coordType, "deg ", 4) == 0 || strncmp(coordType, "wcs ", 4) == 0)) { return coordType+4; } return "2000"; } /* * return the enum CoordinateType value given the string name */ RtdImage::CoordinateType RtdImage::getCoordinateType(const char* s) { switch (*s) { case 'i': return CT_IMAGE; case 's': return CT_SCREEN; case 'w': return CT_WCS; case 'd': return CT_DEG; case 'c': int n = strlen(s); if (strncmp(s, "canvas", n) == 0) return CT_CANVAS; if (strncmp(s, "chip", n) == 0) return CT_CHIP; } error("unknown coord type: ", s); return CT_NONE; } /* * This method converts between different coordinate representations * where the coordinates are passed in string form. * * If dist_flag is non-zero, the coords are treated as a distance, * otherwise as a point. * * inx_buf and iny_buf hold the input coords (or distance) in the given * input coordinate system. If outx_buf and outy_buf are not NULL, they * hold the string form of the resulting coordinates in the target (out) * coordinate system. The decimal result values are written to "x" and * "y". * * The return value is the Tcl status. * * The available coordinate systems are: * * canvas - canvas coordinates (canvas scroll area) * screen - canvas window coords (visible area) * image - basic image pixel coords (at mag 1, no transformations) * chip - detector chip coordinates * wcs - world coordinates in H:M:S * deg - world coordinates in degrees * * The world coordinate types: "wcs" and "deg" may also include the equinox, * for example: "wcs 1950" or "deg 2000". The default equinox is 2000. * * Note: the coordinate types may be abbrieviated. */ int RtdImage::convertCoordsStr(int dist_flag, const char* inx_buf, const char* iny_buf, char* outx_buf, char* outy_buf, double& x, double& y, const char* in_type, const char* out_type) { char in = *in_type, out = *out_type; if (outx_buf) outx_buf[0] = '\0'; if (outy_buf) outy_buf[0] = '\0'; // get x and y as doubles if (in == 'w') { // convert H:M:S to degrees WorldCoords wcs(inx_buf, iny_buf); if (wcs.status() != TCL_OK) return TCL_ERROR; x = wcs.ra_deg(); y = wcs.dec_deg(); } else { if (Tcl_GetDouble(interp_, (char*)inx_buf, &x) != TCL_OK || Tcl_GetDouble(interp_, (char*)iny_buf, &y) != TCL_OK) { return TCL_ERROR; } } if (convertCoords(dist_flag, x, y, in_type, out_type) != TCL_OK) return TCL_ERROR; // format world coords in h:m:s if needed if (out == 'w' && outx_buf && outy_buf) { // Note: don't need equinox here since we are only formatting the coords WorldCoords wcs(x, y); wcs.print(outx_buf, outy_buf); } else { if (outx_buf) sprintf(outx_buf, "%.17g", x); if (outy_buf) sprintf(outy_buf, "%.17g", y); } return TCL_OK; } /* * NOTE: This method should not be called. It is only for backward * compatibility. * * Convert inx,iny in the given coord system to outx,outy in the given * output coord system. The coord types here are single char * abbrieviations: * * c = canvas coords * i = image coords * s = screen coords * w = world coords (in the equinox of the image) * d = world coords in degrees (in the equinox of the image) * * For backward compatibility, this method just calls the more general * version, which checks if the equinox needs to be changed. */ int RtdImage::convertCoords(int dist_flag, double& x, double& y, char in_type, char out_type) { char in[2], out[2]; in[0] = in_type; in[1] = '\0'; out[0] = out_type; out[1] = '\0'; return convertCoords(dist_flag, x, y, in, out); } /* * Convert inx,iny in the given coord system to outx,outy in the given * output coord system. The coord types are the same as for * convertCoordsStr(): * * canvas - canvas coordinates (canvas scroll area) * screen - canvas window coords (visible area) * image - basic image pixel coords (at mag 1, no transformations) * chip - detector chip or CCD coordinates * wcs - world coordinates in H:M:S * deg - world coordinates in degrees * * The world coordinate types: "wcs" and "deg" may also include the equinox, * for example: "wcs 1950" or "deg 2000". The default equinox is 2000. * * To convert coordinates we have to take some or all of the following * into account: * * 1. Transformations: rotate, scale, flipX,Y * These handled by the ImageData methods doTrans() and * undoTrans(). * * 2. Scrolling offsets in canvas * member vars: canvasX_ and canvasY * * 3. Origin of image in image coords * member vars: frameX_, frameY_ * * 4. Image coordinates at origin: * member vars: xOffset_, yOffset_ * * For "chip" coordinates, special fields in the real-time image events, * or for files, the FITS keywords: HIERARCH ESO DET WIN1 STRX and * STRY indicate the chip origin. If this information is not available, * then chip coordinates are the same as image coordinates. */ int RtdImage::convertCoords(int dist_flag, double& x, double& y, const char* in_type, const char* out_type) { CoordinateType in = getCoordinateType(in_type), out = getCoordinateType(out_type); if (in == CT_NONE || out == CT_NONE) return TCL_ERROR; if (in == out) return TCL_OK; char* msg = (char *)"unknown coordinate type"; switch(in) { case CT_CANVAS: // input is canvas coords switch(out) { case CT_SCREEN: // convert canvas to screen coords return canvasToScreenCoords(x, y, dist_flag); case CT_IMAGE: // convert canvas to image coords return canvasToImageCoords(x, y, dist_flag); case CT_CHIP: // convert canvas to chip coords return canvasToChipCoords(x, y, dist_flag); case CT_WCS: // convert canvas to world coords case CT_DEG: if (canvasToWorldCoords(x, y, dist_flag) == TCL_OK) { changeEquinox(dist_flag, x, y, image_->wcs().equinoxStr(), getEquinoxStr(out_type)); return TCL_OK; } return TCL_ERROR; default: return error(msg); } break; case CT_SCREEN: // input is screen coords switch(out) { case CT_CANVAS: // convert screen to canvas coords return screenToCanvasCoords(x, y, dist_flag); case CT_IMAGE: // convert screen to image coords return screenToImageCoords(x, y, dist_flag); case CT_CHIP: // convert screen to chip coords return screenToChipCoords(x, y, dist_flag); case CT_WCS: // convert screen to world coords case CT_DEG: if (screenToWorldCoords(x, y, dist_flag) == TCL_OK) { changeEquinox(dist_flag, x, y, image_->wcs().equinoxStr(), getEquinoxStr(out_type)); return TCL_OK; } return TCL_ERROR; default: return error(msg); } break; case CT_IMAGE: // input is image coords switch(out) { case CT_CANVAS: // convert image to canvas coords return imageToCanvasCoords(x, y, dist_flag); case CT_SCREEN: // convert image to screen coords return imageToScreenCoords(x, y, dist_flag); case CT_CHIP: // convert image to chip coords return imageToChipCoords(x, y, dist_flag); case CT_WCS: // convert image to world coords case CT_DEG: if (imageToWorldCoords(x, y, dist_flag) == TCL_OK) { changeEquinox(dist_flag, x, y, image_->wcs().equinoxStr(), getEquinoxStr(out_type)); return TCL_OK; } return TCL_ERROR; default: return error(msg); } break; case CT_CHIP: // input is chip coords switch(out) { case CT_CANVAS: // convert chip to canvas coords return chipToCanvasCoords(x, y, dist_flag); case CT_SCREEN: // convert chip to screen coords return chipToScreenCoords(x, y, dist_flag); case CT_IMAGE: // convert chip to image coords return chipToImageCoords(x, y, dist_flag); case CT_WCS: // convert chip to world coords case CT_DEG: if (chipToWorldCoords(x, y, dist_flag) == TCL_OK) { changeEquinox(dist_flag, x, y, image_->wcs().equinoxStr(), getEquinoxStr(out_type)); return TCL_OK; } return TCL_ERROR; default: return error(msg); } break; case CT_DEG: // input is world coords case CT_WCS: // convert to image equinox changeEquinox(dist_flag, x, y, getEquinoxStr(in_type), image_->wcs().equinoxStr()); switch(out) { case CT_CANVAS: // convert world to canvas coords return worldToCanvasCoords(x, y, dist_flag); case CT_SCREEN: // convert world to screen coords return worldToScreenCoords(x, y, dist_flag); case CT_IMAGE: // convert world to image coords return worldToImageCoords(x, y, dist_flag); case CT_CHIP: // convert world to chip coords return worldToChipCoords(x, y, dist_flag); case CT_WCS: // no conversion case CT_DEG: changeEquinox(dist_flag, x, y, image_->wcs().equinoxStr(), getEquinoxStr(out_type)); return TCL_OK; default: return error(msg); } break; } return TCL_OK; } /* * Utility method to change the equinox of ra and dec * from in_quinox to out_equinox, if dist_flag is 0. * Note that the equinox values may be a number, such as * 2000 or 1950, or a system name, such as "galactic", "ecliptic", * "J2000", "B1950". */ void RtdImage::changeEquinox(int dist_flag, double& ra, double& dec, const char* in_equinox, const char* out_equinox) { if (!dist_flag) { if (in_equinox && out_equinox && !strcmp(in_equinox, out_equinox) == 0) { WorldCoords wcs(ra, dec, in_equinox); wcs.get(ra, dec, out_equinox); } } } /* * convert canvas to screen coords */ int RtdImage::canvasToScreenCoords(double& x, double& y, int dist_flag) { if (!dist_flag) { x += canvasX_; y += canvasY_; } return TCL_OK; } /* * convert canvas to image coords * * Note: there are 2 cases to handle here: * 1. a frame displaying an image at an offset with the origin at 0,0 * 2. same as above, but with the origin at xOffset,yOffset * * In the normal case, the offset and origin are both zero... */ int RtdImage::canvasToImageCoords(double& x, double& y, int dist_flag) { if (!dist_flag) { double dx = xOffset_, dy = yOffset_; doTrans(dx, dy, 1); if (frameX_ == 0) x += dx; if (frameY_ == 0) y += dy; } undoTrans(x, y, dist_flag); return TCL_OK; } /* * convert canvas to world coords */ int RtdImage::canvasToWorldCoords(double& x, double& y, int dist_flag) { return canvasToImageCoords(x, y, dist_flag) || imageToWorldCoords(x, y, dist_flag); } int RtdImage::canvasToChipCoords(double& x, double& y, int dist_flag) { return canvasToImageCoords(x, y, dist_flag) || imageToChipCoords(x, y, dist_flag); } int RtdImage::chipToImageCoords(double& x, double& y, int dist_flag) { if (! dist_flag) image_->chipToImageCoords(x, y); return TCL_OK; } int RtdImage::chipToCanvasCoords(double& x, double& y, int dist_flag) { return chipToImageCoords(x, y, dist_flag) || imageToCanvasCoords(x, y, dist_flag); } int RtdImage::chipToScreenCoords(double& x, double& y, int dist_flag) { return chipToImageCoords(x, y, dist_flag) || imageToScreenCoords(x, y, dist_flag); } int RtdImage::chipToWorldCoords(double& x, double& y, int dist_flag) { return chipToImageCoords(x, y, dist_flag) || imageToWorldCoords(x, y, dist_flag); } /* * convert image to canvas coords */ int RtdImage::imageToCanvasCoords(double& x, double& y, int dist_flag) { doTrans(x, y, dist_flag); if (!dist_flag) { double dx = xOffset_, dy = yOffset_; doTrans(dx, dy, 1); if (frameX_ == 0) x -= dx; if (frameY_ == 0) y -= dy; } return TCL_OK; } /* * convert image to screen coords */ int RtdImage::imageToScreenCoords(double& x, double& y, int dist_flag) { return imageToCanvasCoords(x, y, dist_flag) || canvasToScreenCoords(x, y, dist_flag); } /* * convert main image coordinates to raw image array coordinates. * * The resulting coordinates can be used to index into the raw image * array, which might begin at a logical offset other than 0,0. This is * only neeeded for rapid frames, since these display coordinates for the * main image, but have smaller data arrays that start at some x,y offset. */ int RtdImage::imageToRawImageCoords(double& x, double& y) { if (rapidFrame_) { // only rapid frames need this... // get offset for rapid frame in main image: // (only one of rapidX_,frameX_ etc. will be non-zero...) double dx = (rapidX_ + frameX_), dy = (rapidY_ + frameY_); if (image_->flipY()) y -= dy; else y -= viewMaster_->image_->height() - image_->height() - dy; if (image_->flipX()) x -= viewMaster_->image_->width() - image_->width() - dx; else x -= dx; } return 0; } /* * convert image to world coords in the equinox of the image */ int RtdImage::imageToWorldCoords(double& x, double& y, int dist_flag) { double ra, dec; if (dist_flag) { if (image_->wcs().pix2wcsDist(x, y, ra, dec) != 0) return TCL_ERROR; } else { if (image_->wcs().pix2wcs(x, y, ra, dec) != 0) return TCL_ERROR; } x = ra; y = dec; return TCL_OK; } int RtdImage::imageToChipCoords(double& x, double& y, int dist_flag) { if (! dist_flag) image_->imageToChipCoords(x, y); return TCL_OK; } /* * convert screen to Ximage coords (index in X Image) */ int RtdImage::screenToXImageCoords(double& x, double& y) { if (displaymode() == 0) { x -= canvasX_; y -= canvasY_; } else { // if the xImage smaller than the window, add the neg. scroll offset double fx = frameX_, fy = frameY_; doTrans(fx, fy, 1); if (canvasX_ > 0) x += -canvasX_ - fx; else if (fx) x -= (fx + canvasX_) ; if (canvasY_ > 0) y += -canvasY_ - fy; else if (fy) y -= (fy + canvasY_); } return TCL_OK; } int RtdImage::screenToChipCoords(double& x, double& y, int dist_flag) { return screenToImageCoords(x, y, dist_flag) || imageToChipCoords(x, y, dist_flag); } /* * convert screen to canvas coords */ int RtdImage::screenToCanvasCoords(double& x, double& y, int dist_flag) { if (!dist_flag) { x -= canvasX_; y -= canvasY_; } return TCL_OK; } /* * convert screen to image coords */ int RtdImage::screenToImageCoords(double& x, double& y, int dist_flag) { return screenToCanvasCoords(x, y, dist_flag) || canvasToImageCoords(x, y, dist_flag); } /* * convert screen to world coords */ int RtdImage::screenToWorldCoords(double& x, double& y, int dist_flag) { return screenToImageCoords(x, y, dist_flag) || imageToWorldCoords(x, y, dist_flag); } /* * convert world to canvas coords */ int RtdImage::worldToCanvasCoords(double& x, double& y, int dist_flag) { return worldToImageCoords(x, y, dist_flag) || imageToCanvasCoords(x, y, dist_flag); } /* * convert world to screen coords */ int RtdImage::worldToScreenCoords(double& x, double& y, int dist_flag) { return worldToCanvasCoords(x, y, dist_flag) || canvasToScreenCoords(x, y, dist_flag); } /* * convert world to image coords */ int RtdImage::worldToImageCoords(double& x, double& y, int dist_flag) { double ra = x, dec = y; if (dist_flag) { if (image_->wcs().wcs2pixDist(ra, dec, x, y) != 0) return TCL_ERROR; } else if (image_->wcs().wcs2pix(ra, dec, x, y) != 0) return TCL_ERROR; return TCL_OK; } int RtdImage::worldToChipCoords(double& x, double& y, int dist_flag) { return worldToImageCoords(x, y, dist_flag) || imageToChipCoords(x, y, dist_flag); } /* * convert Ximage to image coords */ int RtdImage::xImageToImageCoords(double& x, double& y, int dist_flag) { double dx = xOffset_, dy = yOffset_; doTrans(dx, dy, 1); x += dx; y += dy; undoTrans(x, y, dist_flag); return TCL_OK; } /* * convert x,y image coords to a distance */ void RtdImage::coordsToDist(double& x, double& y) { // for image frame in same window, use master coords if (viewMaster_) { if (viewMaster_->tkwin_ == tkwin_) viewMaster_->coordsToDist(x, y); else image_->coordsToDist(x, y, viewMaster_->image_->width(), viewMaster_->image_->height()); } else { image_->coordsToDist(x, y); } } /* * convert x,y distance to coordinates */ void RtdImage::distToCoords(double& x, double& y) { // for image frame in same window, use master coords if (viewMaster_) { if (viewMaster_->tkwin_ == tkwin_) viewMaster_->distToCoords(x, y); else image_->distToCoords(x, y, viewMaster_->image_->width(), viewMaster_->image_->height()); } else { image_->distToCoords(x, y); } } /* * apply the current transformations to the given coordinates * If distFlag is 1, x and y are treated as a distance, otherwise * they are treated as a point and flipped as needed. */ void RtdImage::doTrans(double& x, double& y, int distFlag) { if (distFlag) { image_->doTrans(x, y, distFlag); } else if (viewMaster_) { if (viewMaster_->tkwin_ == tkwin_) { viewMaster_->doTrans(x, y, distFlag); } else { image_->doTrans(x, y, distFlag, rapidX_, rapidY_, viewMaster_->image_->width(), viewMaster_->image_->height()); } } else { image_->doTrans(x, y, distFlag, rapidX_, rapidY_); } } /* * undo the current transformations on the given coordinates. * If distFlag is 1, x and y are treated as a distance, otherwise * they are treated as a point and flipped as needed. */ void RtdImage::undoTrans(double& x, double& y, int distFlag) { if (distFlag) { image_->undoTrans(x, y, distFlag); } else if (viewMaster_) { if (viewMaster_->tkwin_ == tkwin_) { viewMaster_->undoTrans(x, y, distFlag); } else { image_->undoTrans(x, y, distFlag, rapidX_, rapidY_, viewMaster_->image_->width(), viewMaster_->image_->height()); } } else { image_->undoTrans(x, y, distFlag, rapidX_, rapidY_); } } skycat-3.1.2-starlink-1b/rtd/generic/RtdCoords.icc000066400000000000000000000064721215713201500217360ustar00rootroot00000000000000// -*-c++-*- #ifndef _RtdCoords_h_ #define _RtdCoords_h_ /* * E.S.O. - VLT project * "@(#) $Id: RtdCoords.icc,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdCoords.h - definitions for the Rtdimage coordinate conversion methods * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * pbiereic 01/03/01 created (copied from RtdImage.h) */ public: // coordinate conversion types enum CoordinateType { CT_NONE = 0, CT_IMAGE = 'i', CT_CANVAS = 'c', CT_SCREEN = 's', CT_WCS = 'w', CT_DEG = 'd', CT_CHIP = 'C' }; // return the enum CoordinateType value given the string name CoordinateType getCoordinateType(const char* s); // convert coords from string form int convertCoordsStr(int dist_flag, const char* inx_buf, const char* iny_buf, char* outx_buf, char* outy_buf, double& x, double& y, const char* in_type, const char* out_type); // convert coords from doubles int convertCoords(int dist_flag, double& x, double& y, const char* in_type, const char* out_type); // convert coords as doubles (for WCS, assumes equinox of image, // coord type only specifies first letter and no equinox). int convertCoords(int dist_flag, double& x, double& y, char in_type, char out_type); // Utility method to change the equinox of ra and dec if dist_flag is 0 void changeEquinox(int dist_flag, double& ra, double& dec, const char* in_equinox, const char* out_equinox); // utility methods to convert between different coordinate systems int canvasToChipCoords (double& x, double& y, int dist_flag); int canvasToImageCoords (double& x, double& y, int dist_flag); int canvasToScreenCoords (double& x, double& y, int dist_flag); int canvasToWorldCoords (double& x, double& y, int dist_flag); int chipToCanvasCoords (double& x, double& y, int dist_flag); int chipToImageCoords (double& x, double& y, int dist_flag); int chipToScreenCoords (double& x, double& y, int dist_flag); int chipToWorldCoords (double& x, double& y, int dist_flag); int imageToCanvasCoords (double& x, double& y, int dist_flag); int imageToChipCoords (double& x, double& y, int dist_flag); int imageToScreenCoords (double& x, double& y, int dist_flag); int imageToWorldCoords (double& x, double& y, int dist_flag); int screenToCanvasCoords (double& x, double& y, int dist_flag); int screenToChipCoords (double& x, double& y, int dist_flag); int screenToImageCoords (double& x, double& y, int dist_flag); int screenToWorldCoords (double& x, double& y, int dist_flag); int worldToCanvasCoords (double& x, double& y, int dist_flag); int worldToChipCoords (double& x, double& y, int dist_flag); int worldToImageCoords (double& x, double& y, int dist_flag); int worldToScreenCoords (double& x, double& y, int dist_flag); // -- short cuts -- protected: // these coordinate conversion methods are only needed internally int screenToXImageCoords (double& x, double& y); int xImageToImageCoords (double& x, double& y, int dist_flag); int imageToRawImageCoords (double& x, double& y); void coordsToDist (double& x, double& y); void distToCoords (double& x, double& y); void doTrans (double& x, double& y, int distFlag = 0); void undoTrans (double& x, double& y, int distFlag = 0); #endif /* _RtdCoords_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/RtdHDU.C000066400000000000000000000502351215713201500205450ustar00rootroot00000000000000/******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: RtdHDU.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------- -------- ---------------------------------------------- * A. Brighton 05/10/95 Created * pbiereic 01/03/01 copied from RtdImage.C * pbiereic 14/08/01 added "hdu fits" subcommand * P. W. Draper 20/05/07 pick out special columns in getHDU entry * and examine the properties so that we make * sure there is an id column (when the positional * columns take up column 0) and that any sky * coordinates are convered from radians to degrees. * also delete the fits copy in hduCmdSet when * a table is accessed, stops a leak. * P.W. Draper 16/03/09 Transfer comments from FITS extension to the * local table in getHDU (these can be useful for * provenance and may contain additional meta-data). */ /************************************************************************ * NAME * * RtdHDU.C - methods for Rtdimage subcommand hduCmd() * * SYNOPSIS * * * DESCRIPTION * * This file contains all RtdImage member functions needed for * the Rtdimage subcommand hduCmd() * * FILES * * ENVIRONMENT * * CAUTIONS * * SEE ALSO * RtdImage(3), RTD documentation * * BUGS * *------------------------------------------------------------------------ */ static const char *rcsId="@(#) $Id: RtdHDU.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "RtdImage.h" // Trig conversion factors. static const double pi_ = 3.14159265358979323846; static const double r2d_ = 57.295779513082323; // (180.0/pi_) /* * Implement the hdu headings subcommand: * * hdu headings ?$number? * * See comments for hduCmd() for details. */ int RtdImage::hduCmdHeadings(int argc, char** argv, FitsIO* fits) { int hdu = fits->getHDUNum(); int saved_hdu = hdu; int numHDUs = fits->getNumHDUs(); // check for the optional hdu arg, otherwise use current if (argc >= 2 && sscanf(argv[1], "%d", &hdu) == 1) { if (hdu != saved_hdu) { if (hdu < 1 || hdu > numHDUs) return fmt_error("HDU number %d out of range (max %d)", hdu, numHDUs); // switch to the given HDU, but restore the original before returning if (fits->setHDU(hdu) != 0) return TCL_ERROR; } } // get the info and catch any errors int status = getHDUHeadings(fits); // restore the original HDU before returning if (hdu != saved_hdu && fits->setHDU(saved_hdu) != 0) status = TCL_ERROR; return status; } /* * Implement the hdu fits subcommand: * * hdu fits ?$number? * * See comments for hduCmd() for details. */ int RtdImage::hduCmdFits(int argc, char** argv, FitsIO* fits) { int hdu = fits->getHDUNum(); int saved_hdu = hdu; int numHDUs = fits->getNumHDUs(); int status = TCL_OK; // check for the optional hdu arg, otherwise use current if (argc >= 2 && sscanf(argv[1], "%d", &hdu) == 1) { if (hdu != saved_hdu) { if (hdu < 1 || hdu > numHDUs) return fmt_error("HDU number %d out of range (max %d)", hdu, numHDUs); // switch to the given HDU, but restore the original before returning if (fits->setHDU(hdu) != 0) return TCL_ERROR; } } // get the FITS header ostringstream os; fits->getFitsHeader(os); set_result(os.str().c_str()); // restore the original HDU before returning if (hdu != saved_hdu && fits->setHDU(saved_hdu) != 0) status = TCL_ERROR; return status; } /* * This method is used to implement the "hdu headings" subcommand. * It returns the table headings of the current FITS table as a * Tcl list. An error is returned if the current HDU is not a FITS * table. */ int RtdImage::getHDUHeadings(FitsIO* fits) { // return a list of table headings for the current FITS table char* type = (char*)fits->getHDUType(); if (!type || *type == 'i') return error("HDU is not a FITS table"); long nrows = 0; int ncols = 0; if (fits->getTableDims(nrows, ncols) != 0) return TCL_ERROR; reset_result(); for(int col = 1; col <= ncols; col++) { char* s = fits->getTableHead(col); if (!s) return TCL_ERROR; append_element(s); } return TCL_OK; } /* * Implement the "hdu type" subcommand: * * hdu type ?$number? * * See comments for hduCmd() for details. */ int RtdImage::hduCmdType(int argc, char** argv, FitsIO* fits) { int hdu = fits->getHDUNum(); int saved_hdu = hdu; int numHDUs = fits->getNumHDUs(); // check for the optional hdu arg, otherwise use current if (argc >= 2 && sscanf(argv[1], "%d", &hdu) == 1) { if (hdu != saved_hdu) { if (hdu < 1) return fmt_error("HDU number %d out of range (min 1)", hdu); if (hdu > numHDUs) return fmt_error("HDU number %d out of range (max %d)", hdu, numHDUs); // switch to the given HDU, but restore the original before returning if (fits->setHDU(hdu) != 0) return TCL_ERROR; } } char* type = (char*)fits->getHDUType(); int status = TCL_OK; if (type) set_result(fits->getHDUType()); else status = TCL_ERROR; // restore the original HDU before returning if (hdu != saved_hdu && fits->setHDU(saved_hdu) != 0) status = TCL_ERROR; return status; } /* * Implement the hdu get subcommand: * * hdu get ?$number? ?$filename? ?$entry? * * See comments for hduCmd() for details. */ int RtdImage::hduCmdGet(int argc, char** argv, FitsIO* fits) { int hdu = fits->getHDUNum(); int saved_hdu = hdu; int numHDUs = fits->getNumHDUs(); // check for the optional hdu arg, otherwise use current if (argc >= 2 && sscanf(argv[1], "%d", &hdu) == 1) { argc--; argv++; if (hdu != saved_hdu) { if (hdu < 1 || hdu > numHDUs) return fmt_error("HDU number %d out of range (max %d)", hdu, numHDUs); // switch to the given HDU, but restore the original before returning if (fits->setHDU(hdu) != 0) return TCL_ERROR; } } // check for the filename arg char* filename = NULL; if (argc >= 2) filename = argv[1]; // check for the entry arg char* entry = NULL; if (argc >= 3) entry = argv[2]; // get the info and catch any errors int status = getHDU(fits, filename, entry); // restore the original HDU before returning if (hdu != saved_hdu && fits->setHDU(saved_hdu) != 0) status = TCL_ERROR; return status; } /* * This method implements the main body of the hdu get subcommand. * If filename arg is not NULL, the contents of the current HDU are * written to the file as a local catalog. Otherwise, the contents * of the current HDU are returned as a Tcl list or rows. If the * entry arg is not null and a filename was specified, it specifies * the catalog config entry for the file's header, in Tcl list format * {{key value} {key value} ...}. */ int RtdImage::getHDU(FitsIO* fits, const char* filename, const char* entry) { const char* type = fits->getHDUType(); if (!type || *type == 'i') return error("HDU is not a FITS table"); long nrows = 0; int ncols = 0; if (fits->getTableDims(nrows, ncols) != 0) return TCL_ERROR; if (filename == NULL) { // return the contents of the table as a tcl list of rows reset_result(); for(int row = 1; row <= nrows; row++) { append_result(" {"); for(int col = 1; col <= ncols; col++) { char* s = fits->getTableValue(row, col); if (!s) return TCL_ERROR; append_element(s); } append_result("}"); } return TCL_OK; } // Otherwise write the contents of the table to a local catalog file ofstream os(filename); if (! os) return sys_error("can't open file: ", filename); // output the catalog header os << "QueryResult\n\n"; // PWD: locate special columns and their conversion factors (to degrees // from radians). int idcol = -1; int racol = -1; double rascale = 1.0; int deccol = -1; double decscale = 1.0; // output the catalog config entry, if there is one if (entry != NULL) { os << "# Config entry\n"; int nkeys = 0; char** keys = NULL; const char *p; const char *t; char buf[20]; if (Tcl_SplitList(interp_, (char*)entry, &nkeys, &keys) != TCL_OK) return TCL_ERROR; for(int i = 0; i < nkeys; i++) { int n = 0; char** v = NULL; if (Tcl_SplitList(interp_, keys[i], &n, &v) != TCL_OK) { Tcl_Free((char *)keys); return TCL_ERROR; } if (n != 2) { Tcl_Free((char *)keys); Tcl_Free((char *)v); return fmt_error("Invalid catalog config entry: '%s': Expected {key value}", keys[i]); } // PWD: record ra_col, dec_col and id_col columns. p = v[0]; while ( p && *p && *p == ' ' ) p++; // Trim leading blanks. if ( strncasecmp( p, "ra_col", 6 ) == 0 ) { sscanf( v[1], "%d", &racol ); // If these are radians we need to convert to degrees. sprintf( buf, "TUNIT%d", racol + 1 ); t = fits->get( buf ); while ( t && *t && *t == ' ' ) t++; // Trim leading blanks. if ( t && strncasecmp( t, "radian", 6 ) == 0 ) { rascale = r2d_; } } else if ( strncasecmp( p, "dec_col", 7 ) == 0 ) { sscanf( v[1], "%d", &deccol ); // If these are radians we need to convert to degrees. sprintf( buf, "TUNIT%d", deccol + 1 ); t = fits->get( buf ); while ( t && *t && *t == ' ' ) t++; // Trim leading blanks. if ( t && strncasecmp( t, "radian", 6 ) == 0 ) { decscale = r2d_; } } else if ( strncasecmp( p, "id_col", 6 ) == 0 ) { sscanf( v[1], "%d", &idcol ); } os << v[0] << ": " << v[1] << endl; Tcl_Free((char *)v); } // No id_col, so we fake an index at the end. if ( idcol == -1 ) { os << "id_col: " << ncols << endl; } Tcl_Free((char *)keys); os << "# End config entry\n\n"; } // PWD: add any comment cards so that context is preserved. const char *c; while ( ( c = fits->getComment( "COMMENT*" ) ) != NULL ) { os << "#C" << c << endl; } // output the column headings, if id_col is undefined then create a fake // column at the end (to keep ra_col & dec_col at current settings, which // are written out, could also be x_col and y_col to keep happy). int col; for(col = 1; col <= ncols; col++) { char* s = fits->getTableHead(col); if (!s) return TCL_ERROR; os << s; if (col < ncols) os << '\t'; } if ( idcol == -1 && entry != NULL ) { os << '\t' << "ID"; } os << "\n---\n"; // heading separator (dashed line) // output the data for(long row = 1; row <= nrows; row++) { for(col = 1; col <= ncols; col++) { char* s; if ( col == ( racol + 1 ) ) { s = fits->getTableValue(row, col, rascale); } else if ( col == ( deccol + 1 ) ) { s = fits->getTableValue(row, col, decscale); } else { s = fits->getTableValue(row, col, 1.0); } if (!s) return TCL_ERROR; os << s; if (col < ncols) os << '\t'; } if ( idcol == -1 && entry != NULL ) { os << '\t' << row; } os << endl; } return TCL_OK; } /* * Implement the HDU create subcommand: * * hdu create $type $extname $headings $tform $data * * see comments for hduCmd() for details. */ int RtdImage::hduCmdCreate(int argc, char** argv, FitsIO* fits) { if (argc != 6) { return error("hdu create: wrong number of args"); } char* type = argv[1]; char* extname = argv[2]; char* headings = argv[3]; char* tform = argv[4]; char* data = argv[5]; // save the current HDU number and restore it later, since creating a // new table sets the HDU to the new table. int hdu = fits->getHDUNum(); int asciiFlag = (strncmp(type, "ascii", 5) == 0); // These arrays hold the Tcl list info for the list arguments. // The memory is allocated and must be deleted before returning. char** colHeadings = NULL; char** formats = NULL; char** dataRows = NULL; char** dataCols = NULL;; int status = TCL_OK; // dummy loop used only for error handling while (1) { // get the headings array and number of columns int numCols = 0; if (Tcl_SplitList(interp_, headings, &numCols, &colHeadings) != TCL_OK) { status = TCL_ERROR; break; } // get the column formats array int numFormats = 0; if (Tcl_SplitList(interp_, tform, &numFormats, &formats) != TCL_OK) { status = TCL_ERROR; break; } if (numFormats != numCols) { status = error("Wrong number of column formats"); break; } // get the table data array and number of rows int numRows = 0; if (Tcl_SplitList(interp_, data, &numRows, &dataRows) != TCL_OK) { status = TCL_ERROR; break; } // Create the FITS table if (fits->createTable(extname, numRows, numCols, (char**)colHeadings, (char**)formats, asciiFlag) != 0) { status = TCL_ERROR; break; } // insert the data (FITS rows and cols start at 1!) for(int row = 1; row <= numRows; row++) { int n; if (Tcl_SplitList(interp_, dataRows[row-1], &n, &dataCols) != TCL_OK) { status = TCL_ERROR; break; } if (n != numCols) { status = fmt_error("Wrong number of columns in row %d", row); break; } for(int col = 1; col <= numCols; col++) { if (fits->setTableValue(row, col, dataCols[col-1]) != 0) { status = TCL_ERROR; break; } } if (status != TCL_OK) break; if (dataCols) { Tcl_Free((char *)dataCols); dataCols = NULL; } } break; // once only } // Clean up and return the status if (colHeadings) Tcl_Free((char *)colHeadings); if (formats) Tcl_Free((char *)formats); if (dataRows) Tcl_Free((char *)dataRows); if (dataCols) Tcl_Free((char *)dataCols); // restore the original HDU fits->setHDU(hdu); return status; } /* * Implement the HDU delete subcommand: * * hdu delete $number * * see comments for hduCmd() for details. */ int RtdImage::hduCmdDelete(int argc, char** argv, FitsIO* fits) { int hdu; if (Tcl_GetInt(interp_, argv[1], &hdu) != TCL_OK) return TCL_ERROR; int n = fits->getNumHDUs(); if (hdu <= 1 || hdu > n) return fmt_error("HDU index %d out of range: must be > 1 and <= %d", hdu, n); if (fits->deleteHDU(hdu) != 0) return TCL_ERROR; return TCL_OK; } /* * Implement the hdu list subcommand: * * hdu list * * see comments for hduCmd() for details. */ int RtdImage::hduCmdList(int argc, char** argv, FitsIO* fits) { // return a list of HDUs int numHDUs = fits->getNumHDUs(); if (numHDUs <= 0) return TCL_OK; // empty return list // save current HDU, then loop through all HDUs to get info int curHDU = fits->getHDUNum(); ostringstream os; int status = 0; int count = 0; for (int i = 1; i <= numHDUs; i++) { if (fits->setHDU(i) != 0) { status++; break; } const char* type = fits->getHDUType(); if (!type) { status++; break; } // get these keyword values and default to "" char extName[80], naxis[32], naxis1[32], naxis2[32], naxis3[32]; char crpix1[32], crpix2[32]; fits->get("EXTNAME", extName, sizeof(extName)); fits->get("NAXIS", naxis, sizeof(naxis)); fits->get("NAXIS1", naxis1, sizeof(naxis1)); fits->get("NAXIS2", naxis2, sizeof(naxis2)); fits->get("NAXIS3", naxis3, sizeof(naxis3)); fits->get("CRPIX1", crpix1, sizeof(crpix1)); fits->get("CRPIX2", crpix2, sizeof(crpix2)); // Try avoiding long fractional strings if (strlen(crpix1) != 0 && strlen(crpix2) != 0) { double dcrpix1, dcrpix2; fits->get("CRPIX1", dcrpix1); fits->get("CRPIX2", dcrpix2); os << "{" << i << " " << type << " {" << extName << "}" << " {" << naxis << "}" << " {" << naxis1 << "}" << " {" << naxis2 << "}" << " {" << naxis3 << "}" << " {" << dcrpix1 << "}" << " {" << dcrpix2 << "}" << "} "; } else { os << "{" << i << " " << type << " {" << extName << "}" << " {" << naxis << "}" << " {" << naxis1 << "}" << " {" << naxis2 << "}" << " {" << naxis3 << "}" << " {" << crpix1 << "}" << " {" << crpix2 << "}" << "} "; } count++; } if (count) { if (status == TCL_OK) { set_result(os.str().c_str()); } fits->setHDU(curHDU); } return status; } /* * Implement the hdu set subcommand: * * hdu set $number * or: hdu $number * * see comments for hduCmd() for details. */ int RtdImage::hduCmdSet(int argc, char** argv, FitsIO* fits) { if (strcmp(argv[0], "set") == 0) { argc--; argv++; } if (argc != 1) return error("wrong number of args: expected HDU number"); int num = 0; if (Tcl_GetInt(interp_, argv[0], &num) != TCL_OK) return TCL_ERROR; // get a copy so we can change the HDU without changing the original fits = fits->copy(); if (fits->setHDU(num) != 0) { delete fits; return TCL_ERROR; } const char* hduType = fits->getHDUType(); if (!hduType) return TCL_ERROR; if (*hduType != 'i') { delete fits; // Otherwise just dropped. Note original // FitsIO now positioned ay new HDU anyway. return TCL_OK; // FITS table, not image: don't display } // save image transformation parameters to restore later ImageDataParams p; image_->saveParams(p); // delete old image delete image_; image_ = NULL; updateViews(); // Re-initialize the image from the given HDU ImageData* im = makeImage(fits); if (! im) return TCL_ERROR; image_ = im; // The WCS info will be different in this HDU fits->wcsinit(); // restore transformations image_->restoreParams(p, !autoSetCutLevels_); // update the display return initNewImage(); } /* * Implement the hdu display subcommand: * * hdu display ?$hduList? * * see comments for hduCmd() for details. */ int RtdImage::hduCmdDisplay(int argc, char** argv, FitsIO* fits) { int hduList[256]; int numHDUs = 0; if (!image_) return error("No image to display"); if (argc == 2) { // parse list of HDU indexes char** hdus = NULL; if (Tcl_SplitList(interp_, argv[0], &numHDUs, &hdus) != TCL_OK) return TCL_ERROR; if (numHDUs > sizeof(hduList)/sizeof(int)) return fmt_error("RtdImage::hduCmdDisplay: too many HDUs: %d (max 256)", numHDUs); if (numHDUs == 0) return error("No image HDUs were specified"); for(int i = 0; i < numHDUs; i++) { if (Tcl_GetInt(interp_, hdus[1], &hduList[i]) != TCL_OK) { Tcl_Free((char *)hdus); return TCL_ERROR; } } Tcl_Free((char *)hdus); } else { // use all image extensions, except the primary HDU (1) // Note that the primary HDU is 1. int n = fits->getNumHDUs(); int saved_hdu = fits->getHDUNum(); for(int i = 2; i <= n; i++) { if (fits->setHDU(i) != 0) { fits->setHDU(saved_hdu); return TCL_ERROR; // error } const char* type = fits->getHDUType(); if (type != NULL && *type == 'i') hduList[numHDUs++] = i; } fits->setHDU(saved_hdu); if (numHDUs == 0) return error("No image HDUs found"); } // get a (reference counted) copy of the image ImageIO imio = image_->image(); // used to save and restore image transformation parameters ImageDataParams p; image_->saveParams(p); // delete old image delete image_; image_ = NULL; updateViews(); // Create an image composed of all of the requested image extensions image_ = ImageData::makeCompoundImage(name(), imio, hduList, numHDUs, biasimage_->biasInfo(), verbose()); if (! image_) return TCL_ERROR; // restore transformations image_->restoreParams(p, !autoSetCutLevels_); return initNewImage(); } skycat-3.1.2-starlink-1b/rtd/generic/RtdHDU.icc000066400000000000000000000025471215713201500211240ustar00rootroot00000000000000// -*-c++-*- #ifndef _RtdHDU_h_ #define _RtdHDU_h_ /* * E.S.O. - VLT project * "@(#) $Id: RtdHDU.icc,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdHDU.h - definitions methods for the Rtdimage subcommand hduCmd() * * who when what * -------------- -------- ---------------------------------------- * A. Brighton 05/10/95 Created in RtdImage.h * pbiereic 01/03/01 copied from RtdImage.h */ protected: // these are part of the implementation of the hdu subcommand (see hduCmd()) int hduCmdHeadings (int argc, char** argv, FitsIO* fits); int hduCmdGet (int argc, char** argv, FitsIO* fits); int hduCmdCreate (int argc, char** argv, FitsIO* fits); int hduCmdDelete (int argc, char** argv, FitsIO* fits); int hduCmdList (int argc, char** argv, FitsIO* fits); int hduCmdSet (int argc, char** argv, FitsIO* fits); int hduCmdType (int argc, char** argv, FitsIO* fits); int hduCmdDisplay (int argc, char** argv, FitsIO* fits); int hduCmdFits (int argc, char** argv, FitsIO* fits); // Write the contents of the current HDU (FITS table) to a catalog file // or return it as a Tcl list, if filename is NULL. int getHDU(FitsIO* fits, const char* filename, const char* entry); // Return the column headings for the current FITS table int getHDUHeadings(FitsIO* fits); #endif /* _RtdHDU_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/RtdImage.C000066400000000000000000001775601215713201500211620ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: RtdImage.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdImage.C - member routines for class RtdImage, * implementation of the TCL rtdimage command * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * * T.Herlin 06/12/95 Setting object name RtdImage::displayImageEvent * * D.Hopkinson 02/12/96 Added timestamp information for performance tool * * P.Biereichel 30/06/97 processMotionEvent()'s call to getValues() changed * Added RtdImage::remoteTclCmd * * Allan Brighton 10/03/98 Minor changes based on changes made by * Peter W. Draper * for GAIA, which defines a subclass of * RtdImage, so that we can use some of the * GAIA features in our own derived classes. * * Added 2 optional arguments to RtdImage * constructor to allow derived classes to * specify thier own list of configuration * options. * * Changed "blank image" size from 10x10 to 2x2 * image, since people really seem to use 10x10 * pixel images. (The size is sometimes used to * determine if the image is "blank"). * * Changed ImageData::read invocation to use * FitsIO::read instead. This decouples the * need for ImageData (and ImageIO) to know * about what type of data they are dealing * with (and hence we can create a derived * class that can deal with other forms of * data, like NDFs). * * Allan Brighton 13/03/98 Define RTD_OPTIONS as a macro, so that derived * classes can add new options more easily. * * 30/03/98 Fixed the -shm_data and -shm_header options to * work again (they were lost in previous changes at * some point). * * Peter W. Draper 13/01/99 Changed to use non 8 bit visuals. * P.Biereichel 22/03/99 Added biasimage subcommand * Allan Brighton 16/05/99 Fixed isClear() method (removed check for empty header) * P.Biereichel 23/08/99 Added HDU methods (copied from skycat) * Pass on the rapid frame event to the first rapid frame when * the frameId in the rtdIMAGE_INFO structure doesn't exists. * Changed RtdImage::Rtd_Init() * 14/09/99 call to initColors() moved from Rtd_Init() to the RtdImage constructor: * colors are only initialized when needed * Allan Brighton 27/09/99 Reversed change, should fix panel editor to only do the package require * if rtd will be used. The colormap has to be initialized before any * widgets are created (each widget inherits the colormap from the * parent widget). * pbiereic 11/10/99 Until the panel editor has been fixed (Feb 2000) we use a compile flag * PANEL_EDITOR_BUG * Added wcsFlags and wcsdeltset command. * pbiereic 13/11/99 More accurate X, Y coords from RtdImage::statisticsCmd() * pbiereic 28/04/00 RtdImage::loadFile() opens the file with reading only * Peter W. Draper 10/05/00 Always update colormap, some private maps * are used when screen visual differs to * requested one and would not otherwise be * installed. * pbiereic 26/05/00 Added options fillWidth / fillHeight * Peter W. Draper 30/05/01 Added "double" as a valid data type. * pbiereic 01/03/01 o Added option 'debug' * o Added static class for performance tests (removed old code) * o Added method updateRequests() which updates X events * before calling updateIdleTasks(); only for image events. * o Since RtdImage.C was becoming too big all member fuctions * dealing with commands were copied to RtdCmds.C * o Removed XSyncSetPriority() since this blocked all * other X applications * pbiereic 28/05/01 Included Allan's changes for tcl8.3.3 * Removed LockMask in motionNotify() (SPR VLTSW20010313) * Allan Brighton 30/07/01 Fixed problem with X shared memory, ssh and X11 forwarding: * (X shm areas are not freed, so don't use them in this case) * pbiereic 17/02/03 Byte order for shm data is determined by the application * (flag shmEndian in the image event info structure). * Peter W. Draper 28/04/03 Added PIXTAB_MINX, MAXX, MINY and MAXY to report * the positions that the minimum and maximum values * are found in a table of values. * Peter W. Draper 21/10/03 Modified processMotionEvent to pass through * long thin images of 2 pixels or less in * either height or width. A blank image is * 2x2, not nx2 or 2xn. * 19/12/05 Undo change that removed LockMask in motionNotify. * I think that's a handy feature. * 08/01/07 Change isclear to check for RTD_BLANK as the * OBJECT value, don't use the size at all. * Change processMotionEvent to work for images * of all sizes (including blank ones). One * pixel images are possible in cube sections. * * Allan Brighton 16/12/05 Added local Tk_CanvasWindowCoordsNoClip method (moved from tclutil) * Allan Brighton 28/12/05 Replaced init script * Peter W. Draper 16/10/08 Record if user set the levels in setCutLevels * even if they are not changed. That's makes more * sense to the user. * 05/08/09 Add optionModified member to test if a * configuration option is given. This functionality * is lost in Tk 8.5. */ static const char* const rcsId="@(#) $Id: RtdImage.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "RtdImage.h" // Tcl procedure to search for an init for Rtd startup file. static char initScript[] = "if {[info proc ::rtd::Init]==\"\"} {\n\ namespace eval ::rtd {}\n\ proc ::rtd::Init {} {\n" #ifdef MAC_TCL " source -rsrc RtdInit.tcl\n" #else " global rtd_library\n\ tcl_findLibrary rtd " PACKAGE_VERSION " " PACKAGE_VERSION " RtdInit.tcl RTD_LIBRARY rtd_library\n" #endif " }\n\ }\n\ ::rtd::Init"; // should be in X11/extensions/XShm.h extern "C" int XShmQueryExtension(Display*); // should be in X11/extensions/sync.h extern "C" int XSyncInitialize(Display *, int *, int *); // extern "C" int XSyncSetPriority(Display *, XID, int); #if 0 #ifdef NEED_GETHOSTNAME_PROTO // should be in unistd.h ? extern "C" int gethostname(char *name, unsigned int namelen); #endif /* NEED_GETHOSTNAME_PROTO */ #endif // local extension to enable postscript printing for images extern "C" void TkCanvasPsImage_Init(); // generated code for bitmaps used in tcl scripts void defineRtdBitmaps(Tcl_Interp*); // generated code for colormap files used void defineColormaps(); // initialize these dependent packages here for backward compat extern "C" int Tclutil_Init(Tcl_Interp *interp); extern "C" int Astrotcl_Init(Tcl_Interp *interp); // these are static members shared by all instances of the image // and used for managing the color map and bias image, etc. ImageColor* RtdImage::colors_ = (ImageColor*) NULL; BiasData* RtdImage::biasimage_ = (BiasData*) NULL; RtdPerf* RtdImage::rtdperf_ = (RtdPerf*) NULL; // pointer to last RtdImage instance to handle motion events // (used to update display on real-time image events) static RtdImage* motionView_ = NULL; // Rtd Record extern "C" int RtdrecordInit(Tcl_Interp *); /* * image config options - used to process command line options and for the * image "configure" subcommand. */ static Tk_ConfigSpec configSpecs_[] = { RTD_OPTIONS, // See RtdImage.h: defines rtd option list {TK_CONFIG_END, NULL, NULL, NULL, NULL, 0, 0} }; /* * Initialize the image control structure with pointers to the handler * functions */ static Tk_ImageType rtdImageType = { (char *)"rtdimage", /* name */ RtdImage::CreateImage, /* createProc */ TkImage::GetImage, /* getProc */ TkImage::DisplayImage, /* displayProc */ TkImage::FreeImage, /* freeProc */ TkImage::DeleteImage, /* deleteProc */ (Tk_ImagePostscriptProc *) NULL, /* postscriptProc, use generic */ (Tk_ImageType *) NULL /* nextPtr */ }; /* * eval the pre- and post- camera commands and display the image event. * "info" contains all we need to know about the image and "data" * gives access to the shared memory for the image. */ int RtdImageCamera::display(const rtdIMAGE_INFO& info, const Mem& data) { int status = TCL_OK; char buf[2048]; RtdPerf *rtdperf = rtdimage_->rtdperf(); rtdimage_->imageEvent(1); // set image event state rtdperf->newCycle(); // start performance test if applicable if (rtdimage_->cameraPreCmd()) { sprintf(buf, "%s %d", rtdimage_->cameraPreCmd(), info.frameId); status |= Tcl_Eval(interp_, buf); rtdperf->TCLtime(); } rtdperf->GENtime(); status |= rtdimage_->displayImageEvent(info, data); rtdperf->GENtime(); if (rtdimage_->cameraPostCmd()) { sprintf(buf, "%s %d", rtdimage_->cameraPostCmd(), info.frameId); status |= Tcl_Eval(interp_, buf); rtdperf->TCLtime(); } rtdperf->endCycle(); // set the performance test variables rtdimage_->imageEvent(0); // unset image event state return status; } /* * C++ "new handler" - called for out of memory errors by operator new * - just report it */ static void rtd_new_handler() { error("Warning: Real-Time DIsplay is out of memory"); } /* * Delete event handler - called to clean up shared memory when main window * is deleted */ static void destroy_notify(ClientData, XEvent*) { // XXX this method seems to be called at the wrong times // XXX (such as when the mouse enters the window!) // Mem::cleanup(); } /* * Tcl command: rtd_load_cmap * For internal use, to pre-load colormaps before startup */ static int rtd_load_cmap(ClientData, Tcl_Interp* interp, int argc, char** argv) { if (argc != 2) return error("usage: rtd_load_cmap cmapfile"); return (ColorMapInfo::get(argv[1]) ? TCL_OK : TCL_ERROR); } /* * Tcl command: rtd_load_itt * For internal use, to pre-load itts before startup */ static int rtd_load_itt(ClientData, Tcl_Interp* interp, int argc, char** argv) { if (argc != 2) return error("usage: rtd_load_itt ittfile"); return (ITTInfo::get(argv[1]) ? TCL_OK : TCL_ERROR); } /* * This static method implements the "rtd_set_cmap" Tcl command. * * usage: rtd_set_cmap $toplevel * * This command can be used to make a top level window use the same colormap * as the rtd images, so that there is less color flashing in popup windows * when we are using a private colormap. */ int RtdImage::rtd_set_cmap(ClientData, Tcl_Interp* interp, int argc, char** argv) { if (argc != 2) return ::error("usage: rtd_set_cmap $toplevel"); Tk_Window w = Tk_NameToWindow(interp, argv[1], Tk_MainWindow(interp)); if (w == NULL) return TCL_ERROR; if (!colors_) return ::error("rtd_set_cmap: colormap is not initialized yet"); return colors_->setColormap(w); // colors_ is a static member } /* * Install two utility Tcl commands for colormaps/itts * * These commands are for internal use (for pre-loading colormap and itt * files for use with unexec to make a single binary with all the stuff * already loaded in memory) */ extern "C" int CmapITT_Init(Tcl_Interp* interp) { Tcl_CreateCommand(interp, "rtd_load_cmap", (Tcl_CmdProc*)rtd_load_cmap, NULL, NULL); Tcl_CreateCommand(interp, "rtd_load_itt", (Tcl_CmdProc*)rtd_load_itt, NULL, NULL); return TCL_OK; } /* * A call to this function is made from the tkAppInit file at startup * to install the RtdImage image type and do global initialization */ extern "C" int Rtd_Init(Tcl_Interp* interp) { // Initialize the local packages that rtd depends on // PWD: enable postscript printing for images (local ext) TkCanvasPsImage_Init(); // initialize the tclutil package if (Tclutil_Init(interp) == TCL_ERROR) { return TCL_ERROR; } // initialize the astrotcl package if (Astrotcl_Init(interp) == TCL_ERROR) { return TCL_ERROR; } char buf[1024]; #ifndef PANEL_EDITOR_BUG // initialize color management (once only per application) if (RtdImage::initColors(interp) != TCL_OK) return TCL_ERROR; #endif // initialize bias image object if (RtdImage::initBias() != TCL_OK) return TCL_ERROR; // initialize the peformance test object if (RtdImage::initPerf(interp) != TCL_OK) return TCL_ERROR; // set up Rtd Tcl package if (Tcl_PkgProvide (interp, "Rtd", PACKAGE_VERSION) != TCL_OK) { return TCL_ERROR; } // define bitmaps used by Tcl library defineRtdBitmaps(interp); // define colormaps used defineColormaps(); // add the rtdimage image type Tk_CreateImageType(&rtdImageType); // add a tcl command to set the colormap on application windows so that // there is no flashing when there is a private colormap Tcl_CreateCommand(interp, "rtd_set_cmap", (Tcl_CmdProc*)RtdImage::rtd_set_cmap, NULL, NULL); // clean up shared memory on exit signal(SIGINT, RtdImage_cleanup); signal(SIGTERM, RtdImage_cleanup); // ignore floating point exceptions //sigignore(SIGFPE); signal(SIGFPE, SIG_IGN); // 11.9.97: allan, need this for linux Tk_CreateEventHandler(Tk_MainWindow(interp), DestroyNotify, destroy_notify, NULL); // initialize the rtdrecorder and rtdplayback image types RtdrecordInit(interp); Tcl_SetVar(interp, "rtd_version", PACKAGE_VERSION, TCL_GLOBAL_ONLY); return Tcl_Eval(interp, initScript); } /* * This static method is called by the Tk image code to create * a new rtdimage image. * * Note: There was an incompatible change made in tk8.3: argv was * replaced with objv. Therefore the #ifdefs. */ int RtdImage::CreateImage( Tcl_Interp *interp, // Interpreter for application containing image. char *name, // Name to use for image. int argc, // Number of arguments. #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 Tcl_Obj *CONST objv[], // Argument objects for options (not including image name or type) #else char **argv, // Argument strings for options (not including image name or type) #endif Tk_ImageType *typePtr, // Pointer to our type record (not used). Tk_ImageMaster master, // Token for image, to be used by us in later callbacks. ClientData *clientDataPtr) // Store manager's token (this ptr) for image here // it will be returned in later callbacks. { #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 // just generate an argv from the objv argument char* argv[64]; // there shouldn't be more than a few options... for(int i = 0; i < argc; i++) argv[i] = Tcl_GetString(objv[i]); argv[argc] = NULL; #endif RtdImage* im = new RtdImage(interp, name, argc, argv, master, rtdImageType.name, configSpecs_, new RtdImageOptions); if (im && im->status() == TCL_OK) { *clientDataPtr = (ClientData) im; return im->initImage(argc, argv); } return TCL_ERROR; } /* * for backward compat. */ extern "C" int RtdImage_Init(Tcl_Interp* interp) { return Rtd_Init(interp); } /* * Constructor: initialize a new rtdimage with the command line args. * * This constructor is called for each rtd image declared in tk. The destructor * is called when the image image is destroyed. * * Args: * interp - Tk interpreter * instname - instance name of image object * arc, argv - command line args * master - Tk struct with image info * imageType - name of image type ("rtdimage") * specs, options - optional args to be used by derived class. * * The last 2 arguments are optional. They are designed to be used by a derived * class to add new image options. If "specs" is specified, then the * initImage() method must also be called by the caller to process the options, * otherwise initImage() is called here (for backward compatibility). */ RtdImage::RtdImage(Tcl_Interp* interp, const char* instname, int argc, char** argv, Tk_ImageMaster master, const char* imageType, Tk_ConfigSpec* specs, RtdImageOptions* options) : TkImage(interp, imageType, instname, (specs ? specs : configSpecs_), options, master, (char *)"Canvas"), image_((ImageData*)NULL), options_(options), camera_(NULL), cameraPreCmd_(NULL), cameraPostCmd_(NULL), imageEvent_(0), remote_(NULL), frameId_(0), frameX_(0.0), frameY_(0.0), xOffset_(0.0), yOffset_(0.0), rapidX_(0.0), rapidY_(0.0), reqWidth_(0.0), reqHeight_(0.0), propagateScale_(1), autoSetCutLevels_(1), rapidFrame_(0), canvasX_(0), canvasY_(0), prevX_(0), prevY_(0), zoomer_(NULL), motionX_(0), motionY_(0), saveMotion_(1), motionPending_(0), motionState_(0), zoomView_(NULL), zoomView2_(NULL), zoomFactor_(1), zoomSpeed_(1), panFactor_(0), panCommand_(NULL), panx1_(0), pany1_(0), panx2_(0), pany2_(0), displayLocked_(0), canvas_(NULL), canvasName_(NULL), haveXShm_(0), usingXShm_(0), haveXSync_(0), usingXSync_(0), xImage_(NULL), viewMaster_(NULL), currentView_(this), pixTab_(NULL), dbl_(NULL) { if (! options_) { options_ = new RtdImageOptions; } // since gcc 3.2 is complaining about non-POD we use a structure // which holds the options. setOptionsPtr(options_->get_rtd_options()); // errors may have occured in the base class ... if (status() != TCL_OK) return; filename_[0] = '\0'; // debug log object dbl_ = new RtdDebugLog((char *)instname, (int)(debug() & verbose())); // if we are on the console, check for XSHM, X shared memory extension char hostname[64]; gethostname(hostname, sizeof(hostname)); int n = strlen(hostname); char* display = DisplayString(display_); // allan: 7/01: check for screen number "0", since when using X11 forwarding with ssh, // the display is set to something like "host:10:0" - a proxy server, and the X shared // memory is never freed. if (display[0] == ':' || (strncmp(hostname, display, n) == 0 && display[n] == ':' && display[n+1] == '0')) { haveXShm_ = XShmQueryExtension(display_); } #ifdef DEBUG if (verbose()) { int num; char **exts; exts = XListExtensions(display_, &num); fprintf(stderr, "Extension list:-\n"); for (int k = 0; k < num; k++) { fprintf(stderr, "Extension %d is %s\n", k, exts[k]); } XFreeExtensionList(exts); } #endif #if _HAVE_R6 // Check if we have the Sync extension. int ev_br, er_br; // event_base_return, error_base_return. int mjr_opcode; // major opcode. int mj_vr, mn_vr; // Major/minor version number. haveXSync_ = XQueryExtension(display_, "SYNC", &mjr_opcode, &ev_br, &er_br); // Initialise if we haven't and it isn't already. if (haveXSync_) { if (!usingXSync_) { if (XSyncInitialize(display_, &mj_vr, &mn_vr)) { usingXSync_ = 1; } } } #endif // _HAVE_R6 if (haveXShm_) dbl_->log("X Shared memory is supported\n"); else dbl_->log("X Shared memory is not supported\n"); if (haveXSync_) dbl_->log("X Synchronisation is supported\n"); else dbl_->log("X Synchronisation is not supported\n"); // initialize list of views for(int i = 0; i < MAX_VIEWS; i++) view_[i] = NULL; #ifdef PANEL_EDITOR_BUG // initialize color management (once only per application) if (RtdImage::initColors(interp) != TCL_OK) { status_ = TCL_ERROR; return; } #endif // Do first time image configuration. Note: it is better to call this // method from outside the constructor, so that virtual methods can be // overridden. This is kept here for backward compatibility, if "options" // is NULL (default). if (! specs) initImage(argc, argv); } /* * destructor - clean up image when image cmd is destroyed */ RtdImage::~RtdImage() { if (dbl_) { dbl_->log("~RtdImage(): deleting %s (%s)\n", instname(), name()); delete dbl_; dbl_ = NULL; } // there might be more than one image in a canvas window // Tk_DeleteEventHandler(tkwin_, ButtonMotionMask|StructureNotifyMask, // eventProc, (ClientData)this); // if this is a view, remove it from the master's list if (viewMaster_) { if (viewMaster_->currentView_ == this) viewMaster_->currentView_ = viewMaster_; viewMaster_->removeView(this); viewMaster_ = NULL; zoomer_ = NULL; } // reset this static pointer if it points to this instance if (motionView_ == this) motionView_ = NULL; if (image_) { delete image_; image_ = NULL; } deleteXImage(); if (zoomer_) { Tk_CancelIdleCall(motionProc, (ClientData)this); delete zoomer_; zoomer_ = NULL; } if (panCommand_) { free(panCommand_); panCommand_ = NULL; } if (camera_) { delete camera_; camera_ = NULL; } if (cameraPreCmd_) { free(cameraPreCmd_); cameraPreCmd_ = NULL; } if (cameraPostCmd_) { free(cameraPostCmd_); cameraPostCmd_ = NULL; } if (remote_) { delete remote_; remote_ = NULL; } if (pixTab_) { delete[] pixTab_; pixTab_ = NULL; } // remove any views of this image removeViews(); } /* * initialize the color visual and colormap */ int RtdImage::initColors(Tcl_Interp* interp) { // we should only do this once if (colors_) return TCL_OK; int depth = 8; // default, will be set by Tk_GetVisual below Colormap colormap; // make sure the window exists now before setting the colormap Tk_Window tkwin = Tk_MainWindow(interp); // XXX these should be options: min and max number of colors to allocate. // If this many are not available, use private colormap. int min_colors = 30, max_colors = 60; // Use the default visual for now... // Visual* visual = Tk_GetVisual(interp, tkwin, "default", &depth, &colormap); // PWD: use "." here as "default" returns screen visual, not the // "-visual" command-line option. Making this function static has // some drawbacks (the tkwin was previously the parent of the image?). Visual* visual = Tk_GetVisual(interp, tkwin, ".", &depth, &colormap); if (! visual) return TCL_ERROR; Tk_MakeWindowExist(tkwin); colors_ = new ImageColor(Tk_Display(tkwin), visual, depth, max_colors); if (colors_->status() != 0) { return TCL_ERROR; } if (colors_->colorCount() < min_colors) { if (colors_->usePrivateCmap() || colors_->allocate(max_colors)) { return TCL_ERROR; } } // PWD: always set the colormap. This can be "private" when the // default visual doesn't match the one requested, in which case // we still need to set the colormap (I noticed this using a // default truecolor visual when attempting to get a pseudocolor // visual). return colors_->setColormap(tkwin); } /* * set X and Y to values between 0 and $xyscale, where $xyscale * is the scale factor. The values indicate the fraction of the * pixel at the point px,py based on the current scale factor. * i.e.: if the scale factor is 10, x,y = 5,5 means px,py is at * the center of the zoomed pixel. */ void RtdImage::getOffsetInXImage(double px, double py, int& x, int& y) { int xyscale = image_->xScale(); if (xyscale > 1) { x = int((px-int(px))*xyscale); y = int((py-int(py))*xyscale); // printf("%s: getOffsetInXImage: (%.17g,%.17g) ==> (%d,%d) ", instname(), px, py, x, y); if (px < 0) x += xyscale; if (py < 0) y += xyscale; if (image_->rotate()) swap(x, y); // printf("==> (%d,%d)\n", x, y); } } /* * This method is called from the RtdImageCamera class to display the * image from shared memory. "info" contains all we need to know about * the image and "data" gives access to the shared memory for the image. */ int RtdImage::displayImageEvent(const rtdIMAGE_INFO& info, const Mem& data) { // if this event is for us, display it if (info.frameId == frameId_) { int status = TCL_ERROR; // update the x and y offsets // (these are normally 0, when the rapid frame has its own shared memory area) xOffset_ = info.frameX; yOffset_ = info.frameY; // use native byte ordering for data in shared memory, unless // the camera process wants RTD to do the byte swap (eg. RTD // running on a little Endian machine and data are produced // on a big Endian machine). int usingNetBO = ((BIGENDIAN && info.shmEndian == -1) || (info.shmEndian == 0)); // if the image changed, delete it and create a new one, otherwise reuse if (image_ == NULL || image_->data().shared() == 0 || info.xPixels != image_->width() || info.yPixels != image_->height() || usingNetBO != image_->image().usingNetBO() || info.dataType != image_->dataType()) { if (dbl_) dbl_->log("%s: new image received: %d x %d\n", name(), info.xPixels, info.yPixels); // save previous image parameters so we can restore the settings later ImageDataParams p; if (image_) { image_->saveParams(p); delete image_; image_ = NULL; updateViews(); } // make a FitsIO object to represent the new image data and use it to // make a new ImageData object, which manages the image and transformations. Mem header; // empty header (use wcs command to set wcs keywords) FitsIO* fits = new FitsIO(info.xPixels, info.yPixels, info.dataType, 0.0, 1.0, header, data); if (!fits || fits->status() != 0) return TCL_ERROR; fits->usingNetBO(usingNetBO); image_ = makeImage(fits); if (!image_) return TCL_ERROR; // set object name to camera name if (camera_) image_->object(camera_->camera()); // restore transformations, cut levels, etc from the previous image image_->restoreParams(p, !autoSetCutLevels_); // if the image event contains valid cut levels, use them if (autoSetCutLevels_ && info.lowCut != info.highCut) image_->setCutLevels(info.lowCut, info.highCut, 1); // initialize the new image status = initNewImage(); } else { // reuse the current image and just update the image data if (dbl_) dbl_->log("%s: new image data received: %d x %d (size: %d bytes)\n", name(), info.xPixels, info.yPixels, data.length()); // if the image event contains valid cut levels, use them if (info.lowCut != info.highCut) setCutLevels(info.lowCut, info.highCut, 1, 0); // update the image with the new data status = updateImageNewData(data); } // now we have the new image... // set detector parameters setDetParms(image_, info); for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i] && view_[i]->image_ && !view_[i]->isSeparateRapidFrame()) setDetParms(view_[i]->image_, info); } filename(image_->object()); // set WCS info, if available int binningOk = 1; if (info.binningX > 0 || info.binningY > 0) { if (info.binningX != info.binningY) binningOk = 0; } if (info.secpix != 0. && binningOk == 1) { double xrefpix=info.xrefpix, yrefpix=info.yrefpix; double asecpix=info.secpix; if (info.binningX > 1) asecpix = asecpix / info.binningX; image_->chipToImageCoords(xrefpix, yrefpix); if (image_->wcs().set(info.ra, info.dec, asecpix, xrefpix, yrefpix, info.xPixels, info.yPixels, info.rotate, info.equinox, info.epoch, info.proj) != 0) return TCL_ERROR; if (info.wcsFlags & (RTD_WCS_FLIP_RA | RTD_WCS_FLIP_DEC)) { double cdelt1 = - info.secpix / 3600.0; double cdelt2 = info.secpix / 3600.0; if (info.wcsFlags & RTD_WCS_FLIP_RA) cdelt1 = -cdelt1; if (info.wcsFlags & RTD_WCS_FLIP_DEC) cdelt2 = -cdelt2; image_->wcs().deltset(cdelt1, cdelt2, info.rotate); } } // update zoom window and panel labels, etc, if necessary if (motionView_) motionView_->processMotionEvent(); // pause here until image is displayed updateRequests(); // notify the panning window after WCS was set if (panCommand_) autoPan(1); return status; } else { // must be a rapid frame event. Pass it on... int i = info.frameId-1; if (i >= 0 && i < MAX_VIEWS && view_[i] && view_[i]->rapidFrame_) { return view_[i]->displayImageEvent(info, data); } // frameId is wrong: pass the event on to the first rapid frame for (i = 1; i < MAX_VIEWS; i++) { if (view_[i] && view_[i]->rapidFrame_) { rtdIMAGE_INFO infoRapid; memcpy(&infoRapid, &info, sizeof(rtdIMAGE_INFO)); infoRapid.frameId = i+1; return view_[i]->displayImageEvent(infoRapid, data); } } } return TCL_OK; } /* * Set detector paramters */ void RtdImage::setDetParms(ImageData* image, const rtdIMAGE_INFO& info) { image->startX(info.startX); image->startY(info.startY); if (info.binningX > 0) image->binX(info.binningX); if (info.binningY > 0) image->binY(info.binningY); } /* * call updateIdleTasks() if no image event from camera was received. * Otherwise update window and idle events to a) avoid too many * pending X requests and b) set the times for the performance test * */ void RtdImage::updateRequests() { if (! imageEvent_ ) { updateIdleTasks(); // backwards compatible for loaded images return; } if (! dbl_ || ! rtdperf_ || ! xImage_) return; rtdperf_->GENtime(); // update the time stamp xImage_->flushX(); rtdperf_->Xtime(); updateIdleTasks(); } // Fix for Tk clipping coordinates to short range: See CanvasWindowCoordsNoClip() below. #ifdef HAVE_TKCANVAS_H #define MODULE_SCOPE extern #include "tkCanvas.h" #else // The structure we need hasn't changed for a long time, so just include a local copy. #define MODULE_SCOPE extern "C" #include "tkCanvas.h-tk8.4.11" #define HAVE_TKCANVAS_H #endif /* * Hack to work around the tk canvas clipping coordinates to short range: * same as Tk_CanvasWindowCoords, but with no clipping. * Without this fix, there will be problems with very large, or zoomed in images. */ static void Tk_CanvasWindowCoordsNoClip(Tk_Canvas canvas, double x, double y, int* screenXPtr, int* screenYPtr) { #ifdef HAVE_TKCANVAS_H TkCanvas *canvasPtr = (TkCanvas *) canvas; double tmp; tmp = x - canvasPtr->xOrigin; if (tmp > 0) { tmp += 0.5; } else { tmp -= 0.5; } *screenXPtr = (int)tmp; tmp = y - canvasPtr->yOrigin; if (tmp > 0) { tmp += 0.5; } else { tmp -= 0.5; } *screenYPtr = (int)tmp; #else short sx, sy; Tk_CanvasWindowCoords(canvas, x, y, &sx, &sy); if (sx == 32767 || sx == -32768 || sy == 32767 || sy == -32768) { fprintf(stderr, "Warrning: Tk clipped the RTD image coordinates to short range!\n"); } *screenXPtr = sx; *screenYPtr = sy; #endif } /* * This virtual method is invoked indirectly by the Tk image handling * routines to draw the image. * * If displaymode is 0, try to optimize smooth scrolling by copying the * entire image to the X server. If using X shared memory, we can do this * each time otherwise we use an offscreen pixmap and copy the image * there only when needed. * * if displaymode is 1, optimize memory usage by only allocating space for * the visible image. */ void RtdImage::displayImage(Drawable d, int imageX, int imageY, int width, int height, int drawableX, int drawableY) { char buffer[32]; rtdperf_->TCLtime(); if (displayLocked_ || ! initialized_ || ! xImage_ || ! xImage_->data() || ! image_) return; displayLocked_ = 1; // get the canvas X,Y offsets // Note: the Tk routine Tk_CanvasWindowCoords clips the coordinates to "short" range // (-32768 .. 32767), which can cause problems in very large images // and/or at large magnification. The call below is to a replacement defined here. Tk_CanvasWindowCoordsNoClip(canvas_, 0., 0., &canvasX_, &canvasY_); if (displaymode() == 0) { // do entire image, as needed if (xImage_->usingXShm()) { // with X shared memory, should be fast enough to write directly to X server if (update_pending_) image_->update(); xImage_->put(d, imageX, imageY, drawableX, drawableY, width, height); } else { // not using X shared mem, use an offscreen pixmap if (update_pending_) { image_->update(); xImage_->put(pm_, 0, 0, 0, 0, dispWidth(), dispHeight()); } // do a quick copy within the X server if (pm_) XCopyArea(display_, pm_, d, gc_, imageX, imageY, width, height, drawableX, drawableY); } } else { // optimize for fast updates, do only visible area of image double fx = frameX_, fy = frameY_, dx = xOffset_, dy = yOffset_; if (fx || fy) doTrans(fx, fy, 1); // get canvas distance for frameX,Y if (dx || dy) doTrans(dx, dy, 1); // get offset for origin in raw image int x = max(-canvasX_ - int(fx), 0), y = max(-canvasY_ - int(fy), 0); int update = (update_pending_ || x != prevX_ || y != prevY_); prevX_ = x; prevY_ = y; dx += x, dy += y; undoTrans(dx, dy, 1); // get image coord x,y offsets in image coords // if image is zoomed, adjust for correct fraction of pixel at origin int px = 0, py = 0; getOffsetInXImage(dx, dy, px, py); if (xImage_->usingXShm()) { // with X shared memory, should be fast enough to write directly to X server if (update) image_->updateOffset(dx, dy); xImage_->put(d, imageX-x+px, imageY-y+py, drawableX, drawableY, width, height); } else { // not using X shared mem, use an offscreen pixmap if (update) { image_->updateOffset(dx, dy); xImage_->put(pm_, 0, 0, 0, 0, pixw_, pixh_); } // do a quick copy within the X server if (pm_) XCopyArea(display_, pm_, d, gc_, imageX-x+px, imageY-y+py, width, height, drawableX, drawableY); } } // notify the panning window, if necessary if (panCommand_) autoPan(); // reset flags update_pending_ = displayLocked_ = 0; rtdperf_->Xtime(); } /* * This procedure is called to process an argv/argc list, plus * the Tk option database, in order to configure (or reconfigure) * a image. * * redefined here to check which changes were made. */ int RtdImage::configureImage(int argc, char* argv[], int flags) { if (TkImage::configureImage(argc, argv, flags) != TCL_OK) return TCL_ERROR; int status = TCL_OK; int reset = 0; // note if we are using X shared memory usingXShm_ = haveXShm_ && usexshm(); // find out which options were specified and process them // if necessary (note: Tk sets a flag in the config entry when // the option is specified. We use the OFFSET macro defined above // as an efficient way to compare options) for (Tk_ConfigSpec* p=configSpecs_; p->type != TK_CONFIG_END; p++) { if ( optionModified(argc, argv, p->argvName) ) { switch(p->offset) { case RTD_OPTION(usexshm): if (initialized_) { deleteXImage(); reset++; } break; #if _HAVE_R6 case RTD_OPTION(usexsync): if (usingXSync_ && usexsync()) { /* * XSyncSetPriority() was commented out since it can block all * other X-applications when fast image events are received- */ // XSyncSetPriority(display_, None, 65535); // fprintf(stderr, "Raising priority of client %s\n", name()); } break; #endif // _HAVE_R6 case RTD_OPTION(displaymode): case RTD_OPTION(shm_header): case RTD_OPTION(shm_data): if (initialized_) reset++; break; case RTD_OPTION(verbose): case RTD_OPTION(debug): if (dbl_) dbl_->setlog ((int)(debug() & verbose())); break; case RTD_OPTION(fitWidth): case RTD_OPTION(fitHeight): if (initialized_) { if (image_ && fitWidth() && fitHeight()) { image_->shrinkToFit(fitWidth(), fitHeight()); } reset++; } break; case RTD_OPTION(fillWidth): case RTD_OPTION(fillHeight): if (initialized_) { if (image_ && fillWidth() && fillHeight()) { image_->fillToFit(fillWidth(), fillHeight()); } reset++; } break; case RTD_OPTION(file): status = loadFile(); break; case RTD_OPTION(sampmethod): if (initialized_ && image_) { if (image_->sampmethod() != sampmethod()) { image_->sampmethod(sampmethod()); reset++; } } break; case RTD_OPTION(subsample): if (initialized_ && image_) { if (image_->subsample() != subsample()) { image_->subsample(subsample()); reset++; } } break; } } } if (reset) return resetImage(); return status; } /* * test: if an option has been modified during the configureImage * because it is present in the given argv list. */ int RtdImage::optionModified( int argc, char *argv[], const char* option ) { for ( int i = 0; i < argc; i +=2 ) { if ( strcmp( argv[i], option ) == 0 ) { return 1; } } return 0; } /* * util: return true if this is an embedded rapid frame * (i.e.: a rapid frame in the same canvas with the master image) */ int RtdImage::isEmbeddedRapidFrame() { return (rapidFrame_ && viewMaster_ && viewMaster_->tkwin_ == tkwin_); } /* * util: return true if this is a rapid frame that is not embedded * (i.e.: a rapid frame that is not in the same canvas with the master image) */ int RtdImage::isSeparateRapidFrame() { return (rapidFrame_ && viewMaster_ && viewMaster_->tkwin_ != tkwin_); } /* * Set the cut levels to the given min and max values and update the * image and any views of it. If scaled is 1, the values are assumed yo * be already scaled with bzero and bscale. If user is 1, the call is a * result of a user action. */ int RtdImage::setCutLevels(double min, double max, int scaled, int user) { // don't overwrite user's cut levels if (!user && !autoSetCutLevels_) return TCL_OK; // assume the user has set the cut levels, so we wont change them // if a new image is loaded... if (user) autoSetCutLevels_ = 0; // check if there is a change from the previous cut levels if (scaled && min == image_->lowCut() && max == image_->highCut()) return TCL_OK; // no change image_->setCutLevels(min, max, scaled); image_->colorScale(colors_->colorCount(), colors_->pixelval()); // make sure the new lookup table is propagated LookupTable lookup = image_->lookupTable(); for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i] && view_[i]->image_ && !view_[i]->isSeparateRapidFrame()) view_[i]->image_->lookupTable(lookup); } return updateViews(1) || updateImage(); } /* * set the X,Y scale factors for the image and propagate to any views * of the image as needed. */ int RtdImage::setScale(int xScale, int yScale) { // ignore invalid scale values if (xScale == 0 || xScale == -1) xScale = 1; if (yScale == 0 || yScale == -1) yScale = 1; // magnify by zoom factor, if requested if (zoomFactor_ > 1) { if (xScale > 0) { xScale *= zoomFactor_; yScale *= zoomFactor_; } else { xScale = yScale = zoomFactor_; } if (dbl_) dbl_->log("%s: setting scale to (%d, %d), factor %d\n", name(), xScale, yScale, zoomFactor_); } // ignore if the same scale is now in effect int xs = image_->xScale() , ys = image_->yScale(); if (xScale == xs && yScale == ys) { // notify the panning window, if necessary, even if scale didn't change // since it may need to update the panning display if (panCommand_) { panx1_ = pany1_ = panx2_ = pany2_ = 0; autoPan(); } return TCL_OK; } image_->setScale(xScale, yScale); panx1_ = pany1_ = panx2_ = pany2_ = 0; // make sure panning is updated if (resetImage() != TCL_OK) return TCL_ERROR; // also scale any views that don't have a fixed scale return updateViews(2); } /* * This method is called for new images or whenever the image may * have changed size. It updates the size of the pixmap and XImage * as needed and arranges to have the image redrawn. */ int RtdImage::resetImage() { if (! image_) return TCL_OK; // only use a pixmap if not using X shared mem int w = dispWidth(), h = dispHeight(); double rw = reqWidth_, rh = reqHeight_; doTrans(rw, rh, 1); // if an explicit size was requested and it is less than the image // size, use it. if (rw && rw < w) { w = int(rw); } if (rh && rh < h) { h = int(rh); } // size of XImage and pixmap, if used int pixw = w, pixh = h; // if displaymode is 1, the image size is not larger than the window size if (displaymode() == 1) { pixw = Tk_Width(tkwin_); // note: making this any smaller than the window pixh = Tk_Height(tkwin_); // caused problems on HP (X server crash..) if (pixw == 1 && pixh == 1) return TCL_OK; // wait for resize event on image window if (w < pixw) // requested smaller size ? pixw = w; if (h < pixh) pixh = h; // round up the size to the nearest scale factor multiple (+1?), so that no // empty spaces are left around the edges of the image (allan, 10.10.95) int xs = image_->xScale(), ys = image_->yScale(); if (xs > 1) { pixw += (xs - pixw % xs) + xs; pixh += (ys - pixh % ys) + ys; } } // check min size for X image if (pixw <= 0 || pixh <= 0) { pixw = pixh = 1; } // make a new X image if needed and update the size if (!xImage_) xImage_ = new ImageDisplay(display_, visual_, gc_, depth_, usingXShm_, verbose()); if (xImage_->update(pixw, pixh) != TCL_OK) { deleteXImage(); return TCL_ERROR; } // tell that class that manages the image data about the new xImage data image_->setXImage( xImage_ ); // always set Tk's idea of the image size to the full size, // even though the pixmap and XImage may be smaller int status = setImageSize(w, h, !xImage_->usingXShm(), pixw, pixh); // tell Tk we want to redraw the image imageChanged(); return status; } /* * Load a Fits image file and display it. */ int RtdImage::loadFile() { // -file may have been set to "", just clear image then if (strlen(file()) == 0) return clearCmd(0, NULL); // used to save and restore image transformation parameters ImageDataParams p; if (image_) { image_->saveParams(p); delete image_; image_ = NULL; updateViews(); } // if not '-' (stdin) check that it is a file if (strcmp(file(), "-") != 0) { struct stat buf; if (stat(file(), &buf) != 0 || S_ISREG(buf.st_mode) == 0) return error("expected a file, but got: ", file()); } // if sysV shared memory was requested, use it in place of mmap // XXX 18.06.04 shared memory is only used for image event data FitsIO* fits = NULL; if (0 && (shm_header() || shm_data())) { // read the FITS image into shared memory Mem m(file()); if (m.status() != 0) return TCL_ERROR; m.shared(1); fits = FitsIO::initialize(m); } else { // read the FITS image using the default mmap. S_IRUSR is used to cheat // FitsIO.C which assumes that no options are given when 0 // but O_RDONLY is defined as 0. fits = FitsIO::read(file(), O_RDONLY | S_IRUSR); } if (!fits || fits->status() != 0) return TCL_ERROR; image_ = makeImage(fits); if (! image_) return TCL_ERROR; // restore transformations image_->restoreParams(p, !autoSetCutLevels_); filename(file()); // keep filename return initNewImage(); } /* * this method is called to do all the necessary work * after a new image has been loaded from file or shared memory */ int RtdImage::initNewImage() { if (!image_) { return updateViews(); } // reset options image_->subsample(subsample()); image_->sampmethod(sampmethod()); image_->verbose(verbose()); if (fitWidth() || fitHeight()) { image_->shrinkToFit(fitWidth(), fitHeight()); } if (fillWidth() || fillHeight()) { image_->fillToFit(fillWidth(), fillHeight()); } image_->colorScale(colors_->colorCount(), colors_->pixelval()); // update other views if (updateViews(1) != TCL_OK) return TCL_ERROR; if (resetImage() != TCL_OK) return TCL_ERROR; // update the panning window if needed if (panCommand_) { if (Tk_Width(tkwin_) <= 1) { // pause here until window is displayed, so that the pan // window can determine the size of the window updateRequests(); } autoPan(1); } // evaluate the newImageCmd, if there is one if (strlen(newImageCmd())) { return Tcl_Eval(interp_, newImageCmd()); } return TCL_OK; } /* * this method causes the image and its views to be redrawn. */ int RtdImage::updateImage() { imageChanged(); if (image_) image_->update_pending(1); return updateViews(); } /* * This method is called to update an existing image with new * raw data of the same size and type. */ int RtdImage::updateImageNewData(const Mem& data) { if (dbl_) dbl_->log("%s: update image with new data (size: %d)\n", name(), data.length()); if (image_) image_->data(data); // update the data in any views for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i] && view_[i]->image_ && !view_[i]->rapidFrame_ && view_[i] != zoomView_ && view_[i] != zoomView2_) { if (dbl_) dbl_->log("%s: update %s with new data\n", name(), view_[i]->name()); view_[i]->image_->data(data); } } return updateImage(); } /* * delete the XImage used to display the image */ int RtdImage::deleteXImage() { if (xImage_) { delete xImage_; xImage_ = NULL; } // also reset the pointer in the class that manages the XImage data if (image_) image_->setXImage( NULL ); return 0; } /* * this method is called in the master image to update all of the * views. * "flag" is set to 1 if a new image was loaded from file or * shared memory, 2 if the image has be scaled (zoomed) and 0 * otherwise. */ int RtdImage::updateViews(int flag) { int status = TCL_OK; for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i]) status |= view_[i]->updateView(image_, flag); } return status; } /* * add the given image to the list of views, images * that are updated from this one. */ int RtdImage::addView(RtdImage* view) { for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i] == NULL) { view_[i] = view; view->frameId_ = i+1; view->viewMaster_ = this; if (image_) { return view->updateView(image_, 1); } return TCL_OK; } } return error("too many RtdImage views"); } /* * remove the given image from the list of views */ int RtdImage::removeView(RtdImage* view) { if (view) { for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i] == view) { view->viewMaster_ = NULL; view_[i]->zoomer_ = NULL; view_[i]->zoomView_ = NULL; view_[i]->zoomView2_ = NULL; view_[i] = NULL; return TCL_OK; } } } return error("tried to remove nonexistant RtdImage view"); } /* * remove all views from the view list */ void RtdImage::removeViews() { for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i]) { view_[i]->viewMaster_ = NULL; view_[i]->zoomer_ = NULL; view_[i]->zoomView_ = NULL; view_[i]->zoomView2_ = NULL; view_[i] = NULL; } } } /* * This method is called from outside by the master image to update the * view in a slave image. "im" is the master image data, which we make a copy * of here (with reference counting, so the actual data is shared) * * "flag" is set to 1 if a new image was loaded from file or shared * memory, 2 if the image has been scaled (zoomed) and 0 otherwise. */ int RtdImage::updateView(ImageData* im, int flag) { if (!im) { // image was unloaded ? if (image_) delete image_; image_ = NULL; return TCL_OK; } if (image_ && flag != 1) { // this is an existing image, update it // only transformations changed if (flag == 2) { if (propagateScale_ == 0) { // no change - scale is fixed return TCL_OK; } else { // set new x,y scale factors return setScale(im->xScale(), im->yScale()); } } return updateImage(); } // save scale factors, if any int xs = 0, ys = 0; if (image_) { xs = image_->xScale(); ys = image_->yScale(); } if (dbl_) dbl_->log("%s: update view from %s (rapid?: %d)\n", name(), im->name(), rapidFrame_); // if its not a rapid frame in a separate window, copy the image from the master image, // otherwise just copy the transformations if (rapidFrame_) { if (image_ && isEmbeddedRapidFrame()) { ImageDataParams p; im->saveParams(p); image_->restoreParams(p, !autoSetCutLevels_); } } else { // this is a new image, or it changed dimensions or position in some way. // delete old one and copy the new one. if (image_) delete image_; #ifdef XXXDEBUG if (verbose()) printf("%s: copy data from %s\n", name(), im->name()); #endif image_ = im->copy(); image_->name(name()); // reset the name of the slave image image_->sampmethod(sampmethod()); image_->subsample(subsample()); } if (fitWidth() || fitHeight()) { // used for pan window - shrink to fit whole image in window image_->shrinkToFit(fitWidth(), fitHeight()); } else if (zoomFactor_ > 1) { // used for zoom view: make scale relative to main image if (setScale(im->xScale(), im->yScale()) != TCL_OK) return TCL_ERROR; } else if (xs && propagateScale_ == 0) { // if the scale factors should not propagate to the view, restore them here image_->setScale(xs, ys); } if (resetImage() != TCL_OK) return TCL_ERROR; return TCL_OK; } /* * return a pointer to the RtdImage class object for the * given rtdimage tcl instance name, or NULL * if the name is not an rtdimage. */ RtdImage* RtdImage::getView(char* name) { // check that the argument really is an rtdimage... if (strncmp(name, "image", 5) != 0) { error("expected an rtdimage id but got: ", name); return NULL; } // get class instance pointer from name Tcl_CmdInfo info; if (Tcl_GetCommandInfo(interp_, name, &info) == 0) { error("expected an \"rtdimage\" type image"); return NULL; } return (RtdImage*)info.clientData; } /* * This virtual method is called indirectly by the Tk image handling routines * for each use of the image in a widget. * It is redefined here so that we can set up an event handler on the instance * window for autozooming. */ TkImage* RtdImage::getImage(Tk_Window tkwin) { TkImage* ret = TkImage::getImage(tkwin); if (! ret) return ret; // note the name of the canvas window canvasName_ = Tk_PathName(tkwin); // set up event handler for motion events and resizing Tk_CreateEventHandler(tkwin, ButtonMotionMask|StructureNotifyMask, eventProc, (ClientData)this); // get a handle to the canvas and save it for later reference Tcl_CmdInfo info; if (Tcl_GetCommandInfo(interp_, (char*)canvasName_, &info) == 0) { char* msg = (char *)"internal error: couldn't get canvas info"; error(msg); fprintf(stderr, "rtd: %s for %s\n", msg, canvasName_); Tk_BackgroundError(interp_); return NULL; // this crashes Tk, either way... } #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 canvas_ = (Tk_Canvas)info.objClientData; #else canvas_ = (Tk_Canvas)info.clientData; #endif // set colormap if needed for image window and add to window list for later colors_->setColormap(tkwin_); return ret; } /* * This static method is called for motion and configure events * in the image window */ void RtdImage::eventProc(ClientData clientData, XEvent* eventPtr) { RtdImage* thisPtr = (RtdImage*)clientData; if (thisPtr) { if (eventPtr->type == MotionNotify) { // use current view as set by view command, which defaults to this // image, in case more than one image is in canvas (motionView_ = thisPtr->currentView_)->motionNotify(eventPtr); } else if (eventPtr->type == ConfigureNotify) { thisPtr->configureNotify(eventPtr); } } } /* * This method is called for MotionNotify events in the image window * Arrange for the zoom window to be updated. */ void RtdImage::motionNotify(XEvent* eventPtr) { // (eventuallY) update zoom window, if shift button not pressed if ((eventPtr->xmotion.state & ( ShiftMask | LockMask ) ) == 0) { if (saveMotion_) { motionX_ = eventPtr->xmotion.x; motionY_ = eventPtr->xmotion.y; } motionState_ = eventPtr->xmotion.state; if (!motionPending_) { if (motionState_ == 0 && zoomSpeed_ >= 0) { // speed up zoom if no keys or mouse buttons are pressed processMotionEvent(); } else { // slow down zoom if buttons are pressed, or zoomSpeed is // negative, since it might drag down the performance for drawing, etc... motionPending_ = 1; Tk_DoWhenIdle(motionProc, (ClientData)this); } } } } /* * This method is called for ConfigureNotify events in the image window * (when the image window is resized). * Make sure it is redrawn. */ void RtdImage::configureNotify(XEvent* eventPtr) { if (image_ && displaymode() == 1) { if (dbl_) dbl_->log("configureNotify: %d, %d\n", eventPtr->xconfigure.width, eventPtr->xconfigure.height); resetImage(); } } /* * This static method is called, if needed, when there is nothing else to do * to update the zoom window and other motion sensitive widgets */ void RtdImage::motionProc(ClientData clientData) { RtdImage* thisPtr = (RtdImage*)clientData; if (thisPtr) { thisPtr->motionPending_ = 0; thisPtr->processMotionEvent(); } } /* * this virtual method is called for motion events to update the zoom window * and set trace variables based on the current mouse position. */ void RtdImage::processMotionEvent() { if (image_ && xImage_ && xImage_->data() ) { double x = motionX_, y = motionY_; screenToImageCoords(x, y, 0); // there are 2 different kinds of zoom windows implemented... if (zoomView_ || zoomView2_) { autoZoomView(x, y); } else if (zoomer_) { double zx = motionX_, zy = motionY_; screenToXImageCoords(zx, zy); zoomer_->zoom(xImage_->data(), int(zx), int(zy), xImage_->bytesPerLine(), xImage_->height(), image_->xScale(), image_->yScale(), colors_->pixelval(0)); } // update a global Tcl array with the current x, y, pixval, ra, dec, equinox // values for speedy trace update in Tk. The array has the same name as // the main image and is indexed by X, Y, VALUE, RA, DEC, EQUINOX. char xStr[32], yStr[32], valueStr[32], raStr[32], decStr[32], equinoxStr[32]; char* var = (viewMaster_ ? viewMaster_->instname_ : instname_); double rx = x, ry = y; imageToRawImageCoords(rx, ry); image_->getValues(x, y, rx, ry, xStr, yStr, valueStr, raStr, decStr, equinoxStr); Tcl_SetVar2(interp_, var, "X", xStr, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "Y", yStr, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "VALUE", valueStr, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "RA", raStr, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "DEC", decStr, TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "EQUINOX", equinoxStr, TCL_GLOBAL_ONLY); // update the pixtab trace variables, if necessary // (ease up when B3 is pressed, due to measure band...) if (pixTab_ && (motionState_ & Button1Mask & Button3Mask) == 0) { char indexStr[32]; int w = pixTabCols_+1; double d; double sum=0.0, sumsq=0.0, minv, maxv, rms, ave; int npix=0; int maxx = 0, maxy = 0, minx = 0, miny = 0; image_->getValues(x, y, rx, ry, pixTab_, pixTabRows_, pixTabCols_); for(int j = 0; j <= pixTabRows_; j++) { for(int i = 0; i <= pixTabCols_; i++) { sprintf(indexStr, "%d,%d", j, i); // not outside image ? if ((d = pixTab_[j*w+i]) > -HUGE_VAL) { if (i && j) { sprintf(valueStr, "%g", d); // pix value // calculate statistics on pixels if (npix == 0) { minv = d; maxv = d; maxx = minx = j; maxy = miny = i; } npix++; sum += d; sumsq += d * d; if (d < minv) { minv = d; minx = j; miny = i; } if (d > maxv) { maxv = d; maxx = j; maxy = i; } } else sprintf(valueStr, "%.1f", d); // x,y index } else { *valueStr = '\0'; // pixel is outside of image } Tcl_SetVar2(interp_, var, indexStr, valueStr, TCL_GLOBAL_ONLY); } } if (npix > 0) { ave = sum / (double)npix; sprintf(valueStr, "%g", ave); // average Tcl_SetVar2(interp_, var, "PIXTAB_AVE", valueStr, TCL_GLOBAL_ONLY); sprintf(valueStr, "%g", minv); // min Tcl_SetVar2(interp_, var, "PIXTAB_MIN", valueStr, TCL_GLOBAL_ONLY); sprintf(valueStr, "%g", maxv); // max Tcl_SetVar2(interp_, var, "PIXTAB_MAX", valueStr, TCL_GLOBAL_ONLY); sprintf(valueStr, "%d", npix); // npix Tcl_SetVar2(interp_, var, "PIXTAB_N", valueStr, TCL_GLOBAL_ONLY); sprintf(valueStr, "%d", maxx); // maxx Tcl_SetVar2(interp_, var, "PIXTAB_MAXX", valueStr, TCL_GLOBAL_ONLY); sprintf(valueStr, "%d", maxy); // maxy Tcl_SetVar2(interp_, var, "PIXTAB_MAXY", valueStr, TCL_GLOBAL_ONLY); sprintf(valueStr, "%d", minx); // minx Tcl_SetVar2(interp_, var, "PIXTAB_MINX", valueStr, TCL_GLOBAL_ONLY); sprintf(valueStr, "%d", miny); // miny Tcl_SetVar2(interp_, var, "PIXTAB_MINY", valueStr, TCL_GLOBAL_ONLY); } else { Tcl_SetVar2(interp_, var, "PIXTAB_AVE", "\0", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PIXTAB_MIN", "\0", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PIXTAB_MAX", "\0", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PIXTAB_N", "\0", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PIXTAB_MAXX", "\0", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PIXTAB_MAXY", "\0", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PIXTAB_MINX", "\0", TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PIXTAB_MINY", "\0", TCL_GLOBAL_ONLY); } if (npix > 1) { rms = sqrt((sumsq - ((sum * sum) / npix)) / (npix -1)); sprintf(valueStr, "%g", rms); // rms Tcl_SetVar2(interp_, var, "PIXTAB_RMS", valueStr, TCL_GLOBAL_ONLY); } else { Tcl_SetVar2(interp_, var, "PIXTAB_RMS", "\0", TCL_GLOBAL_ONLY); } } } } /* * this virtual method is called for motion events when * a "zoomview" is being used. x and y are the image * coordinates distance from origin. */ void RtdImage::autoZoomView(double x, double y) { if (image_) { coordsToDist(x, y); updateZoomView(zoomView_, x, y); updateZoomView(zoomView2_, x, y); } } /* * update the given zoom view. x and y are the image coordinate offsets */ void RtdImage::updateZoomView(RtdImage* view, double x, double y) { if (view && view->image_) { double rw = view->reqWidth_, rh = view->reqHeight_; view->undoTrans(rw, rh, 1); // get only visible area view->xOffset_ = x - rapidX_ - rw/2.0 - frameX_; view->yOffset_ = y - rapidY_ - rh/2.0 - frameY_; view->updateView(image_, 1); } } /* * This method is called to notify the panning window of the coords * of the visible image. If the size or position of the visible part * of the image has changed, evaluate the panning command with the * new coordinates and a flag indicating whether the image is new or * just an update. * newImageFlag is set to one if a new image was loaded from file or * shared memory. */ void RtdImage::autoPan(int newImageFlag) { int x1 = -canvasX_; if (x1 < 0) x1 = 0; int y1 = -canvasY_; if (y1 < 0) y1 = 0; int w = dispWidth(), h = dispHeight(); int x2 = x1+Tk_Width(tkwin_)-1; if (x2 >= (w-1)) x2 = w-1; if (x2 <= x1) x2 = x1+1; int y2 = y1+Tk_Height(tkwin_)-1; if (y2 >= (h-1)) y2 = h-1; if (y2 <= y1) y2 = y1+1; // if the coords have changed... if (newImageFlag || x1 != panx1_ || y1 != pany1_ || x2 != panx2_ || y2 != pany2_) { // save the coords panx1_ = x1; pany1_ = y1; panx2_ = x2; pany2_ = y2; // make sure the coords are in range and take the scale factors of // both the pan image and the target image into account int xs = image_->xScale(), ys = image_->yScale(); if (xs > 0) { x1 /= (xs * -panFactor_); x2 /= (xs * -panFactor_); } else { x1 = (x1 * xs) / panFactor_; x2 = (x2 * xs) / panFactor_; } if (ys > 0) { y1 /= (ys * -panFactor_); y2 /= (ys * -panFactor_); } else { y1 = (y1 * ys) / panFactor_; y2 = (y2 * ys) / panFactor_; } char buf[1024]; sprintf(buf, "%s %d %d %d %d %d", panCommand_, x1, y1, x2, y2, newImageFlag); if (Tcl_Eval(interp_, buf) != TCL_OK) { Tk_BackgroundError(interp_); panCommand_ = NULL; } } } /* * Make a new image from the given ImageIO object and return a pointer to * a derived class of ImageData specialized in that type of image. * * Note that pointers to ImageIORep subclasses, such as FitsIO are * automatically converted to an ImageIO object through a special * constructor. In this way, you can add new image types by deriving a * new classes in the same way as the FitsIO class (from ImageIORep). * * imio - is a reference to an ImageIO object for the image (or ptr, see * above). */ ImageData* RtdImage::makeImage(ImageIO imio) { return ImageData::makeImage(name(), imio, biasimage_->biasInfo(), verbose()); } /* * Return true if no image is loaded. * * PWD: don't use image size (of 2x2), use OBJECT "RTD_BLANK" value instead. */ int RtdImage::isclear() { if ( image_ ) { const char *object = image_->object(); if ( ! object || object && strcmp( "RTD_BLANK", object ) != 0 ) { return 0; } } return 1; } /* * This method is called to update with new colors if needed. A * forced color update will be necessary when using X visuals which do * not support read-write colour cells. */ int RtdImage::colorUpdate( int force ) { if ( colors_->readOnly() || force ) { if (image_) { image_->colorScale(colors_->colorCount(), colors_->pixelval()); // Make sure new lookup table is propagated. LookupTable lookup = image_->lookupTable(); for(int i = 0; i < MAX_VIEWS; i++) { if (view_[i] && view_[i]->image_ && !view_[i]->isSeparateRapidFrame()) view_[i]->image_->lookupTable(lookup); } } return updateViews(1) || updateImage(); } return TCL_OK; } /* * initialize the bias image object */ int RtdImage::initBias() { // we should do this only once if (biasimage_) return TCL_OK; // create bias image object RtdImage::biasimage_ = new BiasData(); return TCL_OK; } /* * initialize the performance object */ int RtdImage::initPerf(Tcl_Interp* interp) { // we should do this only once if (rtdperf_) return TCL_OK; // create performance object RtdImage::rtdperf_ = new RtdPerf(interp); return TCL_OK; } // RtdImage signal handler void RtdImage_cleanup(int sig) { Mem_RPTcleanup(); // cleanup shm of Rtd Recorder/Playback tool Mem_cleanup(sig); // cleanup shm of RtdImage and exit } skycat-3.1.2-starlink-1b/rtd/generic/RtdImage.h000066400000000000000000000520051215713201500212110ustar00rootroot00000000000000#ifndef _RtdImage_h_ #define _RtdImage_h_ /* * E.S.O. - VLT project / ESO Archive * "@(#) $Id: RtdImage.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdImage.h - class definitions for class RtdImage, a real-time image * display extension for Tk. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * D.Hopkinson 02/12/96 Added timestamp information for performance tool * Allan Brighton 10/03/98 Added optional args to constructor to allow derived * class to specify its own configuration options. * loadFile now virtual to aid subclassing. * Allan Brighton 13/03/98 Define RTD_OPTIONS as a macro, so that derived * classes can add new options more easily. * Peter W. Draper 13/01/99 Added changes to support non 8 bit * colors (colorUpdate). * Made displayImageEvent virtual (need for UKIRT * quick look updates). * P.Biereichel 22/03/99 Added code for bias subtraction * P.Biereichel 29/06/99 Added HDU includes (copied from skycat) * P.Biereichel 26/05/00 Added options fillWidth / fillHeight * P.Biereichel 01/03/01 Copied the include and definitions from RtdImage.C * P.Biereichel 23/10/02 Made gcc 3.2 happy which complained about RTD_OPTION: * (invalid offsetof from non-POD type `class RtdImageOptions'; use * pointer to member instead). POD means "Plain Old Data". * Peter W. Draper 04/08/09 Added optionModified member to recover * functionality lost in Tk 8.5. * pbiereic 10/08/07 increased MAX_VIEWS from 8 to 64 * */ #define PANEL_EDITOR_BUG #define _HAVE_R6 (XlibSpecificationRelease > 5) //#define DEBUG #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "define.h" #include "error.h" #include "WorldCoords.h" #include "ImageColor.h" #include "ImageDisplay.h" #include "ImageData.h" #include "ImageZoom.h" #include "Fits_IO.h" #include "RtdCamera.h" #include "RtdRemote.h" #include "rtdImageEvent.h" #include "BiasData.h" #include "ImageData.h" #include "RtdPerf.h" #include "RtdUtils.h" #include "TkImage.h" // we use pointers to classes of these types below class ImageColor; class ImageDisplay; class ImageData; class BiasData; class ImageZoom; class RtdCamera; class RtdRemote; class Mem; class RtdImage; class RtdPerf; // RtdImage signal handlers void RtdImage_cleanup (int); // cleanup shm routine of Rtd Recorder/Playback tool void Mem_RPTcleanup(); // from BLT package (now locally because this routine was deleted with blt2.1) extern "C" int Blt_GraphElement( Tcl_Interp *interp, /* Interpreter of the graph widget */ char *pathName, /* Path name of the graph widget */ char *elemName, /* Name of the element to reset */ int numValues, /* Number of values in array */ double *valueArr, /* Array of x,y coordinate pairs */ char *xVector, /* Name of x array */ char *yVector); /* Name of y array */ /* * image options (used for image configuration) */ typedef struct Rtd_Options { int displaymode; // set mode used to display image: // 0 ==> XImage is size of image, update whole image to pixmap // 1 ==> XImage is size of window (default mode) int fitWidth; // fit the image in a window with this width int fitHeight; // and this height by shrinking the image int fillWidth; // fit the image in a window with this width int fillHeight; // and this height by shrinking or expanding the image int subsample; // if true, don't count neighboring pixels when shrinking image int sampmethod; // sampling method int usexshm; // if true, use X shared memory if available. int usexsync; // if true, use X synchronisation if available. int verbose; // if true, print program info to stdout int debug; // if true, print program info to stdout int shm_header; // if true, keep image FITS headers in shared memory int shm_data; // if true, keep image FITS data in shared memory // (see RtdRemote remote access interface) int min_colors; // min (max) number of colors to allocate, if this many are int max_colors; // not available, use private colormap. char* file; // name of image file, if any char* name; // name for image (for debugging) char* newImageCmd; // tcl command to evaluate whenever a new (different) // image is loaded (for updates, see camera command) int fixUpdateRate; // flag: user has specified a fixed update rate, as below. double userUpdateTime; // the minimum time between updates, as specified // by the user. } Rtd_Options; class RtdImageOptions : public TkImageOptions { public: // constructor RtdImageOptions() { rtd_options_ = new Rtd_Options; manage = 1; initialise(); } RtdImageOptions( Rtd_Options *options ) { rtd_options_ = options; manage = 0; initialise(); } struct Rtd_Options *rtd_options_; int manage; // Accessors virtual char *get_rtd_options() {return (char *)rtd_options_;} // destructor virtual ~RtdImageOptions() { if ( manage ) { delete rtd_options_; } } private: void initialise() { memset(rtd_options_, '\0', sizeof(Rtd_Options)); rtd_options_->displaymode=1; rtd_options_->usexshm=1; rtd_options_->usexsync=1; rtd_options_->min_colors=30; rtd_options_->max_colors=60; } }; /* * These options are defined here for use in the Tk_ConfigSpec declaration, so that * derived classes can more easily add to them. See RtdImage.C for usage. */ #define RTD_OPTION(x) Tk_Offset(Rtd_Options, x) #define RTD_OPTIONS \ {TK_CONFIG_BOOLEAN, (char *)"-usexshm", NULL, NULL, "1", RTD_OPTION(usexshm), 0}, \ {TK_CONFIG_BOOLEAN, (char *)"-usexsync", NULL, NULL, "1", RTD_OPTION(usexsync), 0}, \ {TK_CONFIG_BOOLEAN, (char *)"-verbose", NULL, NULL, "0", RTD_OPTION(verbose), 0}, \ {TK_CONFIG_BOOLEAN, (char *)"-debug", NULL, NULL, "0", RTD_OPTION(debug), 0}, \ {TK_CONFIG_BOOLEAN, (char *)"-shm_header", NULL, NULL, "0", RTD_OPTION(shm_header), 0}, \ {TK_CONFIG_BOOLEAN, (char *)"-shm_data", NULL, NULL, "0", RTD_OPTION(shm_data), 0}, \ {TK_CONFIG_INT, (char *)"-displaymode", NULL, NULL, "1", RTD_OPTION(displaymode), 0}, \ {TK_CONFIG_INT, (char *)"-min_colors", NULL, NULL, "1", RTD_OPTION(min_colors), 0}, \ {TK_CONFIG_INT, (char *)"-max_colors", NULL, NULL, "1", RTD_OPTION(max_colors), 0}, \ {TK_CONFIG_INT, (char *)"-fitwidth", NULL, NULL, "0", RTD_OPTION(fitWidth), 0}, \ {TK_CONFIG_INT, (char *)"-fitheight", NULL, NULL, "0", RTD_OPTION(fitHeight), 0}, \ {TK_CONFIG_INT, (char *)"-fillwidth", NULL, NULL, "0", RTD_OPTION(fillWidth), 0}, \ {TK_CONFIG_INT, (char *)"-fillheight", NULL, NULL, "0", RTD_OPTION(fillHeight), 0}, \ {TK_CONFIG_BOOLEAN, (char *)"-subsample", NULL, NULL, "1", RTD_OPTION(subsample), 0}, \ {TK_CONFIG_INT, (char *)"-sampmethod", NULL, NULL, "0", RTD_OPTION(sampmethod), 0}, \ {TK_CONFIG_STRING, (char *)"-file", NULL, NULL, "", RTD_OPTION(file), 0}, \ {TK_CONFIG_STRING, (char *)"-newimagecmd", NULL, NULL, "", RTD_OPTION(newImageCmd), 0}, \ {TK_CONFIG_STRING, (char *)"-name", NULL, NULL, "", RTD_OPTION(name), 0} /* * Class RtdImage * * This class implements the extended Tk image type "rtdimage" for displaying * FITS and other images in a Tk canvas window */ class RtdImage : public TkImage { #include "RtdCmds.icc" // image subcommand methods #include "RtdHDU.icc" // methods for hduCmd() #include "RtdCoords.icc" // methods for coordinate conversion protected: RtdImageOptions* options_; // holds image config options RtdCamera* camera_; // class managing interface to realtime image events RtdRemote* remote_; // class managing remote control interface char* cameraPreCmd_; // Tcl command to evaluate when image event is received (before display) char* cameraPostCmd_; // Tcl command to evaluate after image event has been processed int imageEvent_; // image event received from camera int frameId_; // frame Id, for use with rapid frames static ImageColor* colors_; // class for managing colors and colormaps ImageData* image_; // class object managing the image data RtdDebugLog* dbl_; // class object managing the debug log messages static BiasData* biasimage_;// class for managing the bias image static RtdPerf* rtdperf_; // class object for managing the performance test char filename_[1024]; // filename or object of master image ImageZoom* zoomer_; // class for managing zoom window RtdImage* zoomView_; // rtdimage instance used for "zoomview" RtdImage* zoomView2_; // optional second rtdimage instance used for additional "zoomview" int zoomFactor_; // relative magnification for zoom int zoomSpeed_; // normally 0 (fast), or < 0 (slow updates) int motionX_, motionY_; // saved motion event position int saveMotion_; // save motion event flag int motionPending_; // flag for doWhenIdle handler for motion events unsigned int motionState_; // saved state field from motion event int propagateScale_; // flag: if true and this is a view, propagate changes // in magnification from master image to this image int autoSetCutLevels_; // flag: if true we can set cut levels automatically // on new images, otherwise keep previous cut levels int rapidFrame_; // flag: if true, this is a rapid frame int displayLocked_; // flag: true if image is currently being updated // views (copy of image sharing same raw data) enum {MAX_VIEWS = 64}; // maximum number of views of an image RtdImage* view_[MAX_VIEWS]; // array of views (tkimage widgets) RtdImage* viewMaster_; // the image this image is a view of RtdImage* currentView_; // cur view, when more than one image is in a canvas // The following distances are normally 0, but might be non-zero for the // zoom window or a rapid frame. They are all stored as image coordinate distances // and converted to canvas coords as needed, to be independent of transformations. double frameX_, frameY_; // X,Y offset of image frame in image canvas double xOffset_, yOffset_; // X,Y offset of image origin in raw image. // note: this is needed since rapid frames have a separate memory area starting // at 0,0, but which corresponds to (rapidX_,rapidY_) in the main image double rapidX_, rapidY_; // X,Y offset of rapid frame coresponding to main image. double reqWidth_, reqHeight_; // requested width and height or 0 for entire image // panning window int panFactor_; // shrink (scale) factor for panning window char* panCommand_; // Tcl command to evaluate when image changes size or pos. int panx1_, pany1_; // saved coords of upper left of visible image int panx2_, pany2_; // saved coords of lower right of visible image // Tk canvas window info Tk_Canvas canvas_; // handle for image's canvas window const char* canvasName_; // name of canvas window int canvasX_, canvasY_; // X,Y offset of image in canvas (for scrolling) int prevX_, prevY_; // saved X,Y origin from last display update // X shared memory int haveXShm_; // flag: true if X shared memory is available int usingXShm_; // flag: true if we are using X shared memory // X Sync extension (the XSyncSetPriority function is used). int haveXSync_; // flag: true if X synchronisation is available int usingXSync_; // flag: true if we are using XSync // X image ImageDisplay* xImage_; // class object: manages the X Image // Pixel Table double* pixTab_; // array of pixel values and X,Y indices int pixTabRows_, // dimensions of pixTab_ (minus 1 for x,y headings) pixTabCols_; // -- member functions -- private: // copy constructor: not defined RtdImage(const RtdImage&); protected: // redefined from parent class to check configuration options virtual int configureImage(int argc, char* argv[], int flags); // test if an option has been modified during the configureImage. int optionModified(int argc, char *argv[], const char* option); // return true if this is an embedded (not embedded) rapid frame (in master image) int isEmbeddedRapidFrame(); int isSeparateRapidFrame(); // set the X,Y scale (zoom) factors int setScale(int xScale, int yScale); // set the cut levels to the given min and max values int setCutLevels(double min, double max, int scaled, int user); // called for new image or when image changes size to update pixmap // and XImage and redraw int resetImage(); // call resetImage when idle void eventuallyResetImage(); // Return an ImageData object, given an ImageIO object reference. virtual ImageData* makeImage(ImageIO); // load an image file virtual int loadFile(); // called to initialize a new image from a file or shared memory int initNewImage(); // called to force image to be redrawn int updateImage(); // called to update an existing image with new raw data of the same size and type int updateImageNewData(const Mem&); // delete the XImage created by updateXImage int deleteXImage(); // add/remove views, to be updated with this image int addView(RtdImage* view); int removeView(RtdImage* view); void removeViews(); // update this image with a new view from the master image int updateView(ImageData*, int flag = 0); // update all views int updateViews(int flag = 0); // get class object from instance name RtdImage* getView(char* name); // called when idle for motion events in the image virtual void processMotionEvent(); // zooming methods, when using rtdimage view virtual void autoZoomView(double x, double y); virtual void updateZoomView(RtdImage* view, double x, double y); // called to notify the panning window of the coords of the visible image virtual void autoPan(int newImageFlag = 0); // event methods, called for motion/configure events in image window virtual void motionNotify(XEvent* eventPtr); virtual void configureNotify(XEvent* eventPtr); // these are called indirectly by the Tk imageing routines virtual void displayImage( Drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY); virtual TkImage* getImage(Tk_Window); // get fraction of zoomed pixel at point void getOffsetInXImage(double px, double py, int& x, int& y); // propagate color change int colorUpdate( int force = 0); // Set detector parameters void setDetParms(ImageData* image, const rtdIMAGE_INFO&); // set or query the filename of the master image void filename(char *file) {strcpy(filename_, file);} char* filename() {return filename_;} public: // initialize the image with the command line args RtdImage(Tcl_Interp*, const char* instname, int argc, char** argv, Tk_ImageMaster master, const char* imageType, Tk_ConfigSpec* specs = (Tk_ConfigSpec*)NULL, RtdImageOptions* options = (RtdImageOptions*)NULL); // destructor - free any allocated resources ~RtdImage(); // call a member function by name virtual int call(const char* name, int len, int argc, char* argv[]); // initialize color map and visual static int initColors(Tcl_Interp* interp); // initialize bias image object static int initBias(); // initialize performance test object static int initPerf(Tcl_Interp* interp); // entry point from tcl to create a image static int CreateImage(Tcl_Interp*, char *name, int argc, #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 Tcl_Obj *CONST objv[], #else char **argv, #endif Tk_ImageType*, Tk_ImageMaster, ClientData*); // event procedure for main image window static void eventProc(ClientData clientData, XEvent *eventPtr); // doWhenIdle handler for zoom window static void motionProc(ClientData clientData); // called from the Camera class to display image from shared memory virtual int displayImageEvent(const rtdIMAGE_INFO&, const Mem& data); // utility Tcl command proc to set colormap for popup windows static int rtd_set_cmap(ClientData, Tcl_Interp* interp, int argc, char** argv); // update idle tasks and performance test variables void updateRequests(); // read-only access to configuration options static ImageColor* colors() {return colors_;} static RtdPerf* rtdperf() {return rtdperf_;} int displaymode() const {return options_->rtd_options_->displaymode;} int fitWidth() const {return options_->rtd_options_->fitWidth;} int fitHeight() const {return options_->rtd_options_->fitHeight;} int fillWidth() const {return options_->rtd_options_->fillWidth;} int fillHeight() const {return options_->rtd_options_->fillHeight;} int subsample() const {return options_->rtd_options_->subsample;} int sampmethod() const {return options_->rtd_options_->sampmethod;} char* file() const {return options_->rtd_options_->file;} char* newImageCmd() const {return options_->rtd_options_->newImageCmd;} char* name() const {return ((options_->rtd_options_->name && *options_->rtd_options_->name) ? options_->rtd_options_->name : instname_);} int usexshm() const {return options_->rtd_options_->usexshm;} int usexsync() const {return options_->rtd_options_->usexsync;} int shm_header() const {return options_->rtd_options_->shm_header;} int shm_data() const {return options_->rtd_options_->shm_data;} int min_colors() const {return options_->rtd_options_->min_colors;} int max_colors() const {return options_->rtd_options_->max_colors;} int verbose() const {return options_->rtd_options_->verbose;} int debug() const {return options_->rtd_options_->debug;} // -- short cuts -- // return the dimensions of the image after transformations int dispWidth() {return (image_ ? image_->dispWidth() : 1);} int dispHeight() {return (image_ ? image_->dispHeight() : 1);} // return the type of the raw image data int imageType() {return (image_ ? image_->dataType() : UNKNOWN_IMAGE);} // return true if there is an image and it supports world coordinates int isWcs() {return (image_ ? image_->wcs().isWcs() : 0);} // Return true if no image is loaded. int isclear(); // Return name of instance (= tcl command which corresponds to this image) char* instname() {return instname_;} // member access char* cameraPreCmd() {return cameraPreCmd_;} char* cameraPostCmd() {return cameraPostCmd_;} // Set state of image event (currently true/false) int imageEvent(int state) {return ( imageEvent_ = state );} ImageData* image() {return image_;} }; /* * derive a Camera subclass that handles the image events * for loading images from shared memory */ class RtdImageCamera : public RtdCamera { RtdImage* rtdimage_; // keep this ptr for calling display method public: // constructor RtdImageCamera(RtdImage* rtdimage) : RtdCamera(rtdimage->name(), rtdimage->interp(), rtdimage->verbose(), rtdimage->debug(), rtdimage->instname()), rtdimage_(rtdimage) {} // called from the Camera class to display image from shared memory. // pass on the method in RtdImage class int display(const rtdIMAGE_INFO&, const Mem& data); }; /* * derive a RtdRemote subclass that handles the remote access to * the widget. * * This class is a bit different than the above RtdImageCamera class. It * is designed to be of more general use (not just for real-time updates) * and doesn't make use of the rtdServer daemon. */ class RtdImageRemote : public RtdRemote { RtdImage* rtdimage_; // keep this ptr for calling display method public: // constructor RtdImageRemote(RtdImage* rtdimage, int port) : RtdRemote(rtdimage->interp(), port, rtdimage->verbose()), rtdimage_(rtdimage) {} // call an rtdimage command method by name int call(const char* name, int len, int argc, char* argv[]) { return rtdimage_->call(name, len, argc, argv); } }; #endif /* _RtdImage_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/RtdPerf.C000066400000000000000000000164161215713201500210240ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: RtdPerf.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdPerf.C - member functions for class RtdPerf * * RtdPerf is a class for managing the performance test * * who when what * -------------- -------- ---------------------------------------- * P. Biereichel 01/03/01 Created */ /************************************************************************ * NAME * RtdPerf - class for managing the performance test * * SYNOPSIS * #include "RtdPerf.h" * RtdPerf::RtdPerf(Tcl_Interp* interp, int verbose, int debug) * Tcl_Interp* - pointer to a Tcl_Interp structure * verbose - verbose flag * debug - debug flag * * DESCRIPTION * * PUBLIC METHODS * * void RtdPerf::timeInc(double *timevar) * Adds the delta timestamp to 'timevar'. Delta is the time between calls * to this method. * * void RtdPerf::newCycle() * This method is called when a new image event cycle starts. It * initializes the time variables and the start timestamp. * * void RtdPerf::endCycle() * This method is called when a new image event cycle ends. It * calculates the statistics on the time varibales and set the * global Tcl variables which are prefixed with 'PERF_' * * void RtdPerf::reset() * Resets the time variables and Tcl variables * * void RtdPerf::on() * Switches performance test on. It sets the protected member variable * maybeOn_ which indicates that the test will be started as soon as * there is a new image event. * * FILES * * ENVIRONMENT * * CAUTIONS * * SEE ALSO * RtdImage(3) * * BUGS * *------------------------------------------------------------------------ */ #include "RtdPerf.h" RtdPerf::RtdPerf(Tcl_Interp* interp) : interp_(interp), on_(0), verbose_(0), debug_(0), maybeOn_(0), imageCount_(0.0), GENtime_(0.0), TCLtime_(0.0), Xtime_(0.0), FREQtime_(0.0), lastTimeStamp_(0.0), startTime_(0.0), accGENtime_(0.0), accTCLtime_(0.0), accXtime_(0.0), accFREQtime_(0.0) { name((char *)""); dbl_ = new RtdDebugLog((char *)"RtdPerf", (int)0); reset(); } RtdPerf::~RtdPerf() { if (dbl_) { delete dbl_; dbl_ = NULL; } } /* * This routine is called as part of the interactive performance testing. * It evaluates the time between the present and the last timestamp, and * increments the variable pointed to be the argument. * * Arguments: * double *timeval - address of performance indicator to be incremented. */ void RtdPerf::timeInc(double *timevar) { if (! isOn()) // Return immediately if the testing is not activated return; struct timeval currentTime; double curTimeStamp; // Get the current time. gettimeofday(¤tTime, NULL); curTimeStamp = (double)currentTime.tv_sec + (double)currentTime.tv_usec / 1.0e+6; (*timevar) += curTimeStamp - lastTimeStamp_; // Increment the appropriate variable lastTimeStamp_ = curTimeStamp; // Update the last timestamp } /* * This routine is triggered by receipt of an image event, * and sets the timestamp information for the beginning of a cycle. */ void RtdPerf::newCycle() { if (maybeOn()) on(1); if ( ! isOn() ) return; dbl_->setlog(verbose_ & debug_); dbl_->log("Starting image event cycle: %s\n", name()); // Reset the performance variables. GENtime_ = 0.; TCLtime_ = 0.; Xtime_ = 0.; timeInc(&FREQtime_); // set lastTimeStamp_ to current time } /* * This routine sets the variables of the performance test indicator form, * when it is realised. */ void RtdPerf::endCycle() { if ( ! isOn() ) // performance testing is not activated return; char* var = name(); dbl_->log("Ended image event cycle: %s\n", name()); imageCount_++; // Set the frequency Tcl variables. Needs at least two cycles if (imageCount_ > 1) { timeInc(&FREQtime_); // set lastTimeStamp_ to current time FREQtime_ = lastTimeStamp_ - startTime_; accFREQtime_ += FREQtime_; sprintf(buffer_, "%.3f", 1.0 / FREQtime_); Tcl_SetVar2(interp_, var, "PERF_FREQ", buffer_, TCL_GLOBAL_ONLY); sprintf(buffer_, "%.3f", (imageCount_ - 1.0) / accFREQtime_); Tcl_SetVar2(interp_, var, "PERF_FREQ_AVE", buffer_, TCL_GLOBAL_ONLY); } startTime_ = lastTimeStamp_; // Set the total time for the image event. double aveXtime, aveGENtime, aveTCLtime; // Accumulated averages double TOTtime = GENtime_ + Xtime_ + TCLtime_; // Accumulate times (these are total times over all images). accGENtime_ += GENtime_; accTCLtime_ += TCLtime_; accXtime_ += Xtime_; // Average all the totals. Times in % double aveTOTtime = (accGENtime_ + accTCLtime_ + accXtime_) / imageCount_; aveGENtime = accGENtime_ / imageCount_ * 100.0 / aveTOTtime; aveXtime = accXtime_ / imageCount_ * 100.0 / aveTOTtime; aveTCLtime = accTCLtime_ / imageCount_ * 100.0 / aveTOTtime; GENtime_ = GENtime_ * 100.0 / TOTtime; Xtime_ = Xtime_ * 100.0 / TOTtime; TCLtime_ = TCLtime_ * 100.0 / TOTtime; // Set the Tcl variables sprintf(buffer_, "%.0f", imageCount_); Tcl_SetVar2(interp_, var, "PERF_COUNT", buffer_, TCL_GLOBAL_ONLY); sprintf(buffer_, "%6.3f", GENtime_); Tcl_SetVar2(interp_, var, "PERF_GEN", buffer_, TCL_GLOBAL_ONLY); sprintf(buffer_, "%6.3f", Xtime_); Tcl_SetVar2(interp_, var, "PERF_XFUNC", buffer_, TCL_GLOBAL_ONLY); sprintf(buffer_, "%6.3f", TCLtime_); Tcl_SetVar2(interp_, var, "PERF_TCL", buffer_, TCL_GLOBAL_ONLY); sprintf(buffer_, "%8.3f", TOTtime * 1.0e+3); // in msec Tcl_SetVar2(interp_, var, "PERF_TOTAL", buffer_, TCL_GLOBAL_ONLY); // Do the same for the averaged amounts. sprintf(buffer_, "%6.3f", aveGENtime); Tcl_SetVar2(interp_, var, "PERF_GEN_AVE", buffer_, TCL_GLOBAL_ONLY); sprintf(buffer_, "%6.3f", aveXtime); Tcl_SetVar2(interp_, var, "PERF_XFUNC_AVE", buffer_, TCL_GLOBAL_ONLY); sprintf(buffer_, "%6.3f", aveTCLtime); Tcl_SetVar2(interp_, var, "PERF_TCL_AVE", buffer_, TCL_GLOBAL_ONLY); sprintf(buffer_, "%6.3f", aveTOTtime * 1.0e+3); // in msec Tcl_SetVar2(interp_, var, "PERF_TOTAL_AVE", buffer_, TCL_GLOBAL_ONLY); } void RtdPerf::reset() { char* var = name(); dbl_->log("Reset performance data: %s\n", name()); on(0); imageCount_ = 0.0; lastTimeStamp_ = startTime_ = 0.0; GENtime_ = TCLtime_ = Xtime_ = FREQtime_ = 0.0; accGENtime_ = accTCLtime_ = accXtime_ = accFREQtime_ = 0.0; // Clear the Tcl variables. Tcl_SetVar2(interp_, var, "PERF_COUNT", '\0', TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PERF_FREQ", '\0', TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PERF_GEN", '\0', TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PERF_XFUNC", '\0', TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PERF_TCL", '\0', TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PERF_TOTAL", '\0', TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PERF_FREQ_AVE", '\0', TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PERF_GEN_AVE", '\0', TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PERF_XFUNC_AVE", '\0', TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PERF_TCL_AVE", '\0', TCL_GLOBAL_ONLY); Tcl_SetVar2(interp_, var, "PERF_TOTAL_AVE", '\0', TCL_GLOBAL_ONLY); } skycat-3.1.2-starlink-1b/rtd/generic/RtdPerf.h000066400000000000000000000046131215713201500210650ustar00rootroot00000000000000// -*-c++-*- #ifndef _RtdPerf_h_ #define _RtdPerf_h_ /* * E.S.O. - VLT project * * RtdPerf.h - class definitions for managing the performance data. * * who when what * -------------- -------- ---------------------------------------- * pbiereic 01/03/01 Created */ #include #include #include #include #include "RtdUtils.h" class RtdPerf { public: // Constructor RtdPerf(Tcl_Interp* interp); // Destructor ~RtdPerf(); // Add delta time to 'timevar' void timeInc(double *timevar); // Start a new cycle void newCycle(); // End a cycle and set the Tcl global variables void endCycle(); // Reset the time variables and Tcl global variables void reset(); // Switch performance test on void on() {maybeOn_ = 1; on_ = 0;} void on(int set) {on_ = set;} // Switch performance test on void off() {maybeOn_ = 0; on_ = 0;} // Set verbose and debug flag void verbose(int set) {verbose_ = set;} void debug(int set) {debug_ = set;} // Set the instance name of the RtdImage (used for global Tcl variables) void name(char *nam) {strcpy(name_, nam);} // -- short cuts -- void GENtime() {timeInc(&GENtime_);} void TCLtime() {timeInc(&TCLtime_);} void Xtime() {timeInc(&Xtime_);} protected: RtdDebugLog *dbl_; // debug log object Tcl_Interp* interp_; // Tcl interp (for file events, error handling) int on_; // Flag: test is switched on/off int verbose_; // Verbose flag int debug_; // Debug flag int maybeOn_; // Switch test on when a new cycle start double imageCount_; // Image counter double GENtime_; // Time spent in general code processing within a image event cycle double TCLtime_; // Time spent in Tcl code double Xtime_; // Time spent for X updates double FREQtime_; // Frequency of image event cycle double lastTimeStamp_;// Last time stamp double startTime_; // Start time of cycle // Accumulated times double accGENtime_; double accTCLtime_; double accXtime_; double accFREQtime_; char name_[100]; char buffer_[2048]; // -- short cuts -- char* name() {return(name_);} int isOn() {return on_;} int maybeOn() {return maybeOn_;} }; #endif /* _RtdPerf_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/RtdPerformanceTool.C000066400000000000000000000225751215713201500232320ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: RtdPerformanceTool.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdPerformanceTool.C - member routines for class RtdPerformanceTool, * manages manipulation of performance data * * who when what * -------------- -------- ---------------------------------------- * D.Hopkinson 21/11/96 Created * A.Brighton 08/12/97 added cast and fixed "new" expr for SunPro CC */ #include "RtdPerformanceTool.h" #include "tcl.h" #include #include #include /* * Const array of process type identifiers for performance testing. * e.g. PKT = packet transfer, TCL = tcl code interpretation. */ const char *rtdEventDesc[] = {"PKT_", "MEM_", "GEN_", "TCL_", "X_"}; const int numIdentifiers = 5; /* * Constructor function - just initialise the timeIndex. * * Arguments: * None */ RtdPerformanceTool::RtdPerformanceTool() : timeIndex(0), verbose_(1), active_(0) { } /* * Destructor function. */ RtdPerformanceTool::~RtdPerformanceTool() { } /* * Add a timestamp to the performance test data. This routine is called through * a buffer method in RtdCamera when timestamping RtdImage processes, which * prevents timestamping when the tool is not active. When called directly * from an RtdCamera process, this routine ensures that the tool becomes * active. * * Arguments: * char *evDesc - event description * * Return value: * None */ void RtdPerformanceTool::timeStamp(char *evDesc) { // Activate the tool. active_ = 1; // Timestamp. if (timeIndex < RTD_NUMSHM * RTD_NUMTMSTMPS) { gettimeofday(&timeStamps[timeIndex], NULL); sprintf(evDescs[timeIndex++], "%s", evDesc); } else { fprintf(stderr, "Warning: too many timestamps produced\n"); } } /* * Add a timestamp to the performance test data, as above. This routine is * called when the image information is first received by the RTD, and * examines the image information structure to extract the timestamp. * * Arguments: * rtdIMAGE_INFO *imageInfo - the image information structure * * Return value: * None */ void RtdPerformanceTool::timeStamp(const rtdIMAGE_INFO *imageInfo) { // activate the tool. active_ = 1; // Timestamp if (timeIndex < RTD_NUMSHM * RTD_NUMTMSTMPS) { sprintf(evDescs[timeIndex], "SEND"); memcpy(&timeStamps[timeIndex++], (void *)&imageInfo->timeStamp, sizeof(struct timeval)); } else { fprintf(stderr, "Warning: too many timestamps produced\n"); } } /* * Dump the performance data (held in the timeStamps array) to file. * * Arguments: * rtdIMAGE_INFO *imageInfo - image information structure, used for * output of image data to the browse file. * * Return value: * TCL_OK / TCL_ERROR */ int RtdPerformanceTool::dumpPerformanceData(const rtdIMAGE_INFO *imageData) { int i, j; // Index coutners. FILE *fStr; // Input/output file stream. struct fLine *timeLines; // Ditto from display process. reportRecord *sumData; // Summary data array. int numReceived; // Number of images received. int correctOrdering; // Is the ordering of events correct? // Deactivate the tool. active_ = 0; /* * Copy all the performance data into the timeLines structure * prior to sorting. */ timeLines = new fLine[timeIndex]; for (j = 0; j < timeIndex; j++) { timeLines[j].timeStamp = timeStamps[j].tv_sec + (timeStamps[j].tv_usec / 1000000.); sprintf(timeLines[j].descr, "%s", evDescs[j]); } // End the array with the END event. sprintf(timeLines[timeIndex - 1].descr, "END"); // Now sort the resulting line array in order of increasing time. qsort(&timeLines[0], timeIndex, sizeof(struct fLine), (int(*)(const void*, const void*))sortTime); // added cast to avoid compiler error message // Generate the summary data from the array just created. generateSummary(timeLines, timeIndex, sumData, numReceived, correctOrdering); // Open the output browse file for writing. if ((fStr = fopen(RTD_PTEST_FNAME, "w")) == NULL) { if (verbose_) { fprintf(stderr, "Unable to open performance test browse file\n"); return TCL_ERROR; } } // Write the data. Start with general image information. fprintf(fStr, "**** Performance Test Results ****\n"); fprintf(fStr, "\nImage width/pixels\t%d", imageData->xPixels); fprintf(fStr, "\nImage height/pixels\t%d", imageData->yPixels); fprintf(fStr, "\nImage bytes per pixel\t%d", imageData->bytePerPixel); fprintf(fStr, "\nTotal image size\t%ld", imageData->xPixels * imageData->yPixels * imageData->bytePerPixel); fprintf(fStr, "\nNumber of sent images\t%d", RTD_NUMSHM); fprintf(fStr, "\nNumber of received images\t%d", numReceived); // Write the timestamp list. fprintf(fStr, "\n\n**** Timestamp list ****\n"); for (j = 0; j < timeIndex; j++) { fprintf(fStr, "%lf\t%s\n", timeLines[j].timeStamp, timeLines[j].descr); } // Add some general reporting information here. fprintf(fStr, "\n**** Summary results ****\n"); for (j = 0; j < numIdentifiers; j++) { fprintf(fStr, "Process: %s\tInit_time: %6.4f\tOverall_time: %6.4f\n", sumData[j].procDesc, sumData[j].initTime, sumData[j].overallTime); } fprintf(fStr, "Total processing time: %7.4f\n", getProcTime(sumData)); delete(sumData); // Close the browse file and free memory. fclose(fStr); delete(timeLines); // Signal the end of the testing, and display the number of events received. printf("\n***** Performance Test Ended *****\n"); if (!correctOrdering) { printf("\nImage client fell behind server"); } else { printf("\nAll server events were processed immediately"); } printf("\nNumber of image events skipped: %d\n", RTD_NUMSHM - numReceived); printf("Diagnostic output written to %s\n", RTD_PTEST_FNAME); timeIndex = 0; return TCL_OK; } /* * Generate the summary data from the timestamps. This must be freed by the * caller. * * Arguments: * struct fLine *data - pointer to event timestamp data from which the * summary is to be prepared. * int numLines - the number of entries in the above array * reportRecord* &summaryData - pointer to structure containing the output * summary data. Must be freed by caller. * int numReceived - output, the number of image events received * int correctOrdering - flag True if the ordering of the timestamps is * corrent (RTD did not fall behind in image processing). * * Return value: * None */ void RtdPerformanceTool::generateSummary(const struct fLine *data, int numLines, reportRecord* &summaryData, int& numReceived, int& correctOrdering) { float deltaTime = 0.; // Time difference between sequential events. int i, k; // Index counter. // Initialise the ordering and number received parameters correctOrdering = 1; numReceived = 0; summaryData = (reportRecord *)new reportRecord[numIdentifiers]; // First check that the SEND events do not occur out of order. Just check // that each send is followed by a PKT_ identifier. for (i = 0; i < numLines; i++) { // Count the number of received packets. if (strstr(data[i].descr, rtdEventDesc[0])) { numReceived++; } if (strstr(data[i].descr, "SEND")) { if (!strstr(data[i + 1].descr, "PKT")) { correctOrdering = 0; } } } // Accumulate the data for each process identifier. for (i = 0; i < numIdentifiers; i++) { // Copy across the identifier for the process. strcpy(summaryData[i].procDesc, rtdEventDesc[i]); summaryData[i].initTime = 0.; summaryData[i].overallTime = 0.; for (int j = 1; j < numLines; j++) { if (correctOrdering || strstr(rtdEventDesc[i], "PKT")) { deltaTime = data[j].timeStamp - data[j - 1].timeStamp; } else { /* * If the timestamps are out of order, then we require special * processing. We ignore SEND events apart from the case of * data transmission processes. */ for (k = j - 1; k > 0; k--) { if (!strstr(data[k].descr, "SEND")) { deltaTime = data[j].timeStamp - data[k].timeStamp; break; } } } if (strstr(data[j].descr, rtdEventDesc[i])) { // then add the time on to the total. summaryData[i].overallTime += deltaTime; if (strstr(data[j].descr, "INIT")) { summaryData[i].initTime += deltaTime; } } } } } /* * Get the overall total processing time for the image processing from * the summary data. * * Arguments: * reportRecord *data - pointer to summary data structure with the times * for each processing type. * * Return value: * float, the total processing time for the image. */ float RtdPerformanceTool::getProcTime(const reportRecord *data) { float totalProcTime = 0.; /* * Loop over each process type and add the total time for that processing * to the overall time for all processing. */ for (int i = 0; i < numIdentifiers; i++) { totalProcTime += data[i].overallTime; } return totalProcTime; } /* * Routine required for qsort function call. Orders a set of fLines's in * chronological order. * * Arguments: * struct fLine *a, *b - pointers to two sample structures to be sorted * * Return value: * -1, time (a) less than time (b) * +1, time (b) less than time (a) */ int RtdPerformanceTool::sortTime(const struct fLine *a, const struct fLine *b) { if (a->timeStamp < b->timeStamp) { return -1; } else { return 1; } } skycat-3.1.2-starlink-1b/rtd/generic/RtdPerformanceTool.h000066400000000000000000000046541215713201500232750ustar00rootroot00000000000000// -*-c++-*- #ifndef _RtdPerformanceTool_h_ #define _RtdPerformanceTool_h_ /* * E.S.O. - VLT project * * RtdPerformanceTool.h - class definitions for managing the performance data. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * D. Hopkinson 21/11/96 Created */ #include #include "rtdImageEvent.h" #define RTD_NUMTMSTMPS 20 // The number of timestamps produced // for every received image event. struct fLine { // Represent each line of the performance file dump. char descr[32]; // Line description. double timeStamp; // Line timestamp. }; // For the summary report. typedef struct { char procDesc[32]; /* Process description line. */ float initTime; /* Time for startup processes. */ float overallTime; /* Overall time over whole test/ */ } reportRecord; class RtdPerformanceTool { protected: // Display diagnostic messages. int verbose_; // Flag that a test is underway. This is required so that timestamp calls // can be added to routines which are called when the client is quiescent // without filling up the timestamp array before the test starts. int active_; // Array of timestamps for eventual output to the performance data file. struct timeval timeStamps[RTD_NUMSHM * RTD_NUMTMSTMPS]; // Same for event descriptions. char evDescs[RTD_NUMSHM * RTD_NUMTMSTMPS][32]; // Index to these arrays. int timeIndex; // Generate data summary. void generateSummary(const struct fLine *data, int numLines, reportRecord* &summaryData, int& numReceived, int& correctOrdering); // Get the total processing time. float getProcTime(const reportRecord *data); // The sort algorithm for qsort. static int sortTime(const struct fLine *a, const struct fLine *b); public: // Constructor RtdPerformanceTool(); // Destructor ~RtdPerformanceTool(); // Add timestamp for send event (take time from image information) void timeStamp(const rtdIMAGE_INFO *imageInfo); // Add timestamp in performance test. void timeStamp(char *evDesc); // Write the performance data to the browse file. int dumpPerformanceData(const rtdIMAGE_INFO *imageData); // Return active status of performance test. int active() {return active_ ? 1 : 0;} }; #endif /* _RtdPerformanceTool_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/RtdRPFile.C000066400000000000000000000653271215713201500212560ustar00rootroot00000000000000/* * E.S.O. - VLT project * * RtdRPFile.C - member routines for class RtdRPFile, RtdFITSCube, * and RtdFITSComp. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * D.Hopkinson 17/04/97 Created * P.Biereichel 23/07/97 Bug fixed. Revised * pbiereic 10/08/07 RtdFITSCube::writeFITSHeader: using ISO date string (VLTSW20070156) */ /*#include */ #include #include #include #include "RtdRPFile.h" static int cnt = 0; // Shared memory counter /* * Constructor for RtdRPFile class. This opens a file for reading or writing. * * Arguments: * char *fileName - name of the file to open * char *accFlag - usual C access flag, e.g. r+. * double maxFileSize - the maximum allowed file size (Mb) */ RtdRPFile::RtdRPFile(Tcl_Interp* interp, char* instname, char *fileName, char *accFlag, double maxFileSize) : status_(TCL_OK), fPtr(NULL), imageCounter_(0), xPixels_(0), yPixels_(0), bytesPerPixel_(0), startIndex_(0), imageIndex_(0), fileSize_(0.), maxFileSize_(maxFileSize), numFileImages_(0), fileFull_(0), timeStamps_(NULL), hasTimeInfo_(0), instname_(instname), shmSize_(0), interp_(interp), fileName_(0) { fileName_ = fileName; // Open the file in the required access mode. if (accFlag[0] != '\0') { if ((fPtr = fopen(fileName, accFlag)) == NULL) { status_ = TCL_ERROR; } } else { // check that file is a regular file and not write protected struct stat statbuf; if (stat(fileName, &statbuf) == 0) { if (! S_ISREG(statbuf.st_mode) || ! (S_IWUSR & statbuf.st_mode)) { status_ = TCL_ERROR; } } } } /* * Destructor for RtdRPFile object. This just closes the file stream and does * some tidying up of memory. */ RtdRPFile::~RtdRPFile() { cleanup(); } /* * just closes the file stream and does some tidying up of memory. */ void RtdRPFile::cleanup() { // Remove the timestamps array. delete(timeStamps_); timeStamps_ = NULL; // round off file size if (shmSize_ && (imageCounter_ != 0 || fileFull_)) { int n = fileFull_ ? numFileImages_ : imageCounter_; padFile(fPtr, shmSize_ * n); } // Close the file stream (this may take some time if the file is on a remote host) fclose(fPtr); fPtr = NULL; imageCounter_ = 0; } /* * This method takes the subimage coordinates and checks that they are * consistent with the current image information (it is possible, for example, * that the user may set up an edit window on an image which has different * properties to the images received from the camera). * * Arguments: * rtdIMAGE_INFO - image information structure for image * int& x0, y0 - coordinates of bottom left corner of subimage * int& width, height - width and height of subimage * * Return value: * None. */ void RtdRPFile::checkSubImage(rtdIMAGE_INFO *imageInfo, int& x, int& y, int& width, int& height) { // First check the initial coordinates if (x < 0) x = 0; if (y < 0) y = 0; // Check the height and width if (width > imageInfo->xPixels) width = imageInfo->xPixels - 1; if (height > imageInfo->yPixels) height = imageInfo->yPixels - 1; // Finally, make sure the subimage fits into the main image if (x + width > imageInfo->xPixels) { x = imageInfo->xPixels - width - 1; } if (y + height > imageInfo->yPixels) { y = imageInfo->yPixels - height - 1; } } /* * Method to get the time increment between the image just read and the next * image (which the file pointer should be at the start of). * * Arguments: * int direction - forwards through time (1), or backwards (0) * * Return value: * double - the time interval (seconds) */ double RtdRPFile::getTimeIncrement(int direction) { double increment; // Required time increment for return. int tmpIndex; // Temp index - index of last image read. if (!hasTimeInfo_) { // No timestamp information available. Return something. return 2000.; } /* * Strangely, the time increment required here is the same whether we * are going forwards through the file or backwards - the difference * between the previous index and the current index. This is because * when we are going backwards, the current index is already displayed. * This is not the case when going forwards. */ // tmpIndex = (imageIndex_ - 1 < 0) ? numFileImages_ - 1 : imageIndex_ - 1; tmpIndex = (imageIndex_ - 1 < 0) ? imageIndex_ : imageIndex_ - 1; increment = (timeStamps_[imageIndex_] - timeStamps_[tmpIndex]) * 1000.; /* * The increment may be negative if we have reached the end of a file. * Alternatively, it may be zero if the above indices were the same (i.e. * only one imae in the cube). * In either case, just return the default for SLOW speed (or whatever). */ if (increment < 0. || imageIndex_ == tmpIndex) { increment = 1000.; } return increment; } /* * Method to create and initialise a shared memory/semaphore set based on * the image information (that must have already been initialised). * * Arguments: * int numShm - number of shared memory buffers to create * rtdShm *shmInfo - structure to initialise * * Return value: * TCL_OK / TCL_ERROR */ int RtdRPFile::getShm(int numShm, rtdShm *shmInfo) { // Clear any outstanding allocation for the shmInfo memset(shmInfo, '\0', sizeof(rtdShm)); // Check first that the image information is instantiated. if (xPixels_ == 0 || yPixels_ == 0 || bytesPerPixel_ == 0) { return TCL_ERROR; } return rtdShmCreate(numShm, shmInfo, xPixels_, yPixels_, dataType_); } /* * Update tcl variable for current image count and #of images */ void RtdRPFile::update_count() { // Update recorder counter char buffer[64]; int eof=0, bof=0; if (imageCounter_ != imageCounter__ || numFileImages_ != numFileImages__ || \ imageCounter_ == numFileImages_ || imageCounter_ <=1) { if (imageCounter_ <=1) bof = 1; if (imageCounter_ >= numFileImages_) eof = 1; sprintf(buffer, "%d %d %d %d", imageCounter_, numFileImages_, bof, eof); imageCounter__ = imageCounter_; numFileImages__ = numFileImages_; Tcl_SetVar2(interp(), instname(), "COUNT", buffer, TCL_GLOBAL_ONLY); #ifdef DEBUG printf("%d %d %d %d \n", imageCounter_, numFileImages_, bof, eof); #endif } } /* Method to place the file pointer at the start of a certain image which is * indexed by the image count (i.e. the image count starts from zero at the * image which has the lowest timestamp, and this may be in the middle of * the file such that the index is non-zero). This method converts the image * count to an image index and calls a subclass method to actually place the * file pointer. * * Arguments: * int count - the image count where the pointer is to be placed * * Return value: * None */ void RtdRPFile::gotoImageCount(int count) { // Set the image counter to count imageCounter_ = count; // Translate the count into an image index this->gotoImageIndex((count - 1 + startIndex_) % numFileImages_); update_count(); } /* * Method to create an initialised FileObject given a file name. The determines * the type of file that is being loaded and creates the object that * corresponds to that file. It then places the file pointer at the correct * point in the file, ready for playing (or possibly recording in future). * * Arguments: * char *fileName - name of the file to create object from * * Return value: * RtdRPFile * - pointer to new object instance * char *err - error message to return */ RtdRPFile *RtdRPFile::makeFileObject(Tcl_Interp* interp, char* instname, char *fileName, char *err) { FILE *file; // Temporary file pointer. char buffer[16]; // Temporary buffer. // Initialise the instance to return. RtdRPFile *newInstance = (RtdRPFile *)NULL; // Open the file for reading, to check the type of file that we have. if ((file = fopen(fileName, "r")) == NULL) { sprintf(err, "Unable to open file %s", fileName); return NULL; } /* * To check the file type, get the first ten characters. In a compressed * file type, these will be "compressed" (possibly...) */ fgets(buffer, sizeof(buffer), file); fclose(file); if (strncmp(buffer, "compressed", 10) == 0) { newInstance = (RtdFITSComp *)new RtdFITSComp(interp, instname, fileName, (char *)"r", 5.); } else { newInstance = (RtdFITSCube *)new RtdFITSCube(interp, instname, fileName, (char *)"r", 5.); } // Set up the file pointer and timestamp array. if (newInstance) { if (newInstance->open(err) == TCL_ERROR) { delete(newInstance); newInstance = (RtdRPFile *)NULL; } } return newInstance; } /* * round off the file size to the next FITS block. * (size is the current size) */ void RtdRPFile::padFile(FILE* f, int size) { int rest = (size + FITSBLOCK) % FITSBLOCK; if (rest) { fseek(f, 0, SEEK_END); while (rest < FITSBLOCK) { fputc(' ', f); rest++; } } } /* - End of RtdRPFile method definitions - */ /*==========================================================================*/ /* - Start of RtdFITSCube method definitions - */ /* Private methods first. */ /* * This method writes the header to the FITS cube file. It calculates the number * of FITS data files that will fit into the cube before the maximum file size * is reached, and returns this. * * Arguments: * const rtdIMAGE_INFO *imageInfo - image information structure * int subImage - flag true if subimage is to be taken * int x0, y0, width, height - defines subimage bounding box. * * Return value: * TCL_OK / TCL_ERROR */ int RtdFITSCube::writeFITSHeader(const rtdIMAGE_INFO *imageInfo, int subImage, int width, int height) { char buf[81], // Temporary buffers buf2[20]; // Get the size of the image segments. int dataSize = (subImage ? (width * height * abs(imageInfo->dataType / 8)) : (imageInfo->xPixels * imageInfo->yPixels * abs(imageInfo->dataType / 8))); // Calculate the number of images that there will be in the file. numFileImages_ = (int)(maxFileSize_ * 1024. * 1024./ (double)dataSize); // Get the number of keyword lines in the FITS header (including END). int size = FITSBLOCK/80; sprintf(buf, "%-8s= %s", "SIMPLE", "T"); fprintf(fPtr, "%-80s", buf); size--; int bitpix = imageInfo->dataType; if (bitpix == -16) bitpix = 16; sprintf(buf, "%-8s= %d", "BITPIX", bitpix); fprintf(fPtr, "%-80s", buf); size--; sprintf(buf, "%-8s= %d", "NAXIS", 3); fprintf(fPtr, "%-80s", buf); size--; sprintf(buf, "%-8s= %d", "NAXIS1", (subImage ? width : imageInfo->xPixels)); fprintf(fPtr, "%-80s", buf); size--; sprintf(buf, "%-8s= %d", "NAXIS2", (subImage ? height: imageInfo->yPixels)); fprintf(fPtr, "%-80s", buf); size--; if (imageInfo->dataType == -16) { sprintf(buf, "%-8s= %f", "BZERO", (double)32768.0); fprintf(fPtr, "%-80s", buf); size--; sprintf(buf, "%-8s= %f", "BSCALE", (double)1.0); fprintf(fPtr, "%-80s", buf); size--; } // add the date to the cube header. time_t clock = time(0); strftime(buf2, sizeof(buf2), "%Y-%m-%d", localtime(&clock)); sprintf(buf, "%-8s= \'%s\'", "DATE", buf2); fprintf(fPtr, "%-80s", buf); size--; /* * The following blank cards will be used to provide image timestamp * information when the file is closed. */ int i = 0; while (size > 1) { sprintf(buf, "BLANK%02d", i++); fprintf(fPtr, "%-80s", buf); size--; } /* * The number of timestamps available can be smaller than the number * of images */ i--; if (i*3 < numFileImages_) numFileImages_ = i*3; /* * Finally, put on the end card. There will be no need for any padding * before the start of the image data because we should have exactly * filled the FITS block. */ fprintf(fPtr, "%-80s", "END"); // Increment the file count. fileSize_ += FITSBLOCK / (1024. * 1024.); return TCL_OK; } /* * FITSCube object destructor. This goes through the FITS header, changing * BLANK fields into timestamp information - this is in the form: * COMMENT = "TS: ..." (3 timestamps per line). * It also adds a NAXIS3 field. * * The baseclass destructor closes the file down. */ RtdFITSCube::~RtdFITSCube() { char buffer[81]; // Buffer for reading data from file. char buf2[64]; // General purpose buffer. int filePos = 0; // Position of file pointer from beginning of stream. int i; // Index counter int found = 0; // Flag: found BLANK card if (imageCounter_ == 0 && !fileFull_) { // Image file is empty anyway return; } if (!shmSize_) { // Call baseclass destructor. Nothing was recorded. // RtdRPFile::~RtdRPFile; (allan: 8.12.97: this will be called automatically!) return; } // Rewind the file pointer to the beginning of the file. rewind(fPtr); // Loop over the file header, changing fields as detailed in the method // header. do { fgets(&buffer[0], 81, fPtr); if (feof(fPtr)) break; if (strncmp(buffer, "BLANK", 5) == 0) { // Flag that we have found the card found = 1; // Replace this blank field with NAXIS3 count. fseek(fPtr, filePos, SEEK_SET); sprintf(buf2, "%-8s= %d", "NAXIS3", (fileFull_ ? numFileImages_ : imageCounter_)); sprintf(buffer, "%-80s", buf2); fputs(buffer, fPtr); break; } filePos += 80; } while(strncmp(buffer, "END", 3) != 0 && !feof(fPtr)); // If we didn't find the blank card, then either we've got big problems // or we were playing back a FITS file from some other tool. Either way, // get out of here. if (!found) { // Call baseclass destructor. // RtdRPFile::~RtdRPFile; (allan: 8.12.97: this will be called automatically!) return; } /* * Now add the timestamp information below this line. */ char TSBuf[64]; sprintf(TSBuf, "\0"); char buf3[32]; for (i = 0; i < (fileFull_ ? numFileImages_ : imageCounter_); i++) { sprintf(buf3, "%.3lf ", timeStamps_[i]); // Create concatenated timestamp string. strcat(TSBuf, buf3); if (!((i + 1) % 3)) { // Every third string, dump to the FITS header. sprintf(buffer, "%-8s= \"TS: %s/\"", "COMMENT", TSBuf); fprintf(fPtr, "%-80s", buffer); sprintf(TSBuf, "\0"); } } // If there are any timestamps left, dump these to the FITS header. if (TSBuf[0] != '\0') { sprintf(buffer, "%-8s= \"TS: %s/\"", "COMMENT", TSBuf); fprintf(fPtr, "%-80s", buffer); } // Tidy up // RtdRPFile::~RtdRPFile; (allan: 8.12.97: this will be called automatically!) } /* * Given a file pointer in an existing file, this method intialises the * timestamp information so that the images can be played back in real time. * * Arguments: * char *errMsg - error message to return if not all OK * * Return value: * TCL_OK / TCL_ERROR. */ int RtdFITSCube::open(char *errMsg) { char buffer[81]; // Temporary buffer. char *ptr, *vptr; // Temporary pointers. int bzero=0, bscale=0; int foundNAXIS3 = 0, foundNAXIS1 = 0, foundNAXIS2 = 0, foundBITPIX = 0; int i = 0; // Index counter. /* * Loop over the header information to get to the timestamp information. * If the FITS cube was produced with this application, this will be * in COMMENT headers of the form COMMENT = "TS: <> <> <>" in groups * of three timestamps per header. If this information can not be found, * flag that it is missing and let the driver objects sort it out. * * Get the NAXIS3 info first for the timestamp array size. Also, at this * point, get the image information to determine the size of the images * int the file. */ rewind(fPtr); do { fgets(buffer, sizeof(buffer), fPtr); if (feof(fPtr)) break; ptr = strtok(buffer, "="); if (strncmp(buffer, "NAXIS1", 6) == 0) { foundNAXIS1 = 1; vptr = strtok(NULL, "/"); xPixels_ = atoi(vptr); } if (strncmp(buffer, "NAXIS2", 6) == 0) { foundNAXIS2 = 1; vptr = strtok(NULL, "/"); yPixels_ = atoi(vptr); } if (strncmp(buffer, "BITPIX", 6) == 0) { foundBITPIX = 1; vptr = strtok(NULL, "/"); dataType_ = atoi(vptr); bytesPerPixel_ = abs(dataType_) / 8; } if (strncmp(buffer, "NAXIS3", 6) == 0) { // This gives the number of images, and so is also the number of // timestamps in the array. foundNAXIS3 = 1; ptr = strtok(NULL, "/"); numFileImages_ = atoi(ptr); } if (strncmp(buffer, "BSCALE", 6) == 0) { ptr = strtok(NULL, "/"); bscale = atoi(ptr); } if (strncmp(buffer, "BZERO", 5) == 0) { ptr = strtok(NULL, "/"); bzero = atoi(ptr); } } while(strncmp(buffer, "END", 3) != 0 && !feof(fPtr)); // Set BITPIX=-16 if (bscale == 1 && bzero == 32768 && dataType_ == 16) dataType_ = -16; if (feof(fPtr) || !foundBITPIX || !foundNAXIS1 || !foundNAXIS2) { sprintf(errMsg, "Not a FITS file"); return TCL_ERROR; } if (!foundNAXIS3) { numFileImages_ = 1; } timeStamps_ = (double *)new double[numFileImages_]; // Now get the timestamp comments. rewind(fPtr); do { fgets(buffer, sizeof(buffer), fPtr); if (strncmp(buffer, "COMMENT = \"TS:", 14) == 0) { hasTimeInfo_ = 1; // Get the timestamp information by splitting up the line into // constituent timestamps. ptr = &buffer[15]; while (1) { vptr = strchr(ptr, ' '); *vptr = '\0'; timeStamps_[i++] = atof(ptr); ptr = vptr + 1; if (*ptr == '/') { break; } } } } while(strncmp(buffer, "END", 3) != 0); // Get the file pointer at the end of the FITS block FITSHeaderSize_ = ftell(fPtr); // Index i should be the same as the number of file images, or something // is terribly wrong. if (hasTimeInfo_ && i != numFileImages_) { sprintf(errMsg, "Inconsistency between timestamp and image number"); return TCL_ERROR; } /* * Now we set up the image counter and image indices by finding the lowest * of the timestamps (this may not be the first in the array if the image * was cycled when it was recorded). */ imageCounter_ = 0; startIndex_ = 0; if (hasTimeInfo_) { double min = timeStamps_[0]; for (i = 0; i < numFileImages_; i++) { if (timeStamps_[i] < min) { min = timeStamps_[i]; startIndex_ = i; } } } gotoImageIndex(startIndex_); update_count(); return TCL_OK; } /* * This routine sets the file pointer to the start of the image indexed by * the method argument. * * Argument: * int index - index of the image to set the file pointer to * * Return value: * None. */ void RtdFITSCube::gotoImageIndex(int index) { long int offset = (long)((int)((FITSHeaderSize_ - 1) / FITSBLOCK) + 1) * FITSBLOCK; // Go to the start of the images (after the header). fseek(fPtr, offset, SEEK_SET); // Set the image index to the required index. imageIndex_ = index; // Now go to the start of the required index. fseek(fPtr, (imageIndex_ * xPixels_ * yPixels_ * bytesPerPixel_), SEEK_CUR); } /* * Given an image information structure, this method adds the image data to the * FITS cube. If it is the first time round, FITS header information is also * created. * * Arguments: * rtdIMAGE_INFO *imageInfo - image information structure * int subimage - true if sub image is to be taken * int x0, y0 - coordinates of lower left corner of subimage * int width, height - dimensions if subimage * * Return value: * TCL_OK / TCL_ERROR */ int RtdFITSCube::addImage(rtdIMAGE_INFO *imageInfo, int subImage, int x0, int y0, int width, int height) { int shmSize; // Get the byte size of the shared memory. shmSize = imageInfo->xPixels * imageInfo->yPixels * abs(imageInfo->dataType) / 8; shmSize_ = shmSize; if (shmSize <= 0) return TCL_ERROR; // Get a pointer to the start of the shared memory area. Mem shmData = Mem(shmSize, imageInfo->shmId, 0, 0, imageInfo->shmNum, imageInfo->semId); // Check that the memory was attached successfully if (shmData.ptr() == NULL) return TCL_ERROR; /* * If this is the first image to add (file size is still 0), then add a FITS * header to start with. We also initialise an array to deal with all the * timestamps. */ if (!imageCounter_ && !fileFull_) { if ((fPtr = fopen(fileName_, "w+")) == NULL) { return TCL_ERROR; } writeFITSHeader(imageInfo, subImage, width, height); timeStamps_ = (double *)new double[numFileImages_]; } // The timestamp can be given by the timestamp from the image information. timeStamps_[imageCounter_] = (double)imageInfo->timeStamp.tv_sec + (double) imageInfo->timeStamp.tv_usec / 1000000.; /* * If subimaging is not enabled, then just copy across the data into the * file from the shared memory. Otherwise, do a selective copy. */ int bitpix = imageInfo->dataType; if (!subImage) { if (bitpix == -16) { // unsigned short needs to be converted unsigned short *pu = (unsigned short *)shmData.ptr(); int i = shmSize / 2; short *ps_new = new short[i]; short *ps = ps_new; if (ps_new == 0) { fprintf(stderr, "Not enough memory\n"); return TCL_ERROR; } int nn; while (i--) { nn = (int)(*pu++) - 32768; *ps++ = (unsigned int) nn; } fwrite((char*)ps_new, shmSize, 1, fPtr); delete ps_new; } else { fwrite(shmData.ptr(), shmSize, 1, fPtr); // Copy entire buffer } if (!fileFull_) { fileSize_ += shmSize / (1024. * 1024.); } } else { // Get a pointer to the shared memory buffer. char *srcPtr = (char *)shmData.ptr(); int bpp = abs(imageInfo->dataType) / 8; checkSubImage(imageInfo, x0, y0, width, height); // Offset of start of required buffer. srcPtr += bpp * ((imageInfo->xPixels * y0) + x0); // Copy across all lines to the file stream. for (int j = 0; j < height; j++) { if (bitpix == -16) { // unsigned short needs to be converted unsigned short *pu = (unsigned short *)srcPtr; int i = (width * bpp) / 2; short *ps_new = new short[i]; short *ps = ps_new; if (ps_new == 0) { fprintf(stderr, "Not enough memory\n"); return TCL_ERROR; } int nn; while (i--) { nn = (int)(*pu++) - 32768; *ps++ = (unsigned int) nn; } fwrite((char*)ps_new, shmSize, 1, fPtr); delete ps_new; } else { fwrite(srcPtr, width * bpp, 1, fPtr); srcPtr += bpp * (imageInfo->xPixels); } } if (!fileFull_) { fileSize_ += (bpp * height * width) / (1024. * 1024.); } } /* * Increment the image counter. If we have reached the maximum size of the * file, reset the counter to one and reposition the file pointer to the * beginning of the image data segments. */ if (++imageCounter_ == numFileImages_) { update_count(); fseek(fPtr, FITSBLOCK, SEEK_SET); fileFull_ = 1; imageCounter_ = 0; } update_count(); } /* * Method to get the next image from the file and put it into shared memory. * If this is the last image in the file, reset the file pointer to the * start of the images. * * Arguments: * rtdShm *shmInfo - shared memory/semaphore structure to fill * * Return value: * int index - the index of the shared memory buffer in the multi-buffered * scheme that was filled. */ int RtdFITSCube::getNextImage(rtdShm *shmInfo) { char *tmpBuf; // Temporary data buffer. int retIndex = -1; // Return index. int imageSize; // Size of image data. // Calculate the size of the image data. imageSize = xPixels_ * yPixels_ * bytesPerPixel_; // Allocate a temporary buffer for the image data. tmpBuf = new char[imageSize]; // Copy into the shared memory. fread(tmpBuf, imageSize, 1, fPtr); // convert BITPIX=-16 data if (dataType_ == -16) { int nn = imageSize / 2; unsigned short *us = (unsigned short *) tmpBuf; for (int i=0; i < nn; i++) *us++ += 32768; } // Fill up a buffer in the shared memory array by calling a CCD // convenience routine. retIndex = rtdShmFillNext(cnt, tmpBuf, shmInfo); if (retIndex < 0) { delete(tmpBuf); return -1; } cnt = retIndex; // Tidy up local memory. delete(tmpBuf); // Alter imageCounter_ and imageIndex_ as required. if (++imageIndex_ >= numFileImages_) { imageIndex_ = 0; gotoImageIndex(imageIndex_); } if (imageIndex_ > startIndex_) { imageCounter_ = imageIndex_ - startIndex_; } else { imageCounter_ = numFileImages_ - startIndex_ + imageIndex_; } update_count(); return retIndex; } /* * Method to get the previous image from the file and put it into shared memory. * If this is the first image in the file, reset the file pointer to the * end of the images. * * Arguments: * rtdShm *shmInfo - shared memory/semaphore structure to fill * * Return value: * int index - the index of the shared memory buffer in the multi-buffered * scheme that was filled. */ int RtdFITSCube::getPrevImage(rtdShm *shmInfo) { char *tmpBuf; // Temporary data buffer. int retIndex = -1; // Return index. int imageSize; // Size of image data. // Calculate the size of the image data. imageSize = xPixels_ * yPixels_ * bytesPerPixel_; // Allocate a temporary buffer for the image data. tmpBuf = new char[imageSize]; // Rewind the file pointer to just before the required image. if (--imageIndex_ < 0) { imageIndex_ = numFileImages_ - 1; } gotoImageIndex(imageIndex_); // Copy into the shared memory. fread(tmpBuf, imageSize, 1, fPtr); // convert BITPIX=-16 data if (dataType_ == -16) { int nn = imageSize / 2; unsigned short *us = (unsigned short *) tmpBuf; for (int i=0; i < nn; i++) *us++ += 32768; } // Fill up a buffer in the shared memory array by calling a CCD // convenience routine. retIndex = rtdShmFillNext(cnt, tmpBuf, shmInfo); if (retIndex < 0) { delete(tmpBuf); return -1; } cnt = retIndex; // Tidy up local memory. delete(tmpBuf); // After this, the file pointer should be repositioned to the start of the // block of image data that it has just sent. gotoImageIndex(imageIndex_); /* * The image counter should represent the number of the image that is * presently under display. As we have gone backwards to get this, the * image number is one greater than the imageIndex (with an extra * allowance for the fact that the start of the images is at startIndex_). */ if (imageIndex_ >= startIndex_) { imageCounter_ = imageIndex_ - startIndex_ + 1; } else if (imageIndex_ < startIndex_) { imageCounter_ = numFileImages_ - startIndex_ + imageIndex_ + 1; } update_count(); return retIndex; } skycat-3.1.2-starlink-1b/rtd/generic/RtdRPFile.h000066400000000000000000000136341215713201500213150ustar00rootroot00000000000000#ifndef RTDRPFILE_H #define RTDRPFILE_H /* * E.S.O. - VLT project / ESO Archive * * RtdRPFile.h - class definitions for class RtdRPFile, RtdFITSCube, * and RtdFITSComp. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * D.Hopkinson 17/04/97 Created * A.Brighton 08/12/97 fixed lots of C++ errors found by SunPro CC */ #include #include #include #include #include #include "TclCommand.h" #include "tcl.h" #include "tk.h" #include "rtdImageEvent.h" #include "rtdSem.h" #include "Mem.h" #define RTD_SHMBUFFS 5 // Number of shared memory buffers to create. #define FITSBLOCK 2880 /* * This is an abstract base class from which the main classes for the file * type are derived. This simply sets up virtual chains for the functions * that are to be accessed from the recorder/playback tools. */ class RtdRPFile { protected: FILE *fPtr; // File pointer to file being read/written int imageCounter_; // Count of image from start of record/playback. int imageCounter__; // same for update_count() int xPixels_; // Pixel width of each image. int yPixels_; // Pixel height of each image. int bytesPerPixel_; // Bytes per pixel. int dataType_; // BYTE, SHORT, FLOAT, etc int startIndex_; // Index of first image in file (maybe non-zero) int imageIndex_; // Actual index of image in array. int hasTimeInfo_; // File has included timestamp information. double *timeStamps_; // Array of image event timestamps. double fileSize_; // Current size of file. double maxFileSize_; // Maximum allowed size of file. int numFileImages_; // Number of image segments allowed in file. int numFileImages__; // same for update_count() int fileFull_; // Flag: true if file is at max size int status_; // Object instance status. int shmSize_; // Size of shared memory Tcl_Interp* interp_; // tcl interpreter char* instname_; // name of tcl command created for this object char* fileName_; // filename RtdRPFile(Tcl_Interp* interp, char* instname, char *fileName, char *accFlag, double maxFileSize); // Constructor. virtual int open(char *errMsg) {return 0;} // Initialise props of existing file. // Check that the subimage information is consistent with the image. void checkSubImage(rtdIMAGE_INFO *, int&, int&, int&, int&); public: virtual ~RtdRPFile(); // Destructor. // cleanup void cleanup(); void update_count(); // Get the next segment of image data. virtual int getNextImage(rtdShm *) {return 0;} // Get the previous segment of image data. virtual int getPrevImage(rtdShm *) {return 0;} // Add an image segment onto file end. virtual int addImage(rtdIMAGE_INFO *, int, int, int, int, int) {return 0;} // Goto a particular image index in the file. virtual void gotoImageIndex(int index) {fprintf(stderr, "Don't call\n");} // Goto a particular image count in the file. void gotoImageCount(int count); // round off file size static void padFile(FILE* f, int size); // Given an existing file, make and initialise the required file object. static RtdRPFile *makeFileObject(Tcl_Interp* interp, char* instname, char *fileName, char *errMsg); // Get the time increment between this and the next image. double getTimeIncrement(int direction); // Allocate shared memory and semaphores for the image int getShm(int numShm, rtdShm *shmInfo); // Private member access const double fileSize() {return fileSize_;} const int imageCounter() {return imageCounter_;} const int imageIndex() {return imageIndex_;} const int status() {return status_;} Tcl_Interp* interp() {return interp_;} char* instname() {return instname_;} const int hasTimeInfo() {return hasTimeInfo_;} const int bytesPerPixel() {return bytesPerPixel_;} const int xPixels() {return xPixels_;} const int yPixels() {return yPixels_;} const int dataType() {return dataType_;} const int numFileImages() {return numFileImages_;} const double maxFileSize() {return maxFileSize_;} const int fileFull() {return fileFull_;} }; /* * This class defines the above methods for the case where the file is in * the form of a FITS cube. */ class RtdFITSCube : public RtdRPFile { protected: // Size of the FITS header int FITSHeaderSize_; // Write the header at the top of the FITS cube. int writeFITSHeader(const rtdIMAGE_INFO *, int, int, int); int open(char *); public: int getNextImage(rtdShm *); int getPrevImage(rtdShm *); int addImage(rtdIMAGE_INFO *, int, int, int, int, int); void gotoImageIndex(int index); // Constructor - call base class constructor. RtdFITSCube(Tcl_Interp* interp, char* instname, char *fileName, char *accFlag, double maxFileSize) : RtdRPFile(interp, instname, fileName, accFlag, maxFileSize), FITSHeaderSize_(0) {} // Destructor. ~RtdFITSCube(); }; /* * This class defines the above methods for the case where the file is in * the form of a stack of compressed FITS files. * * NB This is not yet implemented - this class template shows how to implement * a record file type by defining the methods below. */ class RtdFITSComp : public RtdRPFile { protected: int open(char*) {return 0;} public: int getNextImage(rtdShm *){return 0;} int getPrevImage(rtdShm *){return 0;} int addImage(rtdIMAGE_INFO *, int, int, int, int, int){return 0;} void gotoImageIndex(int index) {} // Constructor - call base class contructor. RtdFITSComp(Tcl_Interp* interp, char* instname, char *fileName, char *accFlag, double maxFileSize) : RtdRPFile(interp, instname, fileName, accFlag, maxFileSize) {} // Destructor - call base class destructor. ~RtdFITSComp() {} }; #endif skycat-3.1.2-starlink-1b/rtd/generic/RtdRPTool.C000066400000000000000000000767441215713201500213210ustar00rootroot00000000000000/* * E.S.O. - VLT project * * RtdRPTool.C - member routines for class RtdRPTool, RtdRecorder, * and RtdPlayback. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * D.Hopkinson 20/02/97 Created * D.Hopkinson 17/04/97 Added playback and recorder tools, * changed names, added inheritance * P.Biereichel 07/07/97 Adapted for shared library. Code improved * and bugs fixed * pbiereic 28/05/01 Included Allan's changes for tcl8.3.3 */ #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "RtdRPTool.h" static rtdShm shmInfo_; // Structure for managing shm/semaphores // Define the image types for the recorder and playback tools. static Tk_ImageType rtdRecorderType = { (char *)"rtdrecorder", /* name */ RtdRecorder::CreateImage, /* createProc */ RtdRecorder::GetImage, /* getProc */ RtdRecorder::DisplayImage, /* displayProc */ RtdRecorder::FreeImage, /* freeProc */ RtdRecorder::DeleteImage, /* deleteProc */ #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 (Tk_ImagePostscriptProc *) NULL, /* postscriptProc */ #endif (Tk_ImageType *)NULL }; static Tk_ImageType rtdPlaybackType = { (char *)"rtdplayback", RtdPlayback::CreateImage, RtdPlayback::GetImage, RtdPlayback::DisplayImage, RtdPlayback::FreeImage, RtdPlayback::DeleteImage, #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 (Tk_ImagePostscriptProc *) NULL, /* postscriptProc */ #endif (Tk_ImageType *)NULL }; /* * Registers the recorder and playback class types so that they may * be instantiated from the Tcl code. * * Arguments: * Tcl_Interp * interp - pointer to the Tcl interpreter structure * * Return value: * Return value from Tcl_Eval */ extern "C" int RtdrecordInit(Tcl_Interp* interp) { // add the rtdrecorder and rtdplayback image types Tk_CreateImageType(&rtdRecorderType); Tk_CreateImageType(&rtdPlaybackType); // Set the shared memory information structure to NULL memset(&shmInfo_, '\0', sizeof(rtdShm)); return TCL_OK; } /* * These classes are defined as part of the C++/Tcl interface. They * contain a table of Tcl commands, with the addresses of corresponding * C++ methods to call. See the TclCommand man page for more details. */ static class RtdRPToolSubCmds { public: char *name; int (RtdRPTool::*fptr)(int argc, char *argv[]); int min_args; int max_args; } RPsubcmds_[] = { {(char *)"close", &RtdRPTool::close, 0, 0}, {(char *)"cycle", &RtdRPTool::cycle, 1, 1}, {(char *)"filename", &RtdRPTool::filename, 1, 1}, {(char *)"status", &RtdRPTool::status, 0, 0}, // Declared inline in header }; static class RtdRecorderSubCmds { public: char *name; int (RtdRecorder::*fptr)(int argc, char *argv[]); int min_args; int max_args; } Recsubcmds_[] = { {(char *)"camera", &RtdRecorder::camera, 1, 1}, {(char *)"file", &RtdRecorder::file, 2, 2}, {(char *)"record", &RtdRecorder::record, 0, 0}, {(char *)"stop", &RtdRecorder::stop, 0, 0}, {(char *)"subimage", &RtdRecorder::subimage, 1, 5} }; static class RtdPlaybackSubCmds { public: char *name; int (RtdPlayback::*fptr)(int argc, char *argv[]); int min_args; int max_args; } Playsubcmds_[] = { {(char *)"close", &RtdPlayback::close, 0, 0}, {(char *)"filename", &RtdPlayback::filename, 1, 1}, {(char *)"gotoimage", &RtdPlayback::gotoimage, 1, 1}, {(char *)"play", &RtdPlayback::play, 0, 0}, {(char *)"props", &RtdPlayback::props, 2, 2}, {(char *)"hastime", &RtdPlayback::hastime, 0, 0}, {(char *)"reset", &RtdPlayback::reset, 0, 0}, {(char *)"spool", &RtdPlayback::spool, 1, 1}, {(char *)"step", &RtdPlayback::step, 0, 0}, {(char *)"stop", &RtdPlayback::stop, 0, 0} }; /* * Recorder/playback tool object constructor. This does basic * initialisation, and also registers the process with the server daemon. * * Arguments: * Tcl_Interp *interp - pointer to the Tcl interpreter structure * char *instname - the instance name of the itk widget * int arg, char **argv - argument list, unused * Tk_ImageMaster - Tk master */ RtdRPTool::RtdRPTool(Tcl_Interp* interp, char* instname, int argc, char** argv, Tk_ImageMaster master) : TclCommand(interp, instname, instname), eventHndl_(NULL), status_(TCL_OK), cycleMode_(1), fileHandler((RtdRPFile *)NULL), master_(master), tkwin_(Tk_MainWindow(interp)), display(Tk_Display(Tk_MainWindow(interp))) { status_ = RtdRPTool::init(); } /* * Recorder object destructor. */ RtdRPTool::~RtdRPTool() { cleanup(); } /* * init routine: if necessary register to rtdServer */ int RtdRPTool::init() { if (eventHndl_ == NULL) { eventHndl_ = new rtdIMAGE_EVT_HNDL; /* register to rtdServer */ if (rtdInitImageEvt("RTDRPTOOL", eventHndl_, NULL) != RTD_OK) { delete eventHndl_; eventHndl_ = NULL; return TCL_ERROR; } } return TCL_OK; } /* * Overridden TclCommand method for interfacing the C++ with the Tcl code. * This method cycles over the RtdRPToolSubCmds to search for the method * to call. If no method is found (which it should be) control is passed to * the baseclass method). * * Arguments: * const char *name - name of the subcommand to call * int len - length of the subcommand name * int argc, char **argv - argument list for subcommand * * Return value: * Return value from subcommand. */ int RtdRPTool::call(const char *name, int len, int argc, char *argv[]) { for (int i = 0; i < sizeof(RPsubcmds_)/sizeof(*RPsubcmds_); i++) { RtdRPToolSubCmds *t = &RPsubcmds_[i]; if (strcmp(t->name, name) == 0) { if (check_args(name, argc, t->min_args, t->max_args) != TCL_OK) { return TCL_ERROR; } return (this->*t->fptr)(argc, argv); } } return TclCommand::call(name, strlen(name), argc, argv); } /* * Toggle the cycle mode on or off. If cycle is on, then the playback/recorder * object will return to the start of the file when the file is full/completed. * * Usage: * $rtdrecorder/$rtdplayback cycle <1/0> * * Arguments: * int argc, char *argv[] - argument list, * argv[0] - 0,1 (value for cycleMode_) * * Return value: * TCL_OK / TCL_ERROR */ int RtdRPTool::cycle(int argc, char *argv[]) { // Just copy argument into cycleMode_ cycleMode_ = atoi(argv[0]); if (cycleMode_ < 0) { return error("Bad argument for cycle subcommand"); } return TCL_OK; } /* * Close the dialogue. Call the cleanup function. * * Arguments: * int argc, char *argv[] - argument list, unused * * Return value: * TCL_OK */ int RtdRPTool::close(int argc, char *argv[]) { cleanup(); return TCL_OK; } /* * Set the current file name. * * Usage: * $rtdrecorder/$rtdplayback filename * * Arguments: * int argc, char *argv[] - argument list: * argv[0] - file name * * Return value: * TCL_OK */ int RtdRPTool::filename(int argc, char *argv[]) { // Copy across the file name. strncpy(fileName, argv[0], MAXFILENAMELEN); return TCL_OK; } /* * This is invoked when the dialogue is quit, and does basic memory management, * and deinitialises the server. * * Arguments: * None */ void RtdRPTool::cleanup() { // Remove any open file handler objects. if (fileHandler) { delete(fileHandler); fileHandler = (RtdRPFile *)NULL; Mem_RPTcleanup(); } // Remove the event handle. if (eventHndl_) { rtdClose(eventHndl_, NULL); delete(eventHndl_); eventHndl_ = NULL; } } /* - End of RtdRPTool method definitions - */ /*===========================================================================*/ /* - Start of RtdRecorder method definitions - */ /* * This is called when the recorder object is instantiated from the Tcl code. * This simply creates an RtdRecorder object instance. * * Arguments: * Tcl_Interp *interp - pointer to interpreter structure * char *name - instance name * int argc, char *argv[] - argument list, unused * Tk_ImageType *typePtr - Tk image type * Tk_ImageMaster - Tk image master * ClientData *clientDataPtr - client data * * For more information, see Tk_CreateImageType(3). * * Return value: * TCL_OK */ int RtdRecorder::CreateImage( Tcl_Interp *interp, // Interpreter for application containing image. char *name, // Name to use for image. int argc, // Number of arguments. #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 Tcl_Obj *CONST objv[], // Argument objects for options #else char **argv, // Argument strings for options #endif Tk_ImageType *typePtr, // Pointer to our type record (not used). Tk_ImageMaster master, ClientData *clientDataPtr) { #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 // just generate an argv from the objv argument char* argv[64]; // there shouldn't be more than a few options... for(int i = 0; i < argc; i++) argv[i] = Tcl_GetString(objv[i]); argv[argc] = NULL; #endif RtdRecorder *im = new RtdRecorder(interp, name, argc, argv, master); return TCL_OK; } /* * RtdRecorder contructor. Initialises the recorder properties. * * Arguments: * As for RtdRPTool - arguments are just passed on to baseclass. */ RtdRecorder::RtdRecorder(Tcl_Interp *interp, char *instname, int argc, char **argv, Tk_ImageMaster master) : RtdRPTool(interp, instname, argc, argv, master), fileFormat_(FITS_CUBE), fileSize_(MAXFILESIZE), attached_(0), subImage_(0), x0_(0), y0_(0), width_(0), height_(0) { // Default camera name is RTDSIMULATOR. strcpy(camera_, "RTDSIMULATOR"); } /* * Callback routine, invoked when the socket connection to the server becomes * readable (i.e. an image has been received). * * Arguments: * ClientData clientData - client data from the callback * int mask - Tcl/Tk mask * * Return value: * None. */ void RtdRecorder::fileEventProc(ClientData clientData, int mask) { // Call a processing routine. RtdRecorder* thisPtr = (RtdRecorder *)clientData; thisPtr->processFileEvent(); } /* * Routine to process the incoming file events. Called from the callback * routine: fileEventProc. If the cycleMode is off then this routine also * stops the data acquisition immediately if the maximum file size is * exceeded. * * Arguments: * None. * * Return value: * None. */ int RtdRecorder::processFileEvent() { rtdIMAGE_INFO imageInfo; if (RtdRPTool::init() == TCL_ERROR) return TCL_ERROR; // Get the image information that is waiting. if (rtdRecvImageInfo(eventHndl_, &imageInfo, 0, NULL) == RTD_ERROR) return TCL_ERROR; // Pass control to the image processor. fileHandler->addImage(&imageInfo, subImage_, x0_, y0_, width_, height_); // Service the semaphore contained in the image information. rtdShmServicePacket(&imageInfo); /* * If the file size has exceeded the maximum, then we want to stop * here. Call the stop routine. */ if (fileHandler->fileSize() > fileSize_ && !cycleMode_) { fprintf(stderr, "Full up!\n"); stop(0, NULL); } if (fileHandler->fileFull() && !cycleMode_) { stop(0, NULL); } return TCL_OK; } /* * Overridden TclCommand method for interfacing the C++ with the Tcl code. * This method cycles over the RtdRPToolSubCmds to search for the method * to call. If no method is found (which it should be) control is passed to * the baseclass method). * * Arguments: * const char *name - name of the subcommand to call * int len - length of the subcommand name * int argc, char **argv - argument list for subcommand * * Return value: * Return value from subcommand. */ int RtdRecorder::call(const char *name, int len, int argc, char *argv[]) { for (int i = 0; i < sizeof(Recsubcmds_)/sizeof(*Recsubcmds_); i++) { RtdRecorderSubCmds *t = &Recsubcmds_[i]; if (strcmp(t->name, name) == 0) { if (check_args(name, argc, t->min_args, t->max_args) != TCL_OK) { return TCL_ERROR; } return (this->*t->fptr)(argc, argv); } } return RtdRPTool::call(name, strlen(name), argc, argv); } /* * Method to set image recording going. * * Usage: * $rtdrecorder record * * Arguments: * int argc, char *argv[] - argument list * * Return value: * TCL_OK / TCL_ERROR */ int RtdRecorder::record(int argc, char *argv[]) { char msg[64]; // User error message if (RtdRPTool::init() == TCL_ERROR) return TCL_ERROR; if (!fileFormat_) { fprintf(stderr, "FileFormat object is NULL\n"); } // Set up an object to control the file handling. File will be opened // after the first image event. if (fileFormat_ == COMP_FITS) { fileHandler = (RtdFITSComp *)new RtdFITSComp(interp_, instname_, fileName, (char *)"\0", fileSize_); } else if (fileFormat_ == FITS_CUBE) { fileHandler = (RtdFITSCube *)new RtdFITSCube(interp_, instname_, fileName, (char *)"\0", fileSize_); } else { return error("Unknown file format specified"); } if (fileHandler->status() == TCL_ERROR) { sprintf(msg, "Unable to open file %s", fileName); return error(msg); } // Attach to the current camera to start receiving images, if not already. if (!attached_) { if (rtdAttachImageEvt(eventHndl_, camera_, NULL) != RTD_OK) { return error("Error attaching camera to server"); } } attached_ = 1; // Set up a file handler to detect the incoming image events. Tk_CreateFileHandler(eventHndl_->socket, TK_READABLE, fileEventProc, (ClientData)this); return TCL_OK; } /* * Stop method for the recorder tool. This detaches from the camera, closes * the file handler object, and removes the Tk file handler. * * Usage: * $rtdrecorder/$rtdplayback stop * * Arguments: * int argc, char *argv[] - argument list, unused * * Return value: * TCL_OK */ int RtdRecorder::stop(int argc, char *argv[]) { rtdIMAGE_INFO imageInfo; // Temp image information structure if (RtdRPTool::init() == TCL_ERROR) return TCL_ERROR; // Detach from the camera. if (attached_) { // Delete the Tk file handler. Tk_DeleteFileHandler(eventHndl_->socket); attached_ = 0; rtdDetachImageEvt(eventHndl_, camera_, NULL); // Get any outstanding images from the queue and process their semaphores. if (rtdRecvImageInfo(eventHndl_, &imageInfo, 0, NULL) != RTD_ERROR) { rtdShmServicePacket(&imageInfo); } } // Delete the file handling object. if (fileHandler) { delete(fileHandler); fileHandler = (RtdRPFile *)NULL; Mem_RPTcleanup(); } return TCL_OK; } /* * Method to set the current maximum file size or the file format type * in the recorder. * * Usage: * $rtdrecorder file size * $rtdrecorder file format * where is the maximum file size in Mb and is 0 for * compressed FITS, 1 for FITS cube. * * Arguments: * int argc, char *argv[] - argument list: * argv[0] - size/format * argv[1] - argument to argv[0] * * Return value: * TCL_OK / TCL_ERROR */ int RtdRecorder::file(int argc, char *argv[]) { if (strcmp(argv[0], "size") == 0) { fileSize_ = atof(argv[1]); } else if (strcmp(argv[0], "format") == 0) { fileFormat_ = (enum fileFormat)atoi(argv[1]); } else { return error("Bad argument for $rtdrecorder file"); } return TCL_OK; } /* * Method to set the current camera. * * Usage: * $rtdrecorder camera * where is the camera name to receive images from. * * Arguments: * int argc, char *argv[] - argument list * argv[0] - camera name * * Return value: * TCL_OK */ int RtdRecorder::camera(int argc, char *argv[]) { strncpy(camera_, argv[0], 32); return TCL_OK; } /* * Method to set the subimage facility of the recorder tool. * * Usage: * $rtdrecorder subimage ?x? ?y? ?width? ?height? * where is set to 'on' if the subimage sampling is to be turned on, * and 'off' if turned off. x, y, width, and height are specified if the * facility is being turned on. Note that (x,y) are image coordinates of * the top left corner - FITS data is written from the bottom left and * so the y coordinate must be transformed in this routine. * * Arguments: * int argc, char *argv, argument list, see above. * * Return value: * TCL_OK / TCL_ERROR */ int RtdRecorder::subimage(int argc, char *argv[]) { // Check the first argument. if (strcmp(argv[0], "on") == 0) { subImage_ = 1; } else if (strcmp(argv[0], "off") == 0) { subImage_ = 0; return TCL_OK; } else { return error("Bad first argument to subimage subcommand"); } // Get the subsequent arguments for when the sampling is enabled. x0_ = atoi(argv[1]); y0_ = atoi(argv[2]); width_ = atoi(argv[3]); height_ = atoi(argv[4]); y0_ -= height_; return TCL_OK; } /* - End of RtdRecorder method definitions - */ /*===========================================================================*/ /* - Start of RtdPlayback method definitions - */ /* * This is called when the playback object is instantiated from the Tcl code. * This simply creates an RtdPlayback object instance. * * Arguments: * Tcl_Interp *interp - pointer to interpreter structure * char *name - instance name * int argc, char *argv[] - argument list, unused * Tk_ImageType *typePtr - Tk image type * Tk_ImageMaster - Tk image master * ClientData *clientDataPtr - client data * * For more information, see Tk_CreateImageType(3). * * Return value: * TCL_OK */ int RtdPlayback::CreateImage( Tcl_Interp *interp, // Interpreter for application containing image. char *name, // Name to use for image. int argc, // Number of arguments. #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 Tcl_Obj *CONST objv[], // Argument objects for options (not including image name or type) #else char **argv, // Argument strings for options (not including image name or type) #endif Tk_ImageType *typePtr, // Pointer to our type record (not used). Tk_ImageMaster master, ClientData *clientDataPtr) { #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 // just generate an argv from the objv argument char* argv[64]; // there shouldn't be more than a few options... for(int i = 0; i < argc; i++) argv[i] = Tcl_GetString(objv[i]); argv[argc] = NULL; #endif RtdPlayback *im = new RtdPlayback(interp, name, argc, argv, master); return TCL_OK; } /* * RtdRecorder contructor. Initialises the recorder properties. * * Arguments: * As for RtdRPTool - arguments are just passed on to baseclass. */ RtdPlayback::RtdPlayback(Tcl_Interp *interp, char *instname, int argc, char **argv, Tk_ImageMaster master) : RtdRPTool(interp, instname, argc, argv, master), direction_(1), playSpeed_(SPEED_SLOW), timer_((Tcl_TimerToken)-1), spool_(0) {} /* * Method to create a file handler from an existing file. This method calls * the makeFileObject static method of the RtdRPFile class to create the * file handler from the file name, and initialises the file pointer and * image counter appropriately. * * Arguments: * char *err - error message to return to caller * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::makeFileHandler(char *err) { // First create the right type of file object for the file name. fileHandler = RtdRPFile::makeFileObject(interp_, instname_, fileName, err); // Test that the file object has been created successfully. if (fileHandler == NULL) { return TCL_ERROR; } if (fileHandler->status() == TCL_ERROR) { sprintf(err, "Unable to read file for playback"); return TCL_ERROR; } // Create the shared memory areas from the file information if (fileHandler->getShm(RTD_SHMBUFFS, &shmInfo_) == TCL_ERROR) { sprintf(err, "Unable to allocate shared memory"); return TCL_ERROR; } return TCL_OK; } /* * This method adds a timeout callback to reinvoke to send image routines * after a certain time. The timeout interval is governed by the setting * chosen by the user. * * Arguments: * None * * Return value: * None */ void RtdPlayback::makeTimeOut() { double timePeriod; // Time interval in msecs. // Determine time interval based on user requirements. switch(playSpeed_) { case SPEED_SLOW: timePeriod = SLOWSPEED; break; case SPEED_FAST: timePeriod = FASTSPEED; break; case SPEED_RT: // In this case, the period reflects the timestamp data recorded // when the images were recorded. timePeriod = fileHandler->getTimeIncrement(direction_); break; default: // Unknown speed type. fprintf(stderr, "Error: unknown replay speed type"); timePeriod = SLOWSPEED; break; } // Invoke callback. timer_ = Tcl_CreateTimerHandler((int)timePeriod, sendEventProc, this); } /* * Static method called from the timer callback for sending images to the * server daemon. This just passes control to the main send routine, * sendImage(). * * Arguments: * ClientData - Tcl/Tk client data. * * Return value: * None. */ void RtdPlayback::sendEventProc(ClientData clientData) { RtdPlayback *thisPtr = (RtdPlayback *)clientData; thisPtr->sendImage(1); } /* * Protected method to retrieve image data from the file handler and send * it to the RTD server daemon. * * Arguments: * int reinvoke - if true, this sets up a timeout to reinvoke the routine * after the user defined time period. * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::sendImage(int reinvoke) { int index; // Index of shm buffer filled with data. if (RtdRPTool::init() == TCL_ERROR) return TCL_ERROR; // Before doing anything, check if we have reached the end of the file // and we want to stop here. if (!cycleMode_) { if (direction_ && (fileHandler->imageCounter() == fileHandler->numFileImages()) || (!direction_ && fileHandler->imageCounter() == 1)) { if (fileHandler->numFileImages() > 1) { fileHandler->update_count(); return TCL_OK; } else reinvoke = 0; } } // Get the image data into a shared memory buffer. if (direction_) { index = fileHandler->getNextImage(&shmInfo_); } else { index = fileHandler->getPrevImage(&shmInfo_); } if (index == -1) { return TCL_OK; // maybe shm is locked } rtdIMAGE_INFO imageInfo; // Image information for send. // Create a image information structure. memset(&imageInfo, '\0', sizeof(rtdIMAGE_INFO)); imageInfo.frameX = 0; imageInfo.frameY = 0; imageInfo.frameId = 0; imageInfo.xPixels = fileHandler->xPixels(); imageInfo.yPixels = fileHandler->yPixels(); imageInfo.dataType = fileHandler->dataType(); // Fill in the remaining fields. rtdShmStruct(index, &imageInfo, &shmInfo_); // Send the shared memory off. if (rtdSendImageInfo(eventHndl_, &imageInfo, NULL) != RTD_OK) return TCL_ERROR;; // Add a timeout callback to reinvoke this routine, if required. if (reinvoke) { makeTimeOut(); } return TCL_OK; } /* * Overridden TclCommand method for interfacing the C++ with the Tcl code. * This method cycles over the RtdRPToolSubCmds to search for the method * to call. If no method is found (which it should be) control is passed to * the baseclass method). * * Arguments: * const char *name - name of the subcommand to call * int len - length of the subcommand name * int argc, char **argv - argument list for subcommand * * Return value: * Return value from subcommand. */ int RtdPlayback::call(const char *name, int len, int argc, char *argv[]) { for (int i = 0; i < sizeof(Playsubcmds_) / sizeof(*Playsubcmds_); i++) { RtdPlaybackSubCmds *t = &Playsubcmds_[i]; if (strcmp(t->name, name) == 0) { if (check_args(name, argc, t->min_args, t->max_args) != TCL_OK) { return TCL_ERROR; } return (this->*t->fptr)(argc, argv); } } return RtdRPTool::call(name, strlen(name), argc, argv); } /* * Playback fast forward or reverse functions. We must ensure that we have a * fileHandler instance created before we start fast-forwarding, as we need * to know the size of the file, etc. * * Usage: * $rtdplayback spool * where is "ff" or "rewind" * * Arguments: * int argc, char *argv[] - argument list, see above * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::spool(int argc, char *argv[]) { char errMsg[64]; // Return error message. if (RtdRPTool::init() == TCL_ERROR) return TCL_ERROR; // Check that we have a file handler if (!fileHandler) { if (makeFileHandler(&errMsg[0]) != TCL_OK) { return error(&errMsg[0]); } } if (strcmp(argv[0], "rewind") == 0) { stop(0, NULL); fileHandler->gotoImageCount(1); if (sendImage(0) == TCL_ERROR) return error("Error sending initial image data segment"); return TCL_OK; } else if (strcmp(argv[0], "ff") != 0) { return error("Bad argument for spool command"); } if (spool_) return TCL_OK; // Flag that we are now doing a spool spool_ = 1; playSpeed_ = SPEED_FAST; if (sendImage(1) == TCL_ERROR) { return error("Error sending initial image data segment"); } return TCL_OK; } /* * Playback play function. We must ensure that we have a fileHandler object * instance created before starting. * * Usage: * $rtdplayback play * * Arguments: * int argc, char *argv[] - argument list, unused * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::play(int argc, char *argv[]) { char errMsg[64]; // Error message buffer if (RtdRPTool::init() == TCL_ERROR) return TCL_ERROR; if (!fileHandler) { if (makeFileHandler(&errMsg[0]) != TCL_OK) { return error(&errMsg[0]); } } // If we have no timestamp information, we can't playback in real-time. if (!fileHandler->hasTimeInfo() && playSpeed_ == SPEED_RT) { playSpeed_ = SPEED_SLOW; } if (sendImage(1) == TCL_ERROR) { return error("Error sending initial image data segment"); } return TCL_OK; } /* * Reset the playback tool - close the file handler. * * Usage: * $rtdplayback reset * * Arguments: * int argc, char *argv[] - argument list, unused * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::reset(int argc, char *argv[]) { // Remove the file handler. if (fileHandler) { delete(fileHandler); fileHandler = (RtdRPFile *)NULL; Mem_RPTcleanup(); } return TCL_OK; } /* * Set the playback object properties, i.e. playback direction, speed. * * Usage: * $rtdplayback props speed * $rtdplayback props direction * where is the speed number as specified in the enum defined in * the header file, and is 1 for forwards, 0 for reverse. * * Arguments: * int argc, char *argv[] - argument list, see above * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::props(int argc, char *argv[]) { // XXX allan: 10.4.98: increased size of errMsg from 64, // XXX Memory is not that expensive these days, and it avoids crashing... char errMsg[2*1024]; // Error message buffer int direction, count, incr = 0; // Check that we have a file handler if (!fileHandler) { if (makeFileHandler(&errMsg[0]) != TCL_OK) { return error(&errMsg[0]); } } if (strcmp(argv[0], "speed") == 0) { playSpeed_ = (enum playSpeed)atoi(argv[1]); } else if (strcmp(argv[0], "direction") == 0) { direction = atoi(argv[1]); if (direction) { direction = 1; incr = 1; } // after changing the direction goto the right file position if (direction != direction_) { count = incr + fileHandler->imageCounter(); fileHandler->gotoImageCount(count); } direction_ = direction; } else { return error("Bad argument for setprop command"); } return TCL_OK; } /* * Step the current playback image one frame in the current direction. If the * filehandler is not yet initialised, do this first. * * This routine is virtually identical to the play method, but is kept * distinct for simplicity. * * Usage: * $rtdplayback step * * Arguments: * int argc, char *argv[] - argument list, unused * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::step(int argc, char *argv[]) { char errMsg[64]; // Error message buffer if (RtdRPTool::init() == TCL_ERROR) return TCL_ERROR; if (!fileHandler) { if (makeFileHandler(&errMsg[0]) != TCL_OK) { return error(&errMsg[0]); } } // Send an image to the server without reinvoking the send routine after // a timeout. if (sendImage(0) == TCL_ERROR) { return error("Error sending initial image data segment"); } return TCL_OK; } /* * Change the filename of the playback object. * * Usage: * $rtdplayback filename * * Arguments: * int argc, char *argv[] - argument list, * argv[0] - file name * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::filename(int argc, char *argv[]) { /* * Check to see if the file name has changed. If it has, then we want * to remove the current file handler and create a new one when this is * required. If the file name is the same, then nothing has changed so * we call the baseclass method alone. */ if (strcmp(argv[0], fileName) != 0) { if (fileHandler) { delete(fileHandler); fileHandler = (RtdRPFile *)NULL; // Remove the shared memory areas associated with this Mem_RPTcleanup(); } } // Baseclass method. return(RtdRPTool::filename(argc, argv)); } /* * Stop the current playback. * * Usage: * $rtdplayback stop * * Arguments: * int argc, char *argv[] - argument list, not used * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::stop(int argc, char *argv[]) { // If we are stopping a spool, then reset the spool_ flag spool_ = 0; // Remove the timer callback (if it exists) to prevent any more pictures // being displayed. Tcl_DeleteTimerHandler(timer_); timer_ = (Tcl_TimerToken)-1; return TCL_OK; } /* * Close the playback object. * * Usage: * $rtdplayback close * * Arguments: * int argc, char *argv[] - argument list * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::close(int argc, char *argv[]) { // Call the baseclass destructor. RtdRPTool::cleanup(); // Remove the shared memory/semaphore set. Mem_RPTcleanup(); return TCL_OK; } /* * Return whether or not the file has timestamp information (for real-time * playback). * * Usage: * $rtdplayback hastime * * Arguments: * int argc, char *argv[] - argument list * * Return value: * 0 (file not timestamped), 1 (file timestamped). */ int RtdPlayback::hastime(int argc, char *argv[]) { char buf[2]; // Return buffer // Check file handler exists. if (!fileHandler) { return error("File handler is not instantiated"); } // Return the result. sprintf(buf, "%d", fileHandler->hasTimeInfo()); return set_result(buf); } /* * Goto to the image index specified by the argument. * * Usage: * $rtdplayback gotoimage * * Arguments: * int argc, char *argv[] - argument list * - argv[0] - index of image to go to. * * Return value: * TCL_OK / TCL_ERROR */ int RtdPlayback::gotoimage(int argc, char *argv[]) { int index; // Image index to go to. // Check that there is a file handler. if (!fileHandler) { return TCL_OK; } // Check that the image index is in the right range. index = atoi(argv[0]); if (index < 0) { return error("Chosen index is out of range"); } // Go to the appropriate index fileHandler->gotoImageCount(index); return TCL_OK; } void Mem_RPTcleanup() { // Remove the shared memory/semaphore set. rtdShmDelete(&shmInfo_); } skycat-3.1.2-starlink-1b/rtd/generic/RtdRPTool.h000066400000000000000000000154541215713201500213550ustar00rootroot00000000000000#ifndef RTDRPTOOL_H #define RTDRPTOOL_H /* * E.S.O. - VLT project / ESO Archive * * RtdRPTool.h - class definitions for class RtdRPTool, RtdRecorder, * and RtdPlayback. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * D.Hopkinson 20/02/97 Created * D.Hopkinson 17/04/97 Changed name to RtdRPTool and added * inheritance from this. * pbiereic 28/05/01 Included Allan's changes for tcl8.3.3 */ #include #include #include #include "TclCommand.h" #include "Mem.h" #include "rtdImageEvent.h" #include "tk.h" #include "Fits_IO.h" #include "DCompress.h" #include "rtdSem.h" #include "RtdRPFile.h" #define MAXRECORDS 60 // Maximum number of records in file. #define MAXFILENAMELEN 1024 // Maximum length of file names. (allan: changed from 128) #define MAXFILESIZE 5 // Maximum size of data file in Mb. #define SLOWSPEED 4000. // Time between images when playing slow (in msec) #define FASTSPEED 200. // Time between sends when playing fast (in msec) /* * This is an abstract class that simply acts as the parent of the recorder * and playback objects. It contains the various common properties, and also * carries the definitions for the more abstract Tcl commands executed from * the recorder tool. */ class RtdRPTool : public TclCommand { protected: char fileName[MAXFILENAMELEN]; // Filename to load images into. rtdIMAGE_EVT_HNDL *eventHndl_; // Event handle for server connection. Display *display; // Server connection. Tk_ImageMaster master_; // Tk master. Tk_Window tkwin_; // Tk window. int status_; // Object status int cycleMode_; // Flag: cycle round to start of file. RtdRPFile *fileHandler; // Pointer to file handler object. // Constructor. RtdRPTool(Tcl_Interp* interp, char* instname, int argc, char** argv, Tk_ImageMaster master); // Cleanup routine void cleanup(); public: // Destructor. ~RtdRPTool(); // Overridden subcommand calling method. virtual int call(const char *name, int len, int argc, char *argv[]); // Subcommand definition methods. int close(int argc, char *argv[]); int init(); virtual int filename(int argc, char *argv[]); int cycle(int argc, char *argv[]); int status(int argc, char *argv[]) {return status_;} }; /* * Class definition for the recorder object. This is derived from the general * properties of the RtdRPTool object. */ class RtdRecorder : public RtdRPTool { protected: char camera_[32]; // Camera to attach to. double fileSize_; // Maximum allowed size of saved file. int attached_; // Flag: currently attached to camera. enum fileFormat { COMP_FITS, // Compressed FITS - not implemented FITS_CUBE // FITS cube } fileFormat_; // Format to use in file save. int subImage_; // Flag true if using subimage int x0_, y0_; // Bottom left coords of subimage int width_, height_; // Dimensions of subimage // Function called when image event received by recorder. static void fileEventProc(ClientData clientData, int mask); // Routine to process the incoming image event. int processFileEvent(); public: // Constructor RtdRecorder(Tcl_Interp *interp, char *instname, int argc, char **argv, Tk_ImageMaster master); // Destructor ~RtdRecorder() {} // currently empty // Action routines defined in the Tk_ImageType structure. Most of these // are no-ops. static int CreateImage(Tcl_Interp*, char *name, int argc, #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 Tcl_Obj *CONST objv[], #else char **argv, #endif Tk_ImageType*, Tk_ImageMaster, ClientData*); static ClientData GetImage(Tk_Window, ClientData) {return 0;} static void DisplayImage(ClientData, Display*, Drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY) {} static void FreeImage(ClientData, Display*) {} static void DeleteImage(ClientData) {} // Subcommand calling method. int call(const char *name, int len, int argc, char *argv[]); // Subcommand definitions int record(int argc, char *argv[]); int camera(int argc, char *argv[]); int file(int argc, char *argv[]); int stop(int argc, char *argv[]); int subimage(int argc, char *argv[]); }; /* * Class definition for the playback object. This is derived from the general * properties of the RtdRPTool object. */ class RtdPlayback : public RtdRPTool { protected: int direction_; // Flag: true if playing forwards enum playSpeed { SPEED_SLOW, SPEED_FAST, SPEED_RT } playSpeed_; // Playback speed Tcl_TimerToken timer_; // Timer handler for managing the timer callback int spool_; // Flag: we are doing a fast-forward/rewind. // Called from timer callback. static void sendEventProc(ClientData clientData); // Retrieve data from file and send to rtdServer daemon. int sendImage(int reinvoke); // Add a timeout to send the next image. void makeTimeOut(); // Method to make a file handler object instance from an existing file int makeFileHandler(char *err); // Utility to provide a short time interval for the spool increments void spoolPause(); public: // Constructor RtdPlayback(Tcl_Interp *interp, char *instname, int argc, char **argv, Tk_ImageMaster master); // Destructor ~RtdPlayback() {} // currently empty // Action routines defined in the Tk_ImageType structure. Most of these // are no-ops at the moment. static int CreateImage(Tcl_Interp*, char *name, int argc, #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 3 Tcl_Obj *CONST objv[], #else char **argv, #endif Tk_ImageType*, Tk_ImageMaster, ClientData*); static ClientData GetImage(Tk_Window, ClientData) {return 0;} static void DisplayImage(ClientData, Display*, Drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY) {} static void FreeImage(ClientData, Display*) {} static void DeleteImage(ClientData) {} // Subcommand calling method. int call(const char *name, int len, int argc, char *argv[]); // Subcommand definitions int close(int argc, char *argv[]); int filename(int argc, char *argv[]); int gotoimage(int argc, char *argv[]); int hastime(int argc, char *argv[]); int play(int argc, char *argv[]); int reset(int argc, char *argv[]); int spool(int argc, char *argv[]); int props(int argc, char *argv[]); int step(int argc, char *argv[]); int stop(int argc, char *argv[]); }; // cleanup shared mem void Mem_RPTcleanup(); #endif skycat-3.1.2-starlink-1b/rtd/generic/RtdRemote.C000066400000000000000000000304621215713201500213600ustar00rootroot00000000000000/* * E.S.O. - VLT project/ESO Archive * "@(#) $Id: RtdRemote.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdRemote.C - member routines for class RtdRemote, manages remote access * to RtdImage (server side, see ../../rtdrmt/... for client access) * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 04/03/96 Created * Peter W. Draper 13/03/98 Now stores Tcl_File handle. This is to * work around a bug in OSF/1 Tcl which * loses this values occasionally. * Allan Brighton 18/03/99 Added #ifdef in RtdRemote.h, since Tcl_File * is no longer supported in tcl8... * Peter W. Draper 11/05/99 Added changes to getsockname calls so * that size_t or int are used for addrSize (this * is needed for OSF/1). * 16/12/05 Change all SOCKLEN_T use to socklen_t. The logic * that guarantees a value is set in define.h. */ static const char* const rcsId="@(#) $Id: RtdRemote.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "error.h" #include "define.h" #ifdef HAVE_SYS_FILIO_H #include #endif #include "RtdRemote.h" // this call changed in tcl8 #if (TCL_MAJOR_VERSION >= 8) #define RTD_TCL_GETFILE_(x) x #else #define RTD_TCL_GETFILE_(x) Tcl_GetFile((void *)x, TCL_UNIX_FD) #endif // should be in sys/shm.h #ifdef NEED_SHM_PROTO /*extern "C" void *shmat(int shmid, const void* shmaddr, int shmflg); extern "C" int shmdt(const void* shmaddr);*/ #endif #ifdef NEED_SOCKET_PROTO // some protos missing in SunOS extern "C" { int socket(int, int, int); int connect(int, const void*, int); int strncasecmp(char*, char*, int); int bind(int s, struct sockaddr *name, int namelen); int listen(int s, int backlog); int ioctl(int fd, int request, void* arg); int select (int width, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, timeval *timeout); int accept(int s, sockaddr *addr, int *addrlen); void bzero(char *b, int length); getsockname(int s, struct sockaddr *name, int *namelen); } #endif /* NEED_SOCKET_PROTO */ #if 0 #ifdef NEED_GETHOSTNAME_PROTO // these are also missing on solaris extern "C" int gethostname(char *name, unsigned int namelen); #endif /* NEED_GETHOSTNAME_PROTO */ #endif /* -- I/O routines for network I/O taken from the book -- * "UNIX Network Programming" by W. Richard Stevens, */ /* * Read "n" bytes from a descriptor. * Use in place of read() when fd is a stream socket. */ static int readn(int fd, char* ptr, int nbytes) { int nleft, nread; nleft = nbytes; while (nleft > 0) { nread = read(fd, ptr, nleft); if (nread < 0) return(nread); /* error, return < 0 */ else if (nread == 0) break; /* EOF */ nleft -= nread; ptr += nread; } return(nbytes - nleft); /* return >= 0 */ } /* * Read the line one byte at a time, looking for the newline. We store * the newline in the buffer, then follow it with a null (the same as * fgets(3)). Not very efficient but usefull for sockets. * * Returns the number of characters up to, but not including, the null * (the same as strlen(3)) or < 0 upon errors. */ static int readline(int fd, char* ptr, int maxlen) { int n, rc; char c; for (n = 1; n < maxlen; n++) { if ( (rc = read(fd, &c, 1)) == 1) { *ptr++ = c; if (c == '\n') break; } else if (rc == 0) { if (n == 1) return(0); // EOF, no data read else break; // EOF, some data was read } else return(-1); // error } *ptr = 0; return(n); } /* * Write "n" bytes to a descriptor. * Use in place of write() when fd is a stream socket. */ static int writen(int fd, const char* ptr, unsigned long nbytes) { int nleft, nwritten; nleft = nbytes; while (nleft > 0) { nwritten = write(fd, ptr, nleft); if (nwritten <= 0) return(nwritten); /* error */ nleft -= nwritten; ptr += nwritten; } return(nbytes - nleft); } /* * write the given buffer to the given file followed by a newline */ static int writeline(int fd, char* ptr) { return writen(fd, ptr, strlen(ptr)) + writen(fd, "\n", 1); } /* * constructor */ RtdRemote::RtdRemote(Tcl_Interp* interp, int port, int verbose) : status_(0), socket_(-1), interp_(interp), verbose_(verbose), clientPtr_(NULL) { // clear out client table memset ((char *)&clients_, 0, sizeof(clients_)); // clear out address structures sockaddr_in addr; // for local socket address socklen_t addrSize = (socklen_t) sizeof(addr); memset ((char *)&addr, 0, addrSize); addr.sin_family = AF_INET; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_port = htons( port ); // Create the listen socket. socket_ = socket (AF_INET, SOCK_STREAM, 0); if (socket_ == -1) { status_ = sys_error("socket"); return; } // Bind the listen address to the socket. if (bind(socket_, (struct sockaddr *)&addr, addrSize) == -1) { status_ = sys_error("bind"); return; } // note port and host info in a file for client use if ((status_ = makeStatusFile(addr)) != 0) return; // note the port number port_ = ntohs( addr.sin_port ); #ifdef DEBUG if (verbose_) printf("RtdRemote: using port number %d\n", port_); #endif // Initiate the listen on the socket so remote users // can connect. The listen backlog is set to 5. 20 // is the currently supported maximum. if (listen(socket_, 5) == -1) { status_ = sys_error("listen"); return; } Tcl_CreateFileHandler(RTD_TCL_GETFILE_(socket_), TCL_READABLE, fileEventProc, (ClientData)this); } /* * destructor */ RtdRemote::~RtdRemote() { } /* * create a file $HOME/.rtd-remote containing these values: * * pid hostname port * * so that the client library can determine how to access this server. */ int RtdRemote::makeStatusFile(sockaddr_in& addr) { socklen_t addrSize = (socklen_t)sizeof(sockaddr_in); if (getsockname(socket_, (struct sockaddr *)&addr, &addrSize) == -1) return sys_error("getsockname"); char filename[1024]; char* home = getenv("HOME"); sprintf(filename, "%s/.rtd-remote", (home ? home : "/tmp")); FILE* f = fopen(filename, "w+"); if (!f) return sys_error(filename); char hostname[80]; if (gethostname(hostname, sizeof(hostname)) != 0) strcpy(hostname, "localhost"); fprintf(f, "%u %s %u\n", getpid(), hostname, ntohs(addr.sin_port)); fclose(f); return 0; } /* * enter client socket in clients table and return the index or * -1 for errors */ int RtdRemote::enterClient(int sock) { for (int i = 0; i < MAX_CLIENTS; i++) { if (clients_[i].socket == 0) { clients_[i].socket = sock; clients_[i].handle = RTD_TCL_GETFILE_(sock); clients_[i].thisPtr = this; return i; } } return -1; } /* * remove the client and close the socket */ void RtdRemote::removeClient(int sock) { for (int i = 0; i < MAX_CLIENTS; i++) { if (clients_[i].socket == sock) { Tcl_DeleteFileHandler(RTD_TCL_GETFILE_(sock)); #if (TCL_MAJOR_VERSION < 8) Tcl_FreeFile( clients_[i].handle ); #endif close(sock); clients_[i].socket = 0; clients_[i].handle = 0; clients_[i].thisPtr = NULL; return; } } } /* * This method is called when there is a new connection on the socket */ int RtdRemote::fileEvent() { fd_set readMask, readFds; FD_ZERO(&readMask); FD_SET(socket_, &readMask); memcpy(&readFds, &readMask, sizeof(fd_set)); timeval timeout; timeout.tv_sec = timeout.tv_usec = 0; #ifdef HAVE_SELECT_FD_SET int status = select(32, (fd_set *)&readFds, 0, 0, &timeout); #else int status = select(32, (int *)&readFds, 0, 0, &timeout); #endif if (status < 0) return sys_error("select"); else if (status == 0) return TCL_OK; if (FD_ISSET(socket_, &readFds) > 0) { struct sockaddr_in addr; // for local socket address socklen_t addrSize = (socklen_t)sizeof(addr); int sock = accept(socket_, (sockaddr *)&addr, &addrSize); if (sock < 0) return sys_error("accept"); int free = enterClient(sock); if (free != -1) { #ifdef DEBUG if (verbose_) printf("RtdRemote: accept on socket: %d, port:%d\n", sock, addr.sin_port); #endif Tcl_CreateFileHandler(RTD_TCL_GETFILE_(sock), TCL_READABLE, clientEventProc, (ClientData)&clients_[free]); } } return TCL_OK; } /* * send the buffer to the client using the given socket. The format is * * status length\n * result[length] * * where status is 0 or 1 (the return status of the command), length is * the length of the result in bytes and result is the result buffer. * status and length are written as ascii integers on a separate line * followed by the result on the second line. */ int RtdRemote::sendToClient(int socket, int status, int length, const char* result) { char buf[80]; sprintf(buf, "%d %d\n", status, length); if (writen(socket, buf, strlen(buf)) <= 0 || writen(socket, result, length) < 0) { return sys_error("error writing to client"); } return 0; } /* * evaluate the command buf as rtdimage subcommands and return the command's * status. * * XXX Note that some commands should probably not be called from a remote client... */ int RtdRemote::evalClientCmd(const char* cmd) { Tcl_ResetResult(interp_); // split command into argc/argv... int argc = 0; char** argv = NULL; if (Tcl_SplitList(interp_, (char*)cmd, &argc, &argv) != TCL_OK) return TCL_ERROR; if (argc <= 0) return TCL_OK; // ignore empty command const char* name = argv[0]; // command name int len = strlen(name); argc--; char** av = argv + 1; // call the RtdImage command method // argv[0] is the subcommand name, the rest are the arguments if (call(name, len, argc, av) != TCL_OK) { Tcl_Free((char *)argv); return TCL_ERROR; } Tcl_Free((char *)argv); return TCL_OK; } /* * This method is called when there is a message to read from one of the * clients. The message should contain * * * * where is a binary integer in network byte order, the length * of the to read. * */ int RtdRemote::clientEvent(Client* clientPtr) { clientPtr_ = clientPtr; // save current client ptr if (clientPtr->socket == 0) return TCL_OK; #ifdef DEBUG if (verbose_) printf("RtdRemote: Input on client socket: %d\n",clientPtr->socket); #endif int readable = 0; ioctl(clientPtr->socket, FIONREAD, &readable); #ifdef DEBUG if (verbose_) printf("RtdRemote: Bytes readable: %d\n",readable); #endif if (readable <= 0) { removeClient(clientPtr->socket); return TCL_OK; } char buf[2*1024]; if (readline(clientPtr->socket, buf, sizeof(buf)) < 0) return sys_error("error reading command from Rtd client"); #ifdef DEBUG if (verbose_) printf("RtdRemote: got: '%s'\n", buf); #endif int status = evalClientCmd(buf); return sendToClient(clientPtr->socket, status, strlen(Tcl_GetStringResult(interp_)), Tcl_GetStringResult(interp_)); } /* * This static method is called when there is a message to read * on the socket. Pass control to the class method. */ void RtdRemote::fileEventProc(ClientData clientData, int mask) { RtdRemote* thisPtr = (RtdRemote*)clientData; if (thisPtr->fileEvent() != TCL_OK) { Tk_BackgroundError(thisPtr->interp_); } } /* * This static method is called when there is a message to read * on a client socket. Pass control to the class method. */ void RtdRemote::clientEventProc(ClientData clientData, int mask) { RtdRemote::Client* clientPtr = (RtdRemote::Client*)clientData; if (! clientPtr) { error("no client data"); return; } if (clientPtr->thisPtr->clientEvent(clientPtr) != TCL_OK) { Tk_BackgroundError(clientPtr->thisPtr->interp_); } } skycat-3.1.2-starlink-1b/rtd/generic/RtdRemote.h000066400000000000000000000055611215713201500214270ustar00rootroot00000000000000// -*-c++-*- #ifndef _RtdRemote_h_ #define _RtdRemote_h_ /* * E.S.O. - VLT project * "@(#) $Id: RtdRemote.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdRemote.h - class definitions for managing remote access to the RTD * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 04/03/96 Created */ #include "tk.h" /* * Class RtdRemote * */ class RtdRemote { protected: int status_; // status after constructor int port_; // port number for communication int socket_; // socket for remote commands int verbose_; // flag: if true, print diagnostic messages Tcl_Interp* interp_; // Tcl interp (for file events, error handling) enum {MAX_CLIENTS = 32}; // max number of client connections struct Client { int socket; // client socket for sending results int callback_socket; // socket used for callback operations #if (TCL_MAJOR_VERSION >= 8) int handle; // file descriptor for events #else Tcl_File handle; // Tcl file handle for events #endif RtdRemote* thisPtr; // hook to get back to class from callback }; Client clients_[MAX_CLIENTS]; // array of client connection sockets Client* clientPtr_; // ptr to current client connection // create a status file with pid/port info int makeStatusFile(struct sockaddr_in& addr); // method called by fileEventProc to accept new client connection int fileEvent(); // method called by clientEventProc to read from client int clientEvent(Client*); // enter client socket in clients table int enterClient(int sock); // remove the client from the table void removeClient(int sock); // command methods virtual int draw() {return 0;} // call an rtdimage command method by name (defined in a derived class) // (see RtdImage.C for local derived class) virtual int call(const char* name, int len, int argc, char* argv[]) = 0; // send a message to the client with "status length result" int sendToClient(int socket, int status, int length, const char* result); // evaluate the command buf as rtdimage subcommands int evalClientCmd(const char* cmd); public: // constructor RtdRemote(Tcl_Interp*, int port, int verbose); // destructor virtual ~RtdRemote(); // static file handler, called by Tk file handler for new connections static void fileEventProc(ClientData, int mask); // static file handler, called to read client socket static void clientEventProc(ClientData, int mask); // open the current client's callback socket on the given host and port int setClientCallbackPort(const char* host, int port); // member access int status() {return status_;} int port() {return port_;} }; #endif /* _RtdRemote_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/RtdUtils.C000066400000000000000000000037301215713201500212230ustar00rootroot00000000000000/******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: RtdUtils.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------- -------- ---------------------------------------------- * pbiereic 01/03/01 created (copied from RtdImage.C) */ /************************************************************************ * NAME * * RtdUtils.C - RtdImge utilities * * SYNOPSIS * * * DESCRIPTION * * RtdUtils.C contains utility routines commonly used by code in the rtdimg/src * directroy * * FILES * * ENVIRONMENT * * CAUTIONS * * SEE ALSO * RtdImage(3), RTD documentation * * BUGS * *------------------------------------------------------------------------ */ static const char *rcsId="@(#) $Id: RtdUtils.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include "RtdUtils.h" /* * clip x to withing range x0 .. x1 */ void clip(double& x, double x0, double x1) { if (x0 < x1) { if (x < x0) x = x0; else if (x > x1) x = x1; } else { if (x > x0) x = x0; else if (x < x1) x = x1; } } /* * local utility to format a floting point value in arcsec * as minutes and seconds */ void formatHM(double val, char* buf) { int sign = 1; if (val < 0.0) { sign = -1; val = -val; } double dd = val + 0.0000000001; double md = dd / 60; int min = (int)md; double sec = (md - min) * 60; if (min != 0.0) { sprintf(buf, "%02d:%02.2f", min*sign, sec); } else { sprintf(buf, "%02.2f", sec*sign); } // cout << "formatHM: " << val << " == " << buf << endl; } /* * A simple class for debug logs */ RtdDebugLog::RtdDebugLog(char *nam, int debug) : debug_(debug) { strcpy(name_, nam); name_[9] = '\0'; } void RtdDebugLog::log(const char *format, ...) { if (! debug_) return; printf("%s: ", name_); va_list ap; va_start(ap, format); vprintf(format, ap); va_end(ap); } skycat-3.1.2-starlink-1b/rtd/generic/RtdUtils.h000066400000000000000000000015411215713201500212660ustar00rootroot00000000000000// -*-c++-*- #ifndef _RtdUtils_h_ #define _RtdUtils_h_ /* * E.S.O. - VLT project * "@(#) $Id: RtdUtils.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * RtdUtils.h - definitions for the rtdimg utilities * * who when what * -------------- -------- ---------------------------------------- * pbiereic 01/03/01 Created */ #include #include #include #include void clip(double& x, double x0, double x1); void formatHM(double val, char* buf); /* * Class RtdDebugLog */ class RtdDebugLog { public: RtdDebugLog(char *nam, int debug); void log(const char *format, ...); void setlog(int set) {debug_ = set;} int setlog() {return debug_;} protected: char name_[100]; // name of application int debug_; // debug flag }; #endif /* _RtdUtils_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/ShortImageData.C000066400000000000000000000062551215713201500223120ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: ShortImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ShortImageData.C - member functions for class ShortImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * T. Herlin 08/12/95 Added color scale functions to avoid sign problem * Peter W. Draper 23/06/09 Added parseBlank to get blank value in this type. * 09/11/09 Use a scaled range for this data type. Previously * values mapped directly into the lookup table. * Now, like other types, they scale between lowCut_ * and highCut_ which can be outside of the range * -32768 to 32767. */ #include #include #include #include #include #include #include #include "ShortImageData.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" /* * convert the given value to short by adding the integer bias, * scaling, rounding if necessary and checking the range */ short ShortImageData::scaleToShort(int l) { // If have blank pixels then test for this using raw value. if ( haveBlank_ ) { if ( blank_ == (short) l ) { return LOOKUP_BLANK; } } // Scale value into range defined by bias_ and scale_. // Keep result in range of lookup table indices. short s; double d = (l + bias_) * scale_; if (d < 0.0 ) { if((d -= 0.5) < LOOKUP_MIN) s = LOOKUP_MIN; else s = (short)d; } else { if((d += 0.5) > LOOKUP_MAX) s = LOOKUP_MAX; else s = (short)d; } return s; } /* * Initialize conversion from data range to short and _scale_ (not clip) * the low and high cut levels to short range. * * Method: member variables are set here and used later to convert the short * raw image data to another short, which is then used as an index in the * lookup table to get the byte value: * * bias_ = offset * scale_ = scale factor * */ void ShortImageData::initShortConversion() { scale_ = LOOKUP_WIDTH / (highCut_ - lowCut_); bias_ = -((lowCut_ + highCut_) * 0.5); scaledLowCut_ = scaleToShort(int(lowCut_)); scaledHighCut_ = scaleToShort(int(highCut_)); if (haveBlank_) scaledBlankPixelValue_ = LOOKUP_BLANK; } /* * Set the blank value from a given string. Return 1 if successful. */ int ShortImageData::parseBlank(const char* value) { long l; int n = sscanf(value, "%ld", &l); if ( n > 0 ) { blank_ = (short) l; } return n; } /* * Include some standard methods as (cpp macro) templates: * These are methods that are the same for all derived classes of ImageData, * except that they work on a different raw data type */ #define CLASS_NAME ShortImageData #define DATA_TYPE short #ifndef NTOH # define NTOH(x) SWAP16(x) #endif #include "ImageTemplates.icc" #undef CLASS_NAME #undef DATA_TYPE #undef NTOH skycat-3.1.2-starlink-1b/rtd/generic/ShortImageData.h000066400000000000000000000055251215713201500223560ustar00rootroot00000000000000// -*-c++-*- /* * E.S.O. - VLT project * * "@(#) $Id: ShortImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ShortImageData.h - class definitions for class ShortImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * T. Herlin 08/12/95 Added color scale functions to avoid sign problem * Allan Brighton 14/12/95 reversed above and fixed the real problem * Peter W. Draper 04/03/98 Added llookup * 14/07/98 Added blank checks in lookup. * P.Biereichel 22/03/99 Added definitions for bias subtraction * Peter W. Draper 03/11/09 Support lowCut_ and highCut_ out of short range. * 09/11/09 Use a scaled value for lookup. */ #include #include "ImageData.h" // This class is used for images where the raw data is made up of shorts class ShortImageData : public ImageData { private: // value of blank pixel, if known (if haveBlankPixel_ is nonzero) short blank_; double bias_; // offset double scale_; // scale factor // local methods used to get short index in lookup table short scaleToShort(int l); // get value as unsigned short ushort convertToUshort(short s) { return ushort(scaleToShort(int(s))); } // return X image pixel value for raw image value byte lookup(short s) { return lookup_[convertToUshort(s)]; } unsigned long llookup(short s) { return lookup_[convertToUshort(s)]; } // return NTOH converted value evtl. subtracted with corresponding bias value short getVal(short* p, int idx); int getXsamples(short *rawImage, int idx, int wbox, short *samples); int getBsamples(short *rawImage, int idx, int wbox, short *samples); int getCsamples(short *rawImage, int idx, int wbox, short *samples); short getMedian(short *samples, int n); short getBoxVal(short *rawImage, int idx, int wbox, short *samples, int xs); short getRMS(short *samples, int n); protected: // initialize conversion from base type to short void initShortConversion(); public: // constructor ShortImageData(const char* name, const ImageIO& imio, int verbose) : ImageData(name, imio, verbose), blank_(0) {} // return class name as a string virtual const char* classname() { return "ShortImageData"; } // return the data type of the raw data int dataType() {return SHORT_IMAGE;} // return true if the data type is signed int isSigned() {return 1;} // return a copy of this object ImageData* copy() {return new ShortImageData(*this);} // include declarations for methods that differ only in raw data type # include "ImageTemplates.h" }; skycat-3.1.2-starlink-1b/rtd/generic/UShortImageData.C000066400000000000000000000066151215713201500224370ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: UShortImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * UShortImageData.C - member functions for class UShortImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 23/06/09 Added parseBlank to get blank value in this type. * 20/10/09 Don't let lowCut_ and highCut_ wrap when * limits are out of ushort range. * 09/11/09 Use a scaled range for this data type. Previously * values mapped directly into the lookup table. * Now, like other types, they scale between lowCut_ * and highCut_ which can be outside of the range * 0 to 65535. */ #include #include #include #include #include #include #include "UShortImageData.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" /* * convert the given value to ushort by adding the integer bias, * scaling, rounding if necessary and checking the range */ ushort UShortImageData::convertToUshort(int l) { // If have blank pixels then test this against the raw value. if ( haveBlank_ ) { if ( blank_ == (ushort) l ) { return LOOKUP_BLANK; } } // Scale value into range defined by bias_ and scale_. Keep result in // range of lookup table indices. Note this is already unsigned, so // limits are 0, LOOKUP_SIZE-1, not the usual LOOKUP_MIN, LOOKUP_MAX. ushort s; double d = (l + bias_) * scale_; if (d < 0.0) { s = 0; } else { if((d += 0.5) > LOOKUP_WIDTH) { s = LOOKUP_WIDTH; } else { s = (ushort)d; } } return s; } /* * Initialize conversion from data range to ushort and _scale_ (not clip) * the low and high cut levels to ushort range. * * Method: member variables are set here and used later to convert the ushort * raw image data to another ushort, which is then used as an index in the * lookup table to get the byte value (for colour lookup). * * bias_ = offset * scale_ = scale factor * : */ void UShortImageData::initShortConversion() { if ( ( highCut_ - lowCut_ ) > 0.0 ) { bias_ = -lowCut_; scale_ = LOOKUP_WIDTH / (highCut_ - lowCut_); } else { scale_ = 1.0; bias_ = 0.0; } scaledLowCut_ = convertToUshort(int(lowCut_)); scaledHighCut_ = convertToUshort(int(highCut_)); if (haveBlank_) scaledBlankPixelValue_ = LOOKUP_BLANK; } /* * Set the blank value from a given string. Return 1 if successful. */ int UShortImageData::parseBlank(const char* value) { long l; int n = sscanf(value, "%ld", &l); if ( n > 0 ) { blank_ = (ushort) l; } return n; } /* * Include some standard methods as (cpp macro) templates: * These are methods that are the same for all derived classes of ImageData, * except that they work on a different raw data type */ #define CLASS_NAME UShortImageData #define DATA_TYPE ushort #ifndef NTOH # define NTOH(x) SWAP16(x) #endif #include "ImageTemplates.icc" #undef CLASS_NAME #undef DATA_TYPE #undef NTOH skycat-3.1.2-starlink-1b/rtd/generic/UShortImageData.h000066400000000000000000000050421215713201500224750ustar00rootroot00000000000000// -*-c++-*- /* * E.S.O. - VLT project * * "@(#) $Id: UShortImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * UShortImageData.h - class definitions for class UShortImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 04/03/98 Added llookup. * 14/07/98 Added check for blanks in lookup. * P.Biereichel 22/03/99 Added definitions for bias subtraction * Peter W. Draper 09/11/09 Use a scaled value for lookup. */ #include "ImageData.h" // This class is used for images where the raw data is made up of // unsigned shorts class UShortImageData : public ImageData { private: // value of blank pixel, if known (if haveBlankPixel_ is nonzero) ushort blank_; double bias_; // offset double scale_; // scale factor // local methods used to get short index in lookup table ushort convertToUshort(int l); // return X image pixel value for raw image value inline byte lookup(ushort s) { return lookup_[convertToUshort(s)]; } inline unsigned long llookup(ushort s) { return lookup_[convertToUshort(s)]; } // return NTOH converted value evtl. subtracted with corresponding bias value ushort getVal(ushort* p, int idx); int getXsamples(ushort *rawImage, int idx, int wbox, ushort *samples); int getBsamples(ushort *rawImage, int idx, int wbox, ushort *samples); int getCsamples(ushort *rawImage, int idx, int wbox, ushort *samples); ushort getMedian(ushort *samples, int n); ushort getBoxVal(ushort *rawImage, int idx, int wbox, ushort *samples, int xs); ushort getRMS(ushort *samples, int n); protected: // initialize conversion from base type to (unsigned) short, void initShortConversion(); public: // constructor UShortImageData(const char* name, const ImageIO& imio, int verbose) : ImageData(name, imio, verbose), blank_(0) {} // return class name as a string virtual const char* classname() { return "UShortImageData"; } // return the data type of the raw data int dataType() {return USHORT_IMAGE;} // return true if the data type is signed int isSigned() {return 0;} // return a copy of this object ImageData* copy() {return new UShortImageData(*this);} // include declarations for methods that differ only in raw data type # include "ImageTemplates.h" }; skycat-3.1.2-starlink-1b/rtd/generic/XImageData.C000066400000000000000000000026621215713201500214200ustar00rootroot00000000000000/* * E.S.O. - VLT project * * "@(#) $Id: XImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * XImageData.C - member functions for class XImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * pbiereic 17/02/03 Added 'using namespace std'. * Peter W. Draper 23/06/09 Added parseBlank to get blank value in this type. */ static const char* const rcsId="@(#) $Id: XImageData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include "XImageData.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" /* * Set the blank value from a given string. Return 1 if successful. */ int XImageData::parseBlank(const char* value) { long l; int n = sscanf(value, "%ld", &l); if ( n > 0 ) { blank_ = (byte) l; } return n; } /* * Include some standard methods as (cpp macro) templates: * These are methods that are the same for all derived classes of ImageData, * except that they work on a different raw data type */ #define CLASS_NAME XImageData #define DATA_TYPE byte #define NTOH(x) (x) #include "ImageTemplates.icc" #undef CLASS_NAME #undef DATA_TYPE #undef NTOH skycat-3.1.2-starlink-1b/rtd/generic/XImageData.h000066400000000000000000000052671215713201500214710ustar00rootroot00000000000000// -*-c++-*- #ifndef _XImageData_h_ #define _XImageData_h_ /* * E.S.O. - VLT project * * "@(#) $Id: XImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * XImageData.h - class definitions for class XImageData * * See the man page ImageData(3) for a complete description of this class * library. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 04/03/98 Added llookup. * 14/07/98 Added blank pixel check for lookup. * P.Biereichel 22/03/99 Added definitions for bias subtraction */ #include #include "ImageData.h" // This class is used for images where the raw data is made up of bytes class XImageData : public ImageData { private: // value of blank pixel, if known (if haveBlankPixel_ is nonzero) byte blank_; // get value as unsigned short inline ushort convertToUshort(byte b) { return (ushort)b; } // return X image pixel value for raw image value inline byte lookup(byte b) { if ( !haveBlank_ ) return b; if ( b != blank_ ) return b; return blank_; } inline unsigned long llookup(byte b) { if ( !haveBlank_ ) return b; if ( b != blank_ ) return b; return blank_; } // return NTOH converted value evtl. subtracted with corresponding bias value byte getVal(byte* p, int idx); int getXsamples(byte *rawImage, int idx, int wbox, byte *samples); int getBsamples(byte *rawImage, int idx, int wbox, byte *samples); int getCsamples(byte *rawImage, int idx, int wbox, byte *samples); byte getMedian(byte *samples, int n); byte getBoxVal(byte *rawImage, int idx, int wbox, byte *samples, int xs); byte getRMS(byte *samples, int n); protected: // no conversion necessary void initShortConversion() { scaledLowCut_ = 0; scaledHighCut_ = 255; scaledBlankPixelValue_ = LOOKUP_BLANK; } public: // constructor XImageData(const char* name, const ImageIO& imio, int verbose) : ImageData(name, imio, verbose), blank_(0) { flipY_ = 1; } // return class name as a string virtual const char* classname() { return "XImageData"; } // return the data type of the raw data int dataType() {return X_IMAGE;} // return true if the data type is signed int isSigned() {return 0;} // return a copy of this object ImageData* copy() {return new XImageData(*this);} // set the color scale algorithm for the image (redefined from base class) void colorScale(int ncolors, unsigned long* colors) {} // include declarations for methods that differ only in raw data type # include "ImageTemplates.h" }; #endif /* _XImageData_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/colormaps.C000066400000000000000000013601451215713201500214570ustar00rootroot00000000000000 /* * E.S.O. - VLT project * "@(#) $Id: colormaps.tcl,v 1.1.1.1 2006/01/12 16:37:25 abrighto Exp $" * * Colormap definitions for RTD * * This file was generated by ../colormaps/colormaps.tcl - DO NO EDIT */ #include #include void defineColormaps() { static RGBColor rainbow4_lasc[] = { {0.00000, 0.00000, 0.01176}, {0.00000, 0.00000, 0.02745}, {0.00000, 0.00000, 0.04314}, {0.00000, 0.00000, 0.05882}, {0.00000, 0.00000, 0.07451}, {0.00000, 0.00000, 0.09020}, {0.00000, 0.00000, 0.10588}, {0.00000, 0.00000, 0.12157}, {0.00000, 0.00000, 0.13725}, {0.00000, 0.00000, 0.15294}, {0.00000, 0.00000, 0.16863}, {0.00000, 0.00000, 0.18431}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.21176}, {0.00000, 0.00000, 0.22745}, {0.00000, 0.00000, 0.24314}, {0.00000, 0.00000, 0.25882}, {0.00000, 0.00000, 0.27451}, {0.00000, 0.00000, 0.29020}, {0.00000, 0.00000, 0.30588}, {0.00000, 0.00000, 0.32157}, {0.00000, 0.00000, 0.33725}, {0.00000, 0.00000, 0.35294}, {0.00000, 0.00000, 0.36863}, {0.00000, 0.00000, 0.38431}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.41176}, {0.00000, 0.00000, 0.42745}, {0.00000, 0.00000, 0.44314}, {0.00000, 0.00000, 0.45882}, {0.00000, 0.00000, 0.47451}, {0.00000, 0.00000, 0.49020}, {0.00000, 0.00000, 0.50588}, {0.00000, 0.00000, 0.52157}, {0.00000, 0.00000, 0.53725}, {0.00000, 0.00000, 0.55294}, {0.00000, 0.00000, 0.56863}, {0.00000, 0.00000, 0.58431}, {0.00000, 0.00000, 0.60000}, {0.00000, 0.00000, 0.61176}, {0.00000, 0.00000, 0.62745}, {0.00000, 0.00000, 0.64314}, {0.00000, 0.00000, 0.65882}, {0.00000, 0.00000, 0.67451}, {0.00000, 0.00000, 0.69020}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.72157}, {0.00000, 0.00000, 0.73725}, {0.00000, 0.00000, 0.75294}, {0.00000, 0.00000, 0.76863}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.80000}, {0.00000, 0.00000, 0.81176}, {0.00000, 0.00000, 0.82745}, {0.00000, 0.00000, 0.84314}, {0.00000, 0.00000, 0.85882}, {0.00000, 0.00000, 0.87451}, {0.00000, 0.00000, 0.89020}, {0.00000, 0.00000, 0.90588}, {0.00000, 0.00000, 0.92157}, {0.00000, 0.00000, 0.93725}, {0.00000, 0.00000, 0.95294}, {0.00000, 0.00000, 0.96863}, {0.00000, 0.00000, 0.98431}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.03529, 1.00000}, {0.00000, 0.07059, 1.00000}, {0.00000, 0.10980, 1.00000}, {0.00000, 0.14510, 1.00000}, {0.00000, 0.18039, 1.00000}, {0.00000, 0.21961, 1.00000}, {0.00000, 0.25490, 1.00000}, {0.00000, 0.29412, 1.00000}, {0.00000, 0.32941, 1.00000}, {0.00000, 0.36471, 1.00000}, {0.00000, 0.40392, 1.00000}, {0.00000, 0.43922, 1.00000}, {0.00000, 0.47843, 1.00000}, {0.00000, 0.50196, 1.00000}, {0.00000, 0.52549, 1.00000}, {0.00000, 0.54902, 1.00000}, {0.00000, 0.57255, 1.00000}, {0.00000, 0.59608, 1.00000}, {0.00000, 0.61961, 1.00000}, {0.00000, 0.64314, 1.00000}, {0.00000, 0.66667, 1.00000}, {0.00000, 0.69020, 1.00000}, {0.00000, 0.71373, 1.00000}, {0.00000, 0.73725, 1.00000}, {0.00000, 0.76078, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.80000, 1.00000}, {0.00000, 0.81569, 1.00000}, {0.00000, 0.83137, 1.00000}, {0.00000, 0.84706, 1.00000}, {0.00000, 0.86667, 1.00000}, {0.00000, 0.88235, 1.00000}, {0.00000, 0.89804, 1.00000}, {0.00000, 0.91373, 1.00000}, {0.00000, 0.93333, 1.00000}, {0.00000, 0.94902, 1.00000}, {0.00000, 0.96471, 1.00000}, {0.00000, 0.98039, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 0.97647}, {0.00000, 1.00000, 0.95294}, {0.00000, 1.00000, 0.92941}, {0.00000, 1.00000, 0.90588}, {0.00000, 1.00000, 0.88627}, {0.00000, 1.00000, 0.86275}, {0.00000, 1.00000, 0.83922}, {0.00000, 1.00000, 0.81569}, {0.00000, 1.00000, 0.79608}, {0.00000, 1.00000, 0.77255}, {0.00000, 1.00000, 0.74902}, {0.00000, 1.00000, 0.72549}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.65098}, {0.00000, 1.00000, 0.59608}, {0.00000, 1.00000, 0.54118}, {0.00000, 1.00000, 0.48627}, {0.00000, 1.00000, 0.43137}, {0.00000, 1.00000, 0.37647}, {0.00000, 1.00000, 0.32549}, {0.00000, 1.00000, 0.27059}, {0.00000, 1.00000, 0.21569}, {0.00000, 1.00000, 0.16078}, {0.00000, 1.00000, 0.10588}, {0.00000, 1.00000, 0.05098}, {0.00000, 1.00000, 0.00000}, {0.05098, 1.00000, 0.00000}, {0.10588, 1.00000, 0.00000}, {0.16078, 1.00000, 0.00000}, {0.21569, 1.00000, 0.00000}, {0.27059, 1.00000, 0.00000}, {0.32549, 1.00000, 0.00000}, {0.37647, 1.00000, 0.00000}, {0.43137, 1.00000, 0.00000}, {0.48627, 1.00000, 0.00000}, {0.54118, 1.00000, 0.00000}, {0.59608, 1.00000, 0.00000}, {0.65098, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.72549, 1.00000, 0.00000}, {0.74902, 1.00000, 0.00000}, {0.77255, 1.00000, 0.00000}, {0.79608, 1.00000, 0.00000}, {0.81569, 1.00000, 0.00000}, {0.83922, 1.00000, 0.00000}, {0.86275, 1.00000, 0.00000}, {0.88627, 1.00000, 0.00000}, {0.90588, 1.00000, 0.00000}, {0.92941, 1.00000, 0.00000}, {0.95294, 1.00000, 0.00000}, {0.97647, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.99608, 0.97647, 0.00000}, {0.99608, 0.95686, 0.00000}, {0.99608, 0.93333, 0.00000}, {0.99608, 0.91373, 0.00000}, {0.99216, 0.89412, 0.00000}, {0.99216, 0.87059, 0.00000}, {0.99216, 0.85098, 0.00000}, {0.99216, 0.82745, 0.00000}, {0.98824, 0.80784, 0.00000}, {0.98824, 0.78824, 0.00000}, {0.98824, 0.76471, 0.00000}, {0.98824, 0.74510, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.70588, 0.00000}, {0.98824, 0.68627, 0.00000}, {0.98824, 0.66667, 0.00000}, {0.98824, 0.64706, 0.00000}, {0.99216, 0.62745, 0.00000}, {0.99216, 0.60784, 0.00000}, {0.99216, 0.58824, 0.00000}, {0.99216, 0.56863, 0.00000}, {0.99608, 0.54902, 0.00000}, {0.99608, 0.52941, 0.00000}, {0.99608, 0.50980, 0.00000}, {0.99608, 0.49020, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.43137, 0.00000}, {1.00000, 0.39608, 0.00000}, {1.00000, 0.36078, 0.00000}, {1.00000, 0.32549, 0.00000}, {1.00000, 0.28627, 0.00000}, {1.00000, 0.25098, 0.00000}, {1.00000, 0.21569, 0.00000}, {1.00000, 0.18039, 0.00000}, {1.00000, 0.14118, 0.00000}, {1.00000, 0.10588, 0.00000}, {1.00000, 0.07059, 0.00000}, {1.00000, 0.03529, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.05098}, {1.00000, 0.00000, 0.10588}, {1.00000, 0.00000, 0.16078}, {1.00000, 0.00000, 0.21569}, {1.00000, 0.00000, 0.27059}, {1.00000, 0.00000, 0.32549}, {1.00000, 0.00000, 0.37647}, {1.00000, 0.00000, 0.43137}, {1.00000, 0.00000, 0.48627}, {1.00000, 0.00000, 0.54118}, {1.00000, 0.00000, 0.59608}, {1.00000, 0.00000, 0.65098}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.72549}, {1.00000, 0.00000, 0.74902}, {1.00000, 0.00000, 0.77255}, {1.00000, 0.00000, 0.79608}, {1.00000, 0.00000, 0.81569}, {1.00000, 0.00000, 0.83922}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.88627}, {1.00000, 0.00000, 0.90588}, {1.00000, 0.00000, 0.92941}, {1.00000, 0.00000, 0.95294}, {1.00000, 0.00000, 0.97647}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.03529, 1.00000}, {1.00000, 0.07059, 1.00000}, {1.00000, 0.10588, 1.00000}, {1.00000, 0.14118, 1.00000}, {1.00000, 0.18039, 1.00000}, {1.00000, 0.21569, 1.00000}, {1.00000, 0.25098, 1.00000}, {1.00000, 0.28627, 1.00000}, {1.00000, 0.32549, 1.00000}, {1.00000, 0.36078, 1.00000}, {1.00000, 0.39608, 1.00000}, {1.00000, 0.43137, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.48627, 1.00000}, {1.00000, 0.50588, 1.00000}, {1.00000, 0.52157, 1.00000}, {1.00000, 0.54118, 1.00000}, {1.00000, 0.56078, 1.00000}, {1.00000, 0.57647, 1.00000}, {1.00000, 0.59608, 1.00000}, {1.00000, 0.61176, 1.00000}, {1.00000, 0.63137, 1.00000}, {1.00000, 0.65098, 1.00000}, {1.00000, 0.66667, 1.00000}, {1.00000, 0.68627, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.74510, 1.00000}, {1.00000, 0.78824, 1.00000}, {1.00000, 0.83137, 1.00000}, {1.00000, 0.87059, 1.00000}, {1.00000, 0.91373, 1.00000}, {1.00000, 0.95686, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("rainbow4.lasc", rainbow4_lasc); static RGBColor ramp_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00392, 0.00392, 0.00392}, {0.00784, 0.00784, 0.00784}, {0.01176, 0.01176, 0.01176}, {0.01569, 0.01569, 0.01569}, {0.01961, 0.01961, 0.01961}, {0.02353, 0.02353, 0.02353}, {0.02745, 0.02745, 0.02745}, {0.03137, 0.03137, 0.03137}, {0.03529, 0.03529, 0.03529}, {0.03922, 0.03922, 0.03922}, {0.04314, 0.04314, 0.04314}, {0.04706, 0.04706, 0.04706}, {0.05098, 0.05098, 0.05098}, {0.05490, 0.05490, 0.05490}, {0.05882, 0.05882, 0.05882}, {0.06275, 0.06275, 0.06275}, {0.06667, 0.06667, 0.06667}, {0.07059, 0.07059, 0.07059}, {0.07451, 0.07451, 0.07451}, {0.07843, 0.07843, 0.07843}, {0.08235, 0.08235, 0.08235}, {0.08627, 0.08627, 0.08627}, {0.09020, 0.09020, 0.09020}, {0.09412, 0.09412, 0.09412}, {0.09804, 0.09804, 0.09804}, {0.10196, 0.10196, 0.10196}, {0.10588, 0.10588, 0.10588}, {0.10980, 0.10980, 0.10980}, {0.11373, 0.11373, 0.11373}, {0.11765, 0.11765, 0.11765}, {0.12157, 0.12157, 0.12157}, {0.12549, 0.12549, 0.12549}, {0.12941, 0.12941, 0.12941}, {0.13333, 0.13333, 0.13333}, {0.13725, 0.13725, 0.13725}, {0.14118, 0.14118, 0.14118}, {0.14510, 0.14510, 0.14510}, {0.14902, 0.14902, 0.14902}, {0.15294, 0.15294, 0.15294}, {0.15686, 0.15686, 0.15686}, {0.16078, 0.16078, 0.16078}, {0.16471, 0.16471, 0.16471}, {0.16863, 0.16863, 0.16863}, {0.17255, 0.17255, 0.17255}, {0.17647, 0.17647, 0.17647}, {0.18039, 0.18039, 0.18039}, {0.18431, 0.18431, 0.18431}, {0.18824, 0.18824, 0.18824}, {0.19216, 0.19216, 0.19216}, {0.19608, 0.19608, 0.19608}, {0.20000, 0.20000, 0.20000}, {0.20392, 0.20392, 0.20392}, {0.20784, 0.20784, 0.20784}, {0.21177, 0.21177, 0.21177}, {0.21569, 0.21569, 0.21569}, {0.21961, 0.21961, 0.21961}, {0.22353, 0.22353, 0.22353}, {0.22745, 0.22745, 0.22745}, {0.23137, 0.23137, 0.23137}, {0.23529, 0.23529, 0.23529}, {0.23922, 0.23922, 0.23922}, {0.24314, 0.24314, 0.24314}, {0.24706, 0.24706, 0.24706}, {0.25098, 0.25098, 0.25098}, {0.25490, 0.25490, 0.25490}, {0.25882, 0.25882, 0.25882}, {0.26275, 0.26275, 0.26275}, {0.26667, 0.26667, 0.26667}, {0.27059, 0.27059, 0.27059}, {0.27451, 0.27451, 0.27451}, {0.27843, 0.27843, 0.27843}, {0.28235, 0.28235, 0.28235}, {0.28628, 0.28628, 0.28628}, {0.29020, 0.29020, 0.29020}, {0.29412, 0.29412, 0.29412}, {0.29804, 0.29804, 0.29804}, {0.30196, 0.30196, 0.30196}, {0.30588, 0.30588, 0.30588}, {0.30980, 0.30980, 0.30980}, {0.31372, 0.31372, 0.31372}, {0.31765, 0.31765, 0.31765}, {0.32157, 0.32157, 0.32157}, {0.32549, 0.32549, 0.32549}, {0.32941, 0.32941, 0.32941}, {0.33333, 0.33333, 0.33333}, {0.33726, 0.33726, 0.33726}, {0.34118, 0.34118, 0.34118}, {0.34510, 0.34510, 0.34510}, {0.34902, 0.34902, 0.34902}, {0.35294, 0.35294, 0.35294}, {0.35686, 0.35686, 0.35686}, {0.36078, 0.36078, 0.36078}, {0.36471, 0.36471, 0.36471}, {0.36863, 0.36863, 0.36863}, {0.37255, 0.37255, 0.37255}, {0.37647, 0.37647, 0.37647}, {0.38039, 0.38039, 0.38039}, {0.38431, 0.38431, 0.38431}, {0.38823, 0.38823, 0.38823}, {0.39216, 0.39216, 0.39216}, {0.39608, 0.39608, 0.39608}, {0.40000, 0.40000, 0.40000}, {0.40392, 0.40392, 0.40392}, {0.40784, 0.40784, 0.40784}, {0.41176, 0.41176, 0.41176}, {0.41569, 0.41569, 0.41569}, {0.41961, 0.41961, 0.41961}, {0.42353, 0.42353, 0.42353}, {0.42745, 0.42745, 0.42745}, {0.43137, 0.43137, 0.43137}, {0.43529, 0.43529, 0.43529}, {0.43922, 0.43922, 0.43922}, {0.44314, 0.44314, 0.44314}, {0.44706, 0.44706, 0.44706}, {0.45098, 0.45098, 0.45098}, {0.45490, 0.45490, 0.45490}, {0.45882, 0.45882, 0.45882}, {0.46275, 0.46275, 0.46275}, {0.46667, 0.46667, 0.46667}, {0.47059, 0.47059, 0.47059}, {0.47451, 0.47451, 0.47451}, {0.47843, 0.47843, 0.47843}, {0.48235, 0.48235, 0.48235}, {0.48628, 0.48628, 0.48628}, {0.49020, 0.49020, 0.49020}, {0.49412, 0.49412, 0.49412}, {0.49804, 0.49804, 0.49804}, {0.50196, 0.50196, 0.50196}, {0.50588, 0.50588, 0.50588}, {0.50980, 0.50980, 0.50980}, {0.51372, 0.51372, 0.51372}, {0.51765, 0.51765, 0.51765}, {0.52157, 0.52157, 0.52157}, {0.52549, 0.52549, 0.52549}, {0.52941, 0.52941, 0.52941}, {0.53333, 0.53333, 0.53333}, {0.53726, 0.53726, 0.53726}, {0.54118, 0.54118, 0.54118}, {0.54510, 0.54510, 0.54510}, {0.54902, 0.54902, 0.54902}, {0.55294, 0.55294, 0.55294}, {0.55686, 0.55686, 0.55686}, {0.56078, 0.56078, 0.56078}, {0.56471, 0.56471, 0.56471}, {0.56863, 0.56863, 0.56863}, {0.57255, 0.57255, 0.57255}, {0.57647, 0.57647, 0.57647}, {0.58039, 0.58039, 0.58039}, {0.58431, 0.58431, 0.58431}, {0.58823, 0.58823, 0.58823}, {0.59216, 0.59216, 0.59216}, {0.59608, 0.59608, 0.59608}, {0.60000, 0.60000, 0.60000}, {0.60392, 0.60392, 0.60392}, {0.60784, 0.60784, 0.60784}, {0.61177, 0.61177, 0.61177}, {0.61569, 0.61569, 0.61569}, {0.61961, 0.61961, 0.61961}, {0.62353, 0.62353, 0.62353}, {0.62745, 0.62745, 0.62745}, {0.63137, 0.63137, 0.63137}, {0.63529, 0.63529, 0.63529}, {0.63922, 0.63922, 0.63922}, {0.64314, 0.64314, 0.64314}, {0.64706, 0.64706, 0.64706}, {0.65098, 0.65098, 0.65098}, {0.65490, 0.65490, 0.65490}, {0.65882, 0.65882, 0.65882}, {0.66275, 0.66275, 0.66275}, {0.66667, 0.66667, 0.66667}, {0.67059, 0.67059, 0.67059}, {0.67451, 0.67451, 0.67451}, {0.67843, 0.67843, 0.67843}, {0.68235, 0.68235, 0.68235}, {0.68627, 0.68627, 0.68627}, {0.69020, 0.69020, 0.69020}, {0.69412, 0.69412, 0.69412}, {0.69804, 0.69804, 0.69804}, {0.70196, 0.70196, 0.70196}, {0.70588, 0.70588, 0.70588}, {0.70980, 0.70980, 0.70980}, {0.71373, 0.71373, 0.71373}, {0.71765, 0.71765, 0.71765}, {0.72157, 0.72157, 0.72157}, {0.72549, 0.72549, 0.72549}, {0.72941, 0.72941, 0.72941}, {0.73333, 0.73333, 0.73333}, {0.73725, 0.73725, 0.73725}, {0.74118, 0.74118, 0.74118}, {0.74510, 0.74510, 0.74510}, {0.74902, 0.74902, 0.74902}, {0.75294, 0.75294, 0.75294}, {0.75686, 0.75686, 0.75686}, {0.76078, 0.76078, 0.76078}, {0.76471, 0.76471, 0.76471}, {0.76863, 0.76863, 0.76863}, {0.77255, 0.77255, 0.77255}, {0.77647, 0.77647, 0.77647}, {0.78039, 0.78039, 0.78039}, {0.78431, 0.78431, 0.78431}, {0.78824, 0.78824, 0.78824}, {0.79216, 0.79216, 0.79216}, {0.79608, 0.79608, 0.79608}, {0.80000, 0.80000, 0.80000}, {0.80392, 0.80392, 0.80392}, {0.80784, 0.80784, 0.80784}, {0.81176, 0.81176, 0.81176}, {0.81569, 0.81569, 0.81569}, {0.81961, 0.81961, 0.81961}, {0.82353, 0.82353, 0.82353}, {0.82745, 0.82745, 0.82745}, {0.83137, 0.83137, 0.83137}, {0.83529, 0.83529, 0.83529}, {0.83922, 0.83922, 0.83922}, {0.84314, 0.84314, 0.84314}, {0.84706, 0.84706, 0.84706}, {0.85098, 0.85098, 0.85098}, {0.85490, 0.85490, 0.85490}, {0.85882, 0.85882, 0.85882}, {0.86274, 0.86274, 0.86274}, {0.86667, 0.86667, 0.86667}, {0.87059, 0.87059, 0.87059}, {0.87451, 0.87451, 0.87451}, {0.87843, 0.87843, 0.87843}, {0.88235, 0.88235, 0.88235}, {0.88628, 0.88628, 0.88628}, {0.89020, 0.89020, 0.89020}, {0.89412, 0.89412, 0.89412}, {0.89804, 0.89804, 0.89804}, {0.90196, 0.90196, 0.90196}, {0.90588, 0.90588, 0.90588}, {0.90980, 0.90980, 0.90980}, {0.91373, 0.91373, 0.91373}, {0.91765, 0.91765, 0.91765}, {0.92157, 0.92157, 0.92157}, {0.92549, 0.92549, 0.92549}, {0.92941, 0.92941, 0.92941}, {0.93333, 0.93333, 0.93333}, {0.93725, 0.93725, 0.93725}, {0.94118, 0.94118, 0.94118}, {0.94510, 0.94510, 0.94510}, {0.94902, 0.94902, 0.94902}, {0.95294, 0.95294, 0.95294}, {0.95686, 0.95686, 0.95686}, {0.96078, 0.96078, 0.96078}, {0.96471, 0.96471, 0.96471}, {0.96863, 0.96863, 0.96863}, {0.97255, 0.97255, 0.97255}, {0.97647, 0.97647, 0.97647}, {0.98039, 0.98039, 0.98039}, {0.98431, 0.98431, 0.98431}, {0.98823, 0.98823, 0.98823}, {0.99216, 0.99216, 0.99216}, {0.99608, 0.99608, 0.99608}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("ramp.lasc", ramp_lasc); static RGBColor random3_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("random3.lasc", random3_lasc); static RGBColor isophot_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.03922}, {0.00000, 0.00000, 0.07843}, {0.00000, 0.00000, 0.11765}, {0.00000, 0.00000, 0.15686}, {0.00000, 0.00000, 0.19608}, {0.00000, 0.00000, 0.23529}, {0.00000, 0.00000, 0.27843}, {0.00000, 0.00000, 0.31765}, {0.00000, 0.00000, 0.35686}, {0.00000, 0.00000, 0.39608}, {0.00000, 0.00000, 0.43529}, {0.00000, 0.00000, 0.47451}, {0.00000, 0.00000, 0.51765}, {0.00000, 0.00000, 0.55686}, {0.00000, 0.00000, 0.59608}, {0.00000, 0.00000, 0.63529}, {0.00000, 0.00000, 0.67451}, {0.00000, 0.00000, 0.71765}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {0.00000, 0.00000, 0.87843}, {0.00000, 0.00000, 0.91765}, {0.00000, 0.00000, 0.95686}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.03137, 1.00000}, {0.00000, 0.06275, 1.00000}, {0.00000, 0.09412, 1.00000}, {0.00000, 0.12549, 1.00000}, {0.00000, 0.15686, 1.00000}, {0.00000, 0.18824, 1.00000}, {0.00000, 0.21961, 1.00000}, {0.00000, 0.25490, 1.00000}, {0.00000, 0.28627, 1.00000}, {0.00000, 0.31765, 1.00000}, {0.00000, 0.34902, 1.00000}, {0.00000, 0.38039, 1.00000}, {0.00000, 0.41176, 1.00000}, {0.00000, 0.44314, 1.00000}, {0.00000, 0.47843, 1.00000}, {0.00000, 0.49804, 1.00000}, {0.00000, 0.51765, 1.00000}, {0.00000, 0.53725, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {0.00000, 0.61961, 1.00000}, {0.00000, 0.63922, 1.00000}, {0.00000, 0.65882, 1.00000}, {0.00000, 0.67843, 1.00000}, {0.00000, 0.70196, 1.00000}, {0.00000, 0.72157, 1.00000}, {0.00000, 0.74118, 1.00000}, {0.00000, 0.76078, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.79608, 1.00000}, {0.00000, 0.81176, 1.00000}, {0.00000, 0.82353, 1.00000}, {0.00000, 0.83922, 1.00000}, {0.00000, 0.85490, 1.00000}, {0.00000, 0.86667, 1.00000}, {0.00000, 0.88235, 1.00000}, {0.00000, 0.89412, 1.00000}, {0.00000, 0.90980, 1.00000}, {0.00000, 0.92549, 1.00000}, {0.00000, 0.93725, 1.00000}, {0.00000, 0.95294, 1.00000}, {0.00000, 0.96863, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 0.96078}, {0.00000, 1.00000, 0.94118}, {0.00000, 1.00000, 0.92157}, {0.00000, 1.00000, 0.90196}, {0.00000, 1.00000, 0.88235}, {0.00000, 1.00000, 0.86275}, {0.00000, 1.00000, 0.84314}, {0.00000, 1.00000, 0.82353}, {0.00000, 1.00000, 0.80392}, {0.00000, 1.00000, 0.78431}, {0.00000, 1.00000, 0.76471}, {0.00000, 1.00000, 0.74510}, {0.00000, 1.00000, 0.72549}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.65490}, {0.00000, 1.00000, 0.60784}, {0.00000, 1.00000, 0.56078}, {0.00000, 1.00000, 0.51373}, {0.00000, 1.00000, 0.46667}, {0.00000, 1.00000, 0.41961}, {0.00000, 1.00000, 0.37255}, {0.00000, 1.00000, 0.32549}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 0.13725}, {0.00000, 1.00000, 0.09020}, {0.00000, 1.00000, 0.04314}, {0.00000, 1.00000, 0.00000}, {0.04706, 1.00000, 0.00000}, {0.09412, 1.00000, 0.00000}, {0.14118, 1.00000, 0.00000}, {0.18824, 1.00000, 0.00000}, {0.23529, 1.00000, 0.00000}, {0.28235, 1.00000, 0.00000}, {0.32941, 1.00000, 0.00000}, {0.37647, 1.00000, 0.00000}, {0.42353, 1.00000, 0.00000}, {0.47059, 1.00000, 0.00000}, {0.51765, 1.00000, 0.00000}, {0.56471, 1.00000, 0.00000}, {0.61176, 1.00000, 0.00000}, {0.65882, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.72549, 1.00000, 0.00000}, {0.74510, 1.00000, 0.00000}, {0.76471, 1.00000, 0.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {0.84314, 1.00000, 0.00000}, {0.86275, 1.00000, 0.00000}, {0.88235, 1.00000, 0.00000}, {0.90196, 1.00000, 0.00000}, {0.92157, 1.00000, 0.00000}, {0.94118, 1.00000, 0.00000}, {0.96078, 1.00000, 0.00000}, {0.98039, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.99608, 0.98039, 0.00000}, {0.99608, 0.96078, 0.00000}, {0.99608, 0.94118, 0.00000}, {0.99608, 0.92549, 0.00000}, {0.99216, 0.90588, 0.00000}, {0.99216, 0.88627, 0.00000}, {0.99216, 0.87059, 0.00000}, {0.99216, 0.85098, 0.00000}, {0.98824, 0.83137, 0.00000}, {0.98824, 0.81569, 0.00000}, {0.98824, 0.79608, 0.00000}, {0.98824, 0.77647, 0.00000}, {0.98824, 0.76078, 0.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {0.98824, 0.69020, 0.00000}, {0.98824, 0.67059, 0.00000}, {0.98824, 0.65490, 0.00000}, {0.98824, 0.63922, 0.00000}, {0.98824, 0.61961, 0.00000}, {0.99216, 0.60392, 0.00000}, {0.99216, 0.58824, 0.00000}, {0.99216, 0.56863, 0.00000}, {0.99216, 0.55294, 0.00000}, {0.99608, 0.53725, 0.00000}, {0.99608, 0.51765, 0.00000}, {0.99608, 0.50196, 0.00000}, {0.99608, 0.48627, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.43529, 0.00000}, {1.00000, 0.40392, 0.00000}, {1.00000, 0.37255, 0.00000}, {1.00000, 0.34118, 0.00000}, {1.00000, 0.30980, 0.00000}, {1.00000, 0.27843, 0.00000}, {1.00000, 0.24706, 0.00000}, {1.00000, 0.21569, 0.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 0.09020, 0.00000}, {1.00000, 0.05882, 0.00000}, {1.00000, 0.02745, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.04706}, {1.00000, 0.00000, 0.09412}, {1.00000, 0.00000, 0.14118}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 0.00000, 0.32941}, {1.00000, 0.00000, 0.37647}, {1.00000, 0.00000, 0.42353}, {1.00000, 0.00000, 0.47059}, {1.00000, 0.00000, 0.51765}, {1.00000, 0.00000, 0.56471}, {1.00000, 0.00000, 0.61176}, {1.00000, 0.00000, 0.65882}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.72549}, {1.00000, 0.00000, 0.74902}, {1.00000, 0.00000, 0.77255}, {1.00000, 0.00000, 0.79608}, {1.00000, 0.00000, 0.81569}, {1.00000, 0.00000, 0.83922}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.88627}, {1.00000, 0.00000, 0.90588}, {1.00000, 0.00000, 0.92941}, {1.00000, 0.00000, 0.95294}, {1.00000, 0.00000, 0.97647}, {1.00000, 0.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 0.14118, 1.00000}, {1.00000, 0.17647, 1.00000}, {1.00000, 0.21176, 1.00000}, {1.00000, 0.25098, 1.00000}, {1.00000, 0.28627, 1.00000}, {1.00000, 0.32157, 1.00000}, {1.00000, 0.36078, 1.00000}, {1.00000, 0.39608, 1.00000}, {1.00000, 0.43137, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.48627, 1.00000}, {1.00000, 0.50588, 1.00000}, {1.00000, 0.52157, 1.00000}, {1.00000, 0.54118, 1.00000}, {1.00000, 0.56078, 1.00000}, {1.00000, 0.57647, 1.00000}, {1.00000, 0.59608, 1.00000}, {1.00000, 0.61176, 1.00000}, {1.00000, 0.63137, 1.00000}, {1.00000, 0.65098, 1.00000}, {1.00000, 0.66667, 1.00000}, {1.00000, 0.68627, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.74510, 1.00000}, {1.00000, 0.78824, 1.00000}, {1.00000, 0.83137, 1.00000}, {1.00000, 0.87059, 1.00000}, {1.00000, 0.91373, 1.00000}, {1.00000, 0.95686, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("isophot.lasc", isophot_lasc); static RGBColor staircase_lasc[] = { {0.00392, 0.00392, 0.31373}, {0.00784, 0.00784, 0.31373}, {0.01176, 0.01176, 0.31373}, {0.01569, 0.01569, 0.31373}, {0.01961, 0.01961, 0.31373}, {0.02353, 0.02353, 0.31373}, {0.02745, 0.02745, 0.31373}, {0.03137, 0.03137, 0.31373}, {0.03529, 0.03529, 0.31373}, {0.03922, 0.03922, 0.31373}, {0.04314, 0.04314, 0.31373}, {0.04706, 0.04706, 0.31373}, {0.05098, 0.05098, 0.31373}, {0.05490, 0.05490, 0.31373}, {0.05882, 0.05882, 0.31373}, {0.06275, 0.06275, 0.31373}, {0.06667, 0.06667, 0.47059}, {0.07059, 0.07059, 0.47059}, {0.07451, 0.07451, 0.47059}, {0.07843, 0.07843, 0.47059}, {0.08235, 0.08235, 0.47059}, {0.08627, 0.08627, 0.47059}, {0.09020, 0.09020, 0.47059}, {0.09412, 0.09412, 0.47059}, {0.09804, 0.09804, 0.47059}, {0.10196, 0.10196, 0.47059}, {0.10588, 0.10588, 0.47059}, {0.10980, 0.10980, 0.47059}, {0.11373, 0.11373, 0.47059}, {0.11765, 0.11765, 0.47059}, {0.12157, 0.12157, 0.47059}, {0.12549, 0.12549, 0.47059}, {0.12941, 0.12941, 0.62745}, {0.13333, 0.13333, 0.62745}, {0.13725, 0.13725, 0.62745}, {0.14118, 0.14118, 0.62745}, {0.14510, 0.14510, 0.62745}, {0.14902, 0.14902, 0.62745}, {0.15294, 0.15294, 0.62745}, {0.15686, 0.15686, 0.62745}, {0.16078, 0.16078, 0.62745}, {0.16471, 0.16471, 0.62745}, {0.16863, 0.16863, 0.62745}, {0.17255, 0.17255, 0.62745}, {0.17647, 0.17647, 0.62745}, {0.18039, 0.18039, 0.62745}, {0.18431, 0.18431, 0.62745}, {0.18824, 0.18824, 0.62745}, {0.19216, 0.19216, 0.78431}, {0.19608, 0.19608, 0.78431}, {0.20000, 0.20000, 0.78431}, {0.20392, 0.20392, 0.78431}, {0.20784, 0.20784, 0.78431}, {0.21176, 0.21176, 0.78431}, {0.21569, 0.21569, 0.78431}, {0.21961, 0.21961, 0.78431}, {0.22353, 0.22353, 0.78431}, {0.22745, 0.22745, 0.78431}, {0.23137, 0.23137, 0.78431}, {0.23529, 0.23529, 0.78431}, {0.23922, 0.23922, 0.78431}, {0.24314, 0.24314, 0.78431}, {0.24706, 0.24706, 0.78431}, {0.25098, 0.25098, 0.78431}, {0.25490, 0.25490, 0.94118}, {0.25882, 0.25882, 0.94118}, {0.26275, 0.26275, 0.94118}, {0.26667, 0.26667, 0.94118}, {0.27059, 0.27059, 0.94118}, {0.27451, 0.27451, 0.94118}, {0.27843, 0.27843, 0.94118}, {0.28235, 0.28235, 0.94118}, {0.28627, 0.28627, 0.94118}, {0.29020, 0.29020, 0.94118}, {0.29412, 0.29412, 0.94118}, {0.29804, 0.29804, 0.94118}, {0.30196, 0.30196, 0.94118}, {0.30588, 0.30588, 0.94118}, {0.30980, 0.30980, 0.94118}, {0.31373, 0.31373, 0.94118}, {0.31765, 0.31765, 0.95294}, {0.32157, 0.32157, 0.96471}, {0.32549, 0.32549, 0.97647}, {0.32941, 0.32941, 0.98824}, {0.33333, 0.33333, 1.00000}, {0.00392, 0.31373, 0.00392}, {0.00784, 0.31373, 0.00784}, {0.01176, 0.31373, 0.01176}, {0.01569, 0.31373, 0.01569}, {0.01961, 0.31373, 0.01961}, {0.02353, 0.31373, 0.02353}, {0.02745, 0.31373, 0.02745}, {0.03137, 0.31373, 0.03137}, {0.03529, 0.31373, 0.03529}, {0.03922, 0.31373, 0.03922}, {0.04314, 0.31373, 0.04314}, {0.04706, 0.31373, 0.04706}, {0.05098, 0.31373, 0.05098}, {0.05490, 0.31373, 0.05490}, {0.05882, 0.31373, 0.05882}, {0.06275, 0.31373, 0.06275}, {0.06667, 0.47059, 0.06667}, {0.07059, 0.47059, 0.07059}, {0.07451, 0.47059, 0.07451}, {0.07843, 0.47059, 0.07843}, {0.08235, 0.47059, 0.08235}, {0.08627, 0.47059, 0.08627}, {0.09020, 0.47059, 0.09020}, {0.09412, 0.47059, 0.09412}, {0.09804, 0.47059, 0.09804}, {0.10196, 0.47059, 0.10196}, {0.10588, 0.47059, 0.10588}, {0.10980, 0.47059, 0.10980}, {0.11373, 0.47059, 0.11373}, {0.11765, 0.47059, 0.11765}, {0.12157, 0.47059, 0.12157}, {0.12549, 0.47059, 0.12549}, {0.12941, 0.62745, 0.12941}, {0.13333, 0.62745, 0.13333}, {0.13725, 0.62745, 0.13725}, {0.14118, 0.62745, 0.14118}, {0.14510, 0.62745, 0.14510}, {0.14902, 0.62745, 0.14902}, {0.15294, 0.62745, 0.15294}, {0.15686, 0.62745, 0.15686}, {0.16078, 0.62745, 0.16078}, {0.16471, 0.62745, 0.16471}, {0.16863, 0.62745, 0.16863}, {0.17255, 0.62745, 0.17255}, {0.17647, 0.62745, 0.17647}, {0.18039, 0.62745, 0.18039}, {0.18431, 0.62745, 0.18431}, {0.18824, 0.62745, 0.18824}, {0.19216, 0.78431, 0.19216}, {0.19608, 0.78431, 0.19608}, {0.20000, 0.78431, 0.20000}, {0.20392, 0.78431, 0.20392}, {0.20784, 0.78431, 0.20784}, {0.21176, 0.78431, 0.21176}, {0.21569, 0.78431, 0.21569}, {0.21961, 0.78431, 0.21961}, {0.22353, 0.78431, 0.22353}, {0.22745, 0.78431, 0.22745}, {0.23137, 0.78431, 0.23137}, {0.23529, 0.78431, 0.23529}, {0.23922, 0.78431, 0.23922}, {0.24314, 0.78431, 0.24314}, {0.24706, 0.78431, 0.24706}, {0.25098, 0.78431, 0.25098}, {0.25490, 0.94118, 0.25490}, {0.25882, 0.94118, 0.25882}, {0.26275, 0.94118, 0.26275}, {0.26667, 0.94118, 0.26667}, {0.27059, 0.94118, 0.27059}, {0.27451, 0.94118, 0.27451}, {0.27843, 0.94118, 0.27843}, {0.28235, 0.94118, 0.28235}, {0.28627, 0.94118, 0.28627}, {0.29020, 0.94118, 0.29020}, {0.29412, 0.94118, 0.29412}, {0.29804, 0.94118, 0.29804}, {0.30196, 0.94118, 0.30196}, {0.30588, 0.94118, 0.30588}, {0.30980, 0.94118, 0.30980}, {0.31373, 0.94118, 0.31373}, {0.31765, 0.95294, 0.31765}, {0.32157, 0.96471, 0.32157}, {0.32549, 0.97647, 0.32549}, {0.32941, 0.98824, 0.32941}, {0.33333, 1.00000, 0.33333}, {0.31373, 0.00392, 0.00392}, {0.31373, 0.00784, 0.00784}, {0.31373, 0.01176, 0.01176}, {0.31373, 0.01569, 0.01569}, {0.31373, 0.01961, 0.01961}, {0.31373, 0.02353, 0.02353}, {0.31373, 0.02745, 0.02745}, {0.31373, 0.03137, 0.03137}, {0.31373, 0.03529, 0.03529}, {0.31373, 0.03922, 0.03922}, {0.31373, 0.04314, 0.04314}, {0.31373, 0.04706, 0.04706}, {0.31373, 0.05098, 0.05098}, {0.31373, 0.05490, 0.05490}, {0.31373, 0.05882, 0.05882}, {0.31373, 0.06275, 0.06275}, {0.47059, 0.06667, 0.06667}, {0.47059, 0.07059, 0.07059}, {0.47059, 0.07451, 0.07451}, {0.47059, 0.07843, 0.07843}, {0.47059, 0.08235, 0.08235}, {0.47059, 0.08627, 0.08627}, {0.47059, 0.09020, 0.09020}, {0.47059, 0.09412, 0.09412}, {0.47059, 0.09804, 0.09804}, {0.47059, 0.10196, 0.10196}, {0.47059, 0.10588, 0.10588}, {0.47059, 0.10980, 0.10980}, {0.47059, 0.11373, 0.11373}, {0.47059, 0.11765, 0.11765}, {0.47059, 0.12157, 0.12157}, {0.47059, 0.12549, 0.12549}, {0.62745, 0.12941, 0.12941}, {0.62745, 0.13333, 0.13333}, {0.62745, 0.13725, 0.13725}, {0.62745, 0.14118, 0.14118}, {0.62745, 0.14510, 0.14510}, {0.62745, 0.14902, 0.14902}, {0.62745, 0.15294, 0.15294}, {0.62745, 0.15686, 0.15686}, {0.62745, 0.16078, 0.16078}, {0.62745, 0.16471, 0.16471}, {0.62745, 0.16863, 0.16863}, {0.62745, 0.17255, 0.17255}, {0.62745, 0.17647, 0.17647}, {0.62745, 0.18039, 0.18039}, {0.62745, 0.18431, 0.18431}, {0.62745, 0.18824, 0.18824}, {0.78431, 0.19216, 0.19216}, {0.78431, 0.19608, 0.19608}, {0.78431, 0.20000, 0.20000}, {0.78431, 0.20392, 0.20392}, {0.78431, 0.20784, 0.20784}, {0.78431, 0.21176, 0.21176}, {0.78431, 0.21569, 0.21569}, {0.78431, 0.21961, 0.21961}, {0.78431, 0.22353, 0.22353}, {0.78431, 0.22745, 0.22745}, {0.78431, 0.23137, 0.23137}, {0.78431, 0.23529, 0.23529}, {0.78431, 0.23922, 0.23922}, {0.78431, 0.24314, 0.24314}, {0.78431, 0.24706, 0.24706}, {0.78431, 0.25098, 0.25098}, {0.94118, 0.25490, 0.25490}, {0.94118, 0.25882, 0.25882}, {0.94118, 0.26275, 0.26275}, {0.94118, 0.26667, 0.26667}, {0.94118, 0.27059, 0.27059}, {0.94118, 0.27451, 0.27451}, {0.94118, 0.27843, 0.27843}, {0.94118, 0.28235, 0.28235}, {0.94118, 0.28627, 0.28627}, {0.94118, 0.29020, 0.29020}, {0.94118, 0.29412, 0.29412}, {0.94118, 0.29804, 0.29804}, {0.94118, 0.30196, 0.30196}, {0.94118, 0.30588, 0.30588}, {0.94118, 0.30980, 0.30980}, {0.94118, 0.31373, 0.31373}, {0.94902, 0.39216, 0.39216}, {0.96078, 0.52941, 0.52941}, {0.97255, 0.66667, 0.66667}, {0.98431, 0.80392, 0.80392}, {0.99216, 0.80000, 0.80000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("staircase.lasc", staircase_lasc); static RGBColor red_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00392, 0.00000, 0.00000}, {0.00784, 0.00000, 0.00000}, {0.01176, 0.00000, 0.00000}, {0.01569, 0.00000, 0.00000}, {0.01961, 0.00000, 0.00000}, {0.02353, 0.00000, 0.00000}, {0.02745, 0.00000, 0.00000}, {0.03137, 0.00000, 0.00000}, {0.03529, 0.00000, 0.00000}, {0.03922, 0.00000, 0.00000}, {0.04314, 0.00000, 0.00000}, {0.04706, 0.00000, 0.00000}, {0.05098, 0.00000, 0.00000}, {0.05490, 0.00000, 0.00000}, {0.05882, 0.00000, 0.00000}, {0.06275, 0.00000, 0.00000}, {0.06667, 0.00000, 0.00000}, {0.07059, 0.00000, 0.00000}, {0.07451, 0.00000, 0.00000}, {0.07843, 0.00000, 0.00000}, {0.08235, 0.00000, 0.00000}, {0.08627, 0.00000, 0.00000}, {0.09020, 0.00000, 0.00000}, {0.09412, 0.00000, 0.00000}, {0.09804, 0.00000, 0.00000}, {0.10196, 0.00000, 0.00000}, {0.10588, 0.00000, 0.00000}, {0.10980, 0.00000, 0.00000}, {0.11373, 0.00000, 0.00000}, {0.11765, 0.00000, 0.00000}, {0.12157, 0.00000, 0.00000}, {0.12549, 0.00000, 0.00000}, {0.12941, 0.00000, 0.00000}, {0.13333, 0.00000, 0.00000}, {0.13725, 0.00000, 0.00000}, {0.14118, 0.00000, 0.00000}, {0.14510, 0.00000, 0.00000}, {0.14902, 0.00000, 0.00000}, {0.15294, 0.00000, 0.00000}, {0.15686, 0.00000, 0.00000}, {0.16078, 0.00000, 0.00000}, {0.16471, 0.00000, 0.00000}, {0.16863, 0.00000, 0.00000}, {0.17255, 0.00000, 0.00000}, {0.17647, 0.00000, 0.00000}, {0.18039, 0.00000, 0.00000}, {0.18431, 0.00000, 0.00000}, {0.18824, 0.00000, 0.00000}, {0.19216, 0.00000, 0.00000}, {0.19608, 0.00000, 0.00000}, {0.20000, 0.00000, 0.00000}, {0.20392, 0.00000, 0.00000}, {0.20784, 0.00000, 0.00000}, {0.21176, 0.00000, 0.00000}, {0.21569, 0.00000, 0.00000}, {0.21961, 0.00000, 0.00000}, {0.22353, 0.00000, 0.00000}, {0.22745, 0.00000, 0.00000}, {0.23137, 0.00000, 0.00000}, {0.23529, 0.00000, 0.00000}, {0.23922, 0.00000, 0.00000}, {0.24314, 0.00000, 0.00000}, {0.24706, 0.00000, 0.00000}, {0.25098, 0.00000, 0.00000}, {0.25490, 0.00000, 0.00000}, {0.25882, 0.00000, 0.00000}, {0.26275, 0.00000, 0.00000}, {0.26667, 0.00000, 0.00000}, {0.27059, 0.00000, 0.00000}, {0.27451, 0.00000, 0.00000}, {0.27843, 0.00000, 0.00000}, {0.28235, 0.00000, 0.00000}, {0.28627, 0.00000, 0.00000}, {0.29020, 0.00000, 0.00000}, {0.29412, 0.00000, 0.00000}, {0.29804, 0.00000, 0.00000}, {0.30196, 0.00000, 0.00000}, {0.30588, 0.00000, 0.00000}, {0.30980, 0.00000, 0.00000}, {0.31373, 0.00000, 0.00000}, {0.31765, 0.00000, 0.00000}, {0.32157, 0.00000, 0.00000}, {0.32549, 0.00000, 0.00000}, {0.32941, 0.00000, 0.00000}, {0.33333, 0.00000, 0.00000}, {0.33725, 0.00000, 0.00000}, {0.34118, 0.00000, 0.00000}, {0.34510, 0.00000, 0.00000}, {0.34902, 0.00000, 0.00000}, {0.35294, 0.00000, 0.00000}, {0.35686, 0.00000, 0.00000}, {0.36078, 0.00000, 0.00000}, {0.36471, 0.00000, 0.00000}, {0.36863, 0.00000, 0.00000}, {0.37255, 0.00000, 0.00000}, {0.37647, 0.00000, 0.00000}, {0.38039, 0.00000, 0.00000}, {0.38431, 0.00000, 0.00000}, {0.38824, 0.00000, 0.00000}, {0.39216, 0.00000, 0.00000}, {0.39608, 0.00000, 0.00000}, {0.40000, 0.00000, 0.00000}, {0.40392, 0.00000, 0.00000}, {0.40784, 0.00000, 0.00000}, {0.41176, 0.00000, 0.00000}, {0.41569, 0.00000, 0.00000}, {0.41961, 0.00000, 0.00000}, {0.42353, 0.00000, 0.00000}, {0.42745, 0.00000, 0.00000}, {0.43137, 0.00000, 0.00000}, {0.43529, 0.00000, 0.00000}, {0.43922, 0.00000, 0.00000}, {0.44314, 0.00000, 0.00000}, {0.44706, 0.00000, 0.00000}, {0.45098, 0.00000, 0.00000}, {0.45490, 0.00000, 0.00000}, {0.45882, 0.00000, 0.00000}, {0.46275, 0.00000, 0.00000}, {0.46667, 0.00000, 0.00000}, {0.47059, 0.00000, 0.00000}, {0.47451, 0.00000, 0.00000}, {0.47843, 0.00000, 0.00000}, {0.48235, 0.00000, 0.00000}, {0.48627, 0.00000, 0.00000}, {0.49020, 0.00000, 0.00000}, {0.49412, 0.00000, 0.00000}, {0.49804, 0.00000, 0.00000}, {0.50196, 0.00000, 0.00000}, {0.50588, 0.00000, 0.00000}, {0.50980, 0.00000, 0.00000}, {0.51373, 0.00000, 0.00000}, {0.51765, 0.00000, 0.00000}, {0.52157, 0.00000, 0.00000}, {0.52549, 0.00000, 0.00000}, {0.52941, 0.00000, 0.00000}, {0.53333, 0.00000, 0.00000}, {0.53725, 0.00000, 0.00000}, {0.54118, 0.00000, 0.00000}, {0.54510, 0.00000, 0.00000}, {0.54902, 0.00000, 0.00000}, {0.55294, 0.00000, 0.00000}, {0.55686, 0.00000, 0.00000}, {0.56078, 0.00000, 0.00000}, {0.56471, 0.00000, 0.00000}, {0.56863, 0.00000, 0.00000}, {0.57255, 0.00000, 0.00000}, {0.57647, 0.00000, 0.00000}, {0.58039, 0.00000, 0.00000}, {0.58431, 0.00000, 0.00000}, {0.58824, 0.00000, 0.00000}, {0.59216, 0.00000, 0.00000}, {0.59608, 0.00000, 0.00000}, {0.60000, 0.00000, 0.00000}, {0.60392, 0.00000, 0.00000}, {0.60784, 0.00000, 0.00000}, {0.61176, 0.00000, 0.00000}, {0.61569, 0.00000, 0.00000}, {0.61961, 0.00000, 0.00000}, {0.62353, 0.00000, 0.00000}, {0.62745, 0.00000, 0.00000}, {0.63137, 0.00000, 0.00000}, {0.63529, 0.00000, 0.00000}, {0.63922, 0.00000, 0.00000}, {0.64314, 0.00000, 0.00000}, {0.64706, 0.00000, 0.00000}, {0.65098, 0.00000, 0.00000}, {0.65490, 0.00000, 0.00000}, {0.65882, 0.00000, 0.00000}, {0.66275, 0.00000, 0.00000}, {0.66667, 0.00000, 0.00000}, {0.67059, 0.00000, 0.00000}, {0.67451, 0.00000, 0.00000}, {0.67843, 0.00000, 0.00000}, {0.68235, 0.00000, 0.00000}, {0.68627, 0.00000, 0.00000}, {0.69020, 0.00000, 0.00000}, {0.69412, 0.00000, 0.00000}, {0.69804, 0.00000, 0.00000}, {0.70196, 0.00000, 0.00000}, {0.70588, 0.00000, 0.00000}, {0.70980, 0.00000, 0.00000}, {0.71373, 0.00000, 0.00000}, {0.71765, 0.00000, 0.00000}, {0.72157, 0.00000, 0.00000}, {0.72549, 0.00000, 0.00000}, {0.72941, 0.00000, 0.00000}, {0.73333, 0.00000, 0.00000}, {0.73725, 0.00000, 0.00000}, {0.74118, 0.00000, 0.00000}, {0.74510, 0.00000, 0.00000}, {0.74902, 0.00000, 0.00000}, {0.75294, 0.00000, 0.00000}, {0.75686, 0.00000, 0.00000}, {0.76078, 0.00000, 0.00000}, {0.76471, 0.00000, 0.00000}, {0.76863, 0.00000, 0.00000}, {0.77255, 0.00000, 0.00000}, {0.77647, 0.00000, 0.00000}, {0.78039, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.79216, 0.00000, 0.00000}, {0.79608, 0.00000, 0.00000}, {0.80000, 0.00000, 0.00000}, {0.80392, 0.00000, 0.00000}, {0.80784, 0.00000, 0.00000}, {0.81176, 0.00000, 0.00000}, {0.81569, 0.00000, 0.00000}, {0.81961, 0.00000, 0.00000}, {0.82353, 0.00000, 0.00000}, {0.82745, 0.00000, 0.00000}, {0.83137, 0.00000, 0.00000}, {0.83529, 0.00000, 0.00000}, {0.83922, 0.00000, 0.00000}, {0.84314, 0.00000, 0.00000}, {0.84706, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.85490, 0.00000, 0.00000}, {0.85882, 0.00000, 0.00000}, {0.86275, 0.00000, 0.00000}, {0.86667, 0.00000, 0.00000}, {0.87059, 0.00000, 0.00000}, {0.87451, 0.00000, 0.00000}, {0.87843, 0.00000, 0.00000}, {0.88235, 0.00000, 0.00000}, {0.88627, 0.00000, 0.00000}, {0.89020, 0.00000, 0.00000}, {0.89412, 0.00000, 0.00000}, {0.89804, 0.00000, 0.00000}, {0.90196, 0.00000, 0.00000}, {0.90588, 0.00000, 0.00000}, {0.90980, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {0.91765, 0.00000, 0.00000}, {0.92157, 0.00000, 0.00000}, {0.92549, 0.00000, 0.00000}, {0.92941, 0.00000, 0.00000}, {0.93333, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.94118, 0.00000, 0.00000}, {0.94510, 0.00000, 0.00000}, {0.94902, 0.00000, 0.00000}, {0.95294, 0.00000, 0.00000}, {0.95686, 0.00000, 0.00000}, {0.96078, 0.00000, 0.00000}, {0.96471, 0.00000, 0.00000}, {0.96863, 0.00000, 0.00000}, {0.97255, 0.00000, 0.00000}, {0.97647, 0.00000, 0.00000}, {0.98039, 0.00000, 0.00000}, {0.98431, 0.00000, 0.00000}, {0.98824, 0.00000, 0.00000}, {0.99216, 0.00000, 0.00000}, {0.99608, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, }; new ColorMapInfo("red.lasc", red_lasc); static RGBColor heat_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.01176, 0.00392, 0.00000}, {0.02353, 0.00784, 0.00000}, {0.03529, 0.01176, 0.00000}, {0.04706, 0.01569, 0.00000}, {0.05882, 0.01961, 0.00000}, {0.07059, 0.02353, 0.00000}, {0.08235, 0.02745, 0.00000}, {0.09412, 0.03137, 0.00000}, {0.10588, 0.03529, 0.00000}, {0.11765, 0.03922, 0.00000}, {0.12941, 0.04314, 0.00000}, {0.14118, 0.04706, 0.00000}, {0.15294, 0.05098, 0.00000}, {0.16471, 0.05490, 0.00000}, {0.17647, 0.05882, 0.00000}, {0.18824, 0.06275, 0.00000}, {0.20000, 0.06667, 0.00000}, {0.21176, 0.07059, 0.00000}, {0.22353, 0.07451, 0.00000}, {0.23529, 0.07843, 0.00000}, {0.24706, 0.08235, 0.00000}, {0.25882, 0.08627, 0.00000}, {0.27059, 0.09020, 0.00000}, {0.28235, 0.09412, 0.00000}, {0.29412, 0.09804, 0.00000}, {0.30588, 0.10196, 0.00000}, {0.31765, 0.10588, 0.00000}, {0.32941, 0.10980, 0.00000}, {0.34118, 0.11373, 0.00000}, {0.35294, 0.11765, 0.00000}, {0.36471, 0.12157, 0.00000}, {0.37647, 0.12549, 0.00000}, {0.38824, 0.12941, 0.00000}, {0.40000, 0.13333, 0.00000}, {0.41176, 0.13725, 0.00000}, {0.42353, 0.14118, 0.00000}, {0.43529, 0.14510, 0.00000}, {0.44706, 0.14902, 0.00000}, {0.45882, 0.15294, 0.00000}, {0.47059, 0.15686, 0.00000}, {0.48235, 0.16078, 0.00000}, {0.49412, 0.16471, 0.00000}, {0.50588, 0.16863, 0.00000}, {0.51765, 0.17255, 0.00000}, {0.52941, 0.17647, 0.00000}, {0.54118, 0.18039, 0.00000}, {0.55294, 0.18431, 0.00000}, {0.56471, 0.18824, 0.00000}, {0.57647, 0.19216, 0.00000}, {0.58824, 0.19608, 0.00000}, {0.60000, 0.20000, 0.00000}, {0.61176, 0.20392, 0.00000}, {0.62353, 0.20784, 0.00000}, {0.63529, 0.21176, 0.00000}, {0.64706, 0.21569, 0.00000}, {0.65882, 0.21961, 0.00000}, {0.67059, 0.22353, 0.00000}, {0.68235, 0.22745, 0.00000}, {0.69412, 0.23137, 0.00000}, {0.70588, 0.23529, 0.00000}, {0.71765, 0.23922, 0.00000}, {0.72941, 0.24314, 0.00000}, {0.74118, 0.24706, 0.00000}, {0.75294, 0.25098, 0.00000}, {0.76471, 0.25490, 0.00000}, {0.77647, 0.25882, 0.00000}, {0.78824, 0.26275, 0.00000}, {0.80000, 0.26667, 0.00000}, {0.81176, 0.27059, 0.00000}, {0.82353, 0.27451, 0.00000}, {0.83529, 0.27843, 0.00000}, {0.84706, 0.28235, 0.00000}, {0.85882, 0.28627, 0.00000}, {0.87059, 0.29020, 0.00000}, {0.88235, 0.29412, 0.00000}, {0.89412, 0.29804, 0.00000}, {0.90588, 0.30196, 0.00000}, {0.91765, 0.30588, 0.00000}, {0.92941, 0.30980, 0.00000}, {0.94118, 0.31373, 0.00000}, {0.95294, 0.31765, 0.00000}, {0.96471, 0.32157, 0.00000}, {0.97647, 0.32549, 0.00000}, {0.98824, 0.32941, 0.00000}, {1.00000, 0.33333, 0.00000}, {1.00000, 0.33725, 0.00000}, {1.00000, 0.34118, 0.00000}, {1.00000, 0.34510, 0.00000}, {1.00000, 0.34902, 0.00000}, {1.00000, 0.35294, 0.00000}, {1.00000, 0.35686, 0.00000}, {1.00000, 0.36078, 0.00000}, {1.00000, 0.36471, 0.00000}, {1.00000, 0.36863, 0.00000}, {1.00000, 0.37255, 0.00000}, {1.00000, 0.37647, 0.00000}, {1.00000, 0.38039, 0.00000}, {1.00000, 0.38431, 0.00000}, {1.00000, 0.38824, 0.00000}, {1.00000, 0.39216, 0.00000}, {1.00000, 0.39608, 0.00000}, {1.00000, 0.40000, 0.00000}, {1.00000, 0.40392, 0.00000}, {1.00000, 0.40784, 0.00000}, {1.00000, 0.41176, 0.00000}, {1.00000, 0.41569, 0.00000}, {1.00000, 0.41961, 0.00000}, {1.00000, 0.42353, 0.00000}, {1.00000, 0.42745, 0.00000}, {1.00000, 0.43137, 0.00000}, {1.00000, 0.43529, 0.00000}, {1.00000, 0.43922, 0.00000}, {1.00000, 0.44314, 0.00000}, {1.00000, 0.44706, 0.00000}, {1.00000, 0.45098, 0.00000}, {1.00000, 0.45490, 0.00000}, {1.00000, 0.45882, 0.00000}, {1.00000, 0.46275, 0.00000}, {1.00000, 0.46667, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47451, 0.00000}, {1.00000, 0.47843, 0.00000}, {1.00000, 0.48235, 0.00000}, {1.00000, 0.48627, 0.00000}, {1.00000, 0.49020, 0.00000}, {1.00000, 0.49412, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.50196, 0.00000}, {1.00000, 0.50588, 0.00000}, {1.00000, 0.50980, 0.00000}, {1.00000, 0.51373, 0.00000}, {1.00000, 0.51765, 0.00000}, {1.00000, 0.52157, 0.00000}, {1.00000, 0.52549, 0.00000}, {1.00000, 0.52941, 0.00000}, {1.00000, 0.53333, 0.00000}, {1.00000, 0.53725, 0.00000}, {1.00000, 0.54118, 0.00000}, {1.00000, 0.54510, 0.00000}, {1.00000, 0.54902, 0.00000}, {1.00000, 0.55294, 0.00000}, {1.00000, 0.55686, 0.00000}, {1.00000, 0.56078, 0.00000}, {1.00000, 0.56471, 0.00000}, {1.00000, 0.56863, 0.00000}, {1.00000, 0.57255, 0.00000}, {1.00000, 0.57647, 0.00000}, {1.00000, 0.58039, 0.00000}, {1.00000, 0.58431, 0.00000}, {1.00000, 0.58824, 0.00000}, {1.00000, 0.59216, 0.00000}, {1.00000, 0.59608, 0.00000}, {1.00000, 0.60000, 0.00000}, {1.00000, 0.60392, 0.00000}, {1.00000, 0.60784, 0.00000}, {1.00000, 0.61176, 0.00000}, {1.00000, 0.61569, 0.00000}, {1.00000, 0.61961, 0.00000}, {1.00000, 0.62353, 0.00000}, {1.00000, 0.62745, 0.00000}, {1.00000, 0.63137, 0.00000}, {1.00000, 0.63529, 0.00000}, {1.00000, 0.63922, 0.00000}, {1.00000, 0.64314, 0.00000}, {1.00000, 0.64706, 0.00000}, {1.00000, 0.65098, 0.01176}, {1.00000, 0.65490, 0.02353}, {1.00000, 0.65882, 0.03529}, {1.00000, 0.66275, 0.04706}, {1.00000, 0.66667, 0.05882}, {1.00000, 0.67059, 0.07059}, {1.00000, 0.67451, 0.08235}, {1.00000, 0.67843, 0.09412}, {1.00000, 0.68235, 0.10588}, {1.00000, 0.68627, 0.11765}, {1.00000, 0.69020, 0.12941}, {1.00000, 0.69412, 0.14118}, {1.00000, 0.69804, 0.15294}, {1.00000, 0.70196, 0.16471}, {1.00000, 0.70588, 0.17647}, {1.00000, 0.70980, 0.18824}, {1.00000, 0.71373, 0.20000}, {1.00000, 0.71765, 0.21176}, {1.00000, 0.72157, 0.22353}, {1.00000, 0.72549, 0.23529}, {1.00000, 0.72941, 0.24706}, {1.00000, 0.73333, 0.25882}, {1.00000, 0.73725, 0.27059}, {1.00000, 0.74118, 0.28235}, {1.00000, 0.74510, 0.29412}, {1.00000, 0.74902, 0.30588}, {1.00000, 0.75294, 0.31765}, {1.00000, 0.75686, 0.32941}, {1.00000, 0.76078, 0.34118}, {1.00000, 0.76471, 0.35294}, {1.00000, 0.76863, 0.36471}, {1.00000, 0.77255, 0.37647}, {1.00000, 0.77647, 0.38824}, {1.00000, 0.78039, 0.40000}, {1.00000, 0.78431, 0.41176}, {1.00000, 0.78824, 0.42353}, {1.00000, 0.79216, 0.43529}, {1.00000, 0.79608, 0.44706}, {1.00000, 0.80000, 0.45882}, {1.00000, 0.80392, 0.47059}, {1.00000, 0.80784, 0.48235}, {1.00000, 0.81176, 0.49412}, {1.00000, 0.81569, 0.50588}, {1.00000, 0.81961, 0.51765}, {1.00000, 0.82353, 0.52941}, {1.00000, 0.82745, 0.54118}, {1.00000, 0.83137, 0.55294}, {1.00000, 0.83529, 0.56471}, {1.00000, 0.83922, 0.57647}, {1.00000, 0.84314, 0.58824}, {1.00000, 0.84706, 0.60000}, {1.00000, 0.85098, 0.61176}, {1.00000, 0.85490, 0.62353}, {1.00000, 0.85882, 0.63529}, {1.00000, 0.86275, 0.64706}, {1.00000, 0.86667, 0.65882}, {1.00000, 0.87059, 0.67059}, {1.00000, 0.87451, 0.68235}, {1.00000, 0.87843, 0.69412}, {1.00000, 0.88235, 0.70588}, {1.00000, 0.88627, 0.71765}, {1.00000, 0.89020, 0.72941}, {1.00000, 0.89412, 0.74118}, {1.00000, 0.89804, 0.75294}, {1.00000, 0.90196, 0.76471}, {1.00000, 0.90588, 0.77647}, {1.00000, 0.90980, 0.78824}, {1.00000, 0.91373, 0.80000}, {1.00000, 0.91765, 0.81176}, {1.00000, 0.92157, 0.82353}, {1.00000, 0.92549, 0.83529}, {1.00000, 0.92941, 0.84706}, {1.00000, 0.93333, 0.85882}, {1.00000, 0.93725, 0.87059}, {1.00000, 0.94118, 0.88235}, {1.00000, 0.94510, 0.89412}, {1.00000, 0.94902, 0.90588}, {1.00000, 0.95294, 0.91765}, {1.00000, 0.95686, 0.92941}, {1.00000, 0.96078, 0.94118}, {1.00000, 0.96471, 0.95294}, {1.00000, 0.96863, 0.96471}, {1.00000, 0.97255, 0.97647}, {1.00000, 0.97647, 0.98824}, {1.00000, 0.98039, 1.00000}, {1.00000, 0.98431, 1.00000}, {1.00000, 0.98824, 1.00000}, {1.00000, 0.99216, 1.00000}, {1.00000, 0.99608, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("heat.lasc", heat_lasc); static RGBColor idl12_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.32941}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {0.50196, 0.00000, 1.00000}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.25098}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {0.86275, 0.74510, 0.74510}, {0.86275, 0.74510, 0.74510}, {0.86275, 0.74510, 0.74510}, {0.86275, 0.74510, 0.74510}, {0.86275, 0.74510, 0.74510}, {0.86667, 0.74510, 0.74510}, {0.86667, 0.74510, 0.74510}, {0.86667, 0.74510, 0.74510}, {0.86667, 0.74510, 0.74510}, {0.86667, 0.74510, 0.74510}, {0.87059, 0.74510, 0.74510}, {0.87059, 0.74510, 0.74510}, {0.87059, 0.74510, 0.74510}, {0.87059, 0.74510, 0.74510}, {0.87059, 0.74510, 0.74510}, {0.87451, 0.74510, 0.74510}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {0.86275, 0.86275, 0.86275}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("idl12.lasc", idl12_lasc); static RGBColor random4_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("random4.lasc", random4_lasc); static RGBColor smooth_lasc[] = { {0.00000, 0.00000, 1.00000}, {0.01569, 0.00000, 0.98431}, {0.03529, 0.00000, 0.96471}, {0.05098, 0.00000, 0.94902}, {0.06667, 0.00000, 0.93333}, {0.08627, 0.00000, 0.91373}, {0.10196, 0.00000, 0.89804}, {0.11765, 0.00000, 0.88235}, {0.13725, 0.00000, 0.86275}, {0.15294, 0.00000, 0.84706}, {0.16863, 0.00000, 0.83137}, {0.18824, 0.00000, 0.81176}, {0.20392, 0.00000, 0.79608}, {0.21961, 0.00000, 0.78039}, {0.23922, 0.00000, 0.76078}, {0.25490, 0.00000, 0.74510}, {0.27059, 0.00000, 0.72941}, {0.28627, 0.00000, 0.71373}, {0.30588, 0.00000, 0.69412}, {0.32157, 0.00000, 0.67843}, {0.33725, 0.00000, 0.66275}, {0.35686, 0.00000, 0.64314}, {0.37255, 0.00000, 0.62745}, {0.38824, 0.00000, 0.61176}, {0.40784, 0.00000, 0.59216}, {0.42353, 0.00000, 0.57647}, {0.43922, 0.00000, 0.56078}, {0.45882, 0.00000, 0.54118}, {0.47451, 0.00000, 0.52549}, {0.49020, 0.00000, 0.50980}, {0.50980, 0.00000, 0.49020}, {0.52549, 0.00000, 0.47451}, {0.54118, 0.00000, 0.45882}, {0.56078, 0.00000, 0.43922}, {0.57647, 0.00000, 0.42353}, {0.59216, 0.00000, 0.40784}, {0.61176, 0.00000, 0.38824}, {0.62745, 0.00000, 0.37255}, {0.64314, 0.00000, 0.35686}, {0.66275, 0.00000, 0.33725}, {0.67843, 0.00000, 0.32157}, {0.69412, 0.00000, 0.30588}, {0.71373, 0.00000, 0.28627}, {0.72941, 0.00000, 0.27059}, {0.74510, 0.00000, 0.25490}, {0.76078, 0.00000, 0.23922}, {0.78039, 0.00000, 0.21961}, {0.79608, 0.00000, 0.20392}, {0.81176, 0.00000, 0.18824}, {0.83137, 0.00000, 0.16863}, {0.84706, 0.00000, 0.15294}, {0.86275, 0.00000, 0.13725}, {0.88235, 0.00000, 0.11765}, {0.89804, 0.00000, 0.10196}, {0.91373, 0.00000, 0.08627}, {0.93333, 0.00000, 0.06667}, {0.94902, 0.00000, 0.05098}, {0.96471, 0.00000, 0.03529}, {0.98431, 0.00000, 0.01569}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.01176, 0.00000}, {1.00000, 0.01961, 0.00000}, {1.00000, 0.03137, 0.00000}, {1.00000, 0.03922, 0.00000}, {1.00000, 0.05098, 0.00000}, {1.00000, 0.05882, 0.00000}, {1.00000, 0.07059, 0.00000}, {1.00000, 0.08235, 0.00000}, {1.00000, 0.09020, 0.00000}, {1.00000, 0.10196, 0.00000}, {1.00000, 0.10980, 0.00000}, {1.00000, 0.12157, 0.00000}, {1.00000, 0.12941, 0.00000}, {1.00000, 0.14118, 0.00000}, {0.99608, 0.15294, 0.00000}, {0.99608, 0.16078, 0.00000}, {0.99608, 0.17255, 0.00000}, {0.99608, 0.18039, 0.00000}, {0.99608, 0.19216, 0.00000}, {0.99608, 0.20392, 0.00000}, {0.99608, 0.21176, 0.00000}, {0.99608, 0.22353, 0.00000}, {0.99608, 0.23137, 0.00000}, {0.99608, 0.24314, 0.00000}, {0.99608, 0.25098, 0.00000}, {0.99608, 0.26275, 0.00000}, {0.99608, 0.27451, 0.00000}, {0.99608, 0.28235, 0.00000}, {0.99608, 0.29412, 0.00000}, {0.99608, 0.30196, 0.00000}, {0.99608, 0.31373, 0.00000}, {0.99608, 0.32157, 0.00000}, {0.99608, 0.33333, 0.00000}, {0.99608, 0.34510, 0.00000}, {0.99608, 0.35294, 0.00000}, {0.99608, 0.36471, 0.00000}, {0.99608, 0.37255, 0.00000}, {0.99608, 0.38431, 0.00000}, {0.99608, 0.39216, 0.00000}, {0.99608, 0.40392, 0.00000}, {0.99608, 0.41569, 0.00000}, {0.99608, 0.42353, 0.00000}, {0.99608, 0.43529, 0.00000}, {0.99608, 0.44314, 0.00000}, {0.99216, 0.45490, 0.00000}, {0.99216, 0.46667, 0.00000}, {0.99216, 0.47451, 0.00000}, {0.99216, 0.48627, 0.00000}, {0.99216, 0.49412, 0.00000}, {0.99216, 0.50588, 0.00000}, {0.99216, 0.51373, 0.00000}, {0.99216, 0.52549, 0.00000}, {0.99216, 0.53725, 0.00000}, {0.99216, 0.54510, 0.00000}, {0.99216, 0.55686, 0.00000}, {0.99216, 0.56471, 0.00000}, {0.99216, 0.57647, 0.00000}, {0.99216, 0.58431, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.99216, 0.60000, 0.00000}, {0.99216, 0.60784, 0.00000}, {0.99216, 0.61176, 0.00000}, {0.99216, 0.61569, 0.00000}, {0.99216, 0.61961, 0.00000}, {0.99216, 0.62745, 0.00000}, {0.99216, 0.63137, 0.00000}, {0.99216, 0.63529, 0.00000}, {0.99216, 0.64314, 0.00000}, {0.98824, 0.64706, 0.00000}, {0.98824, 0.65098, 0.00000}, {0.98824, 0.65882, 0.00000}, {0.98824, 0.66275, 0.00000}, {0.98824, 0.66667, 0.00000}, {0.98824, 0.67451, 0.00000}, {0.98824, 0.67843, 0.00000}, {0.98824, 0.68235, 0.00000}, {0.98824, 0.68627, 0.00000}, {0.98824, 0.69412, 0.00000}, {0.98824, 0.69804, 0.00000}, {0.98824, 0.70196, 0.00000}, {0.98824, 0.70980, 0.00000}, {0.98824, 0.71373, 0.00000}, {0.98824, 0.71765, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72941, 0.00000}, {0.98824, 0.73333, 0.00000}, {0.98824, 0.73725, 0.00000}, {0.98824, 0.74510, 0.00000}, {0.98824, 0.74902, 0.00000}, {0.98431, 0.75294, 0.00000}, {0.98431, 0.76078, 0.00000}, {0.98431, 0.76471, 0.00000}, {0.98431, 0.76863, 0.00000}, {0.98431, 0.77255, 0.00000}, {0.98431, 0.78039, 0.00000}, {0.98431, 0.78431, 0.00000}, {0.98431, 0.78824, 0.00000}, {0.98431, 0.79608, 0.00000}, {0.98431, 0.80000, 0.00000}, {0.98431, 0.80392, 0.00000}, {0.98431, 0.81176, 0.00000}, {0.98431, 0.81569, 0.00000}, {0.98431, 0.81961, 0.00000}, {0.98431, 0.82745, 0.00000}, {0.98431, 0.83137, 0.00000}, {0.98431, 0.83529, 0.00000}, {0.98431, 0.83922, 0.00000}, {0.98431, 0.84706, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98039, 0.85490, 0.00000}, {0.98039, 0.86275, 0.00000}, {0.98039, 0.86667, 0.00000}, {0.98039, 0.87059, 0.00000}, {0.98039, 0.87843, 0.00000}, {0.98039, 0.88235, 0.00000}, {0.98039, 0.88627, 0.00000}, {0.98039, 0.89020, 0.00000}, {0.98039, 0.89804, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.96471, 0.88627, 0.00000}, {0.94902, 0.87059, 0.00000}, {0.92941, 0.85490, 0.00000}, {0.91373, 0.83922, 0.00000}, {0.89804, 0.82745, 0.00000}, {0.88235, 0.81176, 0.00000}, {0.86275, 0.79608, 0.00000}, {0.84706, 0.78039, 0.00000}, {0.83137, 0.76471, 0.00000}, {0.81569, 0.74902, 0.00000}, {0.79608, 0.73333, 0.00000}, {0.78039, 0.71765, 0.00000}, {0.76471, 0.70196, 0.00000}, {0.74902, 0.68627, 0.00000}, {0.72941, 0.67451, 0.00000}, {0.71373, 0.65882, 0.00000}, {0.69804, 0.64314, 0.00000}, {0.68235, 0.62745, 0.00000}, {0.66275, 0.61176, 0.00000}, {0.64706, 0.59608, 0.00000}, {0.63137, 0.58039, 0.00000}, {0.61569, 0.56471, 0.00000}, {0.60000, 0.54902, 0.00000}, {0.58039, 0.53333, 0.00000}, {0.56471, 0.52157, 0.00000}, {0.54902, 0.50588, 0.00000}, {0.53333, 0.49020, 0.00000}, {0.51373, 0.47451, 0.00000}, {0.49804, 0.45882, 0.00000}, {0.48235, 0.44314, 0.00000}, {0.46667, 0.42745, 0.00000}, {0.44706, 0.41176, 0.00000}, {0.43137, 0.39608, 0.00000}, {0.41569, 0.38039, 0.00000}, {0.40000, 0.36863, 0.00000}, {0.38039, 0.35294, 0.00000}, {0.36471, 0.33725, 0.00000}, {0.34902, 0.32157, 0.00000}, {0.33333, 0.30588, 0.00000}, {0.31765, 0.29020, 0.00000}, {0.29804, 0.27451, 0.00000}, {0.28235, 0.25882, 0.00000}, {0.26667, 0.24314, 0.00000}, {0.25098, 0.22745, 0.00000}, {0.23137, 0.21569, 0.00000}, {0.21569, 0.20000, 0.00000}, {0.20000, 0.18431, 0.00000}, {0.18431, 0.16863, 0.00000}, {0.16471, 0.15294, 0.00000}, {0.14902, 0.13725, 0.00000}, {0.13333, 0.12157, 0.00000}, {0.11765, 0.10588, 0.00000}, {0.09804, 0.09020, 0.00000}, {0.08235, 0.07451, 0.00000}, {0.06667, 0.06275, 0.00000}, {0.05098, 0.04706, 0.00000}, {0.03137, 0.03137, 0.00000}, {0.01569, 0.01569, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, }; new ColorMapInfo("smooth.lasc", smooth_lasc); static RGBColor random1_lasc[] = { {0.00000, 0.00000, 0.16471}, {0.00000, 0.00000, 0.16471}, {0.00000, 0.00000, 0.16471}, {0.00000, 0.00000, 0.16471}, {0.00000, 0.00000, 0.16471}, {0.00000, 0.00000, 0.16471}, {0.00000, 0.00000, 0.16471}, {0.00000, 0.00000, 0.16471}, {0.23137, 0.00000, 0.31765}, {0.23137, 0.00000, 0.31765}, {0.23137, 0.00000, 0.31765}, {0.23137, 0.00000, 0.31765}, {0.23137, 0.00000, 0.31765}, {0.23137, 0.00000, 0.31765}, {0.23137, 0.00000, 0.31765}, {0.23137, 0.00000, 0.31765}, {0.47059, 0.00000, 0.47451}, {0.47059, 0.00000, 0.47451}, {0.47059, 0.00000, 0.47451}, {0.47059, 0.00000, 0.47451}, {0.47059, 0.00000, 0.47451}, {0.47059, 0.00000, 0.47451}, {0.47059, 0.00000, 0.47451}, {0.47059, 0.00000, 0.47451}, {0.47059, 0.00000, 0.63922}, {0.47059, 0.00000, 0.63922}, {0.47059, 0.00000, 0.63922}, {0.47059, 0.00000, 0.63922}, {0.47059, 0.00000, 0.63922}, {0.47059, 0.00000, 0.63922}, {0.47059, 0.00000, 0.63922}, {0.47059, 0.00000, 0.63922}, {0.23137, 0.00000, 0.80392}, {0.23137, 0.00000, 0.80392}, {0.23137, 0.00000, 0.80392}, {0.23137, 0.00000, 0.80392}, {0.23137, 0.00000, 0.80392}, {0.23137, 0.00000, 0.80392}, {0.23137, 0.00000, 0.80392}, {0.23137, 0.00000, 0.80392}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.05098, 0.85098}, {0.00000, 0.05098, 0.85098}, {0.00000, 0.05098, 0.85098}, {0.00000, 0.05098, 0.85098}, {0.00000, 0.05098, 0.85098}, {0.00000, 0.05098, 0.85098}, {0.00000, 0.05098, 0.85098}, {0.00000, 0.05098, 0.85098}, {0.00000, 0.19608, 0.69412}, {0.00000, 0.19608, 0.69412}, {0.00000, 0.19608, 0.69412}, {0.00000, 0.19608, 0.69412}, {0.00000, 0.19608, 0.69412}, {0.00000, 0.19608, 0.69412}, {0.00000, 0.19608, 0.69412}, {0.00000, 0.19608, 0.69412}, {0.00000, 0.33333, 0.56471}, {0.00000, 0.33333, 0.56471}, {0.00000, 0.33333, 0.56471}, {0.00000, 0.33333, 0.56471}, {0.00000, 0.33333, 0.56471}, {0.00000, 0.33333, 0.56471}, {0.00000, 0.33333, 0.56471}, {0.00000, 0.33333, 0.56471}, {0.00000, 0.42353, 0.44706}, {0.00000, 0.42353, 0.44706}, {0.00000, 0.42353, 0.44706}, {0.00000, 0.42353, 0.44706}, {0.00000, 0.42353, 0.44706}, {0.00000, 0.42353, 0.44706}, {0.00000, 0.42353, 0.44706}, {0.00000, 0.42353, 0.44706}, {0.00000, 0.50980, 0.35294}, {0.00000, 0.50980, 0.35294}, {0.00000, 0.50980, 0.35294}, {0.00000, 0.50980, 0.35294}, {0.00000, 0.50980, 0.35294}, {0.00000, 0.50980, 0.35294}, {0.00000, 0.50980, 0.35294}, {0.00000, 0.50980, 0.35294}, {0.00000, 0.59216, 0.25882}, {0.00000, 0.59216, 0.25882}, {0.00000, 0.59216, 0.25882}, {0.00000, 0.59216, 0.25882}, {0.00000, 0.59216, 0.25882}, {0.00000, 0.59216, 0.25882}, {0.00000, 0.59216, 0.25882}, {0.00000, 0.59216, 0.25882}, {0.00000, 0.67059, 0.16471}, {0.00000, 0.67059, 0.16471}, {0.00000, 0.67059, 0.16471}, {0.00000, 0.67059, 0.16471}, {0.00000, 0.67059, 0.16471}, {0.00000, 0.67059, 0.16471}, {0.00000, 0.67059, 0.16471}, {0.00000, 0.67059, 0.16471}, {0.00000, 0.74902, 0.05490}, {0.00000, 0.74902, 0.05490}, {0.00000, 0.74902, 0.05490}, {0.00000, 0.74902, 0.05490}, {0.00000, 0.74902, 0.05490}, {0.00000, 0.74902, 0.05490}, {0.00000, 0.74902, 0.05490}, {0.00000, 0.74902, 0.05490}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.05490, 0.95294, 0.00000}, {0.05490, 0.95294, 0.00000}, {0.05490, 0.95294, 0.00000}, {0.05490, 0.95294, 0.00000}, {0.05490, 0.95294, 0.00000}, {0.05490, 0.95294, 0.00000}, {0.05490, 0.95294, 0.00000}, {0.05490, 0.95294, 0.00000}, {0.14902, 0.88235, 0.00000}, {0.14902, 0.88235, 0.00000}, {0.14902, 0.88235, 0.00000}, {0.14902, 0.88235, 0.00000}, {0.14902, 0.88235, 0.00000}, {0.14902, 0.88235, 0.00000}, {0.14902, 0.88235, 0.00000}, {0.14902, 0.88235, 0.00000}, {0.41176, 0.80784, 0.00000}, {0.41176, 0.80784, 0.00000}, {0.41176, 0.80784, 0.00000}, {0.41176, 0.80784, 0.00000}, {0.41176, 0.80784, 0.00000}, {0.41176, 0.80784, 0.00000}, {0.41176, 0.80784, 0.00000}, {0.41176, 0.80784, 0.00000}, {0.70980, 0.81176, 0.00000}, {0.70980, 0.81176, 0.00000}, {0.70980, 0.81176, 0.00000}, {0.70980, 0.81176, 0.00000}, {0.70980, 0.81176, 0.00000}, {0.70980, 0.81176, 0.00000}, {0.70980, 0.81176, 0.00000}, {0.70980, 0.81176, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 0.70196, 0.00000}, {1.00000, 0.70196, 0.00000}, {1.00000, 0.70196, 0.00000}, {1.00000, 0.70196, 0.00000}, {1.00000, 0.70196, 0.00000}, {1.00000, 0.70196, 0.00000}, {1.00000, 0.70196, 0.00000}, {1.00000, 0.70196, 0.00000}, {1.00000, 0.39216, 0.00000}, {1.00000, 0.39216, 0.00000}, {1.00000, 0.39216, 0.00000}, {1.00000, 0.39216, 0.00000}, {1.00000, 0.39216, 0.00000}, {1.00000, 0.39216, 0.00000}, {1.00000, 0.39216, 0.00000}, {1.00000, 0.39216, 0.00000}, {1.00000, 0.09804, 0.00000}, {1.00000, 0.09804, 0.00000}, {1.00000, 0.09804, 0.00000}, {1.00000, 0.09804, 0.00000}, {1.00000, 0.09804, 0.00000}, {1.00000, 0.09804, 0.00000}, {1.00000, 0.09804, 0.00000}, {1.00000, 0.09804, 0.00000}, {0.97647, 0.00000, 0.00000}, {0.97647, 0.00000, 0.00000}, {0.97647, 0.00000, 0.00000}, {0.97647, 0.00000, 0.00000}, {0.97647, 0.00000, 0.00000}, {0.97647, 0.00000, 0.00000}, {0.97647, 0.00000, 0.00000}, {0.97647, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, }; new ColorMapInfo("random1.lasc", random1_lasc); static RGBColor real_lasc[] = { {0.00784, 0.00392, 0.00000}, {0.01569, 0.00784, 0.00000}, {0.02353, 0.01176, 0.00000}, {0.03137, 0.01569, 0.00000}, {0.03922, 0.01961, 0.00000}, {0.04706, 0.02353, 0.00000}, {0.05490, 0.02745, 0.00000}, {0.06275, 0.03137, 0.00000}, {0.07059, 0.03529, 0.00000}, {0.07843, 0.03922, 0.00000}, {0.08627, 0.04314, 0.00000}, {0.09412, 0.04706, 0.00000}, {0.10196, 0.05098, 0.00000}, {0.10980, 0.05490, 0.00000}, {0.11765, 0.05882, 0.00000}, {0.12549, 0.06275, 0.00000}, {0.13333, 0.06667, 0.00000}, {0.14118, 0.07059, 0.00000}, {0.14902, 0.07451, 0.00000}, {0.15686, 0.07843, 0.00000}, {0.16471, 0.08235, 0.00000}, {0.17255, 0.08627, 0.00000}, {0.18039, 0.09020, 0.00000}, {0.18824, 0.09412, 0.00000}, {0.19608, 0.09804, 0.00000}, {0.20392, 0.10196, 0.00000}, {0.21176, 0.10588, 0.00000}, {0.21961, 0.10980, 0.00000}, {0.22745, 0.11373, 0.00000}, {0.23529, 0.11765, 0.00000}, {0.24314, 0.12157, 0.00000}, {0.25098, 0.12549, 0.00000}, {0.25882, 0.12941, 0.00000}, {0.26667, 0.13333, 0.00000}, {0.27451, 0.13725, 0.00000}, {0.28235, 0.14118, 0.00000}, {0.29020, 0.14510, 0.00000}, {0.29804, 0.14902, 0.00000}, {0.30588, 0.15294, 0.00000}, {0.31373, 0.15686, 0.00000}, {0.32157, 0.16078, 0.00000}, {0.32941, 0.16471, 0.00000}, {0.33725, 0.16863, 0.00000}, {0.34510, 0.17255, 0.00000}, {0.35294, 0.17647, 0.00000}, {0.36078, 0.18039, 0.00000}, {0.36863, 0.18431, 0.00000}, {0.37647, 0.18824, 0.00000}, {0.38431, 0.19216, 0.00000}, {0.39216, 0.19608, 0.00000}, {0.40000, 0.20000, 0.00000}, {0.40784, 0.20392, 0.00000}, {0.41569, 0.20784, 0.00000}, {0.42353, 0.21176, 0.00000}, {0.43137, 0.21569, 0.00000}, {0.43922, 0.21961, 0.00000}, {0.44706, 0.22353, 0.00000}, {0.45490, 0.22745, 0.00000}, {0.46275, 0.23137, 0.00000}, {0.47059, 0.23529, 0.00000}, {0.47843, 0.23922, 0.00000}, {0.48627, 0.24314, 0.00000}, {0.49412, 0.24706, 0.00000}, {0.50196, 0.25098, 0.00000}, {0.50980, 0.25490, 0.00000}, {0.51765, 0.25882, 0.00000}, {0.52549, 0.26275, 0.00000}, {0.53333, 0.26667, 0.00000}, {0.54118, 0.27059, 0.00000}, {0.54902, 0.27451, 0.00000}, {0.55686, 0.27843, 0.00000}, {0.56471, 0.28235, 0.00000}, {0.57255, 0.28627, 0.00000}, {0.58039, 0.29020, 0.00000}, {0.58824, 0.29412, 0.00000}, {0.59608, 0.29804, 0.00000}, {0.60392, 0.30196, 0.00000}, {0.61176, 0.30588, 0.00000}, {0.61961, 0.30980, 0.00000}, {0.62745, 0.31373, 0.00000}, {0.63529, 0.31765, 0.00000}, {0.64314, 0.32157, 0.00000}, {0.65098, 0.32549, 0.00000}, {0.65882, 0.32941, 0.00000}, {0.66667, 0.33333, 0.00000}, {0.67451, 0.33725, 0.00000}, {0.68235, 0.34118, 0.00000}, {0.69020, 0.34510, 0.00000}, {0.69804, 0.34902, 0.00000}, {0.70588, 0.35294, 0.00000}, {0.71373, 0.35686, 0.00000}, {0.72157, 0.36078, 0.00000}, {0.72941, 0.36471, 0.00000}, {0.73725, 0.36863, 0.00000}, {0.74510, 0.37255, 0.00000}, {0.75294, 0.37647, 0.00000}, {0.76078, 0.38039, 0.00000}, {0.76863, 0.38431, 0.00000}, {0.77647, 0.38824, 0.00000}, {0.78431, 0.39216, 0.00000}, {0.79216, 0.39608, 0.00000}, {0.80000, 0.40000, 0.00000}, {0.80784, 0.40392, 0.00000}, {0.81569, 0.40784, 0.00000}, {0.82353, 0.41176, 0.00000}, {0.83137, 0.41569, 0.00000}, {0.83922, 0.41961, 0.00000}, {0.84706, 0.42353, 0.00000}, {0.85490, 0.42745, 0.00000}, {0.86275, 0.43137, 0.00000}, {0.87059, 0.43529, 0.00000}, {0.87843, 0.43922, 0.00000}, {0.88627, 0.44314, 0.00000}, {0.89412, 0.44706, 0.00000}, {0.90196, 0.45098, 0.00000}, {0.90980, 0.45490, 0.00000}, {0.91765, 0.45882, 0.00000}, {0.92549, 0.46275, 0.00000}, {0.93333, 0.46667, 0.00000}, {0.94118, 0.47059, 0.00000}, {0.94902, 0.47451, 0.00000}, {0.95686, 0.47843, 0.00000}, {0.96471, 0.48235, 0.00000}, {0.97255, 0.48627, 0.00000}, {0.98039, 0.49020, 0.00000}, {0.98824, 0.49412, 0.00000}, {0.99608, 0.49804, 0.00000}, {1.00000, 0.50196, 0.00000}, {1.00000, 0.50588, 0.00784}, {1.00000, 0.50980, 0.01569}, {1.00000, 0.51373, 0.02353}, {1.00000, 0.51765, 0.03137}, {1.00000, 0.52157, 0.03922}, {1.00000, 0.52549, 0.04706}, {1.00000, 0.52941, 0.05490}, {1.00000, 0.53333, 0.06275}, {1.00000, 0.53725, 0.07059}, {1.00000, 0.54118, 0.07843}, {1.00000, 0.54510, 0.08627}, {1.00000, 0.54902, 0.09412}, {1.00000, 0.55294, 0.10196}, {1.00000, 0.55686, 0.10980}, {1.00000, 0.56078, 0.11765}, {1.00000, 0.56471, 0.12549}, {1.00000, 0.56863, 0.13333}, {1.00000, 0.57255, 0.14118}, {1.00000, 0.57647, 0.14902}, {1.00000, 0.58039, 0.15686}, {1.00000, 0.58431, 0.16471}, {1.00000, 0.58824, 0.17255}, {1.00000, 0.59216, 0.18039}, {1.00000, 0.59608, 0.18824}, {1.00000, 0.60000, 0.19608}, {1.00000, 0.60392, 0.20392}, {1.00000, 0.60784, 0.21176}, {1.00000, 0.61176, 0.21961}, {1.00000, 0.61569, 0.22745}, {1.00000, 0.61961, 0.23529}, {1.00000, 0.62353, 0.24314}, {1.00000, 0.62745, 0.25098}, {1.00000, 0.63137, 0.25882}, {1.00000, 0.63529, 0.26667}, {1.00000, 0.63922, 0.27451}, {1.00000, 0.64314, 0.28235}, {1.00000, 0.64706, 0.29020}, {1.00000, 0.65098, 0.29804}, {1.00000, 0.65490, 0.30588}, {1.00000, 0.65882, 0.31373}, {1.00000, 0.66275, 0.32157}, {1.00000, 0.66667, 0.32941}, {1.00000, 0.67059, 0.33725}, {1.00000, 0.67451, 0.34510}, {1.00000, 0.67843, 0.35294}, {1.00000, 0.68235, 0.36078}, {1.00000, 0.68627, 0.36863}, {1.00000, 0.69020, 0.37647}, {1.00000, 0.69412, 0.38431}, {1.00000, 0.69804, 0.39216}, {1.00000, 0.70196, 0.40000}, {1.00000, 0.70588, 0.40784}, {1.00000, 0.70980, 0.41569}, {1.00000, 0.71373, 0.42353}, {1.00000, 0.71765, 0.43137}, {1.00000, 0.72157, 0.43922}, {1.00000, 0.72549, 0.44706}, {1.00000, 0.72941, 0.45490}, {1.00000, 0.73333, 0.46275}, {1.00000, 0.73725, 0.47059}, {1.00000, 0.74118, 0.47843}, {1.00000, 0.74510, 0.48627}, {1.00000, 0.74902, 0.49412}, {1.00000, 0.75294, 0.50196}, {1.00000, 0.75686, 0.50980}, {1.00000, 0.76078, 0.51765}, {1.00000, 0.76471, 0.52549}, {1.00000, 0.76863, 0.53333}, {1.00000, 0.77255, 0.54118}, {1.00000, 0.77647, 0.54902}, {1.00000, 0.78039, 0.55686}, {1.00000, 0.78431, 0.56471}, {1.00000, 0.78824, 0.57255}, {1.00000, 0.79216, 0.58039}, {1.00000, 0.79608, 0.58824}, {1.00000, 0.80000, 0.59608}, {1.00000, 0.80392, 0.60392}, {1.00000, 0.80784, 0.61176}, {1.00000, 0.81176, 0.61961}, {1.00000, 0.81569, 0.62745}, {1.00000, 0.81961, 0.63529}, {1.00000, 0.82353, 0.64314}, {1.00000, 0.82745, 0.65098}, {1.00000, 0.83137, 0.65882}, {1.00000, 0.83529, 0.66667}, {1.00000, 0.83922, 0.67451}, {1.00000, 0.84314, 0.68235}, {1.00000, 0.84706, 0.69020}, {1.00000, 0.85098, 0.69804}, {1.00000, 0.85490, 0.70588}, {1.00000, 0.85882, 0.71373}, {1.00000, 0.86275, 0.72157}, {1.00000, 0.86667, 0.72941}, {1.00000, 0.87059, 0.73725}, {1.00000, 0.87451, 0.74510}, {1.00000, 0.87843, 0.75294}, {1.00000, 0.88235, 0.76078}, {1.00000, 0.88627, 0.76863}, {1.00000, 0.89020, 0.77647}, {1.00000, 0.89412, 0.78431}, {1.00000, 0.89804, 0.79216}, {1.00000, 0.90196, 0.80000}, {1.00000, 0.90588, 0.80784}, {1.00000, 0.90980, 0.81569}, {1.00000, 0.91373, 0.82353}, {1.00000, 0.91765, 0.83137}, {1.00000, 0.92157, 0.83922}, {1.00000, 0.92549, 0.84706}, {1.00000, 0.92941, 0.85490}, {1.00000, 0.93333, 0.86275}, {1.00000, 0.93725, 0.87059}, {1.00000, 0.94118, 0.87843}, {1.00000, 0.94510, 0.88627}, {1.00000, 0.94902, 0.89412}, {1.00000, 0.95294, 0.90196}, {1.00000, 0.95686, 0.90980}, {1.00000, 0.96078, 0.91765}, {1.00000, 0.96471, 0.92549}, {1.00000, 0.96863, 0.93333}, {1.00000, 0.97255, 0.94118}, {1.00000, 0.97647, 0.94902}, {1.00000, 0.98039, 0.95686}, {1.00000, 0.98431, 0.96471}, {1.00000, 0.98824, 0.97255}, {1.00000, 0.99216, 0.98039}, {1.00000, 0.99608, 0.98824}, {1.00000, 1.00000, 0.99608}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("real.lasc", real_lasc); static RGBColor redlut_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00392, 0.00000, 0.00000}, {0.00784, 0.00000, 0.00000}, {0.01176, 0.00000, 0.00000}, {0.01569, 0.00000, 0.00000}, {0.01961, 0.00000, 0.00000}, {0.02353, 0.00000, 0.00000}, {0.02745, 0.00000, 0.00000}, {0.03137, 0.00000, 0.00000}, {0.03529, 0.00000, 0.00000}, {0.03922, 0.00000, 0.00000}, {0.04314, 0.00000, 0.00000}, {0.04706, 0.00000, 0.00000}, {0.05098, 0.00001, 0.00001}, {0.05490, 0.00001, 0.00001}, {0.05882, 0.00001, 0.00001}, {0.06275, 0.00002, 0.00002}, {0.06667, 0.00002, 0.00002}, {0.07059, 0.00002, 0.00002}, {0.07451, 0.00003, 0.00003}, {0.07843, 0.00004, 0.00004}, {0.08235, 0.00005, 0.00005}, {0.08627, 0.00006, 0.00006}, {0.09020, 0.00007, 0.00007}, {0.09412, 0.00008, 0.00008}, {0.09804, 0.00009, 0.00009}, {0.10196, 0.00011, 0.00011}, {0.10588, 0.00013, 0.00013}, {0.10980, 0.00015, 0.00015}, {0.11373, 0.00017, 0.00017}, {0.11765, 0.00019, 0.00019}, {0.12157, 0.00022, 0.00022}, {0.12549, 0.00025, 0.00025}, {0.12941, 0.00028, 0.00028}, {0.13333, 0.00032, 0.00032}, {0.13725, 0.00035, 0.00035}, {0.14118, 0.00040, 0.00040}, {0.14510, 0.00044, 0.00044}, {0.14902, 0.00049, 0.00049}, {0.15294, 0.00055, 0.00055}, {0.15686, 0.00061, 0.00061}, {0.16078, 0.00067, 0.00067}, {0.16471, 0.00074, 0.00074}, {0.16863, 0.00081, 0.00081}, {0.17255, 0.00089, 0.00089}, {0.17647, 0.00097, 0.00097}, {0.18039, 0.00106, 0.00106}, {0.18431, 0.00115, 0.00115}, {0.18824, 0.00126, 0.00126}, {0.19216, 0.00136, 0.00136}, {0.19608, 0.00148, 0.00148}, {0.20000, 0.00160, 0.00160}, {0.20392, 0.00173, 0.00173}, {0.20784, 0.00187, 0.00187}, {0.21176, 0.00201, 0.00201}, {0.21569, 0.00216, 0.00216}, {0.21961, 0.00233, 0.00233}, {0.22353, 0.00250, 0.00250}, {0.22745, 0.00268, 0.00268}, {0.23137, 0.00287, 0.00287}, {0.23529, 0.00307, 0.00307}, {0.23922, 0.00327, 0.00327}, {0.24314, 0.00349, 0.00349}, {0.24706, 0.00373, 0.00373}, {0.25098, 0.00397, 0.00397}, {0.25490, 0.00422, 0.00422}, {0.25882, 0.00449, 0.00449}, {0.26275, 0.00477, 0.00477}, {0.26667, 0.00506, 0.00506}, {0.27059, 0.00536, 0.00536}, {0.27451, 0.00568, 0.00568}, {0.27843, 0.00601, 0.00601}, {0.28235, 0.00636, 0.00636}, {0.28627, 0.00672, 0.00672}, {0.29020, 0.00709, 0.00709}, {0.29412, 0.00748, 0.00748}, {0.29804, 0.00789, 0.00789}, {0.30196, 0.00831, 0.00831}, {0.30588, 0.00875, 0.00875}, {0.30980, 0.00921, 0.00921}, {0.31373, 0.00969, 0.00969}, {0.31765, 0.01018, 0.01018}, {0.32157, 0.01069, 0.01069}, {0.32549, 0.01122, 0.01122}, {0.32941, 0.01177, 0.01177}, {0.33333, 0.01235, 0.01235}, {0.33725, 0.01294, 0.01294}, {0.34118, 0.01355, 0.01355}, {0.34510, 0.01418, 0.01418}, {0.34902, 0.01484, 0.01484}, {0.35294, 0.01552, 0.01552}, {0.35686, 0.01622, 0.01622}, {0.36078, 0.01694, 0.01694}, {0.36471, 0.01769, 0.01769}, {0.36863, 0.01847, 0.01847}, {0.37255, 0.01926, 0.01926}, {0.37647, 0.02009, 0.02009}, {0.38039, 0.02094, 0.02094}, {0.38431, 0.02181, 0.02181}, {0.38824, 0.02272, 0.02272}, {0.39216, 0.02365, 0.02365}, {0.39608, 0.02461, 0.02461}, {0.40000, 0.02560, 0.02560}, {0.40392, 0.02662, 0.02662}, {0.40784, 0.02767, 0.02767}, {0.41176, 0.02875, 0.02875}, {0.41569, 0.02986, 0.02986}, {0.41961, 0.03100, 0.03100}, {0.42353, 0.03218, 0.03218}, {0.42745, 0.03338, 0.03338}, {0.43137, 0.03463, 0.03463}, {0.43529, 0.03590, 0.03590}, {0.43922, 0.03721, 0.03721}, {0.44314, 0.03856, 0.03856}, {0.44706, 0.03994, 0.03994}, {0.45098, 0.04136, 0.04136}, {0.45490, 0.04282, 0.04282}, {0.45882, 0.04432, 0.04432}, {0.46275, 0.04585, 0.04585}, {0.46667, 0.04743, 0.04743}, {0.47059, 0.04904, 0.04904}, {0.47451, 0.05070, 0.05070}, {0.47843, 0.05239, 0.05239}, {0.48235, 0.05413, 0.05413}, {0.48627, 0.05591, 0.05591}, {0.49020, 0.05774, 0.05774}, {0.49412, 0.05961, 0.05961}, {0.49804, 0.06153, 0.06153}, {0.50196, 0.06349, 0.06349}, {0.50588, 0.06549, 0.06549}, {0.50980, 0.06755, 0.06755}, {0.51373, 0.06965, 0.06965}, {0.51765, 0.07180, 0.07180}, {0.52157, 0.07400, 0.07400}, {0.52549, 0.07625, 0.07625}, {0.52941, 0.07856, 0.07856}, {0.53333, 0.08091, 0.08091}, {0.53725, 0.08331, 0.08331}, {0.54118, 0.08577, 0.08577}, {0.54510, 0.08829, 0.08829}, {0.54902, 0.09086, 0.09086}, {0.55294, 0.09348, 0.09348}, {0.55686, 0.09616, 0.09616}, {0.56078, 0.09890, 0.09890}, {0.56471, 0.10169, 0.10169}, {0.56863, 0.10455, 0.10455}, {0.57255, 0.10746, 0.10746}, {0.57647, 0.11044, 0.11044}, {0.58039, 0.11347, 0.11347}, {0.58431, 0.11657, 0.11657}, {0.58824, 0.11973, 0.11973}, {0.59216, 0.12296, 0.12296}, {0.59608, 0.12624, 0.12624}, {0.60000, 0.12960, 0.12960}, {0.60392, 0.13302, 0.13302}, {0.60784, 0.13651, 0.13651}, {0.61176, 0.14007, 0.14007}, {0.61569, 0.14369, 0.14369}, {0.61961, 0.14739, 0.14739}, {0.62353, 0.15116, 0.15116}, {0.62745, 0.15500, 0.15500}, {0.63137, 0.15891, 0.15891}, {0.63529, 0.16289, 0.16289}, {0.63922, 0.16695, 0.16695}, {0.64314, 0.17109, 0.17109}, {0.64706, 0.17530, 0.17530}, {0.65098, 0.17959, 0.17959}, {0.65490, 0.18395, 0.18395}, {0.65882, 0.18840, 0.18840}, {0.66275, 0.19292, 0.19292}, {0.66667, 0.19753, 0.19753}, {0.67059, 0.20222, 0.20222}, {0.67451, 0.20699, 0.20699}, {0.67843, 0.21185, 0.21185}, {0.68235, 0.21679, 0.21679}, {0.68627, 0.22182, 0.22182}, {0.69020, 0.22693, 0.22693}, {0.69412, 0.23213, 0.23213}, {0.69804, 0.23742, 0.23742}, {0.70196, 0.24280, 0.24280}, {0.70588, 0.24827, 0.24827}, {0.70980, 0.25384, 0.25384}, {0.71373, 0.25949, 0.25949}, {0.71765, 0.26524, 0.26524}, {0.72157, 0.27109, 0.27109}, {0.72549, 0.27703, 0.27703}, {0.72941, 0.28307, 0.28307}, {0.73333, 0.28920, 0.28920}, {0.73725, 0.29544, 0.29544}, {0.74118, 0.30178, 0.30178}, {0.74510, 0.30821, 0.30821}, {0.74902, 0.31476, 0.31476}, {0.75294, 0.32140, 0.32140}, {0.75686, 0.32815, 0.32815}, {0.76078, 0.33500, 0.33500}, {0.76471, 0.34196, 0.34196}, {0.76863, 0.34903, 0.34903}, {0.77255, 0.35621, 0.35621}, {0.77647, 0.36350, 0.36350}, {0.78039, 0.37090, 0.37090}, {0.78431, 0.37841, 0.37841}, {0.78824, 0.38603, 0.38603}, {0.79216, 0.39377, 0.39377}, {0.79608, 0.40163, 0.40163}, {0.80000, 0.40960, 0.40960}, {0.80392, 0.41769, 0.41769}, {0.80784, 0.42590, 0.42590}, {0.81176, 0.43423, 0.43423}, {0.81569, 0.44268, 0.44268}, {0.81961, 0.45126, 0.45126}, {0.82353, 0.45996, 0.45996}, {0.82745, 0.46878, 0.46878}, {0.83137, 0.47773, 0.47773}, {0.83529, 0.48681, 0.48681}, {0.83922, 0.49601, 0.49601}, {0.84314, 0.50535, 0.50535}, {0.84706, 0.51482, 0.51482}, {0.85098, 0.52442, 0.52442}, {0.85490, 0.53415, 0.53415}, {0.85882, 0.54402, 0.54402}, {0.86275, 0.55403, 0.55403}, {0.86667, 0.56417, 0.56417}, {0.87059, 0.57445, 0.57445}, {0.87451, 0.58487, 0.58487}, {0.87843, 0.59543, 0.59543}, {0.88235, 0.60613, 0.60613}, {0.88627, 0.61698, 0.61698}, {0.89020, 0.62798, 0.62798}, {0.89412, 0.63911, 0.63911}, {0.89804, 0.65040, 0.65040}, {0.90196, 0.66184, 0.66184}, {0.90588, 0.67342, 0.67342}, {0.90980, 0.68516, 0.68516}, {0.91373, 0.69705, 0.69705}, {0.91765, 0.70909, 0.70909}, {0.92157, 0.72129, 0.72129}, {0.92549, 0.73365, 0.73365}, {0.92941, 0.74616, 0.74616}, {0.93333, 0.75883, 0.75883}, {0.93725, 0.77167, 0.77167}, {0.94118, 0.78466, 0.78466}, {0.94510, 0.79782, 0.79782}, {0.94902, 0.81115, 0.81115}, {0.95294, 0.82464, 0.82464}, {0.95686, 0.83830, 0.83830}, {0.96078, 0.85213, 0.85213}, {0.96471, 0.86612, 0.86612}, {0.96863, 0.88029, 0.88029}, {0.97255, 0.89464, 0.89464}, {0.97647, 0.90915, 0.90915}, {0.98039, 0.92385, 0.92385}, {0.98431, 0.93872, 0.93872}, {0.98824, 0.95377, 0.95377}, {0.99216, 0.96899, 0.96899}, {0.99608, 0.98441, 0.98441}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("redlut.lasc", redlut_lasc); static RGBColor rainbow_lasc[] = { {0.00000, 0.00000, 0.16471}, {0.02745, 0.00000, 0.18431}, {0.05882, 0.00000, 0.20000}, {0.08627, 0.00000, 0.21961}, {0.11373, 0.00000, 0.23922}, {0.14510, 0.00000, 0.25882}, {0.17647, 0.00000, 0.27843}, {0.20392, 0.00000, 0.29804}, {0.23137, 0.00000, 0.31765}, {0.26275, 0.00000, 0.33725}, {0.29412, 0.00000, 0.35686}, {0.32157, 0.00000, 0.37647}, {0.35294, 0.00000, 0.39608}, {0.38039, 0.00000, 0.41569}, {0.41176, 0.00000, 0.43529}, {0.43922, 0.00000, 0.45490}, {0.47059, 0.00000, 0.47451}, {0.49804, 0.00000, 0.49412}, {0.52941, 0.00000, 0.51373}, {0.55686, 0.00000, 0.53725}, {0.58824, 0.00000, 0.55686}, {0.55686, 0.00000, 0.57647}, {0.52941, 0.00000, 0.59608}, {0.49804, 0.00000, 0.61569}, {0.47059, 0.00000, 0.63922}, {0.43922, 0.00000, 0.65882}, {0.41176, 0.00000, 0.67843}, {0.38039, 0.00000, 0.70196}, {0.35294, 0.00000, 0.72157}, {0.32157, 0.00000, 0.74118}, {0.29412, 0.00000, 0.76471}, {0.26275, 0.00000, 0.78431}, {0.23137, 0.00000, 0.80392}, {0.20392, 0.00000, 0.82745}, {0.17647, 0.00000, 0.84706}, {0.14510, 0.00000, 0.87059}, {0.11373, 0.00000, 0.89020}, {0.08627, 0.00000, 0.91373}, {0.05882, 0.00000, 0.93333}, {0.02745, 0.00000, 0.95686}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.02353, 0.97647}, {0.00000, 0.04706, 0.95686}, {0.00000, 0.06275, 0.93333}, {0.00000, 0.08235, 0.91373}, {0.00000, 0.09804, 0.89020}, {0.00000, 0.11373, 0.87059}, {0.00000, 0.12941, 0.84706}, {0.00000, 0.14118, 0.82745}, {0.00000, 0.15686, 0.80392}, {0.00000, 0.16863, 0.78431}, {0.00000, 0.18431, 0.76471}, {0.00000, 0.19608, 0.74118}, {0.00000, 0.21176, 0.72157}, {0.00000, 0.22353, 0.70196}, {0.00000, 0.23529, 0.67843}, {0.00000, 0.25098, 0.65882}, {0.00000, 0.26275, 0.63922}, {0.00000, 0.27451, 0.61569}, {0.00000, 0.28627, 0.59608}, {0.00000, 0.29804, 0.57647}, {0.00000, 0.30980, 0.55686}, {0.00000, 0.32157, 0.53725}, {0.00000, 0.33333, 0.51373}, {0.00000, 0.34510, 0.49412}, {0.00000, 0.35686, 0.47451}, {0.00000, 0.36863, 0.45490}, {0.00000, 0.38039, 0.43529}, {0.00000, 0.39216, 0.41569}, {0.00000, 0.40392, 0.39608}, {0.00000, 0.41176, 0.37647}, {0.00000, 0.42353, 0.35686}, {0.00000, 0.43529, 0.33725}, {0.00000, 0.44706, 0.31765}, {0.00000, 0.45882, 0.29804}, {0.00000, 0.46667, 0.27843}, {0.00000, 0.47843, 0.25882}, {0.00000, 0.49020, 0.23922}, {0.00000, 0.49804, 0.21961}, {0.00000, 0.50980, 0.20000}, {0.00000, 0.52157, 0.18431}, {0.00000, 0.52941, 0.16471}, {0.00000, 0.54118, 0.14510}, {0.00000, 0.55294, 0.12941}, {0.00000, 0.56078, 0.10980}, {0.00000, 0.57255, 0.09412}, {0.00000, 0.58431, 0.07451}, {0.00000, 0.59216, 0.05882}, {0.00000, 0.60392, 0.04314}, {0.00000, 0.61176, 0.02745}, {0.00000, 0.62353, 0.01176}, {0.00000, 0.63137, 0.00000}, {0.00000, 0.64314, 0.00000}, {0.00000, 0.65098, 0.00000}, {0.00000, 0.66275, 0.00000}, {0.00000, 0.67059, 0.00000}, {0.00000, 0.68235, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.70196, 0.00000}, {0.00000, 0.70980, 0.00000}, {0.00000, 0.72157, 0.00000}, {0.00000, 0.72941, 0.00000}, {0.00000, 0.74118, 0.00000}, {0.00000, 0.74902, 0.00000}, {0.00000, 0.76078, 0.00000}, {0.00000, 0.76863, 0.00000}, {0.00000, 0.77647, 0.00000}, {0.00000, 0.78824, 0.00000}, {0.00000, 0.79608, 0.00000}, {0.00000, 0.80784, 0.00000}, {0.00000, 0.81569, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.83529, 0.00000}, {0.00000, 0.84314, 0.00000}, {0.00000, 0.85490, 0.00000}, {0.00000, 0.86275, 0.00000}, {0.00000, 0.87059, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.89020, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.90980, 0.00000}, {0.00000, 0.91765, 0.00000}, {0.00000, 0.92549, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.94510, 0.00000}, {0.00000, 0.95294, 0.00000}, {0.00000, 0.96078, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.98039, 0.00000}, {0.00000, 0.98824, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 0.98824, 0.00000}, {0.00000, 0.98039, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.96078, 0.00000}, {0.00000, 0.95294, 0.00000}, {0.00000, 0.94510, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.92549, 0.00000}, {0.00000, 0.91765, 0.00000}, {0.00000, 0.90980, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.89020, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.87059, 0.00000}, {0.00000, 0.86275, 0.00000}, {0.00000, 0.85490, 0.00000}, {0.00000, 0.84314, 0.00000}, {0.00000, 0.83529, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.81569, 0.00000}, {0.00000, 0.80784, 0.00000}, {0.00000, 0.79608, 0.00000}, {0.00000, 0.78824, 0.00000}, {0.00000, 0.77647, 0.00000}, {0.00784, 0.76863, 0.00000}, {0.03529, 0.77647, 0.00000}, {0.06667, 0.78824, 0.00000}, {0.09804, 0.80000, 0.00000}, {0.12941, 0.81176, 0.00000}, {0.16471, 0.82745, 0.00000}, {0.20000, 0.84314, 0.00000}, {0.23529, 0.85882, 0.00000}, {0.26667, 0.87059, 0.00000}, {0.30588, 0.89020, 0.00000}, {0.34118, 0.90196, 0.00000}, {0.37647, 0.92157, 0.00000}, {0.41176, 0.93333, 0.00000}, {0.44706, 0.95294, 0.00000}, {0.48627, 0.96863, 0.00000}, {0.52157, 0.98824, 0.00000}, {0.56078, 1.00000, 0.00000}, {0.59608, 1.00000, 0.00000}, {0.63529, 1.00000, 0.00000}, {0.67059, 1.00000, 0.00000}, {0.70980, 1.00000, 0.00000}, {0.74902, 1.00000, 0.00000}, {0.78431, 1.00000, 0.00000}, {0.82353, 1.00000, 0.00000}, {0.85882, 1.00000, 0.00000}, {0.89804, 1.00000, 0.00000}, {0.93333, 1.00000, 0.00000}, {0.97647, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.99608, 1.00000, 0.00000}, {0.98039, 1.00000, 0.00000}, {0.96078, 0.97647, 0.00000}, {0.94510, 0.93725, 0.00000}, {0.92549, 0.89804, 0.00000}, {0.90980, 0.85882, 0.00000}, {0.89412, 0.81961, 0.00000}, {0.87451, 0.78039, 0.00000}, {0.85882, 0.74118, 0.00000}, {0.83922, 0.70196, 0.00000}, {0.82353, 0.66275, 0.00000}, {0.80392, 0.62353, 0.00000}, {0.78824, 0.58431, 0.00000}, {0.76863, 0.54510, 0.00000}, {0.75686, 0.50980, 0.00000}, {0.74118, 0.46667, 0.00000}, {0.72549, 0.43137, 0.00000}, {0.70980, 0.39216, 0.00000}, {0.69412, 0.35294, 0.00000}, {0.68235, 0.31765, 0.00000}, {0.66275, 0.27451, 0.00000}, {0.65098, 0.23922, 0.00000}, {0.63529, 0.20000, 0.00000}, {0.62745, 0.16863, 0.00000}, {0.61569, 0.12941, 0.00000}, {0.60784, 0.09804, 0.00000}, {0.61961, 0.08235, 0.00000}, {0.62745, 0.06275, 0.00000}, {0.63922, 0.04706, 0.00000}, {0.64706, 0.02353, 0.00000}, {0.65882, 0.00000, 0.00000}, {0.66667, 0.00000, 0.00000}, {0.67843, 0.00000, 0.00000}, {0.68627, 0.00000, 0.00000}, {0.69804, 0.00000, 0.00000}, {0.70980, 0.00000, 0.00000}, {0.71765, 0.00000, 0.00000}, {0.72941, 0.00000, 0.00000}, {0.73725, 0.00000, 0.00000}, {0.74902, 0.00000, 0.00000}, {0.75686, 0.00000, 0.00000}, {0.76863, 0.00000, 0.00000}, {0.77647, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.80000, 0.00784, 0.00784}, {0.80784, 0.02745, 0.02745}, {0.81961, 0.05098, 0.05098}, {0.82745, 0.08235, 0.08235}, {0.83922, 0.11373, 0.11373}, {0.84706, 0.14902, 0.14902}, {0.85882, 0.19216, 0.19216}, {0.86667, 0.23137, 0.23137}, {0.87843, 0.27843, 0.27843}, {0.88627, 0.32549, 0.32549}, {0.89804, 0.37647, 0.37647}, {0.90980, 0.43137, 0.43137}, {0.91765, 0.48627, 0.48627}, {0.92941, 0.54118, 0.54118}, {0.93725, 0.60000, 0.60000}, {0.94902, 0.66275, 0.66275}, {0.95686, 0.72549, 0.72549}, {0.96863, 0.79216, 0.79216}, {0.97647, 0.85882, 0.85882}, {0.98824, 0.92941, 0.92941}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("rainbow.lasc", rainbow_lasc); static RGBColor greenlut_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00392, 0.00000}, {0.00000, 0.00784, 0.00000}, {0.00000, 0.01176, 0.00000}, {0.00000, 0.01569, 0.00000}, {0.00000, 0.01961, 0.00000}, {0.00000, 0.02353, 0.00000}, {0.00000, 0.02745, 0.00000}, {0.00000, 0.03137, 0.00000}, {0.00000, 0.03529, 0.00000}, {0.00000, 0.03922, 0.00000}, {0.00000, 0.04314, 0.00000}, {0.00000, 0.04706, 0.00000}, {0.00001, 0.05098, 0.00001}, {0.00001, 0.05490, 0.00001}, {0.00001, 0.05882, 0.00001}, {0.00002, 0.06275, 0.00002}, {0.00002, 0.06667, 0.00002}, {0.00002, 0.07059, 0.00002}, {0.00003, 0.07451, 0.00003}, {0.00004, 0.07843, 0.00004}, {0.00005, 0.08235, 0.00005}, {0.00006, 0.08627, 0.00006}, {0.00007, 0.09020, 0.00007}, {0.00008, 0.09412, 0.00008}, {0.00009, 0.09804, 0.00009}, {0.00011, 0.10196, 0.00011}, {0.00013, 0.10588, 0.00013}, {0.00015, 0.10980, 0.00015}, {0.00017, 0.11373, 0.00017}, {0.00019, 0.11765, 0.00019}, {0.00022, 0.12157, 0.00022}, {0.00025, 0.12549, 0.00025}, {0.00028, 0.12941, 0.00028}, {0.00032, 0.13333, 0.00032}, {0.00035, 0.13725, 0.00035}, {0.00040, 0.14118, 0.00040}, {0.00044, 0.14510, 0.00044}, {0.00049, 0.14902, 0.00049}, {0.00055, 0.15294, 0.00055}, {0.00061, 0.15686, 0.00061}, {0.00067, 0.16078, 0.00067}, {0.00074, 0.16471, 0.00074}, {0.00081, 0.16863, 0.00081}, {0.00089, 0.17255, 0.00089}, {0.00097, 0.17647, 0.00097}, {0.00106, 0.18039, 0.00106}, {0.00115, 0.18431, 0.00115}, {0.00126, 0.18824, 0.00126}, {0.00136, 0.19216, 0.00136}, {0.00148, 0.19608, 0.00148}, {0.00160, 0.20000, 0.00160}, {0.00173, 0.20392, 0.00173}, {0.00187, 0.20784, 0.00187}, {0.00201, 0.21176, 0.00201}, {0.00216, 0.21569, 0.00216}, {0.00233, 0.21961, 0.00233}, {0.00250, 0.22353, 0.00250}, {0.00268, 0.22745, 0.00268}, {0.00287, 0.23137, 0.00287}, {0.00307, 0.23529, 0.00307}, {0.00327, 0.23922, 0.00327}, {0.00349, 0.24314, 0.00349}, {0.00373, 0.24706, 0.00373}, {0.00397, 0.25098, 0.00397}, {0.00422, 0.25490, 0.00422}, {0.00449, 0.25882, 0.00449}, {0.00477, 0.26275, 0.00477}, {0.00506, 0.26667, 0.00506}, {0.00536, 0.27059, 0.00536}, {0.00568, 0.27451, 0.00568}, {0.00601, 0.27843, 0.00601}, {0.00636, 0.28235, 0.00636}, {0.00672, 0.28627, 0.00672}, {0.00709, 0.29020, 0.00709}, {0.00748, 0.29412, 0.00748}, {0.00789, 0.29804, 0.00789}, {0.00831, 0.30196, 0.00831}, {0.00875, 0.30588, 0.00875}, {0.00921, 0.30980, 0.00921}, {0.00969, 0.31373, 0.00969}, {0.01018, 0.31765, 0.01018}, {0.01069, 0.32157, 0.01069}, {0.01122, 0.32549, 0.01122}, {0.01177, 0.32941, 0.01177}, {0.01235, 0.33333, 0.01235}, {0.01294, 0.33725, 0.01294}, {0.01355, 0.34118, 0.01355}, {0.01418, 0.34510, 0.01418}, {0.01484, 0.34902, 0.01484}, {0.01552, 0.35294, 0.01552}, {0.01622, 0.35686, 0.01622}, {0.01694, 0.36078, 0.01694}, {0.01769, 0.36471, 0.01769}, {0.01847, 0.36863, 0.01847}, {0.01926, 0.37255, 0.01926}, {0.02009, 0.37647, 0.02009}, {0.02094, 0.38039, 0.02094}, {0.02181, 0.38431, 0.02181}, {0.02272, 0.38824, 0.02272}, {0.02365, 0.39216, 0.02365}, {0.02461, 0.39608, 0.02461}, {0.02560, 0.40000, 0.02560}, {0.02662, 0.40392, 0.02662}, {0.02767, 0.40784, 0.02767}, {0.02875, 0.41176, 0.02875}, {0.02986, 0.41569, 0.02986}, {0.03100, 0.41961, 0.03100}, {0.03218, 0.42353, 0.03218}, {0.03338, 0.42745, 0.03338}, {0.03463, 0.43137, 0.03463}, {0.03590, 0.43529, 0.03590}, {0.03721, 0.43922, 0.03721}, {0.03856, 0.44314, 0.03856}, {0.03994, 0.44706, 0.03994}, {0.04136, 0.45098, 0.04136}, {0.04282, 0.45490, 0.04282}, {0.04432, 0.45882, 0.04432}, {0.04585, 0.46275, 0.04585}, {0.04743, 0.46667, 0.04743}, {0.04904, 0.47059, 0.04904}, {0.05070, 0.47451, 0.05070}, {0.05239, 0.47843, 0.05239}, {0.05413, 0.48235, 0.05413}, {0.05591, 0.48627, 0.05591}, {0.05774, 0.49020, 0.05774}, {0.05961, 0.49412, 0.05961}, {0.06153, 0.49804, 0.06153}, {0.06349, 0.50196, 0.06349}, {0.06549, 0.50588, 0.06549}, {0.06755, 0.50980, 0.06755}, {0.06965, 0.51373, 0.06965}, {0.07180, 0.51765, 0.07180}, {0.07400, 0.52157, 0.07400}, {0.07625, 0.52549, 0.07625}, {0.07856, 0.52941, 0.07856}, {0.08091, 0.53333, 0.08091}, {0.08331, 0.53725, 0.08331}, {0.08577, 0.54118, 0.08577}, {0.08829, 0.54510, 0.08829}, {0.09086, 0.54902, 0.09086}, {0.09348, 0.55294, 0.09348}, {0.09616, 0.55686, 0.09616}, {0.09890, 0.56078, 0.09890}, {0.10169, 0.56471, 0.10169}, {0.10455, 0.56863, 0.10455}, {0.10746, 0.57255, 0.10746}, {0.11044, 0.57647, 0.11044}, {0.11347, 0.58039, 0.11347}, {0.11657, 0.58431, 0.11657}, {0.11973, 0.58824, 0.11973}, {0.12296, 0.59216, 0.12296}, {0.12624, 0.59608, 0.12624}, {0.12960, 0.60000, 0.12960}, {0.13302, 0.60392, 0.13302}, {0.13651, 0.60784, 0.13651}, {0.14007, 0.61176, 0.14007}, {0.14369, 0.61569, 0.14369}, {0.14739, 0.61961, 0.14739}, {0.15116, 0.62353, 0.15116}, {0.15500, 0.62745, 0.15500}, {0.15891, 0.63137, 0.15891}, {0.16289, 0.63529, 0.16289}, {0.16695, 0.63922, 0.16695}, {0.17109, 0.64314, 0.17109}, {0.17530, 0.64706, 0.17530}, {0.17959, 0.65098, 0.17959}, {0.18395, 0.65490, 0.18395}, {0.18840, 0.65882, 0.18840}, {0.19292, 0.66275, 0.19292}, {0.19753, 0.66667, 0.19753}, {0.20222, 0.67059, 0.20222}, {0.20699, 0.67451, 0.20699}, {0.21185, 0.67843, 0.21185}, {0.21679, 0.68235, 0.21679}, {0.22182, 0.68627, 0.22182}, {0.22693, 0.69020, 0.22693}, {0.23213, 0.69412, 0.23213}, {0.23742, 0.69804, 0.23742}, {0.24280, 0.70196, 0.24280}, {0.24827, 0.70588, 0.24827}, {0.25384, 0.70980, 0.25384}, {0.25949, 0.71373, 0.25949}, {0.26524, 0.71765, 0.26524}, {0.27109, 0.72157, 0.27109}, {0.27703, 0.72549, 0.27703}, {0.28307, 0.72941, 0.28307}, {0.28920, 0.73333, 0.28920}, {0.29544, 0.73725, 0.29544}, {0.30178, 0.74118, 0.30178}, {0.30821, 0.74510, 0.30821}, {0.31476, 0.74902, 0.31476}, {0.32140, 0.75294, 0.32140}, {0.32815, 0.75686, 0.32815}, {0.33500, 0.76078, 0.33500}, {0.34196, 0.76471, 0.34196}, {0.34903, 0.76863, 0.34903}, {0.35621, 0.77255, 0.35621}, {0.36350, 0.77647, 0.36350}, {0.37090, 0.78039, 0.37090}, {0.37841, 0.78431, 0.37841}, {0.38603, 0.78824, 0.38603}, {0.39377, 0.79216, 0.39377}, {0.40163, 0.79608, 0.40163}, {0.40960, 0.80000, 0.40960}, {0.41769, 0.80392, 0.41769}, {0.42590, 0.80784, 0.42590}, {0.43423, 0.81176, 0.43423}, {0.44268, 0.81569, 0.44268}, {0.45126, 0.81961, 0.45126}, {0.45996, 0.82353, 0.45996}, {0.46878, 0.82745, 0.46878}, {0.47773, 0.83137, 0.47773}, {0.48681, 0.83529, 0.48681}, {0.49601, 0.83922, 0.49601}, {0.50535, 0.84314, 0.50535}, {0.51482, 0.84706, 0.51482}, {0.52442, 0.85098, 0.52442}, {0.53415, 0.85490, 0.53415}, {0.54402, 0.85882, 0.54402}, {0.55403, 0.86275, 0.55403}, {0.56417, 0.86667, 0.56417}, {0.57445, 0.87059, 0.57445}, {0.58487, 0.87451, 0.58487}, {0.59543, 0.87843, 0.59543}, {0.60613, 0.88235, 0.60613}, {0.61698, 0.88627, 0.61698}, {0.62798, 0.89020, 0.62798}, {0.63911, 0.89412, 0.63911}, {0.65040, 0.89804, 0.65040}, {0.66184, 0.90196, 0.66184}, {0.67342, 0.90588, 0.67342}, {0.68516, 0.90980, 0.68516}, {0.69705, 0.91373, 0.69705}, {0.70909, 0.91765, 0.70909}, {0.72129, 0.92157, 0.72129}, {0.73365, 0.92549, 0.73365}, {0.74616, 0.92941, 0.74616}, {0.75883, 0.93333, 0.75883}, {0.77167, 0.93725, 0.77167}, {0.78466, 0.94118, 0.78466}, {0.79782, 0.94510, 0.79782}, {0.81115, 0.94902, 0.81115}, {0.82464, 0.95294, 0.82464}, {0.83830, 0.95686, 0.83830}, {0.85213, 0.96078, 0.85213}, {0.86612, 0.96471, 0.86612}, {0.88029, 0.96863, 0.88029}, {0.89464, 0.97255, 0.89464}, {0.90915, 0.97647, 0.90915}, {0.92385, 0.98039, 0.92385}, {0.93872, 0.98431, 0.93872}, {0.95377, 0.98824, 0.95377}, {0.96899, 0.99216, 0.96899}, {0.98441, 0.99608, 0.98441}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("greenlut.lasc", greenlut_lasc); static RGBColor color_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.18431, 0.18431, 0.18431}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.37255, 0.37255, 0.37255}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.56078, 0.56078, 0.56078}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.74902, 0.74902, 0.74902}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.93725, 0.93725, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.18431, 0.93725}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.37255, 0.74902}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.74902, 0.30980}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.30980, 0.62353, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.49804, 0.49804, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.62353, 0.30980, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, {0.74902, 0.00000, 0.30980}, }; new ColorMapInfo("color.lasc", color_lasc); static RGBColor smooth1_lasc[] = { {0.30980, 0.29020, 0.22353}, {0.32157, 0.30196, 0.23922}, {0.33333, 0.31765, 0.25490}, {0.34510, 0.32941, 0.27059}, {0.35686, 0.34510, 0.29020}, {0.36863, 0.36078, 0.30588}, {0.38039, 0.37647, 0.32549}, {0.39216, 0.38824, 0.34510}, {0.40392, 0.40392, 0.36471}, {0.41569, 0.41961, 0.38431}, {0.42745, 0.43529, 0.40392}, {0.43922, 0.45098, 0.42353}, {0.45098, 0.46667, 0.44314}, {0.46275, 0.48235, 0.46667}, {0.47451, 0.49804, 0.48627}, {0.49020, 0.51765, 0.50980}, {0.50196, 0.53333, 0.53333}, {0.51373, 0.54902, 0.55686}, {0.52549, 0.56863, 0.58039}, {0.54118, 0.58431, 0.60392}, {0.55294, 0.60000, 0.62745}, {0.56863, 0.61961, 0.65098}, {0.58039, 0.63529, 0.67843}, {0.59216, 0.65490, 0.70196}, {0.60784, 0.67059, 0.72941}, {0.61961, 0.69020, 0.75686}, {0.63529, 0.70980, 0.78431}, {0.64706, 0.72549, 0.75686}, {0.66275, 0.74510, 0.72941}, {0.67843, 0.76471, 0.70588}, {0.69020, 0.78431, 0.68235}, {0.70588, 0.80392, 0.65882}, {0.71765, 0.82353, 0.64314}, {0.73333, 0.80392, 0.62353}, {0.74902, 0.78824, 0.60392}, {0.76471, 0.77255, 0.58824}, {0.77647, 0.75686, 0.57255}, {0.79216, 0.74118, 0.55686}, {0.80784, 0.73333, 0.54118}, {0.82353, 0.71765, 0.52941}, {0.83922, 0.70588, 0.51373}, {0.85490, 0.69804, 0.50588}, {0.87059, 0.68235, 0.49412}, {0.85490, 0.67451, 0.48627}, {0.83922, 0.66667, 0.47843}, {0.82745, 0.65882, 0.47059}, {0.81569, 0.65098, 0.46275}, {0.80392, 0.63922, 0.45882}, {0.79216, 0.63529, 0.45490}, {0.78431, 0.62745, 0.45098}, {0.77255, 0.61961, 0.44706}, {0.76078, 0.61176, 0.44706}, {0.74902, 0.60784, 0.44706}, {0.74510, 0.60392, 0.44706}, {0.73333, 0.60000, 0.44706}, {0.72941, 0.59608, 0.45098}, {0.71765, 0.59216, 0.45490}, {0.70980, 0.58824, 0.45882}, {0.70588, 0.58824, 0.46275}, {0.69412, 0.58431, 0.47059}, {0.69020, 0.58039, 0.47843}, {0.68235, 0.58039, 0.48627}, {0.67843, 0.58039, 0.49412}, {0.67451, 0.57647, 0.50588}, {0.66667, 0.58039, 0.51373}, {0.66275, 0.57647, 0.52941}, {0.65490, 0.58039, 0.54118}, {0.65098, 0.58039, 0.55686}, {0.64706, 0.58039, 0.57255}, {0.64314, 0.58431, 0.58824}, {0.63529, 0.58824, 0.60392}, {0.63529, 0.58824, 0.62353}, {0.63137, 0.59216, 0.64314}, {0.62745, 0.59608, 0.65882}, {0.62745, 0.60000, 0.68235}, {0.62353, 0.60392, 0.70588}, {0.62353, 0.60784, 0.72941}, {0.61961, 0.61176, 0.75686}, {0.61961, 0.61961, 0.78431}, {0.61569, 0.62745, 0.75686}, {0.61569, 0.63529, 0.72941}, {0.61176, 0.63922, 0.70588}, {0.61176, 0.65098, 0.68235}, {0.61176, 0.65882, 0.65882}, {0.61176, 0.66667, 0.64314}, {0.61176, 0.67451, 0.62353}, {0.61176, 0.68235, 0.60392}, {0.61176, 0.69804, 0.58824}, {0.61176, 0.70588, 0.57255}, {0.61569, 0.71765, 0.55686}, {0.61569, 0.73333, 0.54118}, {0.61961, 0.74118, 0.52941}, {0.61961, 0.75686, 0.51373}, {0.62353, 0.77255, 0.50588}, {0.62353, 0.78824, 0.49412}, {0.62745, 0.80392, 0.48627}, {0.62745, 0.82353, 0.47843}, {0.63137, 0.80392, 0.47059}, {0.63529, 0.78824, 0.46275}, {0.63529, 0.77255, 0.45882}, {0.64314, 0.75686, 0.45490}, {0.64706, 0.74118, 0.45098}, {0.65098, 0.73333, 0.44706}, {0.65490, 0.71765, 0.44706}, {0.66275, 0.70588, 0.44706}, {0.66667, 0.69804, 0.44706}, {0.67451, 0.68235, 0.44706}, {0.67843, 0.67451, 0.45098}, {0.68235, 0.66667, 0.45490}, {0.69020, 0.65882, 0.45882}, {0.69412, 0.65098, 0.46275}, {0.70588, 0.63922, 0.47059}, {0.70980, 0.63529, 0.47843}, {0.71765, 0.62745, 0.48627}, {0.72941, 0.61961, 0.49412}, {0.73333, 0.61176, 0.50588}, {0.74510, 0.60784, 0.51373}, {0.74902, 0.60392, 0.52941}, {0.76078, 0.60000, 0.54118}, {0.77647, 0.59608, 0.55686}, {0.79216, 0.59216, 0.57255}, {0.80392, 0.58824, 0.58824}, {0.81961, 0.58824, 0.60392}, {0.83922, 0.58431, 0.62353}, {0.85490, 0.58039, 0.64314}, {0.87451, 0.58039, 0.65882}, {0.89804, 0.58039, 0.68235}, {0.92157, 0.57647, 0.70588}, {0.91373, 0.58039, 0.72941}, {0.90588, 0.57647, 0.75686}, {0.89804, 0.58039, 0.78431}, {0.89412, 0.58039, 0.75686}, {0.88627, 0.58039, 0.72941}, {0.88235, 0.58431, 0.70588}, {0.87843, 0.58824, 0.68235}, {0.87451, 0.58824, 0.65882}, {0.87059, 0.59216, 0.64314}, {0.86275, 0.59608, 0.62353}, {0.86275, 0.60000, 0.60392}, {0.85882, 0.60392, 0.58824}, {0.85882, 0.60784, 0.57255}, {0.85490, 0.61176, 0.55686}, {0.85098, 0.61961, 0.54118}, {0.85490, 0.62745, 0.52941}, {0.85098, 0.63529, 0.51373}, {0.85098, 0.63922, 0.50588}, {0.85098, 0.65490, 0.49412}, {0.85098, 0.67059, 0.48627}, {0.85490, 0.68235, 0.47843}, {0.85098, 0.69804, 0.47059}, {0.85490, 0.71373, 0.46275}, {0.85098, 0.74118, 0.45882}, {0.85490, 0.75686, 0.45490}, {0.85882, 0.78039, 0.45098}, {0.86275, 0.80392, 0.44706}, {0.86275, 0.82353, 0.44706}, {0.86667, 0.85098, 0.44706}, {0.87059, 0.87843, 0.44706}, {0.87451, 0.90980, 0.44706}, {0.87843, 0.93725, 0.45098}, {0.88235, 0.97255, 0.45490}, {0.88627, 0.96471, 0.45882}, {0.89020, 0.96078, 0.46275}, {0.89804, 0.95686, 0.47059}, {0.90196, 0.95294, 0.47843}, {0.90588, 0.94902, 0.48627}, {0.91373, 0.94902, 0.49412}, {0.91765, 0.94510, 0.50588}, {0.92549, 0.94118, 0.51373}, {0.92941, 0.94510, 0.52941}, {0.94118, 0.94118, 0.54118}, {0.94902, 0.94510, 0.55686}, {0.95294, 0.94510, 0.57255}, {0.96078, 0.94510, 0.58824}, {0.97255, 0.94902, 0.60392}, {0.98039, 0.94902, 0.62745}, {0.98824, 0.95294, 0.65098}, {0.99608, 0.95686, 0.67451}, {1.00000, 0.95686, 0.70588}, {1.00000, 0.96078, 0.73333}, {1.00000, 0.96863, 0.76863}, {1.00000, 0.97255, 0.80392}, {1.00000, 0.98039, 0.84314}, {1.00000, 0.98431, 0.82353}, {0.98824, 0.99216, 0.80784}, {0.96078, 0.99608, 0.79608}, {0.93333, 1.00000, 0.78431}, {0.90980, 1.00000, 0.77255}, {0.88235, 1.00000, 0.76471}, {0.85882, 1.00000, 0.75686}, {0.83137, 1.00000, 0.74902}, {0.80784, 1.00000, 0.74118}, {0.78039, 1.00000, 0.73725}, {0.75686, 1.00000, 0.73333}, {0.73333, 1.00000, 0.72941}, {0.70588, 1.00000, 0.72941}, {0.69020, 1.00000, 0.72941}, {0.66667, 0.97255, 0.72941}, {0.64314, 0.93725, 0.73333}, {0.62353, 0.90196, 0.73725}, {0.60392, 0.86667, 0.74118}, {0.58431, 0.83137, 0.74510}, {0.56078, 0.79608, 0.75294}, {0.54510, 0.76078, 0.75686}, {0.52941, 0.73333, 0.76863}, {0.51373, 0.69804, 0.77647}, {0.50196, 0.67059, 0.78824}, {0.48627, 0.63922, 0.80392}, {0.47059, 0.61176, 0.81569}, {0.45490, 0.58039, 0.83137}, {0.44314, 0.55294, 0.84706}, {0.43529, 0.52941, 0.86667}, {0.42353, 0.50588, 0.88235}, {0.41569, 0.47843, 0.90196}, {0.41176, 0.45490, 0.92549}, {0.40392, 0.43529, 0.87843}, {0.40000, 0.41569, 0.83922}, {0.39216, 0.39216, 0.79608}, {0.38824, 0.37647, 0.75686}, {0.38431, 0.35686, 0.72157}, {0.38039, 0.34118, 0.67843}, {0.38039, 0.32941, 0.65098}, {0.37255, 0.31765, 0.61569}, {0.37255, 0.30588, 0.58431}, {0.37255, 0.29804, 0.55686}, {0.37255, 0.29412, 0.52549}, {0.37647, 0.28627, 0.50196}, {0.37647, 0.28235, 0.47843}, {0.38039, 0.28235, 0.45882}, {0.38431, 0.27843, 0.43922}, {0.38824, 0.27843, 0.41961}, {0.39608, 0.27843, 0.40784}, {0.40000, 0.28235, 0.40000}, {0.40784, 0.28627, 0.38824}, {0.41569, 0.29020, 0.38431}, {0.42353, 0.29804, 0.38039}, {0.43529, 0.30588, 0.37647}, {0.44706, 0.31765, 0.37647}, {0.45882, 0.32549, 0.38039}, {0.47059, 0.34118, 0.38431}, {0.48235, 0.35294, 0.39216}, {0.50196, 0.37255, 0.40000}, {0.51765, 0.39216, 0.40784}, {0.53725, 0.41176, 0.42353}, {0.55686, 0.43922, 0.43529}, {0.57647, 0.46667, 0.45098}, {0.60000, 0.49804, 0.47451}, {0.62745, 0.52941, 0.49804}, {0.65490, 0.56078, 0.52549}, {0.68235, 0.59216, 0.54902}, {0.70980, 0.62745, 0.58431}, {0.74118, 0.66275, 0.61569}, {0.77255, 0.70196, 0.65098}, {0.80392, 0.74118, 0.69020}, {0.83529, 0.78039, 0.73333}, {0.87059, 0.82353, 0.78431}, }; new ColorMapInfo("smooth1.lasc", smooth1_lasc); static RGBColor random5_lasc[] = { {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 0.99216}, {0.00000, 0.00000, 0.98824}, {0.00392, 0.00000, 0.98431}, {0.00392, 0.00000, 0.98039}, {0.00784, 0.00000, 0.97647}, {0.00784, 0.00000, 0.96863}, {0.01176, 0.00000, 0.96471}, {0.01569, 0.00000, 0.96078}, {0.01569, 0.00000, 0.95686}, {0.01961, 0.00000, 0.95294}, {0.01961, 0.00000, 0.94510}, {0.02353, 0.00784, 0.94118}, {0.02745, 0.01569, 0.93725}, {0.02745, 0.02745, 0.93333}, {0.03137, 0.03922, 0.92941}, {0.03529, 0.05098, 0.92157}, {0.03529, 0.06667, 0.91765}, {0.03922, 0.08235, 0.91373}, {0.04314, 0.09804, 0.90980}, {0.04706, 0.11765, 0.90588}, {0.04706, 0.09804, 0.90196}, {0.05098, 0.08235, 0.89412}, {0.05490, 0.06667, 0.89020}, {0.05490, 0.05098, 0.88627}, {0.05882, 0.03922, 0.88235}, {0.06275, 0.02745, 0.87843}, {0.06667, 0.01569, 0.87059}, {0.07059, 0.00784, 0.86667}, {0.07059, 0.00000, 0.86275}, {0.07451, 0.00000, 0.85882}, {0.07843, 0.00392, 0.85490}, {0.08235, 0.01176, 0.85098}, {0.08235, 0.02353, 0.84314}, {0.08627, 0.03922, 0.83922}, {0.09020, 0.05490, 0.83529}, {0.09412, 0.07059, 0.83137}, {0.09804, 0.09020, 0.82745}, {0.09804, 0.10980, 0.82353}, {0.10196, 0.13333, 0.81569}, {0.10588, 0.15686, 0.81176}, {0.10980, 0.13333, 0.80784}, {0.11373, 0.10980, 0.80392}, {0.11765, 0.09020, 0.80000}, {0.11765, 0.07059, 0.79608}, {0.12157, 0.05490, 0.79216}, {0.12549, 0.03922, 0.78431}, {0.12941, 0.02353, 0.78039}, {0.13333, 0.01176, 0.77647}, {0.13725, 0.00392, 0.77255}, {0.14118, 0.00000, 0.76863}, {0.14118, 0.00392, 0.76471}, {0.14510, 0.01569, 0.75686}, {0.14902, 0.03137, 0.75294}, {0.15294, 0.04706, 0.74902}, {0.15686, 0.06667, 0.74510}, {0.16078, 0.09020, 0.74118}, {0.16471, 0.11373, 0.73725}, {0.16863, 0.13725, 0.73333}, {0.17255, 0.16471, 0.72549}, {0.17255, 0.19608, 0.72157}, {0.17647, 0.16471, 0.71765}, {0.18039, 0.13725, 0.71373}, {0.18431, 0.11373, 0.70980}, {0.18824, 0.09020, 0.70588}, {0.19216, 0.06667, 0.70196}, {0.19608, 0.04706, 0.69804}, {0.20000, 0.03137, 0.69020}, {0.20392, 0.01569, 0.68627}, {0.20784, 0.00392, 0.68235}, {0.21176, 0.00000, 0.67843}, {0.21176, 0.00784, 0.67451}, {0.21569, 0.02353, 0.67059}, {0.21961, 0.04314, 0.66667}, {0.22353, 0.06667, 0.66275}, {0.22745, 0.09412, 0.65490}, {0.23137, 0.12549, 0.65098}, {0.23529, 0.15686, 0.64706}, {0.23922, 0.19608, 0.64314}, {0.24314, 0.23137, 0.63922}, {0.24706, 0.27451, 0.63529}, {0.25098, 0.23137, 0.63137}, {0.25490, 0.19608, 0.62745}, {0.25882, 0.15686, 0.61961}, {0.26275, 0.12549, 0.61569}, {0.26667, 0.09412, 0.61176}, {0.27059, 0.06667, 0.60784}, {0.27451, 0.04314, 0.60392}, {0.27843, 0.02353, 0.60000}, {0.28235, 0.00784, 0.59608}, {0.28627, 0.00000, 0.59216}, {0.29020, 0.00784, 0.58824}, {0.29412, 0.03137, 0.58431}, {0.29804, 0.05490, 0.57647}, {0.29804, 0.08627, 0.57255}, {0.30196, 0.12157, 0.56863}, {0.30588, 0.16078, 0.56471}, {0.30980, 0.20392, 0.56078}, {0.31373, 0.25098, 0.55686}, {0.31765, 0.29804, 0.55294}, {0.32157, 0.35294, 0.54902}, {0.32549, 0.29804, 0.54510}, {0.32941, 0.25098, 0.54118}, {0.33333, 0.20392, 0.53725}, {0.33725, 0.16078, 0.52941}, {0.34118, 0.12157, 0.52549}, {0.34510, 0.08627, 0.52157}, {0.34902, 0.05490, 0.51765}, {0.35294, 0.03137, 0.51373}, {0.35686, 0.00784, 0.50980}, {0.36078, 0.00000, 0.50588}, {0.36471, 0.01176, 0.50196}, {0.37255, 0.03529, 0.49804}, {0.37647, 0.07059, 0.49412}, {0.38039, 0.10588, 0.49020}, {0.38431, 0.14902, 0.48627}, {0.38824, 0.20000, 0.48235}, {0.39216, 0.25098, 0.47843}, {0.39608, 0.30588, 0.47059}, {0.40000, 0.36471, 0.46667}, {0.40392, 0.43137, 0.46275}, {0.40784, 0.36471, 0.45882}, {0.41176, 0.30588, 0.45490}, {0.41569, 0.25098, 0.45098}, {0.41961, 0.20000, 0.44706}, {0.42353, 0.14902, 0.44314}, {0.42745, 0.10588, 0.43922}, {0.43137, 0.07059, 0.43529}, {0.43529, 0.03529, 0.43137}, {0.43922, 0.01176, 0.42745}, {0.44314, 0.00000, 0.42353}, {0.44706, 0.01569, 0.41961}, {0.45098, 0.04314, 0.41569}, {0.45490, 0.08235, 0.41176}, {0.45882, 0.12549, 0.40784}, {0.46275, 0.17647, 0.40392}, {0.46667, 0.23529, 0.40000}, {0.47059, 0.29804, 0.39608}, {0.47843, 0.36471, 0.39216}, {0.48235, 0.43137, 0.38824}, {0.48627, 0.50980, 0.38431}, {0.49020, 0.43137, 0.38039}, {0.49412, 0.36471, 0.37647}, {0.49804, 0.29804, 0.37255}, {0.50196, 0.23529, 0.36471}, {0.50588, 0.17647, 0.36078}, {0.50980, 0.12549, 0.35686}, {0.51373, 0.08235, 0.35294}, {0.51765, 0.04314, 0.34902}, {0.52157, 0.01569, 0.34510}, {0.52549, 0.00000, 0.34118}, {0.52941, 0.01569, 0.33725}, {0.53725, 0.05098, 0.33333}, {0.54118, 0.09412, 0.32941}, {0.54510, 0.14510, 0.32549}, {0.54902, 0.20784, 0.32157}, {0.55294, 0.27059, 0.31765}, {0.55686, 0.34118, 0.31373}, {0.56078, 0.41961, 0.30980}, {0.56471, 0.50196, 0.30588}, {0.56863, 0.58824, 0.30196}, {0.57255, 0.50196, 0.29804}, {0.57647, 0.41961, 0.29804}, {0.58431, 0.34118, 0.29412}, {0.58824, 0.27059, 0.29020}, {0.59216, 0.20784, 0.28627}, {0.59608, 0.14510, 0.28235}, {0.60000, 0.09412, 0.27843}, {0.60392, 0.05098, 0.27451}, {0.60784, 0.01569, 0.27059}, {0.61176, 0.00000, 0.26667}, {0.61569, 0.01961, 0.26275}, {0.61961, 0.05882, 0.25882}, {0.62745, 0.10588, 0.25490}, {0.63137, 0.16863, 0.25098}, {0.63529, 0.23529, 0.24706}, {0.63922, 0.30980, 0.24314}, {0.64314, 0.38824, 0.23922}, {0.64706, 0.47451, 0.23529}, {0.65098, 0.56863, 0.23137}, {0.65490, 0.66667, 0.22745}, {0.66275, 0.56863, 0.22353}, {0.66667, 0.47451, 0.21961}, {0.67059, 0.38824, 0.21569}, {0.67451, 0.30980, 0.21176}, {0.67843, 0.23529, 0.21176}, {0.68235, 0.16863, 0.20784}, {0.68627, 0.10588, 0.20392}, {0.69020, 0.05882, 0.20000}, {0.69804, 0.01961, 0.19608}, {0.70196, 0.00000, 0.19216}, {0.70588, 0.02353, 0.18824}, {0.70980, 0.06275, 0.18431}, {0.71373, 0.12157, 0.18039}, {0.71765, 0.18824, 0.17647}, {0.72157, 0.26275, 0.17255}, {0.72549, 0.34510, 0.17255}, {0.73333, 0.43529, 0.16863}, {0.73725, 0.52941, 0.16471}, {0.74118, 0.63529, 0.16078}, {0.74510, 0.74510, 0.15686}, {0.74902, 0.63529, 0.15294}, {0.75294, 0.52941, 0.14902}, {0.75686, 0.43529, 0.14510}, {0.76471, 0.34510, 0.14118}, {0.76863, 0.26275, 0.14118}, {0.77255, 0.18824, 0.13725}, {0.77647, 0.12157, 0.13333}, {0.78039, 0.06275, 0.12941}, {0.78431, 0.02353, 0.12549}, {0.79216, 0.00000, 0.12157}, {0.79608, 0.02353, 0.11765}, {0.80000, 0.07059, 0.11765}, {0.80392, 0.13333, 0.11373}, {0.80784, 0.20784, 0.10980}, {0.81176, 0.29020, 0.10588}, {0.81569, 0.38039, 0.10196}, {0.82353, 0.47843, 0.09804}, {0.82745, 0.58824, 0.09804}, {0.83137, 0.70196, 0.09412}, {0.83529, 0.82353, 0.09020}, {0.83922, 0.70196, 0.08627}, {0.84314, 0.58824, 0.08235}, {0.85098, 0.47843, 0.08235}, {0.85490, 0.38039, 0.07843}, {0.85882, 0.29020, 0.07451}, {0.86275, 0.20784, 0.07059}, {0.86667, 0.13333, 0.07059}, {0.87059, 0.07059, 0.06667}, {0.87843, 0.02353, 0.06275}, {0.88235, 0.00000, 0.05882}, {0.88627, 0.02745, 0.05490}, {0.89020, 0.07843, 0.05490}, {0.89412, 0.14510, 0.05098}, {0.90196, 0.22745, 0.04706}, {0.90588, 0.31765, 0.04706}, {0.90980, 0.41569, 0.04314}, {0.91373, 0.52549, 0.03922}, {0.91765, 0.64314, 0.03529}, {0.92157, 0.76863, 0.03529}, {0.92941, 0.90196, 0.03137}, {0.93333, 0.76863, 0.02745}, {0.93725, 0.64314, 0.02745}, {0.94118, 0.52549, 0.02353}, {0.94510, 0.41569, 0.01961}, {0.95294, 0.31765, 0.01961}, {0.95686, 0.25882, 0.01569}, {0.96078, 0.23137, 0.01569}, {0.96471, 0.23922, 0.01176}, {0.96863, 0.27843, 0.00784}, {0.97647, 0.35294, 0.00784}, {0.98039, 0.46275, 0.00392}, {0.98431, 0.58431, 0.00392}, {0.98824, 0.71373, 0.00000}, {0.99216, 0.85098, 0.00000}, {1.00000, 1.00000, 0.00000}, }; new ColorMapInfo("random5.lasc", random5_lasc); static RGBColor light_lasc[] = { {0.00000, 0.00392, 0.00000}, {0.00000, 0.00784, 0.01961}, {0.00000, 0.01176, 0.05490}, {0.00000, 0.01569, 0.08627}, {0.00000, 0.01961, 0.10980}, {0.00000, 0.02353, 0.13725}, {0.00000, 0.02745, 0.15686}, {0.00000, 0.03137, 0.18039}, {0.00000, 0.03529, 0.20000}, {0.00000, 0.03922, 0.21569}, {0.00000, 0.04314, 0.23529}, {0.00000, 0.04706, 0.25098}, {0.00000, 0.05098, 0.26275}, {0.00000, 0.05490, 0.28235}, {0.00000, 0.05882, 0.29412}, {0.00000, 0.06275, 0.30588}, {0.00000, 0.06667, 0.31765}, {0.00000, 0.07059, 0.33333}, {0.00000, 0.07451, 0.34118}, {0.00000, 0.07843, 0.35294}, {0.00000, 0.08235, 0.36078}, {0.00000, 0.08627, 0.37255}, {0.00000, 0.09020, 0.38431}, {0.00000, 0.09412, 0.39216}, {0.00392, 0.09804, 0.40000}, {0.00784, 0.10196, 0.41176}, {0.01176, 0.10588, 0.41961}, {0.01569, 0.10980, 0.43137}, {0.01569, 0.11373, 0.43529}, {0.01961, 0.11765, 0.44314}, {0.02353, 0.12157, 0.45098}, {0.02745, 0.12549, 0.45882}, {0.02745, 0.12941, 0.46667}, {0.03137, 0.13333, 0.47059}, {0.03529, 0.13725, 0.48235}, {0.04314, 0.14118, 0.48627}, {0.04706, 0.14510, 0.49412}, {0.05098, 0.14902, 0.50196}, {0.05882, 0.15294, 0.50588}, {0.06667, 0.15686, 0.50980}, {0.07451, 0.16078, 0.51765}, {0.08235, 0.16471, 0.52157}, {0.09020, 0.16863, 0.53333}, {0.09804, 0.17255, 0.53725}, {0.10588, 0.17647, 0.54118}, {0.11765, 0.18039, 0.54902}, {0.12941, 0.18431, 0.55294}, {0.14118, 0.18824, 0.55686}, {0.15294, 0.19216, 0.56078}, {0.16471, 0.19608, 0.56471}, {0.18039, 0.20000, 0.57255}, {0.18824, 0.20392, 0.58039}, {0.20000, 0.20784, 0.58431}, {0.21569, 0.21176, 0.58824}, {0.23137, 0.21569, 0.59216}, {0.24706, 0.21961, 0.59608}, {0.26275, 0.22353, 0.60000}, {0.27843, 0.22745, 0.60392}, {0.29412, 0.23137, 0.60784}, {0.30980, 0.23529, 0.61176}, {0.32941, 0.23922, 0.61569}, {0.34902, 0.24314, 0.61961}, {0.36863, 0.24706, 0.62745}, {0.38431, 0.25098, 0.63137}, {0.40392, 0.25490, 0.63529}, {0.41569, 0.25882, 0.63922}, {0.43529, 0.26275, 0.64314}, {0.45490, 0.26667, 0.64706}, {0.47059, 0.27059, 0.65098}, {0.48627, 0.27451, 0.65490}, {0.50196, 0.27843, 0.65490}, {0.51765, 0.28235, 0.65882}, {0.52941, 0.28627, 0.66275}, {0.54902, 0.29020, 0.66667}, {0.56471, 0.29412, 0.67059}, {0.58039, 0.29804, 0.67843}, {0.59216, 0.30196, 0.67843}, {0.60392, 0.30588, 0.68235}, {0.61961, 0.30980, 0.68627}, {0.63137, 0.31373, 0.69020}, {0.63922, 0.31765, 0.69020}, {0.65098, 0.32157, 0.69412}, {0.65882, 0.32549, 0.69804}, {0.67059, 0.32941, 0.70196}, {0.67843, 0.33333, 0.70196}, {0.69020, 0.33725, 0.70588}, {0.69804, 0.34118, 0.70980}, {0.70588, 0.34510, 0.71373}, {0.71373, 0.34902, 0.71373}, {0.72157, 0.35294, 0.71765}, {0.72941, 0.35686, 0.72157}, {0.73725, 0.36078, 0.72157}, {0.74510, 0.36471, 0.72941}, {0.75294, 0.36863, 0.73333}, {0.76078, 0.37255, 0.73333}, {0.76863, 0.37647, 0.73725}, {0.77647, 0.38039, 0.74118}, {0.78039, 0.38431, 0.74118}, {0.78824, 0.38824, 0.74510}, {0.79608, 0.39216, 0.74510}, {0.80392, 0.39608, 0.74902}, {0.80784, 0.40000, 0.75294}, {0.81176, 0.40392, 0.75294}, {0.81961, 0.40784, 0.75686}, {0.82353, 0.41176, 0.76078}, {0.82745, 0.41569, 0.76078}, {0.83529, 0.41961, 0.76471}, {0.83922, 0.42353, 0.76471}, {0.84314, 0.42745, 0.76863}, {0.84706, 0.43137, 0.76863}, {0.85098, 0.43529, 0.77255}, {0.85490, 0.43922, 0.78039}, {0.85882, 0.44314, 0.78039}, {0.86275, 0.44706, 0.78431}, {0.86667, 0.45098, 0.78431}, {0.87059, 0.45490, 0.78824}, {0.87451, 0.45882, 0.78824}, {0.87843, 0.46275, 0.79216}, {0.88235, 0.46667, 0.79216}, {0.88627, 0.47059, 0.79608}, {0.89020, 0.47451, 0.79608}, {0.89412, 0.47843, 0.80000}, {0.89804, 0.48235, 0.80000}, {0.89804, 0.48627, 0.80392}, {0.90196, 0.49020, 0.80392}, {0.90588, 0.49412, 0.80784}, {0.90980, 0.49804, 0.80784}, {0.91373, 0.50196, 0.81176}, {0.91373, 0.50588, 0.81176}, {0.91765, 0.50980, 0.81569}, {0.92157, 0.51373, 0.81569}, {0.92157, 0.51765, 0.81961}, {0.92549, 0.52157, 0.81961}, {0.92941, 0.52549, 0.82745}, {0.92941, 0.52941, 0.82745}, {0.93333, 0.53333, 0.83137}, {0.93725, 0.53725, 0.83137}, {0.93725, 0.54118, 0.83529}, {0.93725, 0.54510, 0.83529}, {0.94118, 0.54902, 0.83922}, {0.94118, 0.55294, 0.83922}, {0.94510, 0.55686, 0.83922}, {0.94510, 0.56078, 0.84314}, {0.94902, 0.56471, 0.84314}, {0.94902, 0.56863, 0.84706}, {0.95294, 0.57255, 0.84706}, {0.95294, 0.57647, 0.85098}, {0.95294, 0.58039, 0.85098}, {0.95686, 0.58431, 0.85490}, {0.95686, 0.58824, 0.85490}, {0.96078, 0.59216, 0.85490}, {0.96078, 0.59608, 0.85882}, {0.96078, 0.60000, 0.85882}, {0.96471, 0.60392, 0.86275}, {0.96471, 0.60784, 0.86275}, {0.96471, 0.61176, 0.86275}, {0.96863, 0.61569, 0.86667}, {0.96863, 0.61961, 0.86667}, {0.97255, 0.62353, 0.87059}, {0.97255, 0.62745, 0.87059}, {0.97255, 0.63137, 0.87059}, {0.97647, 0.63529, 0.87843}, {0.97647, 0.63922, 0.87843}, {0.98039, 0.64314, 0.88235}, {0.98039, 0.64706, 0.88235}, {0.98039, 0.65098, 0.88235}, {0.98431, 0.65490, 0.88627}, {0.98431, 0.65882, 0.88627}, {0.98431, 0.66275, 0.89020}, {0.98824, 0.66667, 0.89020}, {0.98824, 0.67059, 0.89020}, {0.98824, 0.67451, 0.89412}, {0.99216, 0.67843, 0.89412}, {0.99216, 0.68235, 0.89412}, {0.99216, 0.68627, 0.89804}, {0.99216, 0.69020, 0.89804}, {0.99216, 0.69412, 0.89804}, {0.99608, 0.69804, 0.90196}, {0.99608, 0.70196, 0.90196}, {0.99608, 0.70588, 0.90588}, {0.99608, 0.70980, 0.90588}, {0.99608, 0.71373, 0.90588}, {0.99608, 0.71765, 0.90980}, {0.99608, 0.72157, 0.90980}, {0.99608, 0.72549, 0.90980}, {0.99608, 0.72941, 0.91373}, {0.99608, 0.73333, 0.91373}, {0.99608, 0.73725, 0.91373}, {0.99608, 0.74118, 0.91765}, {0.99608, 0.74510, 0.91765}, {0.99608, 0.74902, 0.91765}, {0.99608, 0.75294, 0.92157}, {0.99608, 0.75686, 0.92157}, {0.99608, 0.76078, 0.92157}, {0.99608, 0.76471, 0.92941}, {0.99608, 0.76863, 0.92941}, {0.99608, 0.77255, 0.92941}, {0.99608, 0.77647, 0.93333}, {0.99608, 0.78039, 0.93333}, {0.99608, 0.78431, 0.93333}, {0.99608, 0.78824, 0.93725}, {1.00000, 0.79216, 0.93725}, {1.00000, 0.79608, 0.93725}, {1.00000, 0.80000, 0.94118}, {1.00000, 0.80392, 0.94118}, {1.00000, 0.80784, 0.94118}, {1.00000, 0.81176, 0.94118}, {1.00000, 0.81569, 0.94510}, {1.00000, 0.81961, 0.94510}, {1.00000, 0.82353, 0.94510}, {1.00000, 0.82745, 0.94902}, {1.00000, 0.83137, 0.94902}, {1.00000, 0.83529, 0.94902}, {1.00000, 0.83922, 0.95294}, {1.00000, 0.84314, 0.95294}, {1.00000, 0.84706, 0.95294}, {1.00000, 0.85098, 0.95686}, {1.00000, 0.85490, 0.95686}, {1.00000, 0.85882, 0.95686}, {1.00000, 0.86275, 0.95686}, {1.00000, 0.86667, 0.96078}, {1.00000, 0.87059, 0.96078}, {1.00000, 0.87451, 0.96078}, {1.00000, 0.87843, 0.96471}, {1.00000, 0.88235, 0.96471}, {1.00000, 0.88627, 0.96471}, {1.00000, 0.89020, 0.96471}, {1.00000, 0.89412, 0.96863}, {1.00000, 0.89804, 0.96863}, {1.00000, 0.90196, 0.96863}, {1.00000, 0.90588, 0.97255}, {1.00000, 0.90980, 0.97255}, {1.00000, 0.91373, 0.97255}, {1.00000, 0.91765, 0.97255}, {1.00000, 0.92157, 0.98039}, {1.00000, 0.92549, 0.98039}, {1.00000, 0.92941, 0.98039}, {1.00000, 0.93333, 0.98039}, {1.00000, 0.93725, 0.98431}, {1.00000, 0.94118, 0.98431}, {1.00000, 0.94510, 0.98431}, {1.00000, 0.94902, 0.98824}, {1.00000, 0.95294, 0.98824}, {1.00000, 0.95686, 0.98824}, {1.00000, 0.96078, 0.98824}, {1.00000, 0.96471, 0.99216}, {1.00000, 0.96863, 0.99216}, {1.00000, 0.97255, 0.99216}, {1.00000, 0.97647, 0.99216}, {1.00000, 0.98039, 0.99608}, {1.00000, 0.98431, 0.99608}, {1.00000, 0.98824, 0.99608}, {1.00000, 0.99216, 0.99608}, {1.00000, 0.99608, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("light.lasc", light_lasc); static RGBColor random2_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00392, 0.47059, 0.00392}, {0.00392, 0.47059, 0.00392}, {0.00392, 0.47059, 0.00392}, {0.00392, 0.47059, 0.00392}, {0.00392, 0.47059, 0.00392}, {0.00392, 0.47059, 0.00392}, {0.00392, 0.47059, 0.00392}, {0.00392, 0.47059, 0.00392}, {0.00392, 0.47059, 0.00392}, {0.00392, 0.47059, 0.00392}, {0.00392, 0.62745, 0.00392}, {0.00392, 0.62745, 0.00392}, {0.00392, 0.62745, 0.00392}, {0.00392, 0.62745, 0.00392}, {0.00392, 0.62745, 0.00392}, {0.00392, 0.62745, 0.00392}, {0.00392, 0.62745, 0.00392}, {0.00392, 0.62745, 0.00392}, {0.00392, 0.62745, 0.00392}, {0.00392, 0.62745, 0.00392}, {0.00392, 0.78431, 0.00392}, {0.00392, 0.78431, 0.00392}, {0.00392, 0.78431, 0.00392}, {0.00392, 0.78431, 0.00392}, {0.00392, 0.78431, 0.00392}, {0.00392, 0.78431, 0.00392}, {0.00392, 0.78431, 0.00392}, {0.00392, 0.78431, 0.00392}, {0.00392, 0.78431, 0.00392}, {0.00392, 0.78431, 0.00392}, {0.00392, 1.00000, 0.00392}, {0.00392, 1.00000, 0.00392}, {0.00392, 1.00000, 0.00392}, {0.00392, 1.00000, 0.00392}, {0.00392, 1.00000, 0.00392}, {0.00392, 1.00000, 0.00392}, {0.00392, 1.00000, 0.00392}, {0.00392, 1.00000, 0.00392}, {0.00392, 1.00000, 0.00392}, {0.00392, 1.00000, 0.00392}, {0.00392, 0.86275, 0.47059}, {0.00392, 0.86275, 0.47059}, {0.00392, 0.86275, 0.47059}, {0.00392, 0.86275, 0.47059}, {0.00392, 0.86275, 0.47059}, {0.00392, 0.86275, 0.47059}, {0.00392, 0.86275, 0.47059}, {0.00392, 0.86275, 0.47059}, {0.00392, 0.86275, 0.47059}, {0.00392, 0.86275, 0.47059}, {0.00000, 0.78431, 0.62745}, {0.00000, 0.78431, 0.62745}, {0.00000, 0.78431, 0.62745}, {0.00000, 0.78431, 0.62745}, {0.00000, 0.78431, 0.62745}, {0.00000, 0.78431, 0.62745}, {0.00000, 0.78431, 0.62745}, {0.00000, 0.78431, 0.62745}, {0.00000, 0.78431, 0.62745}, {0.00000, 0.78431, 0.62745}, {0.00000, 0.70588, 0.78431}, {0.00000, 0.70588, 0.78431}, {0.00000, 0.70588, 0.78431}, {0.00000, 0.70588, 0.78431}, {0.00000, 0.70588, 0.78431}, {0.00000, 0.70588, 0.78431}, {0.00000, 0.70588, 0.78431}, {0.00000, 0.70588, 0.78431}, {0.00000, 0.70588, 0.78431}, {0.00000, 0.70588, 0.78431}, {0.00000, 0.62745, 1.00000}, {0.00000, 0.62745, 1.00000}, {0.00000, 0.62745, 1.00000}, {0.00000, 0.62745, 1.00000}, {0.00000, 0.62745, 1.00000}, {0.00000, 0.62745, 1.00000}, {0.00000, 0.62745, 1.00000}, {0.00000, 0.62745, 1.00000}, {0.00000, 0.62745, 1.00000}, {0.00000, 0.62745, 1.00000}, {0.23529, 0.47059, 1.00000}, {0.23529, 0.47059, 1.00000}, {0.23529, 0.47059, 1.00000}, {0.23529, 0.47059, 1.00000}, {0.23529, 0.47059, 1.00000}, {0.23529, 0.47059, 1.00000}, {0.23529, 0.47059, 1.00000}, {0.23529, 0.47059, 1.00000}, {0.23529, 0.47059, 1.00000}, {0.23529, 0.47059, 1.00000}, {0.23529, 0.00392, 1.00000}, {0.23529, 0.00392, 1.00000}, {0.23529, 0.00392, 1.00000}, {0.23529, 0.00392, 1.00000}, {0.23529, 0.00392, 1.00000}, {0.23529, 0.00392, 1.00000}, {0.23529, 0.00392, 1.00000}, {0.23529, 0.00392, 1.00000}, {0.23529, 0.00392, 1.00000}, {0.23529, 0.00392, 1.00000}, {0.47059, 0.00392, 0.78431}, {0.47059, 0.00392, 0.78431}, {0.47059, 0.00392, 0.78431}, {0.47059, 0.00392, 0.78431}, {0.47059, 0.00392, 0.78431}, {0.47059, 0.00392, 0.78431}, {0.47059, 0.00392, 0.78431}, {0.47059, 0.00392, 0.78431}, {0.47059, 0.00392, 0.78431}, {0.47059, 0.00392, 0.78431}, {0.62745, 0.00392, 0.62745}, {0.62745, 0.00392, 0.62745}, {0.62745, 0.00392, 0.62745}, {0.62745, 0.00392, 0.62745}, {0.62745, 0.00392, 0.62745}, {0.62745, 0.00392, 0.62745}, {0.62745, 0.00392, 0.62745}, {0.62745, 0.00392, 0.62745}, {0.62745, 0.00392, 0.62745}, {0.62745, 0.00392, 0.62745}, {0.78431, 0.00392, 0.47059}, {0.78431, 0.00392, 0.47059}, {0.78431, 0.00392, 0.47059}, {0.78431, 0.00392, 0.47059}, {0.78431, 0.00392, 0.47059}, {0.78431, 0.00392, 0.47059}, {0.78431, 0.00392, 0.47059}, {0.78431, 0.00392, 0.47059}, {0.78431, 0.00392, 0.47059}, {0.78431, 0.00392, 0.47059}, {0.90196, 0.11765, 0.23529}, {0.90196, 0.11765, 0.23529}, {0.90196, 0.11765, 0.23529}, {0.90196, 0.11765, 0.23529}, {0.90196, 0.11765, 0.23529}, {0.90196, 0.11765, 0.23529}, {0.90196, 0.11765, 0.23529}, {0.90196, 0.11765, 0.23529}, {0.90196, 0.11765, 0.23529}, {0.90196, 0.11765, 0.23529}, {1.00000, 0.23529, 0.00000}, {1.00000, 0.23529, 0.00000}, {1.00000, 0.23529, 0.00000}, {1.00000, 0.23529, 0.00000}, {1.00000, 0.23529, 0.00000}, {1.00000, 0.23529, 0.00000}, {1.00000, 0.23529, 0.00000}, {1.00000, 0.23529, 0.00000}, {1.00000, 0.23529, 0.00000}, {1.00000, 0.23529, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.99216, 0.59608, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.98039, 0.47059}, {0.98039, 0.98039, 0.47059}, {0.98039, 0.98039, 0.47059}, {0.98039, 0.98039, 0.47059}, {0.98039, 0.98039, 0.47059}, {0.98039, 0.98039, 0.47059}, {0.98039, 0.98039, 0.47059}, {0.98039, 0.98039, 0.47059}, {0.98039, 0.98039, 0.47059}, {0.98039, 0.98039, 0.47059}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("random2.lasc", random2_lasc); static RGBColor pastel_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 1.00000}, {0.01961, 0.00000, 0.98039}, {0.05490, 0.00000, 0.94510}, {0.08627, 0.00392, 0.91373}, {0.10980, 0.00392, 0.89020}, {0.13725, 0.00392, 0.86275}, {0.15686, 0.00392, 0.84314}, {0.18039, 0.00392, 0.81961}, {0.20000, 0.00784, 0.80000}, {0.21569, 0.00784, 0.78431}, {0.23529, 0.00784, 0.76471}, {0.25098, 0.00784, 0.74902}, {0.26275, 0.01176, 0.73725}, {0.28235, 0.01176, 0.71765}, {0.29412, 0.01176, 0.70588}, {0.30588, 0.01176, 0.69412}, {0.31765, 0.01176, 0.68235}, {0.33333, 0.01569, 0.66667}, {0.34118, 0.01569, 0.65882}, {0.35294, 0.01569, 0.64706}, {0.36078, 0.01569, 0.63922}, {0.37255, 0.01961, 0.62745}, {0.38431, 0.01961, 0.61569}, {0.39216, 0.01961, 0.60784}, {0.40000, 0.01961, 0.60000}, {0.41176, 0.02353, 0.58824}, {0.41961, 0.02353, 0.58039}, {0.43137, 0.02353, 0.56863}, {0.43529, 0.02745, 0.56471}, {0.44314, 0.02745, 0.55686}, {0.45098, 0.02745, 0.54902}, {0.45882, 0.02745, 0.54118}, {0.46667, 0.03137, 0.53333}, {0.47059, 0.03137, 0.52941}, {0.48235, 0.03137, 0.51765}, {0.48627, 0.03529, 0.51373}, {0.49412, 0.03529, 0.50588}, {0.50196, 0.03529, 0.49804}, {0.50588, 0.03529, 0.49412}, {0.50980, 0.04314, 0.49020}, {0.51765, 0.04314, 0.48235}, {0.52157, 0.04314, 0.47843}, {0.53333, 0.04706, 0.46667}, {0.53725, 0.04706, 0.46275}, {0.54118, 0.04706, 0.45882}, {0.54902, 0.05098, 0.45098}, {0.55294, 0.05098, 0.44706}, {0.55686, 0.05098, 0.44314}, {0.56078, 0.05490, 0.43922}, {0.56471, 0.05490, 0.43529}, {0.57255, 0.05490, 0.42745}, {0.58039, 0.05882, 0.41961}, {0.58431, 0.05882, 0.41569}, {0.58824, 0.05882, 0.41176}, {0.59216, 0.06275, 0.40784}, {0.59608, 0.06275, 0.40392}, {0.60000, 0.06275, 0.40000}, {0.60392, 0.06667, 0.39608}, {0.60784, 0.06667, 0.39216}, {0.61176, 0.06667, 0.38824}, {0.61569, 0.07059, 0.38431}, {0.61961, 0.07059, 0.38039}, {0.62745, 0.07451, 0.37255}, {0.63137, 0.07451, 0.36863}, {0.63529, 0.07451, 0.36471}, {0.63922, 0.07843, 0.36078}, {0.64314, 0.07843, 0.35686}, {0.64706, 0.08235, 0.35294}, {0.65098, 0.08235, 0.34902}, {0.65490, 0.08235, 0.34510}, {0.65490, 0.08627, 0.34510}, {0.65882, 0.08627, 0.34118}, {0.66275, 0.09020, 0.33725}, {0.66667, 0.09020, 0.33333}, {0.67059, 0.09020, 0.32941}, {0.67843, 0.09412, 0.32157}, {0.67843, 0.09412, 0.32157}, {0.68235, 0.09804, 0.31765}, {0.68627, 0.09804, 0.31373}, {0.69020, 0.10196, 0.30980}, {0.69020, 0.10196, 0.30980}, {0.69412, 0.10588, 0.30588}, {0.69804, 0.10588, 0.30196}, {0.70196, 0.10980, 0.29804}, {0.70196, 0.10980, 0.29804}, {0.70588, 0.10980, 0.29412}, {0.70980, 0.11765, 0.29020}, {0.71373, 0.11765, 0.28627}, {0.71373, 0.12157, 0.28627}, {0.71765, 0.12157, 0.28235}, {0.72157, 0.12549, 0.27843}, {0.72157, 0.12549, 0.27843}, {0.72941, 0.12941, 0.27059}, {0.73333, 0.12941, 0.26667}, {0.73333, 0.13333, 0.26667}, {0.73725, 0.13725, 0.26275}, {0.74118, 0.13725, 0.25882}, {0.74118, 0.14118, 0.25882}, {0.74510, 0.14118, 0.25490}, {0.74510, 0.14510, 0.25490}, {0.74902, 0.14510, 0.25098}, {0.75294, 0.14902, 0.24706}, {0.75294, 0.14902, 0.24706}, {0.75686, 0.15294, 0.24314}, {0.76078, 0.15686, 0.23922}, {0.76078, 0.15686, 0.23922}, {0.76471, 0.16078, 0.23529}, {0.76471, 0.16078, 0.23529}, {0.76863, 0.16471, 0.23137}, {0.76863, 0.16863, 0.23137}, {0.77255, 0.16863, 0.22745}, {0.78039, 0.17255, 0.21961}, {0.78039, 0.17255, 0.21961}, {0.78431, 0.17647, 0.21569}, {0.78431, 0.18039, 0.21569}, {0.78824, 0.18039, 0.21176}, {0.78824, 0.18431, 0.21176}, {0.79216, 0.18824, 0.20784}, {0.79216, 0.18824, 0.20784}, {0.79608, 0.19608, 0.20392}, {0.79608, 0.20000, 0.20392}, {0.80000, 0.20000, 0.20000}, {0.80000, 0.20392, 0.20000}, {0.80392, 0.20784, 0.19608}, {0.80392, 0.20784, 0.19608}, {0.80784, 0.21176, 0.19216}, {0.80784, 0.21569, 0.19216}, {0.81176, 0.21961, 0.18824}, {0.81176, 0.21961, 0.18824}, {0.81569, 0.22353, 0.18431}, {0.81569, 0.22745, 0.18431}, {0.81961, 0.23137, 0.18039}, {0.81961, 0.23137, 0.18039}, {0.82745, 0.23529, 0.17255}, {0.82745, 0.23922, 0.17255}, {0.83137, 0.24314, 0.16863}, {0.83137, 0.24314, 0.16863}, {0.83529, 0.24706, 0.16471}, {0.83529, 0.25098, 0.16471}, {0.83922, 0.25490, 0.16078}, {0.83922, 0.25882, 0.16078}, {0.83922, 0.26275, 0.16078}, {0.84314, 0.26275, 0.15686}, {0.84314, 0.27059, 0.15686}, {0.84706, 0.27451, 0.15294}, {0.84706, 0.27843, 0.15294}, {0.85098, 0.28235, 0.14902}, {0.85098, 0.28627, 0.14902}, {0.85490, 0.29020, 0.14510}, {0.85490, 0.29412, 0.14510}, {0.85490, 0.29804, 0.14510}, {0.85882, 0.29804, 0.14118}, {0.85882, 0.30196, 0.14118}, {0.86275, 0.30588, 0.13725}, {0.86275, 0.30980, 0.13725}, {0.86275, 0.31373, 0.13725}, {0.86667, 0.31765, 0.13333}, {0.86667, 0.32157, 0.13333}, {0.87059, 0.32549, 0.12941}, {0.87059, 0.33333, 0.12941}, {0.87059, 0.33725, 0.12941}, {0.87843, 0.34118, 0.12157}, {0.87843, 0.34510, 0.12157}, {0.88235, 0.34902, 0.11765}, {0.88235, 0.35294, 0.11765}, {0.88235, 0.35686, 0.11765}, {0.88627, 0.36078, 0.11373}, {0.88627, 0.36471, 0.11373}, {0.89020, 0.37255, 0.10980}, {0.89020, 0.37647, 0.10980}, {0.89020, 0.38039, 0.10980}, {0.89412, 0.38431, 0.10588}, {0.89412, 0.38824, 0.10588}, {0.89412, 0.39216, 0.10588}, {0.89804, 0.40000, 0.10196}, {0.89804, 0.40392, 0.10196}, {0.89804, 0.40784, 0.10196}, {0.90196, 0.41176, 0.09804}, {0.90196, 0.41961, 0.09804}, {0.90588, 0.42353, 0.09412}, {0.90588, 0.42745, 0.09412}, {0.90588, 0.43529, 0.09412}, {0.90980, 0.43922, 0.09020}, {0.90980, 0.44314, 0.09020}, {0.90980, 0.45098, 0.09020}, {0.91373, 0.45490, 0.08627}, {0.91373, 0.45882, 0.08627}, {0.91373, 0.46667, 0.08627}, {0.91765, 0.47059, 0.08235}, {0.91765, 0.47843, 0.08235}, {0.91765, 0.48235, 0.08235}, {0.92157, 0.49020, 0.07843}, {0.92157, 0.49412, 0.07843}, {0.92157, 0.50196, 0.07843}, {0.92941, 0.50588, 0.07059}, {0.92941, 0.51373, 0.07059}, {0.92941, 0.51765, 0.07059}, {0.93333, 0.52549, 0.06667}, {0.93333, 0.52941, 0.06667}, {0.93333, 0.53725, 0.06667}, {0.93725, 0.54118, 0.06275}, {0.93725, 0.54902, 0.06275}, {0.93725, 0.55686, 0.06275}, {0.94118, 0.56078, 0.05882}, {0.94118, 0.56863, 0.05882}, {0.94118, 0.57647, 0.05882}, {0.94118, 0.58039, 0.05882}, {0.94510, 0.58824, 0.05490}, {0.94510, 0.59608, 0.05490}, {0.94510, 0.60000, 0.05490}, {0.94902, 0.60784, 0.05098}, {0.94902, 0.61569, 0.05098}, {0.94902, 0.62353, 0.05098}, {0.95294, 0.63137, 0.04706}, {0.95294, 0.63529, 0.04706}, {0.95294, 0.64314, 0.04706}, {0.95686, 0.65098, 0.04314}, {0.95686, 0.65882, 0.04314}, {0.95686, 0.66667, 0.04314}, {0.95686, 0.67451, 0.04314}, {0.96078, 0.68235, 0.03922}, {0.96078, 0.69020, 0.03922}, {0.96078, 0.69804, 0.03922}, {0.96471, 0.70588, 0.03529}, {0.96471, 0.71373, 0.03529}, {0.96471, 0.72157, 0.03529}, {0.96471, 0.72941, 0.03529}, {0.96863, 0.73725, 0.03137}, {0.96863, 0.74510, 0.03137}, {0.96863, 0.75294, 0.03137}, {0.97255, 0.76078, 0.02745}, {0.97255, 0.77255, 0.02745}, {0.97255, 0.78039, 0.02745}, {0.97255, 0.78824, 0.02745}, {0.98039, 0.79608, 0.01961}, {0.98039, 0.80392, 0.01961}, {0.98039, 0.81569, 0.01961}, {0.98039, 0.82353, 0.01961}, {0.98431, 0.83137, 0.01569}, {0.98431, 0.84314, 0.01569}, {0.98431, 0.85098, 0.01569}, {0.98824, 0.86275, 0.01176}, {0.98824, 0.87059, 0.01176}, {0.98824, 0.87843, 0.01176}, {0.98824, 0.89020, 0.01176}, {0.99216, 0.89804, 0.00784}, {0.99216, 0.90980, 0.00784}, {0.99216, 0.91765, 0.00784}, {0.99216, 0.92941, 0.00784}, {0.99608, 0.94118, 0.00392}, {0.99608, 0.94902, 0.00392}, {0.99608, 0.96078, 0.00392}, {0.99608, 0.97255, 0.00392}, {1.00000, 0.98039, 0.00000}, {1.00000, 0.99216, 0.00000}, }; new ColorMapInfo("pastel.lasc", pastel_lasc); static RGBColor aips0_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.47451, 0.00000, 0.60784}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78431}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.37255, 0.65490, 0.92549}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.69412, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, }; new ColorMapInfo("aips0.lasc", aips0_lasc); static RGBColor smooth2_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.06667}, {0.00000, 0.00000, 0.06667}, {0.00000, 0.00000, 0.06667}, {0.00000, 0.00000, 0.06667}, {0.00000, 0.00000, 0.06667}, {0.00000, 0.00000, 0.06667}, {0.00000, 0.00000, 0.06667}, {0.00000, 0.00000, 0.06667}, {0.00000, 0.00000, 0.13333}, {0.00000, 0.00000, 0.13333}, {0.00000, 0.00000, 0.13333}, {0.00000, 0.00000, 0.13333}, {0.00000, 0.00000, 0.13333}, {0.00000, 0.00000, 0.13333}, {0.00000, 0.00000, 0.13333}, {0.00000, 0.00000, 0.13333}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.26667}, {0.00000, 0.00000, 0.26667}, {0.00000, 0.00000, 0.26667}, {0.00000, 0.00000, 0.26667}, {0.00000, 0.00000, 0.26667}, {0.00000, 0.00000, 0.26667}, {0.00000, 0.00000, 0.26667}, {0.00000, 0.00000, 0.26667}, {0.00000, 0.00000, 0.33333}, {0.00000, 0.00000, 0.33333}, {0.00000, 0.00000, 0.33333}, {0.00000, 0.00000, 0.33333}, {0.00000, 0.00000, 0.33333}, {0.00000, 0.00000, 0.33333}, {0.00000, 0.00000, 0.33333}, {0.00000, 0.00000, 0.33333}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.46667}, {0.00000, 0.00000, 0.46667}, {0.00000, 0.00000, 0.46667}, {0.00000, 0.00000, 0.46667}, {0.00000, 0.00000, 0.46667}, {0.00000, 0.00000, 0.46667}, {0.00000, 0.00000, 0.46667}, {0.00000, 0.00000, 0.46667}, {0.00000, 0.00000, 0.53333}, {0.00000, 0.00000, 0.53333}, {0.00000, 0.00000, 0.53333}, {0.00000, 0.00000, 0.53333}, {0.00000, 0.00000, 0.53333}, {0.00000, 0.00000, 0.53333}, {0.00000, 0.00000, 0.53333}, {0.00000, 0.00000, 0.53333}, {0.06667, 0.00000, 0.53333}, {0.06667, 0.00000, 0.53333}, {0.06667, 0.00000, 0.53333}, {0.06667, 0.00000, 0.53333}, {0.06667, 0.00000, 0.53333}, {0.06667, 0.00000, 0.53333}, {0.06667, 0.00000, 0.53333}, {0.06667, 0.00000, 0.53333}, {0.13333, 0.00000, 0.53333}, {0.13333, 0.00000, 0.53333}, {0.13333, 0.00000, 0.53333}, {0.13333, 0.00000, 0.53333}, {0.13333, 0.00000, 0.53333}, {0.13333, 0.00000, 0.53333}, {0.13333, 0.00000, 0.53333}, {0.13333, 0.00000, 0.53333}, {0.20000, 0.00000, 0.53333}, {0.20000, 0.00000, 0.53333}, {0.20000, 0.00000, 0.53333}, {0.20000, 0.00000, 0.53333}, {0.20000, 0.00000, 0.53333}, {0.20000, 0.00000, 0.53333}, {0.20000, 0.00000, 0.53333}, {0.20000, 0.00000, 0.53333}, {0.26667, 0.00000, 0.53333}, {0.26667, 0.00000, 0.53333}, {0.26667, 0.00000, 0.53333}, {0.26667, 0.00000, 0.53333}, {0.26667, 0.00000, 0.53333}, {0.26667, 0.00000, 0.53333}, {0.26667, 0.00000, 0.53333}, {0.26667, 0.00000, 0.53333}, {0.33333, 0.00000, 0.53333}, {0.33333, 0.00000, 0.53333}, {0.33333, 0.00000, 0.53333}, {0.33333, 0.00000, 0.53333}, {0.33333, 0.00000, 0.53333}, {0.33333, 0.00000, 0.53333}, {0.33333, 0.00000, 0.53333}, {0.33333, 0.00000, 0.53333}, {0.40000, 0.00000, 0.53333}, {0.40000, 0.00000, 0.53333}, {0.40000, 0.00000, 0.53333}, {0.40000, 0.00000, 0.53333}, {0.40000, 0.00000, 0.53333}, {0.40000, 0.00000, 0.53333}, {0.40000, 0.00000, 0.53333}, {0.40000, 0.00000, 0.53333}, {0.46667, 0.00000, 0.53333}, {0.46667, 0.00000, 0.53333}, {0.46667, 0.00000, 0.53333}, {0.46667, 0.00000, 0.53333}, {0.46667, 0.00000, 0.53333}, {0.46667, 0.00000, 0.53333}, {0.46667, 0.00000, 0.53333}, {0.46667, 0.00000, 0.53333}, {0.53333, 0.00000, 0.53333}, {0.53333, 0.00000, 0.53333}, {0.53333, 0.00000, 0.53333}, {0.53333, 0.00000, 0.53333}, {0.53333, 0.00000, 0.46667}, {0.53333, 0.00000, 0.46667}, {0.53333, 0.00000, 0.46667}, {0.53333, 0.00000, 0.46667}, {0.60000, 0.00000, 0.40000}, {0.60000, 0.00000, 0.40000}, {0.60000, 0.00000, 0.40000}, {0.60000, 0.00000, 0.40000}, {0.60000, 0.00000, 0.33333}, {0.60000, 0.00000, 0.33333}, {0.60000, 0.00000, 0.33333}, {0.60000, 0.00000, 0.33333}, {0.66667, 0.00000, 0.26667}, {0.66667, 0.00000, 0.26667}, {0.66667, 0.00000, 0.26667}, {0.66667, 0.00000, 0.26667}, {0.66667, 0.00000, 0.20000}, {0.66667, 0.00000, 0.20000}, {0.66667, 0.00000, 0.20000}, {0.66667, 0.00000, 0.20000}, {0.73333, 0.00000, 0.13333}, {0.73333, 0.00000, 0.13333}, {0.73333, 0.00000, 0.13333}, {0.73333, 0.00000, 0.13333}, {0.73333, 0.00000, 0.06667}, {0.73333, 0.00000, 0.06667}, {0.73333, 0.00000, 0.06667}, {0.73333, 0.00000, 0.06667}, {0.80000, 0.00000, 0.00000}, {0.80000, 0.00000, 0.00000}, {0.80000, 0.00000, 0.00000}, {0.80000, 0.00000, 0.00000}, {0.80000, 0.00000, 0.00000}, {0.80000, 0.00000, 0.00000}, {0.80000, 0.00000, 0.00000}, {0.80000, 0.00000, 0.00000}, {0.86667, 0.00000, 0.00000}, {0.86667, 0.00000, 0.00000}, {0.86667, 0.00000, 0.00000}, {0.86667, 0.00000, 0.00000}, {0.86667, 0.00000, 0.00000}, {0.86667, 0.00000, 0.00000}, {0.86667, 0.00000, 0.00000}, {0.86667, 0.00000, 0.00000}, {0.93333, 0.00000, 0.00000}, {0.93333, 0.00000, 0.00000}, {0.93333, 0.00000, 0.00000}, {0.93333, 0.00000, 0.00000}, {0.93333, 0.00000, 0.00000}, {0.93333, 0.00000, 0.00000}, {0.93333, 0.00000, 0.00000}, {0.93333, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.06667, 0.00000}, {1.00000, 0.06667, 0.00000}, {1.00000, 0.13333, 0.00000}, {1.00000, 0.13333, 0.00000}, {1.00000, 0.20000, 0.00000}, {1.00000, 0.20000, 0.00000}, {1.00000, 0.26667, 0.00000}, {1.00000, 0.26667, 0.00000}, {1.00000, 0.33333, 0.00000}, {1.00000, 0.33333, 0.00000}, {1.00000, 0.40000, 0.00000}, {1.00000, 0.40000, 0.00000}, {1.00000, 0.46667, 0.00000}, {1.00000, 0.46667, 0.00000}, {1.00000, 0.53333, 0.00000}, {1.00000, 0.53333, 0.00000}, {1.00000, 0.60000, 0.00000}, {1.00000, 0.60000, 0.00000}, {1.00000, 0.66667, 0.00000}, {1.00000, 0.66667, 0.00000}, {1.00000, 0.73333, 0.00000}, {1.00000, 0.73333, 0.00000}, {1.00000, 0.80000, 0.00000}, {1.00000, 0.80000, 0.00000}, {1.00000, 0.86667, 0.00000}, {1.00000, 0.86667, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.06667}, {1.00000, 1.00000, 0.06667}, {1.00000, 1.00000, 0.13333}, {1.00000, 1.00000, 0.13333}, {1.00000, 1.00000, 0.20000}, {1.00000, 1.00000, 0.20000}, {1.00000, 1.00000, 0.26667}, {1.00000, 1.00000, 0.26667}, {1.00000, 1.00000, 0.33333}, {1.00000, 1.00000, 0.33333}, {1.00000, 1.00000, 0.40000}, {1.00000, 1.00000, 0.40000}, {1.00000, 1.00000, 0.46667}, {1.00000, 1.00000, 0.46667}, {1.00000, 1.00000, 0.53333}, {1.00000, 1.00000, 0.53333}, {1.00000, 1.00000, 0.60000}, {1.00000, 1.00000, 0.60000}, {1.00000, 1.00000, 0.66667}, {1.00000, 1.00000, 0.66667}, {1.00000, 1.00000, 0.73333}, {1.00000, 1.00000, 0.73333}, {1.00000, 1.00000, 0.80000}, {1.00000, 1.00000, 0.80000}, {1.00000, 1.00000, 0.86667}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("smooth2.lasc", smooth2_lasc); static RGBColor random_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.51765}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98431, 0.81176, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.76863, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 0.89804, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.86275, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.70588, 1.00000}, {0.92157, 0.61961, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.78431, 0.47059, 1.00000}, {0.65882, 0.59608, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.62745, 0.62745, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.47059, 0.78431, 1.00000}, {0.26275, 0.87843, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 0.74118}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.65490}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.36078, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.98431, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.99608, 0.97647, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98431, 0.85098, 0.00000}, {0.98824, 0.77647, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.72549, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.36863, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.46667}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {0.91373, 0.00000, 0.97255}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.70588, 0.00000, 0.90196}, {0.53333, 0.00000, 0.87451}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.47059, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.80392}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.13725}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, }; new ColorMapInfo("random.lasc", random_lasc); static RGBColor idl15_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.07059, 0.00392, 0.00392}, {0.14118, 0.00784, 0.01176}, {0.21176, 0.01176, 0.01961}, {0.28235, 0.01569, 0.02745}, {0.35294, 0.01961, 0.03529}, {0.42353, 0.02353, 0.04314}, {0.49804, 0.02745, 0.05098}, {0.56863, 0.03137, 0.05882}, {0.63922, 0.03529, 0.06667}, {0.70980, 0.03922, 0.07451}, {0.78039, 0.04314, 0.08235}, {0.85098, 0.04706, 0.09020}, {0.92157, 0.05098, 0.09804}, {0.99608, 0.05490, 0.10588}, {0.97647, 0.05882, 0.11373}, {0.95686, 0.06275, 0.12157}, {0.93725, 0.06667, 0.12941}, {0.91765, 0.07059, 0.13725}, {0.89804, 0.07451, 0.14510}, {0.87451, 0.07843, 0.15294}, {0.85490, 0.08235, 0.16078}, {0.83529, 0.08627, 0.16863}, {0.81569, 0.09020, 0.17647}, {0.79608, 0.09412, 0.18431}, {0.77255, 0.09804, 0.19216}, {0.75294, 0.10196, 0.20000}, {0.73333, 0.10588, 0.20784}, {0.71373, 0.10980, 0.21569}, {0.69412, 0.11373, 0.22353}, {0.67451, 0.11765, 0.23137}, {0.65098, 0.12157, 0.23922}, {0.63137, 0.12549, 0.24706}, {0.61176, 0.12941, 0.25490}, {0.59216, 0.13333, 0.26275}, {0.57255, 0.13725, 0.27059}, {0.54902, 0.14118, 0.27843}, {0.52941, 0.14510, 0.28627}, {0.50980, 0.14902, 0.29412}, {0.49020, 0.15294, 0.30196}, {0.47059, 0.15686, 0.30980}, {0.45098, 0.16078, 0.31765}, {0.42745, 0.16471, 0.32549}, {0.40784, 0.16863, 0.33333}, {0.38824, 0.17255, 0.34118}, {0.36863, 0.17647, 0.34902}, {0.34902, 0.18039, 0.35686}, {0.32549, 0.18431, 0.36471}, {0.30588, 0.18824, 0.37255}, {0.28627, 0.19216, 0.38039}, {0.26667, 0.19608, 0.38824}, {0.24706, 0.20000, 0.39608}, {0.22745, 0.20392, 0.40392}, {0.20392, 0.20784, 0.41176}, {0.18431, 0.21176, 0.41961}, {0.16471, 0.21569, 0.42745}, {0.14510, 0.21961, 0.43529}, {0.12549, 0.22353, 0.44314}, {0.10196, 0.22745, 0.45098}, {0.08235, 0.23137, 0.45882}, {0.06275, 0.23529, 0.46667}, {0.04314, 0.23922, 0.47451}, {0.02353, 0.24314, 0.48235}, {0.00000, 0.24706, 0.49020}, {0.25098, 0.25098, 0.49804}, {0.25490, 0.25490, 0.50588}, {0.25882, 0.25882, 0.51373}, {0.26275, 0.26275, 0.52157}, {0.26667, 0.26667, 0.52941}, {0.27059, 0.27059, 0.53725}, {0.27451, 0.27451, 0.54510}, {0.27843, 0.27843, 0.55294}, {0.28235, 0.28235, 0.56078}, {0.28627, 0.28627, 0.56863}, {0.29020, 0.29020, 0.57647}, {0.29412, 0.29412, 0.58431}, {0.29804, 0.29804, 0.59216}, {0.30196, 0.30196, 0.60000}, {0.30588, 0.30588, 0.60784}, {0.30980, 0.30980, 0.61569}, {0.31373, 0.31373, 0.62353}, {0.31765, 0.31765, 0.63137}, {0.32157, 0.32157, 0.63922}, {0.32549, 0.32549, 0.64706}, {0.32941, 0.32941, 0.65490}, {0.33333, 0.33333, 0.66275}, {0.33725, 0.33725, 0.67059}, {0.34118, 0.34118, 0.67843}, {0.34510, 0.34510, 0.68627}, {0.34902, 0.34902, 0.69412}, {0.35294, 0.35294, 0.70196}, {0.35686, 0.35686, 0.70980}, {0.36078, 0.36078, 0.71765}, {0.36471, 0.36471, 0.72549}, {0.36863, 0.36863, 0.73333}, {0.37255, 0.37255, 0.74118}, {0.37647, 0.37647, 0.74902}, {0.38039, 0.38039, 0.75686}, {0.38431, 0.38431, 0.76471}, {0.38824, 0.38824, 0.77255}, {0.39216, 0.39216, 0.78039}, {0.39608, 0.39608, 0.78824}, {0.40000, 0.40000, 0.79608}, {0.40392, 0.40392, 0.80392}, {0.40784, 0.40784, 0.81176}, {0.41176, 0.41176, 0.81961}, {0.41569, 0.41569, 0.82745}, {0.41961, 0.41961, 0.83529}, {0.42353, 0.42353, 0.84314}, {0.42745, 0.42745, 0.85098}, {0.43137, 0.43137, 0.85882}, {0.43529, 0.43529, 0.86667}, {0.43922, 0.43922, 0.87451}, {0.44314, 0.44314, 0.88235}, {0.44706, 0.44706, 0.89020}, {0.45098, 0.45098, 0.89804}, {0.45490, 0.45490, 0.90588}, {0.45882, 0.45882, 0.91373}, {0.46275, 0.46275, 0.92157}, {0.46667, 0.46667, 0.92941}, {0.47059, 0.47059, 0.93725}, {0.47451, 0.47451, 0.94510}, {0.47843, 0.47843, 0.95294}, {0.48235, 0.48235, 0.96078}, {0.48627, 0.48627, 0.96863}, {0.49020, 0.49020, 0.97647}, {0.49412, 0.49412, 0.98431}, {0.49804, 0.49804, 0.99216}, {0.50196, 0.50196, 1.00000}, {0.50588, 0.50588, 0.98431}, {0.50980, 0.50980, 0.96863}, {0.51373, 0.51373, 0.95294}, {0.51765, 0.51765, 0.93333}, {0.52157, 0.52157, 0.91765}, {0.52549, 0.52549, 0.90196}, {0.52941, 0.52941, 0.88627}, {0.53333, 0.53333, 0.86667}, {0.53725, 0.53725, 0.85098}, {0.54118, 0.54118, 0.83529}, {0.54510, 0.54510, 0.81961}, {0.54902, 0.54902, 0.80000}, {0.55294, 0.55294, 0.78431}, {0.55686, 0.55686, 0.76863}, {0.56078, 0.56078, 0.75294}, {0.56471, 0.56471, 0.73333}, {0.56863, 0.56863, 0.71765}, {0.57255, 0.57255, 0.70196}, {0.57647, 0.57647, 0.68627}, {0.58039, 0.58039, 0.66667}, {0.58431, 0.58431, 0.65098}, {0.58824, 0.58824, 0.63529}, {0.59216, 0.59216, 0.61961}, {0.59608, 0.59608, 0.60000}, {0.60000, 0.60000, 0.58431}, {0.60392, 0.60392, 0.56863}, {0.60784, 0.60784, 0.55294}, {0.61176, 0.61176, 0.53333}, {0.61569, 0.61569, 0.51765}, {0.61961, 0.61961, 0.50196}, {0.62353, 0.62353, 0.48627}, {0.62745, 0.62745, 0.46667}, {0.63137, 0.63137, 0.45098}, {0.63529, 0.63529, 0.43529}, {0.63922, 0.63922, 0.41961}, {0.64314, 0.64314, 0.40000}, {0.64706, 0.64706, 0.38431}, {0.65098, 0.65098, 0.36863}, {0.65490, 0.65490, 0.35294}, {0.65882, 0.65882, 0.33333}, {0.66275, 0.66275, 0.31765}, {0.66667, 0.66667, 0.30196}, {0.67059, 0.67059, 0.28627}, {0.67451, 0.67451, 0.26667}, {0.67843, 0.67843, 0.25098}, {0.68235, 0.68235, 0.23529}, {0.68627, 0.68627, 0.21961}, {0.69020, 0.69020, 0.20000}, {0.69412, 0.69412, 0.18431}, {0.69804, 0.69804, 0.16863}, {0.70196, 0.70196, 0.15294}, {0.70588, 0.70588, 0.13333}, {0.70980, 0.70980, 0.11765}, {0.71373, 0.71373, 0.10196}, {0.71765, 0.71765, 0.08627}, {0.72157, 0.72157, 0.06667}, {0.72549, 0.72549, 0.05098}, {0.72941, 0.72941, 0.03529}, {0.73333, 0.73333, 0.01961}, {0.73725, 0.73725, 0.00000}, {0.74118, 0.74118, 0.01176}, {0.74510, 0.74510, 0.02745}, {0.74902, 0.74902, 0.04314}, {0.75294, 0.75294, 0.05882}, {0.75686, 0.75686, 0.07451}, {0.76078, 0.76078, 0.08627}, {0.76471, 0.76471, 0.10196}, {0.76863, 0.76863, 0.11765}, {0.77255, 0.77255, 0.13333}, {0.77647, 0.77647, 0.14902}, {0.78039, 0.78039, 0.16078}, {0.78431, 0.78431, 0.17647}, {0.78824, 0.78824, 0.19216}, {0.79216, 0.79216, 0.20784}, {0.79608, 0.79608, 0.22353}, {0.80000, 0.80000, 0.23529}, {0.80392, 0.80392, 0.25098}, {0.80784, 0.80784, 0.26667}, {0.81176, 0.81176, 0.28235}, {0.81569, 0.81569, 0.29804}, {0.81961, 0.81961, 0.30980}, {0.82353, 0.82353, 0.32549}, {0.82745, 0.82745, 0.34118}, {0.83137, 0.83137, 0.35686}, {0.83529, 0.83529, 0.37255}, {0.83922, 0.83922, 0.38431}, {0.84314, 0.84314, 0.40000}, {0.84706, 0.84706, 0.41569}, {0.85098, 0.85098, 0.43137}, {0.85490, 0.85490, 0.44706}, {0.85882, 0.85882, 0.45882}, {0.86275, 0.86275, 0.47451}, {0.86667, 0.86667, 0.49020}, {0.87059, 0.87059, 0.50588}, {0.87451, 0.87451, 0.52157}, {0.87843, 0.87843, 0.53725}, {0.88235, 0.88235, 0.54902}, {0.88627, 0.88627, 0.56471}, {0.89020, 0.89020, 0.58039}, {0.89412, 0.89412, 0.59608}, {0.89804, 0.89804, 0.61176}, {0.90196, 0.90196, 0.62353}, {0.90588, 0.90588, 0.63922}, {0.90980, 0.90980, 0.65490}, {0.91373, 0.91373, 0.67059}, {0.91765, 0.91765, 0.68627}, {0.92157, 0.92157, 0.69804}, {0.92549, 0.92549, 0.71373}, {0.92941, 0.92941, 0.72941}, {0.93333, 0.93333, 0.74510}, {0.93725, 0.93725, 0.76078}, {0.94118, 0.94118, 0.77255}, {0.94510, 0.94510, 0.78824}, {0.94902, 0.94902, 0.80392}, {0.95294, 0.95294, 0.81961}, {0.95686, 0.95686, 0.83529}, {0.96078, 0.96078, 0.84706}, {0.96471, 0.96471, 0.86275}, {0.96863, 0.96863, 0.87843}, {0.97255, 0.97255, 0.89412}, {0.97647, 0.97647, 0.90980}, {0.98039, 0.98039, 0.92157}, {0.98431, 0.98431, 0.93725}, {0.98824, 0.98824, 0.95294}, {0.99216, 0.99216, 0.96863}, {0.99608, 0.99608, 0.98431}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("idl15.lasc", idl15_lasc); static RGBColor blue_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00392}, {0.00000, 0.00000, 0.00784}, {0.00000, 0.00000, 0.01176}, {0.00000, 0.00000, 0.01569}, {0.00000, 0.00000, 0.01961}, {0.00000, 0.00000, 0.02353}, {0.00000, 0.00000, 0.02745}, {0.00000, 0.00000, 0.03137}, {0.00000, 0.00000, 0.03529}, {0.00000, 0.00000, 0.03922}, {0.00000, 0.00000, 0.04314}, {0.00000, 0.00000, 0.04706}, {0.00000, 0.00000, 0.05098}, {0.00000, 0.00000, 0.05490}, {0.00000, 0.00000, 0.05882}, {0.00000, 0.00000, 0.06275}, {0.00000, 0.00000, 0.06667}, {0.00000, 0.00000, 0.07059}, {0.00000, 0.00000, 0.07451}, {0.00000, 0.00000, 0.07843}, {0.00000, 0.00000, 0.08235}, {0.00000, 0.00000, 0.08627}, {0.00000, 0.00000, 0.09020}, {0.00000, 0.00000, 0.09412}, {0.00000, 0.00000, 0.09804}, {0.00000, 0.00000, 0.10196}, {0.00000, 0.00000, 0.10588}, {0.00000, 0.00000, 0.10980}, {0.00000, 0.00000, 0.11373}, {0.00000, 0.00000, 0.11765}, {0.00000, 0.00000, 0.12157}, {0.00000, 0.00000, 0.12549}, {0.00000, 0.00000, 0.12941}, {0.00000, 0.00000, 0.13333}, {0.00000, 0.00000, 0.13725}, {0.00000, 0.00000, 0.14118}, {0.00000, 0.00000, 0.14510}, {0.00000, 0.00000, 0.14902}, {0.00000, 0.00000, 0.15294}, {0.00000, 0.00000, 0.15686}, {0.00000, 0.00000, 0.16078}, {0.00000, 0.00000, 0.16471}, {0.00000, 0.00000, 0.16863}, {0.00000, 0.00000, 0.17255}, {0.00000, 0.00000, 0.17647}, {0.00000, 0.00000, 0.18039}, {0.00000, 0.00000, 0.18431}, {0.00000, 0.00000, 0.18824}, {0.00000, 0.00000, 0.19216}, {0.00000, 0.00000, 0.19608}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.20392}, {0.00000, 0.00000, 0.20784}, {0.00000, 0.00000, 0.21176}, {0.00000, 0.00000, 0.21569}, {0.00000, 0.00000, 0.21961}, {0.00000, 0.00000, 0.22353}, {0.00000, 0.00000, 0.22745}, {0.00000, 0.00000, 0.23137}, {0.00000, 0.00000, 0.23529}, {0.00000, 0.00000, 0.23922}, {0.00000, 0.00000, 0.24314}, {0.00000, 0.00000, 0.24706}, {0.00000, 0.00000, 0.25098}, {0.00000, 0.00000, 0.25490}, {0.00000, 0.00000, 0.25882}, {0.00000, 0.00000, 0.26275}, {0.00000, 0.00000, 0.26667}, {0.00000, 0.00000, 0.27059}, {0.00000, 0.00000, 0.27451}, {0.00000, 0.00000, 0.27843}, {0.00000, 0.00000, 0.28235}, {0.00000, 0.00000, 0.28627}, {0.00000, 0.00000, 0.29020}, {0.00000, 0.00000, 0.29412}, {0.00000, 0.00000, 0.29804}, {0.00000, 0.00000, 0.30196}, {0.00000, 0.00000, 0.30588}, {0.00000, 0.00000, 0.30980}, {0.00000, 0.00000, 0.31373}, {0.00000, 0.00000, 0.31765}, {0.00000, 0.00000, 0.32157}, {0.00000, 0.00000, 0.32549}, {0.00000, 0.00000, 0.32941}, {0.00000, 0.00000, 0.33333}, {0.00000, 0.00000, 0.33725}, {0.00000, 0.00000, 0.34118}, {0.00000, 0.00000, 0.34510}, {0.00000, 0.00000, 0.34902}, {0.00000, 0.00000, 0.35294}, {0.00000, 0.00000, 0.35686}, {0.00000, 0.00000, 0.36078}, {0.00000, 0.00000, 0.36471}, {0.00000, 0.00000, 0.36863}, {0.00000, 0.00000, 0.37255}, {0.00000, 0.00000, 0.37647}, {0.00000, 0.00000, 0.38039}, {0.00000, 0.00000, 0.38431}, {0.00000, 0.00000, 0.38824}, {0.00000, 0.00000, 0.39216}, {0.00000, 0.00000, 0.39608}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.40392}, {0.00000, 0.00000, 0.40784}, {0.00000, 0.00000, 0.41176}, {0.00000, 0.00000, 0.41569}, {0.00000, 0.00000, 0.41961}, {0.00000, 0.00000, 0.42353}, {0.00000, 0.00000, 0.42745}, {0.00000, 0.00000, 0.43137}, {0.00000, 0.00000, 0.43529}, {0.00000, 0.00000, 0.43922}, {0.00000, 0.00000, 0.44314}, {0.00000, 0.00000, 0.44706}, {0.00000, 0.00000, 0.45098}, {0.00000, 0.00000, 0.45490}, {0.00000, 0.00000, 0.45882}, {0.00000, 0.00000, 0.46275}, {0.00000, 0.00000, 0.46667}, {0.00000, 0.00000, 0.47059}, {0.00000, 0.00000, 0.47451}, {0.00000, 0.00000, 0.47843}, {0.00000, 0.00000, 0.48235}, {0.00000, 0.00000, 0.48627}, {0.00000, 0.00000, 0.49020}, {0.00000, 0.00000, 0.49412}, {0.00000, 0.00000, 0.49804}, {0.00000, 0.00000, 0.50196}, {0.00000, 0.00000, 0.50588}, {0.00000, 0.00000, 0.50980}, {0.00000, 0.00000, 0.51373}, {0.00000, 0.00000, 0.51765}, {0.00000, 0.00000, 0.52157}, {0.00000, 0.00000, 0.52549}, {0.00000, 0.00000, 0.52941}, {0.00000, 0.00000, 0.53333}, {0.00000, 0.00000, 0.53725}, {0.00000, 0.00000, 0.54118}, {0.00000, 0.00000, 0.54510}, {0.00000, 0.00000, 0.54902}, {0.00000, 0.00000, 0.55294}, {0.00000, 0.00000, 0.55686}, {0.00000, 0.00000, 0.56078}, {0.00000, 0.00000, 0.56471}, {0.00000, 0.00000, 0.56863}, {0.00000, 0.00000, 0.57255}, {0.00000, 0.00000, 0.57647}, {0.00000, 0.00000, 0.58039}, {0.00000, 0.00000, 0.58431}, {0.00000, 0.00000, 0.58824}, {0.00000, 0.00000, 0.59216}, {0.00000, 0.00000, 0.59608}, {0.00000, 0.00000, 0.60000}, {0.00000, 0.00000, 0.60392}, {0.00000, 0.00000, 0.60784}, {0.00000, 0.00000, 0.61176}, {0.00000, 0.00000, 0.61569}, {0.00000, 0.00000, 0.61961}, {0.00000, 0.00000, 0.62353}, {0.00000, 0.00000, 0.62745}, {0.00000, 0.00000, 0.63137}, {0.00000, 0.00000, 0.63529}, {0.00000, 0.00000, 0.63922}, {0.00000, 0.00000, 0.64314}, {0.00000, 0.00000, 0.64706}, {0.00000, 0.00000, 0.65098}, {0.00000, 0.00000, 0.65490}, {0.00000, 0.00000, 0.65882}, {0.00000, 0.00000, 0.66275}, {0.00000, 0.00000, 0.66667}, {0.00000, 0.00000, 0.67059}, {0.00000, 0.00000, 0.67451}, {0.00000, 0.00000, 0.67843}, {0.00000, 0.00000, 0.68235}, {0.00000, 0.00000, 0.68627}, {0.00000, 0.00000, 0.69020}, {0.00000, 0.00000, 0.69412}, {0.00000, 0.00000, 0.69804}, {0.00000, 0.00000, 0.70196}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.70980}, {0.00000, 0.00000, 0.71373}, {0.00000, 0.00000, 0.71765}, {0.00000, 0.00000, 0.72157}, {0.00000, 0.00000, 0.72549}, {0.00000, 0.00000, 0.72941}, {0.00000, 0.00000, 0.73333}, {0.00000, 0.00000, 0.73725}, {0.00000, 0.00000, 0.74118}, {0.00000, 0.00000, 0.74510}, {0.00000, 0.00000, 0.74902}, {0.00000, 0.00000, 0.75294}, {0.00000, 0.00000, 0.75686}, {0.00000, 0.00000, 0.76078}, {0.00000, 0.00000, 0.76471}, {0.00000, 0.00000, 0.76863}, {0.00000, 0.00000, 0.77255}, {0.00000, 0.00000, 0.77647}, {0.00000, 0.00000, 0.78039}, {0.00000, 0.00000, 0.78431}, {0.00000, 0.00000, 0.78824}, {0.00000, 0.00000, 0.79216}, {0.00000, 0.00000, 0.79608}, {0.00000, 0.00000, 0.80000}, {0.00000, 0.00000, 0.80392}, {0.00000, 0.00000, 0.80784}, {0.00000, 0.00000, 0.81176}, {0.00000, 0.00000, 0.81569}, {0.00000, 0.00000, 0.81961}, {0.00000, 0.00000, 0.82353}, {0.00000, 0.00000, 0.82745}, {0.00000, 0.00000, 0.83137}, {0.00000, 0.00000, 0.83529}, {0.00000, 0.00000, 0.83922}, {0.00000, 0.00000, 0.84314}, {0.00000, 0.00000, 0.84706}, {0.00000, 0.00000, 0.85098}, {0.00000, 0.00000, 0.85490}, {0.00000, 0.00000, 0.85882}, {0.00000, 0.00000, 0.86275}, {0.00000, 0.00000, 0.86667}, {0.00000, 0.00000, 0.87059}, {0.00000, 0.00000, 0.87451}, {0.00000, 0.00000, 0.87843}, {0.00000, 0.00000, 0.88235}, {0.00000, 0.00000, 0.88627}, {0.00000, 0.00000, 0.89020}, {0.00000, 0.00000, 0.89412}, {0.00000, 0.00000, 0.89804}, {0.00000, 0.00000, 0.90196}, {0.00000, 0.00000, 0.90588}, {0.00000, 0.00000, 0.90980}, {0.00000, 0.00000, 0.91373}, {0.00000, 0.00000, 0.91765}, {0.00000, 0.00000, 0.92157}, {0.00000, 0.00000, 0.92549}, {0.00000, 0.00000, 0.92941}, {0.00000, 0.00000, 0.93333}, {0.00000, 0.00000, 0.93725}, {0.00000, 0.00000, 0.94118}, {0.00000, 0.00000, 0.94510}, {0.00000, 0.00000, 0.94902}, {0.00000, 0.00000, 0.95294}, {0.00000, 0.00000, 0.95686}, {0.00000, 0.00000, 0.96078}, {0.00000, 0.00000, 0.96471}, {0.00000, 0.00000, 0.96863}, {0.00000, 0.00000, 0.97255}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00000, 0.98039}, {0.00000, 0.00000, 0.98431}, {0.00000, 0.00000, 0.98824}, {0.00000, 0.00000, 0.99216}, {0.00000, 0.00000, 0.99608}, {0.00000, 0.00000, 1.00000}, }; new ColorMapInfo("blue.lasc", blue_lasc); static RGBColor stairs8_lasc[] = { {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {0.76471, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("stairs8.lasc", stairs8_lasc); static RGBColor backgr_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.01587, 0.01587, 0.01587}, {0.03174, 0.03174, 0.03174}, {0.04761, 0.04761, 0.04761}, {0.06348, 0.06348, 0.06348}, {0.07935, 0.07935, 0.07935}, {0.09522, 0.09522, 0.09522}, {0.11109, 0.11109, 0.11109}, {0.12696, 0.12696, 0.12696}, {0.14283, 0.14283, 0.14283}, {0.15870, 0.15870, 0.15870}, {0.17457, 0.17457, 0.17457}, {0.19044, 0.19044, 0.19044}, {0.20631, 0.20631, 0.20631}, {0.22218, 0.22218, 0.22218}, {0.23805, 0.23805, 0.23805}, {0.25392, 0.25392, 0.25392}, {0.26979, 0.26979, 0.26979}, {0.28566, 0.28566, 0.28566}, {0.30153, 0.30153, 0.30153}, {0.31740, 0.31740, 0.31740}, {0.33327, 0.33327, 0.33327}, {0.34914, 0.34914, 0.34914}, {0.36501, 0.36501, 0.36501}, {0.38088, 0.38088, 0.38088}, {0.39675, 0.39675, 0.39675}, {0.41262, 0.41262, 0.41262}, {0.42849, 0.42849, 0.42849}, {0.44436, 0.44436, 0.44436}, {0.46023, 0.46023, 0.46023}, {0.47610, 0.47610, 0.47610}, {0.49197, 0.49197, 0.49197}, {0.50784, 0.50784, 0.50784}, {0.52371, 0.52371, 0.52371}, {0.53958, 0.53958, 0.53958}, {0.55545, 0.55545, 0.55545}, {0.57132, 0.57132, 0.57132}, {0.58719, 0.58719, 0.58719}, {0.60306, 0.60306, 0.60306}, {0.61893, 0.61893, 0.61893}, {0.63480, 0.63480, 0.63480}, {0.65067, 0.65067, 0.65067}, {0.66654, 0.66654, 0.66654}, {0.68241, 0.68241, 0.68241}, {0.69828, 0.69828, 0.69828}, {0.71415, 0.71415, 0.71415}, {0.73002, 0.73002, 0.73002}, {0.74589, 0.74589, 0.74589}, {0.76176, 0.76176, 0.76176}, {0.77763, 0.77763, 0.77763}, {0.79350, 0.79350, 0.79350}, {0.80937, 0.80937, 0.80937}, {0.82524, 0.82524, 0.82524}, {0.84111, 0.84111, 0.84111}, {0.85698, 0.85698, 0.85698}, {0.87285, 0.87285, 0.87285}, {0.88872, 0.88872, 0.88872}, {0.90459, 0.90459, 0.90459}, {0.92046, 0.92046, 0.92046}, {0.93633, 0.93633, 0.93633}, {0.95220, 0.95220, 0.95220}, {0.96807, 0.96807, 0.96807}, {0.98394, 0.98394, 0.98394}, {0.99981, 0.99981, 0.99981}, {0.00000, 0.00000, 0.99981}, {0.00000, 0.01587, 0.98394}, {0.00000, 0.03174, 0.96807}, {0.00000, 0.04761, 0.95220}, {0.00000, 0.06348, 0.93633}, {0.00000, 0.07935, 0.92046}, {0.00000, 0.09522, 0.90459}, {0.00000, 0.11109, 0.88872}, {0.00000, 0.12696, 0.87285}, {0.00000, 0.14283, 0.85698}, {0.00000, 0.15870, 0.84111}, {0.00000, 0.17457, 0.82524}, {0.00000, 0.19044, 0.80937}, {0.00000, 0.20631, 0.79350}, {0.00000, 0.22218, 0.77763}, {0.00000, 0.23805, 0.76176}, {0.00000, 0.25392, 0.74589}, {0.00000, 0.26979, 0.73002}, {0.00000, 0.28566, 0.71415}, {0.00000, 0.30153, 0.69828}, {0.00000, 0.31740, 0.68241}, {0.00000, 0.33327, 0.66654}, {0.00000, 0.34914, 0.65067}, {0.00000, 0.36501, 0.63480}, {0.00000, 0.38088, 0.61893}, {0.00000, 0.39675, 0.60306}, {0.00000, 0.41262, 0.58719}, {0.00000, 0.42849, 0.57132}, {0.00000, 0.44436, 0.55545}, {0.00000, 0.46023, 0.53958}, {0.00000, 0.47610, 0.52371}, {0.00000, 0.49197, 0.50784}, {0.00000, 0.50784, 0.49197}, {0.00000, 0.52371, 0.47610}, {0.00000, 0.53958, 0.46023}, {0.00000, 0.55545, 0.44436}, {0.00000, 0.57132, 0.42849}, {0.00000, 0.58719, 0.41262}, {0.00000, 0.60306, 0.39675}, {0.00000, 0.61893, 0.38088}, {0.00000, 0.63480, 0.36501}, {0.00000, 0.65067, 0.34914}, {0.00000, 0.66654, 0.33327}, {0.00000, 0.68241, 0.31740}, {0.00000, 0.69828, 0.30153}, {0.00000, 0.71415, 0.28566}, {0.00000, 0.73002, 0.26979}, {0.00000, 0.74589, 0.25392}, {0.00000, 0.76176, 0.23805}, {0.00000, 0.77763, 0.22218}, {0.00000, 0.79350, 0.20631}, {0.00000, 0.80937, 0.19044}, {0.00000, 0.82524, 0.17457}, {0.00000, 0.84111, 0.15870}, {0.00000, 0.85698, 0.14283}, {0.00000, 0.87285, 0.12696}, {0.00000, 0.88872, 0.11109}, {0.00000, 0.90459, 0.09522}, {0.00000, 0.92046, 0.07935}, {0.00000, 0.93633, 0.06348}, {0.00000, 0.95220, 0.04761}, {0.00000, 0.96807, 0.03174}, {0.00000, 0.98394, 0.01587}, {0.00000, 0.99981, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.01587, 1.00000, 0.00000}, {0.03174, 1.00000, 0.00000}, {0.04761, 1.00000, 0.00000}, {0.06348, 1.00000, 0.00000}, {0.07935, 1.00000, 0.00000}, {0.09522, 1.00000, 0.00000}, {0.11109, 1.00000, 0.00000}, {0.12696, 1.00000, 0.00000}, {0.14283, 1.00000, 0.00000}, {0.15870, 1.00000, 0.00000}, {0.17457, 1.00000, 0.00000}, {0.19044, 1.00000, 0.00000}, {0.20631, 1.00000, 0.00000}, {0.22218, 1.00000, 0.00000}, {0.23805, 1.00000, 0.00000}, {0.25392, 1.00000, 0.00000}, {0.26979, 1.00000, 0.00000}, {0.28566, 1.00000, 0.00000}, {0.30153, 1.00000, 0.00000}, {0.31740, 1.00000, 0.00000}, {0.33327, 1.00000, 0.00000}, {0.34914, 1.00000, 0.00000}, {0.36501, 1.00000, 0.00000}, {0.38088, 1.00000, 0.00000}, {0.39675, 1.00000, 0.00000}, {0.41262, 1.00000, 0.00000}, {0.42849, 1.00000, 0.00000}, {0.44436, 1.00000, 0.00000}, {0.46023, 1.00000, 0.00000}, {0.47610, 1.00000, 0.00000}, {0.49197, 1.00000, 0.00000}, {0.50784, 1.00000, 0.00000}, {0.52371, 1.00000, 0.00000}, {0.53958, 1.00000, 0.00000}, {0.55545, 1.00000, 0.00000}, {0.57132, 1.00000, 0.00000}, {0.58719, 1.00000, 0.00000}, {0.60306, 1.00000, 0.00000}, {0.61893, 1.00000, 0.00000}, {0.63480, 1.00000, 0.00000}, {0.65067, 1.00000, 0.00000}, {0.66654, 1.00000, 0.00000}, {0.68241, 1.00000, 0.00000}, {0.69828, 1.00000, 0.00000}, {0.71415, 1.00000, 0.00000}, {0.73002, 1.00000, 0.00000}, {0.74589, 1.00000, 0.00000}, {0.76176, 1.00000, 0.00000}, {0.77763, 1.00000, 0.00000}, {0.79350, 1.00000, 0.00000}, {0.80937, 1.00000, 0.00000}, {0.82524, 1.00000, 0.00000}, {0.84111, 1.00000, 0.00000}, {0.85698, 1.00000, 0.00000}, {0.87285, 1.00000, 0.00000}, {0.88872, 1.00000, 0.00000}, {0.90459, 1.00000, 0.00000}, {0.92046, 1.00000, 0.00000}, {0.93633, 1.00000, 0.00000}, {0.95220, 1.00000, 0.00000}, {0.96807, 1.00000, 0.00000}, {0.98394, 1.00000, 0.00000}, {0.99981, 1.00000, 0.00000}, {1.00000, 0.99981, 0.00000}, {1.00000, 0.98394, 0.00000}, {1.00000, 0.96807, 0.00000}, {1.00000, 0.95220, 0.00000}, {1.00000, 0.93633, 0.00000}, {1.00000, 0.92046, 0.00000}, {1.00000, 0.90459, 0.00000}, {1.00000, 0.88872, 0.00000}, {1.00000, 0.87285, 0.00000}, {1.00000, 0.85698, 0.00000}, {1.00000, 0.84111, 0.00000}, {1.00000, 0.82524, 0.00000}, {1.00000, 0.80937, 0.00000}, {1.00000, 0.79350, 0.00000}, {1.00000, 0.77763, 0.00000}, {1.00000, 0.76176, 0.00000}, {1.00000, 0.74589, 0.00000}, {1.00000, 0.73002, 0.00000}, {1.00000, 0.71415, 0.00000}, {1.00000, 0.69828, 0.00000}, {1.00000, 0.68241, 0.00000}, {1.00000, 0.66654, 0.00000}, {1.00000, 0.65067, 0.00000}, {1.00000, 0.63480, 0.00000}, {1.00000, 0.61893, 0.00000}, {1.00000, 0.60306, 0.00000}, {1.00000, 0.58719, 0.00000}, {1.00000, 0.57132, 0.00000}, {1.00000, 0.55545, 0.00000}, {1.00000, 0.53958, 0.00000}, {1.00000, 0.52371, 0.00000}, {1.00000, 0.50784, 0.00000}, {1.00000, 0.49197, 0.00000}, {1.00000, 0.47610, 0.00000}, {1.00000, 0.46023, 0.00000}, {1.00000, 0.44436, 0.00000}, {1.00000, 0.42849, 0.00000}, {1.00000, 0.41262, 0.00000}, {1.00000, 0.39675, 0.00000}, {1.00000, 0.38088, 0.00000}, {1.00000, 0.36501, 0.00000}, {1.00000, 0.34914, 0.00000}, {1.00000, 0.33327, 0.00000}, {1.00000, 0.31740, 0.00000}, {1.00000, 0.30153, 0.00000}, {1.00000, 0.28566, 0.00000}, {1.00000, 0.26979, 0.00000}, {1.00000, 0.25392, 0.00000}, {1.00000, 0.23805, 0.00000}, {1.00000, 0.22218, 0.00000}, {1.00000, 0.20631, 0.00000}, {1.00000, 0.19044, 0.00000}, {1.00000, 0.17457, 0.00000}, {1.00000, 0.15870, 0.00000}, {1.00000, 0.14283, 0.00000}, {1.00000, 0.12696, 0.00000}, {1.00000, 0.11109, 0.00000}, {1.00000, 0.09522, 0.00000}, {1.00000, 0.07935, 0.00000}, {1.00000, 0.06348, 0.00000}, {1.00000, 0.04761, 0.00000}, {1.00000, 0.03174, 0.00000}, {1.00000, 0.01587, 0.00000}, {1.00000, 0.00000, 0.00000}, }; new ColorMapInfo("backgr.lasc", backgr_lasc); static RGBColor idl11_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00392, 0.00392}, {0.00000, 0.00784, 0.00784}, {0.00000, 0.01176, 0.01176}, {0.00000, 0.01569, 0.01569}, {0.00000, 0.03137, 0.03137}, {0.00000, 0.04706, 0.04706}, {0.00000, 0.06275, 0.06275}, {0.00000, 0.08235, 0.08235}, {0.00000, 0.09804, 0.09804}, {0.00000, 0.11373, 0.11373}, {0.00000, 0.12941, 0.12941}, {0.00000, 0.14902, 0.14902}, {0.00000, 0.16471, 0.16471}, {0.00000, 0.18039, 0.18039}, {0.00000, 0.19608, 0.19608}, {0.00000, 0.21569, 0.21569}, {0.00000, 0.23137, 0.23137}, {0.00000, 0.24706, 0.24706}, {0.00000, 0.26275, 0.26275}, {0.00000, 0.28235, 0.28235}, {0.00000, 0.29804, 0.29804}, {0.00000, 0.31373, 0.31373}, {0.00000, 0.32941, 0.32941}, {0.00000, 0.34902, 0.34902}, {0.00000, 0.36471, 0.36471}, {0.00000, 0.38039, 0.38039}, {0.00000, 0.39608, 0.39608}, {0.00000, 0.41569, 0.41569}, {0.00000, 0.43137, 0.43137}, {0.00000, 0.44706, 0.44706}, {0.00000, 0.46275, 0.46275}, {0.00000, 0.48235, 0.48235}, {0.00000, 0.49804, 0.49804}, {0.00000, 0.51373, 0.51373}, {0.00000, 0.52941, 0.52941}, {0.00000, 0.54902, 0.54902}, {0.00000, 0.56471, 0.56471}, {0.00000, 0.58039, 0.58039}, {0.00000, 0.59608, 0.59608}, {0.00000, 0.61569, 0.61569}, {0.00000, 0.63137, 0.63137}, {0.00000, 0.64706, 0.64706}, {0.00000, 0.66275, 0.66275}, {0.00000, 0.68235, 0.68235}, {0.00000, 0.69804, 0.69804}, {0.00000, 0.71373, 0.71373}, {0.00000, 0.72941, 0.72941}, {0.00000, 0.74902, 0.74902}, {0.00000, 0.76471, 0.76471}, {0.00000, 0.78039, 0.78039}, {0.00000, 0.79608, 0.79608}, {0.00000, 0.81569, 0.81569}, {0.00000, 0.83137, 0.83137}, {0.00000, 0.84706, 0.84706}, {0.00000, 0.86275, 0.86275}, {0.00000, 0.88235, 0.88235}, {0.00000, 0.89804, 0.89804}, {0.00000, 0.91373, 0.91373}, {0.00000, 0.92941, 0.92941}, {0.00000, 0.94902, 0.94902}, {0.00000, 0.96471, 0.96471}, {0.00000, 0.98039, 0.98039}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 0.98431, 1.00000}, {0.00000, 0.96863, 1.00000}, {0.00000, 0.95294, 1.00000}, {0.00000, 0.93725, 1.00000}, {0.00000, 0.92157, 1.00000}, {0.00000, 0.90588, 1.00000}, {0.00000, 0.89020, 1.00000}, {0.00000, 0.87451, 1.00000}, {0.00000, 0.85882, 1.00000}, {0.00000, 0.84314, 1.00000}, {0.00000, 0.82745, 1.00000}, {0.00000, 0.81176, 1.00000}, {0.00000, 0.79608, 1.00000}, {0.00000, 0.78039, 1.00000}, {0.00000, 0.76471, 1.00000}, {0.00000, 0.74902, 1.00000}, {0.00000, 0.73333, 1.00000}, {0.00000, 0.71765, 1.00000}, {0.00000, 0.70196, 1.00000}, {0.00000, 0.68627, 1.00000}, {0.00000, 0.66667, 1.00000}, {0.00000, 0.65098, 1.00000}, {0.00000, 0.63529, 1.00000}, {0.00000, 0.61961, 1.00000}, {0.00000, 0.60392, 1.00000}, {0.00000, 0.58824, 1.00000}, {0.00000, 0.57255, 1.00000}, {0.00000, 0.55686, 1.00000}, {0.00000, 0.54118, 1.00000}, {0.00000, 0.52549, 1.00000}, {0.00000, 0.50980, 1.00000}, {0.00000, 0.49412, 1.00000}, {0.00000, 0.47843, 1.00000}, {0.00000, 0.46275, 1.00000}, {0.00000, 0.44706, 1.00000}, {0.00000, 0.43137, 1.00000}, {0.00000, 0.41569, 1.00000}, {0.00000, 0.40000, 1.00000}, {0.00000, 0.38431, 1.00000}, {0.00000, 0.36863, 1.00000}, {0.00000, 0.35294, 1.00000}, {0.00000, 0.33333, 1.00000}, {0.00000, 0.31765, 1.00000}, {0.00000, 0.30196, 1.00000}, {0.00000, 0.28627, 1.00000}, {0.00000, 0.27059, 1.00000}, {0.00000, 0.25490, 1.00000}, {0.00000, 0.23922, 1.00000}, {0.00000, 0.22353, 1.00000}, {0.00000, 0.20784, 1.00000}, {0.00000, 0.19216, 1.00000}, {0.00000, 0.17647, 1.00000}, {0.00000, 0.16078, 1.00000}, {0.00000, 0.14510, 1.00000}, {0.00000, 0.12941, 1.00000}, {0.00000, 0.11373, 1.00000}, {0.00000, 0.09804, 1.00000}, {0.00000, 0.08235, 1.00000}, {0.00000, 0.06667, 1.00000}, {0.00000, 0.05098, 1.00000}, {0.00000, 0.03529, 1.00000}, {0.00000, 0.01961, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.01569, 0.00000, 1.00000}, {0.03137, 0.00000, 1.00000}, {0.04706, 0.00000, 1.00000}, {0.06275, 0.00000, 1.00000}, {0.07843, 0.00000, 1.00000}, {0.09412, 0.00000, 1.00000}, {0.10980, 0.00000, 1.00000}, {0.12549, 0.00000, 1.00000}, {0.14118, 0.00000, 1.00000}, {0.15686, 0.00000, 1.00000}, {0.17255, 0.00000, 1.00000}, {0.18824, 0.00000, 1.00000}, {0.20392, 0.00000, 1.00000}, {0.21961, 0.00000, 1.00000}, {0.23529, 0.00000, 1.00000}, {0.25098, 0.00000, 1.00000}, {0.26667, 0.00000, 1.00000}, {0.28235, 0.00000, 1.00000}, {0.29804, 0.00000, 1.00000}, {0.31373, 0.00000, 1.00000}, {0.33333, 0.00000, 1.00000}, {0.34902, 0.00000, 1.00000}, {0.36471, 0.00000, 1.00000}, {0.38039, 0.00000, 1.00000}, {0.39608, 0.00000, 1.00000}, {0.41176, 0.00000, 1.00000}, {0.42745, 0.00000, 1.00000}, {0.44314, 0.00000, 1.00000}, {0.45882, 0.00000, 1.00000}, {0.47451, 0.00000, 1.00000}, {0.49020, 0.00000, 1.00000}, {0.50588, 0.00000, 1.00000}, {0.52157, 0.00000, 1.00000}, {0.53725, 0.00000, 1.00000}, {0.55294, 0.00000, 1.00000}, {0.56863, 0.00000, 1.00000}, {0.58431, 0.00000, 1.00000}, {0.60000, 0.00000, 1.00000}, {0.61569, 0.00000, 1.00000}, {0.63137, 0.00000, 1.00000}, {0.64706, 0.00000, 1.00000}, {0.66667, 0.00000, 1.00000}, {0.68235, 0.00000, 1.00000}, {0.69804, 0.00000, 1.00000}, {0.71373, 0.00000, 1.00000}, {0.72941, 0.00000, 1.00000}, {0.74510, 0.00000, 1.00000}, {0.76078, 0.00000, 1.00000}, {0.77647, 0.00000, 1.00000}, {0.79216, 0.00000, 1.00000}, {0.80784, 0.00000, 1.00000}, {0.82353, 0.00000, 1.00000}, {0.83922, 0.00000, 1.00000}, {0.85490, 0.00000, 1.00000}, {0.87059, 0.00000, 1.00000}, {0.88627, 0.00000, 1.00000}, {0.90196, 0.00000, 1.00000}, {0.91765, 0.00000, 1.00000}, {0.93333, 0.00000, 1.00000}, {0.94902, 0.00000, 1.00000}, {0.96471, 0.00000, 1.00000}, {0.98039, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.00000, 0.98431}, {1.00000, 0.00000, 0.96863}, {1.00000, 0.00000, 0.95294}, {1.00000, 0.00000, 0.93725}, {1.00000, 0.00000, 0.92157}, {1.00000, 0.00000, 0.90588}, {1.00000, 0.00000, 0.89020}, {1.00000, 0.00000, 0.87451}, {1.00000, 0.00000, 0.85490}, {1.00000, 0.00000, 0.83922}, {1.00000, 0.00000, 0.82353}, {1.00000, 0.00000, 0.80784}, {1.00000, 0.00000, 0.79216}, {1.00000, 0.00000, 0.77647}, {1.00000, 0.00000, 0.76078}, {1.00000, 0.00000, 0.74510}, {1.00000, 0.00000, 0.72941}, {1.00000, 0.00000, 0.70980}, {1.00000, 0.00000, 0.69412}, {1.00000, 0.00000, 0.67843}, {1.00000, 0.00000, 0.66275}, {1.00000, 0.00000, 0.64706}, {1.00000, 0.00000, 0.63137}, {1.00000, 0.00000, 0.61569}, {1.00000, 0.00000, 0.60000}, {1.00000, 0.00000, 0.58431}, {1.00000, 0.00000, 0.56471}, {1.00000, 0.00000, 0.54902}, {1.00000, 0.00000, 0.53333}, {1.00000, 0.00000, 0.51765}, {1.00000, 0.00000, 0.50196}, {1.00000, 0.00000, 0.48627}, {1.00000, 0.00000, 0.47059}, {1.00000, 0.00000, 0.45490}, {1.00000, 0.00000, 0.43922}, {1.00000, 0.00000, 0.41961}, {1.00000, 0.00000, 0.40392}, {1.00000, 0.00000, 0.38824}, {1.00000, 0.00000, 0.37255}, {1.00000, 0.00000, 0.35686}, {1.00000, 0.00000, 0.34118}, {1.00000, 0.00000, 0.32549}, {1.00000, 0.00000, 0.30980}, {1.00000, 0.00000, 0.29412}, {1.00000, 0.00000, 0.27451}, {1.00000, 0.00000, 0.25882}, {1.00000, 0.00000, 0.24314}, {1.00000, 0.00000, 0.22745}, {1.00000, 0.00000, 0.21176}, {1.00000, 0.00000, 0.19608}, {1.00000, 0.00000, 0.18039}, {1.00000, 0.00000, 0.16471}, {1.00000, 0.00000, 0.14902}, {1.00000, 0.00000, 0.12941}, {1.00000, 0.00000, 0.11373}, {1.00000, 0.00000, 0.09804}, {1.00000, 0.00000, 0.08235}, {1.00000, 0.00000, 0.06667}, {1.00000, 0.00000, 0.05098}, {1.00000, 0.00000, 0.03529}, {1.00000, 0.00000, 0.01961}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, }; new ColorMapInfo("idl11.lasc", idl11_lasc); static RGBColor idl4_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00784}, {0.00000, 0.00000, 0.01569}, {0.00000, 0.00000, 0.02353}, {0.00000, 0.00000, 0.03137}, {0.00000, 0.00000, 0.03922}, {0.00000, 0.00000, 0.04706}, {0.00000, 0.00000, 0.05490}, {0.00000, 0.00000, 0.06275}, {0.00000, 0.00000, 0.07059}, {0.00000, 0.00000, 0.07843}, {0.00000, 0.00000, 0.08627}, {0.00000, 0.00000, 0.09804}, {0.00000, 0.00000, 0.10588}, {0.00000, 0.00000, 0.11373}, {0.00000, 0.00000, 0.12157}, {0.00000, 0.00000, 0.12941}, {0.00000, 0.00000, 0.13725}, {0.00000, 0.00000, 0.14510}, {0.00000, 0.00000, 0.15294}, {0.00000, 0.00000, 0.16078}, {0.00000, 0.00000, 0.16863}, {0.00000, 0.00000, 0.17647}, {0.00000, 0.00000, 0.18431}, {0.00000, 0.00000, 0.19608}, {0.00000, 0.00000, 0.20392}, {0.00000, 0.00000, 0.21176}, {0.00000, 0.00000, 0.21961}, {0.00000, 0.00000, 0.22745}, {0.00000, 0.00000, 0.23529}, {0.00000, 0.00000, 0.24314}, {0.00000, 0.00000, 0.25098}, {0.00000, 0.00000, 0.25882}, {0.00000, 0.01176, 0.26667}, {0.00000, 0.02353, 0.27451}, {0.00000, 0.03529, 0.28235}, {0.00000, 0.04706, 0.29412}, {0.00000, 0.05882, 0.30196}, {0.00000, 0.07059, 0.30980}, {0.00000, 0.08235, 0.31765}, {0.00000, 0.09804, 0.32549}, {0.00000, 0.10980, 0.33333}, {0.00000, 0.12157, 0.34118}, {0.00000, 0.13333, 0.34902}, {0.00000, 0.14510, 0.35686}, {0.00000, 0.15686, 0.36471}, {0.00000, 0.16863, 0.37255}, {0.00000, 0.18039, 0.38039}, {0.00000, 0.19608, 0.39216}, {0.00000, 0.20784, 0.39216}, {0.00000, 0.21961, 0.39216}, {0.00000, 0.23137, 0.39216}, {0.00000, 0.24314, 0.39216}, {0.00000, 0.25490, 0.39216}, {0.00000, 0.26667, 0.39216}, {0.00000, 0.27843, 0.39216}, {0.00000, 0.29412, 0.39216}, {0.00000, 0.30588, 0.39216}, {0.00000, 0.31765, 0.39216}, {0.00000, 0.32941, 0.39216}, {0.00000, 0.34118, 0.39216}, {0.00000, 0.35294, 0.39216}, {0.00000, 0.36471, 0.39216}, {0.00000, 0.37647, 0.39216}, {0.00000, 0.39216, 0.39216}, {0.00000, 0.40392, 0.39216}, {0.00000, 0.41569, 0.39216}, {0.00000, 0.42745, 0.39216}, {0.00000, 0.43922, 0.39216}, {0.00000, 0.45098, 0.39216}, {0.00000, 0.46275, 0.39216}, {0.00000, 0.47451, 0.39216}, {0.00000, 0.49020, 0.39216}, {0.00000, 0.50196, 0.39216}, {0.00000, 0.51373, 0.39216}, {0.00000, 0.52549, 0.39216}, {0.00000, 0.53725, 0.39216}, {0.00000, 0.54902, 0.39216}, {0.00000, 0.56078, 0.39216}, {0.00000, 0.57255, 0.39216}, {0.00000, 0.58824, 0.39216}, {0.00000, 0.58824, 0.37647}, {0.00000, 0.58824, 0.36471}, {0.00000, 0.58824, 0.35294}, {0.00000, 0.58824, 0.34118}, {0.00000, 0.58824, 0.32941}, {0.00000, 0.58824, 0.31765}, {0.00000, 0.58824, 0.30588}, {0.00000, 0.58824, 0.29412}, {0.00000, 0.58824, 0.27843}, {0.00000, 0.58824, 0.26667}, {0.00000, 0.58824, 0.25490}, {0.00000, 0.58824, 0.24314}, {0.00000, 0.58824, 0.23137}, {0.00000, 0.58824, 0.21961}, {0.00000, 0.58824, 0.20784}, {0.00000, 0.58824, 0.19608}, {0.00000, 0.58431, 0.18039}, {0.00000, 0.58039, 0.16863}, {0.00000, 0.58039, 0.15686}, {0.00000, 0.57647, 0.14510}, {0.00000, 0.57255, 0.13333}, {0.00000, 0.57255, 0.12157}, {0.00000, 0.56863, 0.10980}, {0.00000, 0.56863, 0.09804}, {0.00000, 0.56471, 0.08235}, {0.00000, 0.56078, 0.07059}, {0.00000, 0.56078, 0.05882}, {0.00000, 0.55686, 0.04706}, {0.00000, 0.55294, 0.03529}, {0.00000, 0.55294, 0.02353}, {0.00000, 0.54902, 0.01176}, {0.00000, 0.54902, 0.00000}, {0.02745, 0.53725, 0.00000}, {0.05882, 0.52941, 0.00000}, {0.08627, 0.51765, 0.00000}, {0.11765, 0.50980, 0.00000}, {0.14510, 0.49804, 0.00000}, {0.17647, 0.49020, 0.00000}, {0.20392, 0.47843, 0.00000}, {0.23529, 0.47059, 0.00000}, {0.26275, 0.45882, 0.00000}, {0.29412, 0.45098, 0.00000}, {0.32157, 0.43922, 0.00000}, {0.35294, 0.43137, 0.00000}, {0.38039, 0.41961, 0.00000}, {0.41176, 0.41176, 0.00000}, {0.43922, 0.40000, 0.00000}, {0.47059, 0.39216, 0.00000}, {0.49020, 0.36471, 0.00000}, {0.50980, 0.34118, 0.00000}, {0.52941, 0.31765, 0.00000}, {0.54902, 0.29412, 0.00000}, {0.56863, 0.26667, 0.00000}, {0.58824, 0.24314, 0.00000}, {0.60784, 0.21961, 0.00000}, {0.62745, 0.19608, 0.00000}, {0.64706, 0.16863, 0.00000}, {0.66667, 0.14510, 0.00000}, {0.68627, 0.12157, 0.00000}, {0.70588, 0.09804, 0.00000}, {0.72549, 0.07059, 0.00000}, {0.74510, 0.04706, 0.00000}, {0.76471, 0.02353, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00784, 0.00000}, {0.78824, 0.01569, 0.00000}, {0.78824, 0.02353, 0.00000}, {0.79216, 0.03529, 0.00000}, {0.79216, 0.04314, 0.00000}, {0.79608, 0.05098, 0.00000}, {0.79608, 0.06275, 0.00000}, {0.80000, 0.07059, 0.00000}, {0.80000, 0.07843, 0.00000}, {0.80392, 0.09020, 0.00000}, {0.80392, 0.09804, 0.00000}, {0.80784, 0.10588, 0.00000}, {0.80784, 0.11373, 0.00000}, {0.81176, 0.12549, 0.00000}, {0.81176, 0.13333, 0.00000}, {0.81569, 0.14118, 0.00000}, {0.81569, 0.15294, 0.00000}, {0.81961, 0.16078, 0.00000}, {0.81961, 0.16863, 0.00000}, {0.82353, 0.18039, 0.00000}, {0.82353, 0.18824, 0.00000}, {0.82745, 0.19608, 0.00000}, {0.82745, 0.20784, 0.00000}, {0.83137, 0.21569, 0.00000}, {0.83137, 0.22353, 0.00000}, {0.83529, 0.23137, 0.00000}, {0.83529, 0.24314, 0.00000}, {0.83922, 0.25098, 0.00000}, {0.83922, 0.25882, 0.00000}, {0.84314, 0.27059, 0.00000}, {0.84314, 0.27843, 0.00000}, {0.84706, 0.28627, 0.00000}, {0.84706, 0.29804, 0.00000}, {0.85098, 0.30588, 0.00000}, {0.85098, 0.31373, 0.00000}, {0.85490, 0.32549, 0.00000}, {0.85490, 0.33333, 0.00000}, {0.85882, 0.34118, 0.00000}, {0.85882, 0.34902, 0.00000}, {0.86275, 0.36078, 0.00000}, {0.86275, 0.36863, 0.00000}, {0.86667, 0.37647, 0.00000}, {0.86667, 0.38824, 0.00000}, {0.87059, 0.39608, 0.00000}, {0.87059, 0.40392, 0.00000}, {0.87451, 0.41569, 0.00000}, {0.87451, 0.42353, 0.00000}, {0.87843, 0.43137, 0.00000}, {0.87843, 0.44314, 0.00000}, {0.88235, 0.45098, 0.00000}, {0.88235, 0.45882, 0.00000}, {0.88627, 0.46667, 0.00000}, {0.88627, 0.47843, 0.00000}, {0.89020, 0.48627, 0.00000}, {0.89020, 0.49412, 0.00000}, {0.89412, 0.50588, 0.00000}, {0.89412, 0.51373, 0.00000}, {0.89804, 0.52157, 0.00000}, {0.89804, 0.53333, 0.00000}, {0.90196, 0.54118, 0.00000}, {0.90196, 0.54902, 0.00000}, {0.90588, 0.55686, 0.00000}, {0.90588, 0.56863, 0.00000}, {0.90980, 0.57647, 0.00000}, {0.90980, 0.58431, 0.00000}, {0.91373, 0.59608, 0.00000}, {0.91373, 0.60392, 0.00000}, {0.91765, 0.61176, 0.00000}, {0.91765, 0.62353, 0.00000}, {0.92157, 0.63137, 0.00000}, {0.92157, 0.63922, 0.00000}, {0.92549, 0.65098, 0.00000}, {0.92549, 0.65882, 0.00000}, {0.92941, 0.66667, 0.00000}, {0.92941, 0.67451, 0.00000}, {0.93333, 0.68627, 0.00000}, {0.93333, 0.69412, 0.00000}, {0.93725, 0.70196, 0.00000}, {0.93725, 0.71373, 0.00000}, {0.94118, 0.72157, 0.00000}, {0.94118, 0.72941, 0.00000}, {0.94510, 0.74118, 0.00000}, {0.94510, 0.74902, 0.00000}, {0.94902, 0.75686, 0.00000}, {0.94902, 0.76863, 0.00000}, {0.95294, 0.77647, 0.00000}, {0.95294, 0.78431, 0.00000}, {0.95686, 0.79216, 0.00000}, {0.95686, 0.80392, 0.00000}, {0.96078, 0.81176, 0.00000}, {0.96078, 0.81961, 0.00000}, {0.96471, 0.83137, 0.00000}, {0.96471, 0.83922, 0.00000}, {0.96863, 0.84706, 0.00000}, {0.96863, 0.85882, 0.00000}, {0.97255, 0.86667, 0.00000}, {0.97255, 0.87451, 0.00000}, {0.97647, 0.88627, 0.00000}, {0.97647, 0.89412, 0.00000}, {0.98039, 0.90196, 0.00000}, {0.98039, 0.90980, 0.00000}, {0.98431, 0.92157, 0.00000}, {0.98431, 0.92941, 0.00000}, {0.98824, 0.93725, 0.00000}, {0.98824, 0.94902, 0.00000}, {0.99216, 0.95686, 0.00000}, {0.99216, 0.96471, 0.00000}, {0.99608, 0.97647, 0.00000}, {0.99608, 0.98431, 0.00000}, {1.00000, 0.99216, 0.00000}, {1.00000, 1.00000, 0.00000}, }; new ColorMapInfo("idl4.lasc", idl4_lasc); static RGBColor idl14_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.16471, 0.00000}, {0.00000, 0.33333, 0.00000}, {0.00000, 0.49804, 0.00000}, {0.00000, 0.66667, 0.00000}, {0.00000, 0.83137, 0.00000}, {0.00000, 1.00000, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.92549, 0.00000}, {0.00000, 0.88627, 0.00000}, {0.00000, 0.84706, 0.00000}, {0.00000, 0.80784, 0.00000}, {0.00000, 0.77255, 0.00000}, {0.00000, 0.73333, 0.00000}, {0.00000, 0.69412, 0.00000}, {0.00000, 0.65490, 0.00000}, {0.00000, 0.61569, 0.00000}, {0.00000, 0.58039, 0.00000}, {0.00000, 0.54118, 0.00000}, {0.00000, 0.50196, 0.00000}, {0.00000, 0.46275, 0.00000}, {0.00000, 0.42353, 0.00000}, {0.00000, 0.38824, 0.00000}, {0.00000, 0.34902, 0.00000}, {0.00000, 0.30980, 0.00000}, {0.00000, 0.27059, 0.00000}, {0.00000, 0.23137, 0.00000}, {0.00000, 0.19608, 0.00000}, {0.00000, 0.15686, 0.00000}, {0.00000, 0.11765, 0.00000}, {0.00000, 0.07843, 0.00000}, {0.00000, 0.03922, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.03137}, {0.00000, 0.00000, 0.06275}, {0.00000, 0.00000, 0.09412}, {0.00000, 0.00000, 0.12549}, {0.00000, 0.00000, 0.16078}, {0.00000, 0.00000, 0.19216}, {0.00000, 0.00000, 0.22353}, {0.00000, 0.00000, 0.25490}, {0.00000, 0.00000, 0.29020}, {0.00000, 0.00000, 0.32157}, {0.00000, 0.00000, 0.35294}, {0.00000, 0.00000, 0.38431}, {0.00000, 0.00000, 0.41569}, {0.00000, 0.00000, 0.45098}, {0.00000, 0.00000, 0.48235}, {0.00000, 0.00000, 0.51373}, {0.00000, 0.00000, 0.54510}, {0.00000, 0.00000, 0.58039}, {0.00000, 0.00000, 0.61176}, {0.00000, 0.00000, 0.64314}, {0.00000, 0.00000, 0.67451}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.00000, 0.74118}, {0.00000, 0.00000, 0.77255}, {0.00000, 0.00000, 0.80392}, {0.00000, 0.00000, 0.83529}, {0.00000, 0.00000, 0.87059}, {0.00000, 0.00000, 0.90196}, {0.00000, 0.00000, 0.93333}, {0.00000, 0.00000, 0.96471}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 0.00000}, {0.02745, 0.00000, 0.01961}, {0.05882, 0.00000, 0.03922}, {0.09020, 0.00000, 0.05882}, {0.12157, 0.00000, 0.08235}, {0.15294, 0.00000, 0.10196}, {0.18431, 0.00000, 0.12157}, {0.21569, 0.00000, 0.14510}, {0.24706, 0.00000, 0.16471}, {0.27451, 0.00000, 0.18431}, {0.30588, 0.00000, 0.20784}, {0.33725, 0.00000, 0.22745}, {0.36863, 0.00000, 0.24706}, {0.40000, 0.00000, 0.27059}, {0.43137, 0.00000, 0.29020}, {0.46275, 0.00000, 0.30980}, {0.49412, 0.00000, 0.33333}, {0.52549, 0.00000, 0.34902}, {0.55686, 0.00000, 0.36863}, {0.59216, 0.00000, 0.38431}, {0.62353, 0.00000, 0.40392}, {0.65882, 0.00000, 0.42353}, {0.69020, 0.00000, 0.43922}, {0.72157, 0.00000, 0.45882}, {0.75686, 0.00000, 0.47451}, {0.78824, 0.00000, 0.49412}, {0.82353, 0.00000, 0.51373}, {0.85490, 0.00000, 0.52941}, {0.88627, 0.00000, 0.54902}, {0.92157, 0.00000, 0.56471}, {0.95294, 0.00000, 0.58431}, {0.98824, 0.00000, 0.60392}, {0.00000, 0.00000, 0.00000}, {0.00392, 0.00000, 0.00000}, {0.00784, 0.00000, 0.00000}, {0.01176, 0.00000, 0.00000}, {0.01569, 0.00000, 0.00000}, {0.01961, 0.00000, 0.00000}, {0.02353, 0.00000, 0.00000}, {0.02745, 0.00000, 0.00000}, {0.03137, 0.00000, 0.00000}, {0.03529, 0.00000, 0.00000}, {0.03922, 0.00000, 0.00000}, {0.04314, 0.00000, 0.00000}, {0.04706, 0.00000, 0.00000}, {0.05490, 0.00000, 0.00000}, {0.06275, 0.00000, 0.00000}, {0.07059, 0.00000, 0.00000}, {0.07843, 0.00000, 0.00000}, {0.09020, 0.00000, 0.00000}, {0.09804, 0.00000, 0.00000}, {0.10588, 0.00000, 0.00000}, {0.11373, 0.00000, 0.00000}, {0.12549, 0.00000, 0.00000}, {0.13333, 0.00000, 0.00000}, {0.14118, 0.00000, 0.00000}, {0.14902, 0.00000, 0.00000}, {0.16078, 0.00000, 0.00000}, {0.17255, 0.00000, 0.00000}, {0.18431, 0.00000, 0.00000}, {0.19608, 0.00000, 0.00000}, {0.20784, 0.00000, 0.00000}, {0.21961, 0.00000, 0.00000}, {0.23137, 0.00000, 0.00000}, {0.24706, 0.00000, 0.00000}, {0.25882, 0.00000, 0.00000}, {0.27059, 0.00000, 0.00000}, {0.28235, 0.00000, 0.00000}, {0.29412, 0.00000, 0.00000}, {0.30588, 0.00000, 0.00000}, {0.32157, 0.00000, 0.00392}, {0.33333, 0.00000, 0.00392}, {0.34902, 0.00000, 0.00392}, {0.36471, 0.00000, 0.00392}, {0.38039, 0.00000, 0.00392}, {0.39608, 0.00000, 0.00392}, {0.41176, 0.00000, 0.00392}, {0.42353, 0.00000, 0.00392}, {0.43922, 0.00000, 0.00392}, {0.45490, 0.00000, 0.00392}, {0.47059, 0.00000, 0.00392}, {0.48627, 0.00000, 0.00392}, {0.50196, 0.00392, 0.00392}, {0.51373, 0.00392, 0.00392}, {0.52941, 0.00392, 0.00392}, {0.54510, 0.00392, 0.00392}, {0.56078, 0.00392, 0.00392}, {0.57647, 0.00392, 0.00392}, {0.59216, 0.00392, 0.00392}, {0.60784, 0.00392, 0.00392}, {0.62353, 0.00392, 0.00392}, {0.63922, 0.00392, 0.00392}, {0.65490, 0.00392, 0.00392}, {0.67059, 0.00392, 0.00392}, {0.68627, 0.00392, 0.00392}, {0.69804, 0.00392, 0.00392}, {0.70980, 0.00392, 0.00392}, {0.72549, 0.00392, 0.00392}, {0.73725, 0.00392, 0.00392}, {0.75294, 0.00392, 0.00392}, {0.76471, 0.00392, 0.00392}, {0.77647, 0.00392, 0.00392}, {0.79216, 0.00392, 0.00392}, {0.80392, 0.00392, 0.00392}, {0.81961, 0.00392, 0.00392}, {0.83137, 0.00392, 0.00392}, {0.84706, 0.00392, 0.00784}, {0.85490, 0.00392, 0.00784}, {0.86275, 0.00392, 0.00784}, {0.87451, 0.00392, 0.00784}, {0.88235, 0.00392, 0.00784}, {0.89020, 0.00392, 0.00784}, {0.90196, 0.00392, 0.00784}, {0.90980, 0.00392, 0.00784}, {0.91765, 0.00392, 0.00784}, {0.92941, 0.00392, 0.00784}, {0.93725, 0.00392, 0.00784}, {0.94510, 0.00392, 0.00784}, {0.95686, 0.00784, 0.00784}, {0.95686, 0.00784, 0.00784}, {0.96078, 0.00784, 0.00784}, {0.96471, 0.00784, 0.00784}, {0.96863, 0.00784, 0.00784}, {0.96863, 0.00784, 0.00784}, {0.97255, 0.00784, 0.00784}, {0.97647, 0.00784, 0.00784}, {0.98039, 0.00784, 0.00784}, {0.98039, 0.00784, 0.00784}, {0.98431, 0.00784, 0.00784}, {0.98824, 0.00784, 0.00784}, {0.99216, 0.00784, 0.00784}, {0.99608, 0.00392, 0.00784}, {0.99608, 0.00392, 0.00784}, {0.99608, 0.01176, 0.00784}, {0.99608, 0.01961, 0.00784}, {0.99608, 0.03137, 0.00784}, {0.99608, 0.03922, 0.00784}, {0.99608, 0.04706, 0.00784}, {0.99608, 0.05882, 0.00784}, {0.99608, 0.06667, 0.00784}, {0.99608, 0.07451, 0.00784}, {0.99608, 0.08627, 0.00784}, {0.99608, 0.09412, 0.00784}, {0.99608, 0.10196, 0.00784}, {0.99608, 0.11373, 0.00784}, {0.99608, 0.12157, 0.00784}, {0.99608, 0.12941, 0.00784}, {0.99608, 0.14118, 0.00784}, {0.99608, 0.14118, 0.00784}, {0.99608, 0.14902, 0.01176}, {0.99608, 0.15686, 0.01569}, {0.99608, 0.16471, 0.01961}, {1.00000, 0.17647, 0.02745}, {1.00000, 0.18824, 0.03529}, {1.00000, 0.20000, 0.04706}, {1.00000, 0.21176, 0.05490}, {1.00000, 0.22745, 0.06667}, {1.00000, 0.23922, 0.07843}, {1.00000, 0.25098, 0.09020}, {1.00000, 0.26275, 0.10588}, {1.00000, 0.27451, 0.11765}, {1.00000, 0.28627, 0.13333}, {1.00000, 0.30196, 0.15294}, {1.00000, 0.32157, 0.17255}, {1.00000, 0.34118, 0.19216}, {1.00000, 0.36078, 0.21569}, {1.00000, 0.37647, 0.23529}, {1.00000, 0.39216, 0.25490}, {1.00000, 0.40784, 0.27843}, {1.00000, 0.42353, 0.29804}, {1.00000, 0.44314, 0.32157}, {1.00000, 0.46667, 0.34902}, {1.00000, 0.49020, 0.38039}, {1.00000, 0.51373, 0.40784}, {1.00000, 0.54118, 0.43922}, {1.00000, 0.56471, 0.47059}, {1.00000, 0.59216, 0.50196}, {1.00000, 0.61569, 0.53333}, {1.00000, 0.64314, 0.56863}, {1.00000, 0.67059, 0.60000}, {1.00000, 0.69804, 0.63529}, {1.00000, 0.72549, 0.67059}, {1.00000, 0.75686, 0.70588}, {1.00000, 0.78431, 0.74118}, {1.00000, 0.81569, 0.77647}, {1.00000, 0.84314, 0.81176}, {1.00000, 0.87451, 0.85098}, {1.00000, 0.89804, 0.87843}, {1.00000, 0.92157, 0.90980}, {1.00000, 0.94902, 0.93725}, {1.00000, 0.97255, 0.96863}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("idl14.lasc", idl14_lasc); static RGBColor rainbow3_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.03922}, {0.00000, 0.00000, 0.07843}, {0.00000, 0.00000, 0.11765}, {0.00000, 0.00000, 0.15686}, {0.00000, 0.00000, 0.20000}, {0.00000, 0.00000, 0.23922}, {0.00000, 0.00000, 0.27843}, {0.00000, 0.00000, 0.31765}, {0.00000, 0.00000, 0.35686}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.43922}, {0.00000, 0.00000, 0.47843}, {0.00000, 0.00000, 0.51765}, {0.00000, 0.00000, 0.55686}, {0.00000, 0.00000, 0.60000}, {0.00000, 0.00000, 0.63922}, {0.00000, 0.00000, 0.67843}, {0.00000, 0.00000, 0.71765}, {0.00000, 0.00000, 0.75686}, {0.00000, 0.00000, 0.80000}, {0.00000, 0.00000, 0.83922}, {0.00000, 0.00000, 0.87843}, {0.00000, 0.00000, 0.91765}, {0.00000, 0.00000, 0.95686}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.03137, 1.00000}, {0.00000, 0.06275, 1.00000}, {0.00000, 0.09412, 1.00000}, {0.00000, 0.12549, 1.00000}, {0.00000, 0.15686, 1.00000}, {0.00000, 0.18824, 1.00000}, {0.00000, 0.21961, 1.00000}, {0.00000, 0.25490, 1.00000}, {0.00000, 0.28627, 1.00000}, {0.00000, 0.31765, 1.00000}, {0.00000, 0.34902, 1.00000}, {0.00000, 0.38039, 1.00000}, {0.00000, 0.41176, 1.00000}, {0.00000, 0.44314, 1.00000}, {0.00000, 0.47843, 1.00000}, {0.00000, 0.49804, 1.00000}, {0.00000, 0.51765, 1.00000}, {0.00000, 0.53725, 1.00000}, {0.00000, 0.55686, 1.00000}, {0.00000, 0.58039, 1.00000}, {0.00000, 0.60000, 1.00000}, {0.00000, 0.61961, 1.00000}, {0.00000, 0.63922, 1.00000}, {0.00000, 0.65882, 1.00000}, {0.00000, 0.68235, 1.00000}, {0.00000, 0.70196, 1.00000}, {0.00000, 0.72157, 1.00000}, {0.00000, 0.74118, 1.00000}, {0.00000, 0.76078, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.79608, 1.00000}, {0.00000, 0.81176, 1.00000}, {0.00000, 0.82745, 1.00000}, {0.00000, 0.83922, 1.00000}, {0.00000, 0.85490, 1.00000}, {0.00000, 0.87059, 1.00000}, {0.00000, 0.88235, 1.00000}, {0.00000, 0.89804, 1.00000}, {0.00000, 0.91373, 1.00000}, {0.00000, 0.92549, 1.00000}, {0.00000, 0.94118, 1.00000}, {0.00000, 0.95686, 1.00000}, {0.00000, 0.96863, 1.00000}, {0.00000, 0.98431, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 0.98039}, {0.00000, 1.00000, 0.96078}, {0.00000, 1.00000, 0.94118}, {0.00000, 1.00000, 0.92157}, {0.00000, 1.00000, 0.90196}, {0.00000, 1.00000, 0.88235}, {0.00000, 1.00000, 0.86275}, {0.00000, 1.00000, 0.84314}, {0.00000, 1.00000, 0.82353}, {0.00000, 1.00000, 0.80392}, {0.00000, 1.00000, 0.78431}, {0.00000, 1.00000, 0.76471}, {0.00000, 1.00000, 0.74510}, {0.00000, 1.00000, 0.72549}, {0.00000, 1.00000, 0.70588}, {0.00000, 1.00000, 0.65882}, {0.00000, 1.00000, 0.61176}, {0.00000, 1.00000, 0.56471}, {0.00000, 1.00000, 0.51765}, {0.00000, 1.00000, 0.47059}, {0.00000, 1.00000, 0.42353}, {0.00000, 1.00000, 0.37647}, {0.00000, 1.00000, 0.32549}, {0.00000, 1.00000, 0.27843}, {0.00000, 1.00000, 0.23137}, {0.00000, 1.00000, 0.18431}, {0.00000, 1.00000, 0.13725}, {0.00000, 1.00000, 0.09020}, {0.00000, 1.00000, 0.04314}, {0.00000, 1.00000, 0.00000}, {0.04706, 1.00000, 0.00000}, {0.09412, 1.00000, 0.00000}, {0.14118, 1.00000, 0.00000}, {0.18824, 1.00000, 0.00000}, {0.23529, 1.00000, 0.00000}, {0.28235, 1.00000, 0.00000}, {0.32941, 1.00000, 0.00000}, {0.37647, 1.00000, 0.00000}, {0.42353, 1.00000, 0.00000}, {0.47059, 1.00000, 0.00000}, {0.51765, 1.00000, 0.00000}, {0.56471, 1.00000, 0.00000}, {0.61176, 1.00000, 0.00000}, {0.65882, 1.00000, 0.00000}, {0.70588, 1.00000, 0.00000}, {0.72549, 1.00000, 0.00000}, {0.74510, 1.00000, 0.00000}, {0.76471, 1.00000, 0.00000}, {0.78431, 1.00000, 0.00000}, {0.80392, 1.00000, 0.00000}, {0.82353, 1.00000, 0.00000}, {0.84314, 1.00000, 0.00000}, {0.86275, 1.00000, 0.00000}, {0.88235, 1.00000, 0.00000}, {0.90196, 1.00000, 0.00000}, {0.92157, 1.00000, 0.00000}, {0.94118, 1.00000, 0.00000}, {0.96078, 1.00000, 0.00000}, {0.98039, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.99608, 0.98039, 0.00000}, {0.99608, 0.96078, 0.00000}, {0.99608, 0.94510, 0.00000}, {0.99608, 0.92549, 0.00000}, {0.99608, 0.90588, 0.00000}, {0.99216, 0.89020, 0.00000}, {0.99216, 0.87059, 0.00000}, {0.99216, 0.85098, 0.00000}, {0.99216, 0.83529, 0.00000}, {0.99216, 0.81569, 0.00000}, {0.98824, 0.79608, 0.00000}, {0.98824, 0.78039, 0.00000}, {0.98824, 0.76078, 0.00000}, {0.98824, 0.74118, 0.00000}, {0.98824, 0.72549, 0.00000}, {0.98824, 0.70588, 0.00000}, {0.98824, 0.69020, 0.00000}, {0.98824, 0.67451, 0.00000}, {0.98824, 0.65490, 0.00000}, {0.99216, 0.63922, 0.00000}, {0.99216, 0.62353, 0.00000}, {0.99216, 0.60392, 0.00000}, {0.99216, 0.58824, 0.00000}, {0.99216, 0.57255, 0.00000}, {0.99608, 0.55294, 0.00000}, {0.99608, 0.53725, 0.00000}, {0.99608, 0.52157, 0.00000}, {0.99608, 0.50196, 0.00000}, {0.99608, 0.48627, 0.00000}, {1.00000, 0.47059, 0.00000}, {1.00000, 0.43922, 0.00000}, {1.00000, 0.40784, 0.00000}, {1.00000, 0.37647, 0.00000}, {1.00000, 0.34510, 0.00000}, {1.00000, 0.31373, 0.00000}, {1.00000, 0.28235, 0.00000}, {1.00000, 0.25098, 0.00000}, {1.00000, 0.21569, 0.00000}, {1.00000, 0.18431, 0.00000}, {1.00000, 0.15294, 0.00000}, {1.00000, 0.12157, 0.00000}, {1.00000, 0.09020, 0.00000}, {1.00000, 0.05882, 0.00000}, {1.00000, 0.02745, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.04706}, {1.00000, 0.00000, 0.09412}, {1.00000, 0.00000, 0.14118}, {1.00000, 0.00000, 0.18824}, {1.00000, 0.00000, 0.23529}, {1.00000, 0.00000, 0.28235}, {1.00000, 0.00000, 0.32941}, {1.00000, 0.00000, 0.37647}, {1.00000, 0.00000, 0.42353}, {1.00000, 0.00000, 0.47059}, {1.00000, 0.00000, 0.51765}, {1.00000, 0.00000, 0.56471}, {1.00000, 0.00000, 0.61176}, {1.00000, 0.00000, 0.65882}, {1.00000, 0.00000, 0.70588}, {1.00000, 0.00000, 0.72549}, {1.00000, 0.00000, 0.74902}, {1.00000, 0.00000, 0.77255}, {1.00000, 0.00000, 0.79608}, {1.00000, 0.00000, 0.81569}, {1.00000, 0.00000, 0.83922}, {1.00000, 0.00000, 0.86275}, {1.00000, 0.00000, 0.88627}, {1.00000, 0.00000, 0.90588}, {1.00000, 0.00000, 0.92941}, {1.00000, 0.00000, 0.95294}, {1.00000, 0.00000, 0.97647}, {1.00000, 0.00000, 1.00000}, {1.00000, 0.03529, 1.00000}, {1.00000, 0.07059, 1.00000}, {1.00000, 0.10588, 1.00000}, {1.00000, 0.14118, 1.00000}, {1.00000, 0.18039, 1.00000}, {1.00000, 0.21569, 1.00000}, {1.00000, 0.25098, 1.00000}, {1.00000, 0.28627, 1.00000}, {1.00000, 0.32549, 1.00000}, {1.00000, 0.36078, 1.00000}, {1.00000, 0.39608, 1.00000}, {1.00000, 0.43137, 1.00000}, {1.00000, 0.47059, 1.00000}, {1.00000, 0.48627, 1.00000}, {1.00000, 0.50588, 1.00000}, {1.00000, 0.52157, 1.00000}, {1.00000, 0.54118, 1.00000}, {1.00000, 0.56078, 1.00000}, {1.00000, 0.57647, 1.00000}, {1.00000, 0.59608, 1.00000}, {1.00000, 0.61176, 1.00000}, {1.00000, 0.63137, 1.00000}, {1.00000, 0.65098, 1.00000}, {1.00000, 0.66667, 1.00000}, {1.00000, 0.68627, 1.00000}, {1.00000, 0.70588, 1.00000}, {1.00000, 0.74510, 1.00000}, {1.00000, 0.78824, 1.00000}, {1.00000, 0.83137, 1.00000}, {1.00000, 0.87059, 1.00000}, {1.00000, 0.91373, 1.00000}, {1.00000, 0.95686, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("rainbow3.lasc", rainbow3_lasc); static RGBColor idl6_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.01176, 0.00000, 0.00000}, {0.02745, 0.00000, 0.00000}, {0.04314, 0.00000, 0.00000}, {0.05882, 0.00000, 0.00000}, {0.07451, 0.00000, 0.00000}, {0.08627, 0.00000, 0.00000}, {0.10196, 0.00000, 0.00000}, {0.11765, 0.00000, 0.00000}, {0.13333, 0.00000, 0.00000}, {0.14902, 0.00000, 0.00000}, {0.16078, 0.00000, 0.00000}, {0.17647, 0.00000, 0.00000}, {0.19216, 0.00000, 0.00000}, {0.20784, 0.00000, 0.00000}, {0.22353, 0.00000, 0.00000}, {0.23529, 0.00000, 0.00000}, {0.25098, 0.00000, 0.00000}, {0.26667, 0.00000, 0.00000}, {0.28235, 0.00000, 0.00000}, {0.29804, 0.00000, 0.00000}, {0.30980, 0.00000, 0.00000}, {0.32549, 0.00000, 0.00000}, {0.34118, 0.00000, 0.00000}, {0.35686, 0.00000, 0.00000}, {0.37255, 0.00000, 0.00000}, {0.38431, 0.00000, 0.00000}, {0.40000, 0.00000, 0.00000}, {0.41569, 0.00000, 0.00000}, {0.43137, 0.00000, 0.00000}, {0.44706, 0.00000, 0.00000}, {0.45882, 0.00000, 0.00000}, {0.47451, 0.00000, 0.00000}, {0.49020, 0.00000, 0.00000}, {0.50588, 0.00000, 0.00000}, {0.52157, 0.00000, 0.00000}, {0.53725, 0.00000, 0.00000}, {0.54902, 0.00000, 0.00000}, {0.56471, 0.00000, 0.00000}, {0.58039, 0.00000, 0.00000}, {0.59608, 0.00000, 0.00000}, {0.61176, 0.00000, 0.00000}, {0.62353, 0.00000, 0.00000}, {0.63922, 0.00000, 0.00000}, {0.65490, 0.00000, 0.00000}, {0.67059, 0.00000, 0.00000}, {0.68627, 0.00000, 0.00000}, {0.69804, 0.00000, 0.00000}, {0.71373, 0.00000, 0.00000}, {0.72941, 0.00000, 0.00000}, {0.74510, 0.00000, 0.00000}, {0.76078, 0.00000, 0.00000}, {0.77255, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.80392, 0.00000, 0.00000}, {0.81961, 0.00000, 0.00000}, {0.83529, 0.00000, 0.00000}, {0.84706, 0.00000, 0.00000}, {0.86275, 0.00000, 0.00000}, {0.87843, 0.00000, 0.00000}, {0.89412, 0.00000, 0.00000}, {0.90980, 0.00000, 0.00000}, {0.92157, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.95294, 0.00000, 0.00000}, {0.96863, 0.01176, 0.00000}, {0.98431, 0.02745, 0.00000}, {1.00000, 0.04314, 0.00000}, {0.98431, 0.05882, 0.00000}, {0.96863, 0.07451, 0.00000}, {0.95294, 0.09020, 0.00000}, {0.93725, 0.10588, 0.00000}, {0.92157, 0.12157, 0.00000}, {0.90196, 0.13725, 0.00000}, {0.88627, 0.15294, 0.00000}, {0.87059, 0.16863, 0.00000}, {0.85490, 0.18431, 0.00000}, {0.83922, 0.20000, 0.00000}, {0.82353, 0.21569, 0.00000}, {0.80392, 0.23137, 0.00000}, {0.78824, 0.24706, 0.00000}, {0.77255, 0.26275, 0.00000}, {0.75686, 0.27843, 0.00000}, {0.74118, 0.29412, 0.00000}, {0.72157, 0.30980, 0.00000}, {0.70588, 0.32549, 0.00000}, {0.69020, 0.34118, 0.00000}, {0.67451, 0.35686, 0.00000}, {0.65882, 0.37255, 0.00000}, {0.64314, 0.38824, 0.00000}, {0.62353, 0.40392, 0.00000}, {0.60784, 0.41961, 0.00000}, {0.59216, 0.43529, 0.00000}, {0.57647, 0.45098, 0.00000}, {0.56078, 0.46667, 0.00000}, {0.54118, 0.48235, 0.00000}, {0.52549, 0.49804, 0.00000}, {0.50980, 0.51373, 0.00000}, {0.49412, 0.52941, 0.00000}, {0.47843, 0.54510, 0.00000}, {0.46275, 0.56078, 0.00000}, {0.44314, 0.57647, 0.00000}, {0.42745, 0.59216, 0.00000}, {0.41176, 0.60784, 0.00000}, {0.39608, 0.62353, 0.00000}, {0.38039, 0.63922, 0.00000}, {0.36078, 0.65490, 0.00000}, {0.34510, 0.67059, 0.00000}, {0.32941, 0.68627, 0.00000}, {0.31373, 0.70196, 0.00000}, {0.29804, 0.71765, 0.00000}, {0.28235, 0.73333, 0.00000}, {0.26275, 0.74902, 0.00000}, {0.24706, 0.76471, 0.00000}, {0.23137, 0.78039, 0.00000}, {0.21569, 0.79608, 0.00000}, {0.20000, 0.81176, 0.00000}, {0.18039, 0.82745, 0.00000}, {0.16471, 0.84314, 0.00000}, {0.14902, 0.85882, 0.00000}, {0.13333, 0.87451, 0.00000}, {0.11765, 0.89020, 0.00000}, {0.10196, 0.90588, 0.00000}, {0.08235, 0.92157, 0.00000}, {0.06667, 0.93725, 0.00000}, {0.05098, 0.95294, 0.00000}, {0.03529, 0.96863, 0.00000}, {0.01961, 0.98431, 0.01176}, {0.00000, 1.00000, 0.02745}, {0.00000, 0.98431, 0.04314}, {0.00000, 0.96863, 0.05882}, {0.00000, 0.95294, 0.07451}, {0.00000, 0.93725, 0.09020}, {0.00000, 0.92157, 0.10588}, {0.00000, 0.90588, 0.11765}, {0.00000, 0.89020, 0.13333}, {0.00000, 0.87451, 0.14902}, {0.00000, 0.85882, 0.16471}, {0.00000, 0.84314, 0.18039}, {0.00000, 0.82745, 0.19608}, {0.00000, 0.81176, 0.21176}, {0.00000, 0.79608, 0.22353}, {0.00000, 0.78039, 0.23922}, {0.00000, 0.76471, 0.25490}, {0.00000, 0.74902, 0.27059}, {0.00000, 0.73333, 0.28627}, {0.00000, 0.71765, 0.30196}, {0.00000, 0.70196, 0.31765}, {0.00000, 0.68627, 0.33333}, {0.00000, 0.66667, 0.34510}, {0.00000, 0.65098, 0.36078}, {0.00000, 0.63529, 0.37647}, {0.00000, 0.61961, 0.39216}, {0.00000, 0.60392, 0.40784}, {0.00000, 0.58824, 0.42353}, {0.00000, 0.57255, 0.43922}, {0.00000, 0.55686, 0.45098}, {0.00000, 0.54118, 0.46667}, {0.00000, 0.52549, 0.48235}, {0.00000, 0.50980, 0.49804}, {0.00000, 0.49412, 0.51373}, {0.00000, 0.47843, 0.52941}, {0.00000, 0.46275, 0.54510}, {0.00000, 0.44706, 0.55686}, {0.00000, 0.43137, 0.57255}, {0.00000, 0.41569, 0.58824}, {0.00000, 0.40000, 0.60392}, {0.00000, 0.38431, 0.61961}, {0.00000, 0.36863, 0.63529}, {0.00000, 0.35294, 0.65098}, {0.00000, 0.33333, 0.66667}, {0.00000, 0.31765, 0.67843}, {0.00000, 0.30196, 0.69412}, {0.00000, 0.28627, 0.70980}, {0.00000, 0.27059, 0.72549}, {0.00000, 0.25490, 0.74118}, {0.00000, 0.23922, 0.75686}, {0.00000, 0.22353, 0.77255}, {0.00000, 0.20784, 0.78431}, {0.00000, 0.19216, 0.80000}, {0.00000, 0.17647, 0.81569}, {0.00000, 0.16078, 0.83137}, {0.00000, 0.14510, 0.84706}, {0.00000, 0.12941, 0.86275}, {0.00000, 0.11373, 0.87843}, {0.00000, 0.09804, 0.89020}, {0.00000, 0.08235, 0.90588}, {0.00000, 0.06667, 0.92157}, {0.00000, 0.05098, 0.93725}, {0.00000, 0.03529, 0.95294}, {0.00000, 0.01961, 0.96863}, {0.00000, 0.00000, 0.98431}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 0.98431}, {0.00000, 0.00000, 0.96863}, {0.00000, 0.00000, 0.95294}, {0.00000, 0.00000, 0.93725}, {0.00000, 0.00000, 0.92157}, {0.00000, 0.00000, 0.90588}, {0.00000, 0.00000, 0.89020}, {0.00000, 0.00000, 0.87451}, {0.00000, 0.00000, 0.85882}, {0.00000, 0.00000, 0.84314}, {0.00000, 0.00000, 0.82745}, {0.00000, 0.00000, 0.81176}, {0.00000, 0.00000, 0.79608}, {0.00000, 0.00000, 0.78039}, {0.00000, 0.00000, 0.76471}, {0.00000, 0.00000, 0.74902}, {0.00000, 0.00000, 0.73333}, {0.00000, 0.00000, 0.71765}, {0.00000, 0.00000, 0.70196}, {0.00000, 0.00000, 0.68627}, {0.00000, 0.00000, 0.66667}, {0.00000, 0.00000, 0.65098}, {0.00000, 0.00000, 0.63529}, {0.00000, 0.00000, 0.61961}, {0.00000, 0.00000, 0.60392}, {0.00000, 0.00000, 0.58824}, {0.00000, 0.00000, 0.57255}, {0.00000, 0.00000, 0.55686}, {0.00000, 0.00000, 0.54118}, {0.00000, 0.00000, 0.52549}, {0.00000, 0.00000, 0.50980}, {0.00000, 0.00000, 0.49412}, {0.00000, 0.00000, 0.47843}, {0.00000, 0.00000, 0.46275}, {0.00000, 0.00000, 0.44706}, {0.00000, 0.00000, 0.43137}, {0.00000, 0.00000, 0.41569}, {0.00000, 0.00000, 0.40000}, {0.00000, 0.00000, 0.38431}, {0.00000, 0.00000, 0.36863}, {0.00000, 0.00000, 0.35294}, {0.00000, 0.00000, 0.33333}, {0.00000, 0.00000, 0.31765}, {0.00000, 0.00000, 0.30196}, {0.00000, 0.00000, 0.28627}, {0.00000, 0.00000, 0.27059}, {0.00000, 0.00000, 0.25490}, {0.00000, 0.00000, 0.23922}, {0.00000, 0.00000, 0.22353}, {0.00000, 0.00000, 0.20784}, {0.00000, 0.00000, 0.19216}, {0.00000, 0.00000, 0.17647}, {0.00000, 0.00000, 0.16078}, {0.00000, 0.00000, 0.14510}, {0.00000, 0.00000, 0.12941}, {0.00000, 0.00000, 0.11373}, {0.00000, 0.00000, 0.09804}, {0.00000, 0.00000, 0.08235}, {0.00000, 0.00000, 0.06667}, {0.00000, 0.00000, 0.05098}, {0.00000, 0.00000, 0.03529}, {0.00000, 0.00000, 0.01961}, {0.00000, 0.00000, 0.00000}, }; new ColorMapInfo("idl6.lasc", idl6_lasc); static RGBColor blulut_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.00392}, {0.00000, 0.00000, 0.00784}, {0.00000, 0.00000, 0.01176}, {0.00000, 0.00000, 0.01569}, {0.00000, 0.00000, 0.01961}, {0.00000, 0.00000, 0.02353}, {0.00000, 0.00000, 0.02745}, {0.00000, 0.00000, 0.03137}, {0.00000, 0.00000, 0.03529}, {0.00000, 0.00000, 0.03922}, {0.00000, 0.00000, 0.04314}, {0.00000, 0.00000, 0.04706}, {0.00001, 0.00001, 0.05098}, {0.00001, 0.00001, 0.05490}, {0.00001, 0.00001, 0.05882}, {0.00002, 0.00002, 0.06275}, {0.00002, 0.00002, 0.06667}, {0.00002, 0.00002, 0.07059}, {0.00003, 0.00003, 0.07451}, {0.00004, 0.00004, 0.07843}, {0.00005, 0.00005, 0.08235}, {0.00006, 0.00006, 0.08627}, {0.00007, 0.00007, 0.09020}, {0.00008, 0.00008, 0.09412}, {0.00009, 0.00009, 0.09804}, {0.00011, 0.00011, 0.10196}, {0.00013, 0.00013, 0.10588}, {0.00015, 0.00015, 0.10980}, {0.00017, 0.00017, 0.11373}, {0.00019, 0.00019, 0.11765}, {0.00022, 0.00022, 0.12157}, {0.00025, 0.00025, 0.12549}, {0.00028, 0.00028, 0.12941}, {0.00032, 0.00032, 0.13333}, {0.00035, 0.00035, 0.13725}, {0.00040, 0.00040, 0.14118}, {0.00044, 0.00044, 0.14510}, {0.00049, 0.00049, 0.14902}, {0.00055, 0.00055, 0.15294}, {0.00061, 0.00061, 0.15686}, {0.00067, 0.00067, 0.16078}, {0.00074, 0.00074, 0.16471}, {0.00081, 0.00081, 0.16863}, {0.00089, 0.00089, 0.17255}, {0.00097, 0.00097, 0.17647}, {0.00106, 0.00106, 0.18039}, {0.00115, 0.00115, 0.18431}, {0.00126, 0.00126, 0.18824}, {0.00136, 0.00136, 0.19216}, {0.00148, 0.00148, 0.19608}, {0.00160, 0.00160, 0.20000}, {0.00173, 0.00173, 0.20392}, {0.00187, 0.00187, 0.20784}, {0.00201, 0.00201, 0.21176}, {0.00216, 0.00216, 0.21569}, {0.00233, 0.00233, 0.21961}, {0.00250, 0.00250, 0.22353}, {0.00268, 0.00268, 0.22745}, {0.00287, 0.00287, 0.23137}, {0.00307, 0.00307, 0.23529}, {0.00327, 0.00327, 0.23922}, {0.00349, 0.00349, 0.24314}, {0.00373, 0.00373, 0.24706}, {0.00397, 0.00397, 0.25098}, {0.00422, 0.00422, 0.25490}, {0.00449, 0.00449, 0.25882}, {0.00477, 0.00477, 0.26275}, {0.00506, 0.00506, 0.26667}, {0.00536, 0.00536, 0.27059}, {0.00568, 0.00568, 0.27451}, {0.00601, 0.00601, 0.27843}, {0.00636, 0.00636, 0.28235}, {0.00672, 0.00672, 0.28627}, {0.00709, 0.00709, 0.29020}, {0.00748, 0.00748, 0.29412}, {0.00789, 0.00789, 0.29804}, {0.00831, 0.00831, 0.30196}, {0.00875, 0.00875, 0.30588}, {0.00921, 0.00921, 0.30980}, {0.00969, 0.00969, 0.31373}, {0.01018, 0.01018, 0.31765}, {0.01069, 0.01069, 0.32157}, {0.01122, 0.01122, 0.32549}, {0.01177, 0.01177, 0.32941}, {0.01235, 0.01235, 0.33333}, {0.01294, 0.01294, 0.33725}, {0.01355, 0.01355, 0.34118}, {0.01418, 0.01418, 0.34510}, {0.01484, 0.01484, 0.34902}, {0.01552, 0.01552, 0.35294}, {0.01622, 0.01622, 0.35686}, {0.01694, 0.01694, 0.36078}, {0.01769, 0.01769, 0.36471}, {0.01847, 0.01847, 0.36863}, {0.01926, 0.01926, 0.37255}, {0.02009, 0.02009, 0.37647}, {0.02094, 0.02094, 0.38039}, {0.02181, 0.02181, 0.38431}, {0.02272, 0.02272, 0.38824}, {0.02365, 0.02365, 0.39216}, {0.02461, 0.02461, 0.39608}, {0.02560, 0.02560, 0.40000}, {0.02662, 0.02662, 0.40392}, {0.02767, 0.02767, 0.40784}, {0.02875, 0.02875, 0.41176}, {0.02986, 0.02986, 0.41569}, {0.03100, 0.03100, 0.41961}, {0.03218, 0.03218, 0.42353}, {0.03338, 0.03338, 0.42745}, {0.03463, 0.03463, 0.43137}, {0.03590, 0.03590, 0.43529}, {0.03721, 0.03721, 0.43922}, {0.03856, 0.03856, 0.44314}, {0.03994, 0.03994, 0.44706}, {0.04136, 0.04136, 0.45098}, {0.04282, 0.04282, 0.45490}, {0.04432, 0.04432, 0.45882}, {0.04585, 0.04585, 0.46275}, {0.04743, 0.04743, 0.46667}, {0.04904, 0.04904, 0.47059}, {0.05070, 0.05070, 0.47451}, {0.05239, 0.05239, 0.47843}, {0.05413, 0.05413, 0.48235}, {0.05591, 0.05591, 0.48627}, {0.05774, 0.05774, 0.49020}, {0.05961, 0.05961, 0.49412}, {0.06153, 0.06153, 0.49804}, {0.06349, 0.06349, 0.50196}, {0.06549, 0.06549, 0.50588}, {0.06755, 0.06755, 0.50980}, {0.06965, 0.06965, 0.51373}, {0.07180, 0.07180, 0.51765}, {0.07400, 0.07400, 0.52157}, {0.07625, 0.07625, 0.52549}, {0.07856, 0.07856, 0.52941}, {0.08091, 0.08091, 0.53333}, {0.08331, 0.08331, 0.53725}, {0.08577, 0.08577, 0.54118}, {0.08829, 0.08829, 0.54510}, {0.09086, 0.09086, 0.54902}, {0.09348, 0.09348, 0.55294}, {0.09616, 0.09616, 0.55686}, {0.09890, 0.09890, 0.56078}, {0.10169, 0.10169, 0.56471}, {0.10455, 0.10455, 0.56863}, {0.10746, 0.10746, 0.57255}, {0.11044, 0.11044, 0.57647}, {0.11347, 0.11347, 0.58039}, {0.11657, 0.11657, 0.58431}, {0.11973, 0.11973, 0.58824}, {0.12296, 0.12296, 0.59216}, {0.12624, 0.12624, 0.59608}, {0.12960, 0.12960, 0.60000}, {0.13302, 0.13302, 0.60392}, {0.13651, 0.13651, 0.60784}, {0.14007, 0.14007, 0.61176}, {0.14369, 0.14369, 0.61569}, {0.14739, 0.14739, 0.61961}, {0.15116, 0.15116, 0.62353}, {0.15500, 0.15500, 0.62745}, {0.15891, 0.15891, 0.63137}, {0.16289, 0.16289, 0.63529}, {0.16695, 0.16695, 0.63922}, {0.17109, 0.17109, 0.64314}, {0.17530, 0.17530, 0.64706}, {0.17959, 0.17959, 0.65098}, {0.18395, 0.18395, 0.65490}, {0.18840, 0.18840, 0.65882}, {0.19292, 0.19292, 0.66275}, {0.19753, 0.19753, 0.66667}, {0.20222, 0.20222, 0.67059}, {0.20699, 0.20699, 0.67451}, {0.21185, 0.21185, 0.67843}, {0.21679, 0.21679, 0.68235}, {0.22182, 0.22182, 0.68627}, {0.22693, 0.22693, 0.69020}, {0.23213, 0.23213, 0.69412}, {0.23742, 0.23742, 0.69804}, {0.24280, 0.24280, 0.70196}, {0.24827, 0.24827, 0.70588}, {0.25384, 0.25384, 0.70980}, {0.25949, 0.25949, 0.71373}, {0.26524, 0.26524, 0.71765}, {0.27109, 0.27109, 0.72157}, {0.27703, 0.27703, 0.72549}, {0.28307, 0.28307, 0.72941}, {0.28920, 0.28920, 0.73333}, {0.29544, 0.29544, 0.73725}, {0.30178, 0.30178, 0.74118}, {0.30821, 0.30821, 0.74510}, {0.31476, 0.31476, 0.74902}, {0.32140, 0.32140, 0.75294}, {0.32815, 0.32815, 0.75686}, {0.33500, 0.33500, 0.76078}, {0.34196, 0.34196, 0.76471}, {0.34903, 0.34903, 0.76863}, {0.35621, 0.35621, 0.77255}, {0.36350, 0.36350, 0.77647}, {0.37090, 0.37090, 0.78039}, {0.37841, 0.37841, 0.78431}, {0.38603, 0.38603, 0.78824}, {0.39377, 0.39377, 0.79216}, {0.40163, 0.40163, 0.79608}, {0.40960, 0.40960, 0.80000}, {0.41769, 0.41769, 0.80392}, {0.42590, 0.42590, 0.80784}, {0.43423, 0.43423, 0.81176}, {0.44268, 0.44268, 0.81569}, {0.45126, 0.45126, 0.81961}, {0.45996, 0.45996, 0.82353}, {0.46878, 0.46878, 0.82745}, {0.47773, 0.47773, 0.83137}, {0.48681, 0.48681, 0.83529}, {0.49601, 0.49601, 0.83922}, {0.50535, 0.50535, 0.84314}, {0.51482, 0.51482, 0.84706}, {0.52442, 0.52442, 0.85098}, {0.53415, 0.53415, 0.85490}, {0.54402, 0.54402, 0.85882}, {0.55403, 0.55403, 0.86275}, {0.56417, 0.56417, 0.86667}, {0.57445, 0.57445, 0.87059}, {0.58487, 0.58487, 0.87451}, {0.59543, 0.59543, 0.87843}, {0.60613, 0.60613, 0.88235}, {0.61698, 0.61698, 0.88627}, {0.62798, 0.62798, 0.89020}, {0.63911, 0.63911, 0.89412}, {0.65040, 0.65040, 0.89804}, {0.66184, 0.66184, 0.90196}, {0.67342, 0.67342, 0.90588}, {0.68516, 0.68516, 0.90980}, {0.69705, 0.69705, 0.91373}, {0.70909, 0.70909, 0.91765}, {0.72129, 0.72129, 0.92157}, {0.73365, 0.73365, 0.92549}, {0.74616, 0.74616, 0.92941}, {0.75883, 0.75883, 0.93333}, {0.77167, 0.77167, 0.93725}, {0.78466, 0.78466, 0.94118}, {0.79782, 0.79782, 0.94510}, {0.81115, 0.81115, 0.94902}, {0.82464, 0.82464, 0.95294}, {0.83830, 0.83830, 0.95686}, {0.85213, 0.85213, 0.96078}, {0.86612, 0.86612, 0.96471}, {0.88029, 0.88029, 0.96863}, {0.89464, 0.89464, 0.97255}, {0.90915, 0.90915, 0.97647}, {0.92385, 0.92385, 0.98039}, {0.93872, 0.93872, 0.98431}, {0.95377, 0.95377, 0.98824}, {0.96899, 0.96899, 0.99216}, {0.98441, 0.98441, 0.99608}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("blulut.lasc", blulut_lasc); static RGBColor smooth3_lasc[] = { {0.00000, 0.00000, 0.00784}, {0.00000, 0.00000, 0.01795}, {0.00000, 0.00000, 0.03087}, {0.00000, 0.00000, 0.04434}, {0.00000, 0.00000, 0.05781}, {0.00000, 0.00000, 0.07128}, {0.00000, 0.00000, 0.08475}, {0.00000, 0.00000, 0.09822}, {0.00000, 0.00000, 0.11170}, {0.00000, 0.00000, 0.12231}, {0.00000, 0.00000, 0.13472}, {0.00000, 0.00000, 0.14819}, {0.00000, 0.00000, 0.16166}, {0.00000, 0.00000, 0.17513}, {0.00000, 0.00000, 0.18851}, {0.00000, 0.00000, 0.19862}, {0.00000, 0.00000, 0.21163}, {0.00000, 0.00000, 0.22510}, {0.00000, 0.00000, 0.23857}, {0.00000, 0.00000, 0.25080}, {0.00000, 0.00000, 0.26228}, {0.00000, 0.00000, 0.27885}, {0.00000, 0.00000, 0.28895}, {0.00000, 0.00000, 0.30201}, {0.00000, 0.00000, 0.31308}, {0.00000, 0.00000, 0.32503}, {0.00000, 0.00000, 0.33850}, {0.00000, 0.00000, 0.35197}, {0.00000, 0.00000, 0.36526}, {0.00000, 0.00000, 0.37536}, {0.00000, 0.00000, 0.39146}, {0.00000, 0.00000, 0.40341}, {0.00000, 0.00000, 0.41541}, {0.00000, 0.00000, 0.42754}, {0.00000, 0.00000, 0.43922}, {0.00000, 0.00000, 0.45559}, {0.00000, 0.00000, 0.46570}, {0.00000, 0.00000, 0.47885}, {0.00000, 0.00000, 0.49232}, {0.00000, 0.00000, 0.50579}, {0.00000, 0.00000, 0.51788}, {0.00000, 0.00000, 0.52881}, {0.00000, 0.00000, 0.54228}, {0.00000, 0.00000, 0.55576}, {0.00000, 0.00000, 0.56923}, {0.00000, 0.00000, 0.58016}, {0.00397, 0.00000, 0.59225}, {0.01356, 0.00000, 0.60572}, {0.02791, 0.00000, 0.61919}, {0.04507, 0.00000, 0.63234}, {0.06528, 0.00000, 0.64245}, {0.08235, 0.00000, 0.65569}, {0.10178, 0.00000, 0.66916}, {0.12198, 0.00000, 0.68263}, {0.14219, 0.00000, 0.69462}, {0.16240, 0.00000, 0.70565}, {0.18261, 0.00000, 0.71912}, {0.20281, 0.00000, 0.73259}, {0.21984, 0.00000, 0.74607}, {0.23668, 0.00000, 0.75954}, {0.25559, 0.00000, 0.77093}, {0.27580, 0.00000, 0.78256}, {0.29504, 0.00000, 0.79603}, {0.31063, 0.00000, 0.80909}, {0.31737, 0.00000, 0.81919}, {0.31765, 0.00000, 0.83575}, {0.31765, 0.00000, 0.84992}, {0.31765, 0.00000, 0.86339}, {0.31765, 0.00000, 0.87686}, {0.31765, 0.00000, 0.88932}, {0.31719, 0.00000, 0.89942}, {0.31382, 0.00000, 0.90953}, {0.31373, 0.00000, 0.92291}, {0.31373, 0.00000, 0.93638}, {0.31373, 0.00000, 0.94985}, {0.31373, 0.00000, 0.96332}, {0.31373, 0.00000, 0.97573}, {0.40250, 0.05175, 0.86307}, {0.99189, 0.39528, 0.05813}, {1.00000, 0.40000, 0.04706}, {0.84776, 0.30312, 0.04983}, {0.55402, 0.11438, 0.05319}, {0.38644, 0.00000, 0.05988}, {0.40664, 0.00000, 0.07442}, {0.42685, 0.00000, 0.09799}, {0.44706, 0.00000, 0.12157}, {0.46727, 0.00000, 0.13841}, {0.48466, 0.00000, 0.15806}, {0.50376, 0.00000, 0.17827}, {0.52397, 0.00000, 0.20018}, {0.54417, 0.00000, 0.22261}, {0.56438, 0.00000, 0.24281}, {0.58459, 0.00000, 0.26302}, {0.60480, 0.00000, 0.28323}, {0.62501, 0.00000, 0.30344}, {0.64521, 0.00000, 0.32364}, {0.66542, 0.00000, 0.34385}, {0.68563, 0.00000, 0.36406}, {0.70584, 0.00000, 0.38491}, {0.72604, 0.00000, 0.40840}, {0.74625, 0.00000, 0.42860}, {0.76937, 0.00000, 0.44881}, {0.79059, 0.00000, 0.46667}, {0.81260, 0.00000, 0.48711}, {0.83493, 0.00000, 0.50944}, {0.85513, 0.00000, 0.52964}, {0.87576, 0.00000, 0.54985}, {0.90607, 0.00000, 0.57006}, {0.93933, 0.00000, 0.59027}, {0.96821, 0.00000, 0.61047}, {0.98777, 0.00000, 0.63068}, {0.99737, 0.00000, 0.65089}, {1.00000, 0.00000, 0.67110}, {1.00000, 0.00092, 0.69149}, {1.00000, 0.01776, 0.71506}, {1.00000, 0.03760, 0.73564}, {1.00000, 0.05781, 0.75585}, {1.00000, 0.07802, 0.77606}, {1.00000, 0.09822, 0.79626}, {1.00000, 0.11922, 0.81647}, {1.00000, 0.14279, 0.83668}, {1.00000, 0.16637, 0.85689}, {1.00000, 0.18690, 0.88014}, {1.00000, 0.20960, 0.90122}, {1.00000, 0.23124, 0.92143}, {1.00000, 0.25144, 0.94164}, {1.00000, 0.27165, 0.96185}, {1.00000, 0.29214, 0.98178}, {1.00000, 0.31571, 0.99862}, {1.00000, 0.33310, 0.98454}, {1.00000, 0.35248, 0.96517}, {1.00000, 0.37269, 0.94496}, {1.00000, 0.39290, 0.92332}, {1.00000, 0.41223, 0.89974}, {1.00000, 0.42907, 0.87649}, {1.00000, 0.44591, 0.85628}, {1.00000, 0.46588, 0.83294}, {1.00000, 0.48609, 0.81195}, {1.00000, 0.50630, 0.79174}, {1.00000, 0.52503, 0.77006}, {1.00000, 0.54279, 0.74740}, {1.00000, 0.56263, 0.72720}, {1.00000, 0.57947, 0.70699}, {1.00000, 0.59949, 0.68360}, {1.00000, 0.61707, 0.66265}, {1.00000, 0.62976, 0.64037}, {1.00000, 0.63682, 0.61831}, {1.00000, 0.63922, 0.59811}, {1.00000, 0.63922, 0.57790}, {1.00000, 0.63922, 0.55769}, {1.00000, 0.63922, 0.53425}, {1.00000, 0.63922, 0.51335}, {1.00000, 0.63922, 0.49102}, {1.00000, 0.63922, 0.46902}, {1.00000, 0.63922, 0.44881}, {1.00000, 0.63922, 0.42860}, {1.00000, 0.63922, 0.40839}, {1.00000, 0.63922, 0.38491}, {1.00000, 0.63922, 0.36406}, {1.00000, 0.63922, 0.34168}, {0.99838, 0.63922, 0.31972}, {0.99077, 0.63922, 0.29845}, {0.97241, 0.63922, 0.27589}, {0.94546, 0.63922, 0.25905}, {0.91520, 0.63922, 0.23557}, {0.88489, 0.63922, 0.21476}, {0.85457, 0.63922, 0.19234}, {0.82426, 0.63922, 0.16876}, {0.79395, 0.63922, 0.14629}, {0.76309, 0.63922, 0.12664}, {0.72941, 0.63922, 0.10980}, {0.70583, 0.63922, 0.08622}, {0.69070, 0.63922, 0.06265}, {0.67949, 0.63922, 0.04133}, {0.67793, 0.64092, 0.02113}, {0.68582, 0.64545, 0.00554}, {0.69772, 0.65278, 0.00000}, {0.71793, 0.66307, 0.00000}, {0.73814, 0.68665, 0.00000}, {0.75834, 0.71022, 0.00000}, {0.77855, 0.73380, 0.00000}, {0.79876, 0.75738, 0.00000}, {0.81897, 0.78095, 0.00000}, {0.83982, 0.80517, 0.00000}, {0.86330, 0.83202, 0.00000}, {0.88351, 0.85560, 0.00000}, {0.90372, 0.88208, 0.00000}, {0.92393, 0.90667, 0.00000}, {0.94413, 0.93025, 0.00000}, {0.96434, 0.95382, 0.00000}, {0.98386, 0.97740, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00305}, {1.00000, 1.00000, 0.01638}, {1.00000, 1.00000, 0.03322}, {1.00000, 1.00000, 0.05006}, {1.00000, 1.00000, 0.06773}, {1.00000, 1.00000, 0.08794}, {1.00000, 1.00000, 0.10815}, {1.00000, 1.00000, 0.12526}, {1.00000, 1.00000, 0.14464}, {1.00000, 1.00000, 0.16485}, {1.00000, 1.00000, 0.18506}, {1.00000, 1.00000, 0.20439}, {1.00000, 1.00000, 0.22155}, {1.00000, 1.00000, 0.24176}, {1.00000, 1.00000, 0.25883}, {1.00000, 1.00000, 0.27567}, {1.00000, 1.00000, 0.28642}, {1.00000, 1.00000, 0.28872}, {1.00000, 1.00000, 0.28350}, {1.00000, 1.00000, 0.27229}, {1.00000, 1.00000, 0.25208}, {1.00000, 1.00000, 0.22869}, {1.00000, 1.00000, 0.20511}, {1.00000, 1.00000, 0.18154}, {1.00000, 1.00000, 0.15796}, {1.00000, 1.00000, 0.13536}, {1.00000, 1.00000, 0.11473}, {1.00000, 1.00000, 0.09116}, {1.00000, 1.00000, 0.06435}, {1.00000, 1.00000, 0.04008}, {1.00000, 1.00000, 0.02076}, {1.00000, 1.00000, 0.00706}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.09305}, {1.00000, 1.00000, 0.33136}, {1.00000, 1.00000, 0.60966}, {1.00000, 1.00000, 0.83605}, {0.96674, 1.00000, 0.96343}, {0.75749, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, }; new ColorMapInfo("smooth3.lasc", smooth3_lasc); static RGBColor idl2_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.14118, 0.00000}, {0.00000, 0.28235, 0.00000}, {0.00000, 0.29412, 0.00000}, {0.00000, 0.30980, 0.00000}, {0.00000, 0.32157, 0.00000}, {0.00000, 0.33725, 0.00000}, {0.00000, 0.35294, 0.00000}, {0.00000, 0.36471, 0.00000}, {0.00000, 0.38039, 0.00000}, {0.00000, 0.39216, 0.00000}, {0.00000, 0.40784, 0.00000}, {0.00000, 0.42353, 0.00000}, {0.00000, 0.45882, 0.00000}, {0.00000, 0.49412, 0.00000}, {0.00000, 0.52941, 0.00000}, {0.00000, 0.56471, 0.00000}, {0.00000, 0.60000, 0.00000}, {0.00000, 0.63529, 0.00000}, {0.00000, 0.67059, 0.00000}, {0.00000, 0.70588, 0.00000}, {0.00000, 0.74118, 0.00000}, {0.00000, 0.77647, 0.00000}, {0.00000, 0.81176, 0.00000}, {0.00000, 0.84706, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.91765, 0.00000}, {0.00000, 0.95294, 0.00000}, {0.00000, 0.98824, 0.00000}, {0.02353, 0.97647, 0.00000}, {0.04706, 0.96471, 0.00000}, {0.07059, 0.95294, 0.00000}, {0.09412, 0.94118, 0.00000}, {0.11765, 0.91765, 0.00000}, {0.14118, 0.89412, 0.00000}, {0.16471, 0.87059, 0.00000}, {0.18824, 0.84706, 0.00000}, {0.21176, 0.82353, 0.00000}, {0.23529, 0.80000, 0.00000}, {0.25882, 0.77647, 0.00000}, {0.28235, 0.75294, 0.00000}, {0.30588, 0.72941, 0.00000}, {0.32941, 0.70588, 0.00000}, {0.35294, 0.68235, 0.00000}, {0.37647, 0.65882, 0.00000}, {0.40000, 0.63529, 0.00000}, {0.42353, 0.61176, 0.00000}, {0.44706, 0.58824, 0.00000}, {0.47059, 0.56471, 0.00000}, {0.49412, 0.54118, 0.00000}, {0.51765, 0.51765, 0.00000}, {0.54118, 0.49412, 0.00000}, {0.56471, 0.47059, 0.00000}, {0.58824, 0.44706, 0.00000}, {0.61176, 0.42353, 0.00000}, {0.63529, 0.40000, 0.00000}, {0.65882, 0.37647, 0.00000}, {0.68235, 0.35294, 0.00000}, {0.70588, 0.32941, 0.00000}, {0.72941, 0.30588, 0.00000}, {0.75294, 0.28235, 0.00000}, {0.77647, 0.25882, 0.00000}, {0.80000, 0.23529, 0.00000}, {0.82353, 0.21176, 0.00000}, {0.84706, 0.18824, 0.00000}, {0.87059, 0.16471, 0.00000}, {0.89412, 0.14118, 0.00000}, {0.91765, 0.11765, 0.00000}, {0.94118, 0.09412, 0.00000}, {0.95294, 0.07059, 0.00000}, {0.96471, 0.04706, 0.00000}, {0.97647, 0.02353, 0.00000}, {0.98824, 0.00000, 0.00000}, {0.98824, 0.00000, 0.00000}, {0.98824, 0.00000, 0.00000}, {0.98824, 0.00000, 0.00000}, {0.98824, 0.00000, 0.00392}, {0.98431, 0.00000, 0.01176}, {0.98039, 0.00000, 0.01961}, {0.97647, 0.00000, 0.02745}, {0.97255, 0.00000, 0.03529}, {0.97255, 0.00000, 0.03922}, {0.97255, 0.00000, 0.04706}, {0.97255, 0.00000, 0.05490}, {0.97255, 0.00000, 0.06275}, {0.96863, 0.00000, 0.07059}, {0.96471, 0.00000, 0.07843}, {0.96078, 0.00000, 0.08627}, {0.95686, 0.00000, 0.09804}, {0.95294, 0.00000, 0.10588}, {0.94902, 0.00000, 0.11373}, {0.94510, 0.00000, 0.12157}, {0.94118, 0.00000, 0.13333}, {0.94118, 0.00000, 0.13725}, {0.93725, 0.00000, 0.14510}, {0.93333, 0.00000, 0.15294}, {0.92941, 0.00000, 0.16078}, {0.92549, 0.00000, 0.16863}, {0.92549, 0.00000, 0.17647}, {0.92549, 0.00000, 0.18431}, {0.92549, 0.00000, 0.19608}, {0.92157, 0.00000, 0.20392}, {0.91765, 0.00000, 0.21176}, {0.91373, 0.00000, 0.21961}, {0.90980, 0.00000, 0.23137}, {0.90588, 0.00000, 0.23922}, {0.90196, 0.00000, 0.24706}, {0.89804, 0.00000, 0.25490}, {0.89412, 0.00000, 0.26275}, {0.89412, 0.00000, 0.26667}, {0.89412, 0.00000, 0.27451}, {0.89412, 0.00000, 0.28235}, {0.89412, 0.00000, 0.29020}, {0.89020, 0.00000, 0.29804}, {0.88627, 0.00000, 0.30588}, {0.88235, 0.00000, 0.31373}, {0.87843, 0.00000, 0.32549}, {0.87451, 0.00000, 0.33333}, {0.87059, 0.00000, 0.34118}, {0.86667, 0.00000, 0.34902}, {0.86275, 0.00392, 0.36078}, {0.85882, 0.00392, 0.36863}, {0.85490, 0.00392, 0.37647}, {0.85098, 0.00392, 0.38431}, {0.84706, 0.00000, 0.39608}, {0.84706, 0.00000, 0.40000}, {0.84706, 0.00000, 0.40784}, {0.84706, 0.00000, 0.41569}, {0.84706, 0.00000, 0.42353}, {0.84314, 0.00000, 0.43137}, {0.83922, 0.00000, 0.43922}, {0.83529, 0.00000, 0.44706}, {0.83137, 0.00000, 0.45490}, {0.82745, 0.00000, 0.46275}, {0.82353, 0.00000, 0.47059}, {0.81961, 0.00000, 0.47843}, {0.81569, 0.00000, 0.49020}, {0.81176, 0.00000, 0.49804}, {0.80784, 0.00000, 0.50588}, {0.80392, 0.00000, 0.51373}, {0.80000, 0.00000, 0.52549}, {0.80000, 0.00000, 0.52941}, {0.80000, 0.00000, 0.53725}, {0.80000, 0.00000, 0.54510}, {0.80000, 0.00000, 0.55294}, {0.79608, 0.00000, 0.56078}, {0.79216, 0.00000, 0.56863}, {0.78824, 0.00000, 0.57647}, {0.78431, 0.00000, 0.58824}, {0.78039, 0.00000, 0.59608}, {0.77647, 0.00000, 0.60392}, {0.77255, 0.00000, 0.61176}, {0.76863, 0.00000, 0.62353}, {0.76863, 0.00000, 0.62745}, {0.76863, 0.00000, 0.63529}, {0.76863, 0.00000, 0.63922}, {0.76863, 0.00000, 0.64706}, {0.76471, 0.00000, 0.65490}, {0.76078, 0.00000, 0.66275}, {0.75686, 0.00000, 0.67059}, {0.75294, 0.00000, 0.68235}, {0.74902, 0.00000, 0.69020}, {0.74510, 0.00000, 0.69804}, {0.74118, 0.00000, 0.70588}, {0.73725, 0.00000, 0.71765}, {0.73333, 0.00000, 0.72549}, {0.72941, 0.00000, 0.73333}, {0.72549, 0.00000, 0.74118}, {0.72157, 0.00000, 0.75294}, {0.72157, 0.00000, 0.75686}, {0.72157, 0.00000, 0.76471}, {0.72157, 0.00000, 0.77255}, {0.72157, 0.00000, 0.78039}, {0.71765, 0.00000, 0.78824}, {0.71373, 0.00000, 0.79608}, {0.70980, 0.00000, 0.80392}, {0.70588, 0.00000, 0.81569}, {0.70196, 0.00000, 0.82353}, {0.69804, 0.00000, 0.83137}, {0.69412, 0.00000, 0.83922}, {0.69020, 0.00000, 0.84706}, {0.69020, 0.00000, 0.85098}, {0.69020, 0.00000, 0.85882}, {0.69020, 0.00000, 0.86667}, {0.69020, 0.00000, 0.87451}, {0.68627, 0.00000, 0.88235}, {0.68235, 0.00000, 0.89020}, {0.67843, 0.00000, 0.89804}, {0.67451, 0.00000, 0.90980}, {0.67059, 0.00000, 0.91765}, {0.66667, 0.00000, 0.92549}, {0.66275, 0.00000, 0.93333}, {0.65882, 0.00000, 0.94510}, {0.65490, 0.00000, 0.95294}, {0.65098, 0.00000, 0.96078}, {0.64706, 0.00000, 0.96863}, {0.64314, 0.00000, 0.98039}, {0.64314, 0.00000, 0.98431}, {0.64314, 0.00000, 0.98824}, {0.64314, 0.00000, 0.99216}, {0.64314, 0.00000, 1.00000}, {0.63922, 0.00000, 1.00000}, {0.63529, 0.00000, 1.00000}, {0.63137, 0.00000, 1.00000}, {0.62745, 0.00000, 1.00000}, {0.62353, 0.00000, 1.00000}, {0.61961, 0.00000, 1.00000}, {0.61569, 0.00000, 1.00000}, {0.61176, 0.00000, 1.00000}, {0.60784, 0.00000, 1.00000}, {0.60392, 0.00000, 1.00000}, {0.60000, 0.00000, 1.00000}, {0.59608, 0.00000, 1.00000}, {0.59608, 0.00000, 1.00000}, {0.59608, 0.00000, 1.00000}, {0.59608, 0.00000, 1.00000}, {0.59608, 0.00000, 1.00000}, {0.59216, 0.00000, 1.00000}, {0.58824, 0.00000, 1.00000}, {0.58431, 0.00000, 1.00000}, {0.58039, 0.00000, 1.00000}, {0.59216, 0.03137, 1.00000}, {0.60392, 0.06275, 1.00000}, {0.61569, 0.09412, 1.00000}, {0.62745, 0.12549, 1.00000}, {0.63922, 0.15686, 1.00000}, {0.65098, 0.18824, 1.00000}, {0.66275, 0.21961, 1.00000}, {0.67451, 0.25098, 1.00000}, {0.69020, 0.28235, 1.00000}, {0.70588, 0.31373, 1.00000}, {0.72157, 0.34510, 1.00000}, {0.73725, 0.37647, 1.00000}, {0.74902, 0.40784, 1.00000}, {0.76078, 0.43922, 1.00000}, {0.77255, 0.47059, 1.00000}, {0.78431, 0.50196, 1.00000}, {0.79608, 0.52941, 1.00000}, {0.80784, 0.55686, 1.00000}, {0.81961, 0.58431, 1.00000}, {0.83137, 0.61176, 1.00000}, {0.84314, 0.64314, 1.00000}, {0.85490, 0.67451, 1.00000}, {0.86667, 0.70588, 1.00000}, {0.87843, 0.73725, 1.00000}, {0.89412, 0.76863, 1.00000}, {0.90980, 0.80000, 1.00000}, {0.92549, 0.83137, 1.00000}, {0.94118, 0.86275, 1.00000}, {0.95294, 0.89412, 1.00000}, {0.96471, 0.92549, 1.00000}, {0.97647, 0.95686, 1.00000}, {0.98824, 0.98824, 1.00000}, {0.99216, 0.99216, 1.00000}, {0.99608, 0.99608, 1.00000}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("idl2.lasc", idl2_lasc); static RGBColor rainbow2_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.03137, 0.00000, 0.03137}, {0.06275, 0.00000, 0.06275}, {0.09412, 0.00000, 0.09412}, {0.12549, 0.00000, 0.12549}, {0.15686, 0.00000, 0.15686}, {0.18824, 0.00000, 0.18824}, {0.21961, 0.00000, 0.21961}, {0.25098, 0.00000, 0.25098}, {0.28235, 0.00000, 0.28235}, {0.31373, 0.00000, 0.31373}, {0.34510, 0.00000, 0.34510}, {0.37647, 0.00000, 0.37647}, {0.40784, 0.00000, 0.40784}, {0.43922, 0.00000, 0.43922}, {0.47059, 0.00000, 0.47059}, {0.50196, 0.00000, 0.50196}, {0.53333, 0.00000, 0.53333}, {0.56471, 0.00000, 0.56471}, {0.59608, 0.00000, 0.59608}, {0.62745, 0.00000, 0.62745}, {0.65882, 0.00000, 0.65882}, {0.69020, 0.00000, 0.69020}, {0.72157, 0.00000, 0.72157}, {0.75294, 0.00000, 0.75294}, {0.78431, 0.00000, 0.78431}, {0.81569, 0.00000, 0.81569}, {0.84706, 0.00000, 0.84706}, {0.87843, 0.00000, 0.87843}, {0.90980, 0.00000, 0.90980}, {0.94118, 0.00000, 0.94118}, {0.97255, 0.00000, 0.97255}, {1.00000, 0.00000, 1.00000}, {0.96863, 0.00000, 1.00000}, {0.93725, 0.00000, 1.00000}, {0.90588, 0.00000, 1.00000}, {0.87451, 0.00000, 1.00000}, {0.84314, 0.00000, 1.00000}, {0.81176, 0.00000, 1.00000}, {0.78039, 0.00000, 1.00000}, {0.74902, 0.00000, 1.00000}, {0.71765, 0.00000, 1.00000}, {0.68627, 0.00000, 1.00000}, {0.65490, 0.00000, 1.00000}, {0.62353, 0.00000, 1.00000}, {0.59216, 0.00000, 1.00000}, {0.56078, 0.00000, 1.00000}, {0.52941, 0.00000, 1.00000}, {0.49804, 0.00000, 1.00000}, {0.46667, 0.00000, 1.00000}, {0.43529, 0.00000, 1.00000}, {0.40392, 0.00000, 1.00000}, {0.37255, 0.00000, 1.00000}, {0.34118, 0.00000, 1.00000}, {0.30980, 0.00000, 1.00000}, {0.27843, 0.00000, 1.00000}, {0.24706, 0.00000, 1.00000}, {0.21569, 0.00000, 1.00000}, {0.18431, 0.00000, 1.00000}, {0.15294, 0.00000, 1.00000}, {0.12157, 0.00000, 1.00000}, {0.09020, 0.00000, 1.00000}, {0.05882, 0.00000, 1.00000}, {0.02745, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.03137, 1.00000}, {0.00000, 0.06275, 1.00000}, {0.00000, 0.09412, 1.00000}, {0.00000, 0.12549, 1.00000}, {0.00000, 0.15686, 1.00000}, {0.00000, 0.18824, 1.00000}, {0.00000, 0.21961, 1.00000}, {0.00000, 0.25098, 1.00000}, {0.00000, 0.28235, 1.00000}, {0.00000, 0.31373, 1.00000}, {0.00000, 0.34510, 1.00000}, {0.00000, 0.37647, 1.00000}, {0.00000, 0.40784, 1.00000}, {0.00000, 0.43922, 1.00000}, {0.00000, 0.47059, 1.00000}, {0.00000, 0.50196, 1.00000}, {0.00000, 0.53333, 1.00000}, {0.00000, 0.56471, 1.00000}, {0.00000, 0.59608, 1.00000}, {0.00000, 0.62745, 1.00000}, {0.00000, 0.65882, 1.00000}, {0.00000, 0.69020, 1.00000}, {0.00000, 0.72157, 1.00000}, {0.00000, 0.75294, 1.00000}, {0.00000, 0.78431, 1.00000}, {0.00000, 0.81569, 1.00000}, {0.00000, 0.84706, 1.00000}, {0.00000, 0.87843, 1.00000}, {0.00000, 0.90980, 1.00000}, {0.00000, 0.94118, 1.00000}, {0.00000, 0.97255, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 0.96863}, {0.00000, 1.00000, 0.93725}, {0.00000, 1.00000, 0.90588}, {0.00000, 1.00000, 0.87451}, {0.00000, 1.00000, 0.84314}, {0.00000, 1.00000, 0.81176}, {0.00000, 1.00000, 0.78039}, {0.00000, 1.00000, 0.74902}, {0.00000, 1.00000, 0.71765}, {0.00000, 1.00000, 0.68627}, {0.00000, 1.00000, 0.65490}, {0.00000, 1.00000, 0.62353}, {0.00000, 1.00000, 0.59216}, {0.00000, 1.00000, 0.56078}, {0.00000, 1.00000, 0.52941}, {0.00000, 1.00000, 0.49804}, {0.00000, 1.00000, 0.46667}, {0.00000, 1.00000, 0.43529}, {0.00000, 1.00000, 0.40392}, {0.00000, 1.00000, 0.37255}, {0.00000, 1.00000, 0.34118}, {0.00000, 1.00000, 0.30980}, {0.00000, 1.00000, 0.27843}, {0.00000, 1.00000, 0.24706}, {0.00000, 1.00000, 0.21569}, {0.00000, 1.00000, 0.18431}, {0.00000, 1.00000, 0.15294}, {0.00000, 1.00000, 0.12157}, {0.00000, 1.00000, 0.09020}, {0.00000, 1.00000, 0.05882}, {0.00000, 1.00000, 0.02745}, {0.00000, 1.00000, 0.00000}, {0.03137, 1.00000, 0.00000}, {0.06275, 1.00000, 0.00000}, {0.09412, 1.00000, 0.00000}, {0.12549, 1.00000, 0.00000}, {0.15686, 1.00000, 0.00000}, {0.18824, 1.00000, 0.00000}, {0.21961, 1.00000, 0.00000}, {0.25098, 1.00000, 0.00000}, {0.28235, 1.00000, 0.00000}, {0.31373, 1.00000, 0.00000}, {0.34510, 1.00000, 0.00000}, {0.37647, 1.00000, 0.00000}, {0.40784, 1.00000, 0.00000}, {0.43922, 1.00000, 0.00000}, {0.47059, 1.00000, 0.00000}, {0.50196, 1.00000, 0.00000}, {0.53333, 1.00000, 0.00000}, {0.56471, 1.00000, 0.00000}, {0.59608, 1.00000, 0.00000}, {0.62745, 1.00000, 0.00000}, {0.65882, 1.00000, 0.00000}, {0.69020, 1.00000, 0.00000}, {0.72157, 1.00000, 0.00000}, {0.75294, 1.00000, 0.00000}, {0.78431, 1.00000, 0.00000}, {0.81569, 1.00000, 0.00000}, {0.84706, 1.00000, 0.00000}, {0.87843, 1.00000, 0.00000}, {0.90980, 1.00000, 0.00000}, {0.94118, 1.00000, 0.00000}, {0.97255, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 0.98431, 0.00000}, {1.00000, 0.96863, 0.00000}, {1.00000, 0.95294, 0.00000}, {1.00000, 0.93725, 0.00000}, {1.00000, 0.92157, 0.00000}, {1.00000, 0.90588, 0.00000}, {1.00000, 0.89020, 0.00000}, {1.00000, 0.87451, 0.00000}, {1.00000, 0.85882, 0.00000}, {1.00000, 0.84314, 0.00000}, {1.00000, 0.82745, 0.00000}, {1.00000, 0.81176, 0.00000}, {1.00000, 0.79608, 0.00000}, {1.00000, 0.78039, 0.00000}, {1.00000, 0.76471, 0.00000}, {1.00000, 0.74902, 0.00000}, {1.00000, 0.73333, 0.00000}, {1.00000, 0.71765, 0.00000}, {1.00000, 0.70196, 0.00000}, {1.00000, 0.68627, 0.00000}, {1.00000, 0.67059, 0.00000}, {1.00000, 0.65490, 0.00000}, {1.00000, 0.63922, 0.00000}, {1.00000, 0.62353, 0.00000}, {1.00000, 0.60784, 0.00000}, {1.00000, 0.59216, 0.00000}, {1.00000, 0.57647, 0.00000}, {1.00000, 0.56078, 0.00000}, {1.00000, 0.54510, 0.00000}, {1.00000, 0.52941, 0.00000}, {1.00000, 0.51373, 0.00000}, {1.00000, 0.49804, 0.00000}, {1.00000, 0.48235, 0.00000}, {1.00000, 0.46667, 0.00000}, {1.00000, 0.45098, 0.00000}, {1.00000, 0.43529, 0.00000}, {1.00000, 0.41961, 0.00000}, {1.00000, 0.40392, 0.00000}, {1.00000, 0.38824, 0.00000}, {1.00000, 0.37255, 0.00000}, {1.00000, 0.35686, 0.00000}, {1.00000, 0.34118, 0.00000}, {1.00000, 0.32549, 0.00000}, {1.00000, 0.30980, 0.00000}, {1.00000, 0.29412, 0.00000}, {1.00000, 0.27843, 0.00000}, {1.00000, 0.26275, 0.00000}, {1.00000, 0.24706, 0.00000}, {1.00000, 0.23137, 0.00000}, {1.00000, 0.21569, 0.00000}, {1.00000, 0.20000, 0.00000}, {1.00000, 0.18431, 0.00000}, {1.00000, 0.16863, 0.00000}, {1.00000, 0.15294, 0.00000}, {1.00000, 0.13725, 0.00000}, {1.00000, 0.12157, 0.00000}, {1.00000, 0.10588, 0.00000}, {1.00000, 0.09020, 0.00000}, {1.00000, 0.07451, 0.00000}, {1.00000, 0.05882, 0.00000}, {1.00000, 0.04314, 0.00000}, {1.00000, 0.02745, 0.00000}, {1.00000, 0.01176, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.03137, 0.03137}, {1.00000, 0.06275, 0.06275}, {1.00000, 0.09412, 0.09412}, {1.00000, 0.12549, 0.12549}, {1.00000, 0.15686, 0.15686}, {1.00000, 0.18824, 0.18824}, {1.00000, 0.21961, 0.21961}, {1.00000, 0.25098, 0.25098}, {1.00000, 0.28235, 0.28235}, {1.00000, 0.31373, 0.31373}, {1.00000, 0.34510, 0.34510}, {1.00000, 0.37647, 0.37647}, {1.00000, 0.40784, 0.40784}, {1.00000, 0.43922, 0.43922}, {1.00000, 0.47059, 0.47059}, {1.00000, 0.50196, 0.50196}, {1.00000, 0.53333, 0.53333}, {1.00000, 0.56471, 0.56471}, {1.00000, 0.59608, 0.59608}, {1.00000, 0.62745, 0.62745}, {1.00000, 0.65882, 0.65882}, {1.00000, 0.69020, 0.69020}, {1.00000, 0.72157, 0.72157}, {1.00000, 0.75294, 0.75294}, {1.00000, 0.78431, 0.78431}, {1.00000, 0.81569, 0.81569}, {1.00000, 0.84706, 0.84706}, {1.00000, 0.87843, 0.87843}, {1.00000, 0.90980, 0.90980}, {1.00000, 0.94118, 0.94118}, {1.00000, 0.97255, 0.97255}, }; new ColorMapInfo("rainbow2.lasc", rainbow2_lasc); static RGBColor standard_lasc[] = { {0.00392, 0.00392, 0.33333}, {0.00784, 0.00784, 0.34118}, {0.01176, 0.01176, 0.34902}, {0.01569, 0.01569, 0.35686}, {0.01961, 0.01961, 0.36471}, {0.02353, 0.02353, 0.37255}, {0.02745, 0.02745, 0.38039}, {0.03137, 0.03137, 0.38824}, {0.03529, 0.03529, 0.39608}, {0.03922, 0.03922, 0.40392}, {0.04314, 0.04314, 0.41176}, {0.04706, 0.04706, 0.41961}, {0.05098, 0.05098, 0.42745}, {0.05490, 0.05490, 0.43529}, {0.05882, 0.05882, 0.44314}, {0.06275, 0.06275, 0.45098}, {0.06667, 0.06667, 0.45882}, {0.07059, 0.07059, 0.46667}, {0.07451, 0.07451, 0.47451}, {0.07843, 0.07843, 0.48235}, {0.08235, 0.08235, 0.49020}, {0.08627, 0.08627, 0.49804}, {0.09020, 0.09020, 0.50588}, {0.09412, 0.09412, 0.51373}, {0.09804, 0.09804, 0.52157}, {0.10196, 0.10196, 0.52941}, {0.10588, 0.10588, 0.53725}, {0.10980, 0.10980, 0.54510}, {0.11373, 0.11373, 0.55294}, {0.11765, 0.11765, 0.56078}, {0.12157, 0.12157, 0.56863}, {0.12549, 0.12549, 0.57647}, {0.12941, 0.12941, 0.58431}, {0.13333, 0.13333, 0.59216}, {0.13725, 0.13725, 0.60000}, {0.14118, 0.14118, 0.60784}, {0.14510, 0.14510, 0.61569}, {0.14902, 0.14902, 0.62353}, {0.15294, 0.15294, 0.63137}, {0.15686, 0.15686, 0.63922}, {0.16078, 0.16078, 0.64706}, {0.16471, 0.16471, 0.65490}, {0.16863, 0.16863, 0.66275}, {0.17255, 0.17255, 0.67059}, {0.17647, 0.17647, 0.67843}, {0.18039, 0.18039, 0.68627}, {0.18431, 0.18431, 0.69412}, {0.18824, 0.18824, 0.70196}, {0.19216, 0.19216, 0.70980}, {0.19608, 0.19608, 0.71765}, {0.20000, 0.20000, 0.72549}, {0.20392, 0.20392, 0.73333}, {0.20784, 0.20784, 0.74118}, {0.21176, 0.21176, 0.74902}, {0.21569, 0.21569, 0.75686}, {0.21961, 0.21961, 0.76471}, {0.22353, 0.22353, 0.77255}, {0.22745, 0.22745, 0.78039}, {0.23137, 0.23137, 0.78824}, {0.23529, 0.23529, 0.79608}, {0.23922, 0.23922, 0.80392}, {0.24314, 0.24314, 0.81176}, {0.24706, 0.24706, 0.81961}, {0.25098, 0.25098, 0.82745}, {0.25490, 0.25490, 0.83529}, {0.25882, 0.25882, 0.84314}, {0.26275, 0.26275, 0.85098}, {0.26667, 0.26667, 0.85882}, {0.27059, 0.27059, 0.86667}, {0.27451, 0.27451, 0.87451}, {0.27843, 0.27843, 0.88235}, {0.28235, 0.28235, 0.89020}, {0.28627, 0.28627, 0.89804}, {0.29020, 0.29020, 0.90588}, {0.29412, 0.29412, 0.91373}, {0.29804, 0.29804, 0.92157}, {0.30196, 0.30196, 0.92941}, {0.30588, 0.30588, 0.93725}, {0.30980, 0.30980, 0.94510}, {0.31373, 0.31373, 0.95294}, {0.31765, 0.31765, 0.96078}, {0.32157, 0.32157, 0.96863}, {0.32549, 0.32549, 0.97647}, {0.32941, 0.32941, 0.98431}, {0.33333, 0.33333, 0.99216}, {0.00392, 0.33333, 0.00392}, {0.00784, 0.34118, 0.00784}, {0.01176, 0.34902, 0.01176}, {0.01569, 0.35686, 0.01569}, {0.01961, 0.36471, 0.01961}, {0.02353, 0.37255, 0.02353}, {0.02745, 0.38039, 0.02745}, {0.03137, 0.38824, 0.03137}, {0.03529, 0.39608, 0.03529}, {0.03922, 0.40392, 0.03922}, {0.04314, 0.41176, 0.04314}, {0.04706, 0.41961, 0.04706}, {0.05098, 0.42745, 0.05098}, {0.05490, 0.43529, 0.05490}, {0.05882, 0.44314, 0.05882}, {0.06275, 0.45098, 0.06275}, {0.06667, 0.45882, 0.06667}, {0.07059, 0.46667, 0.07059}, {0.07451, 0.47451, 0.07451}, {0.07843, 0.48235, 0.07843}, {0.08235, 0.49020, 0.08235}, {0.08627, 0.49804, 0.08627}, {0.09020, 0.50588, 0.09020}, {0.09412, 0.51373, 0.09412}, {0.09804, 0.52157, 0.09804}, {0.10196, 0.52941, 0.10196}, {0.10588, 0.53725, 0.10588}, {0.10980, 0.54510, 0.10980}, {0.11373, 0.55294, 0.11373}, {0.11765, 0.56078, 0.11765}, {0.12157, 0.56863, 0.12157}, {0.12549, 0.57647, 0.12549}, {0.12941, 0.58431, 0.12941}, {0.13333, 0.59216, 0.13333}, {0.13725, 0.60000, 0.13725}, {0.14118, 0.60784, 0.14118}, {0.14510, 0.61569, 0.14510}, {0.14902, 0.62353, 0.14902}, {0.15294, 0.63137, 0.15294}, {0.15686, 0.63922, 0.15686}, {0.16078, 0.64706, 0.16078}, {0.16471, 0.65490, 0.16471}, {0.16863, 0.66275, 0.16863}, {0.17255, 0.67059, 0.17255}, {0.17647, 0.67843, 0.17647}, {0.18039, 0.68627, 0.18039}, {0.18431, 0.69412, 0.18431}, {0.18824, 0.70196, 0.18824}, {0.19216, 0.70980, 0.19216}, {0.19608, 0.71765, 0.19608}, {0.20000, 0.72549, 0.20000}, {0.20392, 0.73333, 0.20392}, {0.20784, 0.74118, 0.20784}, {0.21176, 0.74902, 0.21176}, {0.21569, 0.75686, 0.21569}, {0.21961, 0.76471, 0.21961}, {0.22353, 0.77255, 0.22353}, {0.22745, 0.78039, 0.22745}, {0.23137, 0.78824, 0.23137}, {0.23529, 0.79608, 0.23529}, {0.23922, 0.80392, 0.23922}, {0.24314, 0.81176, 0.24314}, {0.24706, 0.81961, 0.24706}, {0.25098, 0.82745, 0.25098}, {0.25490, 0.83529, 0.25490}, {0.25882, 0.84314, 0.25882}, {0.26275, 0.85098, 0.26275}, {0.26667, 0.85882, 0.26667}, {0.27059, 0.86667, 0.27059}, {0.27451, 0.87451, 0.27451}, {0.27843, 0.88235, 0.27843}, {0.28235, 0.89020, 0.28235}, {0.28627, 0.89804, 0.28627}, {0.29020, 0.90588, 0.29020}, {0.29412, 0.91373, 0.29412}, {0.29804, 0.92157, 0.29804}, {0.30196, 0.92941, 0.30196}, {0.30588, 0.93725, 0.30588}, {0.30980, 0.94510, 0.30980}, {0.31373, 0.95294, 0.31373}, {0.31765, 0.96078, 0.31765}, {0.32157, 0.96863, 0.32157}, {0.32549, 0.97647, 0.32549}, {0.32941, 0.98431, 0.32941}, {0.33333, 0.99216, 0.33333}, {0.33333, 0.00392, 0.00392}, {0.34118, 0.00784, 0.00784}, {0.34902, 0.01176, 0.01176}, {0.35686, 0.01569, 0.01569}, {0.36471, 0.01961, 0.01961}, {0.37255, 0.02353, 0.02353}, {0.38039, 0.02745, 0.02745}, {0.38824, 0.03137, 0.03137}, {0.39608, 0.03529, 0.03529}, {0.40392, 0.03922, 0.03922}, {0.41176, 0.04314, 0.04314}, {0.41961, 0.04706, 0.04706}, {0.42745, 0.05098, 0.05098}, {0.43529, 0.05490, 0.05490}, {0.44314, 0.05882, 0.05882}, {0.45098, 0.06275, 0.06275}, {0.45882, 0.06667, 0.06667}, {0.46667, 0.07059, 0.07059}, {0.47451, 0.07451, 0.07451}, {0.48235, 0.07843, 0.07843}, {0.49020, 0.08235, 0.08235}, {0.49804, 0.08627, 0.08627}, {0.50588, 0.09020, 0.09020}, {0.51373, 0.09412, 0.09412}, {0.52157, 0.09804, 0.09804}, {0.52941, 0.10196, 0.10196}, {0.53725, 0.10588, 0.10588}, {0.54510, 0.10980, 0.10980}, {0.55294, 0.11373, 0.11373}, {0.56078, 0.11765, 0.11765}, {0.56863, 0.12157, 0.12157}, {0.57647, 0.12549, 0.12549}, {0.58431, 0.12941, 0.12941}, {0.59216, 0.13333, 0.13333}, {0.60000, 0.13725, 0.13725}, {0.60784, 0.14118, 0.14118}, {0.61569, 0.14510, 0.14510}, {0.62353, 0.14902, 0.14902}, {0.63137, 0.15294, 0.15294}, {0.63922, 0.15686, 0.15686}, {0.64706, 0.16078, 0.16078}, {0.65490, 0.16471, 0.16471}, {0.66275, 0.16863, 0.16863}, {0.67059, 0.17255, 0.17255}, {0.67843, 0.17647, 0.17647}, {0.68627, 0.18039, 0.18039}, {0.69412, 0.18431, 0.18431}, {0.70196, 0.18824, 0.18824}, {0.70980, 0.19216, 0.19216}, {0.71765, 0.19608, 0.19608}, {0.72549, 0.20000, 0.20000}, {0.73333, 0.20392, 0.20392}, {0.74118, 0.20784, 0.20784}, {0.74902, 0.21176, 0.21176}, {0.75686, 0.21569, 0.21569}, {0.76471, 0.21961, 0.21961}, {0.77255, 0.22353, 0.22353}, {0.78039, 0.22745, 0.22745}, {0.78824, 0.23137, 0.23137}, {0.79608, 0.23529, 0.23529}, {0.80392, 0.23922, 0.23922}, {0.81176, 0.24314, 0.24314}, {0.81961, 0.24706, 0.24706}, {0.82745, 0.25098, 0.25098}, {0.83529, 0.25490, 0.25490}, {0.84314, 0.25882, 0.25882}, {0.85098, 0.26275, 0.26275}, {0.85882, 0.26667, 0.26667}, {0.86667, 0.27059, 0.27059}, {0.87451, 0.27451, 0.27451}, {0.88235, 0.27843, 0.27843}, {0.89020, 0.28235, 0.28235}, {0.89804, 0.28627, 0.28627}, {0.90588, 0.29020, 0.29020}, {0.91373, 0.29412, 0.29412}, {0.92157, 0.29804, 0.29804}, {0.92941, 0.30196, 0.30196}, {0.93725, 0.30588, 0.30588}, {0.94510, 0.30980, 0.30980}, {0.95294, 0.31373, 0.31373}, {0.96078, 0.31765, 0.31765}, {0.96863, 0.32157, 0.32157}, {0.97647, 0.32549, 0.32549}, {0.98431, 0.32941, 0.32941}, {0.99216, 0.33333, 0.33333}, {1.00000, 0.33725, 0.33725}, }; new ColorMapInfo("standard.lasc", standard_lasc); static RGBColor manycol_lasc[] = { {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {1.00000, 1.00000, 1.00000}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.34902, 0.34902, 0.34902}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.44706, 0.78431, 0.92549}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69020, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 0.69020, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.72549, 0.00000, 0.72549}, {0.72549, 0.00000, 0.72549}, }; new ColorMapInfo("manycol.lasc", manycol_lasc); static RGBColor rainbow1_lasc[] = { {0.00000, 0.00000, 0.16471}, {0.02745, 0.00000, 0.18431}, {0.05882, 0.00000, 0.20000}, {0.08627, 0.00000, 0.21961}, {0.11373, 0.00000, 0.23922}, {0.14510, 0.00000, 0.25882}, {0.17647, 0.00000, 0.27843}, {0.20392, 0.00000, 0.29804}, {0.23137, 0.00000, 0.31765}, {0.26275, 0.00000, 0.33725}, {0.29412, 0.00000, 0.35686}, {0.32157, 0.00000, 0.37647}, {0.35294, 0.00000, 0.39608}, {0.38039, 0.00000, 0.41569}, {0.41176, 0.00000, 0.43529}, {0.43922, 0.00000, 0.45490}, {0.47059, 0.00000, 0.47451}, {0.49804, 0.00000, 0.49412}, {0.52941, 0.00000, 0.51373}, {0.55686, 0.00000, 0.53725}, {0.58824, 0.00000, 0.55686}, {0.55686, 0.00000, 0.57647}, {0.52941, 0.00000, 0.59608}, {0.49804, 0.00000, 0.61569}, {0.47059, 0.00000, 0.63922}, {0.43922, 0.00000, 0.65882}, {0.41176, 0.00000, 0.67843}, {0.38039, 0.00000, 0.70196}, {0.35294, 0.00000, 0.72157}, {0.32157, 0.00000, 0.74118}, {0.29412, 0.00000, 0.76471}, {0.26275, 0.00000, 0.78431}, {0.23137, 0.00000, 0.80392}, {0.20392, 0.00000, 0.82745}, {0.17647, 0.00000, 0.84706}, {0.14510, 0.00000, 0.87059}, {0.11373, 0.00000, 0.89020}, {0.08627, 0.00000, 0.91373}, {0.05882, 0.00000, 0.93333}, {0.02745, 0.00000, 0.95686}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 0.97647}, {0.00000, 0.00784, 0.95686}, {0.00000, 0.01569, 0.93333}, {0.00000, 0.02353, 0.91373}, {0.00000, 0.03137, 0.89020}, {0.00000, 0.03922, 0.87059}, {0.00000, 0.05098, 0.85098}, {0.00000, 0.06275, 0.83137}, {0.00000, 0.07843, 0.81176}, {0.00000, 0.09804, 0.79216}, {0.00000, 0.11765, 0.77255}, {0.00000, 0.13725, 0.75294}, {0.00000, 0.15686, 0.73333}, {0.00000, 0.17647, 0.71373}, {0.00000, 0.19608, 0.69412}, {0.00000, 0.21569, 0.67451}, {0.00000, 0.23529, 0.65882}, {0.00000, 0.25490, 0.64314}, {0.00000, 0.27059, 0.62745}, {0.00000, 0.28627, 0.61176}, {0.00000, 0.30196, 0.59608}, {0.00000, 0.32157, 0.58039}, {0.00000, 0.33333, 0.56471}, {0.00000, 0.34510, 0.54902}, {0.00000, 0.35686, 0.53333}, {0.00000, 0.36863, 0.51765}, {0.00000, 0.38039, 0.50196}, {0.00000, 0.39216, 0.48627}, {0.00000, 0.40392, 0.47059}, {0.00000, 0.41176, 0.45882}, {0.00000, 0.42353, 0.44706}, {0.00000, 0.43529, 0.43529}, {0.00000, 0.44706, 0.42353}, {0.00000, 0.45882, 0.41176}, {0.00000, 0.46667, 0.40000}, {0.00000, 0.47843, 0.38824}, {0.00000, 0.49020, 0.37647}, {0.00000, 0.49804, 0.36471}, {0.00000, 0.50980, 0.35294}, {0.00000, 0.52157, 0.34118}, {0.00000, 0.52941, 0.32941}, {0.00000, 0.54118, 0.31765}, {0.00000, 0.55294, 0.30588}, {0.00000, 0.56078, 0.29412}, {0.00000, 0.57255, 0.28235}, {0.00000, 0.58431, 0.27059}, {0.00000, 0.59216, 0.25882}, {0.00000, 0.60392, 0.24706}, {0.00000, 0.61176, 0.23529}, {0.00000, 0.62353, 0.22353}, {0.00000, 0.63137, 0.21176}, {0.00000, 0.64314, 0.20000}, {0.00000, 0.65098, 0.18824}, {0.00000, 0.66275, 0.17647}, {0.00000, 0.67059, 0.16471}, {0.00000, 0.68235, 0.15294}, {0.00000, 0.69020, 0.14118}, {0.00000, 0.70196, 0.12941}, {0.00000, 0.70980, 0.11765}, {0.00000, 0.72157, 0.10196}, {0.00000, 0.72941, 0.08627}, {0.00000, 0.74118, 0.07059}, {0.00000, 0.74902, 0.05490}, {0.00000, 0.76078, 0.03922}, {0.00000, 0.76863, 0.02353}, {0.00000, 0.77647, 0.00000}, {0.00000, 0.78824, 0.00000}, {0.00000, 0.79608, 0.00000}, {0.00000, 0.80784, 0.00000}, {0.00000, 0.81569, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.83529, 0.00000}, {0.00000, 0.84314, 0.00000}, {0.00000, 0.85490, 0.00000}, {0.00000, 0.86275, 0.00000}, {0.00000, 0.87059, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.89020, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.90980, 0.00000}, {0.00000, 0.91765, 0.00000}, {0.00000, 0.92549, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.94510, 0.00000}, {0.00000, 0.95294, 0.00000}, {0.00000, 0.96078, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.98039, 0.00000}, {0.00000, 0.98824, 0.00000}, {0.00784, 1.00000, 0.00000}, {0.01569, 0.98824, 0.00000}, {0.02353, 0.98039, 0.00000}, {0.03137, 0.97255, 0.00000}, {0.04314, 0.96078, 0.00000}, {0.05490, 0.95294, 0.00000}, {0.06667, 0.94510, 0.00000}, {0.07843, 0.93725, 0.00000}, {0.09020, 0.92549, 0.00000}, {0.10196, 0.91765, 0.00000}, {0.11373, 0.90980, 0.00000}, {0.12549, 0.89804, 0.00000}, {0.13725, 0.89020, 0.00000}, {0.14902, 0.88235, 0.00000}, {0.16471, 0.87059, 0.00000}, {0.20000, 0.86275, 0.00000}, {0.23529, 0.85490, 0.00000}, {0.26667, 0.84314, 0.00000}, {0.30588, 0.83529, 0.00000}, {0.34118, 0.82353, 0.00000}, {0.37647, 0.81569, 0.00000}, {0.41176, 0.80784, 0.00000}, {0.44706, 0.79608, 0.00000}, {0.48627, 0.78824, 0.00000}, {0.52157, 0.77647, 0.00000}, {0.56078, 0.76863, 0.00000}, {0.59608, 0.77647, 0.00000}, {0.63529, 0.78824, 0.00000}, {0.67059, 0.80000, 0.00000}, {0.70980, 0.81176, 0.00000}, {0.74902, 0.82745, 0.00000}, {0.78431, 0.84314, 0.00000}, {0.82353, 0.85882, 0.00000}, {0.85882, 0.87059, 0.00000}, {0.89804, 0.89020, 0.00000}, {0.93333, 0.90196, 0.00000}, {0.97647, 0.92157, 0.00000}, {1.00000, 0.93333, 0.00000}, {1.00000, 0.95294, 0.00000}, {1.00000, 0.96863, 0.00000}, {1.00000, 0.98824, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {0.99608, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 1.00000, 0.00000}, {1.00000, 0.97647, 0.00000}, {1.00000, 0.93725, 0.00000}, {1.00000, 0.89804, 0.00000}, {1.00000, 0.85882, 0.00000}, {1.00000, 0.81961, 0.00000}, {1.00000, 0.78039, 0.00000}, {1.00000, 0.74118, 0.00000}, {1.00000, 0.70196, 0.00000}, {1.00000, 0.66275, 0.00000}, {1.00000, 0.62353, 0.00000}, {1.00000, 0.58431, 0.00000}, {1.00000, 0.54510, 0.00000}, {1.00000, 0.50980, 0.00000}, {1.00000, 0.46667, 0.00000}, {1.00000, 0.43137, 0.00000}, {1.00000, 0.39216, 0.00000}, {1.00000, 0.35294, 0.00000}, {1.00000, 0.31765, 0.00000}, {1.00000, 0.27451, 0.00000}, {1.00000, 0.23922, 0.00000}, {1.00000, 0.20000, 0.00000}, {1.00000, 0.16863, 0.00000}, {1.00000, 0.12941, 0.00000}, {1.00000, 0.09804, 0.00000}, {1.00000, 0.08235, 0.00000}, {1.00000, 0.06275, 0.00000}, {1.00000, 0.04706, 0.00000}, {1.00000, 0.02353, 0.00000}, {1.00000, 0.00000, 0.00000}, {0.99216, 0.00000, 0.00000}, {0.98431, 0.00000, 0.00000}, {0.97647, 0.00000, 0.00000}, {0.96863, 0.00000, 0.00000}, {0.96078, 0.00000, 0.00000}, {0.95294, 0.00000, 0.00000}, {0.94510, 0.00000, 0.00000}, {0.93725, 0.00000, 0.00000}, {0.92941, 0.00000, 0.00000}, {0.92157, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {0.90588, 0.00000, 0.00000}, {0.89804, 0.00000, 0.00000}, {0.89020, 0.00000, 0.00000}, {0.88235, 0.00000, 0.00000}, {0.87451, 0.00000, 0.00000}, {0.86667, 0.00000, 0.00000}, {0.85882, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.84314, 0.00000, 0.00000}, {0.83529, 0.00000, 0.00000}, {0.82745, 0.00000, 0.00000}, {0.81961, 0.00000, 0.00000}, {0.81176, 0.00000, 0.00000}, {0.80392, 0.00000, 0.00000}, {0.79608, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.78039, 0.00000, 0.00000}, {0.77255, 0.00000, 0.00000}, {0.76471, 0.00000, 0.00000}, {0.75686, 0.00000, 0.00000}, {0.74902, 0.00000, 0.00000}, {0.74118, 0.00000, 0.00000}, {0.73333, 0.00000, 0.00000}, }; new ColorMapInfo("rainbow1.lasc", rainbow1_lasc); static RGBColor green_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00392, 0.00000}, {0.00000, 0.00784, 0.00000}, {0.00000, 0.01176, 0.00000}, {0.00000, 0.01569, 0.00000}, {0.00000, 0.01961, 0.00000}, {0.00000, 0.02353, 0.00000}, {0.00000, 0.02745, 0.00000}, {0.00000, 0.03137, 0.00000}, {0.00000, 0.03529, 0.00000}, {0.00000, 0.03922, 0.00000}, {0.00000, 0.04314, 0.00000}, {0.00000, 0.04706, 0.00000}, {0.00000, 0.05098, 0.00000}, {0.00000, 0.05490, 0.00000}, {0.00000, 0.05882, 0.00000}, {0.00000, 0.06275, 0.00000}, {0.00000, 0.06667, 0.00000}, {0.00000, 0.07059, 0.00000}, {0.00000, 0.07451, 0.00000}, {0.00000, 0.07843, 0.00000}, {0.00000, 0.08235, 0.00000}, {0.00000, 0.08627, 0.00000}, {0.00000, 0.09020, 0.00000}, {0.00000, 0.09412, 0.00000}, {0.00000, 0.09804, 0.00000}, {0.00000, 0.10196, 0.00000}, {0.00000, 0.10588, 0.00000}, {0.00000, 0.10980, 0.00000}, {0.00000, 0.11373, 0.00000}, {0.00000, 0.11765, 0.00000}, {0.00000, 0.12157, 0.00000}, {0.00000, 0.12549, 0.00000}, {0.00000, 0.12941, 0.00000}, {0.00000, 0.13333, 0.00000}, {0.00000, 0.13725, 0.00000}, {0.00000, 0.14118, 0.00000}, {0.00000, 0.14510, 0.00000}, {0.00000, 0.14902, 0.00000}, {0.00000, 0.15294, 0.00000}, {0.00000, 0.15686, 0.00000}, {0.00000, 0.16078, 0.00000}, {0.00000, 0.16471, 0.00000}, {0.00000, 0.16863, 0.00000}, {0.00000, 0.17255, 0.00000}, {0.00000, 0.17647, 0.00000}, {0.00000, 0.18039, 0.00000}, {0.00000, 0.18431, 0.00000}, {0.00000, 0.18824, 0.00000}, {0.00000, 0.19216, 0.00000}, {0.00000, 0.19608, 0.00000}, {0.00000, 0.20000, 0.00000}, {0.00000, 0.20392, 0.00000}, {0.00000, 0.20784, 0.00000}, {0.00000, 0.21176, 0.00000}, {0.00000, 0.21569, 0.00000}, {0.00000, 0.21961, 0.00000}, {0.00000, 0.22353, 0.00000}, {0.00000, 0.22745, 0.00000}, {0.00000, 0.23137, 0.00000}, {0.00000, 0.23529, 0.00000}, {0.00000, 0.23922, 0.00000}, {0.00000, 0.24314, 0.00000}, {0.00000, 0.24706, 0.00000}, {0.00000, 0.25098, 0.00000}, {0.00000, 0.25490, 0.00000}, {0.00000, 0.25882, 0.00000}, {0.00000, 0.26275, 0.00000}, {0.00000, 0.26667, 0.00000}, {0.00000, 0.27059, 0.00000}, {0.00000, 0.27451, 0.00000}, {0.00000, 0.27843, 0.00000}, {0.00000, 0.28235, 0.00000}, {0.00000, 0.28627, 0.00000}, {0.00000, 0.29020, 0.00000}, {0.00000, 0.29412, 0.00000}, {0.00000, 0.29804, 0.00000}, {0.00000, 0.30196, 0.00000}, {0.00000, 0.30588, 0.00000}, {0.00000, 0.30980, 0.00000}, {0.00000, 0.31373, 0.00000}, {0.00000, 0.31765, 0.00000}, {0.00000, 0.32157, 0.00000}, {0.00000, 0.32549, 0.00000}, {0.00000, 0.32941, 0.00000}, {0.00000, 0.33333, 0.00000}, {0.00000, 0.33725, 0.00000}, {0.00000, 0.34118, 0.00000}, {0.00000, 0.34510, 0.00000}, {0.00000, 0.34902, 0.00000}, {0.00000, 0.35294, 0.00000}, {0.00000, 0.35686, 0.00000}, {0.00000, 0.36078, 0.00000}, {0.00000, 0.36471, 0.00000}, {0.00000, 0.36863, 0.00000}, {0.00000, 0.37255, 0.00000}, {0.00000, 0.37647, 0.00000}, {0.00000, 0.38039, 0.00000}, {0.00000, 0.38431, 0.00000}, {0.00000, 0.38824, 0.00000}, {0.00000, 0.39216, 0.00000}, {0.00000, 0.39608, 0.00000}, {0.00000, 0.40000, 0.00000}, {0.00000, 0.40392, 0.00000}, {0.00000, 0.40784, 0.00000}, {0.00000, 0.41176, 0.00000}, {0.00000, 0.41569, 0.00000}, {0.00000, 0.41961, 0.00000}, {0.00000, 0.42353, 0.00000}, {0.00000, 0.42745, 0.00000}, {0.00000, 0.43137, 0.00000}, {0.00000, 0.43529, 0.00000}, {0.00000, 0.43922, 0.00000}, {0.00000, 0.44314, 0.00000}, {0.00000, 0.44706, 0.00000}, {0.00000, 0.45098, 0.00000}, {0.00000, 0.45490, 0.00000}, {0.00000, 0.45882, 0.00000}, {0.00000, 0.46275, 0.00000}, {0.00000, 0.46667, 0.00000}, {0.00000, 0.47059, 0.00000}, {0.00000, 0.47451, 0.00000}, {0.00000, 0.47843, 0.00000}, {0.00000, 0.48235, 0.00000}, {0.00000, 0.48627, 0.00000}, {0.00000, 0.49020, 0.00000}, {0.00000, 0.49412, 0.00000}, {0.00000, 0.49804, 0.00000}, {0.00000, 0.50196, 0.00000}, {0.00000, 0.50588, 0.00000}, {0.00000, 0.50980, 0.00000}, {0.00000, 0.51373, 0.00000}, {0.00000, 0.51765, 0.00000}, {0.00000, 0.52157, 0.00000}, {0.00000, 0.52549, 0.00000}, {0.00000, 0.52941, 0.00000}, {0.00000, 0.53333, 0.00000}, {0.00000, 0.53725, 0.00000}, {0.00000, 0.54118, 0.00000}, {0.00000, 0.54510, 0.00000}, {0.00000, 0.54902, 0.00000}, {0.00000, 0.55294, 0.00000}, {0.00000, 0.55686, 0.00000}, {0.00000, 0.56078, 0.00000}, {0.00000, 0.56471, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.57255, 0.00000}, {0.00000, 0.57647, 0.00000}, {0.00000, 0.58039, 0.00000}, {0.00000, 0.58431, 0.00000}, {0.00000, 0.58824, 0.00000}, {0.00000, 0.59216, 0.00000}, {0.00000, 0.59608, 0.00000}, {0.00000, 0.60000, 0.00000}, {0.00000, 0.60392, 0.00000}, {0.00000, 0.60784, 0.00000}, {0.00000, 0.61176, 0.00000}, {0.00000, 0.61569, 0.00000}, {0.00000, 0.61961, 0.00000}, {0.00000, 0.62353, 0.00000}, {0.00000, 0.62745, 0.00000}, {0.00000, 0.63137, 0.00000}, {0.00000, 0.63529, 0.00000}, {0.00000, 0.63922, 0.00000}, {0.00000, 0.64314, 0.00000}, {0.00000, 0.64706, 0.00000}, {0.00000, 0.65098, 0.00000}, {0.00000, 0.65490, 0.00000}, {0.00000, 0.65882, 0.00000}, {0.00000, 0.66275, 0.00000}, {0.00000, 0.66667, 0.00000}, {0.00000, 0.67059, 0.00000}, {0.00000, 0.67451, 0.00000}, {0.00000, 0.67843, 0.00000}, {0.00000, 0.68235, 0.00000}, {0.00000, 0.68627, 0.00000}, {0.00000, 0.69020, 0.00000}, {0.00000, 0.69412, 0.00000}, {0.00000, 0.69804, 0.00000}, {0.00000, 0.70196, 0.00000}, {0.00000, 0.70588, 0.00000}, {0.00000, 0.70980, 0.00000}, {0.00000, 0.71373, 0.00000}, {0.00000, 0.71765, 0.00000}, {0.00000, 0.72157, 0.00000}, {0.00000, 0.72549, 0.00000}, {0.00000, 0.72941, 0.00000}, {0.00000, 0.73333, 0.00000}, {0.00000, 0.73725, 0.00000}, {0.00000, 0.74118, 0.00000}, {0.00000, 0.74510, 0.00000}, {0.00000, 0.74902, 0.00000}, {0.00000, 0.75294, 0.00000}, {0.00000, 0.75686, 0.00000}, {0.00000, 0.76078, 0.00000}, {0.00000, 0.76471, 0.00000}, {0.00000, 0.76863, 0.00000}, {0.00000, 0.77255, 0.00000}, {0.00000, 0.77647, 0.00000}, {0.00000, 0.78039, 0.00000}, {0.00000, 0.78431, 0.00000}, {0.00000, 0.78824, 0.00000}, {0.00000, 0.79216, 0.00000}, {0.00000, 0.79608, 0.00000}, {0.00000, 0.80000, 0.00000}, {0.00000, 0.80392, 0.00000}, {0.00000, 0.80784, 0.00000}, {0.00000, 0.81176, 0.00000}, {0.00000, 0.81569, 0.00000}, {0.00000, 0.81961, 0.00000}, {0.00000, 0.82353, 0.00000}, {0.00000, 0.82745, 0.00000}, {0.00000, 0.83137, 0.00000}, {0.00000, 0.83529, 0.00000}, {0.00000, 0.83922, 0.00000}, {0.00000, 0.84314, 0.00000}, {0.00000, 0.84706, 0.00000}, {0.00000, 0.85098, 0.00000}, {0.00000, 0.85490, 0.00000}, {0.00000, 0.85882, 0.00000}, {0.00000, 0.86275, 0.00000}, {0.00000, 0.86667, 0.00000}, {0.00000, 0.87059, 0.00000}, {0.00000, 0.87451, 0.00000}, {0.00000, 0.87843, 0.00000}, {0.00000, 0.88235, 0.00000}, {0.00000, 0.88627, 0.00000}, {0.00000, 0.89020, 0.00000}, {0.00000, 0.89412, 0.00000}, {0.00000, 0.89804, 0.00000}, {0.00000, 0.90196, 0.00000}, {0.00000, 0.90588, 0.00000}, {0.00000, 0.90980, 0.00000}, {0.00000, 0.91373, 0.00000}, {0.00000, 0.91765, 0.00000}, {0.00000, 0.92157, 0.00000}, {0.00000, 0.92549, 0.00000}, {0.00000, 0.92941, 0.00000}, {0.00000, 0.93333, 0.00000}, {0.00000, 0.93725, 0.00000}, {0.00000, 0.94118, 0.00000}, {0.00000, 0.94510, 0.00000}, {0.00000, 0.94902, 0.00000}, {0.00000, 0.95294, 0.00000}, {0.00000, 0.95686, 0.00000}, {0.00000, 0.96078, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96863, 0.00000}, {0.00000, 0.97255, 0.00000}, {0.00000, 0.97647, 0.00000}, {0.00000, 0.98039, 0.00000}, {0.00000, 0.98431, 0.00000}, {0.00000, 0.98824, 0.00000}, {0.00000, 0.99216, 0.00000}, {0.00000, 0.99608, 0.00000}, {0.00000, 1.00000, 0.00000}, }; new ColorMapInfo("green.lasc", green_lasc); static RGBColor random6_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.14118, 0.00000}, {0.00000, 0.28235, 0.00000}, {0.00000, 0.42353, 0.00000}, {0.00000, 0.56471, 0.00000}, {0.00000, 0.70588, 0.00000}, {0.00000, 0.84706, 0.00000}, {0.00000, 0.98824, 0.00000}, {0.00000, 0.00000, 0.14118}, {0.00000, 0.14118, 0.14118}, {0.00000, 0.28235, 0.14118}, {0.00000, 0.42353, 0.14118}, {0.00000, 0.56471, 0.14118}, {0.00000, 0.70588, 0.14118}, {0.00000, 0.84706, 0.14118}, {0.00000, 0.98824, 0.14118}, {0.00000, 0.00000, 0.28235}, {0.00000, 0.14118, 0.28235}, {0.00000, 0.28235, 0.28235}, {0.00000, 0.42353, 0.28235}, {0.00000, 0.56471, 0.28235}, {0.00000, 0.70588, 0.28235}, {0.00000, 0.84706, 0.28235}, {0.00000, 0.98824, 0.28235}, {0.00000, 0.00000, 0.42353}, {0.00000, 0.14118, 0.42353}, {0.00000, 0.28235, 0.42353}, {0.00000, 0.42353, 0.42353}, {0.00000, 0.56471, 0.42353}, {0.00000, 0.70588, 0.42353}, {0.00000, 0.84706, 0.42353}, {0.00000, 0.98824, 0.42353}, {0.00000, 0.00000, 0.56471}, {0.00000, 0.14118, 0.56471}, {0.00000, 0.28235, 0.56471}, {0.00000, 0.42353, 0.56471}, {0.00000, 0.56471, 0.56471}, {0.00000, 0.70588, 0.56471}, {0.00000, 0.84706, 0.56471}, {0.00000, 0.98824, 0.56471}, {0.00000, 0.00000, 0.70588}, {0.00000, 0.14118, 0.70588}, {0.00000, 0.28235, 0.70588}, {0.00000, 0.42353, 0.70588}, {0.00000, 0.56471, 0.70588}, {0.00000, 0.70588, 0.70588}, {0.00000, 0.84706, 0.70588}, {0.00000, 0.98824, 0.70588}, {0.00000, 0.00000, 0.84706}, {0.00000, 0.14118, 0.84706}, {0.00000, 0.28235, 0.84706}, {0.00000, 0.42353, 0.84706}, {0.00000, 0.56471, 0.84706}, {0.00000, 0.70588, 0.84706}, {0.00000, 0.84706, 0.84706}, {0.00000, 0.98824, 0.84706}, {0.00000, 0.00000, 0.98824}, {0.00000, 0.14118, 0.98824}, {0.00000, 0.28235, 0.98824}, {0.00000, 0.42353, 0.98824}, {0.00000, 0.56471, 0.98824}, {0.00000, 0.70588, 0.98824}, {0.00000, 0.84706, 0.98824}, {0.00000, 0.98824, 0.98824}, {0.00000, 0.00000, 0.00000}, {0.32941, 0.14118, 0.00000}, {0.32941, 0.28235, 0.00000}, {0.32941, 0.42353, 0.00000}, {0.32941, 0.56471, 0.00000}, {0.32941, 0.70588, 0.00000}, {0.32941, 0.84706, 0.00000}, {0.32941, 0.98824, 0.00000}, {0.32941, 0.00000, 0.14118}, {0.32941, 0.14118, 0.14118}, {0.32941, 0.28235, 0.14118}, {0.32941, 0.42353, 0.14118}, {0.32941, 0.56471, 0.14118}, {0.32941, 0.70588, 0.14118}, {0.32941, 0.84706, 0.14118}, {0.32941, 0.98824, 0.14118}, {0.32941, 0.00000, 0.28235}, {0.32941, 0.14118, 0.28235}, {0.32941, 0.28235, 0.28235}, {0.32941, 0.42353, 0.28235}, {0.32941, 0.56471, 0.28235}, {0.32941, 0.70588, 0.28235}, {0.32941, 0.84706, 0.28235}, {0.32941, 0.98824, 0.28235}, {0.32941, 0.00000, 0.42353}, {0.32941, 0.14118, 0.42353}, {0.32941, 0.28235, 0.42353}, {0.32941, 0.42353, 0.42353}, {0.32941, 0.56471, 0.42353}, {0.32941, 0.70588, 0.42353}, {0.32941, 0.84706, 0.42353}, {0.32941, 0.98824, 0.42353}, {0.32941, 0.00000, 0.56471}, {0.32941, 0.14118, 0.56471}, {0.32941, 0.28235, 0.56471}, {0.32941, 0.42353, 0.56471}, {0.32941, 0.56471, 0.56471}, {0.32941, 0.70588, 0.56471}, {0.32941, 0.84706, 0.56471}, {0.32941, 0.98824, 0.56471}, {0.32941, 0.00000, 0.70588}, {0.32941, 0.14118, 0.70588}, {0.32941, 0.28235, 0.70588}, {0.32941, 0.42353, 0.70588}, {0.32941, 0.56471, 0.70588}, {0.32941, 0.70588, 0.70588}, {0.32941, 0.84706, 0.70588}, {0.32941, 0.98824, 0.70588}, {0.32941, 0.00000, 0.84706}, {0.32941, 0.14118, 0.84706}, {0.32941, 0.28235, 0.84706}, {0.32941, 0.42353, 0.84706}, {0.32941, 0.56471, 0.84706}, {0.32941, 0.70588, 0.84706}, {0.32941, 0.84706, 0.84706}, {0.32941, 0.98824, 0.84706}, {0.32941, 0.00000, 0.98824}, {0.32941, 0.14118, 0.98824}, {0.32941, 0.28235, 0.98824}, {0.32941, 0.42353, 0.98824}, {0.32941, 0.56471, 0.98824}, {0.32941, 0.70588, 0.98824}, {0.32941, 0.84706, 0.98824}, {0.32941, 0.98824, 0.98824}, {0.32941, 0.00000, 0.00000}, {0.65882, 0.14118, 0.00000}, {0.65882, 0.28235, 0.00000}, {0.65882, 0.42353, 0.00000}, {0.65882, 0.56471, 0.00000}, {0.65882, 0.70588, 0.00000}, {0.65882, 0.84706, 0.00000}, {0.65882, 0.98824, 0.00000}, {0.65882, 0.00000, 0.14118}, {0.65882, 0.14118, 0.14118}, {0.65882, 0.28235, 0.14118}, {0.65882, 0.42353, 0.14118}, {0.65882, 0.56471, 0.14118}, {0.65882, 0.70588, 0.14118}, {0.65882, 0.84706, 0.14118}, {0.65882, 0.98824, 0.14118}, {0.65882, 0.00000, 0.28235}, {0.65882, 0.14118, 0.28235}, {0.65882, 0.28235, 0.28235}, {0.65882, 0.42353, 0.28235}, {0.65882, 0.56471, 0.28235}, {0.65882, 0.70588, 0.28235}, {0.65882, 0.84706, 0.28235}, {0.65882, 0.98824, 0.28235}, {0.65882, 0.00000, 0.42353}, {0.65882, 0.14118, 0.42353}, {0.65882, 0.28235, 0.42353}, {0.65882, 0.42353, 0.42353}, {0.65882, 0.56471, 0.42353}, {0.65882, 0.70588, 0.42353}, {0.65882, 0.84706, 0.42353}, {0.65882, 0.98824, 0.42353}, {0.65882, 0.00000, 0.56471}, {0.65882, 0.14118, 0.56471}, {0.65882, 0.28235, 0.56471}, {0.65882, 0.42353, 0.56471}, {0.65882, 0.56471, 0.56471}, {0.65882, 0.70588, 0.56471}, {0.65882, 0.84706, 0.56471}, {0.65882, 0.98824, 0.56471}, {0.65882, 0.00000, 0.70588}, {0.65882, 0.14118, 0.70588}, {0.65882, 0.28235, 0.70588}, {0.65882, 0.42353, 0.70588}, {0.65882, 0.56471, 0.70588}, {0.65882, 0.70588, 0.70588}, {0.65882, 0.84706, 0.70588}, {0.65882, 0.98824, 0.70588}, {0.65882, 0.00000, 0.84706}, {0.65882, 0.14118, 0.84706}, {0.65882, 0.28235, 0.84706}, {0.65882, 0.42353, 0.84706}, {0.65882, 0.56471, 0.84706}, {0.65882, 0.70588, 0.84706}, {0.65882, 0.84706, 0.84706}, {0.65882, 0.98824, 0.84706}, {0.65882, 0.00000, 0.98824}, {0.65882, 0.14118, 0.98824}, {0.65882, 0.28235, 0.98824}, {0.65882, 0.42353, 0.98824}, {0.65882, 0.56471, 0.98824}, {0.65882, 0.70588, 0.98824}, {0.65882, 0.84706, 0.98824}, {0.65882, 0.98824, 0.98824}, {0.65882, 0.00000, 0.00000}, {0.98824, 0.14118, 0.00000}, {0.98824, 0.28235, 0.00000}, {0.98824, 0.42353, 0.00000}, {0.98824, 0.56471, 0.00000}, {0.98824, 0.70588, 0.00000}, {0.98824, 0.84706, 0.00000}, {0.98824, 0.98824, 0.00000}, {0.98824, 0.00000, 0.14118}, {0.98824, 0.14118, 0.14118}, {0.98824, 0.28235, 0.14118}, {0.98824, 0.42353, 0.14118}, {0.98824, 0.56471, 0.14118}, {0.98824, 0.70588, 0.14118}, {0.98824, 0.84706, 0.14118}, {0.98824, 0.98824, 0.14118}, {0.98824, 0.00000, 0.28235}, {0.98824, 0.14118, 0.28235}, {0.98824, 0.28235, 0.28235}, {0.98824, 0.42353, 0.28235}, {0.98824, 0.56471, 0.28235}, {0.98824, 0.70588, 0.28235}, {0.98824, 0.84706, 0.28235}, {0.98824, 0.98824, 0.28235}, {0.98824, 0.00000, 0.42353}, {0.98824, 0.14118, 0.42353}, {0.98824, 0.28235, 0.42353}, {0.98824, 0.42353, 0.42353}, {0.98824, 0.56471, 0.42353}, {0.98824, 0.70588, 0.42353}, {0.98824, 0.84706, 0.42353}, {0.98824, 0.98824, 0.42353}, {0.98824, 0.00000, 0.56471}, {0.98824, 0.14118, 0.56471}, {0.98824, 0.28235, 0.56471}, {0.98824, 0.42353, 0.56471}, {0.98824, 0.56471, 0.56471}, {0.98824, 0.70588, 0.56471}, {0.98824, 0.84706, 0.56471}, {0.98824, 0.98824, 0.56471}, {0.98824, 0.00000, 0.70588}, {0.98824, 0.14118, 0.70588}, {0.98824, 0.28235, 0.70588}, {0.98824, 0.42353, 0.70588}, {0.98824, 0.56471, 0.70588}, {0.98824, 0.70588, 0.70588}, {0.98824, 0.84706, 0.70588}, {0.98824, 0.98824, 0.70588}, {0.98824, 0.00000, 0.84706}, {0.98824, 0.14118, 0.84706}, {0.98824, 0.28235, 0.84706}, {0.98824, 0.42353, 0.84706}, {0.98824, 0.56471, 0.84706}, {0.98824, 0.70588, 0.84706}, {0.98824, 0.84706, 0.84706}, {0.98824, 0.98824, 0.84706}, {0.98824, 0.00000, 0.98824}, {0.98824, 0.14118, 0.98824}, {0.98824, 0.28235, 0.98824}, {0.98824, 0.42353, 0.98824}, {0.98824, 0.56471, 0.98824}, {0.98824, 0.70588, 0.98824}, {0.98824, 0.84706, 0.98824}, {0.98824, 0.98824, 0.98824}, }; new ColorMapInfo("random6.lasc", random6_lasc); static RGBColor stairs9_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.19608, 0.19608, 0.19608}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.60784, 0.00000, 0.47451}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.78431, 0.00000, 0.00000}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.92549, 0.65490, 0.37255}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.56863, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 0.96471, 0.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 1.00000, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.69412, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, {0.00000, 0.00000, 1.00000}, }; new ColorMapInfo("stairs9.lasc", stairs9_lasc); static RGBColor idl5_lasc[] = { {0.00000, 0.00000, 0.00000}, {0.00000, 0.00000, 0.01961}, {0.00000, 0.00000, 0.03922}, {0.00000, 0.00000, 0.05882}, {0.00000, 0.00000, 0.07843}, {0.00000, 0.00000, 0.10196}, {0.00000, 0.00000, 0.12157}, {0.00000, 0.00000, 0.14118}, {0.00000, 0.00000, 0.16078}, {0.00000, 0.00000, 0.18039}, {0.00000, 0.00000, 0.20392}, {0.00000, 0.00000, 0.22353}, {0.00000, 0.00000, 0.24314}, {0.00000, 0.00000, 0.26275}, {0.00000, 0.00000, 0.28235}, {0.00000, 0.00000, 0.30588}, {0.00000, 0.00000, 0.32549}, {0.00000, 0.00000, 0.34510}, {0.00000, 0.00000, 0.36471}, {0.00000, 0.00000, 0.38431}, {0.00000, 0.00000, 0.40784}, {0.00000, 0.00000, 0.42745}, {0.00000, 0.00000, 0.44706}, {0.00000, 0.00000, 0.46667}, {0.00000, 0.00000, 0.48627}, {0.00000, 0.00000, 0.50980}, {0.00000, 0.00000, 0.52941}, {0.00000, 0.00000, 0.54902}, {0.00000, 0.00000, 0.56863}, {0.00000, 0.00000, 0.58824}, {0.00000, 0.00000, 0.61176}, {0.00000, 0.00000, 0.63137}, {0.00000, 0.00000, 0.65098}, {0.00000, 0.00000, 0.67059}, {0.00000, 0.00000, 0.69020}, {0.00000, 0.00000, 0.71373}, {0.00000, 0.00000, 0.73333}, {0.00000, 0.00000, 0.75294}, {0.00000, 0.00000, 0.77255}, {0.00000, 0.00000, 0.79216}, {0.00000, 0.00000, 0.81569}, {0.00000, 0.00000, 0.83529}, {0.00000, 0.00000, 0.85490}, {0.00000, 0.00000, 0.87451}, {0.00000, 0.00000, 0.89412}, {0.00000, 0.00000, 0.91765}, {0.00000, 0.00000, 0.93725}, {0.00000, 0.00000, 0.95686}, {0.01569, 0.00000, 0.97647}, {0.03529, 0.00000, 1.00000}, {0.05490, 0.00000, 0.98039}, {0.07451, 0.00000, 0.96078}, {0.09020, 0.00000, 0.93725}, {0.10980, 0.00000, 0.91765}, {0.12941, 0.00000, 0.89412}, {0.14902, 0.00000, 0.87451}, {0.16471, 0.00000, 0.85490}, {0.18431, 0.00000, 0.83137}, {0.20392, 0.00000, 0.81176}, {0.22353, 0.00000, 0.78824}, {0.23922, 0.00000, 0.76863}, {0.25882, 0.00000, 0.74510}, {0.27843, 0.00000, 0.72549}, {0.29804, 0.00000, 0.70588}, {0.31765, 0.00000, 0.68235}, {0.31765, 0.00000, 0.66275}, {0.31765, 0.00000, 0.63922}, {0.31765, 0.00000, 0.61961}, {0.31765, 0.00000, 0.59608}, {0.31765, 0.00000, 0.57647}, {0.31765, 0.00000, 0.55686}, {0.31765, 0.00000, 0.53333}, {0.31373, 0.00000, 0.51373}, {0.31373, 0.00000, 0.49020}, {0.31373, 0.00000, 0.47059}, {0.31373, 0.00000, 0.44706}, {0.31373, 0.00000, 0.42745}, {0.31373, 0.00000, 0.40784}, {0.31373, 0.00000, 0.38431}, {0.30980, 0.00000, 0.36471}, {0.32941, 0.00000, 0.34118}, {0.34902, 0.00000, 0.32157}, {0.36863, 0.00000, 0.29804}, {0.38824, 0.00000, 0.27843}, {0.40784, 0.00000, 0.25882}, {0.42745, 0.00000, 0.23529}, {0.44706, 0.00000, 0.21569}, {0.46667, 0.00000, 0.19216}, {0.48627, 0.00000, 0.17255}, {0.50588, 0.00000, 0.14902}, {0.52549, 0.00000, 0.12941}, {0.54510, 0.00000, 0.10980}, {0.56471, 0.00000, 0.08627}, {0.58431, 0.00000, 0.06667}, {0.60392, 0.00000, 0.04314}, {0.62353, 0.00000, 0.02353}, {0.64314, 0.00000, 0.00000}, {0.66275, 0.00000, 0.00000}, {0.68235, 0.00000, 0.00000}, {0.70588, 0.00000, 0.00000}, {0.72549, 0.00000, 0.00000}, {0.74510, 0.00000, 0.00000}, {0.76863, 0.00000, 0.00000}, {0.78824, 0.00000, 0.00000}, {0.80784, 0.00000, 0.00000}, {0.83137, 0.00000, 0.00000}, {0.85098, 0.00000, 0.00000}, {0.87059, 0.00000, 0.00000}, {0.89412, 0.00000, 0.00000}, {0.91373, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.00000, 0.00000}, {1.00000, 0.01961, 0.00000}, {1.00000, 0.03922, 0.00000}, {1.00000, 0.06275, 0.00000}, {1.00000, 0.08235, 0.00000}, {1.00000, 0.10588, 0.00000}, {1.00000, 0.12549, 0.00000}, {1.00000, 0.14510, 0.00000}, {1.00000, 0.16863, 0.00000}, {1.00000, 0.18824, 0.00000}, {1.00000, 0.21176, 0.00000}, {1.00000, 0.23137, 0.00000}, {1.00000, 0.25098, 0.00000}, {1.00000, 0.27451, 0.00000}, {1.00000, 0.29412, 0.00000}, {1.00000, 0.31765, 0.00000}, {1.00000, 0.33333, 0.01569}, {1.00000, 0.35294, 0.03529}, {1.00000, 0.37255, 0.05490}, {1.00000, 0.39216, 0.07451}, {1.00000, 0.41176, 0.09412}, {1.00000, 0.42745, 0.10980}, {1.00000, 0.44706, 0.12941}, {1.00000, 0.46667, 0.14902}, {1.00000, 0.48627, 0.16863}, {1.00000, 0.50588, 0.18824}, {1.00000, 0.52549, 0.20784}, {1.00000, 0.54118, 0.22353}, {1.00000, 0.56078, 0.24314}, {1.00000, 0.58039, 0.26275}, {1.00000, 0.60000, 0.28235}, {1.00000, 0.61961, 0.30196}, {1.00000, 0.63922, 0.32157}, {1.00000, 0.63922, 0.30196}, {1.00000, 0.63922, 0.27843}, {1.00000, 0.63922, 0.25490}, {1.00000, 0.63922, 0.23137}, {1.00000, 0.63922, 0.20784}, {1.00000, 0.63922, 0.18431}, {1.00000, 0.63922, 0.16078}, {1.00000, 0.63922, 0.14118}, {1.00000, 0.63922, 0.11765}, {1.00000, 0.63922, 0.09412}, {1.00000, 0.63922, 0.07059}, {1.00000, 0.63922, 0.04706}, {1.00000, 0.63922, 0.02353}, {1.00000, 0.63922, 0.00000}, {1.00000, 0.63922, 0.00000}, {1.00000, 0.63922, 0.00000}, {1.00000, 0.63922, 0.00000}, {0.97255, 0.63922, 0.00000}, {0.94118, 0.63922, 0.00000}, {0.90980, 0.63922, 0.00000}, {0.88235, 0.63922, 0.00000}, {0.85098, 0.63922, 0.00000}, {0.81961, 0.63922, 0.00000}, {0.79216, 0.63922, 0.00000}, {0.76078, 0.63922, 0.00000}, {0.72941, 0.63922, 0.00000}, {0.70196, 0.63922, 0.00000}, {0.67059, 0.63922, 0.00000}, {0.63922, 0.63922, 0.00000}, {0.65882, 0.63922, 0.00000}, {0.67843, 0.63922, 0.00000}, {0.69804, 0.66275, 0.01176}, {0.71765, 0.68627, 0.02353}, {0.73725, 0.70980, 0.03529}, {0.75686, 0.73333, 0.04706}, {0.77647, 0.75686, 0.06275}, {0.79608, 0.78039, 0.07451}, {0.81961, 0.80392, 0.08627}, {0.83922, 0.83137, 0.09804}, {0.85882, 0.85490, 0.11373}, {0.87843, 0.87843, 0.12549}, {0.89804, 0.90196, 0.13725}, {0.91765, 0.92549, 0.14902}, {0.93725, 0.94902, 0.16078}, {0.95686, 0.97255, 0.17647}, {0.97647, 1.00000, 0.18824}, {1.00000, 1.00000, 0.20000}, {1.00000, 1.00000, 0.21176}, {1.00000, 1.00000, 0.22745}, {1.00000, 1.00000, 0.23922}, {1.00000, 1.00000, 0.25098}, {1.00000, 1.00000, 0.26275}, {1.00000, 1.00000, 0.27843}, {1.00000, 1.00000, 0.29020}, {1.00000, 1.00000, 0.30196}, {1.00000, 1.00000, 0.31373}, {1.00000, 1.00000, 0.32549}, {1.00000, 1.00000, 0.34118}, {1.00000, 1.00000, 0.35294}, {1.00000, 1.00000, 0.36471}, {1.00000, 1.00000, 0.37647}, {1.00000, 1.00000, 0.39216}, {1.00000, 1.00000, 0.40392}, {1.00000, 1.00000, 0.41569}, {1.00000, 1.00000, 0.42745}, {1.00000, 1.00000, 0.43922}, {1.00000, 1.00000, 0.45490}, {1.00000, 1.00000, 0.46667}, {1.00000, 1.00000, 0.47843}, {1.00000, 1.00000, 0.49020}, {1.00000, 1.00000, 0.50588}, {1.00000, 1.00000, 0.51765}, {1.00000, 1.00000, 0.52941}, {1.00000, 1.00000, 0.54118}, {1.00000, 1.00000, 0.55686}, {1.00000, 1.00000, 0.56863}, {1.00000, 1.00000, 0.58039}, {1.00000, 1.00000, 0.59216}, {1.00000, 1.00000, 0.60392}, {1.00000, 1.00000, 0.61961}, {1.00000, 1.00000, 0.63137}, {1.00000, 1.00000, 0.64314}, {1.00000, 1.00000, 0.65490}, {1.00000, 1.00000, 0.67059}, {1.00000, 1.00000, 0.68235}, {1.00000, 1.00000, 0.69412}, {1.00000, 1.00000, 0.70588}, {1.00000, 1.00000, 0.71765}, {1.00000, 1.00000, 0.73333}, {1.00000, 1.00000, 0.74510}, {1.00000, 1.00000, 0.75686}, {1.00000, 1.00000, 0.76863}, {1.00000, 1.00000, 0.78431}, {1.00000, 1.00000, 0.79608}, {1.00000, 1.00000, 0.80784}, {1.00000, 1.00000, 0.81961}, {1.00000, 1.00000, 0.83529}, {1.00000, 1.00000, 0.84706}, {1.00000, 1.00000, 0.85882}, {1.00000, 1.00000, 0.87059}, {1.00000, 1.00000, 0.88235}, {1.00000, 1.00000, 0.89804}, {1.00000, 1.00000, 0.90980}, {1.00000, 1.00000, 0.92157}, {1.00000, 1.00000, 0.93333}, {1.00000, 1.00000, 0.94902}, {1.00000, 1.00000, 0.96078}, {1.00000, 1.00000, 0.97255}, {1.00000, 1.00000, 0.98431}, {1.00000, 1.00000, 1.00000}, }; new ColorMapInfo("idl5.lasc", idl5_lasc); static double expo_iasc[] = { 0.00458, 0.00689, 0.00920, 0.01152, 0.01386, 0.01620, 0.01855, 0.02091, 0.02328, 0.02565, 0.02804, 0.03044, 0.03285, 0.03526, 0.03769, 0.04012, 0.04257, 0.04502, 0.04748, 0.04996, 0.05244, 0.05493, 0.05743, 0.05995, 0.06247, 0.06500, 0.06754, 0.07010, 0.07266, 0.07523, 0.07781, 0.08041, 0.08301, 0.08562, 0.08824, 0.09088, 0.09352, 0.09618, 0.09884, 0.10152, 0.10420, 0.10690, 0.10960, 0.11232, 0.11505, 0.11779, 0.12054, 0.12330, 0.12607, 0.12885, 0.13164, 0.13445, 0.13726, 0.14009, 0.14293, 0.14578, 0.14863, 0.15151, 0.15439, 0.15728, 0.16019, 0.16310, 0.16603, 0.16897, 0.17192, 0.17488, 0.17786, 0.18084, 0.18384, 0.18685, 0.18987, 0.19290, 0.19595, 0.19900, 0.20207, 0.20515, 0.20824, 0.21135, 0.21447, 0.21760, 0.22074, 0.22389, 0.22706, 0.23024, 0.23343, 0.23663, 0.23985, 0.24308, 0.24632, 0.24957, 0.25284, 0.25612, 0.25942, 0.26272, 0.26604, 0.26937, 0.27272, 0.27608, 0.27945, 0.28283, 0.28623, 0.28964, 0.29307, 0.29651, 0.29996, 0.30342, 0.30690, 0.31039, 0.31390, 0.31742, 0.32095, 0.32450, 0.32806, 0.33164, 0.33523, 0.33883, 0.34245, 0.34608, 0.34973, 0.35339, 0.35707, 0.36076, 0.36446, 0.36818, 0.37191, 0.37566, 0.37942, 0.38320, 0.38699, 0.39080, 0.39462, 0.39846, 0.40231, 0.40618, 0.41006, 0.41396, 0.41788, 0.42180, 0.42575, 0.42971, 0.43368, 0.43767, 0.44168, 0.44570, 0.44974, 0.45379, 0.45786, 0.46195, 0.46605, 0.47017, 0.47430, 0.47845, 0.48262, 0.48680, 0.49100, 0.49522, 0.49945, 0.50370, 0.50797, 0.51225, 0.51655, 0.52087, 0.52520, 0.52955, 0.53392, 0.53830, 0.54270, 0.54712, 0.55156, 0.55601, 0.56048, 0.56497, 0.56948, 0.57400, 0.57855, 0.58311, 0.58768, 0.59228, 0.59689, 0.60153, 0.60618, 0.61085, 0.61553, 0.62024, 0.62496, 0.62970, 0.63447, 0.63925, 0.64404, 0.64886, 0.65370, 0.65855, 0.66343, 0.66832, 0.67323, 0.67817, 0.68312, 0.68809, 0.69308, 0.69809, 0.70312, 0.70817, 0.71324, 0.71833, 0.72344, 0.72856, 0.73371, 0.73888, 0.74407, 0.74928, 0.75451, 0.75977, 0.76504, 0.77033, 0.77564, 0.78098, 0.78633, 0.79171, 0.79711, 0.80253, 0.80797, 0.81343, 0.81891, 0.82442, 0.82994, 0.83549, 0.84106, 0.84665, 0.85226, 0.85790, 0.86356, 0.86924, 0.87494, 0.88066, 0.88641, 0.89218, 0.89797, 0.90379, 0.90963, 0.91549, 0.92137, 0.92728, 0.93321, 0.93916, 0.94514, 0.95114, 0.95716, 0.96321, 0.96928, 0.97538, 0.98150, 0.98764, 0.99381, 0.99888, 1.00000, 1.00000, }; new ITTInfo("expo.iasc", expo_iasc); static double null_iasc[] = { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, }; new ITTInfo("null.iasc", null_iasc); static double gamma_iasc[] = { 0.11285, 0.13544, 0.15416, 0.17045, 0.18502, 0.19831, 0.21059, 0.22206, 0.23284, 0.24304, 0.25275, 0.26202, 0.27090, 0.27945, 0.28768, 0.29564, 0.30334, 0.31081, 0.31807, 0.32513, 0.33201, 0.33872, 0.34526, 0.35167, 0.35793, 0.36406, 0.37007, 0.37596, 0.38173, 0.38741, 0.39298, 0.39846, 0.40385, 0.40915, 0.41437, 0.41952, 0.42458, 0.42957, 0.43449, 0.43935, 0.44414, 0.44887, 0.45353, 0.45814, 0.46270, 0.46720, 0.47165, 0.47604, 0.48039, 0.48469, 0.48894, 0.49315, 0.49732, 0.50144, 0.50552, 0.50957, 0.51357, 0.51754, 0.52146, 0.52536, 0.52922, 0.53304, 0.53683, 0.54059, 0.54432, 0.54801, 0.55168, 0.55531, 0.55892, 0.56250, 0.56605, 0.56958, 0.57307, 0.57655, 0.57999, 0.58342, 0.58681, 0.59019, 0.59354, 0.59686, 0.60017, 0.60345, 0.60671, 0.60995, 0.61317, 0.61637, 0.61955, 0.62271, 0.62584, 0.62896, 0.63206, 0.63515, 0.63821, 0.64126, 0.64429, 0.64730, 0.65029, 0.65327, 0.65623, 0.65918, 0.66211, 0.66502, 0.66792, 0.67080, 0.67367, 0.67652, 0.67936, 0.68218, 0.68499, 0.68778, 0.69057, 0.69333, 0.69609, 0.69883, 0.70156, 0.70427, 0.70697, 0.70966, 0.71234, 0.71501, 0.71766, 0.72030, 0.72293, 0.72555, 0.72815, 0.73075, 0.73333, 0.73591, 0.73847, 0.74102, 0.74356, 0.74609, 0.74861, 0.75112, 0.75361, 0.75610, 0.75858, 0.76105, 0.76351, 0.76596, 0.76840, 0.77083, 0.77325, 0.77566, 0.77806, 0.78046, 0.78284, 0.78522, 0.78759, 0.78994, 0.79229, 0.79464, 0.79697, 0.79929, 0.80161, 0.80392, 0.80622, 0.80851, 0.81079, 0.81307, 0.81534, 0.81760, 0.81985, 0.82210, 0.82434, 0.82657, 0.82879, 0.83101, 0.83322, 0.83542, 0.83762, 0.83980, 0.84198, 0.84416, 0.84633, 0.84849, 0.85064, 0.85279, 0.85493, 0.85706, 0.85919, 0.86131, 0.86343, 0.86553, 0.86764, 0.86973, 0.87182, 0.87391, 0.87598, 0.87806, 0.88012, 0.88218, 0.88424, 0.88628, 0.88833, 0.89036, 0.89239, 0.89442, 0.89644, 0.89845, 0.90046, 0.90246, 0.90446, 0.90645, 0.90844, 0.91042, 0.91240, 0.91437, 0.91634, 0.91830, 0.92025, 0.92221, 0.92415, 0.92609, 0.92803, 0.92996, 0.93189, 0.93381, 0.93572, 0.93763, 0.93954, 0.94144, 0.94334, 0.94523, 0.94712, 0.94901, 0.95088, 0.95276, 0.95463, 0.95649, 0.95836, 0.96021, 0.96206, 0.96391, 0.96576, 0.96760, 0.96943, 0.97126, 0.97309, 0.97491, 0.97673, 0.97854, 0.98035, 0.98216, 0.98396, 0.98576, 0.98755, 0.98934, 0.99113, 0.99291, 0.99469, 0.99646, 0.99823, 1.00000, 1.00000, 1.00000, }; new ITTInfo("gamma.iasc", gamma_iasc); static double equa_iasc[] = { 0.06275, 0.13725, 0.22353, 0.30196, 0.36078, 0.41176, 0.46275, 0.50588, 0.54510, 0.57647, 0.60392, 0.62745, 0.64706, 0.66275, 0.68235, 0.69412, 0.70588, 0.71765, 0.72941, 0.73725, 0.74510, 0.75686, 0.76471, 0.76863, 0.77647, 0.78039, 0.78824, 0.79216, 0.79608, 0.80000, 0.80392, 0.80784, 0.81176, 0.81569, 0.81961, 0.82353, 0.82745, 0.83137, 0.83529, 0.83922, 0.84314, 0.84314, 0.84706, 0.85098, 0.85490, 0.85882, 0.85882, 0.86275, 0.86667, 0.86667, 0.87059, 0.87451, 0.87451, 0.87843, 0.87843, 0.88235, 0.88235, 0.88627, 0.88627, 0.89020, 0.89020, 0.89412, 0.89412, 0.89804, 0.89804, 0.90196, 0.90196, 0.90588, 0.90588, 0.90980, 0.90980, 0.91373, 0.91373, 0.91765, 0.91765, 0.92157, 0.92157, 0.92549, 0.92549, 0.92941, 0.92941, 0.93333, 0.93333, 0.93725, 0.93725, 0.93725, 0.94118, 0.94118, 0.94510, 0.94510, 0.94510, 0.94902, 0.94902, 0.95294, 0.95294, 0.95294, 0.95686, 0.95686, 0.95686, 0.96078, 0.96078, 0.96078, 0.96471, 0.96471, 0.96471, 0.96471, 0.96863, 0.96863, 0.96863, 0.96863, 0.97255, 0.97255, 0.97255, 0.97255, 0.97255, 0.97255, 0.97647, 0.97647, 0.97647, 0.97647, 0.97647, 0.97647, 0.98039, 0.98039, 0.98039, 0.98039, 0.98039, 0.98039, 0.98039, 0.98039, 0.98039, 0.98039, 0.98431, 0.98431, 0.98431, 0.98431, 0.98431, 0.98431, 0.98431, 0.98431, 0.98431, 0.98431, 0.98431, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.98824, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99216, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 0.99608, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, }; new ITTInfo("equa.iasc", equa_iasc); static double stairs_iasc[] = { 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.00000, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.11765, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.17647, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.23529, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.29412, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.35294, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.41176, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.47059, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.52941, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.58824, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.64706, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.70588, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.76471, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.82353, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.88235, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 0.94118, 1.00000, 1.00000, }; new ITTInfo("stairs.iasc", stairs_iasc); static double jigsaw_iasc[] = { 0.00000, 0.01569, 0.03137, 0.04706, 0.06275, 0.07843, 0.09412, 0.10980, 0.12549, 0.14118, 0.15686, 0.17255, 0.18824, 0.20392, 0.21961, 0.23529, 0.25098, 0.26667, 0.28235, 0.29804, 0.31373, 0.33333, 0.34902, 0.36471, 0.38039, 0.39608, 0.41176, 0.42745, 0.44314, 0.45882, 0.47451, 0.49020, 0.50588, 0.52157, 0.53725, 0.55294, 0.56863, 0.58431, 0.60000, 0.61569, 0.63137, 0.64706, 0.66667, 0.68235, 0.69804, 0.71373, 0.72941, 0.74510, 0.76078, 0.77647, 0.79216, 0.80784, 0.82353, 0.83922, 0.85490, 0.87059, 0.88627, 0.90196, 0.91765, 0.93333, 0.94902, 0.96471, 0.98039, 0.99608, 0.00000, 0.01569, 0.03137, 0.04706, 0.06275, 0.07843, 0.09412, 0.10980, 0.12549, 0.14118, 0.15686, 0.17255, 0.18824, 0.20392, 0.21961, 0.23529, 0.25098, 0.26667, 0.28235, 0.29804, 0.31373, 0.33333, 0.34902, 0.36471, 0.38039, 0.39608, 0.41176, 0.42745, 0.44314, 0.45882, 0.47451, 0.49020, 0.50588, 0.52157, 0.53725, 0.55294, 0.56863, 0.58431, 0.60000, 0.61569, 0.63137, 0.64706, 0.66667, 0.68235, 0.69804, 0.71373, 0.72941, 0.74510, 0.76078, 0.77647, 0.79216, 0.80784, 0.82353, 0.83922, 0.85490, 0.87059, 0.88627, 0.90196, 0.91765, 0.93333, 0.94902, 0.96471, 0.98039, 0.99608, 0.00000, 0.01569, 0.03137, 0.04706, 0.06275, 0.07843, 0.09412, 0.10980, 0.12549, 0.14118, 0.15686, 0.17255, 0.18824, 0.20392, 0.21961, 0.23529, 0.25098, 0.26667, 0.28235, 0.29804, 0.31373, 0.33333, 0.34902, 0.36471, 0.38039, 0.39608, 0.41176, 0.42745, 0.44314, 0.45882, 0.47451, 0.49020, 0.50588, 0.52157, 0.53725, 0.55294, 0.56863, 0.58431, 0.60000, 0.61569, 0.63137, 0.64706, 0.66667, 0.68235, 0.69804, 0.71373, 0.72941, 0.74510, 0.76078, 0.77647, 0.79216, 0.80784, 0.82353, 0.83922, 0.85490, 0.87059, 0.88627, 0.90196, 0.91765, 0.93333, 0.94902, 0.96471, 0.98039, 0.99608, 0.00000, 0.01569, 0.03137, 0.04706, 0.06275, 0.07843, 0.09412, 0.10980, 0.12549, 0.14118, 0.15686, 0.17255, 0.18824, 0.20392, 0.21961, 0.23529, 0.25098, 0.26667, 0.28235, 0.29804, 0.31373, 0.33333, 0.34902, 0.36471, 0.38039, 0.39608, 0.41176, 0.42745, 0.44314, 0.45882, 0.47451, 0.49020, 0.50588, 0.52157, 0.53725, 0.55294, 0.56863, 0.58431, 0.60000, 0.61569, 0.63137, 0.64706, 0.66667, 0.68235, 0.69804, 0.71373, 0.72941, 0.74510, 0.76078, 0.77647, 0.79216, 0.80784, 0.82353, 0.83922, 0.85490, 0.87059, 0.88627, 0.90196, 0.91765, 0.93333, 0.94902, 0.96471, 0.98039, 0.99608, }; new ITTInfo("jigsaw.iasc", jigsaw_iasc); static double log_iasc[] = { 0.00000, 0.01961, 0.05490, 0.08627, 0.10980, 0.13725, 0.15686, 0.18039, 0.20000, 0.21569, 0.23529, 0.25098, 0.26275, 0.28235, 0.29412, 0.30588, 0.31765, 0.33333, 0.34118, 0.35294, 0.36078, 0.37255, 0.38431, 0.39216, 0.40000, 0.41176, 0.41961, 0.43137, 0.43529, 0.44314, 0.45098, 0.45882, 0.46667, 0.47059, 0.48235, 0.48627, 0.49412, 0.50196, 0.50588, 0.50980, 0.51765, 0.52157, 0.53333, 0.53725, 0.54118, 0.54902, 0.55294, 0.55686, 0.56078, 0.56471, 0.57255, 0.58039, 0.58431, 0.58824, 0.59216, 0.59608, 0.60000, 0.60392, 0.60784, 0.61176, 0.61569, 0.61961, 0.62745, 0.63137, 0.63529, 0.63922, 0.64314, 0.64706, 0.65098, 0.65490, 0.65490, 0.65882, 0.66275, 0.66667, 0.67059, 0.67843, 0.67843, 0.68235, 0.68627, 0.69020, 0.69020, 0.69412, 0.69804, 0.70196, 0.70196, 0.70588, 0.70980, 0.71373, 0.71373, 0.71765, 0.72157, 0.72157, 0.72941, 0.73333, 0.73333, 0.73725, 0.74118, 0.74118, 0.74510, 0.74510, 0.74902, 0.75294, 0.75294, 0.75686, 0.76078, 0.76078, 0.76471, 0.76471, 0.76863, 0.76863, 0.77255, 0.78039, 0.78039, 0.78431, 0.78431, 0.78824, 0.78824, 0.79216, 0.79216, 0.79608, 0.79608, 0.80000, 0.80000, 0.80392, 0.80392, 0.80784, 0.80784, 0.81176, 0.81176, 0.81569, 0.81569, 0.81961, 0.81961, 0.82745, 0.82745, 0.83137, 0.83137, 0.83529, 0.83529, 0.83922, 0.83922, 0.83922, 0.84314, 0.84314, 0.84706, 0.84706, 0.85098, 0.85098, 0.85490, 0.85490, 0.85490, 0.85882, 0.85882, 0.86275, 0.86275, 0.86275, 0.86667, 0.86667, 0.87059, 0.87059, 0.87059, 0.87843, 0.87843, 0.88235, 0.88235, 0.88235, 0.88627, 0.88627, 0.89020, 0.89020, 0.89020, 0.89412, 0.89412, 0.89412, 0.89804, 0.89804, 0.89804, 0.90196, 0.90196, 0.90588, 0.90588, 0.90588, 0.90980, 0.90980, 0.90980, 0.91373, 0.91373, 0.91373, 0.91765, 0.91765, 0.91765, 0.92157, 0.92157, 0.92157, 0.92941, 0.92941, 0.92941, 0.93333, 0.93333, 0.93333, 0.93725, 0.93725, 0.93725, 0.94118, 0.94118, 0.94118, 0.94118, 0.94510, 0.94510, 0.94510, 0.94902, 0.94902, 0.94902, 0.95294, 0.95294, 0.95294, 0.95686, 0.95686, 0.95686, 0.95686, 0.96078, 0.96078, 0.96078, 0.96471, 0.96471, 0.96471, 0.96471, 0.96863, 0.96863, 0.96863, 0.97255, 0.97255, 0.97255, 0.97255, 0.98039, 0.98039, 0.98039, 0.98039, 0.98431, 0.98431, 0.98431, 0.98824, 0.98824, 0.98824, 0.98824, 0.99216, 0.99216, 0.99216, 0.99216, 0.99608, 0.99608, 0.99608, 0.99608, 1.00000, 1.00000, 1.00000, }; new ITTInfo("log.iasc", log_iasc); static double lasritt_iasc[] = { 0.05882, 0.12157, 0.18431, 0.24706, 0.30980, 0.37255, 0.43529, 0.49804, 0.56078, 0.62353, 0.68627, 0.74902, 0.81176, 0.87451, 0.93725, 1.00000, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.12157, 0.12157, 0.12157, 0.12157, 0.12157, 0.12157, 0.12157, 0.12157, 0.18431, 0.18431, 0.18431, 0.18431, 0.18431, 0.18431, 0.18431, 0.18431, 0.24706, 0.24706, 0.24706, 0.24706, 0.24706, 0.24706, 0.24706, 0.24706, 0.30980, 0.30980, 0.30980, 0.30980, 0.30980, 0.30980, 0.30980, 0.30980, 0.37255, 0.37255, 0.37255, 0.37255, 0.37255, 0.37255, 0.37255, 0.37255, 0.43529, 0.43529, 0.43529, 0.43529, 0.43529, 0.43529, 0.43529, 0.43529, 0.49804, 0.49804, 0.49804, 0.49804, 0.49804, 0.49804, 0.49804, 0.49804, 0.56078, 0.56078, 0.56078, 0.56078, 0.56078, 0.56078, 0.56078, 0.56078, 0.62353, 0.62353, 0.62353, 0.62353, 0.62353, 0.62353, 0.62353, 0.62353, 0.68627, 0.68627, 0.68627, 0.68627, 0.68627, 0.68627, 0.68627, 0.68627, 0.74902, 0.74902, 0.74902, 0.74902, 0.74902, 0.74902, 0.74902, 0.74902, 0.81176, 0.81176, 0.81176, 0.81176, 0.81176, 0.81176, 0.81176, 0.81176, 0.87451, 0.87451, 0.87451, 0.87451, 0.87451, 0.87451, 0.87451, 0.87451, 0.93725, 0.93725, 0.93725, 0.93725, 0.93725, 0.93725, 0.93725, 0.93725, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.05882, 0.12157, 0.12157, 0.12157, 0.12157, 0.12157, 0.12157, 0.12157, 0.18431, 0.18431, 0.18431, 0.18431, 0.18431, 0.18431, 0.18431, 0.24706, 0.24706, 0.24706, 0.24706, 0.24706, 0.24706, 0.24706, 0.30980, 0.30980, 0.30980, 0.30980, 0.30980, 0.30980, 0.30980, 0.37255, 0.37255, 0.37255, 0.37255, 0.37255, 0.37255, 0.37255, 0.43529, 0.43529, 0.43529, 0.43529, 0.43529, 0.43529, 0.43529, 0.49804, 0.49804, 0.49804, 0.49804, 0.49804, 0.49804, 0.49804, 0.56078, 0.56078, 0.56078, 0.56078, 0.56078, 0.56078, 0.56078, 0.62353, 0.62353, 0.62353, 0.62353, 0.62353, 0.62353, 0.62353, 0.68627, 0.68627, 0.68627, 0.68627, 0.68627, 0.68627, 0.68627, 0.74902, 0.74902, 0.74902, 0.74902, 0.74902, 0.74902, 0.74902, 0.81176, 0.81176, 0.81176, 0.81176, 0.81176, 0.81176, 0.81176, 0.87451, 0.87451, 0.87451, 0.87451, 0.87451, 0.87451, 0.87451, 0.93725, 0.93725, 0.93725, 0.93725, 0.93725, 0.93725, 0.93725, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, }; new ITTInfo("lasritt.iasc", lasritt_iasc); static double ramp_iasc[] = { 0.00000, 0.00392, 0.00784, 0.01176, 0.01569, 0.01961, 0.02353, 0.02745, 0.03137, 0.03529, 0.03922, 0.04314, 0.04706, 0.05098, 0.05490, 0.05882, 0.06275, 0.06667, 0.07059, 0.07451, 0.07843, 0.08235, 0.08627, 0.09020, 0.09412, 0.09804, 0.10196, 0.10588, 0.10980, 0.11373, 0.11765, 0.12157, 0.12549, 0.12941, 0.13333, 0.13725, 0.14118, 0.14510, 0.14902, 0.15294, 0.15686, 0.16078, 0.16471, 0.16863, 0.17255, 0.17647, 0.18039, 0.18431, 0.18824, 0.19216, 0.19608, 0.20000, 0.20392, 0.20784, 0.21177, 0.21569, 0.21961, 0.22353, 0.22745, 0.23137, 0.23529, 0.23922, 0.24314, 0.24706, 0.25098, 0.25490, 0.25882, 0.26275, 0.26667, 0.27059, 0.27451, 0.27843, 0.28235, 0.28628, 0.29020, 0.29412, 0.29804, 0.30196, 0.30588, 0.30980, 0.31372, 0.31765, 0.32157, 0.32549, 0.32941, 0.33333, 0.33726, 0.34118, 0.34510, 0.34902, 0.35294, 0.35686, 0.36078, 0.36471, 0.36863, 0.37255, 0.37647, 0.38039, 0.38431, 0.38823, 0.39216, 0.39608, 0.40000, 0.40392, 0.40784, 0.41176, 0.41569, 0.41961, 0.42353, 0.42745, 0.43137, 0.43529, 0.43922, 0.44314, 0.44706, 0.45098, 0.45490, 0.45882, 0.46275, 0.46667, 0.47059, 0.47451, 0.47843, 0.48235, 0.48628, 0.49020, 0.49412, 0.49804, 0.50196, 0.50588, 0.50980, 0.51372, 0.51765, 0.52157, 0.52549, 0.52941, 0.53333, 0.53726, 0.54118, 0.54510, 0.54902, 0.55294, 0.55686, 0.56078, 0.56471, 0.56863, 0.57255, 0.57647, 0.58039, 0.58431, 0.58823, 0.59216, 0.59608, 0.60000, 0.60392, 0.60784, 0.61177, 0.61569, 0.61961, 0.62353, 0.62745, 0.63137, 0.63529, 0.63922, 0.64314, 0.64706, 0.65098, 0.65490, 0.65882, 0.66275, 0.66667, 0.67059, 0.67451, 0.67843, 0.68235, 0.68627, 0.69020, 0.69412, 0.69804, 0.70196, 0.70588, 0.70980, 0.71373, 0.71765, 0.72157, 0.72549, 0.72941, 0.73333, 0.73725, 0.74118, 0.74510, 0.74902, 0.75294, 0.75686, 0.76078, 0.76471, 0.76863, 0.77255, 0.77647, 0.78039, 0.78431, 0.78824, 0.79216, 0.79608, 0.80000, 0.80392, 0.80784, 0.81176, 0.81569, 0.81961, 0.82353, 0.82745, 0.83137, 0.83529, 0.83922, 0.84314, 0.84706, 0.85098, 0.85490, 0.85882, 0.86274, 0.86667, 0.87059, 0.87451, 0.87843, 0.88235, 0.88628, 0.89020, 0.89412, 0.89804, 0.90196, 0.90588, 0.90980, 0.91373, 0.91765, 0.92157, 0.92549, 0.92941, 0.93333, 0.93725, 0.94118, 0.94510, 0.94902, 0.95294, 0.95686, 0.96078, 0.96471, 0.96863, 0.97255, 0.97647, 0.98039, 0.98431, 0.98823, 0.99216, 0.99608, 1.00000, }; new ITTInfo("ramp.iasc", ramp_iasc); static double neglog_iasc[] = { 1.00000, 0.98039, 0.94510, 0.91373, 0.89020, 0.86275, 0.84314, 0.81961, 0.80000, 0.78431, 0.76471, 0.74902, 0.73725, 0.71765, 0.70588, 0.69412, 0.68235, 0.66667, 0.65882, 0.64706, 0.63922, 0.62745, 0.61569, 0.60784, 0.60000, 0.58824, 0.58039, 0.56863, 0.56471, 0.55686, 0.54902, 0.54118, 0.53333, 0.52941, 0.51765, 0.51373, 0.50588, 0.49804, 0.49412, 0.49020, 0.48235, 0.47843, 0.46667, 0.46275, 0.45882, 0.45098, 0.44706, 0.44314, 0.43922, 0.43529, 0.42745, 0.41961, 0.41569, 0.41176, 0.40784, 0.40392, 0.40000, 0.39608, 0.39216, 0.38824, 0.38431, 0.38039, 0.37255, 0.36863, 0.36471, 0.36078, 0.35686, 0.35294, 0.34902, 0.34510, 0.34510, 0.34118, 0.33725, 0.33333, 0.32941, 0.32157, 0.32157, 0.31765, 0.31373, 0.30980, 0.30980, 0.30588, 0.30196, 0.29804, 0.29804, 0.29412, 0.29020, 0.28627, 0.28627, 0.28235, 0.27843, 0.27843, 0.27059, 0.26667, 0.26667, 0.26275, 0.25882, 0.25882, 0.25490, 0.25490, 0.25098, 0.24706, 0.24706, 0.24314, 0.23922, 0.23922, 0.23529, 0.23529, 0.23137, 0.23137, 0.22745, 0.21961, 0.21961, 0.21569, 0.21569, 0.21176, 0.21176, 0.20784, 0.20784, 0.20392, 0.20392, 0.20000, 0.20000, 0.19608, 0.19608, 0.19216, 0.19216, 0.18824, 0.18824, 0.18431, 0.18431, 0.18039, 0.18039, 0.17255, 0.17255, 0.16863, 0.16863, 0.16471, 0.16471, 0.16078, 0.16078, 0.16078, 0.15686, 0.15686, 0.15294, 0.15294, 0.14902, 0.14902, 0.14510, 0.14510, 0.14510, 0.14118, 0.14118, 0.13725, 0.13725, 0.13725, 0.13333, 0.13333, 0.12941, 0.12941, 0.12941, 0.12157, 0.12157, 0.11765, 0.11765, 0.11765, 0.11373, 0.11373, 0.10980, 0.10980, 0.10980, 0.10588, 0.10588, 0.10588, 0.10196, 0.10196, 0.10196, 0.09804, 0.09804, 0.09412, 0.09412, 0.09412, 0.09020, 0.09020, 0.09020, 0.08627, 0.08627, 0.08627, 0.08235, 0.08235, 0.08235, 0.07843, 0.07843, 0.07843, 0.07059, 0.07059, 0.07059, 0.06667, 0.06667, 0.06667, 0.06275, 0.06275, 0.06275, 0.05882, 0.05882, 0.05882, 0.05882, 0.05490, 0.05490, 0.05490, 0.05098, 0.05098, 0.05098, 0.04706, 0.04706, 0.04706, 0.04314, 0.04314, 0.04314, 0.04314, 0.03922, 0.03922, 0.03922, 0.03529, 0.03529, 0.03529, 0.03529, 0.03137, 0.03137, 0.03137, 0.02745, 0.02745, 0.02745, 0.02745, 0.01961, 0.01961, 0.01961, 0.01961, 0.01569, 0.01569, 0.01569, 0.01176, 0.01176, 0.01176, 0.01176, 0.00784, 0.00784, 0.00784, 0.00784, 0.00392, 0.00392, 0.00392, 0.00392, 0.00000, 0.00000, 0.00000, }; new ITTInfo("neglog.iasc", neglog_iasc); static double neg_iasc[] = { 1.00000, 0.99608, 0.99216, 0.98824, 0.98431, 0.98039, 0.97647, 0.97255, 0.96863, 0.96471, 0.96078, 0.95686, 0.95294, 0.94902, 0.94510, 0.94118, 0.93725, 0.93333, 0.92941, 0.92549, 0.92157, 0.91765, 0.91373, 0.90980, 0.90588, 0.90196, 0.89804, 0.89412, 0.89020, 0.88627, 0.88235, 0.87843, 0.87451, 0.87059, 0.86667, 0.86275, 0.85882, 0.85490, 0.85098, 0.84706, 0.84314, 0.83922, 0.83529, 0.83137, 0.82745, 0.82353, 0.81961, 0.81569, 0.81176, 0.80784, 0.80392, 0.80000, 0.79608, 0.79216, 0.78824, 0.78431, 0.78039, 0.77647, 0.77255, 0.76863, 0.76471, 0.76078, 0.75686, 0.75294, 0.74902, 0.74510, 0.74118, 0.73725, 0.73333, 0.72941, 0.72549, 0.72157, 0.71765, 0.71373, 0.70980, 0.70588, 0.70196, 0.69804, 0.69412, 0.69020, 0.68627, 0.68235, 0.67843, 0.67451, 0.67059, 0.66667, 0.66275, 0.65882, 0.65490, 0.65098, 0.64706, 0.64314, 0.63922, 0.63529, 0.63137, 0.62745, 0.62353, 0.61961, 0.61569, 0.61176, 0.60784, 0.60392, 0.60000, 0.59608, 0.59216, 0.58824, 0.58431, 0.58039, 0.57647, 0.57255, 0.56863, 0.56471, 0.56078, 0.55686, 0.55294, 0.54902, 0.54510, 0.54118, 0.53725, 0.53333, 0.52941, 0.52549, 0.52157, 0.51765, 0.51373, 0.50980, 0.50588, 0.50196, 0.49804, 0.49412, 0.49020, 0.48627, 0.48235, 0.47843, 0.47451, 0.47059, 0.46667, 0.46275, 0.45882, 0.45490, 0.45098, 0.44706, 0.44314, 0.43922, 0.43529, 0.43137, 0.42745, 0.42353, 0.41961, 0.41569, 0.41176, 0.40784, 0.40392, 0.40000, 0.39608, 0.39216, 0.38824, 0.38431, 0.38039, 0.37647, 0.37255, 0.36863, 0.36471, 0.36078, 0.35686, 0.35294, 0.34902, 0.34510, 0.34118, 0.33725, 0.33333, 0.32941, 0.32549, 0.32157, 0.31765, 0.31373, 0.30980, 0.30588, 0.30196, 0.29804, 0.29412, 0.29020, 0.28627, 0.28235, 0.27843, 0.27451, 0.27059, 0.26667, 0.26275, 0.25882, 0.25490, 0.25098, 0.24706, 0.24314, 0.23922, 0.23529, 0.23137, 0.22745, 0.22353, 0.21961, 0.21569, 0.21176, 0.20784, 0.20392, 0.20000, 0.19608, 0.19216, 0.18824, 0.18431, 0.18039, 0.17647, 0.17255, 0.16863, 0.16471, 0.16078, 0.15686, 0.15294, 0.14902, 0.14510, 0.14118, 0.13725, 0.13333, 0.12941, 0.12549, 0.12157, 0.11765, 0.11373, 0.10980, 0.10588, 0.10196, 0.09804, 0.09412, 0.09020, 0.08627, 0.08235, 0.07843, 0.07451, 0.07059, 0.06667, 0.06275, 0.05882, 0.05490, 0.05098, 0.04706, 0.04314, 0.03922, 0.03529, 0.03137, 0.02745, 0.02353, 0.01961, 0.01569, 0.01176, 0.00784, 0.00392, 0.00000, }; new ITTInfo("neg.iasc", neg_iasc); } skycat-3.1.2-starlink-1b/rtd/generic/histdist.c000066400000000000000000000157661215713201500213600ustar00rootroot00000000000000#ifndef lint static char SccsId[] = "%W% %G%"; #endif /* Module: histdist.c (Histogram Equalize Distribute) * Subroutine: distribute_levels() returns: int * Copyright: 1989 Smithsonian Astrophysical Observatory * You may do anything you like with this file except remove * this copyright. The Smithsonian Astrophysical Observatory * makes no representations about the suitability of this * software for any purpose. It is provided "as is" without * express or implied warranty. * Modified: {0} Michael VanHilst initial version 30 May 1989 * {1} MVH fixed bug in range_zgroup 7 Dec 1989 * {n} -- -- */ #include #include "histeq.h" /* define SubrangeLink */ static int excess_zgroup(), excess_nzgroup(), range_zgroup(); /* * Subroutine: distribute_levels * Purpose: Distribute the levels among histogram sub-groups * Returns: number of groups with no assigned color levels */ int distribute_levels ( linklist, pixel_area, color_levels, pmin, pmax, ncolor ) SubrangeLink *linklist; int pixel_area, color_levels; int pmin, pmax, ncolor; { int average; int threshold; int excess; int levels, zeroes; int max_z_excess, max_nz_excess, max_z_range; SubrangeLink *subrange; #ifdef DEBUG int census = 0; #endif /* if all one group (no strong peaks), allocation is simple */ if( linklist->next == 0 ) { linklist->color_levels = ncolor; return( 0 ); } /* average is rounded strongly upward to be stingy with levels */ average = (pixel_area / color_levels) + 1; subrange = linklist; zeroes = 0; max_z_excess = max_nz_excess = 0; max_z_range = 0; /* first pass, simple assignment and some note taking */ while( subrange != 0 ) { if( subrange->range > 0 ) { levels = subrange->pixel_area / average; excess = subrange->pixel_area - (levels * average); if( levels >= subrange->range ) { levels = subrange->range; subrange->range = -subrange->range; } else { if( levels == 0 ) { zeroes++; if( excess > max_z_excess ) max_z_excess = excess; if( subrange->range > max_z_range ) max_z_range = subrange->range; } else { if( excess > max_nz_excess ) max_nz_excess = excess; } } subrange->color_levels = levels; subrange->excess_pixels = excess; color_levels -= levels; #ifndef DEBUG } #else census += levels; } else ++census; #endif subrange = subrange->next; } /* second pass groups with no levels and vals or ranges above limits */ if( zeroes > 0 ) { /* groups with counts above 1/4 of average */ threshold = average / 4; while( (zeroes > 0) && (color_levels > 0) && (max_z_excess > threshold) ) { if( excess_zgroup(linklist, &max_z_excess, &max_z_range, average) ) { zeroes--; color_levels--; #ifndef DEBUG } #else census++; } else (void)fprintf(stderr, "Failed to find excess zero.\n"); #endif } /* groups with range above 2 * unequalized distribution */ threshold = MAX(((pmax - pmin) / 8) , 4); while( (zeroes > 0) && (color_levels > 0) && (max_z_range > threshold) ) { if( range_zgroup(linklist, &max_z_excess, &max_z_range, average) ) { zeroes--; color_levels--; #ifndef DEBUG } #else census++; } else (void)fprintf(stderr, "Failed to find range zero.\n"); #endif } } /* third pass, give away any remaining levels by highest excess */ #ifdef DEBUG if( color_levels != (ncolor - census) ) { (void)fprintf(stderr, "Allocation waste: %d level(s)\n", (ncolor - census) - color_levels); } #endif while( color_levels > 0 ) { if( (zeroes > 0) && (max_z_excess > max_nz_excess) ) { if( excess_zgroup(linklist, &max_z_excess, &max_z_range, average) ) { zeroes--; color_levels--; } else { #ifdef DEBUG (void)fprintf(stderr, "Failed to find excess zero.\n"); #endif break; /* allan: break endless loop */ } } else { if( excess_nzgroup(linklist, &max_nz_excess, average) ) color_levels--; else { #ifdef DEBUG (void)fprintf(stderr, "Failed to find excess.\n"); #endif break; /* allan: break endless loop */ } } } return( zeroes ); } /* * Subroutine: excess_zgroup * Purpose: Find subrange with zero allotted levels and specified excess. * Assign it one level */ static int excess_zgroup ( subrange, excess, range, average ) SubrangeLink *subrange; int *excess, *range; int average; { int max_excess, looking; max_excess = -32700; looking = 1; while( subrange != 0 ) { if( (subrange->color_levels == 0) && (subrange->range > 0) ) { if( looking && (subrange->excess_pixels == *excess) ) { if( subrange->range > 1 ) { subrange->color_levels = 1; } else { subrange->color_levels = 1; subrange->range = -1; } subrange->excess_pixels -= average; looking = 0; } else { if( subrange->excess_pixels > max_excess ) max_excess = subrange->excess_pixels; if( subrange->range > *range ) *range = subrange->range; } } subrange = subrange->next; } *excess = max_excess; return( !looking ); } /* * Subroutine: range_zgroup * Purpose: Find group with zero allotted levels and specified range. * Assign it one level. */ static int range_zgroup (subrange, excess, range, average) SubrangeLink *subrange; int *excess, *range; int average; { int max_range, looking; max_range = 0; looking = 1; while( subrange != 0 ) { if( (subrange->color_levels == 0) && (subrange->range > 0) ) { if( looking && (subrange->range == *range) ) { if( subrange->range > 1 ) { subrange->color_levels = 1; } else { subrange->color_levels = 1; subrange->range = -1; } subrange->excess_pixels -= average; looking = 0; } else { if( subrange->excess_pixels > *excess ) *excess = subrange->excess_pixels; if( subrange->range > max_range ) max_range = subrange->range; } } subrange = subrange->next; } *range = max_range; return( !looking ); } /* * Subroutine: excess_nzgroup * Purpose: Find group with non-zero allotted levels and specified * excess value. Assign it one additional level. */ static int excess_nzgroup ( subrange, excess, average ) SubrangeLink *subrange; int *excess; int average; { int looking, max_excess; looking = 1; max_excess = -32767; while( subrange != 0 ) { if( (subrange->color_levels > 0) && (subrange->range > 1) ) { if( looking && (subrange->excess_pixels == *excess) && (subrange->color_levels < subrange->range) ) { subrange->color_levels += 1; subrange->excess_pixels -= average; if( subrange->color_levels == subrange->range ) { subrange->color_levels = subrange->range; subrange->range = -subrange->range; } else { if( subrange->excess_pixels > max_excess ) max_excess = subrange->excess_pixels; } looking = 0; } else { if( subrange->excess_pixels > max_excess ) max_excess = subrange->excess_pixels; } } subrange = subrange->next; } *excess = max_excess; return( !looking ); } skycat-3.1.2-starlink-1b/rtd/generic/histeq.h000066400000000000000000000044311215713201500210120ustar00rootroot00000000000000/* * histeq.h - saoimage header file for histogram equalization functions. * allan: added header, guard, includes, prototypes */ #ifndef _histeq_h_ #define _histeq_h_ #include #ifndef lint static char SccsHistEqId[] = "%W% %G%"; #endif /* Module: HistEq.h * Purpose: Define the structs for histogram equalization * Modified: {0} Michael VanHilst initial version 30 May 1989 * {1} Peter W. Draper converted to use unsigned 20 Jan 1999 * long for scalemap * {n} -- -- */ #ifndef MAX #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #endif /* link describes a section of the histogram to have levels allocated */ typedef struct histogramLink { int low; /* index of lowest histogram entry */ int high; /* index of highest histogram entry */ int range; /* number of histogram entries covered */ int nz_entries; /* number of non-zero histogram entries */ int pixel_area; /* number of image pixels within range */ int max_entry; /* largest area for any single entry */ int excess_pixels; /* pixel area in excess of average */ int color_levels; /* number of color levels allocated */ struct histogramLink *next; /* link list pointer */ int pad; } SubrangeLink; /* list describing details of color level allocation for a histogram range */ typedef struct histogramList { int pixel_area; /* pixel area that is covered by this color level */ int first, last; /* first and last histogram entries cor this color */ int pad; int shrink_area; /* area covered by omitting last non-zero entry */ int shrink_entry; /* index for last to excude last non-zero entry */ int stretch_area; /* area covered by including next non-zero entry */ int stretch_entry; /* index for last to include next non-zero entry */ } SubrangeList; /* allan: added prototype */ void histogram_equalize ( unsigned long *scalemap, /* i/o: scalemap (for signed indexing) */ int *histogram, /* i: histogram (for signed indexing) */ int area, /* i: area in pixels when histogram was made */ int pmin, int pmax, /* i: min and max values in histogram */ int color_levels, /* i: number of levels in color map */ unsigned long *pixels); /* i: map to hardware entries */ #endif /* _histeq_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/histeql.c000066400000000000000000000134551215713201500211670ustar00rootroot00000000000000#ifndef lint static char SccsId[] = "%W% %G%"; #endif /* Module: histeql.c (Histogram Equalize) * Purpose: Fill the scalemap by histogram equalization * Subroutine: histogram_equalize() returns: void * Copyright: 1989 Smithsonian Astrophysical Observatory * You may do anything you like with this file except remove * this copyright. The Smithsonian Astrophysical Observatory * makes no representations about the suitability of this * software for any purpose. It is provided "as is" without * express or implied warranty. * Modified: {0} Michael VanHilst initial version 30 May 1989 * {1} Peter W. Draper converted to use unsigned 20 Jan 1999 * long for scalemap * {n} -- -- */ #include #include "histeq.h" /* define SubrangeLink */ static int count_nonzero_histogram_entries(), rescan_histogram(); static void unmark_peak_links(); /* * Subroutine: histogram_equalize * Purpose: Create a scaling map which equalizes image cells per * output level optimization accounts for large cell counts * for single levels (e.g. half of all pixels with value 0) */ void histogram_equalize ( scalemap, histogram, area, pmin, pmax, color_levels, pixels ) unsigned long *scalemap; /* i/o: scalemap (for signed indexing) */ int *histogram; /* i: histogram (for signed indexing) */ int area; /* i: area in pixels when histogram was made */ int pmin, pmax; /* i: min and max values in histogram */ int color_levels; /* i: number of levels in color map */ unsigned long *pixels; /* i: map to hardware entries */ { SubrangeLink *linklist; /* l: beginning of subrange linklist */ int average_area; /* l: average area covered by each level */ int pixel_area; int map_levels; int nz_entries; /* l: non-zero entries in histogram */ int empties; /* l: subranges with no alloted levels */ char *calloc_errchk(); int distribute_levels(); void generate_scalemap(), scan_histogram_for_peaks(), resolve_zeroes(); /* initialize link list */ linklist = (SubrangeLink *)calloc_errchk(10, sizeof(int), "HElink"); linklist->next = 0; linklist->low = pmin; linklist->high = pmax; linklist->range = (pmax - pmin) + 1; linklist->pixel_area = area; linklist->max_entry = 0; /* if not enough non-zero entries to make distribution, bypass work */ nz_entries = count_nonzero_histogram_entries(histogram, pmin, pmax); if( nz_entries <= color_levels ) { linklist->color_levels = color_levels; linklist->nz_entries = nz_entries; generate_scalemap(histogram, linklist, scalemap, pixels); return; } /* initialize count and level variables */ pixel_area = area; map_levels = color_levels; /* desired number of pixels at each level */ /* average is rounded strongly upward to be stingy with levels */ average_area = (pixel_area / map_levels) + 1; /* go through histogram seeking histogram entries above the map mean */ scan_histogram_for_peaks(linklist, histogram, &pixel_area, &map_levels, &average_area); /* repeat scans until no more treetops emerge */ while( rescan_histogram(linklist, histogram, &pixel_area, &map_levels, &average_area) != 0 ); /* allocate levels */ empties = distribute_levels(linklist, pixel_area, map_levels, pmin, pmax, color_levels); /* make peak and valley links look the same (peaks have range 1) */ unmark_peak_links(linklist, color_levels); if( empties > 0 ) { resolve_zeroes(linklist, empties); } /* make map and free memory */ generate_scalemap(histogram, linklist, scalemap, pixels); } /* * Subroutine: rescan_histogram * Purpose: Repeat scanning for large count levels as saturation level * is modified. Repeats until all large count levels are * marked and residual is stable * Returns: 1 if a range was modified, 0 if nothing was changed */ static int rescan_histogram ( subrange, histogram, pixel_area, map_levels, average_area ) SubrangeLink *subrange; int *histogram; int *pixel_area; int *map_levels; int *average_area; { int process; void scan_histogram_for_peaks(); process = 0; while( subrange != 0 ) { /* if subrange has values that exceed current average */ if( (subrange->range > 1) && (subrange->max_entry >= *average_area) ) { scan_histogram_for_peaks(subrange, histogram, pixel_area, map_levels, average_area); /* indicate that additional processing has taken place */ process = 1; } subrange = subrange->next; } return( process ); } /* * Subroutine: unmark_peak_links * Purpose: Make singularity links non_uniquely marked (range > 0) and * check count against reference * Called by: histogram_equalize() above */ static void unmark_peak_links ( subrange, nlevels ) SubrangeLink *subrange; int nlevels; { #ifdef DEBUG int levels = 0; #endif while( subrange != 0 ) { if( subrange->range <0 ) { subrange->range = -subrange->range; } #ifdef DEBUG if( (subrange->next != 0) && (subrange->next->low != (subrange->high + 1)) ) (void)fprintf(stderr, "Missing Link in list.\n"); if( subrange->color_levels > subrange->range ) (void)fprintf(stderr, "Excess levels in a Link.\n"); levels += subrange->color_levels; #endif subrange = subrange->next; } #ifdef DEBUG if( levels != nlevels ) { (void)fprintf(stderr, "Levels = %d\n",levels); } #endif } /* * Subroutine: count_nonzero_histogram_entries * Called by: histogram_equalize() in HistEqual.c */ static int count_nonzero_histogram_entries ( histogram, pmin, pmax ) register int *histogram; int pmin; register int pmax; { register int i, npix; npix = 0; for( i = pmin; i <= pmax; i++ ) { if( histogram[(ushort)i] > 0 ) /* allan: added ushort cast */ ++npix; } return( npix ); } skycat-3.1.2-starlink-1b/rtd/generic/histlist.c000066400000000000000000000365121215713201500213600ustar00rootroot00000000000000#ifndef lint static char SccsId[] = "%W% %G%"; #endif /* Module: histlist.c (Histogram List) * Subroutine: make_equalized_list() returns: void * Copyright: 1989 Smithsonian Astrophysical Observatory * You may do anything you like with this file except remove * this copyright. The Smithsonian Astrophysical Observatory * makes no representations about the suitability of this * software for any purpose. It is provided "as is" without * express or implied warranty. * Modified: {0} Michael VanHilst initial version 30 May 1989 * {1} MVH constraints based on best history 15 Dec 1989 * {2} JRW limit to get out of infinite loop 19 Jun 1991 * {n} -- -- */ #include #include "histeq.h" /* define SubrangeList */ #define MAXITERATIONS 1000 /* --jrw */ #ifdef DEBUG #define HDEBUG #endif static int equalize_simply(); #ifdef JIGGLE static void adjust_list(); #endif /* * Subroutine: make_equalized_list * Purpose: Distributing levels for a subrange section of the histogram */ void make_equalized_list ( histogram, list, low_entry, high_entry, pixel_area, color_levels ) int *histogram; SubrangeList *list; int low_entry, high_entry; int pixel_area, color_levels; { int shrink_level, stretch_level; int max_shrink, min_stretch; int average_area, end_area, min_area, max_area; int levels_given; /* levels which equalize_simply used */ int correction; /* correction for asymptotic convergence */ int iterations; /* avoid infinite loop --jrw */ int end_error; /* deviation from ideal of last level */ int best_levels_over; /* levels from an equalize worth remembering */ int best_levels_under; int best_average_over = 0; /* average_area used to get best_levels */ int best_average_under = 0; /* else allocation distribution must first be determined */ /* run through histgram section making basic allocation and taking notes */ average_area = pixel_area / color_levels; max_area = max_shrink = 0; min_area = min_stretch = pixel_area + 1; /* use 2*color_levels to allow allocation to exceed limit */ levels_given = equalize_simply(histogram, list, 0, average_area, low_entry, high_entry, color_levels + color_levels, &shrink_level, &stretch_level, &end_area, &min_area, &max_area, &min_stretch, &max_shrink); if( levels_given != color_levels ) { /* make approximation for large errors */ correction = ((color_levels - levels_given) * average_area) / -100; /* default correction if error was relatively small */ if( (correction < 2) && (correction > -2) ) { if( color_levels > levels_given ) correction = -2; else correction = 2; } /* record what has been learned so far */ if( levels_given > color_levels ) { best_levels_over = levels_given; best_average_over = average_area; } else { best_levels_under = levels_given; best_average_under = average_area; } } else /* if first try was good enough, go with it */ correction = 0; end_error = 0; iterations = 0; /* --jrw */ while( (correction != 0) && (iterations++ < MAXITERATIONS) ) { /* --jrw */ average_area += correction; levels_given = equalize_simply(histogram, list, 0, average_area, low_entry, high_entry, color_levels + color_levels, &shrink_level, &stretch_level, &end_area, &min_area, &max_area, &min_stretch, &max_shrink); if( levels_given != color_levels ) { if( levels_given > color_levels ) { /* is this the closest overshoot */ if( (best_average_over == 0) || (levels_given < best_levels_over) ) { best_levels_over = levels_given; best_average_over = average_area; } if( correction < 0 ) { /* went too far, turn back if that is an option */ if( (correction == -1) && (end_error == 0) ) /* done if we never got to a true result */ correction = 0; else /* asymtotic correction to converge on solution */ correction = (correction - 1) / -2; } else if( (best_average_under != 0) && (best_average_under <= (average_area + correction)) ) /* if continue in same direction, don't pass previous best */ correction = (best_average_under - average_area) - 1; } else { /* is this the closest undershoot */ if( (best_average_under == 0) || (levels_given < best_levels_under) ) { best_levels_under = levels_given; best_average_under = average_area; } if( correction > 0 ) { if( (correction == 1) && (end_error == 0) ) /* done if we never got to a true result */ correction = 0; else /* asymtotic correction to converge on solution */ correction = (correction + 1) / -2; } else if( (best_average_over != 0) && (best_average_over <= (average_area + correction)) ) /* if continue in same direction, don't pass previous best */ correction = (best_average_over - average_area) + 1; } } else if( (end_area > max_area) || (end_area < min_area) ) { if( correction < -16 ) correction = -16; else if( correction > 16 ) correction = 16; if( end_area > average_area ) { if( correction < 0 ) { /* this is an overshoot */ correction = correction / -2; if( (end_error == 0) || ((end_area - average_area) > end_error) ) { /* go back if we might do better */ if( correction == 0 ) correction = 1; } end_error = end_area - average_area; } } else { if( correction > 0 ) { /* this is an overshoot */ correction = correction / -2; if( (end_error == 0) || ((average_area - end_area) > end_error) ) { /* go back if we might do better */ if( correction == 0 ) correction = -1; } end_error = average_area - end_area; } } } else correction = 0; } #if 0 if (correction != 0) { (void)printf("SAOimage: histeq could not converge on best distribution,"); (void)printf(" proceeding anyway\n"); (void)fflush(stdout); } #endif /* if no fit yet, force one by making last level stretch */ if( (levels_given != color_levels) && (best_average_over != 0) ) { levels_given = equalize_simply(histogram, list, 0, best_average_over, low_entry, high_entry, color_levels, &shrink_level, &stretch_level, &end_area, &min_area, &max_area, &min_stretch, &max_shrink); } #ifdef JIGGLE /* This section to directly adjust level boundaries for a better fit * is experimental. It is not currently used, because the improvement * is not important relative to the processing time that can occur * in non-stable situations. In some situations, such as when * levels != color_levels coming out of the previous loop, a few * passes could yield worthwhile improvements. */ #ifdef HDEBUG (void)printf("Before adjustment: %d (between: %d %d), end: %d\n", max_area - min_area, min_area, max_area, end_area); (void)fflush(stdout); #endif /* jiggle the allocations for a better fit (reduce maximum error) */ if( (end_area > max_area) && (end_area > min_stretch) ) { /* bunch toward the end to make it smaller */ while( (end_area > max_area) && (end_area > min_stretch) ) { average_area = min_stretch; adjust_list(1, histogram, list, color_levels, low_entry, high_entry, average_area, &stretch_level, &shrink_level, &end_area, &min_area, &max_area, &min_stretch, &max_shrink); } } else if( (end_area < min_area) && (end_area < max_shrink) ) { /* bunch away from the end to make it bigger */ while( (end_area < min_area) && (end_area < max_shrink) ) { average_area = max_shrink; adjust_list(0, histogram, list, color_levels, low_entry, high_entry, average_area, &stretch_level, &shrink_level, &end_area, &min_area, &max_area, &min_stretch, &max_shrink); } } #ifdef HDEBUG (void)printf("After adjustment: %d (between: %d %d), end: %d\n", max_area - min_area, min_area, max_area, end_area); (void)fflush(stdout); #endif #endif } /* * Subroutine: equalize_simply * Purpose: Make a list to describe map using basic allocation method * Note: Allocate levels from "level" to "color_levels" */ static int equalize_simply ( histogram, histlist, level, average_area, low_entry, high_entry, color_levels, shrink_level, stretch_level, end_area, min_area, max_area, min_stretch, max_shrink ) int *histogram; SubrangeList *histlist; int level, average_area; int low_entry, high_entry; int color_levels; int *shrink_level, *stretch_level; int *end_area, *min_area, *max_area; int *min_stretch, *max_shrink; { int entry, neighbor_entry; int area, old_area; int err_low, err_high; int init_next; /* initialize parameters */ init_next = 0; area = 0; histlist[level].first = low_entry; /* reduce by one for indexing to end on last list level */ color_levels--; /* in this pass, assign levels by simple method */ for( entry = low_entry; entry <= high_entry; entry++ ) { if( init_next ) { ++level; histlist[level].first = entry; area = 0; init_next = 0; } old_area = area; area += histogram[(ushort)entry]; /* allan: added ushort cast */ /* while levels last, scan till exceed average area */ if( (level < color_levels) && (area >= average_area) ) { err_low = average_area - old_area; err_high = area - average_area; if( err_high < err_low ) { /* err to excess */ histlist[level].last = entry; histlist[level].pixel_area = area; /* shrink option would be to exclude this entry */ histlist[level].shrink_area = old_area; histlist[level].shrink_entry = entry - 1; /* look for next non-zero entry to include for stretch option */ neighbor_entry = entry; do { ++neighbor_entry; } while( (neighbor_entry <= high_entry) && (histogram[(ushort)neighbor_entry] == 0) ); /* allan: added ushort cast */ if( neighbor_entry > high_entry ) { /* if at high end, exagerate to preclude this option */ histlist[level].stretch_area = 10 * area; histlist[level].stretch_entry = high_entry; } else { histlist[level].stretch_area = area + histogram[(ushort)neighbor_entry]; /* allan: added ushort cast */ histlist[level].stretch_entry = neighbor_entry; } } else { /* err short */ /* exclude this entry */ neighbor_entry = entry - 1; histlist[level].last = neighbor_entry; histlist[level].pixel_area = old_area; /* including this entry is the stretch option */ histlist[level].stretch_area = area; histlist[level].stretch_entry = entry; /* look for previous non-zero entry for shrink option (check limit) */ while( (neighbor_entry >= low_entry) && (histogram[(ushort)neighbor_entry] == 0) ) /* allan: added ushort cast */ --neighbor_entry; if( neighbor_entry < low_entry ) { /* if at low end, preclude this option */ histlist[level].shrink_area = 0; histlist[level].shrink_entry = low_entry; } else { histlist[level].shrink_area = old_area - histogram[(ushort)neighbor_entry]; /* allan: added ushort cast */ histlist[level].shrink_entry = neighbor_entry - 1; } /* leave this entry for the next level */ --entry; } /* check for new champions of excess */ if( histlist[level].pixel_area < *min_area ) *min_area = histlist[level].pixel_area; if( histlist[level].pixel_area > *max_area ) *max_area = histlist[level].pixel_area; if( histlist[level].stretch_area <= *min_stretch ) { *min_stretch = histlist[level].stretch_area; *stretch_level = level; } if( histlist[level].shrink_area >= *max_shrink ) { *max_shrink = histlist[level].shrink_area; *shrink_level = level; } init_next = 1; } } /* mark end of list (level should be last one (color_levels - 1)) */ histlist[level].pixel_area = area; *end_area = area; histlist[level].last = entry - 1; return( level + 1 ); } #ifdef JIGGLE /* * Subroutine: adjust_list * Purpose: Alter a level of the map and remake section above altered level */ static void adjust_list ( stretch_this_entry, histogram, histlist, color_levels, low_entry, high_entry, average_area, stretch_level, shrink_level, end_area, min_area, max_area, min_stretch, max_shrink ) int stretch_this_entry; /* i: stretch an entry, else shrink one */ int *histogram; SubrangeList *histlist; int color_levels; int low_entry, high_entry, average_area; int *shrink_level, *stretch_level; int *end_area, *min_area, *max_area; int *min_stretch, *max_shrink; { int level, j, neighbor_entry; int equalize_simply(); /* make an adjustment */ if( stretch_this_entry ) { /* stretch an entry */ level = *stretch_level; /* shrink returns to what it was */ histlist[level].shrink_area = histlist[level].pixel_area; histlist[level].shrink_entry = histlist[level].last; /* current was stretch option before */ histlist[level].pixel_area = histlist[level].stretch_area; histlist[level].last = histlist[level].stretch_entry; /* find the next non-zero entry for the new stretch option */ neighbor_entry = histlist[level].last; do { ++neighbor_entry; } while( (neighbor_entry <= high_entry) && (histogram[(ushort)neighbor_entry] == 0) ); /* allan: added ushort cast */ if( neighbor_entry > high_entry ) { /* don't go off the edge */ histlist[level].stretch_area *= 10; histlist[level].stretch_entry = high_entry; } else { histlist[level].stretch_area += histogram[(ushort)neighbor_entry]; /* allan: added ushort cast */ histlist[level].stretch_entry = neighbor_entry; } } else { /* shrink an entry */ level = *shrink_level; /* stretch option becomes what it was */ histlist[level].stretch_area = histlist[level].pixel_area; histlist[level].stretch_entry = histlist[level].last; /* current was shrink option before */ histlist[level].last = histlist[level].shrink_entry; histlist[level].pixel_area = histlist[level].shrink_area; /* look for last non-zero entry to exclude for new shrink option */ neighbor_entry = histlist[level].last; while( (neighbor_entry >= low_entry) && (histogram[(ushort)neighbor_entry] == 0) ) /* allan: added ushort cast */ --neighbor_entry; if( neighbor_entry < low_entry ) { /* don't go off the edge */ histlist[level].shrink_area = 0; histlist[level].shrink_entry = low_entry; } else { histlist[level].shrink_area -= histogram[(ushort)neighbor_entry]; /* allan: added ushort cast */ histlist[level].shrink_entry = neighbor_entry - 1; } } /* remake list with this change */ *min_area = *min_stretch = average_area * 3; *max_shrink = *max_area = 0; /* retake notes up to point of change */ for( j = 0; j <= level; j++ ) { if( histlist[j].pixel_area < *min_area ) *min_area = histlist[j].pixel_area; if( histlist[j].pixel_area > *max_area ) *max_area = histlist[j].pixel_area; if( histlist[j].stretch_area <= *min_stretch ) { *min_stretch = histlist[j].stretch_area; *stretch_level = j; } if( histlist[j].shrink_area >= *max_shrink ) { *max_shrink = histlist[j].shrink_area; *shrink_level = j; } } if( (level < color_levels) && (histlist[level].last < high_entry) ) /* make rest of list in normal way */ (void)equalize_simply(histogram, histlist, j, average_area, histlist[level].last + 1, high_entry, color_levels, shrink_level, stretch_level, end_area, min_area, max_area, min_stretch, max_shrink); } #endif skycat-3.1.2-starlink-1b/rtd/generic/histmap.c000066400000000000000000000173021215713201500211560ustar00rootroot00000000000000#ifndef lint static char SccsId[] = "%W% %G%"; #endif /* Module: histmap.c (Histogram Map) * Subroutine: make_HE_scalemap() returns: int * Copyright: 1989 Smithsonian Astrophysical Observatory * You may do anything you like with this file except remove * this copyright. The Smithsonian Astrophysical Observatory * makes no representations about the suitability of this * software for any purpose. It is provided "as is" without * express or implied warranty. * Modified: {0} Michael VanHilst initial version 30 May 1989 * {1} Peter W. Draper converted to use unsigned 20 Jan 1999 * long for scalemap * {n} -- -- */ #include #include #include "histeq.h" /* define SubrangeLink, List */ static void make_subrange_scalemap(); static void make_gapped_list(), list_to_map(); static int first_shortlist_pass(); static void add_level_to_short_list(); /* * Subroutine: generate_scalemap * Purpose: Make scalemap, applying standard histgoram equalization * one subrange group at a time * Note: Value range was broken into groups with an assigned number * of levels for each group. Each group is either a single * value or a range of values with no excessive peaks, such that * standard (non-optimizing) histogram equaliztion algorithm can * safely be applied. * Note: The original link-list of groups is freed. */ void generate_scalemap ( hist, subrange, scalemap, pixels ) int *hist; /* i: histogram (for signed offsets) */ SubrangeLink *subrange; /* i: linklist of subranges */ unsigned long *scalemap; /* i: scalemap (for signed indexing) */ unsigned long *pixels; /* i: map to hardware entries */ { int baselevel; SubrangeLink *trash; baselevel = 0; while( subrange != 0 ) { make_subrange_scalemap(hist, subrange, scalemap, baselevel, pixels); if( subrange->color_levels > 0 ) baselevel += subrange->color_levels; trash = subrange; subrange = subrange->next; free((char *)trash); } } /* * Subroutine: make_subrange_scalemap * Purpose: Make a section of scale map using histgroup link as guide * Called by: make_HE_scalemap() in HistEqual.c */ static void make_subrange_scalemap ( histogram, subrange, scalemap, baselevel, pixels ) int *histogram; SubrangeLink *subrange; unsigned long *scalemap; /* scalemap (for signed indexing) */ int baselevel; unsigned long *pixels; /* i: map to hardware entries */ { int i, color_levels; SubrangeList *list; unsigned long dispval; char *calloc_errchk(); void make_equalized_list(); /* if only one level, make map section */ if( subrange->color_levels <= 1 ) { dispval = pixels[baselevel]; for( i = subrange->low; i <= subrange->high; i++ ) { scalemap[(ushort)i] = dispval; /* allan: added ushort cast */ } return; } color_levels = subrange->color_levels; /* allocate excess space as initial efforts may overshoot number of levels */ list = (SubrangeList *) calloc_errchk(2 * color_levels, sizeof(SubrangeList), "HistList"); /* if normal processing will not work, choose special */ if( color_levels < subrange->nz_entries ) { make_equalized_list(histogram, list, subrange->low, subrange->high, subrange->pixel_area, color_levels); } else { make_gapped_list(histogram, list, subrange->low, subrange->high, color_levels); } #ifdef DEBUG /* check work done */ if( list[color_levels - 1].last != subrange->high ) { (void)fprintf(stderr, "ERROR: histogram list not right\n"); (void)fprintf(stderr, "levels: %d, list: %d, link: %d\n", color_levels, list[color_levels - 1].last, subrange->high); } #endif /* make section of map as defined by list */ list_to_map(scalemap, list, baselevel, color_levels, pixels); /* free the list space */ free( (char *)list ); } /* * Subroutine: list_to_map * Purpose: Make section of map as defined by list * Called by: make_subrange_scalemap() above */ static void list_to_map ( scalemap, histlist, baselevel, levels, pixels ) unsigned long *scalemap; /* scalemap (for signed indexing) */ SubrangeList *histlist; int baselevel, levels; unsigned long *pixels; /* i: map to hardware entries */ { int i, level; int first, last, imageval; unsigned long dispval; level = baselevel; for( i = 0; i < levels; i++ ) { first = histlist[i].first; last = histlist[i].last; dispval = pixels[level]; for( imageval = first; imageval <= last; imageval++ ) { scalemap[(ushort)imageval] = dispval; /* allan: added ushort cast */ } level++; } } /* * Subroutine: make_gapped_list * Purpose: Allocate levels for a histogram subrange. Special process * for situation when more levels than actually used values. */ static void make_gapped_list ( histogram, list, low, high, levels ) int *histogram; SubrangeList *list; int low, high, levels; { int range_j, max_range; int levels_used; levels_used = first_shortlist_pass(histogram, list, low, high, levels, &max_range, &range_j); while( levels_used < levels ) { add_level_to_short_list(list, levels_used - 1, &max_range, &range_j); ++levels_used; } } /* * Subroutine: first_shortlist_pass * Purpose: Make a list to describe map allocation using special * allocation method. Fill the list with each entry ending * at the next actually used value. */ static int first_shortlist_pass ( histogram, list, low_entry, high_entry, levels, max_range, range_j ) int *histogram; SubrangeList *list; int low_entry, high_entry, levels; int *range_j, *max_range; { int i, area, level; /* initialize parameters (index starts at 0) */ level = 0; area = 0; *max_range = -1; list[level].first = low_entry; /* first pass, assign levels by simple method */ for( i = low_entry; i <= high_entry; i++ ) { area += histogram[(ushort)i]; /* allan: added ushort cast */ /* while levels last, scan till value which is used */ if( (area > 0) || (i == high_entry) ) { list[level].last = i; list[level].pixel_area = area; list[level].shrink_entry = (i - list[level].first) + 1; /* find the lowest entry with the highest range */ if( list[level].shrink_entry > *max_range ) { *max_range = list[level].shrink_entry; *range_j = level; } if( i < high_entry ) { /* start for next group */ list[++level].first = i + 1; #ifdef DEBUG if( level > levels ) { (void)fprintf(stderr, "Actual exceeds levels\n"); level--; } #endif } else if (level >= levels) { list[level - 1].last = i; } area = 0; } } return( level+1 ); } /* * Subroutine: add_level_to_short_list */ static void add_level_to_short_list ( list, top, max_range, range_j ) SubrangeList *list; int top; int *max_range, *range_j; { int i, j, mark; mark = *range_j; *max_range = -1; for( i = top, j = top + 1; j > mark; i--, j-- ) { list[j].first = list[i].first; list[j].last = list[i].last; list[j].pixel_area = list[i].pixel_area; list[j].shrink_entry = list[i].shrink_entry; /* find the lowest entry with the highest range */ if( list[j].shrink_entry >= *max_range ) { *max_range = list[j].shrink_entry; *range_j = j; } } i++; j++; list[i].last = list[i].first + ((list[i].shrink_entry / 2) - 1); list[j].first = list[i].last + 1; list[i].pixel_area = 0; list[i].shrink_entry = (list[i].last - list[i].first) + 1; list[j].shrink_entry = (list[j].last - list[j].first) + 1; for( ; j >= 0; j-- ) { /* find the lowest entry with the highest range */ if( list[j].shrink_entry >= *max_range ) { *max_range = list[j].shrink_entry; *range_j = j; } } } skycat-3.1.2-starlink-1b/rtd/generic/histscan.c000066400000000000000000000114351215713201500213260ustar00rootroot00000000000000#ifndef lint static char SccsId[] = "%W% %G%"; #endif /* Module: histscan.c (Histogram Scan) * Subroutine: scan_histogram_for_peaks() returns: void * Copyright: 1989 Smithsonian Astrophysical Observatory * You may do anything you like with this file except remove * this copyright. The Smithsonian Astrophysical Observatory * makes no representations about the suitability of this * software for any purpose. It is provided "as is" without * express or implied warranty. * Modified: {0} Michael VanHilst initial version 30 May 1989 * {n} -- -- */ #include "histeq.h" static SubrangeLink *get_new_subrange_record(); static void fill_subrange_record(); /* * Subroutine: scan_histogram_for_peaks * Purpose: Scan the image histogram picking out large cell count values * make sub-groups of the histogram between the large count levels */ void scan_histogram_for_peaks ( subrange, histogram, pixel_area, map_levels, average ) SubrangeLink *subrange; /* i/o: link (initially covers range) */ int *histogram; /* i: histogram (for signed index) */ int *pixel_area; /* i/o: number of pixels to account for */ int *map_levels; /* i/o: number of levels left to map */ int *average; /* i/o: average pixels per color map level */ { int i; int scan_end; /* l: end of subrange in histogram */ int scan_start; /* l: histogram entry after last peak */ int pixel_count; /* l: number of pixels at histogram entry */ int sr_nzentries; /* l: number of non-zero entries in subrange */ int sr_pixel_area; /* l: number of pixels in current subrange */ int sr_max_peak; /* l: highest peak within current subrange */ /* set initial pixel_count values */ sr_pixel_area = 0; sr_nzentries = 0; sr_max_peak = 0; scan_start = subrange->low; scan_end = subrange->high; /* run through values in histogram mapping excessive entries */ for( i = scan_start; i <= scan_end; i++ ) { pixel_count = histogram[(ushort)i]; /* allan: added ushort cast */ /* if this pixel value alone is enough for one level, mark it */ if( pixel_count >= *average ) { /* take this count out of equalization distribution */ *pixel_area -= pixel_count; *map_levels -= 1; /* compute new average, (peaks in prior range will be rechecked later */ if( *map_levels > 0 ) *average = (*pixel_area / *map_levels) + 1; /* make a subrange between peaks if there was a valley & get new link */ if( i > scan_start ) { fill_subrange_record(subrange, scan_start, i - 1, i - scan_start, sr_nzentries, sr_pixel_area, sr_max_peak); subrange = get_new_subrange_record(subrange); } /* make a subrange of one for this peak */ fill_subrange_record(subrange, i, i, -1, 1, pixel_count, pixel_count); subrange->color_levels = 1; /* if entries remain, put them in a subrange */ if (i < scan_end) { subrange = get_new_subrange_record(subrange); fill_subrange_record(subrange, i + 1, scan_end, scan_end - i, 0, 0, 0); } /* reset scan values */ sr_pixel_area = 0; sr_nzentries = 0; sr_max_peak = 0; scan_start = i + 1; } else { /* update scan values */ if( pixel_count > 0 ) { sr_pixel_area += pixel_count; ++sr_nzentries; if( pixel_count > sr_max_peak ) sr_max_peak = pixel_count; } } } /* mark the final group */ if( scan_start < scan_end ) { fill_subrange_record(subrange, scan_start, scan_end, (scan_end - scan_start) + 1, sr_nzentries, sr_pixel_area, sr_max_peak); } } /* * Subroutine: get_new_subrange_record * Purpose: Create a new link in histogram link list, after one given * Returns: Pointer to new subrange link */ static SubrangeLink *get_new_subrange_record ( old_link ) SubrangeLink *old_link; { SubrangeLink *new_link; char *calloc_errchk(); /* create new record for histogram link list */ new_link = (SubrangeLink *) calloc_errchk(1, sizeof(SubrangeLink), "histeq link"); new_link->next = old_link->next; old_link->next = new_link; new_link->color_levels = 0; new_link->excess_pixels = 0; return( new_link ); } /* * Subroutine: fill_subrange_record * Purpose: Set parameters in subrange link list record */ static void fill_subrange_record ( link, low, high, range, nz_entries, pixel_area, max_entry ) SubrangeLink *link; int low, high; /* i: first and last index in histogram */ int range; /* i: span of histogram entries */ int nz_entries; /* i: non-zero entries in range */ int pixel_area; /* i: sum of histogram entry values (pixels) */ int max_entry; /* i: highest histogram entry value */ { link->low = low; link->high = high; link->range = range; link->nz_entries = nz_entries; link->pixel_area = pixel_area; link->max_entry = max_entry; } skycat-3.1.2-starlink-1b/rtd/generic/histzero.c000066400000000000000000000064001215713201500213550ustar00rootroot00000000000000#ifndef lint static char SccsId[] = "%W% %G%"; #endif /* Module: histzero.c (Histogram Zero) * Subroutine: resolve_zeroes() returns: void * Copyright: 1989 Smithsonian Astrophysical Observatory * You may do anything you like with this file except remove * this copyright. The Smithsonian Astrophysical Observatory * makes no representations about the suitability of this * software for any purpose. It is provided "as is" without * express or implied warranty. * Modified: {0} Michael VanHilst initial version 30 May 1989 * {n} -- -- */ #include #include #include "histeq.h" /* define SubrangeLink */ static void merge_links(); /* * Subroutine: resolve_zeroes * Purpose: Combine groups with zero alloted levels with adjoining groups * Note: Adjoining groups are large count single level groups * Called by: histrogram_equalize() above */ void resolve_zeroes ( PriorLink, zeroes ) SubrangeLink *PriorLink; int zeroes; { SubrangeLink *ThisLink, *NextLink; int a_count, b_count, z1count, z2count; /* if very first entry is a zero allocated link */ if( PriorLink->color_levels == 0 ) { /* merge this and next */ merge_links(PriorLink); zeroes--; } /* scan for the zero allocated links */ while( zeroes > 0 ) { ThisLink = PriorLink->next; #ifdef DEBUG /* if reached the end of the list, we had an error */ if( ThisLink == 0 ) { (void)fprintf(stderr,"Zero error\n"); return; } #endif /* if we are about to hit a zero */ if( ThisLink->color_levels == 0 ) { /* if it is the last zero merge with prior */ NextLink = ThisLink->next; if( NextLink == 0 ) { merge_links(PriorLink); return; } a_count = PriorLink->pixel_area; b_count = NextLink->pixel_area; /* if the preceding link is smaller than the trailing link */ if( a_count > b_count ) { merge_links(PriorLink); zeroes--; } else { /* probe beyond */ if( NextLink->next != 0 ) { if( NextLink->next->color_levels != 0 ) { /* if new competition, merge with next link */ merge_links(ThisLink); zeroes--; } else { z1count = ThisLink->pixel_area; z2count = NextLink->next->pixel_area; /* where would the next one go? */ if( (NextLink->next->next == 0) || (NextLink->next->next->pixel_area > (b_count + z2count)) ) { if( (b_count + z2count) > (a_count + z1count) ) { merge_links(PriorLink); } else { merge_links(ThisLink); } } else merge_links(ThisLink); zeroes--; } } else { merge_links(PriorLink); zeroes--; } } } PriorLink = ThisLink; } } /* * Subroutine: merge_links * Purpose: Combine two links of histogram group list */ static void merge_links ( subrange ) SubrangeLink *subrange; { SubrangeLink *lostlink; lostlink = subrange->next; subrange->next = lostlink->next; subrange->max_entry = MAX(subrange->max_entry, lostlink->max_entry); subrange->pixel_area += lostlink->pixel_area; subrange->high = lostlink->high; subrange->range += lostlink->range; subrange->nz_entries += lostlink->nz_entries; subrange->excess_pixels += lostlink->excess_pixels; subrange->color_levels += lostlink->color_levels; free( (char *)lostlink ); } skycat-3.1.2-starlink-1b/rtd/generic/iqefunc.c000066400000000000000000000533251215713201500211500ustar00rootroot00000000000000/*=========================================================================== Copyright (C) 1995 European Southern Observatory (ESO) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. Correspondence concerning ESO-MIDAS should be addressed as follows: Internet e-mail: midas@eso.org Postal address: European Southern Observatory Data Management Division Karl-Schwarzschild-Strasse 2 D 85748 Garching bei Muenchen GERMANY ===========================================================================*/ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .COPYRIGHT (c) 1996 European Southern Observatory .IDENT iqefunc.c .LANGUAGE C .AUTHOR P.Grosbol, IPG/ESO .KEYWORDS Image Quality Estimate, PSF .PURPOSE Routines for Image Quality Estimate holds iqe, iqebgv, iqemnt, iqesec, iqefit .VERSION 1.0 1995-Mar-16 : Creation, PJG .VERSION 1.1 1995-Jun-22 : Correct derivatives in 'g2efunc', PJG .VERSION 1.2 1996-Dec-03 : Code clean-up, PJG 000427 ------------------------------------------------------------------------*/ #include /* Standard ANSI-C library */ #include /* Mathematical definitions */ #include static double hsq2 = 0.7071067811865475244; /* constant 0.5*sqrt(2) */ #define MA 6 /* No. of variables */ #define MITER 64 /* Max. no. of iterations */ static float *pval; static float *pwght; static int mx, mp, winsize; static double w[9]; static double xi[9]; static double yi[9]; /* */ int iqe(pfm, pwm, mx, my, parm, sdev) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .PURPOSE Estimate parameters for the Image Quality using a small frame around the object. The following parameters are estimated and given in the array 'parm': parm[0] = mean X position within array, first pixel = 0 parm[1] = FWHM in X parm[2] = mean Y position within array, first pixel = 0 parm[3] = FWHM in Y parm[4] = angle of major axis, degrees, along X = 0 parm[5] = peak value of object above background parm[6] = mean background level Further, estimates of the standard deviation of the parameters are given in 'sdev'. The routine is just a sequence of calls to 'iqebgv', 'iqemnt', 'iqesec' and 'iqefit'. .RETURN status, 0: OK, <0: estimate failed, ------------------------------------------------------------------------*/ float *pfm; float *pwm; int mx; int my; float *parm; float *sdev; { int n, err, nbg; int iqebgv(), iqemnt(), iqesec(), iqefit(); float bgv, bgs, s2f, r2d; float ap[6], cv[6], est[6], sec[6]; s2f = 2.0*sqrt(2.0*log(2.0)); /* Sigma to FWHM constant */ r2d = 45.0/atan(1.0); /* Radian to Degrees */ for (n=0; n<7; n++) parm[n] = sdev[n] = 0.0; winsize = (mx * my) - 1; /* size of sub window */ if ((err=iqebgv(pfm, pwm, mx, my, &bgv, &bgs, &nbg))) return -1; parm[6] = bgv; sdev[6] = bgs; if ((err=iqemnt(pfm, pwm, mx, my, bgv, bgs, est))) return -2; parm[0] = est[1]; parm[1] = s2f*est[2]; parm[2] = est[3]; parm[3] = s2f*est[4]; parm[5] = est[0]; if ((err=iqesec(pfm, pwm, mx, my, bgv, est, sec))) return -3; parm[4] = r2d*sec[5]; if ((err=iqefit(pfm, pwm, mx, my, bgv, sec, ap, cv))<0) return -4; parm[0] = ap[1]; sdev[0] = cv[1]; parm[1] = s2f*ap[2]; sdev[1] = s2f*cv[2]; parm[2] = ap[3]; sdev[2] = cv[3]; parm[3] = s2f*ap[4]; sdev[3] = s2f*cv[4]; parm[4] = fmod(r2d*ap[5]+180.0, 180.0); sdev[4] = r2d*cv[5]; if (sdev[4] > 180.) sdev[4] = 180.0; /* max is: Pi */ parm[5] = ap[0]; sdev[5] = cv[0]; return 0; } /* */ int iqebgv(pfm, pwm, mx, my, bgm, bgs, nbg) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .PURPOSE Estimate background level for subimage .RETURN status, 0: OK, -1:no buffer space, -2: no points left ------------------------------------------------------------------------*/ float *pfm; float *pwm; int mx; int my; float *bgm; float *bgs; int *nbg; { int n, m, ns, ms, nt, mt; float *pfb, *pwb, *pf, *pw; float *pf0, *pf1, *pf2, *pf3, *pfs0, *pfs1, *pfs2, *pfs3; float *pw0, *pw1, *pw2, *pw3, *pws0, *pws1, *pws2, *pws3; double val, fks, ba, bm, bs; void hsort(); *bgm = 0.0; *bgs = 0.0; *nbg = 0; pfs0 = pfm; pfs1 = pfm + mx - 1; pfs2 = pfm + mx*(my-1); pfs3 = pfm + mx*my - 1; if (pwm) { pws0 = pwm; pws1 = pwm + mx - 1; pws2 = pwm + mx*(my-1); pws3 = pwm + mx*my - 1; } ns = (mx winsize)) return -99; if (pwm) pw = pwm + ioff; if ((!pwm) || (pwm && 0.0<*pw)) { val = *pf - bgv; am = val; ax = val*x; ay = val*y; axx = val*x*x; ayy = val*y*y; axy = val*x*y; nt++; } else am = ax = ay = axx = ayy = axy = 0.0; ki = ks = kn = 1; while (n--) { k = kn; if (!ki && ks==-1) { if (nx) nx = 0; else break; } ioff = (ki) ? ks : ks*mx; while (k--) { if (ki) x += ks; else y += ks; if (x<0.0 || y<0.0 || xm winsize)) break; if (pwm) pw += ioff; val = *pf - bgv; if ( (dv winsize)) break; dx = x - xc; dy = y - yc; r = sqrt(dx*dx + dy*dy); if (rl winsize)) return -99; pf = pfb; pw = pwb; iy = ny; if (pwm) { pwm += nxs + mx*nys; while (iy--) { ix = nx; while (ix--) { *pf++ = *pfm++ - bgv; psize = pfm - pfmo; if (psize > winsize) return -99; if (0.0<*pwm) *pw++ = *pwm++; else *pw++ = 1.0; } pfm += mx - nx; psize = pfm - pfmo; if ((psize < 0) || (psize > winsize)) return -99; pwm += mx - nx; } } else { while (iy--) { ix = nx; while (ix--) { *pf++ = *pfm++ - bgv; psize = pfm - pfmo; if (psize > winsize) return -99; *pw++ = 1.0; } pfm += mx - nx; psize = pfm - pfmo; if ((psize < 0) || (psize > winsize)) return -99; } } /* initialize parameters for fitting */ ap[0] = est[0]; ap[1] = est[1] - nxs; ap[2] = est[2]; ap[3] = est[3] - nys; ap[4] = est[4]; ap[5] = est[5]; /* perform actual 2D Gauss fit on small subimage */ n = g2efit(pfb, pwb, nx, ny, ap, cm, &chi); /* normalize parameters and uncertainties, and exit */ ap[1] += nxs; ap[3] += nys; free(pfb); return n; } /* */ int g2einit(val, wght, nx, ny) /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .PURPOSE Initiate gauss fit function, set pointers to data and weights .RETURN status, 0: OK, -1: error - bad pixel no. ------------------------------------------------------------------------*/ float *val; float *wght; int nx; int ny; { double fh, w1, w2, w3; if (nx<1) { /* if NO x-pixel set to NULL */ pval = (float *) 0; pwght = (float *) 0; mx = mp = 0; return -1; } pval = val; /* otherwise initiate static varables */ pwght = wght; mx = nx; mp = (0 #include void defineRtdBitmaps(Tcl_Interp *interp) { #include "double_left.xbm" Tk_DefineBitmap(interp, Tk_GetUid("double_left"), (char*)double_left_bits, double_left_width, double_left_height); #include "record.xbm" Tk_DefineBitmap(interp, Tk_GetUid("record"), (char*)record_bits, record_width, record_height); #include "big_right.xbm" Tk_DefineBitmap(interp, Tk_GetUid("big_right"), (char*)big_right_bits, big_right_width, big_right_height); #include "Right.xbm" Tk_DefineBitmap(interp, Tk_GetUid("Right"), (char*)Right_bits, Right_width, Right_height); #include "rect.xbm" Tk_DefineBitmap(interp, Tk_GetUid("rect"), (char*)rect_bits, rect_width, rect_height); #include "double_right.xbm" Tk_DefineBitmap(interp, Tk_GetUid("double_right"), (char*)double_right_bits, double_right_width, double_right_height); } skycat-3.1.2-starlink-1b/rtd/generic/rtd_remote.c000066400000000000000000000252731215713201500216630ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: rtd_remote.c,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * rtdRemote.c - client library for remote control of an RtdImage * widget, communicates over a socket with a remote * rtdimage widget. See rtdimage/src/RtdRemote.C * for the server side. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/03/96 Created * Peter W. Draper 09/02/98 Removed sys_errlist and replaced with strerror. * pbiereic 07/04/04 Fixed: variable argument list * Allan Brighton 02/01/06 Renamed rtdRemote.c to rtd_remote.c to avoid * name conflict on file systems that ignore case */ static const char* const rcsId="@(#) $Id: rtd_remote.c,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "rtd_remote.h" /* -- private interface -- */ /* local struct allocated to manage the client's connection */ typedef struct { int socket; /* socket connection with display */ int pid; /* pid of display on host */ char host[64]; /* hostname where dsplay is running */ int port; /* port number to use on host */ char errmsg[10240]; /* copy of last error message */ /* optional error handler, to be called with error message */ RtdRemoteErrorHandler errhandler; } rtdRemote; /* note: compiler initializes static data to all 0's, K&R */ static rtdRemote info; /* this struct holds local info */ /* -- local error routines -- */ /* * Report the error, syntax like printf. * The error message is kept in a local buffer and can be retrieved * with rtdRemoteGetError(). */ static int error(const char *fmt, ...) { va_list args; char buf[sizeof(info.errmsg)]; va_start(args, fmt); vsprintf(buf, fmt, args); va_end(args); strcpy(info.errmsg, buf); if (info.errhandler) (*info.errhandler)(buf); return 1; } /* * report the error, including system error code */ static int sys_error(const char *fmt, ...) { va_list args; char buf[sizeof(info.errmsg)]; #ifndef errno extern int errno; #endif va_start(args, fmt); vsprintf(buf, fmt, args); va_end(args); strcat(buf, ": "); strcat(buf, strerror(errno)); strcpy(info.errmsg, buf); if (info.errhandler) (*info.errhandler)(buf); return 1; } /* -- I/O routines for network I/O taken from the book -- * "UNIX Network Programming" by W. Richard Stevens, */ /* * Read "n" bytes from a descriptor. * Use in place of read() when fd is a stream socket. */ static int readn(int fd, char* ptr, int nbytes) { int nleft, nread; nleft = nbytes; while (nleft > 0) { nread = read(fd, ptr, nleft); if (nread < 0) return(nread); /* error, return < 0 */ else if (nread == 0) break; /* EOF */ nleft -= nread; ptr += nread; } return(nbytes - nleft); /* return >= 0 */ } /* * Write "n" bytes to a descriptor. * Use in place of write() when fd is a stream socket. */ static int writen(int fd, char* ptr, unsigned long nbytes) { int nleft, nwritten; nleft = nbytes; while (nleft > 0) { nwritten = write(fd, ptr, nleft); if (nwritten <= 0) return(nwritten); /* error */ nleft -= nwritten; ptr += nwritten; } return(nbytes - nleft); } /* * Read the line one byte at a time, looking for the newline. We store * the newline in the buffer, then follow it with a null (the same as * fgets(3)). Not very efficient but usefull for sockets. * * Returns the number of characters up to, but not including, the null * (the same as strlen(3)) or < 0 upon errors. */ static int readline(int fd, char* ptr, int maxlen) { int n, rc; char c; for (n = 1; n < maxlen; n++) { if ( (rc = read(fd, &c, 1)) == 1) { *ptr++ = c; if (c == '\n') break; } else if (rc == 0) { if (n == 1) return(0); /* EOF, no data read */ else break; /* EOF, some data was read */ } else return(-1); /* error */ } *ptr = 0; return(n); } /* * write the given buffer to the given file followed by a newline */ static int writeline(int fd, char* ptr) { return writen(fd, ptr, strlen(ptr)) + writen(fd, "\n", 1); } /* -- other routines -- */ /* * read the ~/.rtd-remote file to get the pid, hostname and port number * of the RTD, if it is running (check that it is running...) */ static int getRtdInfo() { char filename[1024]; char* home = getenv("HOME"); FILE* f; char hostname[64]; sprintf(filename, "%s/.rtd-remote", (home ? home : "/tmp")); f = fopen(filename, "r"); if (!f) return error("can't open status file: %s, is the display application running?", filename); if (fscanf(f, "%u %s %u", &info.pid, info.host, &info.port) != 3) return error("error in Rtd status file: %s", filename); fclose(f); if (kill(info.pid, 0) != 0 || (gethostname(hostname, sizeof(hostname)) == 0 && strcmp(hostname, info.host) != 0)) return error("display application may not be running on this host?"); return 0; } /* -- public interface -- */ /* * write the command to the rtdimage socket and return 0 if all is * OK, otherwise 1. "cmd" should not contain a newline, it will be * added here. */ int rtdRemoteSendOnly(char* cmd) { if (writeline(info.socket, cmd) <= 0) return sys_error("error sending command to RTD"); return 0; } /* * open a connection to a currently running Rtd Display. The pid, hostname * and port number, if not specified (set to 0) are read from the file * $HOME/.rtd-remote, which is created by the Rtd on startup * (see rtdimage/src/RtdRemote.C). * * The return value is 0 for success, 1 for error. The error text * can be retrieved with rtdRemoteGetError(). */ int rtdRemoteConnect(int pid, char* host, int port) { struct hostent *hp; /* pointer to host info */ struct sockaddr_in addr; /* for peer socket address */ if (pid && host && port) { info.pid = pid; strncpy(info.host, host, sizeof(info.host)); info.port = port; } else if (getRtdInfo() != 0) /* get pid, hostname, port from ~/.rtd-remote file */ return 1; /* clear out address */ memset ((char *)&addr, 0, sizeof(struct sockaddr_in)); /* Set up the peer address to which we will connect. */ addr.sin_family = AF_INET; /* Get the host information for the rtd display */ hp = gethostbyname (info.host); if (hp == NULL) return sys_error("gethostbyname"); addr.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr; addr.sin_port = htons(info.port); /* Create the socket. */ info.socket = socket(AF_INET, SOCK_STREAM, 0); if (info.socket == -1) return sys_error("socket"); /* Try to connect to the remote Rtd display */ if (connect(info.socket, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1) return sys_error("connect"); return 0; } /* * disconnect from the Rtd display */ void rtdRemoteDisconnect() { if (info.socket != -1) { close(info.socket); info.socket = -1; } } /* * set a routine to be called with the text of error messages * when they occur. The argument is a pointer to an error * handler: * * void errhandler(char* msg); * * The return value is a pointer to the previous error handler, or NULL, * if none was defined. */ RtdRemoteErrorHandler rtdRemoteSetErrorHandler(RtdRemoteErrorHandler errhandler) { RtdRemoteErrorHandler old_handler = info.errhandler; info.errhandler = errhandler; return old_handler; } /* * Return the text of the most recent error message. * */ char* rtdRemoteGetError() { return info.errmsg; } /* * read the socket with the answer from the last command sent to the * remote RtdImage display and return the command's status. The command's * result is returned in the "result" argument, which points to local or * static storage. * * The format of the message read from the socket is: * * status length\n * msg[length] * * where status is 0 (OK) or 1 and length is the length of the result that follows. */ int rtdRemoteGetResult(int sock, char** result) { static char buf[1024]; /* use to hold results up to 1024 bytes */ static char* rbuf = buf; /* may be allocated with malloc if needed */ static int rbufsize = sizeof(buf) - 1; int status; /* return status of command */ int length; /* length of result */ if (result) *result = rbuf; buf[0] = '\0'; /* default to empty result */ if (readline(sock, buf, sizeof(buf)) <= 0) return sys_error("error reading result status from rtdimage"); if (sscanf(buf, "%d %d", &status, &length) != 2) return error("unknown result from rtdimage"); if (length == 0) return status; /* empty result */ if (length < 0) return error("bad length received from display application"); if (length >= rbufsize) { /* use static storage or malloc ? */ if (rbufsize != sizeof(buf)) free(rbuf); rbuf = (char*)malloc(rbufsize=length+10); if (!rbuf) { rbuf = buf; rbufsize = sizeof(buf); return error("rtdRemote: could not allocate %d bytes for result", length); } if (result) *result = rbuf; } if (readn(sock, rbuf, length) != length) return sys_error("error reading result from rtdimage"); rbuf[length] = '\0'; return status; } /* * Evaluate the given rtdimage subcommand in the remote rtd application * and return the status of the command. * * The command syntax is the same as for the * "rtdimage" widget (image type), except that the instance name is * missing. Example: * * char* result; * int status = rtdRemoteCmd("wcscenter", &result); * if (status == 0) { * if (sscanf(result, ...) ...) {...} * ... * } * * On success, "result" points to a char buffer containing the result of * the command. The buffer is internal and should not be freed and will * be overwritten in the next call to this routine. * * If the command could not be sent, result is set to a NULL pointer and * an error status (1) is returned. The error message can be retrieved * with rtdRemoteGetError(). */ int rtdRemoteSend(char* cmd, char** result) { if (info.socket == -1) return error("no connection to the image display: rtdRemoteConnect was not called"); if (rtdRemoteSendOnly(cmd) != 0) return 1; return rtdRemoteGetResult(info.socket, result); } skycat-3.1.2-starlink-1b/rtd/generic/rtd_remote.h000066400000000000000000000025471215713201500216670ustar00rootroot00000000000000#ifndef _rtdRemote_h_ #define _rtdRemote_h_ /* * E.S.O. - VLT project * "@(#) $Id: rtd_remote.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * rtd_remote.h - C interface for remote access to rtdimage based * widgets * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 04/03/96 Created * 02/01/06 Renamed rtdRemote.h to rtd_remote.h to avoid * name conflict on file systems that ignore case */ typedef void (*RtdRemoteErrorHandler)(char* message); /* connect to remote Rtd: if args are null, uses ~/.rtd-remote file */ int rtdRemoteConnect(int pid, char* host, int port); /* disconnect from remote Rtd */ void rtdRemoteDisconnect(); /* read the given socket to get the result */ int rtdRemoteGetResult(int socket, char** result); /* send the command to the remote Rtd (don't get result) */ int rtdRemoteSendOnly(char* cmd); /* send a command to the remote Rtd and get the result */ int rtdRemoteSend(char* cmd, char** result); /* set an error handler to be called as: void errorhandler(char* msg); */ RtdRemoteErrorHandler rtdRemoteSetErrorHandler(RtdRemoteErrorHandler); /* return the text of the last error message */ char* rtdRemoteGetError(); #endif /* _rtdRemote_h_ */ skycat-3.1.2-starlink-1b/rtd/generic/saoutil.c000066400000000000000000000015071215713201500211710ustar00rootroot00000000000000/* * This file contains utility functions from saoimage (1.23.2) required for * the histeq code */ #include #include #include static char *errnote = " allocation failure\n"; /* * Subroutine: calloc_errchk * Purpose: Calloc with printf'less error message and exit for failure * Note: If message is given, print it and exit on failure * Note: If no message is given, return 0 on failure */ char *calloc_errchk ( count, size, errmess ) int count; unsigned int size; char *errmess; { char *space; /* char *calloc(); allan: gets error with Sun cc */ if( (space = (char *)calloc((unsigned)count, size)) == NULL ) { if( errmess == NULL ) return(0); else { fputs (errmess, stderr); fputs (errnote, stderr); exit( 100 ); } } return( space ); } skycat-3.1.2-starlink-1b/rtd/generic/tkCanvas.h-tk8.4.11000066400000000000000000000260601215713201500223570ustar00rootroot00000000000000/* * tkCanvas.h -- * * Declarations shared among all the files that implement canvas widgets. * * Copyright (c) 1991-1994 The Regents of the University of California. * Copyright (c) 1994-1995 Sun Microsystems, Inc. * Copyright (c) 1998 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * * RCS: @(#) $Id: tkCanvas.h,v 1.13 2007/12/13 15:24:13 dgp Exp $ */ #ifndef _TKCANVAS #define _TKCANVAS #ifndef _TK #include "tk.h" #endif #include "tclUnixPort.h" #ifndef USE_OLD_TAG_SEARCH typedef struct TagSearchExpr_s TagSearchExpr; struct TagSearchExpr_s { TagSearchExpr *next; /* For linked lists of expressions - used in * bindings. */ Tk_Uid uid; /* The uid of the whole expression. */ Tk_Uid *uids; /* Expresion compiled to an array of uids. */ int allocated; /* Available space for array of uids. */ int length; /* Length of expression. */ int index; /* Current position in expression * evaluation. */ int match; /* This expression matches event's item's * tags. */ }; #endif /* not USE_OLD_TAG_SEARCH */ /* * The record below describes a canvas widget. It is made available to the * item functions so they can access certain shared fields such as the overall * displacement and scale factor for the canvas. */ typedef struct TkCanvas { Tk_Window tkwin; /* Window that embodies the canvas. NULL means * that the window has been destroyed but the * data structures haven't yet been cleaned * up.*/ Display *display; /* Display containing widget; needed, among * other things, to release resources after * tkwin has already gone away. */ Tcl_Interp *interp; /* Interpreter associated with canvas. */ Tcl_Command widgetCmd; /* Token for canvas's widget command. */ Tk_Item *firstItemPtr; /* First in list of all items in canvas, or * NULL if canvas empty. */ Tk_Item *lastItemPtr; /* Last in list of all items in canvas, or * NULL if canvas empty. */ /* * Information used when displaying widget: */ int borderWidth; /* Width of 3-D border around window. */ Tk_3DBorder bgBorder; /* Used for canvas background. */ int relief; /* Indicates whether window as a whole is * raised, sunken, or flat. */ int highlightWidth; /* Width in pixels of highlight to draw around * widget when it has the focus. <= 0 means * don't draw a highlight. */ XColor *highlightBgColorPtr; /* Color for drawing traversal highlight area * when highlight is off. */ XColor *highlightColorPtr; /* Color for drawing traversal highlight. */ int inset; /* Total width of all borders, including * traversal highlight and 3-D border. * Indicates how much interior stuff must be * offset from outside edges to leave room for * borders. */ GC pixmapGC; /* Used to copy bits from a pixmap to the * screen and also to clear the pixmap. */ int width, height; /* Dimensions to request for canvas window, * specified in pixels. */ int redrawX1, redrawY1; /* Upper left corner of area to redraw, in * pixel coordinates. Border pixels are * included. Only valid if REDRAW_PENDING flag * is set. */ int redrawX2, redrawY2; /* Lower right corner of area to redraw, in * integer canvas coordinates. Border pixels * will *not* be redrawn. */ int confine; /* Non-zero means constrain view to keep as * much of canvas visible as possible. */ /* * Information used to manage the selection and insertion cursor: */ Tk_CanvasTextInfo textInfo; /* Contains lots of fields; see tk.h for * details. This structure is shared with the * code that implements individual items. */ int insertOnTime; /* Number of milliseconds cursor should spend * in "on" state for each blink. */ int insertOffTime; /* Number of milliseconds cursor should spend * in "off" state for each blink. */ Tcl_TimerToken insertBlinkHandler; /* Timer handler used to blink cursor on and * off. */ /* * Transformation applied to canvas as a whole: to compute screen * coordinates (X,Y) from canvas coordinates (x,y), do the following: * * X = x - xOrigin; * Y = y - yOrigin; */ int xOrigin, yOrigin; /* Canvas coordinates corresponding to * upper-left corner of window, given in * canvas pixel units. */ int drawableXOrigin, drawableYOrigin; /* During redisplay, these fields give the * canvas coordinates corresponding to the * upper-left corner of the drawable where * items are actually being drawn (typically a * pixmap smaller than the whole window). */ /* * Information used for event bindings associated with items. */ Tk_BindingTable bindingTable; /* Table of all bindings currently defined for * this canvas. NULL means that no bindings * exist, so the table hasn't been created. * Each "object" used for this table is either * a Tk_Uid for a tag or the address of an * item named by id. */ Tk_Item *currentItemPtr; /* The item currently containing the mouse * pointer, or NULL if none. */ Tk_Item *newCurrentPtr; /* The item that is about to become the * current one, or NULL. This field is used to * detect deletions of the new current item * pointer that occur during Leave processing * of the previous current item. */ double closeEnough; /* The mouse is assumed to be inside an item * if it is this close to it. */ XEvent pickEvent; /* The event upon which the current choice of * currentItem is based. Must be saved so that * if the currentItem is deleted, can pick * another. */ int state; /* Last known modifier state. Used to defer * picking a new current object while buttons * are down. */ /* * Information used for managing scrollbars: */ char *xScrollCmd; /* Command prefix for communicating with * horizontal scrollbar. NULL means no * horizontal scrollbar. Malloc'ed. */ char *yScrollCmd; /* Command prefix for communicating with * vertical scrollbar. NULL means no vertical * scrollbar. Malloc'ed. */ int scrollX1, scrollY1, scrollX2, scrollY2; /* These four coordinates define the region * that is the 100% area for scrolling (i.e. * these numbers determine the size and * location of the sliders on scrollbars). * Units are pixels in canvas coords. */ char *regionString; /* The option string from which scrollX1 etc. * are derived. Malloc'ed. */ int xScrollIncrement; /* If >0, defines a grid for horizontal * scrolling. This is the size of the "unit", * and the left edge of the screen will always * lie on an even unit boundary. */ int yScrollIncrement; /* If >0, defines a grid for horizontal * scrolling. This is the size of the "unit", * and the left edge of the screen will always * lie on an even unit boundary. */ /* * Information used for scanning: */ int scanX; /* X-position at which scan started (e.g. * button was pressed here). */ int scanXOrigin; /* Value of xOrigin field when scan started. */ int scanY; /* Y-position at which scan started (e.g. * button was pressed here). */ int scanYOrigin; /* Value of yOrigin field when scan started. */ /* * Information used to speed up searches by remembering the last item * created or found with an item id search. */ Tk_Item *hotPtr; /* Pointer to "hot" item (one that's been * recently used. NULL means there's no hot * item. */ Tk_Item *hotPrevPtr; /* Pointer to predecessor to hotPtr (NULL * means item is first in list). This is only * a hint and may not really be hotPtr's * predecessor. */ /* * Miscellaneous information: */ Tk_Cursor cursor; /* Current cursor for window, or None. */ char *takeFocus; /* Value of -takefocus option; not used in the * C code, but used by keyboard traversal * scripts. Malloc'ed, but may be NULL. */ double pixelsPerMM; /* Scale factor between MM and pixels; used * when converting coordinates. */ int flags; /* Various flags; see below for * definitions. */ int nextId; /* Number to use as id for next item created * in widget. */ Tk_PostscriptInfo psInfo; /* Pointer to information used for generating * Postscript for the canvas. NULL means no * Postscript is currently being generated. */ Tcl_HashTable idTable; /* Table of integer indices. */ /* * Additional information, added by the 'dash'-patch */ void *reserved1; Tk_State canvas_state; /* State of canvas. */ void *reserved2; void *reserved3; Tk_TSOffset tsoffset; #ifndef USE_OLD_TAG_SEARCH TagSearchExpr *bindTagExprs;/* Linked list of tag expressions used in * bindings. */ #endif } TkCanvas; /* * Flag bits for canvases: * * REDRAW_PENDING - 1 means a DoWhenIdle handler has already been * created to redraw some or all of the canvas. * REDRAW_BORDERS - 1 means that the borders need to be redrawn * during the next redisplay operation. * REPICK_NEEDED - 1 means DisplayCanvas should pick a new * current item before redrawing the canvas. * GOT_FOCUS - 1 means the focus is currently in this widget, * so should draw the insertion cursor and * traversal highlight. * CURSOR_ON - 1 means the insertion cursor is in the "on" * phase of its blink cycle. 0 means either we * don't have the focus or the cursor is in the * "off" phase of its cycle. * UPDATE_SCROLLBARS - 1 means the scrollbars should get updated as * part of the next display operation. * LEFT_GRABBED_ITEM - 1 means that the mouse left the current item * while a grab was in effect, so we didn't * change canvasPtr->currentItemPtr. * REPICK_IN_PROGRESS - 1 means PickCurrentItem is currently * executing. If it should be called recursively, * it should simply return immediately. * BBOX_NOT_EMPTY - 1 means that the bounding box of the area that * should be redrawn is not empty. */ #define REDRAW_PENDING 1 #define REDRAW_BORDERS 2 #define REPICK_NEEDED 4 #define GOT_FOCUS 8 #define CURSOR_ON 0x10 #define UPDATE_SCROLLBARS 0x20 #define LEFT_GRABBED_ITEM 0x40 #define REPICK_IN_PROGRESS 0x100 #define BBOX_NOT_EMPTY 0x200 /* * Flag bits for canvas items (redraw_flags): * * FORCE_REDRAW - 1 means that the new coordinates of some item * are not yet registered using * Tk_CanvasEventuallyRedraw(). It should still * be done by the general canvas code. */ #define FORCE_REDRAW 8 /* * Canvas-related functions that are shared among Tk modules but not exported * to the outside world: */ MODULE_SCOPE int TkCanvPostscriptCmd(TkCanvas *canvasPtr, Tcl_Interp *interp, int argc, CONST char **argv); MODULE_SCOPE int TkCanvTranslatePath(TkCanvas *canvPtr, int numVertex, double *coordPtr, int closed, XPoint *outPtr); /* * Standard item types provided by Tk: */ #endif /* _TKCANVAS */ skycat-3.1.2-starlink-1b/rtd/generic/tkCanvasPsImage.c000066400000000000000000000201771215713201500225350ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: tkCanvasPsImage.c,v 1.2 2005/02/02 01:43:02 brighton Exp $" * * TkCanvasPsImage.C - Implement Tk postscript output for images * * The code here was taken from a version of the Tk canvasps patch, which * was modified by Peter Draper of Starlink to only access the visible * portion of an image (required, to avoid problems with large or zoomed * in images). * * To avoid having to patch the Tk sources, I gathered all the necessary * code in this file, including some private struct typedefs from the Tk * source files, which are not available in any include files. * * NOTE: This code is Tk4.2 specific. If you upgrade to a newer version, * you will have to redo it, based on the latest Tk sources and/or Tk * canvasps patch. * * PWD (again): Redone for tk8.4 as the default printing (at least there is * some now) includes the empty padding once more. Using a new image * postscript proc will not work as there isn't enough information passed in * to determine the canvas viewport. * * To enable this extension, call TkCanvasPsImage_Init(). * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 19/06/98 Created * Peter W. Draper 05/05/06 Added support for tk8.4 as zoomed images * generate massive postscript files full of * padding around the rtdimage. */ #include #ifdef HAVE_TKCANVAS_H #include "tclInt.h" #include "tkCanvas.h" #else // The structure we need hasn't changed for a long time, so just include a local copy. #include "tkCanvas.h-tk8.4.11" #define HAVE_TKCANVAS_H #endif /* Local prototypes */ static int RtdImageToPostscript( Tcl_Interp *interp, Tk_Canvas canvas, Tk_Item *itemPtr, int prepass ); /* Private function we add to Tk. */ Tk_ItemType *getTkImageType(); /* * -------------------------------------------------------------- * * TkCanvasPsImage_Init -- * * This procedure is called to initialize the canvas image * postscript extension by setting a field in the canvas * image type control struct, causing our postscript routine * to be called for canvas images. * * Results: * None. * * Side effects: * None. * * -------------------------------------------------------------- */ void TkCanvasPsImage_Init() { /* Need to access the Tk Image type and supercede the Postscript * command. */ Tk_ItemType *tkImageType = getTkImageType(); tkImageType->postscriptProc = RtdImageToPostscript; } /* * Note we do it this way, rather than by defining an image postscript proc, * as we do not have the necessary handles to canvases etc. passed to a * postscript proc. */ /* * The structure below defines the record for each image item (lifted from * tkCanvImg.c). */ typedef struct ImageItem { Tk_Item header; /* Generic stuff that's the same for all * types. MUST BE FIRST IN STRUCTURE. */ Tk_Canvas canvas; /* Canvas containing the image. */ double x, y; /* Coordinates of positioning point for * image. */ Tk_Anchor anchor; /* Where to anchor image relative to * (x,y). */ char *imageString; /* String describing -image option (malloc-ed). * NULL means no image right now. */ char *activeImageString; /* String describing -activeimage option. * NULL means no image right now. */ char *disabledImageString; /* String describing -disabledimage option. * NULL means no image right now. */ Tk_Image image; /* Image to display in window, or NULL if * no image at present. */ Tk_Image activeImage; /* Image to display in window, or NULL if * no image at present. */ Tk_Image disabledImage; /* Image to display in window, or NULL if * no image at present. */ } ImageItem; /* *-------------------------------------------------------------- * * RtdImageToPostscript -- * * This procedure is called to generate Postscript for * image items. * * Results: * The return value is a standard Tcl result. If an error * occurs in generating Postscript then an error message is * left in interp->result, replacing whatever used to be there. * If no error occurs, then Postscript for the item is appended * to the result. * * Side effects: * None. * *-------------------------------------------------------------- */ static int RtdImageToPostscript(interp, canvas, itemPtr, prepass) Tcl_Interp *interp; /* Leave Postscript or error message * here. */ Tk_Canvas canvas; /* Information about overall canvas. */ Tk_Item *itemPtr; /* Item for which Postscript is * wanted. */ int prepass; /* 1 means this is a prepass to * collect font information; 0 means * final Postscript is being created.*/ { ImageItem *imgPtr = (ImageItem *)itemPtr; Tk_Window canvasWin = Tk_CanvasTkwin(canvas); char buffer[256]; double x, y; int width, height; Tk_Image image; Tk_State state = itemPtr->state; int screenX1, screenY1, screenX2, screenY2; TkCanvas *canvasPtr = (TkCanvas *) canvas; if (state == TK_STATE_NULL) { state = ((TkCanvas *)canvas)->canvas_state; } image = imgPtr->image; if (((TkCanvas *)canvas)->currentItemPtr == itemPtr) { if (imgPtr->activeImage != NULL) { image = imgPtr->activeImage; } } else if (state == TK_STATE_DISABLED) { if (imgPtr->disabledImage != NULL) { image = imgPtr->disabledImage; } } if (image == NULL) { /* * Image item without actual image specified. */ return TCL_OK; } Tk_SizeOfImage(image, &width, &height); /* Determine region of image that needs to be drawn. For rtdimages only * the part visible on the display screen is done. */ screenX1 = canvasPtr->xOrigin + canvasPtr->inset; screenY1 = canvasPtr->yOrigin + canvasPtr->inset; screenX2 = canvasPtr->xOrigin + Tk_Width(canvasWin) - canvasPtr->inset; screenY2 = canvasPtr->yOrigin + Tk_Height(canvasWin) - canvasPtr->inset; if ( width > screenX2 - screenX1 ) { width = screenX2 - screenX1; } else { screenX1 = 0; } if ( height > screenY2 - screenY1 ) { height = screenY2 - screenY1; } else { screenY1 = 0; } /* * Compute the coordinates of the lower-left corner of the image, * taking into account the anchor position for the image. */ x = imgPtr->x; y = Tk_CanvasPsY(canvas, imgPtr->y); switch (imgPtr->anchor) { case TK_ANCHOR_NW: y -= height; break; case TK_ANCHOR_N: x -= width/2.0; y -= height; break; case TK_ANCHOR_NE: x -= width; y -= height; break; case TK_ANCHOR_E: x -= width; y -= height/2.0; break; case TK_ANCHOR_SE: x -= width; break; case TK_ANCHOR_S: x -= width/2.0; break; case TK_ANCHOR_SW: break; case TK_ANCHOR_W: y -= height/2.0; break; case TK_ANCHOR_CENTER: x -= width/2.0; y -= height/2.0; break; } if (!prepass) { sprintf(buffer, "%.15g %.15g", x, y); Tcl_AppendResult(interp, buffer, " translate\n", (char *) NULL); } return Tk_PostscriptImage(image, interp, canvasWin, ((TkCanvas *) canvas)->psInfo, screenX1, screenY1, width, height, prepass); } skycat-3.1.2-starlink-1b/rtd/images/000077500000000000000000000000001215713201500171735ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/rtd/images/img_ext.fits000066400000000000000000000757001215713201500215270ustar00rootroot00000000000000SIMPLE = T / Standard FITS format (NOST-100.0) BITPIX = 16 / # of bits storing pix values NAXIS = 2 / # of axes in frame NAXIS1 = 100 / # pixels/axis NAXIS2 = 100 / # pixels/axis ORIGIN = 'ESO ' / European Southern Observatory DATE = '1999-06-07T15:23:07.508' / UT date when this file was written CRVAL1 = 1.0 / value of ref pixel CRPIX1 = 1.0 / Ref. pixel of center of rotation CDELT1 = 1.0 / Binning factor CTYPE1 = 'PIXEL ' / Pixel coordinate system CRVAL2 = 1.0 / value of ref pixel CRPIX2 = 1.0 / Ref. pixel of center of rotation CDELT2 = 1.0 / Binning factor CTYPE2 = 'PIXEL ' / Pixel coordinate system BSCALE = 1.0 / pixel=FITS*BSCALE+BZERO BZERO = 0.0 / pixel=FITS*BSCALE+BZERO MJD-OBS = 51336.64107118 / MJD start (1999-06-07T15:23:08.550) DATE-OBS= '1999-06-07T17:23:08.550' / Date of observation EXPTIME = 2.0000 / Total integration time EXTEND = T / Extension may be present END  megupqniqqr}xz{xrxyuw{vspspnwvtuovoptuuvvtrquwpsroyysuuoutqqsw|tvwxuovv{}yrwum}xxqqvusuuzyxvsztyijowt{|}}wty{|}{zwzvw|zxvw{{}ruzzw~}wutuvy}z}xxwuzwv{xxzz~txs|vtx}v~x{ysyxz~zxrpunrnuyv}z||}}~||yqt{xv{rww}}z|zzs}x|}tx{{z}{|x{}z}|zrzvv{}}utuzzwu}z|{{{~zy}}zu|~|z}}x}u}w{x~|{z}z||~|}wx~}}yt~z|w}}rorw||~wv~~{z~}z{|y~xt{}syy~zzy{z}x{w~}~zz}{}|~{|||~xx{}|unnsw}z|z~~y}}|{}|xy{z~xzvzz|yxx}y|w|}}x|{x~y~vz{}}{zrxvuxvxz|{||{|z}zszy~y~yyy~z}v|~w|}y{{}~|z~t~~y}{x{~~rxuyw{uxxy}~y~tyz}wwwy{{}zwx~}{~z|z~|zy}|~wy}~~|z}vz{{}mqtox{~{zx{}x{zt{|~~x|v|}|z|z{yz|z}yx}}|{~z~}}~~|w~|~}}|}}}~w}wprsqw|y{u}}x}~}yzuxz|vzwyxv|{}yzz|}y}wz|~xw~}zv}z||vttytvtt}}y{z}~{v|}{{z}}{y~|xy|~|}||y}zwz~|yy|zs|w}w}z}nptx}|yzz~~|z|zz{|{zyz~}|}~~ywy}|x{z||x|y~w~|{~yy}~}~{zz|{youvwtx}u|~{~}~yw{{~|z||uw}z~z~{zy{~z|yxyy}y}x~~~x{|}||y|z|{}}|~|}vqyqpv|zy~{{w~{|}zxy}{uuu{}yw{{{||u{z|zx~y~z|{~wps{|xwvy}y{}}yu}~vyzx{zxy|z{w}}w~|{}|}{zzv~}u|}x||vz~~~mptxx{~w|}~||z{vz~wv}v}~||w~|{v~y{x|~x}}{{~z}|}{}x}y{uvswqtpv}{|{|}wzv~xss{|}{~}{}|{}y~w}~}y}}{y{zwwz~~}xzxz|{wwwtzww}y~|x~zzxv|w~yy|}w||x|~~|wxyu|||y~~{}vtz|yzyz}xzyqtos~wwx{y}~zv{|{zy~xv||{yz}z{z~}}www|vyy}}}y|zz~}qmkqzw~{|}{{{||v}}z~{z{v}x~{}{{||~v~~}vw}}|{~}|}vz~|z}wq{qws|~~~~y{|x}{zx}}{v|}}zyy~z{{}{|wu}zv|yz{y}~~}}{{xz{{xwx}wvzwz|v~|}v~{|yz}~|y||{y}{u|}}|}zz|}}v~|v}||~}}yy{}~~{s|}~rvrv~yt{~~}}{yy|y}vwuz~ywwz~~{|}w{{zz}{z{y~~}wy~~ysmntxx~}zv{~{zy|wvy|{{{~}}|zyy|~z}}}zz}~}wz}~yzz}}z}{x|u}txyuvz|~{}}y|{y|xwz~zyy|{y~~zu||}{xy|~}||~zxy~~y{y~{{|~z~wqxw|yw{v~~~{~zz}w{yxxyvy}|z~|{uzy~|~{|~y{}zy}{}~yyy}wy|zorlt{}x{{~~}~u{y}~||}vvv}|}{~{}zw}t}yz}y{{}}|z{~{}v~x}||xutvuw{|x~|{{vtwu{~}}wwz}|y~|z}{z~~x}{z}|{{z~|zu|~}{~}pmw{yv}{{zz~xz~~{yxvz}~}wz}|zyx~|}{w{}}yu|~|zy}zyyzzz~}{~~mkvsxx{u~{~|||}}|yx|}{wz}||uyz{|}}}~~x|~x{|z}zy}z|x~~}~zy~~{zxxqlttz~}z}~~~}yyzyx~}|~xz{{z}}|zxv}|x~z~}x}}|sy|z{|}}uutwvwt|~}}{{wxy|}zvv||~}}xr}z}wx{|~|}z~}yzxz{npryzvyy~v{{xzy}~}}xv}}||}z}~w{|yz|{{~~z{~}~zvx~yx}}yw~|yztjwvt{{yz~~y|vw}}~}|zwwy}~{}z}~{~zz}z|yx{}y|z~~xx{~yunvvq}x~~~y~y{~}yzv|~xz|||y~{xz}}zz~}x}y~~{|zy}|}}}|{qvvvvttx|{|}{zx|y|yzy}{~|~{}x~{~}u|{~}|{~}|wx|~|x|}}{||z~|}|}mpuv|z|y~}}}~|y|{zs{{v~{~ry{{~y|w|wx{}|{{zvxz|y~~~}}zxz~y|pvptrw|~}|~~{y}}{xt~x{{{~|~~wyw~t}}z}w~|r~}~{|z{}z}u|}{|~}zwwvuyt|x~w{}{~||{|{z}vz}{z|y|z|~}zy|||}{z~~{{|vz{zyy}}z{|z~~wwvwwwzzzzz}|xz}}{|z|{|z||yw|y{~|xw}y}{yvyzzy|zzx|{{~rnlu|}}|x}}t}y{~t{vyxz|{~~z~~wx{~{}xy~~|}{|~wy|{~}xz}z{}zvzturxxw~~|~~{}}}yy|}}|y{{}y}z|ywzwzx{~x~yvx~}}zyxlu{v}vx|v|}}|~~~w|{{|s{|y}z}}yw}|xz}z{y}ut|zy|y}x}|}zu{||vx|zorrx|{|zz}z|}x}}|z}r}y~w{z}~{zzy}wwy{zy~{}}}}{vu~z~yz{||~{xkpsxwy}~}zz~}y}~z{{}x|ww|}{w|}}w}}ywy|~~}v~~~{|zv|~|~|wwpxqst{|~~~z~y|ty{~}{vzwz|wyzwu}}{{}||{y{}zzy~x}|wuqlwxv~|yz~~}~x~~z}{|zwt~z{~wwv~~}z{|}~z}~{uz}~w{{zzy{}|w{rrrpq~z|{}}}|{~|x}|{|y|}}}z}w|~}}{{|~y}zz{|~z{w{{|}||}~{|xv~}}w|roruuz}x~uw|}zzvvw~x{{z|}|}}}}}zyyz}}}u||yz}~}z|y{}}}|zsrwzwutx}~}{}~y}}zy||{{yy|{~|}z~z~~}yzyx~}v}||}yz|}y|||}nwvw~}yy}|yz|}}|{z~|{{~}}~{ywz~{{x}z}xzyzy}x{}z}|~{vz~{~~}vomtsts~{{{~~yy~{v}zzwyvw}|}y}|x}{{}y{w}{|xy~|}yz|{{xv{{wxtstzyz{}{}{zy~}{||yw|{{zw|}{|{}|{vywy~|{}|~|~z|y}|x~sruz|zw}}zyzz|}{||u|z}z|x}{{|w~}x{|}}xyw}~{~}||}v{z~ki|t~z|~z~|}z|~~wyx{{xz{~}yvx~~v}~{z}z{|~z}{x||}|z}vxypvpzw~~|~}z{}|wv||zxz}yxvx{z|{zy|x|r}x~z}||~xzzy~|z{}}}|zz|wxuyuu|}~z~y}~w~yuxy~||www|w}{zu}z~yx~x|~~yv||~{xy|}zyx~|rlqw~xzvw~{{~~~|}~xz{s|~}}~y}~{|}|}{}z~{~{}w|~|z{}}{xx|}~rltvvs{|~{~~zzx~zvx}~|y{u}x}{zz}y|yxyx{~{xy}|{~xw}}}}z{}svvptvqy~zzy~{||yzw{x}~y~~z{z{z}|{z~{|y{|}|~{{~|yy|{|}}uwxvv}}txz~~~yr{}}{x{w}~x}|{yx}}y}xx|z~~y~~}}~z{x}v~z}tppvzy}}{s{}x~~~yx{{~z|x|z|y{{}~x{}y~x}|y|z|zyx~~wz{}{}u|z}z||~yvlrwwtv{~|z|~zz|z~||}tu}x{yx}~}~|{|||||}~u|{z}{y}}~{{|x}uvt}psw{~}z~}{x|{x||}{}z~zyz}wy{|{y~{~~|z~||}{}}zz}|suvvww{yyy~{~|ywyy|xy|u{{z}}~xv}y}z{~~}xxy}x{||}}w}zzlprqv{{}}}{{~x|v}{{y}|ux}{{vy}{y~zv~~yz{|}}|}xx}||zx}y{}yosouzu~|xzw{{y}x{ty}}~}x{zz{wz~x{}~vv{~|yy~{{~|zpuyy{vz{{|}|}ywz}{xyswy~x{z}szw{~xy|~|}}||yzz|z~}~ropu{z~{{yz{}||z{{}z~vxy|}zzx|}yz|{~{vyz~zzzy{yz|y}~y~x|x|rnsxxz{}}zx~vxz{|~}|w|}w{t|wz{{|}~y}~~{||~~uxy}vyv~wwuzqyswx~}{~{~x{|zz~{~~}{{|{~{|}}}z}xzz~u}}}z~zx{{v}|z}zrsr~y{yyy~~xx|}y~{|yz|y}~yww~}}}{|~u}z~|y}~|~}~{x{}vxz|}wpquw{{||x~z~}{}x{zz~z{|}|{w~t}y|~z{~{~zyzz{|}zz|zz~|}|vwsrpyt|~|z|wzx|sy{~}x{w{}{}}||xz}z|xz|{~z~z{{x}y}~w~|xsvzytyw{~~~~|yz|}|}zxzy{{~yw|{{~~zy{{xzv~}~tz~xy}{|~}||~~z{~~}snqz}wz|~yw}}|~w}{}{wyx}}y{|z}xzu~u}~~|}y|s~w}~}~|}z|x}yxxrqsvsx}}~|{|}}wz|~}|}t~z}~~x}~~y}z{x|}{|||}}~yx~yz{~zz{v~~{~}w|rotu|||{x~y{|}z}v}~{|y}||{zz}{|~~}z{}|z}||y|~{y{usu}~{wv}}{}}{zvzz}v{}~yx}|{xy|wwz|z|{}~}{{|}xv|xz~vorwx}z{|w|||z~yz|}}|w}{v~~|y|{|yx{z}xww~}}y~z}|}{x{t||zvuoqsz~~}~}~}yyz|zz{|z|x{|uxz{~{z|}}}y|yz{y}x}}{{y|z~|vwutt{uu}~}}~~{|}}}vyzz{{|~|}{z||{}}}{x}}{z|}{z}u}}|t{{yzwurru||v}y|~{{zzy}zyzu~{x|w}y}{zyz~yz|}~yx~}wz}||zz|zrruxvyz}}|}wz~}}zv}{||}{~}z||~zzy|zxv}y}zzwz~|z|}zy|}}zxuzztvz|}x}z||zx|{ywu~v}{w}|xz}z}y||{~~zz~|y~z}~z|~qtswt{xr{~}~{w|z}{|uzz{}~yu~z|~zy}{|~|}{|zz||{}u}~~~wy|{{zy|tnnzw~z}}{}zzz}y}~}z}{wz}{|x{|{|~}{~~}~}yzyw|{{}}{}}{y||xuqrutxu~{}|}y~y{vy|zy}xz{|}vx}{{{{{~yzz~~~zwx}~~|}{}xnzuuvux|{y|y}~z|{}y~{|}}wz||~|s}~}zxz}{z{v}{w}{z|}y~yponw~~yx|x}}~}wz|}{zw{|z}zw~~{|}{~|z{z}y||{|w}y{{}{~ww~~}{}z}vprpuxz}|~|}}|vyyxu{{}}~~x~{}yzz|{}{}{}y~~}{{|~||x|y~~|z}r{r{uzx}x}yy|}|z}v{|{zz}{~y|{wyzzzx}|w}{y~zyw}{wztqy{vyt~}|~y}}{{|xw}}||y|z|{}}~||~{}}z{~|yy{~z{xx}~}}zy{y|{~|||npss}z}|v|~|z{|}zzvyx}yu~uy|}v|{}~}vzy{||}{~|}{|x}||zyx~||~zustvx|}}|~|}~zy{{z~{x}|z|t{~~}|{|}~z{z~}zz{~v|xz}}yyw}}||{{uswvv{xvzz}z}yztz|~{y}|}ww||vy}{}zx||}u{}z~xz~~ux|~shn|xzz{|{}ywwz|}{|~v|x~}yz{zx}z||~yz{}xx~~}}wz|~}~}~zzzzppuxtw~}}~|w}}|v|{}|{zvy|||zz|~zw~{}zzz}|~~}}|y}~zx~|vwyxsqxwx}|}}z{~yy}|||w~{{x}|{z{~w~y}|~|{{y~{|x~{}XTENSION= 'IMAGE ' / Extension first keyword (see SIMPLE) BITPIX = 16 / # of bits storing pix values NAXIS = 2 / # of axes in frame NAXIS1 = 50 / # pixels/axis NAXIS2 = 50 / # pixels/axis ORIGIN = 'ESO ' / European Southern Observatory DATE = '1999-06-07T15:23:07.513' / UT date when this file was written CRVAL1 = 150.0 / value of ref pixel CRPIX1 = 1.0 / Ref. pixel of center of rotation CDELT1 = 1.0 / Binning factor CTYPE1 = 'PIXEL ' / Pixel coordinate system CRVAL2 = 150.0 / value of ref pixel CRPIX2 = 1.0 / Ref. pixel of center of rotation CDELT2 = 1.0 / Binning factor CTYPE2 = 'PIXEL ' / Pixel coordinate system BSCALE = 1.0 / pixel=FITS*BSCALE+BZERO BZERO = 0.0 / pixel=FITS*BSCALE+BZERO MJD-OBS = 51336.64107118 / MJD start (1999-06-07T15:23:08.550) DATE-OBS= '1999-06-07T17:23:08.550' / Date of observation EXPTIME = 2.0000 / Total integration time PCOUNT = 0 / Number of parameters per group GCOUNT = 1 / Number of groups END }wqurut|u|ty|y|~|vz~xtxy~||~x|y~w~||{zxyz|rurquwz~zywzvw~{|~||wz|{y}z{~y{z}~}}ysz|y{qrxuvv}}zz~}~{}|w~~}xxz}}}|wzwz{}pvttq|zxpsqxyzz}yx{}|{yxxu~z}}|~xwytr|v|||{z}v{~z{w{|y}~wy|yw}yzys}ywqswqzz~yzx}xz|~}{}{vx}zz{{t|ovxuvyztsptyy{|yzv}{|w~xwz{|ux~v}zu}rrrvyyws{zw{|}z|x|{y|{~zzy{z}|}yysvszvt}xysy~{{t}v~{}wz|~zyw{}{|}w{uztuv|xzxwstz}x{}|v~w|}zy}{x~|vy}}{susrx{wxvwv}~wzzzz{w}~yz}{zwyy||~z{wx{xwxqswy~vw~uv{~{x~~v}{xy|wz|y|zuzyzuxtu{vvzzz}}{}z{y~}~xz|{}~{sw}{r{vwqv|wxzu|{~x{|{xyv}{xx}~v}~|wzx{wysvv{z|w||xt}zx~}}|~~w~{su}}~{wwwrtxvszurwxz}|z{y~~{~x~}yx}{xu|{yuwsnzy{rsss||{{zy{zzw|}{zzt}}|zy{wysqywt|wzuwv}x{w}|y}{~v{~y|~wux|ywurovsv{|wyy{{}}w~}{t{~}}~us~|yrutuz~ytquvw~~||}}|z~~yxxw}yz{{~zvx{}|tvntsx}tzxyu}~}|{x|xz|w{zw|~|wyy|||t~u}wps~}yzu{{v{}~~rv}z{y|wws|||{vxu{zww{vqoux{{|}|u{{y}z~|~|sy}~zyx{~ypwtxv|z{vxxtv|x{z}|u|z|}{z{x|yx|yxwyw{mwvxwvzzux}}~{}xz~z|yw{}x|xzy}|xyzvsz{yqrvw~y~~~w{y~~{|~}}{|x~|yw|~zuurtoxz~szvyx|y~|u~}}|zyy~{||~{xu}}vtrzvvyztyus{z~}~}|vu~}}zxv|{zxzvvywv{tvowuwx|~~|}|}z}z|x~z}|vvy}~wvssuy{s|pvp{{y{{|~{~~|}|vx|~z{xzyuwq{wyxxzswx|z}y{~w}~}}z{{zxz~|}|w}{z}vvwwqo}z|xuw{w}~~~{xy}|yxvy}ywrrxz{~twz}|z~}w{~}{{~}|}v|z|{xwv|{uuprr~{yy|vwy~||~|~zz~{zxy{}|}z{{||yywsqsvty|zyxt|{{||vyy}|~|{wx|{}uwvrzyw{nzu}v}zzx~}{z~zv}}|y{y~|yzyytqvrv{wvxx{wt{|zx{x~zz||}~}v~|{zzux}zxv{uxstt||{}ww{|}|{{{vw{|z|xvv{z}|ttyy{qutu{w|{zzw~~}wxyw}zyvw|w{zvlpp~y{vwtwrzz{|w}~|u}{~zyy}zyvuzw~yxuwqrwu{yy{|z{~~zzz{u}{u{~|x{yuwzz|rsosy}~~}wv}}~}|y||{}}u}}~yw|wz{rptyw~ywuuz}{zz~}{x}{yzw{~}vz{~zwsuuvuywztz{|{x}{zyz{wy{}zzzv|uwzu{xvt{{|{{|s{v~z}zx|{wy}|~twy~|{~zwut}u~xxwywzw{z}}|}{w{}zu{|~x~zx|u~|unuuwyv}wyu{v}{}{x~|~{{|z~{|wy}|w{xv}w}zuy}|}v|ww{}yw||z}w|{{~z~{{}{z~}~{pru~}szyu{wyy{y||}z}~|z|wx|~~~xzs}~txvvwtwzwyzz~y|}}{}|}ww~{}u{~{|{wskycat-3.1.2-starlink-1b/rtd/images/ngc1275.fits000066400000000000000000007777001215713201500211720ustar00rootroot00000000000000SIMPLE = T /FITS header BITPIX = 16 /No.Bits per pixel NAXIS = 2 /No.dimensions NAXIS1 = 353 /Length X axis NAXIS2 = 353 /Length Y axis DATE = '28/06/95 ' /Date of FITS file creation ORIGIN = 'CASB -- STScI ' /Origin of FITS image PLTLABEL= 'E1618 ' /Observatory plate label PLATEID = '07WS ' /GSSS Plate ID REGION = 'XE198 ' /GSSS Region Name DATE-OBS= '20/12/57 ' /UT date of Observation UT = '05:36:00.00 ' /UT time of observation EPOCH = 1.9579677734375E+03 /Epoch of plate PLTRAH = 3 /Plate center RA PLTRAM = 9 / PLTRAS = 3.2780210000000E+01 / PLTDECSN= '+ ' /Plate center Dec PLTDECD = 42 / PLTDECM = 33 / PLTDECS = 3.1743320000000E+01 / EQUINOX = 2.0000000000000E+03 /Julian Reference frame equinox EXPOSURE= 4.5000000000000E+01 /Exposure time minutes BANDPASS= 8 /GSSS Bandpass code PLTGRADE= 1 /Plate grade PLTSCALE= 6.7200000000000E+01 /Plate Scale arcsec per mm SITELAT = '+33:24:24.00 ' /Latitude of Observatory SITELONG= '-116:51:48.00 ' /Longitude of Observatory TELESCOP= 'Palomar 48-inch Schmidt'/Telescope where plate taken CNPIX1 = 2686 /X corner (pixels) CNPIX2 = 4893 /Y corner DATATYPE= 'INTEGER*2 ' /Type of Data SCANIMG = 'XE198_07WS_00_00.PIM'/Name of original scan SCANNUM = 0 /Identifies scan of the plate DCHOPPED= F /Image repaired for chopping effects DSHEARED= F /Image repaired for shearing effects DSCNDNUM= 0 /Identifies descendant of plate scan image XPIXELSZ= 2.5284450000000E+01 /X pixel size microns YPIXELSZ= 2.5284450000000E+01 /Y pixel size microns PPO1 = 0.0000000000000E+00 /Orientation Coefficients PPO2 = 0.0000000000000E+00 / PPO3 = 1.7747471555000E+05 / PPO4 = 0.0000000000000E+00 / PPO5 = 0.0000000000000E+00 / PPO6 = 1.7747471555000E+05 / AMDX1 = 6.7240987715710E+01 /Plate solution x coefficients AMDX2 = 3.6605616579680E-01 / AMDX3 = -1.3732674154580E+02 / AMDX4 = -2.2170938540070E-05 / AMDX5 = -2.0113447317610E-05 / AMDX6 = -2.1108647953950E-05 / AMDX7 = 0.0000000000000E+00 / AMDX8 = 1.8223387505210E-06 / AMDX9 = -9.7173567076310E-08 / AMDX10 = 2.3013465940930E-06 / AMDX11 = -6.6734677147540E-08 / AMDX12 = 0.0000000000000E+00 / AMDX13 = 0.0000000000000E+00 / AMDX14 = 0.0000000000000E+00 / AMDX15 = 0.0000000000000E+00 / AMDX16 = 0.0000000000000E+00 / AMDX17 = 0.0000000000000E+00 / AMDX18 = 0.0000000000000E+00 / AMDX19 = 0.0000000000000E+00 / AMDX20 = 0.0000000000000E+00 / AMDY1 = 6.7250690753980E+01 /Plate solution y coefficients AMDY2 = -3.6679440186020E-01 / AMDY3 = -3.1235334956310E+02 / AMDY4 = -3.5598357942100E-05 / AMDY5 = 2.4433823111370E-08 / AMDY6 = 4.3754127047740E-07 / AMDY7 = 0.0000000000000E+00 / AMDY8 = 2.0663931384810E-06 / AMDY9 = 2.9377276167040E-09 / AMDY10 = 2.0894436743940E-06 / AMDY11 = -2.4710339600070E-08 / AMDY12 = 0.0000000000000E+00 / AMDY13 = 0.0000000000000E+00 / AMDY14 = 0.0000000000000E+00 / AMDY15 = 0.0000000000000E+00 / AMDY16 = 0.0000000000000E+00 / AMDY17 = 0.0000000000000E+00 / AMDY18 = 0.0000000000000E+00 / AMDY19 = 0.0000000000000E+00 / AMDY20 = 0.0000000000000E+00 / Based on photographic data of the National Geographic Society -- Palomar Observatory Sky Survey (NGS-POSS) obtained using the Oschin Telescope on Palomar Mountain. The NGS-POSS was funded by a grant from the National Geographic Society to the California Institute of Technology. The plates were processed into the present compressed digital form with their permission. The Digitized Sky Survey was produced at the Space Telescope Science Institute under US Government grant NAG W-2166. Investigators using these scans are requested to include the above acknowledgements in any publications. Copyright (c) 1994, Association of Universities for Research in Astronomy, Inc. All rights reserved. DATAMAX = 14733 /Maximum data value DATAMIN = 2806 /Minimum data value OBJECT = 'ngc1275 ' /Object ID OBJCTRA = '03 19 48.168 ' /Object Right Ascension (J2000) OBJCTDEC= '+41 30 42.12 ' /Object Declination (J2000) OBJCTX = 2862.03 /Object X on plate (pixels) OBJCTY = 5069.55 /Object Y on plate (pixels) CTYPE1 = 'RA---TAN' /R.A. in tangent plane projection CTYPE2 = 'DEC--TAN' /DEC. in tangent plane projection CRPIX1 = 176.5 /Refpix of first axis CRPIX2 = 176.5 /Refpix of second axis CRVAL1 = 4.9950707579921E+01 /RA at Ref pix in decimal degrees CRVAL2 = 4.1511441513468E+01 /DEC at Ref pix in decimal degrees CDELT1 = -4.7246758859361E-04 /RA pixel step (deg) CDELT2 = 4.7257498386706E-04 /DEC pixel step (deg) CD1_1 = -4.7215789128263E-04 /CD matrix CD1_2 = 1.6336830291022E-05 /CD matrix CD2_1 = 1.7104033764000E-05 /CD matrix CD2_2 = 4.7229251884081E-04 /CD matrix PC001001= 9.9934451099196E-01 /PC matrix PC001002= -3.4577674078453E-02 /PC matrix PC002001= 3.6193269529500E-02 /PC matrix PC002002= 9.9940228527557E-01 /PC matrix END SSSS z z( $ $ == == 9 9 O O SS O O O Oiiiippplt#  j jnn nnn ? ? ?XX XX  ? nnnn  l e e O O SSWl X*(.7(lliiii====   u u"""""}""""""CCCCCC jnnnn   nn   nnnn nn j j jCC CC nnnn jn  tttt !!!%tt!|-%(#3 S O z z ~~AA==== ==   O O O K Oiil|  j j j j j nn  nv ? XX XX nnnn n   e e W SS[.6V74(pii ii==  9<<  4 4 4 u u"" u u"}}} u*""  CC j jnnnn j j j j  nnnn j j  j j CC CCnnnnnn  )tttttt!!xx !!!xx-`" %7 jbS _/ z ~~AA====AAWW O  Ol|P&J j j j j jnnnnnv^^N  XX ? ?nnnn n  EE W  OSS[!1#5R79 73x|(wH%ii ii== <  4 4 4 u u"" u u"}}}**"" CCnnnn j j j j  nnnn r j j CCnnnnnn  )tttttt!!xx !!!xxx% bS  ((((E S  tiiiip+#rr j #"'M%RC T T T T T T T T  ? ?  =5xi SSSS SSSS" 49 78^1H X!==== =@ 4 "" u u  yy}99.yyCCCCCCnn jnn  j j CCCC j CC j j tt tttttxxtttt!!t\!h??77 S W((((IIEUt MS  WWiiiipvvn j  2L604-d T T T T T T T T  ? ?  j j =M!0+'sll SSSS SSSS&042&5t)l==== =@ "" u uyyyy}A h#.yyCCCCCCnnnn jnn  j j CCCC j jrr CCr j j11tt ttttttttt!!t X??77   O O((((((//XIAA =t. 0" WW WW ll|Ptiiiii j j j j j jnn2(%5886.CC T T T T T T X XX ? j j j j = ,4/l OSSSS SSSSp%#cT%ppptll======   u yyyX//.&&CC CCnn nn  j j CC Cr  CCrrr j j j j11!!tttttttttt!!tpp`   O O O O((((((%*S$<XAAAA= #8([[ WW__WW ll!tiiiii  j j j j j jnnn#*4)2'CC T T T T T T X XX ? j j j j =&#cl OSSSS SSSS pp%pp======   u yyy9%%.&&CC CCnn nn  j j CC Cr j j  CCrrr j j j j j j9!!ttttttttttxx!!t\`` e e z( z z z z O O O O O"J+"WW z[ n# ( (6(( T T T TXXXX 1 1 " G XX  nnCC GG | + ~~C(((( iiiii AA~~++~~ SS SSSS    _ _  cccccccc  _C@\\\\\ TXX \ CC CC ; ----CCC ?  nn --5RbJIIII E E 7777CC;;QIII e e z( z z z z O O O O OWWSS # B[($&,E"C((( z z(( T T T TXX  1 1 XX  nnCCN\\XX | + ~~+3((((i iiii AA~~~~~~ ~~ SS SSSS   _ _ _ _    cccccccc  _<\\ll XX \d CCCC ; ---- CCC ? nnq#IIII  7777;;;;QIII e e z z z z O O __WW ![SSSSSS WW [7R((((( z - -- ) ) 1d      J f\  ~~~~++~~~~(((( iiii AA  ~~/++ +~ $ O O S SS       _g   cccc<<8888 \XX  d\ CCCCCCC ) ---- j jv55--y IIIIIIMM7  ; IIII e e z z z z(( z z O O O O OWWWWWWn[ SSSSSSWWWW[(3((((( z - -- ) ) 1     J(-": ~~~~ ~~~~iiii  ~~///++++ +~ $ O O S SS        _g   cc<<8888 '/+$W\XX  \\ CCCC C ) ---- j j}v--cJIIIIIIIIMM7  33; II  e e $ $ + z z O O O O WW SS[[WWSSSb +++++ (((( T T % -- - --  nn G}0p2x$\XXXX1  (((( z z z z +++++pi e== ((((( z(((( O O O O O O O O        oo kkC8888\  CC CC -- ) 1 ? ? 1 )1/V-"GIIIIQQ 33 M MQ  e e $ $ + z z O O O O SS[[WW[[SSb'+ +++ ((((  -- - -- T T T T Q Q nn G^}*\XX1  (((( z z z z +++++% e== ((( z z(( z(((( O O O O O O O O         gwkkkSC8888\ dd   CC CC -- ) 1 ? ? rrz( 1 ) 1='7+GGIIII 3377M M l $ $ $ $ z z O O O OSSSS O O SS[[[WW_jrbSSSSSSS~++++ ~~~~(((( Q -- --5 Q Qnn   j j G\`w@11 (((((( z~~~~+R ((((( z z/(((( O O O O O O O O _ _    cc gggg<<8888\\  \\ T T X CC CC -- 1 ) )  ? ? GzB#11TGGIIIIC333 IIIll $ $ $ $ z z O O O OSSSS O O SS[jz_n!*( bSSSSSS[~++++++~~~~(((( T T Q -- --      j j GG\`"1 (((((( z~~;&-*" 5t== ((( z z z(((( O O O O O O O O _ _    cc   gg<<<<8888\\\\ T TX CC CC --  1  ? ? Gz+}11995GGG IIIIIIII33377  III SS O O O O K  z z z z((+$R~[/0U74d% 3++ W  T T ) ) ---  j j j j nn ? ?CCX XXXX O OW +5=7Z6/lll i   SS SS O O O O    cc88888888c-------- ) )-- j j CC 1-- nn XX\l@ \rrIIIIII333333^^^^  ^^ t SS  O O K  z z z z((Wf~[/.54d(6 r;; W  T T ) ) ) ) ---  T T j j j j nn ? ? ? ? CC T TX  d XXXX   3787Z6)$9!ll i  K SS SS O O O O    cc888888 c -------- -- j j j j CC 1  -- nnGGXX\!! \rrIIIIII3333333^^^^  ^^ !!t  O OS S O O z z z z (WW_[jb$&"R SSr++++SS O O XX T T | | -- --  X j j j j nn ? ? ? T T T TXX XX O_f:357E886/;"_tlliiii S SS O O O O _ _ _ _cc c 8 cc         -11 )-- j j j CCCC1  )---- nn  GNG XX d``Xr p pIIIIII333333  ^^^^ !tt t  O OS S O O z z z z( [( z z SS++ ++SS O O XX T T | 1 -- -- X j j j j nn ? ? ? T T T TXXXX O%15R5R463. X)lliiii  S SS O O O O _ _ _ _cc c 8 cc        _ _ -11 )-- j j jrr CCCC1  )---- nn  ^NG XX ``XzrIIIIII 333333    ^^^^ !tt   O O  O z z z z(( +~~ S+ ++~ $~~ O O O ) --  T TXXXXnn   nn  XXXX` T T O OSSSS~ B%k( 2G77Z6%SS  O O OSSSS _ _       8888 _ _  _ _   ---- j  ? ---- nnnn N\\ dd\XXrtttt MIIII33 bbtttttt  O O O O O z z z z z z SS +++~~ S O O O O +++~~~ O  ) ) ) --  T TXXXXnnnn nn ? ? XX  T T O OSSSS=#c043K#1iiSS SS O OSSSS _ _       8888 _ _  _ _  ) ) ) ) ) ) ---- j  ? ----    ds8{lrtttt MIIII33 bbtttttt! ii  O O ( (( SSSS ~~~~ O O ~~++++++ XXXX 11 1  T T nn  XX  T T O OSSSS W__x- %!!ii eSSSS  SSSS       888888g _  cc _ _  )  j JJ------  1#vvr  T ("-,v"``ztt  M IIII33337 bbtttt t ii WW O O ( (( SSSS ~~~~  ~~+++++n_ XX  1  T T nn XX  T T O OSSSS  __%)!lii eSSSS   O O SS         88888888g _  cc  )  j JJ---- 1#}'rr   17J84%`tt!! MMMIIII33337 bbtttt| t O ==== e e e e === O SSSSSSA AA\M== T T  T T  J NN NN J N yy"""" e eiiii )1~W  HH D D ssssss T TXXXX-- nnnn nn J J  J J          g5-XXXX\\G nnn$A58 8 5X%2#CCJJ((,,,T,  (> OWW ====== e e e e === O SSSSSSA AA==== T T  T T   J NN J N yy"""" e eiiii'#++++~ W HH LL D D s(ss T TXXXX-- nnnn  j j J J         gg;;D5-XXXX\\^G nJJN(Q25X/}#CC,,,s_, ,,( WWWW == === e e e e == SSSAAAA= == T T T T T T - T T T X J J NN &&&""""ii i1'1(wJ~~~~ O @  D D ssss XX -n nnnn j jrr J J QQgg!-.*y\X\\VGG n#}RJJVu#%vnnCCCC { {,,,,c# W  $ $FFB WW== === e e e e == SSSbAIXA= == T T T T T T - T T T X  NNNN NNNN &&&"""" ii i!H~~~~ O   D D ssssss XX- n nnnn j jrr J JQQa  ,%1>.= \\N  n#zvnnCCCC { {(( ,, !G7 W  $ $B j=  9 9 9 9 9  O O W $( 6M=== ==== T T T T ---- | ) )  NNNN NNQQQQ  u u u u u e et||3~(( O SS HH HH D D HH HHHssss---- j jnn  j J J Qa%Y   _  9 111 d\\\JJnnnn#+"$fGGG##vCC ((cTT { { {, BB$!j=  9 9 9  O O f$45*\ ==== T T T T ---- | ) )  NNNN NNQQQQQQ u u u u u u u e e e e~~(( O SS HH HH D D HH HHHssss---- ) ) ) ) j jnn  j NN  Q) /%i _   _  ss9 111 \\\\nnnnnv VGGGGGvCC (((([[TT {, j/=  9  e e =  O O O /|2( AA == T ---- T T T T NNNN QNNQQ"""" """ e e e e elll~~ z z z z SSSHH HH D D HH D Dss! -- ) )  nn  Q'-!gg     ckk 1 dd \\ CCnn vNNGG   (((((,, [[=  9   = O O O O O'M==  == T ---- T T T T NNNN QNNQQY"""""}"" e e elll~~ z z SSSHH HH  HH wwss!  --  nn  QQp%gg   ggc 1d\\ CCnn GG   ((((((,,,, -!M++ e e   ==== e e O OW ~~~~33lliiii  \ \ QQ&Ey""  J J 6==~~  z z z z z z ! ss  p p   p p%wwwwwXXXX T T T T CC   "" u uyy&&Yggcc cccc 11119"dnnnn vNGGGGnnnn  ?CCCC T (((((((( TT,,,,u01&~~++ ii ==== e e O OW ~~~~~~++iiii  \ \ QQ .H(U."" J J J J  ==~~  z z z z z z! ss  p p  %ww%%wXXXX T T T T CC  GG""yy&&NNQQ  cccc cccc 1111%[2.dnnnn vNGGGGnnnn  ?CCCC T(((((((( TT(( ,,'+," & z $ $~~   ==== e e = == O O~~~~++~ $ e eiiii e e eiiii T T T T  XXXX T TY***85 3"."" J J J == ==== ~~((((( z z((( ssss w  %%%%,`XX  T T  ? ? G"""" yyNNNNQQ    cc cccc ) )1@D(&,\ nn nGGGGnnnnnnnnG CCCC TTTT(( { { TT {((m"q z $ $~~ii ==== e e =  O O O~~~~ ~ $ e eiiii e e eiiii T T T T  XXXX T T9* &)'U""QQ J J J == ==== ~~(((((((( ssss w   p p%444,  `XX   ? ? G"""" yyNNNNQQ    cc cccc ) )pw\   nGG GGnnnnnnnnG CCCC TTTT(( TT {((mm"(((( ziiii ====l==  O z z z z z(( llXX XXX T TXXXX\  -4-X**A&""  Jii ii 9 9 ==+ + ~~~~ ssss! ! ss p p   %%,<K   \ CC CCCCCC & & J JQQcccc cc1 --    \ CCCC  j j nnC  TT(((,,TTTTTTT(( { {((mmmi (( ziiii ====l==  O z z z z z(( || TXX XXX T TXXXX\  "484#& u u""  Jiiii 9 9 == ++  ~~~~ ssss ! ! ss p pss %%,<[',*3_d  \ CC CCCCCC & & QQcccc _ _ _ _ 1 ---\CC  j j nnC   TT(((,,TTTTTTT(( { {((mmmi (( ====t = SS z z(((( e e e e iilllXXX    T T T T N.s30 }}**&&& """" J J J Jiiiiiiii == $~~ $((((~~ ~~ ss sssswww%1N50%v   XXX CCCC &&&  Jcccc _ _ _ccc -- \ nnCC  j j CC CC WW TT(( { { TT(((( eiii(((( z z  9====ll)!! = z z z z (( e e e e iit!!lttXXX   T T  T T T T ]a5% A""&&& """" J J J JiiiiiiiiAA == ~ $~ $((((~~ ~~ ss ssssww,K#/2R.B!fG   Q XXX CCCC &&&&&  Jcccc _ccccck-- \ j jrr nnCC  j j CC CC WWTT(( { { $ $ TT(((( eiii SS ((((ll!t== = ii == == 9 9 A\\    X1  T TXXXX -CC<<G $"kcc      gg 88SSSS((((((((  ==  == HHHH !ss  f.%&!Q}+ j  j nnCC & u uNNNNNNNN 4 4 <<GGCCGGC11----  nn nn CCCCXXXX  P P(( { {((((,,((BB SS ++((((l== = iil == == 9 9A# /;/;#\\  hh 1 XXXX - // kcccc      gg 88SSSS((((((((  ==  == HHHH !ss   fi.2}"v j  nnCC & u uNNNNNNNN 4 4  CC GGC11----  nn nn CCCCXXXX P P(( { {(((( ((BB SS ~~++l== ii e   I/;66+,9l  %    4@kc   _ _    8888  ((((((((  ======HH HHssss^iqqm#n nn nnr'#nnn ?yyyy u""NNNNNNNN 4 4 4 4  CCCCGG11  nn nnCCCCXXXXTTWW {  (((( ((BBB SS ~~++l e e e e== ii==  '1C1C%l *,&%9  5 4 4 4@ c       8888  (((((((( ======HH HHssss^^^ffnn j j nnnnrrnn  ?yyyy u""NNNNNNNN 4 4<< G CCCC CC11  nn nnCCCCXXXXTT  {((,,(((( ((JBS O O O~ z z(( e e ==== ll  9 AA X=\s%5B6/+1 | --- T T T T ) ) )11 48@ cc _ _cccc8888SSSS z z z z~~ ====== == ==== s! ss^^^^^  bbf rrnn nnnn rrCC CCC """" u"" 8888888888 G CCCC 5  nn CCCCCCCCTT( ((((,,BBFS O O O~(( e e ==== llllXI  9 AAtx\!135B081 | --- T T T T ) << 4 cc _ _cccc8888SSSS z z z z~~ ====== == ==== !!s! ss^^^^^  bb^ nn nn nn  CCC CC "" u"" 88888888 4 488 GGGCCCC 5  nn CCCCCCCC\\TT(,,((((,,BBJSS O O OWC~(( e e ii==== e)t 9 AAll\\! !1 -- T T T T T  <<@Ggcc    cccc 8888SS ((((++++== ==== ssssss ^^ ^^^^  ^^rr n nnCC C  u u u""""Q NN  4 88 GCCCC 51111 1 nn nnnnCCCCC\\\\[[, ,,(( { ,BBBBSS O O O W3~ z z(( e e ii==== !'$gA 9 9 9 9  lii\\\ll1 -- T T T T T  <<@Ggcc   g cccc 8888S S (((( ++== ==== D ssss   ^^  ^^  ^^rr n nnCC C  u u u""""Q NN 4 88 GCCCCGGN L=1111 1 nn nnnnCCCCC\\\\[,,,((0,BBBB z z ~~S OWW O O O O  e e == =!1n6+3v!Uii e e e e 9 9 9 9==== iiiiii-X XXX -- ksk < g  gcccccc(((( z(((( z z zii ii  p p !  D D D  ^^   ? ? CC ? ?CC  u""""""}" uyyyycccc    888 88CCCCCCCCCC&3.R$,5  n5WWW,, T,,,,BBBBF> z z ~~S  O O O O O  e e e e =====*42!Uii e e e e 9 9 9 9 == iiiiii-X XXXXX --k !VGzk g  gcc(((( z(((( z z zii ii  p p !  D D^^^^ CC CC ? ?CC  u""""""}" uyyyycccc    88888CCCCCCCC&/5/X5  #==5W ,, T,, BBBBF> S O O O O O O e e e e e e == El!0{\ e e e e 9 9 == iiiiii ------XXXX XX -k+}4I,*k< 4<< gzcc(((((((((l iii  p p ss   ^^^^ ^^  GGG CC ? ? ? ?CC """"""""""""yyyycc    8888CCb '"$-XX  GrrvDWWW (( W TTTT,,,,,,,,BBBB v v S O O O O O O e e e e e e EM e e e e == iiiiii ------XXXX XX kz$.,*?< 4<<oogzNGscc(((((((//l iii  p p ss  D D  ^^ Z Z ^^ G CC CC """""""""""yyyy cc    88CC -XX  GrrvL WW ((00W TTTT,,,,,,,,BBBBF(( $ $ $~  O O O O   Ei    e e==== ii  -- |  ) XX T T  --c /<<< Co33cccc++++/// e eii ssssss HHHH    CCCC ? ?  ? ? u u yy&&yyyy""""    cccc 4 4<< G CC55 r' TT ,,<[TTTM $ $ $~  O SS O ii == ==i    e e==== ii  -- |  ) XX T T 11--ckkkc<< <C$ R+&!wggcccc z z z z++++/////ppllii ssssssLLHHHH^^ bbCC ? ?  ? ? u u""yy&&yyyy""""    cccc 4 4 4 G CC55 rrD TT TTTM" z z $~~~ SS W  a iiiiii 9 = e e = ii ii - 1 XX  T TXXX 11-c << <K,gcccc z z++++/pplliii  ss !ssHHHH^^  bbbJJJCCCGG  u u &yyyy u u u u   _ccc <<GG GCC -\\\ nnnnr[[ P P < TT((((FM%2 z z $~~~ W  iiii 9 =  e e = ii ii - 1 T T T TXX X  kkc << wg cccc z z++++/lliii  ss !ssHHHH^^ Z ZbbbCCCG^  u u &yyyy u u u u   _ccc <<GG ? CC -  \\\ nnnnr ,,TT((FM(5~  p p   cc     UUNN & &&     cc cc    N J  N ) )  T T --\l0{zn  CCJJvvnnnn--59=Dp`\XX T J J QQQ 88  _ _ ggo,44wHH#%  Z Z^^^^ ss!  p HHss www// z(( ~~WWWWWWG+~~!!ssHHHHNNNNNNNRR<< ]]e(g  p p   cc  ggY  N & &6&    cc ccgg  N J  N    T T --\\0{z n  CCnnnn--5--9=c\XX T Q 88  88 gg$~<DD4,HH/3*t&^^^^ ss! %  HHss!!w/// z z((((++WWWWWW OG"u' ;+~~!!ssHHNNNNNNNRR< <]]ell  p p _ _  Y-xmyyyy &&      oo  J --  T T | -- \\  ddrrnn CC Cnn j jnnnn 555@\!($<whd \\XXYii 8888 88ggo$~ cLLi.&d.'bbb^^^^ss ! !s HHHH HHsss<7((((((((~3;f!'2^3~~ p p!!ssHH LNNNN RR 99]]  e  p p _ _ _ _  "0{-yy& &     $o  J -- ) ) T T 1 --\nn CCC#+vnnnn 5@&2 65.!Kd \\XX J ='U 8888 88ggo~"j+0-$r<LLibbb^^^^ss! !sHHH HHHss()/'((((((((&.??3~~ p p {ssHHLNNNN RR@@ ]] e p p p p  _ _   _ _ _ _o'X/w* |UU u""""   _ _ _ _ gkcc J J J Q-- T T T T T T  ) --` j jnnn  'vnn j jr--19H&48#8#65B+l XXXX J JQ"*2,!NN 88 cck /'485]->4PHHbbi^^  !ss p p ss!!!!L HHHH%!262f(((~~~~+;+&SS[33~~ p pss !HHNNN RRR<<<<<<@]]] p p p p _ _cc   _ _o))t] u u u""   _ _ _ _  cc J J J QQ ---- T T T T T T  ) -- j j j jnnn  rvnnr---O8#8#8#765(fld ``XXXXQ|"#!tN 88 cck ?&z264*PHHHHbbbb^^  !ss p p ss{{{{LHHHH'->)/(((~~~~+SS[~~~~~3wwss !HHNNNRRR<<<<<<@]]] p p p p _ _ _ _cc _ _   UUNN u"" u u u _ _   _ _ _ cc J J  ---  T T T ) ) --   Cnn r j119 .8#8#67J7J5B#!l\XXXXXQQ ]NNN<  ccc(['+7+7#K,PHHbbbb^^^^  ssss ss0[%%DD7((~~~~+33SS~++~~~~! ssHHNRRRR<<<<<<< ]]] p p p p p p _ _ _ _ cc  _UNN u"" u u u _ _   _ _ _ cc J J  ---  T T T ) ) --  C   r j11119H"{468#7J7J/@\XXXXX UUUNNN<  cccs(K<PHH^^     ss ss&# %%((((((~~~~ +SSS~++~~~~ p p! ssHHHHNRRRR<<<<<<<]]] D D   _ _cc 8@ 4 4 NNNN  NNNN _ _ _ _         NNNN\ -- T T-- ) ) j j nn CC j j j j GCCCC@"{,3f4/+ Gsh------""""}}NNNN888888@@888CCC@@,HHHHH 666 ^ Z p p   !%%.&z<%!!ssLL SS  OSSS(((((((((((( ssssssww!!! +RRRRRR<<hhdd.222 D D   _ _ 8@ 4 4 NNNN J J NN _ _ _ _      yy NNNN\ --  T T-- ) ) j j nn CC j j j j GCC1=L !$W(h------"""" u u""NNNNNN888888888C000wHHHHH 666 ^ Z  p p   !<K%!!ssLLSS SS  OSSS((((((((((((!!ssssssww!!! +RRRRRR<<hhdd.222 D D _ _  c  4 4 J J J J N _ _ _ _ _ _  yy&   J J NNNN T --   ) )    j j J99 11Tsd`* """NN NN8888888888<<<(,%%HHHH ^^^^ Z Z p ps  ! !%%%ss LL SS OSSS((((((s!!ssss!!ss####}#RR <dd.222 D D _ _  c  4 4 J J J J Ncc _ _ _ _ yyyy&   J J NNNN T T T --   ) )     j j Jg5115Ddd ` u """NN 8888888888<<<{{(wHHHH ^^^^ s  ! !ww%ss LL SS OSSS((//((s!!ssss%%!!ss####}#RR <@@ll.222 HH g  88 J J NN NNgg _ _ _ _  " u u y NNNNXXXX-- \ T T-- -- j j CC f f nCC#0'7519h XX1---- q y"" 88 88wwwwwHHHHHHHH /  V   ssss!!!!ss! ssss HHHH OSSSSW ++++(( z++~~++~~!!ss !ss p!!{!!{!!yy y''' RRhh22225 HH g  88 J J NNgg _ _ _  " u u y NNNNXXXX---- \-- -- j j j j ni"{+'7519 XXXX 1---- q y"" 88 888888wwwwwHHHHHHHH /     wwssss !!ss! ssssLLHHHH OSSSS W++++(( z++~~++~~!!ss !ssww%!!{!!{!!yyy''' RRhh22225HH      88 J J NNNNw$o _  u u u u && XXXX -- \-- -- CCCC nnZ#=, "1 1111XXXX----&& &"""" 88 88888888HH HH ^^^^^^^ssss ssssss!!!  HH O SWW++++++++~~ !!!!!ssww%ssss!!!!'''''' NNR9<hh225HH HH     88 J J NNNN"Z%o _  u u u u && NN XXXX --  -- -- CCCC nny'!6Z==1 1111XXXX----&& &}}"" Q 88 88888888 88HHP ^^^^^^^ssss ssssss!!{! HH O [[WW++++++ ~~ !!! ssww%ss!!{{''''''''NNR9<hh225  22 NNNN""""yy N  J NN,.& NN _  cccccc  _ _nn nr nnn  r-- 1  ) XX\\d(s11  11""& yy*""y&  """" u u""sssswws00! HH D D / sssswwHH S SS+====iiii    ^^  66Hddhhhhhhhh@@@ 22 NNNN""""yy N J NNN&&& NN _  cccccc  _ _   nr nnn   -- 1  ) XX   \1111 11 u u"" &yy*""y&  """" u u""sssss{{ss! D D / sssswwHH S SS+====lllliiii    ^^  66Hdd  hhhhhh@@@aa  NNNN""""    J J J NN U99yyy  N _ _ _ _ cccg   ' nnnn    -- ) ) XX \\\\  111111111551111\ u uyyyy""""&&yy J "" u u u""  pss!!!!ss HHLL 66bbssss  SSS[[;=AAAAlliiii    6666hhh@@<aaa + NNNN""""    J J J *yyy  N _ _ _ _ cg   r' nnnn     j j-- ) ) XX \\  11111115511\ u uyyyy""""&&yy J "" u u u"" pss !!ss HHLL bbssss  SSS[[R=AAAAlliiii^^    6666ddhhh@@9@@ 22 J  J yy   q q  J J J J J NNNN" J J     [ [ jnn jnnnn j j j jnn ---- ) ) )-- XX XX ----5=1@9\ T T """"""  J}}""""ss  p p DL D !! 2222   bbb ssssss D D [$}&/lliibbHHhhhD<<<aa 22 J  J yy   Q J J J J J NNNNyyyy u u" J J      j nn jnnnn j jnn ---- )-- XX XXXX --55D LPo_\ T T """"""QQ}}""""ss  p p DL  D !! 2222:  b ssssss D [#"%*V/iihdD<<<aaa 22 J J J   J J J J J J J J  "" u u J J J J _ _ _ _ c cccc nn jn  rr j - ---- XXXXX ) --5*)T99)2b*CP """"}}**aaQ QQ}}}"""""    p p   Dssss2222^^ss ssss LLSS?E==llllii Z2hhD<<<<aaaa 22 J J J   J J J J J J J J  "" u u J J J J _ _ _ _ c cccc   jn   j ----- X XXXX ) --5\99%.R+ """"}}*pQ }}}"""""    p p   Dssss2222222^^bbss ss LLLLSS////77EEE=EEllllii2hhhh<D<<<<<<aaaa y u u"" J J "" u u"""  yyy    u u u u 88 4 4 C nnrr XXd  TXXXXXX 19@111 NNUe*8(}} u  HH  HHHHHH ss p p  HH22  HH HH ps0+~~~~ +WWWWWW__xAA:<<<<<<<<hhhh@@ y""  "" u u""" J J yyy    u u u u 88 4 4 C nnrrXXdsdXX T XXXX 111191  NNNNUeeU}} u  HHHH HHHH ss p p HH2266 HH HH ps0+~~~~ +WWWWWWppiAA:<<<<<<<<<<hhhh@@   "" J J J J"" u u"" u u J     u u u u u u"" 88 4 4 C C nn n \XX  X \\  111111 )--UUNNQQQ NNU&""""  H HHHHH ss pwHH22> 2222HHHH p p p!{{{+~~~~~~WWAA26666::<<<<<<<<<<<hhhllll9@@5552   u u"" J J J J"" u u"" u u J     u u u u"" 88 4 4 C C nn n`` \XX T T X \\   --eQ NNU.&&""""  H HHH ss pwHHHH22 / 2222HHHH p !!!+~~~~~~WW_pp26666<<<<<<<hllll@@555992^^^^yyy yy N yy J J JNN u u u u y   4 4 CC nn j j j jnn nnnn d XXXX XXXXXXXX\1 -- 1--1]NN&&yy& &NN NN H ! !!HHHH 22 2222 sss(( + +W WbAA66666666PPPD@@llD55^^^^.y yy N yy J J JNN u u u u &&y  << 4 4 4 4 CC nn j j j jnn nnnn ,, XXXX XXXXXXXX\  1 -- 1 --1"1&&yy& &NN FNN H ! HHHH 22 2222 s(( + +W WAA22666666PPPDllD55 Z Z   f  NN &&yy  J J QNN u u""yy y<C 4 4 CC CCCC  j j j jnnnn nn`pp\ T T XX XX TX  XX\ ) ---- ---]$0/w'X"]UNNNNyy&&yy &NN NN L HHHH ss ssHH  66 22 L !!(((~~ +WW Wp666666DDHll@@@@99 Z Z   fE .&& NN yy  J J NN""y=y yK 4 4 CC CCCC  nnnn nn ``\ T T XX XX TX  XX\ ) ---- ---".774#UNNNNyy&&yy &NNNN NN LHHHH ss ssHH  22 22 L !!(((~~ + WSSpii666666DDll@@@@992222k g     c _ _ _ _     5T`XX T T TGGGG  CC ? ?    c    _ _ _    CCC Gnn            _ _     88Ut,562NNN    cccc   2222222222222  ^iiii== ==SSSSSS[~~~~((=====AAAAAA =lllWWWW/++ i  5599aaaalll222222c     _ _c _ _ _ _    115 L`XX T T T ? ? CC     c    _ _ _    T T CCC Gnn            _ _    _ 888888U %P+'NNNNN    cccc   22222222222  ^iiii==  ==SSSSSS ~~~~((=== ==AAAAAA =lllWWWW/++++e||iee559999aaaaoolll22 22 _  8 _ _ _ _     _ _ _TXX ?     cc 4   _ _ _ _  8\\\  )1 CCC  nnnn      ccc g _  _ _ 8 88 etxiQNNNNNN    cccc  cccc 222222^^  b == SSS ~~~~ z==AAAAAA==llWWWW++'# ee 99aaah22 22  _  8 _ _ _ _      _ _ _55XX ?     cc 4    _ _  8\\\\\  )1 CCC ? ? nnnn      cc c g _  _ _ 8 88 NUYQQNNNNNN    cccc  cccc:::::222222^^  b == S ~~~~ z==AAAA llWWWW++1&_% ee 99aaass2222    _ _ _ _ 88       _ _ --XXX  ?    cc   <<< \\   ?  j jccccc cc _   cccccc88 QQ QQ J J cc   g 66Ba#-B22 2  Zbbbii AASSSS ++ +~~== AAAAAA==llllllllWWWWW /EEEEaaplee==9999ooss2222   _ _ _ _ _ _ 88         _ _11 -- X   ?    cc   << <<<<<\\   ?  j jccccc cc _ _ _   cccccc88 QQ J J cc   g !%66B,$ 2  Zbii AASSSS+++++~~== AAAAAA==llllllllWWWWW /EEEEaaiiee9999ooooss22 _ _ _ _  88 0   _ _gg       XXXX XX  ? ? ? ? ? _ _  _ _ _ <<<<<<    \\--  ? ?  j j j cccc   _     cccc8888 Q  J J cccc      BJ>QB 2222bli iiA AASSSS +++~~E 9 9AAAAEElllllWWWW//~aaaa  ee==9999e oos2222 _ _ _ _ _ _  88 0 _ _         XXXX XX  ? ? ? ? ? _ _  _ _ _ <<<<<<    \\--  ? ?  j j j cccc   _   cccc 8888 Q  J J cccc      : 2222bliiiA  SSSSSS +++~~~~E lllllWWWW//~aaaa  ee==9999eoosss ^^ V 4    cc         T T CC  cccc    _ _ _ _ _  @<551 -- ? C 88  _  8888 48888}""" u u""  88   g     ^^::6222222 A == ~~ ~~ ((~~~~iiiiiiillll~~~~++++++aa=iiiiDDD ^^ V 4    gcccc          CC ? ? cccc    _ _ _ _ _  88@551 ---- C  88 cc _  8888 48888}""" u u""  88<<ggg     ^^6222222 A == ~~++~~ ((~~~~iiiiiiillll++++++++aa===iiii^     gcc c c       XX CC ?     _       88OK51 11--GGGG CC 88cccc8888 <<8888}}"" NN 88C  ^^^f ^2266 /22 6 66 222 == +++++++ ((~~~~lliiii E==ll++++++++ppaa==eeeeaaiiiL ^    cc c cgg     XXGGCC ?     _      4 488@@@K==599111 ----   88cccc88 <<8888}}"" NN 88  ^^^f^2266 /22 6  222 == +++++++ ((~~~~iiiiEll++++++ppaa==55  eeiiiL   Z <       _  g _ _  TXXXXCC ? ? ?   _ _ cc _   _ _ 8@@@KK5---- ; CCC   gg 88 8 888}}""""}}NNNNNN bb22 22 2222==  9 ~~+++++ ~~~~iiiiiiAAAAllllll3//++~~ll    aa99ieelliLLPP  Z <     _   _ _  TXXXXJCC ? ? ? _ _ cc _  < 8@@@KKLD---- CCC   g  88 8  888""""""""NNNNNN  bb2222 2222==  9 ~~++ +~~~~illiiiAAAAllllll~//++ll    aa99ieelliLLPP 88<                    T T X u+)i C _ _  cc       4 8@@@@D=55----CCCCC ?G  88       8888 88"""""""" NNNN 88 _ _bb Zb 222 6 2222==== 9 AAA A~~~~~~~++++tiiAA==llllll++++//3++eee aa9eiiiiiLTP 88<                gg \\X %$AJ C _ _  cc      4 8@@@@[[55----CCCCC ?G  88      8888 88""}}""}} NNNN  Zb66222 6662222==== A A~~~~~~~++++((tii ==llllll++++//3++teeeaa9eppTHH cc88y yy y  u""  rrG^^RCC  ? ? 8 88  4 @@ 3L=\nnnnnnCC NN NNNN"""""}""  J J  4  Q  QQQ ss!!%!!!! Zb22  ==AA i ii/(//((++~~ iiiiAAAAAAAAII~~vv$$z(++~~/33F>HH cc@y yyy  u"" rrGGCC  ? ? 8 88  4  ,C\T=\nn nnnnCC NN NNNN"""""}""  NN 4 Q  QQQ wwss!!%!!!! Zb 66 ==AA i ii/(++~~ iiiiAAAAAAAACR$$z(++~~~~337>HH D cc cc@@y  & yy """" nnnn nn   88 88  4k( R sL=``\ nnnnnnCCCC GG  NN u u"" u u NNN NN  ww !ww ssb6 6======== Aiiiiiil++~~ pAAAAAAAAAEIQ#i~$zz((~~~++!&u3FHH D cc cc @y&& & yy """" nnnn nn   88 88 << 4@@k(#%%#(k=``\ nnnnnnCCCC NN u u"" u u NNN NN   !ww!!ssb6 ======== 9A iiiiiilll++~~pAA==AAAAAAAEI;~~$zz((~++"f3FFFGG T XX440000,,,,,,   MMMMMMMMM  bb    ;;  ?||||--`x1!) -*(!{44     0000 X X  \\8  ))||))||&&|||| tttt!!IM IIIIItttttt! M MMMMMMdddd@9999NNV5.YaaOOOjffnn'''yyyDGG T XX ,, 0000 ( (,,,,,,   MMMMMMMMM  bb    ;;  ?||||--`x)232:.*& 7{k44     0000 X X\\\\ ]]  ))||))||&&|||| tttt!!IM IIIIItttttt|!M MMMMMMdddd@9999NNV5.YOOOjbffunn'yDDDGG  XX,,,,,,,,00  ,,,,,, MMMMMMMM  bbb     ;; ;; ||||-`$P17C7C502%^k444  \\\\00  X X  \\00 00 UUU  U M ||||||&& ))!!tttt!!IIIIIIIItttttt!!MMMMdddd99NV.5aOObffnnu:nnnr'yDDDGG GGXXXX,,,,,,,,00  ,,,,,, MMMMMMMMU   bbb     ;; ;; ||||-`$P17C7C64B)nk444  \\\\00  X X  \\0000 UUU U  M 11||&& ))!!tttt!!IIIIIIII Q% ptttttt!!MMMMdddd99NVVVVV5aaaOObff: I*nnnrr''.DDDDGG GG   ,,, MMMM 77 b  f?? ;; --#L2/7862'C,g00  X X0000 \\```QQ Q))||&&- ||!!!!II III MM!!! x!!!!xxxx%% MMMM    hddRRRRR^ 522  ]]OOfr6}}2#u'y'..DGG GG   ,,, MMMM+! 77 b  f?? --!. 6?76/%C,g00 000044 \\````` -QQQQQ)))1||&& x))||!!!!II III MM!!! x!!!!xxxxXMMMMMMMM   hdd RRR^$(   ]]j*/*}nnnu'y'..DTGG GG XX,,  ,,00 ( ( ( (0 MM 777777 f ; ; --h"-r4752*r Ko88  X X000044\\ \```  YQ))|||))&&||||!!!! IIIIMMtt %%!!!!xxx%%QQMM M  hhll<<DDDRRRR(+G =   e    n#&573"nu'.6TTGG GG XX T T,,    ,,  ( ( ( ( 0QQQQ777777 f%O???; ; %&.0'.&b,o88 - -  X X000044\\ \`  ``  YQ))|||))&&||||xx!!!! IIII tt %%!!!!xxxTTMMM hhhh<<D^RRRR  =   e    W'rn#.3/!*nuyy'...66T Ts ,,   T T T T  XXXX%%%9|xx%%%%%% 7  fv33ggn ;;;;;;;;-))15E\# ')8& 0{ogg``` X  \\\\\\ X X 800044  \\\\\\0000&& ||||||QQQ|||||||IIMMIIIIxxx!!||)%%5<<hh T%%xxxxxx99[$(e+}}.. ]5555m'FF uFFFF}}66,, 0s ,,   T T T T  XXXX%%%|"xx%%%%%% 7 fnnggg ;;;;;;;;---))15"s##V0{ogg``` X  \\\\\\ X X 800044  \\\\\\0000&& ||||||QQQ|11||||IIMMIIx%%xx!!)5D[,,whT%%xxxxxx99.^2m$+}} ]5555SN^FNNFFFF66!!! ss    T T T T 0 XXXX%%  xxxxxx77      fffgg gg;;;;;;;;&))5E d"s& {gg ``` X X\\\\\\   X X 00044  \\    0||||||)&& )9A1|| II IIxxxx|| 1-$s(($,dTxx%%%D "/U6.+''   e]]]555555KKFFFFFFFFFFRR}:6FF"< 4"""#?ss    T T T T 0 XXXX  xxxxxx77      f  gg gg;;;;;;;;&))5 #V 0 ggg ``` X X X X\\\\\\  800044  \\    0--||||)&&||QII IIxxxx||1_03'~@<!-440%Kw Txx%%%6.+++''   e]]]555555KK??FFFFRR}:6 "<#""%G%G'Os ( ( T T T T XX t t t t t t"" t t""""     _gg ;;----5==L{gg```` X  \\\\\\\\   0      4444----))))&&YQ--MMI !tt!!tMMQQII !ttt!!!|9!g/2R&9<'(48753'{hXt!!!!tt DD+}}}}y'}}++  ]]]]55KK;;BJVVF!M#$&K'+)'s ( ( T T T T XX t t t t t t"" t t ""     _ ;; --5=sgg```` X  \\\\\\\\  0 - -cc    <444--))))&&YQ-- I !tt!!tM !tt t!! !)9P#07f61#&OhXt!!!!ttDD+}}}}y'}}++  ]]55KK;;B?JVVFF!M"&K'*[+/--  ww$  ( ( ( ( ( ( XX """""" t t"""" t t"" ;;  bb  gggg 7 7;;;;&==kgg```\\    c  X X \\000000 44\\\ c444)))) xQQ---TTMMttttt!|t ! t))---D c(,/&0{hXQ!!tt !!dlhhhh<}}}}+}#''yy+++    55555555;;BBFFFJVV $%])+//110r  $ 00  ( ( ( ( ( (  """""" t t"""" t t"" ;;  bbffgggg;;;;&--=kgg```\\     `` X X \\000000 44\ c"'r4))))-QQQQQQ---MMttttt|\\\\t ! t||- c$G!lhXQ!!!!!!dlhhhh<<<<<}}}}+}#''yy+++    55555555KK;;BBFFJVV %]&+.j0r3'333'662 P T    ,,,, BB BBBB t t"" QQ7777 77 3;;;; ;;gg ggQQQQUU55Ru qq 800 0  4000J2BBy))))) ))jjjjgxxxxtt!! M If 33333MMMM9HJ??   yy''yy''VV@@<a]  a    e  77dw%G'-1144625 2  T    ,,,, BB BB t t""  7777  3;;;; ;;gg QQQQUU11R qq 800 0  4000J#}}}yqq)))))))jjjjgxxxxtt!! M IIjvf 333MMMM%9RRJ????   ''VV@@<a]  a        77nndo$, 4!8"%G'+/3'57626 62222 X T T,,,,,,,,BB BB BB t t""  7777 7777 ;;;; ;;gggQQQQ11RRJJuu n nqq00880 0000 40044JJJJ##)))| gggxx!!ttjnff3MMMM%|C??  bVVV9a ea]]]7frrrdd!"!!8"%G)W-0r367762 62222X ,,,,,,,,BB BB BB t t"" I I 7777 7777 ;;;; ;;gg gQQQQ11JJJ0000 0000 40044JJJJ##uu-- ")))1 ggg!!ttjnff;;333MMMM%xx!|))77  bjj..uVV9Da ]]a]7ffrr'dd!)+&#"%G)W,b/36626262  22  ( ( ,, > > > x%%"""" I  7777  7  ggQQQQ Q--JJJuuuuu004400 0000 44JJuuuu#|) ---nggjjjjtttxxxQjj !!!!%%xxbbjf'-+=R@@@@<<<<  ] e  f##``  o,#-f0*%#?$(*.3}2#5766  22 00,, > x%%"""" I  ;;7777  7  ggggQQQQ QJJJuuu004444000088844JJuuuu###|)---nggjjjjjjtttxxxQIIb!!!!xxbbjvQ+0(R@@<<<<  ]aa e]  BB``  ow&''$$%'O(,/n+^155/22 T T T T00  ,,FFFFB  xx-|" t t   7777 ; CggggQQQQQQ&00 444  088444 ####----jjjjjj!! %Ib;;MMM !!!!77773b'i2=2=!:YZRR<<<<9  ]]aaaa    eennnnnnu  hh{ !!$$'O*-f.03'3'5/22 T T T T00  ,,FFFFB  xxx|" t t   7777 ; ggggQQQQQQ & n n00 4448888444 ##uu##9E5--nnjjjjjj!!!!%IbMMTTM!!!!77773b'i33#ZRR99<<<<9  aaaa    ee]aaaa;nnnnnnu    hh {00!$*-f-f-f.0r0r1]]]]      qmmmmBB >MMMMMM )""""      bbbbg gg g M QQQYu JJ44``````  uuuuuu##]l|]]]jjjjnnQMMMMbbbb f77-<xxxQ f  b;; "*"*M..RRRR<<<<<<h hh9995555555;??nDL[! &v.1/C+*-;.-]]]]      qyymmBB >MMMMMM )""||      bbbbg gg g M QQQY**u JJ44``````cc##uuuuuu##]ll]]vjjjjnnQQQMMMMbbbb f77 xxxxQ f  b;;F++}}RRRRRR<<<<<<h hh95555555;??nDW#)+,)*&v)+*)   ,,,,\\y=2" BB MMMM M)"""")      bbbb bbgggggggggg  QQQQYY} n n n 4400000000 `` ``cc  ######uuu  lJ!ZvnnjjjjgQQM MMMMMbf x--%xx^^^^b;77??''}}}R RR<<<<<<hhdd22==5555=BJ???j!%$o##%&v&v   ,,,,\\/.} BB MMMM M t"""")       bb bbggggUU QQ#} n n n 4400000000 `` ``    ########uuu U];+nnjjjjgQQMMMMbf x%xx^^bbb;77''}}}RRR<<<<<<hh225555=BZ???jLPPP!#! ! #%% ]],,,, \U+*}uBB BB I I MMxx xx %        bbbb gg jjjjggU   QQ## qq JJ00 4\\    \``````&&&&###YYYYQYYY``vnnjjjjMQQQbbbb  ;!|)xxxMMMMbbbbj777777}}}}}}RRRR<<55555599VFFj5555DLT "!c !c" ]],,,, \E2*BB BB I I MMxx xx %  ff    bbbb gg jjrjggU UUQQ QQ## qq JJ0000 4\\    \``````&&&&}###YYYY QYYYvnnnnjjjjM QQQbbbb  ;|xxxMMMMbbbbj7777}}}}}}RR<<555555FFj5588DL  Y Y ]],,,, ( ( &&6Q!`uBBB MMxxx        bbbbjjj'rgg UQQ uqq J00 44 0044\    ```````&.&&y&uu##YYYYYYYYnnnnnnnMMbbbb f  ;;;;;XH-xxxbbbb#}}}RRhhhh5555552999VVjj888<LLLT[ Y Y ]],,,, ( ( q&6&0D$BBB  MMxxx        bbbbjj'#  UQQ uqq J00 44 0044\    ```````&.&&y&##YYYYYYnnnnnQQMMbbbb f  ;;;;;9%w.%w<xxbbbbbb#}}}RRllhh5555552999 uVnnjj-8<TLT R I MM ff#$a:77,,,  T T T T XXXXXX:*2)XF  \\\\\\;;;;;; ?  QQQQUUUU) nvn???yyyy###}}##}}###   gc 7777333QQQQQQQQ#"f TQTMM G.99AA2GGCKKKKKK^NBB;?ryryyy2++ R I QQ MM ff~v77,,,  T T T XXXXXXu**"eF  \\\\\\``;;;;;; ? QQUUUU)YYnn?yy###}}#}}##   gc7777?FQQQQQQQQn   TQXXTMM G.AKKKKKK?BB????r'yyy2*''~ QQ  fnn 77  ,,\  TXXXX nu#]FF  \\\\\\  ;; ???? ?? YUUU-YYYYnnnnG&&##***   gccc;;777?FQQQQQQQQffff f  MMX`\\GGKKvoo222IKKKKK?BBBB???BByrryyy***''$~ R` f  77  ,,\\   TXXXX nu#NNFF X X  \\\\\\  ;; ?????? UUU-YYYYnnnnGGGyy}}*   gccc;;7?QQQQQQQQQQff   fffjMMX\GGvoo222292GGCKKKKK?BB???yyy***r'$ N\MMMMUUMMff7777 ,, ( XXXXXX  T  # FF\\  X\\\\;;;???? UUUU)1UUUnnnnKKGGyyy&&}}`cccccc``7;;;;MMMMMMbbbbbbbbjjTTT\ "\QQQ o2222...KGGGG7;BBuu###uz zr NRMMMMMMtdUMM    7777 ,, ( XXXX  T T   n B FF\\  X\\\\;;;?? UUUUUU)| nnnnGGyyy&&}}**`cc7;;;;MMMMbbbbbbbbbbjjTTT{$-0v(WlQQ o2222...KGGGG777;BBuu#urr  RRM MM\ MMMMMM    bb7777  3     XX XX\\\  FFFF \\    X X  ;;;;QQQQUUUU)|]]nnnnCGG&&.&}}}}}}}}   gkkgg??;;;;;MMbbn\*_47:7:4+ oooo.2222KKKKKGG7777;;jnuuuu##kkk RRM MMUMMMMMM    bb7777 3     XX XX\  u FFFF \\    X X  7 7;;;;QQUU)1]]nnnnC&&.&}}}}}}}}gggkkkkkkgg??;;;C  \TMMbbbbn\&O37:7:7:7:4(W``oo2222 KKGGG7777;;;;jnuuuu##kkkkk'~~ + ""||%%% %%     bb  3,,  ,,,,,,,,00 (__qqqq# n n n qq0000 4444 ggj n&&&&&-QYU11KVVVYRR&.&@@ogjjjjjC-|)t    ?!07f7f7f777/_HH  $$KK ssssssvvvv  ss????Buuuu##kkkk'~~ + ""||%%% % %    bb ;; 3,,  ,,,,,, C,,!o__qq#u n nqq0000 44 ggjnn&&&-QYU11KKKn#VVVYRR.&8@@ogjjjjjCR-?+7 c-|!    ?-<07f7f7f777/ "))/zz$$KK ssssssvv  ????BBBBBnnkkkko z z~ # ""%%     bb  ,,,,@8o'b55'boqquuu n n 00  nn&&&--YQQYYY]1111##rrVVY.@@jjCC% 44'-|!)!!||^  7777??L(468775*3$2R3#z vvGG..YY  sso    ?BBBBBBBnnnnnnkoo z z~ # "" t t     bbbb 3,,,,_n83((qq n n 00   jj&&&--YYYY]1111KK##rrVVY.....oo)/-?&z-|!)!!||^  7777%-'(2675.C #o'~/z GG..    ss$    777?BBBBBnnnnnnkoog''+ # # """"xx _ _ _ _bbbb77 0000 4G004    __qq ##44  00ggjj))))UUYYYYYROOOvvvvvv]YYkkkf;J@X%%||xxxx      ;;%%5"*3,;%w55<  v...ass zoo$;+ssv77777;??BBBBnnngg'' +~~ """"xx _ _ _ _ bb77 0000  8000     qq 444400ggjj))))UUUUYYYYYOOO##vvvvvv]]]YY6kkkf;%%||xxxx      ^^33;;%%%1@XH-(  v...ass oo~;  v77777;7BBn  gg++~~ xx t t "xx p _ _  bb 777777 00,,  ,\\\\__Xqq u*4444448800 ggUUYY`195555KOOO#~####   YY66HHknnCC|1--x!!xxxx        ;;%%-19)-sssKKC22aass  $+ zz ??77;;?f  ++~~%%xx|"xx %  bb 777777  ,,  ,\\\\Xqq uu#4444448800 gg--UUYY`15555KO#~~~~~  e a6666HHOHHskn#vff||x!!xxxx        ;;%%x|9))%%xsssKKC22aass  ov z 77;;???  _ZRM QQ MM"""" xxMMMMMM XXXXXXXXXX  XX\\\\  RJJNNFF 7 ;;;;???nrrzKKKKKzz''~~zLLLLLOHHHH@@HJRCjjj||MMMQxxxxxx77;;;;GGvv$vvvssGGGGGGGGCCCCGGGGG55        ff^bbjZZRM!Q Q  MM"""" xxMMMMMMXXXXXXXX <4XX\\ B  JJNFF 7??;;;;???nrrzKKKKKzz''~~/7FOLLLLLHHHH@@HJCj%%))||MQxxxxxx777??77;;GG~~$vvvGGGGGGGGGGGG55          ^bbjXXX=UU#!\ IQ  MM""""xx%% MMM_XXXX__\\\\XXX0 44,XX_J   JJR FFFF;; ??????nnrrzKKKzzzz''~~++>OOOHOHH@@@OCCCx%||||MMMMMQxxx??;KK~Z~vvvvv  GKCGG55       f^bPPXXPPqq&iUUQ MM""""xx%% MM_XX XX 0 ,XX  J  JJ JJRVFFFF 7;; ??????nnnnrrzKKKzzzz''[SS[OOOHHCCjjrx||||MMMMMQxxx??;KKO-3/Rv ssGGGKCGG55    ff f^bbbPPPPqq"^QQXXMMMMMMM""""|| M\3~X \\ 8 ,,,,XX_FF JFFF FFFF ;? CCCCv+vnnnrrrvvv'/33SS[[[S_[SSOFCjjx%MMM!!!!77;;GGGG;'y1.+sGGKGGGGK9  ^bbffPPqquu^QQXXMMMMMMM"""""" M%O/,;g  \\  00,,,,_ JFFF JJFF ;? ??CCCC"#nnjjrrrvvv'/33[[[c__nk[SSSSOLL FCjj--x%MMM%%%%!!!!77;;GGGGRR;sGGKGGGGK9  ^bbffXqquQUMMMM"""""""" ,4>2  X\ XX FF FFFF ; ??CCKB.52E&~nnK+7ckggg[[OHHLLJr-%%TMMMMQxtt!!777;;;GGGGOv++$$KGGKKK29bf   bbb fPTqqqqQ'`UUUMMMM"""""""" M\%Z&3X\ XX FF FFFF ; ??CCK3"&"~nnrK+Fccckkkkkg[[[[OLLJjjr---MMMMQx!!77 ;;;GGGGvvvKGGKKK9bf ffbbb fPPLTqqqq%%=%xx Q MM""4 TXX  ,,,,\\uuqqqqFF  qqq ;; ggv+~rrrrzzzzz''//kkrrGG K _WWSLLrvnnTTQQ!!%%bjjnn377vvv  ssoosooossCKKGGCCKKK5^^  j;;PP!|)x%%''%%%-H%xx Q MM""||444,, TXX  ,,,,\\uuqqqqFF B BJJ qqq  ;; ggnrrrr##zzzzz''777FFk r "' ! KCC W[[[SLLrvCCTTQQQQ!!%%%%bjj#n77vvv  ssoosooossCKKGGCCKKK5^^  j??LL!|)x%% zx%%%%9%%% I I MM""""""),, XX,, ,,,\\\\\\#qqFF B Bu qqqq qy ;;  gg??nnrrrzv'''///7FF $##"!O""$Z# _[CCTTTQQTQ||%%%j   ssoooo zssKKGG CC^^  ;TI!|xxxxBBII z''x%%%%%%)9% I I MM""||"" t,,,, XX,, ,,,\\\\\\#FF Yuqqqq qy ;;  gg??nnrrrz+'''''/7FF !z#$$$$"$$'%##!!n[[''nnCCTTTQQTQ||jjjjvvf  ssoo zssKKG G CC^^  ;!"# PPI!|xxxxBB''xxx||%--xxxMM  %%% t t,,00\\  XX\\qqquu nu* 7 ;;????nnnnz~~3~+FFR v#+#%3%&''&b&b'')n(& $#+#+! v__W#}vnnFFFCXTTTTQQMMzjn;;$osssoos  vz ss2222bbb;N%21`4*[LL!||!!|BBFFF''xxx""%%-xxMM  %%%,,00\\00XXq Nqq nu??jjjj????nnnnz~~+;3~+++FFR v#+%3&&(?(+)))))n(('f#+#+#+! kk__WW#vnnFFFCXTTMMQQQQMM||)bb;Z~$sssooo$s  vvv ss2222bbb;)A66/wLL!|!!|BBFF z/6%%%x%%%%MM%%xx)|",,000000,,4XX n????;;;;jjjjCC??nnnnnnnrr+++~~7F!Z!Z"#a#+$%';(?**,N+)++*(((';%#"~!z _WW+##vFFFC d\MQQQQQQMM!|bbf   ;;C#.)&+vssso$  $ssGGGGCC22b;;F*-Q$hPLLL!!!ttBB> z/6%%% x%%%%%%%%xx)|",,00  0000,,4XXVNN# n n????;;;;jjjjCC??nnnnnnnrrvv+337>>FFF!Z!Z"#a%';)+J,N,N-//.-/-',#,#+u+u(';%3!#" gWW+##vFFFC"%!l\QQQQQQMM|!bb f  ;;#3l7{6\*.;ssso~o  $ssGGGGCC22bF^hPLLL!!!ttBB>=Lnfbb    bb 3;;;;    bbbb;C)"" tQQQ MMaaiieeeK KKKKKllllAEE ^^^^^^^  mmmuu&&g#~^ f!!$u&(*-x..00112110-.-x-x*A(&$*"x!662}u QQQQ8$~3a5-44400JFFBBBBm(w7[889.KKKo  ]] a]]  GGCCdddd  hhk@8vn fbb    bbbb 3  ?    bbbb;j)"" tQQQ MMaaiieeKKKKKKllllAEE f  ^^^^^^^    mmmuuuu&&xxggg#~ f!#%'a*,..13335@44210--x,+)&%-#! q*]UQQQQQG'3674e 444JFFBBBBmii* X/<66*KKKo  ]] a]]GGCCdddd  ``hhkkk@8vnDT. 4#1n'nbbb    bb   bbbb;;-,U""QQ MMaaiqE(*&"me KKSKKK Hl HHA  ^^^  ^^^^^^  mmmuuu&&v#~"n#%#)2)h,-x0-0346D5555431..P*A*A'%%#!>*}}]UUUQQQJQf):,&/K<00BBBBmqq"2Q.5-eSKKKoossss]] ]] KKOOKKCC d`dd8v(6*82823 #bbb    bb   bbbb;;-,U""QQQQMMaaiq"162%d1e SKKKltA  ^^^^^^^^^  mmmuuuxx&&nv#~!"n%#&})h,.125446D55556D420-.P,++(%%-"x>*}}]UQQQJQ<0000BBBBm"}A-452KKKssss]] ]] K^KKCC dk`dddd`8vL)6*8293E R  f _   _   77 ; bbbRj|Mm1%6O73#\uKKKKSSpppAAH^^   ^mu"|*n##!j""(.+/)223455665655311/T--+E(9%&1#| > MQQ44800FFBBFFBBmm"2"`*Y'#O ssY]]]] ]]WGGGC  dd  dd888888rrn#/f4#2)B  f _   _   77 ;bbb;CC|Mm+{/* LumKKKKSSpAAHHHZZ^^ ff^mu"|*#b bb!j(.%y(.+,t/234555565553110/T,)(9(9'$ UUUQQ444800FFBBFFBBmm""2fO ssY]]]] ]]GGGGGC  dd  ddk888888n##7#7Bnbb      _ _77;;77  ;bb;;|||||"QQ  "L E"mO KKOOOOSSHZZZZ^^^^nn^mmmmmm"*#+bbb $&'&),t,t-136D46D6D6D6D6D54321\0+'),I*A&1! E>6eeUUQQJJ440000FFBBmmmmmm"OGGssssaY]] e]GGGGGGGG    dddd  ddd88888=Dbbbb    77;;77 3 3; bbbb;;;;|||||"   em"-mO OOOOAAAAHZZZZ^^^^* nmmmmmm"|*r#~+bb "#r&),t,t,t036D6D76D6D6D6D54320.+'),I+'! E   UUUQQJJ440000BBmmmmmmmm"OGGGG  YGGGGGGGGCC    dddd  ddddd88888     _ffbb77 7777 77ffUQQxxx t t6OOOOKKpppp LLV^^^^  #Q025&#uuuuIICCCK ;""B"B')*+-L02`56o55546D6D4210-L,)'&%#&!a] Uy""""____4FFJUUBBuGGGG GGGG  YY..=ssssssss  ``dddd     dddd8888<nnr     _ffbbbb77 7777  77ff\)Qxxx t t6::OOOOKKpp LV^^^^  &34+puuuuuuIIIQQCCCK+!##'))=*+./2`32`4<4<3432510--L-L,)%-! q q!].&&""""______4FFJMqqGGGGGGGGGG  YYssssssOOOKKss  ``dddd     ddd d8888<nnr==@@ @  _ _  bbbbbbbb 77bbf!(.&h %%|"66::::::KKKKppppAEE^  2%Y(Buuu***QQCS+3 #$')**+..0X112525110-0-.%,+E,,(#! q!!aVVe ]]]&yy""uu44FFJJJJMMMFGGGGGGGG]]YYY555555ss  OGKKCCss  ddd dd``dd8888<nnr== @  _ _  _ _bbbbbbbb 77 77bbbbv1~43,wXQQ%%"|:::: H HKKKK hppppppAEEEE^^^  nuun9"X#IC+~3 "B$&R)=)=)=+*,I.P.P//0-0-0-0-.%,+E))("x q qa!1]&yy""*u  44MMJJJJFGGGGGGGGYYY5555ss  OKKCCssss  d dd``dd8888<nnr====   3 f        f 3 3 3 3 bbb fn~"(&X%%%%: ::::KKOKppppEEEEZZ^^mm$ 10$YIIG'/!>!>$$$'5)=)=((,I,I.%.%0-..|.|-)+E)'&"mmaYRR&- - !Yyycc[[[ 0QJJJMFqiiBBBBGGGGGG ]]22sssss([jjssssddddddddddd88nnnn====   3  f       f  3 3 bbb f0{l%%%%: ::::KKOKppppEEEEZZb^^^^mm%d24(I??G' #F#&%%-''$$*&(+p-x,+)(d' ('5&%-"!u""mia&4{77-Yyy  [[ 088QJJMFqBBBBGGGGGG  2sssssss(z+]. Ossssddddddddddd488nn======7777 3 3   _    _ _  ff;; 3 3 bbbff#l\`|||"::>>>>::::KK OOOKKppppppZZ^^    ^"=$'kLIIIQ??z/ !!!#%-$*""$*$'a(()' ' ' '5%%$""""""miiai*T6883 -*&&[  [[ c8YFFFFqqBBBBCGGtA222222ss  ss%F24)#Osssdddddddddddd d888nn======7777   _    _ _       bbb  `%$-|||::>:: OOOKKppppppppZZ^^    ^m-QIIIQzz7 q#"!u!u"#Q#Q$$%%$U$U$#&#&!""""""miiYaY#/4{4{+Y***[  [[ c8YYYFFFFqqBBBBCOGG222222ss  ss(!6#ss(dddddddddd   d 888nn==X xx x %xx    bffbbbbMMMM MM||)|1X-%%)eeEUd>>{   ww$ OK////^^73377[444Y]  hp>!BB !!#Q!#Q#Q#Q#Q!"""""" !!i]VV$$g <<<<,4eQJJuuT WWYY]225ET..GGK((so44NJR####yyy111==H  x  %xxffbffbbbbMMMM MM||)||-%%ee %8.-W"U>{   ww$ OK////^^777337777[[[44444QQY]  h` EBBB ! !!!B mmm iii]Nv g<<<<444@@]e QmmT WWYY]225555=GGK  ss(G%'"okk44 NJR####yyy11111=H` QQQ%% xxfbffMMMMMM||)%%|%$1mee$48+60l> s { ww OOS//33ZZ ^^7>7777WW[44Y]] ``66>>eaNoo888GQJqqmmTTWWYY 5555.GGssss  /%43Q$$?0k44NNJJuu #yy1=%%  xxf f bffMMMM||)%%|"omeeu#16$8+64 |> s {$$ww OOS//33ZZ ^>7777WW[QQ ````22::::::::ee aoo48008UUMQJqqmmTTWWYY U..5555...GGssss  N(},!S$(n?44NNJJuu #yy1A==,wX""   ffjMMMMMM"|% x%%%%=ieeu.[4r4r* E$ w$$ww OOO33ZZ^^ fFF::::W_000077UU  ]22.62]RJJkkk44800,4qqmmWWWW WTT U U..222222GGssvz/G{kk,oNNNNyy`== I  X""     jjjjjMMMMMMMM"|xx% x%%%%ieeh % %dE$ w$$ww 33ZZ^^f :::W00UU]*...62*]NRJJkkk448,4qqmmWWWW WTTaa.222222GGss  oov  (kkoNNNNyy9I o== QQ""     ffjrMMM MMMM"""" xxxxxxxxxxaeeA>>$$ww$$ww S3 !u!uVB::[[0000MMUUUUuu....2}}VVNRJJsk4840000FFmmWWWWWWWWWWWWTTTa]]22555599222CGGssssooossss`4488NNNNJyyy11 == I I""     ffjz6'MMM MMMM"""" xx xxxxxxxxaeeeeAA>> $$ww$$ww S3 V VBBBB[[0000EEEMMuuyyyy}}}VVNJJRk4840000FFWWWWWWWWWWWWTTT ]]22=55222CGGssssooossssdd`4488NNNNJyyy11Ihh t t t t %%xx""""    ;Zq;MMM t t xxxQ MMMMMMMM   eeeeee KKKK ww$$$$ww+^^  bBnn_WW,,,4qquu""xx&*uu##NNNNNNNRyy@@88__  ____    W__[ MMMJmmmmmm0((22225i ee  CCCCo  ssodd  ddddddddNNJ]]]hh t t t t xx""""    ;;MUUMM t t t t xxxQ MMMMMMMM   eeee KKKK ww$$$$ww+  FFFBuuuu  WW,,,4qquu||xx&*yyNNNBqqqq@@88______    W_[ MJmmmmmm000222255E#(.+ e e  YYCCCCossodddd ddddddNNJ]]]] "" t p """" _ _;KMU t t t t xxx MMMMMMMeemmaaaaKKKK  www$$33^^>JJu}#  WWWW4qqqu||xnnqqFFFFNFFqq88__[[[_WW  [[[[FFBmmmm0((0022.'5n4&    Kvv  ooodddd dddkddddNNNNNNJ] ll"" t % """" _ _;M \ t t xxx MMMMMMMe|maaaaKKKK $$www$$33^^>JY}uWW,,4qqqu||xuunnnnqqFFFFJBB88[[WW[[[[FFBmmmm0((22.&*   Kvv  ooo \dddddddddddNNNNNNJRR] d d % %   bbff d%    eemqiiaaaa  e  OO{ wwww////VV^^ ::J!I! .q____WW,,qqx*uuuFFFBBjjjjjj<<__[[[ [[W_FFFq(00,,2222)e  aa]]GG  sss k``    h dd  NNNNNNYYY d d %%  %% bbff Xhd%   MM   aaeee OOOO{ ww////^^ ::JY"x&,,("M&__gWW(qqx#&h"X*uu>BB>>jjjj<4__[[[ [[[[W_Fqi00,,22222AQ   aa]]]]GGsss ``      ddhhNNNNNNYYY hh%% xxxx p xx bb _  ; Q""""xxx MMMM MM eeO  {$$ww//// ^^   (/450-&]>.yg __{#05K5K/4!*uuujjn>>B:>>7b<    ___eMi0(2222A  a]]GGCoo``      dddd  hh NN NN YYY hh %% xxxx p xx bb _  ; QQQMM""""xxx MMMM MM eeaaO { $$ww////  ff(3864<*l.yg __0+$5887S,unf>>B:>><    ___$ti0(888 222]  a]]GGCssoo``      dddd   JJ NN YYY  ]]\XXX ( ,, ,,  7777 xx """" IMMMMwwww $ww    wwwwwwww www$ $$wwLLd&G0n55+2v'o`70[[c* 69775(Zn_0000707EEyyqquqq[[[[[[[[NV     ftt!!xxx||ttttRRRRNNNNNNNNN    hh `GGGGssssooCC88888888      `yy##u]]  ]]\XXX ( ,, ,,  ;;777777 xx """" MMMMwwww $ww    wwwwwwww www$ $$wwLLTTX d )11+%C70,,(2*4/!n_00000AAEEMyyuqq  [[[[[[??FJ    f tt!!x!!ttttttRRRRNNNNNNN    hhGGGGssssooCC8888 88      `yy##u   XX 0 ,,,,  ,, ;;7777 3xx """" I IQQ MM wwwwww  s swwwwwwww ww$$ww$$wwllLL\Xk$?/-% `7S#%N0EEEEAmmq[[[[ FVC     tt!! p p!!!!|!ttVV GsssK88 4488        yyyy##u   XX 0 ,,,,  ,, 7777 77 3xx """" I I U o owwwwww  wwwwwwww ww$$ww$$wwLL {`Xk 0%$? `7,SSSSSSjg0EEEEuummq[[[[TC     tt!!!!||!|tt JhhGsss~K8888448888       hyy##u] ]\ 4, ( ( (, ,,,,,,,, 3 7777 xxxxxxx  MMwwwwww$$$$     $$ww  $wwppppL *0.%Co`ggs`XX00,,OS[[,,00IEuuqqmm"WWWWWWWWWW;  ^^bb!!!!tt!!! R NNdddhhKKKK    vGG888<<    u##] ]\\\ , ( ( (, ,,,,,,,, 3 7777 xxxxxxx  MMMwwwwww$$$$     $$ww{{ $wwppppLT-b6772"   d0000,,OS_n'c[[,,00I>EuuqqmmmWWWWWWWW_WW;;  ^^bb!!!!tt !R NNdddhhKK    vGG888<<``    u##   \\X ,,,, ( ( ,,  ,,,,   3 3 777777777 %xxxx% MM wwwwww$${{  wwwwwwww{{$$wtt\ 04'8686866,`PP0(,OSSSWW gcWWWW,,000AE>>qmmmWWWWWWWWWWWW;;;;   bbb!!!!!!!!!!!!tt !N J JhhdhhCCKss zvvGG88<<888<  ####   X ,,,,  ,,  ,,,, 77777 %xxxx % MM wwwwww$${{  wwwwww  $$w-b686866.!4`PPPP0(,OSSSWW WW,,((000IIA>>qmmmWWWWWWWWWWWW;;   bbb!!!!!!||||!!tt !N hhhh  vvGG88<<888<  ####yy]]a0    ,, ,,,,,,bb   f777xxxx"" MMMM $OOO  KppppH #06.41,"c4))PP$O00,,,WWSSWWWW"**"iimqq[W;;;^^bbIMM)!!!!ttRR yy''''''hhss KGGGdddddddddd8888    hh  N NNN]]a0 ( (     00,, \ ,,,,,, bb   f777xx"" QQMMMM $OOOKKKSKppppH`$#;!L$O,,,WWWWSSSSWWWW""Xiimqq[W;;^bbIMMt !!ttRR yy''''''  ss KGddkdddddddd8888        NNNN   ( ( (   00,,\XX,,,,,, bb _ _77-"""" MMMMwwww ,OOOg~OSppppppX4!!ttPLLOOSSS{{((OWWSSSWWWW[u% + *uiiBB[WW    bbQt!!!!ttRR yy'''''  hhhhh dd sKKGddddddd  ````NNN   ( ( (   00,,\XX,,,, bb _ _ _ _ 77NL||"" MMMMwwww$$,OOW nOKKSppppppHH%xx!!ttLL,,OOSSS{{(($$O_SSSWWWW[u I*uiiBB[[[WW7777;;   bbQTTt!!!!tt  yy'' '''hhhhhhh dd sKKGddddkdDD  ``NNN]]]]]]     44,,,,,,    3 3 777G))x% MMMM {  {{0g OWOOKKKK lttEEHxx!ttHHHHE{{(({SSS(({{$gvSWWSSm|*uiiiiqqBBWW[77^^^QQQ\!!!!xxxNNVVRR}}''yyhhhhhhhhhhhhKKKKKKhhddd<kddRRN]]]]]]     4,,,,,, _ _  bb 777||x% MMMM  {{   OOOOOKKKK ll!ttEEHH!ttHHHHE{{(({SSS(({{$!~_SSSmmmuuiiiiiiBBFF[[WWWW[[[77^^^QQQp"@!!!!!xxxNNRR}}yyhhhhhhhhhhhhKKOOKKhhkkkkddd@@<kddRN]]]]]]     00K<44\\   \,,,,    7777xxxMMMM     OOOOKKKKKK llEEEEAptt((({{SSSS(({{$$,, gWSrvWWSSmmmmiiiqqqqBB WWWWWW[[77^^QT!!!!xRR}}y   hhvKKKKOOOKKhhkkkkkd@@ddk&]]]]]]     00'%/44\\   \  ,,,,,,    7777xxxMMMM     OOOOKKKKKK llllll EEpA({{(({{SSSS(({{$$OOWSWWWSSeemmqqBBTWWWWWW77^^QQ!!!!xRR}}y   hhvKKKKOOOSSookkkkkd@@@@<<ddi F 66 XX_[4"qqBB BB%%x "" t t MM %%xxxxxx 66: ::::::::666   aa  EE llppttttpppp{{{{wwOOOOSSSOOOOSSSSOOSSiiiieeBBBBTT   n  ^^  MMtt pdddd<<<<NNNNyyyyyy''OOGKKosskkkRRNNNNN**uuu 66 XX_<<4}qq BB%%x "" t t MM %%xxxxxx :: 66: ::::666   aaEEEE llpppppp{{{{$$wwOOOOSSSOOOOSSSSOOSSiiiieeBBBBBBTT   ^  ^^  MMtt pdddd << 5NNNNyyyyyy''GOOGKSS[$wwsskkkRRNNNNNuuuuu XXXX44"(%(%yqBB "" M x%%xx %  ::::  :66 ] ]  aaaaE tppppppppp{{{{$$$$OOOOOOSSSSSSOOSWWWiiiiiieeeBBBB[[TTTWW ^^  f MM MM!!tth dddd  ''''''GOOS[[[[wwww{ssssssRRNNNuuuuuuu XXXXDD444"2$)qBB ""M x xx %  :: ::::: 66 . ] ]  aaaaE ttppppppppp{{{{$$$$OOSSSSSSOOSWWWiiiiiieee BBBB[[TTTWW^^ ^^  f MM MM!!h dddd  '''''' GOOOOS[,,,,0(ssssRRNNN uuuuuuu22 XXXX_Kj:mBB F t""xx%%QQxx xxxx I6666 2 666 aa   ltl$$$$ OOKSSSOOSeeBBBB>BBBB [      bbMMtttthh ` ` <  NNNNyyyy''''KKK/b844$$$wwVVJJJyyuuu22 XXXX_<)>*uumBB F t""xx QQ%%xx I6666 2 6666666 :aa   ] ]ltlll$$$$  OOOOKccOOSSOOSmmiiBBBB>BBBB[[      bbIIMMtttttttthh ` ` <  NNyy''''KKCK[j88CwwVVJyyyyuuu 22 XDjj444qqFF% QQ-% I I I Q 6666 6666 2aaaa ] ]   AAAlltppllt$$$$OOOOjSOOOOOOOSSii&|mmiiiiFB FFBBBB[TTT  bIIIIMMtt!!tt h  h  <<<NNNNNy'''yyKKKKSSrGC<,$$VVVRyy# u  X44<<444JJ % %% IQQT% I I I Q 6666 6666 2aa  AAAAAll tppttt$$$$OOOOz'V,(zcOOOOOSSii11iiiiFB FFBBBBz TT  #IIIIMMtt!!tt  h h  <<<<< NNNN.''KKKKSSr' O!!S KK #[4wVVVRyy# u Y Y T, FFFmmmm MQQ))_.%O\MM t txx%%a 66666666  eeaall llpppp!!0@OO H HOOO "1&3+ {{{{{{{{::::>>phIqq000[< $bbbbJ";ttttttt!!!! p p<< ` h###}yy'....}}}KKOW CR ##%&#[$#[!'&( z P^VRRNNJJJ Y Y T,,4  F mmmmMQQ)c250#{xx a 66666666ee  aall llpppp!!OOOOO SS #)% {{{{ww{{{{::::IAA::qq80bb)EJttttt!!!! p p 5 5<< ` h}}#}yy'.}}}KKOOOW C #&f(n+#,,,(##!  P^VRRNNJJJXXXX,,,,, F  MM Q)='W.$UUU""xx aa eeeaa 6666aa lll lAAp{{xppOOO KSS##OO{ww$${{{{::::>>AAA>>04,,,bZbR;;t!!!! !!! 5 5<<<< d}}yy.++++KKOW^n #i%+#-+/2>2>1,''?#/ z VVRNNNNJRXXXX,,,,, F uMM Q))H%{)"LtU""xx%%aa eeeaa>6666 ]aailll lAA pppOOOKSSW_WWOO H{ww$${{{{::::>>>>ii>>80,, ,b;C;;t!! !tt!! 5 5<<<<h ddd##yy'''y++KKOWW^ #i',}1:36N6N52.)$ g _P^VVRNNNNR ,,BB qyX -5c04',H`xx % xxaaaa  eea e llEE AAt ppppKKKSSS[[SSOO$$$ww$$(  ::::A>>,,,,,^^  !|!!tttt d dd#}}}''++KKKG^G#(n05J6666N41e-V&!'^^VVVVNRNNNN P ,,BB &.X -#',!H`QQxx % xxaaii  eea::e llEE ppKKKKSSSSSSSOO$$$ww$$({{::::((,, ,,,^^^7tt! !!tttt dldd#}}}'++KKKG^V"f'/25J66676N40 )F!'oVVVVN NNNN T  ,, BBB y \MMM-PXM  xx ii  aa::ll pplllKKKKKKOOKSSSS$$$$(::>::qqBBBB00 ,bb^^  33tttttt!!!!t<< <d}#++''}}KKKGW^?V#(n,}36666640 )F"vg_e   NN T  ,, BBB  \ XMM-H9XM xxxxixxeeaaaa 66ll ppxpplKKKKKKOOKSSSS$$$$ s s s::>::qq.MBBBB ,bbbb  33tttttt!!!!t<< <ddd}#''''++}}KKKGOOW^?$^(n1:366552.&"vge  NRNN.GG  . . ]] ss   (''~~++b""bRRRR ~~''O&%FssCCv ''yy+V NRRyyyyyy  ss2999AA2v  ssG KGGGGCCC$$+%qvssss]]]]RRRRRRRRyy'' 5<<dddddddd<<ddNN #}+loo!(y6#&t'+.1432/k+\%E!5)tmYYJJJJFFFFF]GG  . ]] ss   s''~~++bm"RRRR ~~''*Y4)2SssCCvv''yy vVNRRyyGG ss29`vssG KGGGGCCC$2M6\1vssss55]]]]RRRRRRRRyy''<<dddddddd<<ddNN #}+hhloo!(i6) *&t&t))+0-.-8*%#)tmYYRJJJJFNFFNNGGGG  . ]]ss  ss''~~~~m^R RR ~~''GWn"*'  k kGGCC$3~syyy}}##NNNNNRR GssA`%h922GGGG~)0E+vss 55..YY]]RRRRRRRR}###yy<< ddhh  NNNN NN####hhhhllo!i.!####$l%'!%#=#= -)tmYRRJJFFNFFGG GG . . ]]ss  ss''~~bm^RRRR ~~''GbK  k k CC$~~syyy}}##NNNNNRR''GCC  ss22922GGGGCC$CR+vss 55..YY]]  RRRRRRRR}#}}yyyy<< 5 ddhh  NNNN NN###hhhho!iMM \#! -]YRRJJFFNNFF D D6 2 Y Y]]]] o o     ''''++3u#) qZVV NVV'' ~~O oCCCssz  kssyyyy+RRNNR v''yCGG oo2222==o GGooos(+v 22]]]]VVRR}}+''yy<< hhhh99ddhhN yyhhhhlllwwqqIQ!`&xm NNJJFF 6 2 Y Y]]]] o o     ''''++3*h3+bZZVV NVV'' ~~ oCCC  kssyyyy+RRNNR v''yC GG   2222552oGGGGooossvv 22]]]]VV}}+ yy<<@@hhhhddhh  yy++hh  ddlllbqiUNNFF  6 22]]]]   ss o o z z''~~~3&YVV '' ~~GGCCoCCssssyy''}}## JNN}###''yyCCC sv552222GGGGGGGGoo s      2222]]  ^+yyyy<<hhhh< <9ddh   NN''y++ddllooobb::AIiUURRUJJBFF  622]]]]ss ss o o''~~ffZ  '' ~~ CCCCoCCssss''#### JNN}### yyCCC sv552222GGGGGGGGoo s     5552222e^+yyyy<<hh  < < 9ddh   NNN''ylloooZ2::a]UURRJJBFFss    ]]]] . . . .66   ~~ ~~RRRRRR oo G ?CCCCv$$vVNNR RRyy  RR NN Js  ss  222 ]]  ssssKKoovv529A6622:ZR VNNddhh hh dd99 ''## Nhh222222]UUUURRNNFFFFBFFww    ]]]] . . . . . .66 @ ~~ ~~RRRRRR oo  GCCCCvCVNNR RRyy  RR NN J ?GGs  ss  222 ]]  ssKKoooovv529AZRVNNddhh hh dd99 ''## Nhhll2}*UUUURRFFFFBFF$    e ]]  . .  ++~~~~ VVRRRRRR  ooG CCCC$)*Z+++' RR J GGssss aY]  s  GGGGCCoo $$GGC22AQ>:VVl hohh    d yyyy###}NNhhhhll***}}**RFFJFF$    e]]   D D ++~~~~ VVRRRRRR N N  ooG CC CCC$"4U5,+' RR RR GGssss aY]ssvv(  GGGGCC oovOGGCAQM:VVlh$hh  hhd yyyy###}NNhhhhdll++u}}NNNRRNJ ($$wwi   6 22  GG D D ~~ '' VVZR  CCCCCCCCC ),6"VV M   ss    2222   YYYYoovvv3vKKCCGGooooo+S555E\lQB:VVh o8slllddhhl<<'' NN R  hhll}}uu""&yyNNJJJNFFFFF($$ww  6 22  GG D D ~~ '' V^% ZR  CCCCCCCCC z/CC; VV..y KK ss  zz222222YYYYoovvv((7KKCCGGooooovv==5ETd!!%0'-#a:VVh oosll ddhhl<<''''NN R  hhll}}}}uu""&NNFJJJtNFFFFF/~~$$a  62222 G ''' #* VV oooo k k  CCCCC CCssvNNV''yyNNNNz ssszz922]]]Y$#-:.*!bK GGoooov CC G5555d!+-O,'-!:Zhhhhlldd dhhL<<9H##yyyNNhhh hhll}}}}"uuyyUNF - *XFF/~a  2222 D D  ++''' fV^VV oooo k ks CCCCC CCssssvvvV''yyNNNNCC (zz99922]]]Yvv$#388d7 2 SKKGGoooov CC G555M#(+G243\-%:hhhhddd hhsG$##yyyNNhhh  ll}}muuyUNF a'33#UFsss GG  D sss OG RRRRVV====DT@@G CC  ooooooC  hd99<<CC GGGO~$oKKA,78z87v6(a]]]..G Cooooss5=9)@46650:&wd<< NNZ}> y''yNNNN99 99dhhRRR_X__<KK8844 '+qqmmmeemmsss GG D sss GG RRRR ==== == G CC  ooooooC GG hllllll<<CCKGO3++$$KKA,78z87v6(%a]]] GCoooo5E #(.68#8#61'nOd<< NN+}6.''yyyNNNN99 99hhRRR_X__<<<0\\ ck qqmmmee]]ss o ss  D RRRRRR========  CCCC ooooCCGGGGGGGGhhhhl!llhh `@CCGGW C+vvvK[="%16r7v61_!!i]]....CCCoss  =d)!w*3f7v7v7v5-",woohhdll@9NRR}#yyyyNN999999ddRRZ_4440000\\\\ccqqqqmmm  ]]ss $$ D Dss  D RRRRRR======== @@ CCCC oooo CCGGGGGGGGhh{0ll!sshh@GG R;vvvK'#=2Q"%*D-)"{i]]....CCCossT#( '2 67v7v4J)voohhds{llDDD@9NRR}#yyyyyyNN999999ddRR_4440000\\\\  \qqqqmmm]]]] /z D D D  zss K   V==========  CCCC k k  GGGGGhh{@sll@@<<KKj#$ C3~$$*4/m`A.5=M\l\a]] 222GGCCoovoo2AE '/32c2c-/!!lhhC{lXD< RR}##}''yyNNN99  hh N \\\\0080000\\\ q]]]] zz  DKKz ss K N N  RR V==========  CCCCGG k k GGG hhl!{0(sll<<OOKKj*,6(&~$$$.5=a]] 222GGoovoo2EQ`p#(<,K+(#$!lhho4lH'#TD<RRRR}##}''yyNNN99  h hN \\\\\\\\000000\\\ q  ] ss K K ss D D D D RR ======== ==  G vG GGGGhhssws<<GGOWK[b%F1t4U,6R~vGGb5]]222222GGoo29E`p"%$,""%p<$!hho$!H !DRR##''}}++VNN99 h hh NNN\\000000k\\\mmmm i i  ] ss K K ss D D D D RRRR ======== ==  G  G GGOGGhhlld<<<<OWKr'4)7 1$C~vGGGGS 55]]222222GGoo 29E`h`olhhlPDD JRR}}''}}mVNN99 h hh NNN000000k\\mmmm i i22:22GGKK D DGGGG o o o o o''''' z z ~~~ # hh 9@  CCGGooooss  zz <<@@@@@@hhdll$vvzzzz^(Q0p3.i 2OOvYY.52222.  soooo  a)11-%DD<< <<<<<hhll  v v##yyyy}}+..''''y#t!RRhhhh     JR 0,,XX ,,,,,____ immm22:22GG KKGGGG o o o o o''''' z z ~~ #~++hh 9@ CC s oooo  ss  zz <<@@hhll$zz  ^&*Y$}^Ov.5..2222...sooooat!!xpD<<<< <<<<<hh  v v##yyyy}}.''''.F$%uRR        << < JR 0,,XX ,,,,,   immm 22 G D DGGGG o o o o'''' z ~~~~~ hhhh @ ==CCs    zzzzs<<<<hhhhllllllllvv((OOOn 2"n^Waaiiiaa5..555sssssovoo] <<h dddddd###}yyyy}(&)M''''m^       ` << XXXX,,,,X i immm 22 G D D D DGGGGww o o o o o o''''// ~~~ # hhhh @== CC   ((zz(<<9hhhhllllllllllvvvvOOO^#W=a5..555=55sssssovoo] aaeiia<<h dddddd###}yyyy}2Q$$M''''yy'       ` << XXXX,,,,X i immm . GG GGGG o o o oss +~~:++''// d d d  = G ?ooo oosz +//~~$@<<< <<<hhll(zzzz  KKSS[ff WWOOssssvee"Pt  225AXIoooooooossoo] @<<<< < ddddddd  yyyyyy+2:+y''yy''R        ` <<RR ( ( XXXX ,,XXXXXXmm m . GG GGGG D D o oss +~~++++''>// d = G ?oo os z+3~$@<<<D<<<hhllszzzzzzSSWWWOOssv!!  225`+/ E55oooooooossoo] @<<<< < ddddddd  yyyyyy+22+y yy''NNR        `  <<RR XXXX ,,,XXXXmm m . GG GGGG ssww   s~~~~~~~~''/l======== G oo  ;C ^ ^;<<<<<hhhhhhlll(zz((SS[^^WWWWOs ]]]]]2 222225`+/ .. oooossoo]]aaaaaaY99<< <dddddd h  yy yyyy+}}++}#yy yy''NNNN J    ,,XX XXmmq . GG GGGGKK ss   s~~~~~~~~''/tl======== GGG oo  R%q+2-+%+<<<<<hhhhlll(zz((SS[^^WWfs ]]]] ]22 22225Q5vv oooossoo]]aaY99  <dddddd h  yy yyyy+}}#}yy yy''NNNN J  ` `99 ,, XXmmq ====== d dll +~++~~VV V@@@@@==DDHHXl  2 ]] R&0664,ar[VV.+}}.ZZDHHHHbbbb.+} NRRR V ++WGGs CCNNNN R Rdd h99<<G G GGG G..YY ####yy'  yydd  (X XXXX %%- ====== d d d d+~++~~VV VHHP@@@==H ,0l  2 ]] z/+6\77751#V >..+.ZZLDHHHHiZ+}NNRRR VV''++WGGs NNNN R Rdd h99  GG G G ..YY ####yy'  yydd 8 XXXX ))-K D  d d d d+++~~V ^mX==== g ..    .7 775,a ZZR^..+++VZZHHZZ}}}VRRNN''''#}}}GGCC GGGG NN JRRRRl   ?...YY]####yy ####yy  00  0G!v w XXX X\\\  DD  d d+++~~ V%H==== Hl .. z(J%q-2x2x,a"[ZZR^F..+++VZZTHHZZ}}}VRRNN''''}}}GGGG k kCC  NN RRRRl{s ...YY]####   ####yy dd0000000 G%&, XXXX\\\XXXX)9x D D H 9 hh '/~~~ #  VH======hhhh dl.... ]]v$~G#&(Q"f WVV Q++}}.++^^ PPPPLL''''NNNRRR NN..''KGGo oo CCCCCCC R NRRsGO{ddd99CC CC2222....]]]]]]  yy####yyyy dd ,,,,Wo_\\\\XXH`Axx D D 9 9 hh  d' z~~~  V@@========hhhh dl.... v$~7G# WVB++}}.++ZZ TPPLLibZRRR NN''''  o oo CCCCCCC  J J RN NNRRRR@!ddd99 CC2222....]]]]]]  ''yy##}}yyyy dd ,,8_\\\\)9Axx KO GG hh ''''~~~~  @ ==== ==  d d.... *o$(7 ffWRRVVVV+}++++   eXXXLLbb6''.RRVVZ NNy'' CC ?  oo CCCC K    RRRsd99 99CCCC..]]]yyyy##}}yy 'yyyydd ,,0 0 0000XXX __   ))))%%x KO GG hhhh''''~~~~  @ ==== ==  d d.... * *oo((W WWRRVV}}+}++++   e[[XXXXXTTbbbb6 q6''.VVZ NNNNy''CC ?  oo CCCC K  RR  RRRd99 99KKCCCC!|]]yyyy####yy 'yyyydd ,,,,0 00000XXX   g %%xss == @ == ~~ z''VV ====  9D==  ..YYYY]] sszz~~~~$$vv++}}}}}}RRZZ^^ eiigc  cgTm.y..'.+V^#### NNR KC  CCCCoooo ? ?GGNRRhhhddddddOCCCCCYYYY $1_1_"2N ## v##<  5XXXX,,)0Y)00MM o oss == @ == 5 ~~ z''VV N ====  9HD==  ..YYYY]] ssss  $$$$$$vv++}}}}}}RRVVZZ^^eii_scc _[[ ..'y+V## v v## NNR KC GGCCCCooooGGN  JhhhoddddddS^ CCCCCCCYYYY +G66*2N## v##<  5XXXX(:0Y&800M M o o == 9 == ~~''''VVVV == == @wL=hh ..YYss    vvvvvvv}}++++RRRVV eiggwkkg  [^  ''}}N##NN RR CC ooooooGGNNRR    holdd KSr":$ 2 CCYYYYYYE'*A9RRNN v v v#### XXXX T  4 0MMM o o ==  == ~~'''' VV == == @hh ..YY  U U  vvvvvvv}}++++RRRVVbb emmy gw ( (  [i  }}N## J JRR CC ooooooGG^  NN    h#ClddlK)U5-5-0p![ CCYYYYYYaa NN v}}## XXXX T  4888\MMM o o ====== ~~ RRRR == == @@@@..oo sss+''''RZVVby&w!, zz $$wc iee  }}}}RRRR}#yy GGCC CCCC oooooorGNNNNNNNNNN dd,hddG}3%776+GG ]I9NNNN ''''}}##<<< T T T\XX04008G` M o o  ====== ~~ RRRR == @@@@..oosssss+''''ZVV$$""$##"/#3#3!,ssyiee  }}}}RRRR}#RRGGCC CCCC oooooobGNNNNNNNNNNNN ddhhhddGn,a665-'^OGG ]]9922NNNN ''''}}##<<< T T T T T\04,,008QQMss o o  9========++~~~~~~  ====== =D ==@@@@... Uoossssoo}}''RZZbqq.6 ~!%;'(G)(G&(($#3zsse^....}}+R NNN##+.'' JCCCCC ooooooCGGNN NNdd hhh ddW$*Y&JvWGG222222NNNN ''yy#### <<XXXX, ,MMMss o o  9==== ====:~~ # #  ====== =D ==@@HHH@@... U oossssoo}}ZZebiiq&.6 #3'C*-Z,V--,V,,('C$"/ (sye^...'}}+R NNN##+y'' J J JCCCCC ooooooCK dd   h dd  W 2222NNNN yy#### XXXX,,MMMG G hh hh l@2V N N 9 ^^'' z z''CCOGsooooCCCCKGG RR bVVZZZeqy #I&+~.3.3..110.,)K&?$"/ _TLLwwwll''''+}}##VNyyyy#### 2YYYY..}}NNNNNN###### 'yyy  oo zC]YY <<9999dd dddd9999 BBqmmmm  G G hh l@V 9 9 ^'$'' z z''CCOsooooCCCCCC GG RR9#VVZZZqy!$'X*#,034J4J4J4J420-Z*N&?#z_TLLll''+}}}}VNyyyy#### 2YYYY..}}]>.y NNNNNN###### 'yyy  oo C]YY  5 5 9999dd dddd9999 T T   BBqmmmm  hh l!{mVV ==  9  :-*hu VV'' z z''Sff^O ooooCCCCCCCCGGGGGGu* /!"VVZZ  qy."$'X*#.314J556R45y41j.*&%!ogLLooll+++ J J yyyy####. 2 YYYY......})(F NNN  v v v####yyyy' yyoo z  KK]Y  . 5 599 dddddddd9999 T   BB mmmm M hh llVV ======  ==u*fVV'' z z''(+%nooooGGGGGGebbb  mmq#%(,025666R765y20-)&"$gLLwwll+++ J J yyyy####... 2 YYYY U U......#}: F'NNN v v v####yyyy' yyoo z((K]Y  .99 dddddddd9999 T   BB qmmmm M hh dhhhhpZ V @@H===b^V ~~ ''b)U472!6/ GGGGGGGNNRibeeqm"}6"E&U*d,03F57U7U666}5"3/ .^(&?#c[!!!l}.#}#### J v}###.. 22 ..........22''6yNNNNNN####yy''$v/5--GGYY * * *     ` `h   ,, 0BBBBBBB i immmmMMMM  hh d hhpZ V @@HX===V # # ''%F474)"/  GGGGGGGRZZ^  m"}6"E&U*d,03F555666}5"1-+(&?# TT{{{!!2...#}####Z v}###.. 22 .......... '''yNNNNNN ##yy''$ ":*Y$fGG YY *     h D  ,, 0BBBBB i immmmMMMM  hh d ` `h hhh RRR  @@ @@HX_P===RRRR ~~~~'''#)U"(sss k  GG GGGGZZV^iu""'*d+'/6145N6555"30f,V+'$7!s T(((22}}}}ZiZ v}}.. 2...... U.... yy''''NNNNNN v v##yy #####}oOfY YY]=Dh `o_ \,, BB i immmmMMMM hhhh d h hhh RRRR RRR VV  @===RRRR '''Kbssss k  GG GGGGNNV^iu".!$'(r,00233F3F2m1/ **N&?$7!s Ts++}}}}Z v}}.. 2.... U.... * * yy''yy''NNNNNN v v##yy #####}oYYY]h `<\44,,00BB i immmmMMMM I I ss   z z zZVV == hh +~ #''''^^RRRsssssCCCC g oossssss''yy+++''''+++66:B!$x&(--.300:0:.,+)v)v&j"[!@,,$PDD}}}}y''yyyRRRRR ##yy'']YYY . yyyyyyyy yy  v vNNNN ooooss  22 YYYYYY9999    99XXXXXX \\yyBB > ss    z z z V == hh +~ #''''RRRsssCCCC oossss''+++''''+++..2:BJQa!"$ (**#,,+,+,+)v&&#K,,$PDD++y''yyyRR R ##yy''!]]]liYYY .99]]YYyyyyyyyy yy  v vNNNN J J ooooss2222YYYYYY 9999    99XX XXXXXX .. > %ssssss 9 9 9'''Rb6  hhhh hh~~ z zVVRRsCCCCCC  k koooo kss''''}}}}'+..::BJJa!W"$ ((((&'n&%f"!C0$HDD2++y'''  R ##' y]YY .222]]YY' yy yy 'yy #} NN oooov2YY   ` ` 99XX XXXXXXXX,+0MyqqJBB  xssssssHH '''''R  hhhh hh~~ z z RRsCCCCCC  k k k koo ''''}}}2'+}}..:BJJJ$ $"$ ""#_%fKC80$HDD2++.'''  R ##' yYY . 222YY' yy yy' yy #}NNRRssssoooov9YYYY    99XX XXXXXXXX'!43O#qqJBB  x o oss@XH 9 9 9 = '' z z' z N== ==== d d d ~~'''' RRRRoo oo  ooooooo ' yy2''}}}}+++.66BBB " SC88($$$HH22..''yyNN y####YYYY]]YY ]]]]222  ]yyyy}# v v yy#### v vvssvvvI922]]YYYYdd    5 5XXXX I%p)FF BBxxxx t t o o  ss H 9 9 9 9 = ''' z NR== ====ll ~~'''' RRRRoo oo  ooooooo ' yy}''}}+++.BB<<GGC88($$$HH$x#2''NN y####YYYY]]  YY 22 2 ]yyyy}# v v yy#### v ssv++"*) I]]]]YYYYddhh  <<XXXX u2*u > >BBxxxx t t t  9 9 9 9===='''''' z z N N N  ==l ~~ z'' RRRRoooo GGGGG oooo oooooo ''}}}'}}++.8@@0000(wwwLLH(42 i2'''''' ' yy}}##YYYY]]YY 22yyyy v##yy ######RRsoovv&375/]]99dddd `<<XXXX T Tmuummm BBBBxxxx""  9 9 9 9===='''''' z z N == d dl ~~ z'' RRRRRRoooo GGGGG oooo oooo ''}}}'}}}}++.448440000(wwwLLH i/L/L i2'''''' ' yy}}##YYYY]]YY 22yyyy v##yy ######RRZZZ  soovv+2M578z70[ ]]9999dddd `<<XXXXmm BBBBxxxx|| o o p t t t t t t"""""" I "" t t t t   _ _ bb _ _bbbbb [bMM MM p% MMMMMMIIfjjr'X_,,{{((HHHH<woh99 < B   P TTTTTT (((( ,<mm06W4-01'u>>>>tt!!! t  RRRR V =D ===== o o p t t t t t t||"""" I t t"" t t t t77    bbbbbbb [b MM p% MMMMIIfjjrvvvvX_(({0((HHHHwoooh99 <<<B   PWWTTTTTT (((( ,8Gf$ mm6" 't$h9u>>>>tt!!! t  / / RRRR V =D =====   o o o o xx t t t t""||| t t t t t t""        bbbbb E xIMMMMIIfjvPP0((00(PPPP$$$oh hh99<  PTTTTTTTT TT((((, 0@/52]&/K"mqqq.***uu>>>> tt tt RR RRRR N N =====ss o o xx t t t t"""||| t t t t t t""        bbbbb E  IIIMMMMfjvPPP{(ww(@@XXX$$$4C4hhh99 <  PTTTTTTTT TT((((, ):6772][}"mqqquu>>>> tt tt RR RRRR N N =======  """" p x t txx% MM t t """""77 77 77        bbb ^^ ff f  II ! IIIMQQbbffrLL$$$$w,,488  __{!W(!l<<< 99999>>>>>>>>m eiiii T W ((((,, $ ,,,,$'4e86/Rymmqqqqqmm >F>>xtt t  tt  / V R RR=hhh==   """" p x t txx% MM t t """""77 77 77        bbb  fff II ! III MIbbffLLLL$$$$w4O  ssoogg808O!l<<< 9999999>>>>>>miiii T W ((((  $ ,,,,"*):!mmqqqqqmm >F>>xtt t  tt  / V RRR=h@w ss""""  "" MM I I I I t  t t t t t7777 _      bbbbjffnIIIIttt  pIIMMbbnLLLLLL$$wwwK!W&()v)(G'$!${!{(hh << >>>> emm P PTTTT WWW  (( { ,,OOqqmmumqq>>!!tttt tt 7RRRR RRL@ @w ss""""  "" t t MM I I I I t t t t t)7777 _      bbbbj'}+}fIIIIttt  pIIMMbbnDLLww,!!#)v.24J54u2m/+R%!,!, OG80!shh <<<< >>>> emm P PTTTT WWW  (( { ,4 ,0qqu"""qqu!!tttt!!tt 7RRRR RR @KK   x I I 777777b      7?b".'$2F '+"!bb  MMMMM^ f;;;??DLHHPw!,!)15777U7U7U40*#&$" (scDDDdFF  mm  P P ((,,W TT TTTT WWWT[[    [[uuFFFmmiiiit!! p II 33 ''RRhhpDhhKK   x   777777b      7?%36|5-eFF 35/1/jbb  MMM ^ f;??DHHHHP_!,%+R15777U7U7U7U40+~$ (sTDDDd FF  mm  P P { {(( W PTT TTTT WWWT[[  ""QQMFmmiiiit!! p II 33 ''RRpttLhhKK K  I   x M M M  7777 bb  _ _bbbb/ 79184p"F(A-)% b p II EMMMM  ff;;LHPPX ~!%-2m6}7665N20:,+&"  TLD<9999hh  : iim { { {, TTTT P[[[[[[*2YYUMMMFiittttxxII 33 '' R %w)\ T@@hh[KKK  I   x M M M I I 7777 bb _ _bbbb,U6|77%3"6b p II EMMMM  ff;;<<@@Ho#(-1221>+)v%f"[ TLD< 9999   : iim  {, TTTTWW P[[[[[[&&*2a MMMFttttxxxxII 33 '' R %4,!!H"'$s@@hh+ O M xx MM I I MMMMMM 777 bb   _ _    Cy*0d.%6Cjjbbb p p p  MMMM MMMMMbbbbbb77;;<<DDHH_ "(G(r$b#! S 9999 9dd dd B m e eT ( WWTTTTTTWW    **Aell]JJJqqmm!!tt!!IIII 33 #~~~'' RRRRZZw))#2q5&4y,ZphhWO M xx MM MMMMMM 777?bb       3 3KbRC77bbb p p p MMMM MMMMMbbbbbb77;;<<X[cC44TL999 dd dd BBB mT (((  TT TT [[[[  cc**AAt|!!l]JJqqmm!!tttt!!IIII 33 #~~~'' z z RRRRh)8'5R7785+ phhG MMMM % xx MM MMMMMM M?7bbbb _ _  _ _ _ _ ; b [ p p p p pMMMMM\MMb7777<<<< PTT,,,LD@@99999 dd dd  e e ((((  TTTT W[[__ cc}2Q!!1!1"!1 )]UQQJqq!!! !ttIIIII  ~~''''RRRp@-38777.7./oPpG MMMM p xx MM MMMMMM M?Gbbbb   _ _ _ _ ;;;; b [ p p pMMMM\0"@Mb7777<<<T"*!,HHwww$$LD@@99999 \dd dd  e e (((( $ $  TTTT W[$o cc**AQ#%@''&$#9)t Jqq!!! !ttIIIII  ~~''''RRRp!'5R777.7.+Pppppp22222QQMM bb    _  _%%)|MMMM 7777 7777M IItt !xx [ [ ^^;;:,/Jb ^^^;;RRRRZ]#sswLL}N NNNN NNNN yy v v##(W BBB : : >>>>>>TTTT (((T/ zc   z3 C'*..".")%"JbK bbb33  z z'' ++~~++6,6@7720  //>:+22222QQMM bb    _  _%%xx)|MMMMQQ 7777 7777M IItt ! [ [ ^^;;v $b ^^^RRRR''.::2s(wDDDDD}yyNNNNN J JNNNN yy v v##( WBBB : : >>>>>>TTTT P P (((T k c  s  3 C$R+0*4:330,q'"JbKg bbb;; 33  z z'' ~~++b&,+l#Mf N#" 22222 IMM  bb   b      xxxxM77  II t  p p p pb^ ^^3C;v}333 / ^^b3;33RRRRlloDDDDDD}}''yy NNNN J J J JNNNN y}###,,((((WWWW BB >>>> P P (( { { TT[[ s z ',q36A6641-$KG__WWbb;C3  MM'' z z'' + ~~~RRZb&( ""^6+(5R322222 I MM  bb   b      xxxx||M I I 77  II t  p p p p ^ ^^3;C;ff333 / ^^b3;33RRRR++++lls$oDDDDDD<<}}}}''yy NNNN J J J JNNNN''y}###,,(((( P PBB >>  (( { { TT[[ s z '/&47667E4/'!r[[G__WWbbbbbb;C3  MM'' z z'' + ~~~RRZ/{48.2^6RB Q  I I             %xx)UUMQ 7777; 77 IIII p p p p33 [ 7    ''}}}}o@@<<'' N ++## yy,,(((( TT >>>>>TTTT P(( { {(( { { ccc c gvvv?#N/}478I664:/}*##WK WWbbb  ^^3;;7 IIII~~~+ ~~ z z''Vf 37D4V3 Q  I I             %xx)))  MQ ;; 7777; 77 IIII p p p p [ [33 [  7    ''''}}}}h@@@<<'' NNNNN R ## yy,,(((( TT >>>>>TTTT P(( { {((  c g?#N,36A68I52,'^!WG WWbbb  ^^37 IIII~+ ~~'Vf*'-+2V3  I I I  _  bb     _ _ _ _ xx  3 7777 ;77 IIII p p [ b33 ^^ 77NNNyy''++hhooo@<<yyyNNNNN ++## yy,,(( { TT>> >>>>>>>>>>TTTT W(( { {[[c  gg!(."22343/}*$OC<<c [b^^   IIII~~++++~~''//'RRRR^**m^VV~66  I I I  _  bb    _ _ _ _    3 7777 3 3 ;77 IIIIxx p p [ b33 ^^ 77NNNyy''++hh9@<<yyyNNNNN J J## yy,,,,(( { WW TT>> >>>>>>>>>>TTTT  8(( { {TT[[     ggvv(7?#N'^+m."/}/}+m&#NOC<<c [b^^   IIII~~ ~~'''RRRR^  ^VV~~~: 22 MM I I I I bb _     MM I % xx bb      ;; IIIIIItt ^^^ ^^^^   3333  [ b^^^^^^^^NNNNRR<<<<<<99''''#}N## vRRR NNNN ,,TT TT  :  TTT  P (((TTTTTT[[[[ccCK[ !r"J'),q,( "!G;+vkkk  WW^^  7   E RRRR ~~+ ~~+++++~::22 MM I I I I bb _ _ _     MM I % xx bb       IIIIII p ptt!!^^^ ^^^^  3333  [ b^^^^^^NNNNRR<<<<<<99''''#}++N## vRRRNNNN ,, TT  :  TTT (((TTTTTT[[[[ccCK;#%(b&"+g  WW^^ 7 / /  E RRRR ~~''+ ~~+++++++~''::22  I bb          M x  xx bbbb _ _   3 3IIII    ^^   3333  [^^^^^^  VN RR<<<<<<< 99''''#}+VV}}RRNNNNTT TTT :  : BW , { { ( TT[    <KS3! (vocc[[[W^^^^ /  E ~~ +~~++++++++~~ '''''''::22  I      bb     M x  xx%%bbbb _ _ff 3 3IIII  ^^   3333 ^^^^^^   N  J<< <<< 99''''#}+VV++}}RRNNNNTT TTT :  : B  W, ( TT[    K~//  [[[W_^^^^ /  E ~~ +~~++++++++~~ '''''''A: MM Q  bbf _ _  bbMM """"""|| I b^^^^ ^^ [ [ 3 ^^^^^^ ^^^VNNN 9 @9yyy+bV''''yy''NNNNNNN $  TTTT>>>>>> $s T,,,, P T[ [[Gs$~vo   [[g  ^^ [33 33 II N NRR ~~~~~~''++~~~++~~ '''' z z'Y: MM Q  bb      MM """"""|| 77 I b b^^^^ ^^ 3 ^^^^^^  ^^^VNNN 9  9y+22q N''''yy''NNN NNNN $  TTTT>>>>>> ~(b#T,,,, P T[c [[WGoW[[WW  ^^ [33 33 II N NRR ~~~~~~''++~~~++~~ '''' z z'%)%QAQQMMMMQQ Q   bbbb  bb  M """""")f f 3;;7777 IIII p ^b3 3333 / ^^^^^^^^^NNNNNN 9999 99999''''i^''''yy NNN , T [ [ >> >>>>  _c,,,, ,,, P TTTTTT[ [[go__TTWWWW^^^33 II RR ++++'' ++ ++ ~~'''''6 7z6 0!%MMMMQQ Q bb bbbb  _ _bbbbM MM """""")ff 3 7777 IIII p p p [ [ ^b3 3333 / ^^^^^^^^^NNNNNN 9999 9999999''''ZZbb^''''yy NNN , T c >> >>>>   c w ,, P TTTTTT T[[088ccg__TTWWWW^^^33  IIVV RR ~~++'' ++++++ ~~'''''8876`+XQMMMM"" xx77 7777 bb   _ mmx-B > BB33333333  / ^^^ E E 33  33^^^^CCCCCKKG G 99llss99 99 9999>>>>   >>>>>>xxxxx p ttII  E EtttfB?IMMMMIIIIII E E l hh zVV sss 8879/XQMMMM|| xx77 7777 bb   _qmm/k2 % > BB33333333 33  / ^^^ E E p p33  33^^^^CCCCCKSG G 99999999@99 9999>>>> i&qmm >>>>>>x p ttII E E E Etttf22vff?IMMMMIIIIII E E l hh z ssss8875(`M||xxx77 [   _ i imm.1s'L > BBB3333333   33   ^ xx 333333^^ CCCC G  999 999 9999>>  iii >>> p p p tt E E E E p pttfnnMMII MMMMIIIIII E E E /l hhh''V ssss  /22Q,^QM))||xxx77 [   _ i immu*q&B > BBB3333333   33   ^ xx 333333^^  !6)U'SG  9999dd99 9999F  yiiii >>> p tt  E E p ptttt f7MM A MMMMIIIIIIII E E E /lhpp////''V ssss !$qQ5|"77 _ _ bbb mm mmmmmmuUBBBB > 333333 3333333 3^^  E  E  t 77GG}O CCCCCCGG< <<dd999999FF>>>> iiii B tt x MII ttttbb77;;MM E EMMMM MM II 3333hhhhhhl!):++~~  RRRww o  s3~Q=!kc|77 _ _  bbbu mm mmmmmmuFBBBBBB > 333333 333 3333  3^^  [ [ E E !!t 77GGKW CCCCCCGG< dd99999999>>>> yiiii BB B tt!! x MII ttttbb77MM IIMMM  MM II 3333hh hhhh{,0(v++~~++ Rww o  s~,QQX=T))|?    _bbmmmmm mmFFBBBB 3333 33 3 33 3^^f  E E E E M p!!tt  %&nC CC CC ?99dd99< 9999>> &iiiiBBB tt  p! p p II p p bbbb7 77 MM  IIII M 3333 hhhhll,7Z85R#x+ +~~ RRRRRRsss$~,QQX-)A?   _bbmmmmm mm BBBB 3333 33 3 33 3^^f   E E M p p p!!tt  S,a0p 2C CC CC ?99dd99< 9999 >> iiiiBBB tt p ! p p II p p  [ [7 77 MMMT IIII M 3333 hhhhhhll++585R&-+ +~~ RRRRRRsssSSUM-P% g#  _ 3 3 37777 > > BBBB Fmmmmmmmm 3 77 ^^ ^^^^^ tttt t tt p  / / / o$R  Gshhhh<<hh<< BB >>>> Q iiii  E EIIIIx p p ttx M 33 II MMII ^^hh h h~+0j)2V V ''''~~~~ " 7dUM\$-P',$w  _ 3 3 37777 > > BBBB mmmmmmmm 3 ^^ ^^^^^^^ tttt t tt p  / / / o$~$v~z   Gs  hh<<hh<< <<BB >>>>BB Q : iiii IIII p p ttx M 33!! IIM sII ^^hh h hHP_g V V ''''~~~~ K'3*+ UA    _ _ 3 3 7777 i i  BB > mmmmmmmm3333 ^^^ ^^ [ [^^  ^^ !!tttttt tt%^^^^ 7 s   h hh<<< <<<<<<>>>>B ii iii : I p p tt E  E M 33 33tttxIIM\MIII^^ hh h HVVV''''~~~ G[(V"U%xx|||n    ;;7777qq i i  BB > mmmmmmmm3333 ^^^   [ [ [ [^^  ^^ tttttt tt p^^^^ 777 soooooo  h hh<<< DD<<>>>> QB ii iiy : I p p tt E  E M 33 33tttxIIMMIII^^ hh h V  ''''~~~ # SrQQ Q%%xx||b bb 3 3 mm mm BB  BB  i333333 ^^  ^^^^^ tt ^^^^   33337 s k koo GG CCCCoo oohh<<<<@@llHXD>> >>Q iiiB   p p ttx IIII 33  tt!!xxIIIIII====RR N N~~~~'' z z K QQQ xx"" b bb    mm FFBB   i333333 ^^^^  ^^^^^!!tt ^^^^   3333 7 s k koo GG CCCCoooohh<<<<l!&" D B iii&BBB  xx p p x IIII 33  tt!!xxIIIIII EIIIIll======~~~~''K  KKQ QQxxxx t tbbbb bb mmmmmmmm FBBBB : i i i i3333 ^  ^   b ^^bb^^^^tttt p p ^^^^   33 / / k k koo GGCC oohh@@@oo!X%;#c<>>iiiiiiBB : :MMMM ptt!! p p p II 333333 /!!!!xxxIIIIIIII II  d dl d d == ==V VV+ ~~''''  D Q xxxx t tbb   bb;; mmmmmmmm F > >BBBB  i iqq i i3333 ^  ^   b  ^^bb^^^^tttt ^^^^   ;;33 k  k koo CC oohh@@oo!!!<>>iiiiiiBBMMxx ptt  p p p II 333333 / !!xII IIIIII II d d d d == ==RRV VV+ ~~''''Kssss"""""""" x "" 77 \XXXX BN > 33  33 !!ttx|)xIIII M tttttt MM!!x2   U Uoooo oooooo#}}}.222222^VW TTcTTT TT[%)))Q p p p [ [ [b^^^^b?7^^^^  ^^ 3333^^  ^^ d d d d == hh dl   o ossss"""""""" x "" 77  T T\XXXXB > 33  33 77!!ttx|xIIII M!!tttttt MM tt!!x2   U Uoooooooooo v v#}}}.6^VW  cTTT TT[555)))Q p p p [ [ [b^^^^b77^^^^  ^^ 3333^^  ^^  d d == hh dl  ss "" t"""" "")  77  TXX  mm 3333 3333 7ttt)1%xxIIM !!tttttt   .... Uoooooooooo##}}}}}..::666^^   TT TTT P TT ![||Q   p p p [ 77   333333  ^^^^^^tttt d d====== hh d d d hh66 ss "" t"""" "")  77  TXX  mm  33 3333 7tttt!|%xxM tttttt E  * * .... Uoooooooo}}}}}}}..F^^__ TTTTTT TT!.22+Q   p p p [ bb77   333333  ^^^^^^tttt d d d d d d d d====== hhhh d d d hh  ss """""" t t"""" t|| 3 3 3 XXXXX XXXXBBBB 3333 33 !!!ttt tt  *.... U U  s ooyy..:MYM>>b  T W W _g/G7f884$sT E EIIII M t !^^^^ [ [3333 ^^ 3333 / !tt  d d== 5  hhhhhhhhhhhh2222ss """""""""" t|| 3  ;XXX XXXX XXXXBBBB 3333 33 !!!ttt xtt  *.... ksooyy..:M !%#!]MMqbbWWW   W WWW_;3V8887f/GT5TIIII M t !^^^^ [ [bb3333 ^^  3333 /!|l d d==  hhhhhhhhhh2222skycat-3.1.2-starlink-1b/rtd/images/ngc1275.gzfits000066400000000000000000002473041215713201500215230ustar00rootroot00000000000000Z4ngc1275.fits}pǙ ҾH[8*p: i+CP KF8-CiaW&@0C2LIqM C`hZ82&G{]ie/q8v>/lo7* ak=1aŠ'\o9 T֓t?ܒ*)ЛJҋGzb<퓉^25iel&=)Bg/L#B|_jzzK GRM6;E3. ]%d2/c%$rV70O"C =@.5Sqk D{A/*Yvvܞx!t|< ƎXEb o-~ E{hGRhNސ5\x|t l|ܩezۇ=%N /$E_P+ZQOrx*"^Ӄ@ 񫭹0Fx.&#0 &/$o\`2\5ChQoiď o[Op;:t\7<3Ez|)zKO_w1ĨS_p5$B>_ ~^EΞ$X „54lvU#gMS9+)esBb";5ʌ ؘ(hx׋wA$@heL?%G4TUlYn>U"H: H z,:LHF,jBmGOa`iTO[ZiUm7ׅO*L ,~i2}-8ɨ' v~뢦K:fXN~z 됂ȺJؾeCR=9(KRLME۷=QU5Х=IM]5BBꙂ͟)ˊbɤBD#4$CtC4tYh>0hD=CeYO|HJ*iUӫgTYϬ^zXUQWD=$cf cƏFHUEEycTq$YE iĿ,7~Lϣ4~R6eE0b,߿~J QDU9~⥮+!ERL<1rBa{!.c8z/UE;XV9~V9~V9~V9~V9~V9~V9~V9~V3~8ǖxoSBv<H%pkl:;>c߻ ya/eV3ErV".DI|גTZ ezT 'Sy|6f߳ ?w *Nx06OX~V[N{\fJǯ?-%].%==gɗ-.5%$j*H%v6 ^O\M[qk:U<3#LMJߺO L.5>Q)R/M#7B\7''zsnt7Tnm(1os] k!G!6=_(Ճg74Ѓ!k m,}O*=_Lr1ý]/B$T4!Y Tq;IIkɴ}JPB4։xVz_& h_j9w;sǹQ{{ymg~~{_cng?Dc.{}4voA;vjy>|F΁1)jl-7Ʀ|w=C<{w{ws&==d;𞹓24x¶f`Kz? Ѱ5}};l;j7{{w<gknF.l/4>ւyY6 gkH\j}ɘ+w;ͬw,ⲏp ع¸F3Ƈ<8xQp^y])j ԼϲиV9<|Ƚ迩_oj-n|%[``2 11J"yٻdɆ/%ysf*yMm߲Έyw{8:d,H0a?a?a?J|;Snc{f|p.L VFiv}hytԸ)7g<8n|3Rk5KZ0`/a/q Tb6 ޝdNrHG;J+v~G| su^ԵRodnNJFC3#pU `(`n.J0w>d^^`e08;(i78 nܸdl'=\Ys%O9vv1^`. p!I_m}jǵ!H}f6m%x{?9H/{`$wN:[G{$9ڰ5Q\>-26~x#>{862ݾ/d }19]2)_l)7-&Eԕሡq;Zϴ~oˎfó -̮,fNapqdF5+i}:ɮO3[~*4k^)0dVa6:= me1;`sыDz 3^g A%\$1h^NVS8wHtwXqkK7!Dd7aE/&2bzҷE-z]ӷU;xa}M0{h13`=|  lo*n}}H0fFL o˓ &nqf{uQ=Ցl>cZ.e3"׷NtC[diȈD0\ i i`ϐ G翘Km~ JM0\&Z}##2xe>Y*Lx]`~ߊc 5^cdĸO.q\g5#0d $߸꿟3TH-Hf W&aZ8Q>q'!׈_[f:gtz|o_:Y!՜^ຯ\zoFbxD*\yKbpA+X1+a6NFfS9b' l o`7Iˈ]`weyBHXFq>ywQ3&s#RLɜE#4 SSCzѼ`W;p̼zaKjFH>/!+-fkOZ{="Nȧ jᶚ`g:#LoY _S7ʿi }_͆,[~ =*ڣM+O0x| ]wCܭܭK!e\!jCE#6Pd6=Ƿbխ_s}}V9zM\vB]k{LslX%}6eX s)Vn]Z?ٕ6a;fI00 ;-ϵnšVwj憎:2Ƶ=%--nDٕu`@ .g`ywzw+|ۿ`o<=e4َ&ر?w'U"} '<3 aUE9qQQ1* *"V0슠1 b„`ESuw'P/{z̻~NE XQ$n[}NI)xE++j-O0<9kr7 yb5bCޑ@EfiV/*_'pfqrәeoT^aI0*s>!E0yV3/e~B[lb|$$i"q8]㮱Y_1TzIw%z}˟愲H~STc+Ɵeh(ec7s[KmyfVBJR !߉*BT/FGH1 $y7n3;K02 &փX^II0uu*F;앳"%B?&9DNL;B-p-a &:=#A%}O- 5PWsc FCl}v]Uo=]Ԇs>Q٧vH{ fjz>T"}1-ʙK lFh] 4WdDa|sSQD&}gd:3@^<Շ -!) ]O5r:{ssW"gg;&و"yZԈrΆLDΧ5_&8[Ǡr@6V\T{;(V6 _Oj¬aXq 3|_Y,)$F|SJ KuBQ-ܝ_[DnǘjhY쇭I B) XGϖQeI:N,8<هFXTm0ĤM3*1:a "$8=bb{ctl?o/y{0p&`B>x#HI0Л`}OCd'N}mj` 9O`~lS C,BؓMXf½$}0Vٚi|,TF k )NזHI:|-|6PR St x?*ft~ԫ~*b Ǫz}&"xK+-ղᩇ\m  ܋kkޛ5rX-(U5~g41R96/HFH#uL>h|1pW0U_]]83r=FH%T A;$ߵ#RstK~L6 eѷiV5Wl:?[3ꝙ͐'"IlsC6X툴Zӫ~yE7/C%V%9CN6{[&UH Y$ҝ6q{HDr3?#׻ c 2g,fŋ& N*gg="OՃIpΫ@0dBDYED]IX# &a/~op۹~$"J"kuȘIݾ3l,KsKnw+3dʼnaGG׌n`"PIzF?LY"`JUo,@Lӗ"X`PX:D>" 'Jq8Lk%TamL ȍ<yXJC;y7Ycq*z029 "$pfFtk0Ȭ f% _lˢyӏ1k(:7 ;lFt:Bp!/6zfcÞ$5yXxO{3 6K5&@JT#yY}rG?7m"1{cqT݁ة%y}'b];6qզ&*93VhFŏ$&::L% Kj"qu-l䬫j%O|Θ(d`[[%Dy Do`] ] fbE$ؙ*YWFݘu(tgKYRlwweˏ c&MK M5 j,oBըO0l !Cϛ[UK~Ol`}Uk}u8'*`o ,XIU N%0h`偝9\gh߻zM-82+إ$ /$k":I8 κ|iex4Wg|Yb+9_+әP}0/l̡ѻ"F~=r[6QYdad!Vs:eͪ{ՑU{z˔X6dgN-LlџDwo&KoGO-4#9_C*UޖsnJUY.˷[B0y>,Z"XW'^7 *Yo׵lǖ}#}#-cMv)Fi_+F1{dՉ VUۚ&R]?}EoYa&鯒S%M{3F`qtN3]=`t#Z4?*_*[8vG[3lWYYmG=m8FztIx{3? Ցm;$2h~Щw?YWӝ-5,|HznM0mIu4"ؚΉαU FC[׉u\SLNL2WSΘ9AT',տ>k5T_`ͱ*L!C9euܔV¨wZEGƫz`S"Mxޛś7Ԝ>H,7(d((S-k}^Ww_{f1r@0( gXˏs=taإXy9: {rNE2%:9?"H[)3&{ :w;[%{SᔢLDba,aw퇏To *"D~_l1 )N~g. Vvఊ0 F}'uf} ̨Vȯa"u;|9ʭm4 g@`ߘW(fc "@pgܱGpvcUg(`{!}:C0a$"E0';~}TIRdL*g>0f$N㝜Ԣ{^/뭕~g%) Ӗ看!̠y&Koo,pEI62Q3ssU]"˜~$ƀ]Rxoߖޒ13CfBMe+  ȝ|۞p]GE~z; KuB\}3v[[->1w@qإI)HEh] Z| |ѽ K?R*Daٽ?zg"X@Ȳ{{}2A8:q+ f z'}|o`c ];;Cǫ7Z>=v7`KSS~TBc\A+r7ǏG L0h2FU Xn"_ 6=ý45ID>Af~sVm\zg_U)juЊ`2J# 'X!gѣ>8VIݯAQB0&5[4BD@㬪**&WpfŒ==šjVI ETΨOOY{)Píy33WZcrԌk%I}rsCTV*N/Fw z"utgK^ch`u@&TJjQGJ&O v1iL5Y 68D0R ܓAuuF6u e7`PLHU&ؙ㥜9Qm!QnnS1JF&8ޭ#u7Xs c(|{\16Vs.Ϲ\hT`lve2ҵ\WD+"Nj4?z^ *וYbweN8auG'?W~H֕"CI" cz4qM(E9+|k +5X s0m7R U{{nN7xđJS%ϹOv?(6h >W`b(M'8,A燽s&:r|UGߔ٧ڞ+RXyswy,!8 =ӰK}K0HoadgVf' ,ʥ&"{3A&CZ,?鳆E M%{w`3v!+kJq+qBpӄ· vfQ1TF<f/#1^ U#\W^za%5j4?Rr? ּ샃ESt?TL0U8 9uGG1`B)z. D:SCj>^|K@ǦCધ+Oa}_=nm&!qB0ҹ"#l|R#}V9`o|`)I\28Jd"XWt`xW]EqӍ#y,vzPl~ZMEuE 9¶1s\#UNpo$Lpd?$XLN?}$د^_x5X {Fs _&ס5H:ξ8x+īP#>6Z5 7/fRo9/es/hOXyu͠as:5p4kfWxB jOg@3䁝:wB|OM(8g3!  `ZŹ9֝MrĂWl 17':: T"OmH<1T'6}4Ҟ*8Uk9a(&l<ӑ l%? /Q '޳ޖYE`SBkU}3.LǚvV.[Q\xd8{ F7`}]2^ 5 է "XOɥJi1K0FgqYZEاŗ&&FыQ5#~>㰟l4C_Tb,Ϊbo U?Wov}ƚL^yjwS0ô~*,|5_WVYsYRGx ~;Pq\]^szZ>&}N;+9Dp% ;TjCQ`?& *;Oԩ*96aN(@RA`A0ʕ<]P;Se\0>95I0U?RI08cLL}S~"جIMRRVa$tF,oio9u'al0xdjvÌn8-c fz<l h`O0#Ɖ%Dz1'; EC M&x3N,O)FaDmv8 %y3fL#"ijYUd W;C;R9eOt#3kZUrOo% EytE`lqUIr1eֶֶb=+H6P>{/yOzdzcC،-3a'q$wҳf4qG V2:Uf]T| 3VF,)=>864ؿlɰAsl,9֎d"a79;Dcfsw7`3)FslH5ϋ $8im wMҲ`{k`]?&fw`HFSG՗%Cpy1){?ںd?<RJ<:S2ጇ1[yys}=&A)#Gԕ94&ϢHKU+vBG}{\7']H0jSirO*y;I=b9}K{" Uy=T<Μdݫ['ʡV#Cw R&8y94sRA0& '<&6RcW2@y=1E'hC ׌I Ƙ/Et`{(TH& S37aKs 6)*v]cV qzjJEs;ᖁonM/ s-Zf5Jlߌ}*B ͸ǪIISt<9ZbJ6dPL;ֶ(튑RW$]E9zE6,5݈ P\ުsq eFtOŪ )0|lԪfqf,$F$=rAp ҃A&7 iLSzޕ`MYڙ'8ѳe`G0M~  *پ!Lޱ?"qO^k`ܶqߠ1Y D1d0v/w`au@0ֹu`'[C@2}`s9*aW tڿĻŻjvĺbk ֛jqI8>p2& ]ؽՄjSn 4jgb^n>6Hp.CT"94:h2Q˝E&źRg5`RS݋:=AA@oHSԩa>9;"'.Ws_)N%Eh?!Jv$"?l2~G#j7.*$Xw+;vڿRj ~XmqF Xzcmlݳ ,`M&#]#]/L]lJ{5} l転~\+մ}ʎ͘ety³aWS9?ջyLRo-dPߝ^ 4X'+?G"hoQ/ URRPU-T#kT&Ws%`99/G_UTюF壭lF>(Mxd=O/E8SIA+X2XOEsÈ1 'd+Ԑ<$lE7 -ŖnzGF;,v]f}n@pʮכMymY֖` .#(YC Lp!i[ b*~XId`/dB0Ě[3@&c!j8.$NӐLzю cT;=}bqsxbH`3"Xe& 3LZLeڵ&"o/ao9ZaU+0DP$U9rE;& U΃a̳qUv6H]:E&Ƃ9heIO3½ us*'~V3Q_ߋA/)fBonF lV_ro6"U7LpΘ1Bfg7w;]tN⨛`Lwvٓ nTD`$%$QE<]{Զ歹n#F?L*"r6@=Dx^YtCT ,x7~n &86>ܝ(MywT=#XaJw:ҟGuQwQvCRLoLWoF%'Λ2&**{tx" ,J4>K} OJ6I6;yYKO~+ZTo~kJ`7FI0gMԒ־8%`D.b] i4ei6*$+Ke42Orʪ]y5ZkNP>EqlkX(:HZkF=$ vA62^90K(35bDSݛC- "kNʷ_\yeE#j+tP1 5?qWOEnazdg2? 0/-j'O0dv#fQuv`I גəf+&VOGM9%wVFU^Вswc(ot&?M Dt)=mfZJ=i?ו&!Ls8Zuy(ApK@iaW= S}OPXMTCV32ѭ0,1Ծ[ Qg*Sɠ NMp9YffQ^un ~D@&XW(UQ58́N7=UmνvHƹTEZ]NďW6`56H0zK[i gq #/}D/ X$tNlk{3ĽZTɯ{kݭx"ݒҦXS_D,N&Buu}bUd"X^"wIb󘻍5H[$w)sC.$X兂6ødVrتw$|"N>CYO`uHY|v^}"I^ٸ@>v`Q.6j2@t5FE:G`Rrzۺ3`m FkC!s=0j4daէLTW>vP=W՝nN|6 pȯjqcCfVؗl'WoVtd-IThl8g孟!1L99m=b9H3y5gqvN#nvߛ&ڐxAeS!0U(uj3UcDQj[`ܮ^hL*eEb P8a9 ԿPpyau 6 :O"LQ!k9z_=XhkjJк.uwk=?`L0'*.kڶwn s?-P٥`y"m?$a Tr|g=nltzm|;p`&&:l8c;DU5X(N,D3)ﱊ©<wE^m>LpqN` G> Y_%w4(l{r3j"s'A sUA]*~%'OB &x(.K9Q_bR"KQ6"&4ÄM:OW=iQIqG λrQ}( ~'j : 'a r{>A۾ Oc׿X4ɦ{ F6VNV/jU8&qR/iJD#bQyj ;B) i_K7eT :$6A青fWi?0j.5Z 듏=fghyn`0Y |(h`/ܕG~U2}qJ8LWl\/%7R2yV>-cn_q6ԫkͥ&;~ZPs ŧqvEn`1ޛ3Qh?n Ӕn@4xag FMߚ3m+R$ ʲrExDIiQ"t% Ofݡ?W% :Q缭u93l&W d8[9+`+iS|y?/י̋4܇xA} ,?^ ^vU}-ϻĞ8#|r #NƪK`Im>üO:H1$bj]Mf}(扊',NNM&n҆i)w|YՉU*)VX}*6a 9&W2t"SfY K0C}ia/`5lH)]J^ }$@}K ^b+:Dsj Nr[n*0:=O~;,5iDsQEE ?"x ` mFi`(LU,Qk`32g%FXX5+;@%46xҲ=: Ov hyMMLvw͉†+ΎoQ5+ 8 u/o5O>'c:IF5.&HE0"&lˎ%"M`Y8IQU-;&&x# ޲lc?8|@|xnW^]ʙ>(oNz oŨ'J\Z)ІB'GHAt)T=M1(.l*$xdȈ씄mkb[c>&~\ؙyR sNLxF{7Ӷ^ߢ,,h |bZh"þ%1 ^Xul:}Z H>-D05$smUrNOF)7c6JX45>CT-ŝ$~&%2;BJR'$'g3 &2%̓ T$@r`[PB(} CҜPVJmSre1'R]ɔUI]L]3cչOC-OpF%AfD#Ϣi&%jL_3Dž5ZRd~bf6t/@pߕVNݝjـ)~GLxS^yoP p6bG&v;RI,nZs1C$-i#ns{cF`ސ'd!*!;g'8A0dUԿ+ʠu`*N"GM[Fzbg1Tu5ugݵ w?9_6Hz悹":8}TgP2*ZS &(`<&m.If]uWYkP4Ggؠr8L:N3rgܘ0“Gvnr|ll-JC; "XKXG`%QYxxWv( cPysx SaMF FceϒBkJW X X"o5 !D0Ԑ9##h@0SSCJk 6g!;m7`&Xstتԟk4:@0aֵ!V텣`TH۩(`Io)ncX6oY`fsCYs to{RՏG]@f6kZ3]Ix10z maHрp ;_KQ(2#=X`s.<Ll+_2 VfJR( 7)\lOMu~ũ@h۪< LTv^ŹLC{EEt-Sf]LTx *Rf01^mu%Et׎2%X1@`v؎̝am`*23#:"XuE78{nÉ= O=]a LڝJGx718]03GSn5 cחפm`"X:BO&XWg!W Jg 64dI ovi0{':#+ 1d9:Ӭl>'95N\mL{TM U?m:fPbOV' +J~gppv3q7Rk *vs$w&X"KMg $ʄ3E f ̌i@qCF1À_aE0E(K>UʪΒUpU]o*1&':+Oq\D^m01G՘hEp>ONX\`3o0"IL;l;>JM]JH<ܷ!q_Ο<`U]{G73`M*Wܘ:& O015ě`-xԷm6$'O`  Õ)LȡV|o9M=A9+ڢswfDMT s o&dzތU>j#(S1?&>Cq\~ n$^5cnX$ 23}ԕ9[U1,$`T^ih\-d{3LQ&|L4>ɡ@urN 5y{"J QLTDlϡ- !z c&PeЬE׶EuC yG|Z3 Ea7@nmAGyf5!#%XE8YeM"Xla;Cæt& ! a sEu}"';u;ZS/ f[PjJuMUL0E`}aشNF9N*NڊM٬t$Y*ċE{w׽rP=H =!nJyϏ2 :{|#Rn*n:9t s9O*_ yÛP*|$X +MUކ}?=rZː`rps|êvHű$3KRG\..>6 ƫ\æ!X8;$ 9T+sUdK9s0֊@_q;CD`UFdTI~/O*'8g>؜j+P514`M/`zJ\;O6U~+&~&ꔦ~৉LSЌFX=Yg4vj{C8/P H@9V7qww3%%ǓB)mQWXKyIPMXK/3*K8&PƇ)fsy@62;I">VHf?~P/g ߀9fI ~Pٳj"tb}Sh4xVk6@4Dc"I 8S6ZP^T}p`̵\\\&X\sn CAQ]d 2,L00:Դjb ճ`ޙ]S% y}smOJ9!j5!hK>y VӤ)cD`l$Hj^(_MǁGvҨ w#Z{4DbhʣvMSYw(7 И4;^ !AYQ=~eS^PS7OXˤW7]X8vj"@W _*3:KGwU4Vpn`{#F);e8H03o!v99կ)q"O> W[jK" ԃR}-Im?hb՝L0Q{u:Cԯpls'6>?q'y#-aaL7 O|T7zur/Hj29 7*㎷}RXIsE`\ɟD6oHmEAE|vRA{''ޖjA~AI\i_lIE8<+O$;/;/~kz;A01.W^qmBQО-m`1%8R7WRY_`Zs?=NJf_&5SB9ډvabN`$Z'9&+kV;A}z gf\m`H@b\ Ӹ|D'j29ߨHp?س*HbZutF5H;QϗXñ>@p (ƙ,}&zp_s_*Ϲ z{$dJ,z:m֓ų,Լ:ZX|ɧVu[Q7O !Y&O kAy>b_$K;@e 3ԉ g_>1ibARW`%blB}׼.p1Ǧ,A\ fm{f`f!hwu6GƖQ.E( Q絊nW=ej2W1 $Q2U Ot}_5Q1&{??4#{B2t;|INS6ZKJNh*S{G QCqH ʄ8:v`cp;Ռml !XMof8 0WM2`u8^9`nc, FCk`sJTg ٷ,-&h\O " v+0L2 oܹ]*+W sgzc$׊`#vU8s:g ıe =0dvؓ5yiN5[Lő4sJMM ltnBU!9A4<ڊI R&73W{6)OmD>GcںcF"j`aiV;TA*yJ͈Q{b$W0{#f@yk`gcJL,3*&:Іqk;"`~ZG WOg qaA^s%̽%}g'FE XR mA-pgh&outvsc? y;7ƙ`4$!*JTtUZ(WU ]ê+kj8=F6_QD0O9z&"Upԍ+gNfpH8CH-GAꂲ9_jR@F# Ep2jH0tOm`cpq%ٮT'J#$ޞ-N$X o2luMIS 5 s~93DPWv vH ^x0MFt`:":&B 3v"X7Dd^;F1ך`|;D0a`kiv`ܰGg}xxq l`v~ y}7ДsuH /+7($HӗbL7Y|ح`8_ &6L0b$RgFt!Dֿ\?JpȬ&'ԯl#fK"\#oBGv*Onψ}YIhE +,ErSǔ=V~<fOn-/},fV^8WwɨGzQ&89]1!:H@k`80q`|dPO0,2l]D0+ F*f+u 5p6AՓE0lsHHۧ1@(ls^0^X||{]b{K, ]*h< X:wH͈"[:!!C\h\AQWh"D@vEޛԤTp0]FnQdTQc$f9}&ZFGe}wҔ[4@1ۡu+i__{㌝!U80WCS4Uir߁&PKj! gPg*hSe`ݍLos$赧rtM< d(3}x"LY띠kM' x";Jj¾Z)nr(>[2\%${ϊ8=oһ Ö-s[G&Jj ,r+=YMl*^)"8V0IުҭST'}Kͽ&?> XmM0&kہ`o|lIpbې!!Έvv_m ,zYoJ-[t̚M6?~LǣGHQKvmQ/ǞK׳ܪRK/ض,&[ˣ^VbVt>RYd(rQ#"=H%'G͕EU-ت i{+biʐ_XwFwv[d}WX?cxquݬݨ7x,oeq| ~ߍW7> VKC6yn` OhsG#S6י9sQ(x+L,JT&*c&*g gI''Ep䟒\6&HՆv` 4yY_j*;'vg,#!K%ʯ`<%Dp^O0+ X2M ]w@/X9 ЋYZ =mM^&F~5Ti@-Q+ ~(>t/Yg 3M~x z1@&7D&1Əz}qx]jc[(r%4@{-y=:PԚ34D)l\>LkO,'Q"hi%@Y 5-w;%Ē\jc?K x,^JFíƋgi0P {&Xg;I0P&w{k`Ÿߚ`ulft.{n,^NJ`+{E-rW.^()@0ͤq􌈍܄"#"?D~@5Hu|Zg*<;Rn-HԱzd6Or? I>wح\VQ!s|u!|Y ѩr{'&KnRCA~`T4.xu0֖֖>]|h{C^*9|ūzo޷5~Tuf̚9b01;Hp^E>h&'8rfm83l!8&&Lp"]vgչݑag֚`0AKwUMq\MycKML7ksݓwOaQ=P':>J0pǨ/^ 7-$N7|_$Nnb 'R }js>!51 _Pn;.~t>-W5]U3hXj|INL})R0iA/6Əb?F+lu~852}/?3$B'9 4 ܳ*OD>Yb{!)|O0ŝo<'Ija>0&TɓЫ!˭h:q` *9bۢӗI_1 FZMzf*"Ly  X~ R$1S?X(~aE1]I I}%d{MX4hvF'[-OLRvjՅU3nɯK<; b5 ?"i! Jsq{ "E0sLWZ6/01̾ǾGy^ W, oO@G$KyW\svE*꒫KߔJ0k1Ň셓^o"$l`4ֳ+W y7%~s_^K۳kkl_Wnl+O NH$8J+VU!{DO^eSO0Z$#p@inG~ 6)hAf2ʇJ=AGQ饓"*xiҖ$/Ěwj0Ô`"UMr>K~ Ig҈`:ӭDDԽ|urT bfDn2*!nb:x"g@.sciiDś~ ǷKp߹}V4Wޟ{bڜIz#"4iέ`<%i+مj5/{. B\L`@{]%O`ycCwH7uq+DcnזVyOV޳)1,缘bGIB6 v;˽bz/l *G[쯈r&  gsgspۚ`ů9@#i1]뗻g;ݥ@;[4>#{_ѳbw"8'Z_w`O,ך` WU&鏥&PŻ XxczaI;:C!BFEccrbG1VZTcV<|0 }"}3?/u$plH3 T0`h:saB./ɯݒ[ k0y'6~ѷ!o!~s~.@? i::W8}=x]E0!?NߪqSNH.:ºs+P>~@ϗmq"G 6gѮ,M/⢥ VGD4 X\K[W)ᮊ ?L! 8q5EVy՛= {yM&k:J,sZ&Ufu`F,bEplmIehk`V :gy;`k2 g4 emX%ck Y6`I8qI0~4ǏC675 \~pŬ1yJIh]8qΞh)UD'u\bϻc9ⳓd,ryo ȳۺz!^c{߻ȇ@eO !qzThd`ABT5ܜ&=eS,J`HMGz;I0㋼1AIQ1!UE_|J|D|w&X?SXiY3vg'-L0A@}Ip(ɰ$8uR^YA]ᄂz-b~seG}{YC6) -T@f9T]iko(:]YW`'-e$x4tȨ(PRFLBُQ_֤QL!CL/2,Rio7g#`8z.ߧE Ik FfGϰҝ^-tFٮ)F"ZU䙁bP K +^V(鵞vxj^#i)vvՖgTp56j5lICЗjT=eNUA񤒯')^z_ `$XEHBwUF!!%~i@I0aoL ^%&"GJz4E7{3 "XpB,ZId!X" lW`wGA}}<`7xW~{(CL0za`ܯI8}Hդj>p6T% \<ڭ+֔~;1K,-r1ꇋ)ةS3_'Z3*s{wU 6{X؃]jy ɉ:f0jԔn((E\\d Mہ5MR:ދA~+_%TޞjY9伢b:7Jejj`s: &w/&ϔƾ72>2#~:t3IdGHvW#yw}䯕OrE;1O!9*_Ғ.ê"-^/;,6;uR:=rk.t٢m>T޽/m`=`Ee`F l&:F"k2zf Ə!G;rqSip!!^ [Up1ɋ n*)"8W=W]~5C0vf P2 uoA3 TQr] e7TG}uO5=–Zy&"Z(iYX{M4T% >@9|xz5ި:]N hyLqUzrcޣޣc&:w.+s`rG6\)s``xS> s| $X";wwrZ b,F' mlaB'f Y!YF"yZ҂T@1lcZf }1?o yL1Epap#$ã{Y=XY!k]9Q4>ѱ%SKD%JS[E5wsN%EhTmw]uO.qr ,}{̦3 ǝEǀ3~m_jr 蹏?1u3K3U*_@,*RGȠ28}刑B\A viHoۖԔԤvs?P,ޗxPWw0p\4edUEрmGLe3bI(zwTbˡfB@O= /<✊1 S{iTf|}+:CuXhee-t`\;@0!;5N`[{ά؉%`xs<}3>C g *v6`N)JLK,*wߝKηVc!b@%'@013wOAG ^:nR5+T֌ +g\. &g%̽-dXL0*}q:nt$ǙdS1Wsܵ>aw޷S4"X+Ih5dQ'6}n#L`i`vz$6{QZMh;EM"~N#)  LN=TK &;lk0 ppF<>fO 8 6aO=J}y p3@=zWp pl9 ٙ[.y*T ۅ7~0缎 iZA.y i<`|rq&f-60* Z[>`TXs;JQ!D0|n!3 #y* soG&>XW؛'0\ynn@/j &f-اviE雜VhpFϤFO乎#XR{zMqBt-!`*GfBIu10jW_UoL L]0f?>s1KMdcD[NfYeA9^Τxw=}>ƀY2}3*'YENrQ5R"&b6{Il0ڽ>q_r_էF4&9֢,EĔm");w,S|dQG b;6Mzė&f:,h03Z-a`lCr]3>r_ H^OIl c3Vcgxɬ O8H0AZk.].f}}A +%!p 0 n#K sq&RQNSWakj8Yd`n>j$>|2QB{zuM]zp\AG G F73á&ȭ_+ ޥYXe/B9A+K޷xZe`z;I=cHL0]gp*s_j'3+@CӸYLbXwtӓxI0Uc :):V^~5ηP5zۈ&9ǓiN-n4&B<4w`E/\wI0MHwQm/Q9&su`P2 $SF#LnR;_^i$Ap_ ψop apxS Qij?L0צR /3 Ɖi0L=;gMtDOiw DcZvx/NĪ?-ݕO'A̎zͽ&ވѦKѝ335+ع2ȨW[o#뉨F]idH#OH(<;ۋ`B,2XwiK)m逷83af.Sh̐p,X঒ps%RiԉOUJ )Y'9Iu47Do|g J56/hz86s/ 6LA]Wޢ{^>vOd|wL~rcdnj|`ڪ'率 ɭA6"=ѧ;#u`ѽ[;55% 5` XƯq&SQSy гhRS,2 `d8XG{{wRF]gV\{)3#pl}\| 4 >]CvPu FKE WJL>zP%QS&b16| 0'I] 3޻ςTv?̠VL0f! Q{jKg;.`Fo̟>X̄',M0l%U3yJP_qjPae X *VI bVW  &Xl.=zg?wt,|R))Fc'I/DΚ/c+/k5>sx{wF@0LjK5, &k^2U>?&ao&h`$<ОSN333ݣ?_`1HzkFc+lg,& `kM0*L}I!u/&TAEO;r 35x,Z7"LU AyI&^Jތs5ݟ\m4;2ybY;yKL'| TmrZ?V$R¥p¬Ȁ`Tuu&3$0AdG_=T+"h?/^ sYע, O(`p*qǑ󢴫^g~B-VkfQxyZzbĮ ~݃Y>/.0 ]LR̋d[|`JՄR5=nQ/ٽ_Co)z5D>v)l? ':JR0oLdE:;ىђR u iQ0(SSx2O~f`=1,E1&oo #G,z'G}훝`U10KvWAp@I+/ S^űL `@{r)1y&Nt)7Lq[>9GGM00'FKO\$%#"7Ont w^ $66sE>ɡzA8E!U\tetWࢶ}Dn}#ԲH0FäL:Y웑^m"TJM9v%?8| {ؠ^l vf:3͉'aSMe.T5&6)>o޻5_ŵ9Kbv!H")<V[ NuM-#5#L hEj` *~'oW`S%r4a4x2vB 9vBv;H0w` Zw3lCF`sbe c!``vv'iD!ƌCynγL/[`{*X` t+ 03?q3U&*h~U W=wH}{I'SR8t%6&`"Xuh`hsϯQni&%2`U!UG>Q}m#_;z袧;l {>&hvW=z|}^#Tc#DxUZHtApّ%7Ce:{@V I:;Bِ`񉻃wWy'Ur]uGx'`R<@0aМPovѵF /WYi1_ qaFߛR"U{=y*MI0`|SƧ:CƎzGx0+mU^]{u|j}j5RT艻Lu֣:YUz}>󟖭j ,{iDn2lI!S':Q'9MPk' S \Df襮o*fم{{{:~Rؼlc+AkUFC G0V^nsUep=`}Ql`Idg +4$; z0"`A] `š`g Scwwn߾l`Dlt_'߆A0-;sIvF:A0'#>K;@#o`3j92VJQ+-fE ʘ`MV 1AV1>ؐ JI&{;sE"Y;*'C|> xBp!w}ajSx" F4K9k@<vum/CJHλTR|2&9}MpgL49bY Mw~;c C?E 0zմk%E%^Ms]3 IZ+|,ƨSMy<[dA[quҙyBMe#s&VF-A#[[O#Y}KLlwxŽ>ɵ&y?kW y;I w`fAw0x+%LYn,TgFw)!{1& `Q,v{zիAަ8`;'Um<`%D2Ծm`=Ӈsv4;8`\lErtQtU 9'+h0  {7~={L 2=-<>m勝QRo"VJX 4 > t8ܥ~Z?Q`0}10m:b. *|*crt{sk:XwDkb3WMqk#x<ݡ3K$CM9&֯M)v2ywsU[r%$VL`M|%}l ݳ!r'6EVϺg{^e؅L|fQG@gik nnqW[mz|wQz򭡱#Aπ+swß ]E\SgCa@8anbt@ֵC& :3l Qݞ%b۠?86;ǻ].ti땉;ޖS@ Xy1q8$؝*ْὀ/zg};FFrD0װY:0uۯJ5H0\S;A7 ޢxcOΩ-{0{0a>3* \B0VNC02X-.kMs7FߔFz~lF0I0klwZ\8쭰:AU#IPs9*3̛P6=d֘VԶ[io z^i?gGgXCZi#mKU+25+h ժ)rU%/֕S 5 FP%.M5G e.^} A +kԄ_ 50OISjì\k^UO>3p>Z@P期?㓜*,H&#A=x=lh"2lonφԢ!vDE(T Б` 5oH3;t&.M~,qde}oI,vG~E:2L;Y `TOM1s?\{ GbE~ꁫ9;D9d#Xբ ƙz0 l ԲP4GN؇fok󨽟ޯ&Kgwc%[m4A3rz1IPMwv]3VZ㶁Hֵ\Uj,.$[*ʤ:xz7_j5?];}h/R<#9he~S[HDπGH*ݻݻYo( %әY2'`Yj)O>>Sܑ_yVӭ*ȹ%)[ UWoAufBb^ .O򸲠z-"L,餋ɜS[saѕ+YwϦߊǜn `>" /yildNtk5:DA>,}ƕ)$ Brlhiک"O^8)N!Gwo؃x|bY i}RW>,O1` 槟yE0Lsrm-SUevGKrb Ӥ7Utsz@/LeIJAyW~ynskZb XZ:|©ۨ ^P #&@U{z[ɭ"L)d/E NUYb03k`"r-?fE0 AvDsV񒭘`{ti y;=,["kΘXm}h9BB[;@-ݫoLZ0 Y8pR8*¼PGO]0^'=öh79Uѣ b:Tctп^_0}GIOʣ~7qI=1Ň@gtaɮ4Y%dΞ q2E0ϾGF "vxYGcW z`16S'>`ߎ/**]jIeѫE^SOwK *̓}*7g >`3QT4W̵iz φN#&P) N+ޡSdSvv^^CMFbcFEpF9TeIzO/eǁ !hV;BCEϘ߂sWZ8hLimU|VyUUGTQtգ܊m-~hL|8ݡCs*+{j{\ ck:´&}P^:s?.2v+%lV/S֩TC9y WU jOrq9v:S㻗7ھ۫dહ#`dHE+'+ut`wf:z臫ݥ^]V}lZΪ {߫W "Xwm$wr&XG_D_(>rzDJ] zU \*])QK:AS*"BZ]7C 1c&I)X TRXp>0,T@0@AP|@V֖/_Vٿjj~۽څ kJ/9lyNtDmXDzw v"9gf"zd ]#R_gPj҆* vkrd c=TJCxU3 f%c< 4Ex;ϭ~Չc 'KzӬӘ`im`i aaK{CN$;!z$r.>Z6Orm2p`"͐MI0[vhuص~QGuuמ^5U2\\ZNQ*cTBE&:Fp*;N D[sO3wޚOsNj &9_&`0=q_ıޣG43Y묅yb5@uvZO"m٩[+( ʏZaWk\qV&Ծqí8q;v \hZ谜aPfEOTfIY[{['9/c'UnA|^|^MKsOK˽s疝^ѭ5՟V[=XܳgĞK{.QVgXEe5%geyz6%ϋx#$f%=<+7ٿ:}o>u&ٽDúH,­2ٺN@e"kC, yevA3Iw7)}x"S%ջ) =:~ö@'Fl&KEbin%|QdiXq, NJ bcǬBL 8FcƺPta+2l&}<(>;Vq&㽻;J9yRco;iŰIpt ё@*k?E*3 vӁaEwwf [>斿QyxM.9y/Zv5ה='?WN)Ycy [>^G͏fFeM3uXG׸]z/y#fӫg"8zX0`$bw *9SL g`}7 ܜ|u%q~O`; TksrJH~Z$@Z2 .$qN(*+=1Zmi'MқK1 .Uغ3{X<׽|͓{NdYc͎Xd𺂿_0}q&y^< |;R+͹ c7Kݏav'b~Iܤ7M`0P&NNI`-]-H0 ȈTiUPmIQ–J:@lWLbKa،{mCџ^`Hp̞W^]Qɞ΋@0xL[>I_22L:J0_O%F%a-ݒQZz}m{pK-'x ח`! luB?<ў}#Y z7`4$=/c}qM~>hAդkw!}}>eV#D02`凝'hީhtq"90/=!dinogljkU"⛉TYv0dI(J,{>5PzPb{p{I-P '['%;FWKҶ[1~F]1WE LJbkx:L̗6*].{?/yTcuĦ[L뽺jٳqݩ_ ^056(H`bg7L*g{W,ͺHj X )b *m2?f&X,/\rXw*)R|j{̷`eR?8{ɫjJIHt$KjI3&Ž>aU =|k-FKS*~p8WiӂWn(p&As<ɳ\R{Ne5EÁ`3L1 (D3Rc"X&8R% (< V["ƽn_U+$t0hL/R"X(m ӹ}J`d F Xo fb#X*b;VJF=kS')70=JflYUD"&Zy[ϥ<4cem^+I]^8hzNE #32V) keo-|ϩ_E1ssQ([%qqLp0U̫zⲅ/;z.m `644A=P]kvY|[N470,)>:y4_MҘ쉤$X, Fb'9x t?| & hF%<#+% ~8g>ZR)muFB1 J XZt Xp;ֱopHsTF3&\󽝨_ྡྷcLfM&}3)(`ع^ 'AJT$JG3u=ϭa{tiXy9R`m-&1 c! FkN*̋# `(Zj4mG:ٛK)>WUa ıS֕sF\c}Ok@a]wOVLp{Et_7tZ*%JȔzw'%?*1,5,}wjMރ /YU2d`忪VC]k>%*Bb8УKpP+.){p+{ݷBƣvfۇ*Hs*{{(i&NoJKا#qU$V^dm$K7D`woE3仉e h'E%luSr5J*`I%!Fc JƳY'g!A)[}Ii Tȗ~8DV+n=9>b``%4"8*5 Ϋ\z3\=n@aͳ]k7OnjpEpy}qA)E0 # n[3a^v~=|0<3MslYV%_;_g"΃`z Mv!򅵃-h_SE2?H0`\`OdP+ʎy;4f U2 Hyy[@pl]l]dEdEtk^]AF-o$p`̜b7G0^0f|<+9/|kI6F?Rds ;|:LcO(p$ Aɻ*RkpKÿ!u[͉ e.,Yl.6Πp+s_#}όA/" +rEex~A{AYaz(D}n·õvk1%#~}"(( }\G41+SrNA^epgbDTN^[A0|º$Oj#"ɒcm+ǢƯLo,=*9ws9$fb+xaxEW eե7e6g6wZڎ 际'uGr\r\Fb;W6s{̽,?"٧2A09$.(f[lU=D/ۧ} ,Ȏsj87̙^zvTUxK?`lZ K5 }}Uu(!`8KVFG/U "#ؿs.j4 X|=Esۣb'ZCMðDN"Hpzܙ澈d";/kD=מ a(T5Eƒ+X40:xm̢ $no=ժiU:6;e`~[@[mhn[,[#آ?^]HdUs[h{]N-챟EPПG|:OjOGbӔ?A*&؂-g1T0gDXElj3KUBng;sX]#cD"lD>ϭސh5iZ>nn=z׷׈K"_Hs9jںPjw]c=˝&q+͕H˴ez6@7EBZJ>.`ދN!b>.TqO>ݜM wz'HN]q+ !K|S:H0V+ ؼ,D$3k$G[+bs` 񚣷;@0orYpM$W o5E0Yl9?q~F"#&'ع5$XmO֕YlluU; z ml56F0l0$"Bb琺ƻ ŇԘ1Kcm f+L;  Vh`=<9j 篢#Ⱥ:Gϕ4| [$j2/N(31qV^S,}k}U"H] O#X$REZivwb"8F刪;,MW_ρ2{\E62jͺ>sهSVO"HzZ=Z#5zѾ !Pᓂp`82ȫo`oCكh`XM"i} gx׏Æ:GuHu?RLNk`[ve<-%v]M8QMà "7kݖ! dznC+:]Wk?% 5g Ylw`8Gt[Rp4r>X[zz7ߍF~!ft&@;s4Cp@0u$RzUʩkjC S-D6Jy\!)=H/`^j`%;FDgK5M0s[\0iXr  //jD.Do`E"8|OX='v A{<\#ȍ $`UJAk.o'!ɇXݐ`ku\70$Bk!n-&ƒLVm+_\w 3>ʛ{!|>5ߪ2rs`@y;1Ed66^I"Z? 찠؟I&͛0@"@DgwӀw "9u5!M&[7H:Sn 7 &(\v158XEFxR^].BV 1TEn≯HvXq"2EC'%CcO#a)e _z'ϹIkcm\N<pV*APnZQ4gH'&3Dt›P^1Ro#5ClH{);KARlmH>wA i'ae`kNwS zdW/q'77գOo`PYVE/1G"XlH6I[\17E` {]mlfz@129 x^̗\ WݖYXKk̿tǵ\ko2[PC}Hja#jR7II {g.D/1úy [  f$v )᝼ &w;$t {JT GqL"81!;)vѕ֊^]ĸr}G&+*lx68JuX唴uw EgɲxNYvľw珕':5Y1RYe 'LpR(NпD։鋖<>Ɗd\ {Xm~^*07pST`2H{y IAosTA0z+Vr0H==7`O7+[nSD/%A9&mtDe6jùdugV,ﳔo(sgVUl; |rɻ= s&Uݤ Pe'7pX[Ξ&dBM۫ jRrȞ5Abe@tE?LIīIyfb3I犒^Jnsڳ4bw>i,v?*ݮvMU Xm1D&[[I0l0=:af 3A (v#/t'#c116Uնw7 T+ޘg U,dzzA!88uCߠGU4BK|,B+#XΏ`(zi-#v91{{yrUWMH=aݾqA +/= t+md;{s؀`eHp<~2Ku(;]Ť }P ;ٳ%g د*z8ˡuz;m$ bowex}!!fd/NNo B|#SulI6$2?MMJ_P{ޖ:&6E`VDBӨ_[}qLu 9[H&KVGnpzƭ 5E/k핌[۞s?\'fl7HHi(y|R;tZH!}>64-r-;Uү=Q+~uS@n`f<V|ZBp _M0ۃ3<?|]WytADL~oVBH Sk\J[6RQЊhqq x\PI3qZ*v A\8~}_ns7As>=L?jLQ\`'? T+"yE\lQ+7p^.~-NRstJg}go_욐iL\\-*3%NOݟ8#ّ ϭ<[#a["(`ꃠNӂҲhuOg*}T?ԓNS>X*Ф8ҥ9Nhw?ijDx W!檠(/=KFM"%)+q;`g3Ǿy+r?şbzAk[ס ?[5lq'.$zAb"4iZf+`/lۈ/,0NpQ&8P.[QS9?T*SfkZoߦ@!8h ؊)V 8&u~z-luqWd1y~* &5al`5gc=L5$w˝p z{#~MM}#NrALu"QD[U!rg)E|6ӎ +F"Q]…Y-Z{PT}(OX}ۻ#8:'=;ߐ$fpdgl\7c&8?7 Bpp{_`(Q;OԻ$Xjrq~b&\EImAwh!A[|3";3q+a3/ۨdS;ͦp`Yi]4dg]!Pvg̚ֆ#`m[ϥC&φde-\@#O+:ECL &ʓ3bXQ#Oj] L=J3D,_/2[Q3ͲMpGq$ooӳ2\6nLzդJQ6Q+ |. E1{OI"غB = X6 J$wQclhދx2Pl&?u!TD $bwanwbl~SNRŊz`&xV&GzwBpؑ(Gw|Ft!h l &ͻz"..MKe{O` +KOsL1L`/,g7H%*B r?idp( +^\u6,EAk0x(6Lo4ѵ/5U̹Co֓4`YEکޒnȏ j`c˂e ]/1"ZSGdx%)šxGNfaPj^z@ygtNo'm"g֤&k#:}?JNl|p'нer11h*VDީJ{y<`F-g!q܆8].ӎFjmE&SQ&`0Lyvm^,co}f`SȻdR cw;NM\wT'f'^nO$&(mfLDngު^FİT8:.SE׾#p7poi QT*WKY.+b[1 d?\%Z[ELE)E`xl(g> 5 ~ޙC 3-v{cljw9`R =j!LA]<+~Q?EsQA,zֹ0Dn) Em,F@-4ĶekF ۽4t(FXob?Uە`FuO!^e>ݳ&8j;89{#|ޕ.KLSO%'~QFxs\oL/u[ ݠ[y )zAqt:[E+KU٦\|k\xV >sB,,XfofNy't7'(-9[$k,-A0mE7{;hE#FT3̶(訛C5N [CN @T2*,M3ԜڰޫƳ6h=Lobbweڜ '{)]${4vDpqvp'+ _+C@ B}2v`JKځ&X+{^`b|nWaL~wxO NLKui?Yluru-ӒڜjLl ýrWQ(JJC@TDjRw(_ͻʯ _ޒ%`{ww{Kd6L"0/צZgѫo|W|2/Qi5Ahm֗# V*7ROP!fѢ 3JrA*9k)utgozpޕ-Rל]3b5 N}D0VQ/_o 697*~ckvB0a?P2Y^˦s?o򶪏[qSt3ybEpp0%ͧFlsaAZ Fvb R3zjx $V` C9P%6.mҼq@RjJ* =~#32iaK#?9siG$gt fz K6|Ewo0 l @0f~+﮾{kOSzRu*wAQ )|sS zZ  p{^Zr-uATmjtZ7@0|cmj?GK9NRß&s/th Y8 MbdBpm|7ۄ`1=hen?jW!11Xj[WG *{f"X*Bp3 ֭ه5 k\Wnk\y#ubyZ)t$g)N`&[K*Ow˭ߥnNXѿaw'Žlr,$*[%";k;+NB1`N6*HEρp~8k ~"'1aG\]빺TzH_fELCi.+?L[OޥLkݣ%?Jߝ_6Ww=_8N1\K3;7u*1awSR_lz)OtҞD&e`t(BIu!s"ي*l.kvU==go=#!yke썈,;|LjXh.*Bl:_Ugq"dEpx/V*B5_66mF>krs'`ڝ2!싰p;Ax W.\^ Eg,o]М9!BWJT6$Glm+ |)b6Iè|V)K*ʆ7 RED1ʴgnsWK O{$ ]_7R׳Tet~d]Ӗa[7aklQEAN%4w$ӟsRsN6]awձE /!c8\i" 'fs+>^UqvGOl϶ϔMnhwMi;0#{}kzüg`# Dl` :": / fV+> B4DEV9utWt34LqS5x(HNfא\8M`kMn`_`EK唩c}6kv'B0a,sx ߳kq#}p{'"fg`j r{s,}/xl gj{c#'c|(tU^:&*`8ѻ[EpoJBa&Z|AӖ"b8,rt)Y Eʮ=򆻿W[AUIOgMԆ1ahnVV Dl& eG|5#zTcV}ѭg"Tgɸ;$Z3";J0F, {"N`>`U8؛}HiQGt0w(͵{+ N<;$XI|SW"C#ChCyV-uRyNBIƏtX["3Z"-glqvގ͉̱։DXqXEH(ik>7PvXQvA?]TPʖ܄S^yyT`["5!dE_Kmه^WW+;o~epSǸmnX|a/Ū D}*xeH0{ >$82N6מ`Z8|$Epd:ӧ#M;`k&@OeW4o;G{R뚾A`"XnGD~}YRow|pjTRi3`o`z- R,+o ~MeX~y :+E K^PZ"s$XJ^Yf -rk7Vc]:4|ȵ@?HvAE)+F MQdeeZĶ3mFDVGV}E&m1cUzl1Xn0.wjSx?&Y'H|FV#Ӊ.cP,tM{W ֌)5PnL v»cꓬum( TR@aζ>`4eu1 >`RRqw0*rS,oL^6((q򧩋]6#WyLǧ,8*ۥ I`#"[&8SBt;1k"r_Cpdp}&.J[ =݈N`=O7xs֙9c` j`nE0I~U"sL0j`DD]d8$yk_M~7"8Ӝ/.! >F-vׁq ,Q Tg[:X S(xQ4Gx˪#6tdCDdّQ`R"27[@P~.o$}Mۤ$I);XnmeU>KGlJW/V +.:ꓣO<+cS!fi3; &{ZFrd\-n&GΕDoaΦI.-$Xj1O>'򿣜0 ќ2jmo"p='zN<`_gM&W<]őKȻ` X,H]%b=DH']k f]>&XA0,| l!# vJ"D,osOIu% X_H0Y]xᄠkp$X`L(T=KnsD49LNg4ڔ2LѬ欙z'9eTG`S _Qa3$sfV9љ#G=Jrt6=DR*zFN=˧EcԂG)# ^$I#`fk;:=1>Z뢯aleMc]1mT tX_WVnE[ ؈hD/ѻR902|<۳0`=Z$ Y.'3=`F'E>YWc,Um`Mq;m64XM0|++^^oo,Ƃ"M9Rgw̮7yU~gwU.rq\H LVɴ O > &l_T3 #8*b# .g E0ыQ \UhArn[czUuk#5|8+ cʒsnǾS$$3 Y#ch#k'Ф*? Iֽgё"'HuEoT9HsK? 'H )MO:y≊|%MzS&`I~cw8"PMg`g΅-Ex֙Mpu`q F<1x% ؿsi$~xͪOTp[S%X brF83 kA0\"_yb$3 FrM%.Uhǒl%kw($q.cľxwxɬG+)GP̪\z&5~9&r~{]^\/E&n;lVP/TޗaU'[D,4Fb|ꮲ]n7gwA@dQ|D{M=dl`9kQ1c,f&hz{;nE/PR'@0傗&( 1 %yzהOHu}=a1ݝ46f 5.o`'A0QlGrL]2j%%V Q&~g}Y58ýXN1?5%Tn '7TT{_?`D`6gDF!S* =<<`7y$'Npm*"2~ =D>ܔI0Ջ3'?R~gIw#z \{ṵbJ̽Ô{~cspt=gfZʨ!`9Cr~l=(Q 9Y2-4y(3:.5Q~>WgT|."Tߘz|q({+?~3~igQOb_ӧ~ZugVAC' "85X]ArPSbћ1X޽йV!Iblb|ep?#aYKS2cMv\PM>1v;l(rn y9E~<=v{d>u'GMCs&;i7`COVA.e_ }S88O`2~'ɷK Wbj _zMpK&2t6]*-?1;Q7~)<{@N[?(h%"o܆y.Iqg43{EEA;;)drkUsI(|߼If䁷V-L+k?\/ruv̼Ma lkWi72Mwkr XR!ߗ8ӌF j.R[mC8iJq+'LZRw7DvTXs!Uıfq<š&z_Qug3$T<fl2tZM$vK$NKQ~x'dX27zQqYՐoV{R4gO쒒T4uoH"}. b>yv vg7Rͳ,B0}ߓ$6<2lfzqfs0 څ5baNg>0 2Z35 &z3d G&2f,տ16?9(Pw4/uyVQj 0LMS7iͿ%F P:U5-ysk c61.X:ҧ`k&- dtHP_w>Ot)|^;uW]Yӫľf`6+Z5k㾜78u[sw9P)UMry0#C$sYͼԓ9O& ir_9An#ߓМ3yRr&̶ؙ u k9 5E08zb;i{A0WD>A9V-'= .xj}φ)+Ie,(Mo]=Mz)uBA0HpTrsŹ=U/WyR$;*+3%4'#774m}ZI Z # B`A"HUެã  baʣReU֙{4LZ7i6[^R̆ cl{9:&!~c`c`CO6 nCٴi{][S^+#/ބVUJU>nFwɡ|&&4d婡ҙcޛ2v&^ߞ/bL}av.A0p%lh<=ӊ_RLɤj|#߆/l"iz+m7EL`  ]I޷f1*Ah6eJw7:dެ.#ЯaT9m-^U ȭRWRԖMG)>e>7`[5cJ*9RxmIոLML̤ң]GM8cNiT¿{vC&:0(] ;4E]ڋ┶A\8- ,-MT؛~ -<Ww™+ʨN8K.Œ`{bh{-*Hv; xָ}iظItT3ayN#uk˦{ʸ)3Uoc;CgB%i 8jNK: Bmywmn5klw6ʫ')]՚ qshJ!hklH,]\mE0Q KqsJxF_$^`he("/X)|&X{ƳY8U8:iQ#7&&'}qFt//Kǘs!x#oZg0ɚ\L@ɲe:&jKAC.';r誽UCCߛJQ5OjZT<-PNWHt-Plux6I僪2Ť9E*M1F]?Ÿ? CY>ݜEj#U{mTEchgMe uslK[ދx? aX6kM1CU `2MF֓)0,m/5!OWI2ϏPD\_Ha`e4'>Wk:hKaeՅWBAU&c|6`] ׆k,oB0>|S`1P5|{?~*3|!b %C(ukɎ{`E&U&&vͦ6iǵʅβsQMsOP?/c(^,W X`TWY6&t6S@uCy7Id &Apny=w:#CLVU .xtI[_h(7Uf~/lo '!k7q3wpZ]`SwbX{wKWGy>I CLYdFv`=|݊t ,S^+SuCIg-Nܠ :6z3h,w?@1< !ZfҐߨ(ӯE0 GwV&~ڊi+\гҙ?L[ӗts#%3=<`F2x+cG#Ɇy3BWw&tS溷F_-[ <1T'(eL6 wST&(i#?flQr(=޷Hx[?׹͹t[ɤ"\+ 檀瞤Z6+NKgvΚ͛{F0QIu"87] R#[)Kv74L01L~cu]NeS'm{y7 `ǑTvcƢbm{;Ç"Xf`cS_`ڪA0w%]P{C=jO& A0& \LN`@; &sX6ؓE6{E6P.ݢD D9҆/uAR*U\>>BgdՄ`1ۑG6|"ͅwm?<͗tBAM9 !<e U.&[-ߒ]M.~xM<%Kw@>KeVŇ>R6m߷fY !]d5Y3Ӓt۶)^+`6>"9:x8=oY/Lo.92ux[2}7t+~m]*s6FsF}oav.mf I&%aіY{tΤsznmhʻCYEۇ" $t~yͫF0֑9V$#ГXqjY6d569$iRV`COH,B(un)$S.Vəo92r̞3:!:85ɏu~Ԥ^".˿%%oTW=Cx ^xR3xu/G%e`sP)N0vo4Ub`:@>Y5a!80޿z_dq]Ԑd]\P#‰+++?ދz> =7ۦ| ji7}pvf)|9Bfᠠe8sltmY랮{Z4U _5;rr?3hq)s݃LDkXY?7CbY~3v:wÓ7u smSpD[fFz}aI?Ro焻]~ wGAq2Bg~)P>d ;'|nz BEHn32k.ocBK2,xN{<TZauf*?X9t@gzO+ŋ@EmL{5JƬ@ Fwyl$s%M|woEqʐ3dK36#kKSkd߷`Y[&_+,^M0(W!W|B&ΦSXWInzI!ZwFՎlz8݊8~ d3ugr7\\ ><[LҚ4!X^g,I9h”hUSvK~TiaÆ -~PQ<*Ꮳ (Ցp.sDhS_(Ҷ. $:'r D)Vi$ !ذ_6k> zLL?~%LӵFdԹ#cf=Mx9a sǮO͚uSL'I0ju5)71L,ĆC0`:IO@oPP~Ta~Æ_6UŲSso| L,赒FB[17fL}U xuN{^R5?wcʸ,M"8kƄ[l`̱~@\` lxx2WEn0ո?\W:$\h̀-I溆/=_h!X(V/epFAyeEוVV(lCiaQ];?O7E;!?$W4))䬴%`u䆨*;HOz$c/fj?/3+"w@W:uF͓{qdiu ?ߎcPee ]O,lvMyl̝ EN`6ncu"=k&*u.^zL5Ess=o6-1|&G)Sccj]]Jsca\C5.X&bI<˙5RAuXg vuz"{ީh,W`(_]1c]o+osK^ZV<#%S+y )E- պuN&?̧D$2T.7Wyƙ6θѕ!{I6-5Ɏpvy"_BOQM"+#Ȋ#83sK *K[ziZִLmoj,m, |cx Xy'169ly1dRLn/&6=3.ҙM/~E5/[EQXwCtol:37P(=gA">n@A4i*6o_4ZlJEHJ w*uou* B0}?ˮ %M9ߙMz#d:ͮ|ڮkۿ6iYaPܰ81$0a3D5dvi͜Ef^rS{:kij,AkA#"fX_WjhcY KX!e!T2lgLQ6Fv<}2RX!NۼЦdM{P %CԞ^,pI8w'Xѧ FBYk\&9d{ݻwm{nv!o q`?_&K"9Clu,a#!X74W&0yv|XTIUf}?[Ap6SE֏ulNu)TaX\Ȅ3F4jSㆸгe[%M0QtyŬ$2O2mJ^i`QWi?FĦNb.Oy; C-8+W5OvMVoĕWN󡱟< sdW0>+[ s72e)l t $1EQUeetJiO%y)đV 6W(xt{`0?2|!ƛK)3p`ѝ?)[ InuçS"5 KxuWBVU4珮mwrKh>YuFjDY2!P\jO—9[Z%h՘r_2}'2k`Sޙzw׸w\racQzBƌS`b(כW[]SQv1E0L=:K3_s+&sҰFuꪮ T(Lt2 b #N@^#*J`  ֒%,uĠ2 #`}꿺oNUծފQz]fh}cT<+e}stKdo)^P~H0e˸h$ĭ'#0&fkk7TD!4.( 6brFNeU+Kmw6Oo.w$Kۉ."{y`b#G|S;C@o;hhKM4N(O{ [ߴ<[{c*4w] sBp,^^^PhU6M\pg`q#rWsHu#@Wsy3ĄY)3gA"cưj{R/G9k5֭8)Q;wɾ";T1aw#m`mLo}coU85q$UKq'3a MN6,V9u[珋)2 o^6l(0 (vQUBUk:MY/f>8O'S*OاWqrVTIOv}qnS[T-Sݨ9\ӿ`,DW{}qw|[Wn ^,Ӿ(|P$"=+|MnyhN+C0VZCGGP#A<7Umi vr%U$x{̑D07~ʵh!1u]xL)ENO[WLWI``BA;!ܡ9$:. r_s4nV.'>/X<~kRs.{^u2?ooɌ^\ys~)6ʾ <<)#J㻹=uN`Q5$'a\+`P>m 6.;Arv*kZ+,UV{++|@|@tD'alT=zbPtҊT WCS=zN0zUr$w96a|F,kNrF@XYWʤlS>Lv@!^9:@Շ[ΓVjռ+9W^"Nso7hN$3 3iH1 ;m |%I0v9u7"I̍.,:vM3_{Vg0rL]];/L:є`wW|YUuI8u˼F v(O&X,YcU, 69kB3!XL}j:!(GS;3^iU CE p%`ق'ū+,Sp"0D+bǞ`jq+))Ns 7)ЮN8z@:uG$QP0.HpT!E;%X23hu,t#2잸؋:D}}#uXȉj #";Cz"ʩ'|q+>m:Ιyp`OaʘLO?1` ~.-\^Qp"ea*']Q{fɲ֧Fh]eYC|xv4Sz_y]MG*;]$As8ԡʛ5EcT~/ؿF /v>=@wS;Wsʈ"Nn-D.n'(im6:;{SV@ ,掁BfޙN8`qe"6 ?+:Kc% zy"_A0bI(X{b|ƭQN`=_8SFi&g3<7+&B& <Fu`(>LtB0N'amUC7a-*̹wBf\gY Sk`QAY]v5VeOҺBam{zqc9G'7&iX &cxw`= v&K{6O $o<粇5|+##ӣ r }څ;K%g3`P᝵^{!fydUg7nl.@sA݈|+s#8\G0\Al'P?n,} Jo6Vc]]vĹ,K- -N'ёyoUn2~8o8E( q8Ct1[^M nn/]r#}>[H\uǧR}qnIؕD[KMvxKȘfL3:O8͘3Ƃ"aamӦ K쯛pY"5ތJ%zf=)mަ ]]۳%v0V2 3DLwB0ho֛t GzB7]l#Hppsop}#""^ds~'cN"7BoO̽ϔ`c1J)~pckG,88MtjA] )`Xl"_荿ƃnۈ^r=(H!s]xDkH0([4FEڕ`!ǠVw1X k&K툹.p6;8vCw}߀V #uǝI ({]SM tReu t\VOV.ҋ<, 6낃 ׶7ڙ[Jk#?fc,|FG(k<3MH,H_ _T~T2_YzqbX΃E02|6 X| lHl,h'Xr`*cr kG q<<-:xAqF#~~R~ WD ^ H=$X{fW hмySg`O0S,e}]+9̨In:[n|k.&^Tndp,R{9-d!6ߪj1# RRǥe@ b|-5/ A@1Ue/._9_Y;=ц03;EG>"{OvOK /ߒ8pn<fdI-_Ɓ>9X}v~]w9z%]e;T( ӃslP;4~=J$A@2LD#@/~P4-bx7L<U+ޮ=bj"T.3Y%tS֡+et&f%[E0|gWY| 1GFpsKppGd7qCǨO䞝YW0$~O &sS;CEE?ezk-ߜ&Gw#L`1'é)[DZ%̷mS;xE5j#b6P>^`ry9c ûpg7M*IJ]rC?/JՁ׾!ssp95*&`Wy'A?q8%u:"2&@#we++zNzFɜRMw!œN=kptHtH!L/ W .("h&:L/ь N.ڏbe.Qb1"{uC0 e0f n E O`'=,ӫC02xapudz|N)ZU1f_P5gjhɁTup)DdNYݦsN0\ENB!;ӬcR)f`[owS%x%n3x|v{ug xsKH"<]X pX}7F9/3iJn< x]f^݀BM`7^h"ПI)XyH]x6;@[A2 dU/ζ 8em+ÙM/f5={0 & :t8`&f0#DvA3<$8վJL`EyVU`,8>M]5^P=]%!A00|4z^)K;r8ћ2tL֝-D'ObKь}deXNO>]S.-Kv>EEV{!`) V9<^^=EQO0:/&8vN_Qv½,U9fqٲE[/|0g$̨\ nJRNknj &U~]7咦 +( QTvM.vx*#$K8zl4#c 9Mp)d$0[da-U;G π\"b䵿\[:$k:-L1ú>x}L3WʲJ( {w\ACȑA ΁5FXg"8O(LW`Wt ơC뚘>W'؞- MNI32%Xcd8*إs+ce]&5xPh 1󘱾`,Nk$L~AQHns@O܄u6ΙaدFgVVaJd[P>P`r!ˤ<ar.{e˜UD֌LbxcT'%ndT CcO}[ba@0דF/&"9`&`RLkz11z[!u{ĒK,93WTJJMAތH5~OIe$O:p8g &9jP>@pu[S =փe'8V.X`8H0 Ha`r; :)͡] f~-<g2Wӝ!XKpХ'pe#;f< ` "~(9pbOÊWUTfBMM1 (z$ln` ״$] u6Az6N}2"UA_/C EePךj{|G52 )Eh2. Ŷ2<=1z(0  nFԾT|Q;ihL0^I0~˜g\Vr {쟴3z;`RO] y7G&G^\YevTu5 vo? Tf6Ưg j:"3m1}>=x[>lYs3;uG^4P;m%0(n1Z>LcmqTӺuCGSvsYgY׻Í5{~Y  vvd#e oJa.wN0MzoE6C֗甅+I{ȓ`13brTDp$]+jbCѰaՐe +7 \b4d%^`:rSdrYEgk]JwD[ui8~~΀l]=2SK/ "oLN0|߹#(}RfmF7`4FHk*Ӡq&l%N)Y4H1?]etqMi"Pyk H0LAZ@瞲\+.+ T\}to`Y]vTBoX،Zu%߭SaUÍW/YoX[QIc4x4@Ap|r`F 7.(}PH,W?O}vcњw%&Y ^/`* \~ó]&2O|@nYIpۋ، F͛V"@42H0  2uC577u/Un*FRSӣccs{`xzB02 Ju:|p vn-1)r+¯ƍj ZSp{yV腫)Xˆ\Vk F)bSNVR}KJ;JX~?~ '1.S5)BY_ f9;qE7QEBf*@C98b_ܧ&rJgp`EM[^xDݒNYYژ ZyKG 0B5Qg;wdIN1L8XhލΜ 7}~荅'qw)sCV:sy, 7` Uμ1mV;L0(X=:h:W\T *glINPnFgd!M#X!1e#89A=_㷊^$H+\s$U*̛GGXo7{ E!ѯ XT4 28 "4>`H#/x#_h} `c9M`v' 5SߏuuH1wEjY1$SS 9ce#ЋB^U~{d$'~{S. jX|_llࠨeW DFʎ*eĦp# sɁɁ M g4=!X ƾb"X^KM0:#hF? ]9X|0n`!ok>8H0Fr="Xp9<721]?ʦ `PLx5-[R33e2[,ꏠ}P:v:T{QjZ/WT8fU%T:jz" +ǂ#EcӦqDFOJ(xU/ue$<xOgLo.o o츑vS]V)fެ7!pד>V 5KA0v]GC~> c#FR7lOIáC0t ;.CTaViҐ_ѻ@ Mkq&>yIZS9 V:; e7+= v*T1 1I0D,а' {P@'?wT5 bcG2ͅ%wͼڟ-,p]; U ᧩` Bdu`*xgvD'ڣz:r0*_)!*SY`ѹ+#)#X?O=\g /u"氦\t`=SUۑCP"eX4fϐJB'_]: œCa8)ƖF$dy53hM{6I&i>غ&eFlۄuIJ1n)f*0``=bS׊荿ߡ+!KĠ̇:#X^`O`{.ktS{YK5fM;OÂn{yvA];֥U+)Ǒ`+A*bȺ:f{=9 ^[uP#כLT駍_Y_k?n]"y?0h>LA7R髊 {(^W 7̯*1j'&4\G=wa* ;Lv0Pwg;ុyԸ/b[ &i;7rq'^M'7Eߣ 8[N c&)Jcz.r.h7Kʜ[Qd윱ks`{]<9{YFˡOI\zM8yr+4xsDW敊qC^ΈKϊݞސ`Я7slISwy}D6}y="9ž<]M~8IpeVSA;$rvj Qzw1nJ6A.X$ vzˉ:UK5 m`'^Amg.׎;D-wENLo0@}3+`= t˰1,5&b_Ep .xO2>gT}2li&Ne%OkG KaO|\"O)5-`Y :VG;nV4`_im^T$ }>^3M `{Dtn6$u?P?Pь4AC"ؼ\H찏UD#| wJ)JxSX]̾V' }aNډSUH(nf!8`7 Xޣ==r>:|!8LQ D6ȌC ug;CwAt/CDqDIO3 .,Ys﫫JB0\_ե+j P G[(s۩+hVFͣte >%UYw ifVs298*DX:ofF2V[[a "XM~LY6OvZ6'lFB4 ,!΀c*5moi1d*xʘgՉՉ4ex;+uWWv mh`YKG>[ryq-\W 6R1;!&Tgf}\ay;1n薸LG0rTCq`':YSs fjP#XB`v/d8՝W"|v'ˇZ8nO~ʝ>xRYnך{ͽL [D>>55ٽRef8nK7 *|w/W'X_(Z9㈎ 5ZCQmeU ϊ;ͣ3io0 D[R..|R`"=+D1s*rSGr4|H=/0oWH{|FM}F0~ X}Oے ~__¬~?g3˛ 3lRUにmi2f`H5^aYmvߴv$oeQq{d&:!i/7$ꐯ׻cF%;_I02|@pxr $XUIu``ؚ?j ;W zuukNy*/'/x[Fua";hJ#7G&eՀ _aޟ? c3saׁY6Q򁆁5c ¬GbϦ~#w%Ϊm.A>YSBlJ{0&w-aMy*ā0ޔmU:¬͂)`wo8!vj?a`p*]vB-O"ers'37U:AS4ڿ ̱Z#&B˝m>=;UTq8wwj 'l۞ኟ T Zԓ3 Ê薉8vQse-ɩ >9CvkLLY vt tGU$kO0`"S!8m.o=ߜ>%X:2=LAm[\a81;uuqHp`AG4DA+&E&nq!غGq3yԃsJRhz> Z5&AG?[iX?xU O{RI~g}mƃ2lU53K r8Y]ɹҚ߷,s~}CY) r7ψt-3̤,Kײev'ǿmƍل7X`OsLo!8w"L `g\DsYh󓴯< *w`EC3̶Fm_:LLU!ho!8_yVJ)>*\>C=n7$2;ߍ-"13p_LߪDJF 8Lr'@.?q += S)TC59rVE(J x8∊Itͯ@O?ڟuktr¹58+ɕ;gGŴMN_a纴$хw]z;D8!wzd[vv[L&}u ]0>rjq :lmNbSi"j/|;ni1mKe4;knjx(C0fs~<FT#x隠u%%%8]xUfQFF~m%A+_\Xww=AtJ0 FKpe/\4+8jZtZ;nD3].Bh4_VW%$Ǹ,X'jOnQˊy&& quAuS2 +A-h~GH!LAbxZ::IS'銟v`;S|$Z~qSg`aGME~)gu߰ Pwl_1L]%RRZJpPD0FC!)A0UV|5a>*j 3>.Drr I0c'؟.·~7sk+PH0~YEX5Q`xxWKLRA`fy0e3`D&X9C|Mlª3:\*Vb!Zӡ!V0 0}&xv6EŬMfY;E]Kw|55շoSSہIf#ŴlrV{4OƁ7.I{5W鼢^Vg?7$@ q̙$&]d֫^ 18 JB[ {0;|خDYV#Yj>_#677N[=m &[``W!wn*z'7naRӉ/Է+YSLSD'Bs.x9 dMpᛦe V//ضqßjs`[uY`ߋ`/{ IO0&c1?3vskycat-3.1.2-starlink-1b/rtd/install.sh000077500000000000000000000042121215713201500177320ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 skycat-3.1.2-starlink-1b/rtd/library/000077500000000000000000000000001215713201500173725ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/rtd/library/LabelValue2.tcl000066400000000000000000000035121215713201500221750ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: LabelValue2.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # LabelValue2.tcl - Widget displaying a label and two values # # who when what # -------------- --------- ---------------------------------------- # pbiereic 01/03/01 Created # This widget displays a label and two values. # Class 'LabelValue' already creates a label and an entry. # This class adds an additional entry widget packed after the LabelValue object itk::usual LabelValue2 {} itcl::class util::LabelValue2 { inherit util::LabelValue constructor {args} { eval itk_initialize $args } protected method init {} { $w_ config -disabledforeground black -state disabled pack $w_ -fill x -expand 0 # add an additional entry itk_component add entry2 { entry $w_.entry2 -justify right -textvariable {} } { keep -textvariable -relief -borderwidth -show rename -font -valuefont valueFont ValueFont rename -width -valuewidth valueWidth ValueWidth } $itk_component(entry) config -textvariable [cget -textvariable] -justify right config -value2 [cget -value2] pack $w_ $itk_component(entry2) \ -anchor w -expand 1 -fill x -padx 1m -ipadx 1m $itk_component(entry2) config -textvariable $itk_option(-textvariable2) } # -- options -- itk_option define -shelp shelp Shelp {} { add_short_help $w_ [cget -shelp] } itk_option define -textvariable2 textvariable2 Textvariable2 {} # set the value displayed in the second entry itk_option define -value2 value2 Value2 {} { if {[info exists itk_component(entry2)]} { $itk_component(entry2) config -state normal $itk_component(entry2) delete 0 end $itk_component(entry2) insert 0 $itk_option(-value2) $itk_component(entry2) config -state disabled } } } skycat-3.1.2-starlink-1b/rtd/library/Rtd.tcl000066400000000000000000000676511215713201500206460ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: Rtd.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # Rtd.tcl - real-time image display application class # See man page Rtd(n) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 11/10/95 created # 23/06/96 added real-time test (../test/tRtd), use -debug 1 option # P.Biereichel 30/06/97 attach to camera in method rapid_frame_command # Added itk_option(-with_warp) # Default itk_option(-disp_image_icon) set to 0 # A.Brighton 22/03/98 Added -float_panel option to allow info panel to be # in a popup window (default is off, no change), # added -panel_layout option to allow changing the # order of the zoom and pan windows in the layout # (default is the same as before, no change). # P.Biereichel 22/03/99 Added bias subtraction to real-time menu # P.Biereichel 04/08/99 Added itk_options -attach, -geometry # Added rtd_status and rtd_about # P.Biereichel 25/05/00 Added auto scale # P.Biereichel 20/04/04 Added $w_ to input_dialog in method set_camera itk::usual Rtd {} # This class defines the top level window for the rtd (real-time image # display) application. The window contains a menubar with rtd related # items, an RtdImageCtrl widget for displaying the image, and related # info and a short help window. # # The easiest way to use this class is via the "start" method (inherited # from TopLevelWidget). This creates an instance of this class and # passes any command line options as public variables to the class and # waits for window to be exited. Alternatively, you can create the # instance in the usual way for itcl classes and withdraw the main # window ".", if it is not being used. # # One global variable is assumed to have been defined: # # rtd_library - dir containing Rtd Tcl sources. itcl::class rtd::Rtd { inherit util::TopLevelWidget # constructor: create a toplevel window constructor {args} { eval itk_initialize $args } destructor { catch {kill $rapid_pid_} } # This method is called after the options have been evaluated. protected method init {} { global ::argv0 ::errorInfo ::rtd_version # set/get X defaults first time through - can be overridden in # subclass and/or in user's .Xdefaults file if {$itk_option(-number) == 1} { setXdefaults } wm protocol $w_ WM_DELETE_WINDOW "[code $this close]" feedback "initializing user interface..." if {"$itk_option(-number)" == "1"} { wm title $w_ "Rtd - Real-Time Display, version $rtd_version" } else { wm title $w_ "Rtd - Real-Time Display, version $rtd_version ($itk_option(-number))" } wm iconname $w_ Rtd # set rtd camera if not set on command line, default to environment var global ::env if {"$itk_option(-camera)" == ""} { if {[info exists env(RTD_CAMERA)]} { config -camera $env(RTD_CAMERA) } else { config -camera RTDSIMULATOR } } feedback "making image window..." # create the rtd image widget and exit on errors, such as no more # colors, no more memory... if {[catch {make_rtdimage} msg]} { puts $errorInfo exit 1 } # display the image also as an icon ? if {$itk_option(-disp_image_icon)} { feedback "icon..." # optional RtdImage image icon itk_component add icon { rtd::RtdImageIcon $w_.icon \ -image $itk_component(image) \ -usexshm $itk_option(-usexshm) \ -usexsync $itk_option(-usexsync) \ -verbose $itk_option(-verbose) \ -subsample $itk_option(-subsample) \ -center 0 } wm iconwindow $w_ $w_.icon } feedback "menubar..." # add the menubar and short help add_menubar pack $itk_component(image) -fill both -expand 1 make_short_help # make a message if we are using a private colormap if {[$image_ cmap isprivate]} { set prog [file rootname [file tail $argv0]] catch { puts "\n$prog: unable to allocate enough colors for image display \ in the default colormap - using a private colormap. If this \ causes any problems with color flashing, try exiting other \ color intensive applications (such as netscape) first\n" } } if {$attach_} { after idle [code $this attach_camera] } else { after idle "$itk_component(image) updateCameraStatus $itk_option(-camera)" } } # this method can be redefined in a subclass to get feedback during # startup public method feedback {msg} { } # set default X resources for colors and fonts, and set some default key # bindings. This is done in a method so that it can be overridden by a subclass. # These are built-in defaults that the user can also override in the ~/.Xdefaults # file. public method setXdefaults {} { rtd::setXdefaults } # create the rtd image widget protected method make_rtdimage {} { set image_ $w_.image # RtdImageCtrl(n) widget containing image and control panel. itk_component add image { rtd::RtdImageCtrl $image_ \ -file $itk_option(-file) \ -usexshm $itk_option(-usexshm) \ -usexsync $itk_option(-usexsync) \ -verbose $itk_option(-verbose) \ -shm_header $itk_option(-shm_header) \ -shm_data $itk_option(-shm_data) \ -min_colors $itk_option(-min_colors) \ -max_colors $itk_option(-max_colors) \ -drag_scroll $itk_option(-drag_scroll) \ -scrollbars $itk_option(-scrollbars) \ -subsample $itk_option(-subsample) \ -sampmethod $itk_option(-sampmethod) \ -use_zoom_view $itk_option(-use_zoom_view) \ -zoom_view_propagate $itk_option(-zoom_view_propagate) \ -with_zoom_window $itk_option(-with_zoom_window) \ -dozoom $itk_option(-dozoom) \ -with_pan_window $itk_option(-with_pan_window) \ -zoom_factor $itk_option(-zoom_factor) \ -zoom_width $itk_option(-zoom_width) \ -zoom_height $itk_option(-zoom_height) \ -pan_width $itk_option(-pan_width) \ -pan_height $itk_option(-pan_height) \ -colorramp_height $itk_option(-colorramp_height) \ -color_scale $itk_option(-color_scale) \ -default_cmap $itk_option(-default_cmap) \ -default_itt $itk_option(-default_itt) \ -with_colorramp $itk_option(-with_colorramp) \ -rapid_frame_command [code $this rapid_frame_command] \ -feedback [code $this feedback] \ -port $itk_option(-port) \ -shorthelpwin $this \ -debug [expr {$itk_option(-debug) != 0}] \ -camera $itk_option(-camera) \ -float_panel $itk_option(-float_panel) \ -panel_layout $itk_option(-panel_layout) \ -panel_orient $itk_option(-panel_orient) \ -with_grid $itk_option(-with_grid) \ -with_warp $itk_option(-with_warp) \ -min_scale $itk_option(-min_scale) \ -max_scale $itk_option(-max_scale) \ -pickobjectorient $itk_option(-pickobjectorient) \ -updatePick $itk_option(-updatePick) \ -xscale $itk_option(-xscale) \ -yscale $itk_option(-yscale) \ -image_directory $itk_option(-image_directory) } # If this is a cloned widget, use a different image name if {[cget -number] > 1} { $itk_component(image) config -name \ "[$itk_component(image) cget -name][cget -number]" } } # add the menubar at the top of the window protected method add_menubar {} { # menu bar TopLevelWidget::add_menubar # add menubuttons and menus add_file_menu add_view_menu add_graphics_menu add_realtime_menu add_help_menu } # add the File menubutton and menu protected method add_file_menu {} { set m [add_menubutton File] add_short_help $itk_component(menubar).file \ {File menu: load, save, print, clear image, new window, exit application} add_menuitem $m command "Open..." \ {Open and display an image file} \ -command [code $this busy "$image_ open"] \ -accelerator "Control-o" add_menuitem $m command "Reopen" \ {Reload the image display after the image has changed on disk} \ -command [code $image_ reopen] \ -accelerator "Control-v" add_menuitem $m command "Save as..." \ {Save the current image to a file} \ -command [code $image_ save_as] \ -accelerator "Control-s" add_menuitem $m command "Save region as..." \ {Save a section of the current image to a file} \ -command [code $image_ save_region_as] \ -accelerator "Control-S" add_menuitem $m command "Print..." \ {Print the current image to a file or printer} \ -command [code $image_ print] \ -accelerator "Control-P" add_menuitem $m command Clear \ {Clear the image display} \ -command [code $this clear] $m add separator add_menuitem $m command "Bias Image..." \ {Control subtraction of a bias image} \ -command [code $image_ set_bias] \ -accelerator "Control-b" $m add separator add_menuitem $m command "New Window" \ {Display up a new main window} \ -command [code $this clone] \ -accelerator "Control-n" add_menuitem $m command "Close" \ {Close the main window and exit if there are no more windows} \ -command [code $this close] $m add separator add_menuitem $m command Exit \ {Exit the application} \ -command [code $this quit] \ -accelerator "Control-q" } # add the VIew menubutton and menu protected method add_view_menu {} { set m [add_menubutton View] add_short_help $itk_component(menubar).view \ {View menu: manipulate colors, cut levels, pixel info} add_menuitem $m command "Colors..." \ {Display a window for manipulating the image colormap} \ -command [code $image_ set_colors] \ -accelerator "Control-c" add_menuitem $m command "Cut Levels..." \ {Display a window for manipulating the image cut levels} \ -command [code $image_ component info cut_level_dialog] \ -accelerator "Control-l" add_menuitem $m command "Cuts..." \ {Display a graph of pixel values along a line drawn interactively over the image} \ -command [code $image_ spectrum] \ -accelerator "Control-u" add_menuitem $m command "Pick Object..." \ {Select an object or star in the image and display statistics} \ -command [code $image_ pick_dialog] \ -accelerator "Control-p" add_menuitem $m command "Fits header..." \ {Display the FITS header for the current image} \ -command [code $image_ view_fits_hdu_header] \ -accelerator "Control-f" # XXX note: the WCS Info impl. still needs work to display the # correct values (setting values is OK) # pbiereic: Let's wait for an SPR add_menuitem $m command "WCS Info..." \ {Set/Display World Coordinate information for the current image} \ -command [code $image_ wcs_info_dialog] add_menuitem $m cascade "Pixel Table..." \ {Display a table of pixel values surrounding the mouse cursor} \ -menu [menu $m.pix] $m.pix add command -label "3x3" -command [code $image_ pixel_table 3 3] $m.pix add command -label "5x5" -command [code $image_ pixel_table 5 5] $m.pix add command -label "7x7" -command [code $image_ pixel_table 7 7] $m.pix add command -label "9x9" -command [code $image_ pixel_table 9 9] add_menuitem $m cascade "Magnification" \ {Set the magnification factor of the image display} \ -menu [menu $m.mag] after idle [code $itk_component(image) component info component trans fill_mag_menu $m.mag] $m add separator if { ! $itk_option(-float_panel) } { add_menuitem $m checkbutton "Hide Control Panel" \ {Toggle the visibility of the upper control panel} \ -variable $w_.hide_control_panel -onvalue 1 -offvalue 0 \ -command [code $image_ hide_control_panel $w_.hide_control_panel] } add_menuitem $m checkbutton "Hide Popup Windows" \ {Toggle the visibility of the popup windows} \ -variable $w_.hide_windows -onvalue 1 -offvalue 0 \ -command [code $this hide_windows $w_.hide_windows] if {0} { add_menuitem $m checkbutton "Show Grid" \ {Toggle the visibility of the image ra,dec grid} \ -variable $w_.image.grid -onvalue 1 -offvalue 0 \ -command [code $image_ show_grid $w_.image.grid] } $m add separator add_menuitem $m checkbutton "Auto scale" \ {Scale the image to the max. visible size} \ -variable $w_.autoscale -onvalue 1 -offvalue 0 \ -command [code $image_ autoscale $w_.autoscale] $m add separator add_menuitem $m command "Select FITS HDU..." \ {Display the available FITS HDUs (header/data units) and select the current HDU} \ -command [code $image_ display_fits_hdus] } # add the Graphics menubutton and menu protected method add_graphics_menu {} { set m [add_menubutton Graphics] add_short_help $itk_component(menubar).graphics \ {Graphics menu: display graphics window or set graphics options} add_menuitem $m command "Toolbox..." \ {Display the graphics toolbox for drawing on the image} \ -command [code $image_ show_toolbox] \ -accelerator "Control-t" $m add separator [$image_ component draw] add_menuitems $m $m add separator add_menuitem $m checkbutton "Hide Graphics" \ {Toggle the visibility of the image line graphics} \ -variable $w_.hide_graphics -onvalue 1 -offvalue 0 \ -command [code $image_ hide_graphics $w_.hide_graphics] } # add the Real-time menubutton and menu protected method add_realtime_menu {} { set m [add_menubutton "Real-time"] add_short_help $itk_component(menubar).real-time \ {Real-time menu: real-time display commands. rapid frame} add_menuitem $m command "Attach Camera" \ {Attach the real-time camera - start receiving images} \ -command [code $this attach_camera] \ -accelerator "Control-a" add_menuitem $m command "Detach Camera" \ {Detach the real-time camera - stop receiving images} \ -command [code $this detach_camera] \ -accelerator "Control-d" add_menuitem $m command "Set Camera..." \ {Set the real-time camera name} \ -command [code $this set_camera] $m add separator add_menuitem $m cascade "Rapid Frame" \ {Create a rapid frame by interactively drawing a rectangle on the image} \ -menu [menu $m.rapid] $m.rapid add command -label "In Canvas" \ -command [code $image_ rapid_frame 0] $m.rapid add command -label "In Separate Window" \ -command [code $image_ rapid_frame 1] $m.rapid add command -label "Delete Rapid Frame" \ -command [code $image_ delete_rapid_frame] $m add separator global ::$w_.preview_mode set $w_.preview_mode 0 add_menuitem $m checkbutton "Preview Mode" \ {Preview mode: copy the real-time image from shared memory to local memory} \ -variable $w_.preview_mode -onvalue 1 -offvalue 0 \ -command [code $image_ preview $w_.preview_mode] $m add separator add_menuitem $m command "Record/Playback Images..." \ {Record and playback real time images} \ -command [code $this record] if {$itk_option(-with_perftest)} { $m add separator add_menuitem $m command "Performance..." \ {Performance test: enable interactive performance test parameters} \ -command [code $image_ perftest] } } # add a menubutton with help items protected method add_help_menu {} { set m [add_menubutton "Help" {} right] add_menuitem $m command "Status..." \ {Display a window with status information} \ -command [code $this rtd_status] add_menuitem $m command "About Rtd..." \ {Display a window with information about this Rtd version} \ -command [code $this rtd_about] add_short_help $itk_component(menubar).help \ {Help menu: display information about this application} } # make a new main window public method clone {} { global ::rtd_usage # use the -noop option to avoid reloading the main image (part of $argv list) after 0 [code util::TopLevelWidget::start Rtd "-noop" "$rtd_usage"] } # close the application public method close {} { delete object $this } # quit the application public method quit {} { delete object $this after idle exit } # attach the current camera public method attach_camera {} { # debug: for testing if {$itk_option(-debug) == 1} { utilReUseWidget rtd::tRtd $w_.tRtd \ -camera $itk_option(-camera) \ -rtdimage $image_ \ -testprog [cget -testprog] \ -interval $itk_option(-interval) } $image_ attach_camera $itk_option(-camera) $itk_component(image) updateCameraStatus $itk_option(-camera) } # detach the current camera public method detach_camera {} { if {$itk_option(-debug) && [winfo exists $w_.tRtd]} { $w_.tRtd close } else { $image_ detach_camera } $itk_component(image) updateCameraStatus $itk_option(-camera) } # popup a window to query for new camera public method set_camera {} { set sts [[$image_ get_image] camera attach] if {$sts} { set s "\"$itk_option(-camera)\" is attached" } else { set s "\"$itk_option(-camera)\" is detached" } set cam [input_dialog "The current camera is: \"$itk_option(-camera)\"\n$s\n\ Please enter a new camera name:" $w_] if { $cam != "" } { configure -camera $cam if {$sts} { attach_camera } } } # Methods for the playing and recording of images. public method record {} { $image_ record $itk_option(-camera) } # add the short help window and add some help texts for the menu buttons protected method make_short_help {} { TopLevelWidget::make_short_help } # Called for "Clear" menu item. Clear the image and delete all graphics public method clear {} { $image_ clear # delete any remaining graphics set canvas [$image_ get_canvas] foreach tag [$canvas find all] { if {"[$canvas type $tag]" != "image"} { $canvas delete $tag } } } # This method is called when the user creates, moves, resizes # or deletes a rapid frame. # # The args are: # # frameId = unique rapid frame id for use with rtdServer # # name = unique name for the frame # # op = {move,resize or delete}, # # x, y = coords of upper left corner of frame in image # # w, h = dimensions of frame. protected method rapid_frame_command {frameId name op x y w h} { if {! $itk_option(-debug)} { return } catch {kill $rapid_pid_} if {"$op" == "delete"} { return } set im [$image_ get_image] $im convert dist $x $y canvas ix iy image $im convert dist $w $h canvas iw ih image if {[catch {set rapid_pid_ [exec $itk_option(-testprog) \ -v $itk_option(-verbose) \ -t $itk_option(-interval) \ -x $ix -y $iy -w $iw -h $ih -f $frameId &]} msg]} { error_dialog "error starting $itk_option(-testprog): $msg" } else { $image_ attach_camera $itk_option(-camera) } } # display a popup window with status information public method rtd_status {} { set t1 "Rtd [package versions Rtd], Status" set s1 "Object:\t\t[[$image_ get_image] object]" set s2 "Camera name:\t[cget -camera]" if {[[$image_ get_image] camera attach]} { set s3 "Camera:\t\tattached" } else { set s3 "Camera:\t\tdetached" } DialogWidget $w_.rtd_status \ -messagewidth 6i \ -justify left \ -text "$t1\n\n$s1\n$s2\n$s3" \ -title "Status" $w_.rtd_status activate } # display a popup window with information about Rtd public method rtd_about {} { global tcl_pkgPath rtd_library tclutil_library astrotcl_library set rtdLoaded {} foreach d [info loaded] { if {[lsearch $d Rtd] != -1} { set rtdLoaded [lindex $d 0] break } } set t1 "Rtd version:\t[package versions Rtd]" set t2 "Rtd shared library:\t[abs_path $rtdLoaded]" set t3 "Rtd library path:\t[abs_path $rtd_library]" set t4 "Tclutil lib path:\t[abs_path $tclutil_library]" set t5 "Astrotcl lib path:\t[abs_path $astrotcl_library]" set t6 "Tcl version:\t[info patchlevel]" set t7 "Tcl package path:\t$tcl_pkgPath" set t8 "Package versions:\t" foreach el "Tclx Itcl Itk Tkx BLT" { set t8 "$t8$el[package versions $el] " } DialogWidget $w_.rtd_about \ -messagewidth 12i \ -justify left \ -text "$t1\n$t2\n$t3\n$t4\n$t5\n$t6\n$t7\n$t8" \ -title "About" $w_.rtd_about activate } # return absolute pathname protected method abs_path { path } { set dir [file dirname $path] set tail [file tail $path] set cwd [pwd] set err [catch {set adir [cd $dir ; pwd]}] cd $cwd if { $err } { return $path } return [file join $adir $tail] } # -- public variables (also program options) -- # image file to display itk_option define -file file File {} # Float the control panel (better real estate control on small displays). itk_option define -float_panel float_panel Float_panel 0 # flag: if true, try to use X shared memory for images itk_option define -usexshm useXshm UseXshm {1} #flag: if true, try to use X synchronisation itk_option define -usexsync useXsync UseXsync {1} # This flag controls whether the FITS image header is kept in # sysV shared memory (see the rtdRemote interface for use of this) itk_option define -shm_header shm_header Shm_header 0 # This flag controls whether the FITS image data is kept in # sysV shared memory (see the rtdRemote interface for use of this) itk_option define -shm_data shm_data Shm_data 0 # specify the min number of colors to allocate before using # a private colormap (not impl.) itk_option define -min_colors min_colors Min_colors 30 # specify the max number of colors to allocate before using # a private colormap (not impl.) itk_option define -max_colors max_colors Max_colors 60 # flag: if true, print diagnostic messages itk_option define -verbose verbose Verbose {0} # flag: if true, use faster subsampling algorithm when shrinking images, # otherwise use a pixel algorithm defined by option -sampmethod itk_option define -subsample subsample Subsample {1} { if {[info exists itk_component(image)]} { $itk_component(image) config -subsample $itk_option(-subsample) } } # sampling method to used when option -subsample is 0 itk_option define -sampmethod sampmethod Sampmethod {0} { if {[info exists itk_component(image)]} { $itk_component(image) config -sampmethod $itk_option(-sampmethod) } } # default (midas) colormap itk_option define -default_cmap default_cmap Default_cmap {real} # default (midas) intensity transfer table itk_option define -default_itt default_itt Default_itt {ramp} # camera name: default: $env(RTD_CAMERA), if set, otherwise RTDSIMULATOR itk_option define -camera camera Camera {} { if {[info exists itk_component(image)]} { $itk_component(image) updateCameraStatus $itk_option(-camera) } } # Panel layout order: set to one of {saoimage reverse default} # to change the layout ordering of the panel windows. # "saoimage" puts the info first, followed by pan and zoom, # "reverse" reverses the default order, which is {zoom info pan}. itk_option define -panel_layout panel_layout Panel_layout {} # Panel orient: one of {horizontal vertical} (default: horizontal) itk_option define -panel_orient panel_orient Panel_orient {} # zooming factor itk_option define -zoom_factor zoom_factor Zoom_factor 4 # Width of zoom window itk_option define -zoom_width zoom_width Zoom_width 152 # Height of zoom window itk_option define -zoom_height zoom_height Zoom_height 152 # height of the colorramp subwindow itk_option define -colorramp_height colorramp_height Colorramp_height 12 # width of panning window itk_option define -pan_width pan_width Pan_width 152 # height of panning window itk_option define -pan_height pan_height Pan_height 152 # flag: if true (default), show the color ramp window itk_option define -with_colorramp with_colorramp With_colorramp 1 # flag: if true, use a "view" of the main image for the zoom window # otherwise zoom directly from the X display. # The advantage of the first approach (-use_zoom_view 1) is that the zoom # is accurate even when the main image is shrunken. # The second (-use_zoom_view 0) is faster and allows more accurate positioning. itk_option define -use_zoom_view use_zoom_view Use_zoom_view 1 # flag: if true, changes in main image scale will propagate to the zoom window, # otherwise controls are displayed so the user can manually change it (ZoomView only) itk_option define -zoom_view_propagate zoom_view_propagate Zoom_view_propagate 1 # flag: if true (default) make a zoom window itk_option define -with_zoom_window with_zoom_window With_zoom_window 1 # flag: if true (default) make a panning window itk_option define -with_pan_window with_pan_window With_pan_window 1 # flag: if true, turn on zoom window itk_option define -dozoom dozoom Dozoom 1 # flag: if true, display a copy (view) of the image as an icon itk_option define -disp_image_icon disp_image_icon Disp_image_icon 0 # flag: if true, set bindings to scroll with the middle mouse button itk_option define -drag_scroll drag_scroll Drag_scroll 1 # flag: if true, display scrollbars to scroll the image itk_option define -scrollbars scrollbars Scrollbars 0 # default port for remote connections (0 means system chooses a port) itk_option define -port port Port 0 # debugging flag: enables real-time simulation with $testProg (below) itk_option define -debug debug Debug 0 { global ::env if {$itk_option(-debug) == 1} { set cam rtdtest if {[cget -number] > 1} { set cam "$cam[cget -number]" } set env(RTD_CAMERA) $cam configure -camera $cam } } # for testing: name of test program used to generate real-time updates itk_option define -testprog testProg TestProg "tRtd" # for testing: interval between updates in ms itk_option define -interval interval Interval 500 # with performance tester utility in menu bar itk_option define -with_perftest with_perftest With_perftest 1 # option to warp the mouse pointer itk_option define -with_warp with_warp With_warp 1 # option to include grid button (default to off, since it doesn't work # well yet on some images) itk_option define -with_grid with_grid With_grid 0 # minimum allowed scale value itk_option define -min_scale min_scale Min_scale -10 # maximum allowed scale value itk_option define -max_scale max_scale Max_scale 20 # Set the default color scale algorithm to one of: {linear log sqrt histeq} itk_option define -color_scale color_scale Color_scale linear # dummy option, used when cloning the main window, in place of "-file" itk_option define -noop noOp NoOp {} # -orient option for Pick Object window itk_option define -pickobjectorient pickObjectOrient PickObjectOrient {vertical} # option to update RtdImagePick after a real-time image event itk_option define -updatePick updatePick UpdatePick {1} # default scaling factor itk_option define -xscale xscale Xscale 1 itk_option define -yscale yscale Yscale 1 # attach to camera itk_option define -attach attach Attach {0} { set attach_ [cget -attach] } # Rtd's window geometry itk_option define -rtd_geometry rtd_geometry Rtd_geometry {} { if {"$itk_option(-rtd_geometry)" != ""} { after idle [code "wm geometry $w_ $itk_option(-rtd_geometry)"] } } # Rtd's window title itk_option define -rtd_title rtd_title Rtd_title {} { if {"$itk_option(-rtd_title)" != ""} { after idle [code "wm title $w_ {$itk_option(-rtd_title)}"] } } # Default directory for loading images itk_option define -image_directory image_directory Image_directory {} # -- protected variables -- # name of main image (class RtdImageCtrl or a derived class) protected variable image_ # pid of test prog used to generate rapid frames (debug) protected variable rapid_pid_ # attach to camera after widget was initialized protected variable attach_ 0 } skycat-3.1.2-starlink-1b/rtd/library/RtdImage.tcl000066400000000000000000001123731215713201500216010ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: RtdImage.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImage.tcl - itcl widget wrapper for the rtdimage type extension # # This widget is based on the Tk rtdimage extension, which is implemented # in C++. It simplifies things by creating its own frame, canvas and # scrollbars. # # See man page RtdImage(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01/06/98 Created # P.Biereichel 05/08/96 Added itk_option(-with_warp) # Allan Brighton 22/03/98 Added focus_ method to fix focus problems # and conflicts between menu traversal and # mouse cursor warp code (from Peter Draper, # Starlink). # pbiereic 11/10/99 Added 'wm colormapwindows' if private colormaps are used # pbiereic 04/11/03 Workaround bug in tcl 8.4.3 (SourceForge Request ID 835020) # Peter W. Draper 21/07/12 Make cmap_dir a PATH-like list. itk::usual RtdImage {} # The RtdImage widget is an [incr Tk] interface to the rtdimage extended # Tk image type. The widget creates a canvas window with optional # scrollbars and a canvas image item to hold the image. An optional # canvas line graphics editor is also created by default, to manage # drawing on the image. The RtdImage widget can be treated pretty much # like any standard Tk widget and can be inserted in a Tk frame with the # pack(n) command. Applications using the RtdImage widget, can access # the underlying image object and the canvas window to overlay graphics # on the image. # # In addition to the methods below, this class also forwards methods # implemented in the C++ rtdimage code. It is, however, usually more # efficient to use the "get_image" method to get a handle for the # internal rtdimage object and use it directly. itcl::class rtd::RtdImage { inherit util::FrameWidget # create a new RtdImage widget constructor {args} { global ::rtd_library # frame to hold image and scrollbars itk_component add imagef { frame $w_.imagef -background black } { keep -borderwidth -relief } pack $itk_component(imagef) -fill both -expand 1 # vertical scrollbar frame itk_component add vscrollf { frame $itk_component(imagef).vscrollf -background black } pack $itk_component(vscrollf) -side right -fill y # horizontal scrollbar frame itk_component add hscrollf { frame $itk_component(imagef).hscrollf -background black } pack $itk_component(hscrollf) -side bottom -fill x # canvas # note: create canvas in global namespace, to avoid problems in C++ side set cmd \ [list canvas $itk_component(imagef).canvas \ -xscrollincr 1 \ -yscrollincr 1 \ -background black \ -insertofftime 0] # Tk canvas containing the image itk_component add canvas { set canvas_ [uplevel "#0" $cmd] } { rename -relief -canvasrelief canvasRelief CanvasRelief rename -borderwidth -canvasborderwidth canvasBorderwidth CanvasBorderwidth rename -background -canvasbackground canvasBackground CanvasBackground rename -width -canvaswidth canvasWidth CanvasWidth rename -height -canvasheight canvasHeight CanvasHeight } pack $canvas_ -fill both -expand 1 # create the image # note: create (for now) in global namespace to avoid problems in C++ interface set cmd [list image create rtdimage] set image_ [uplevel "#0" $cmd] # put the image in the canvas set imageId_ [$canvas_ create image 0 0 \ -image $image_ \ -anchor nw \ -tags $image_] bind $canvas_ [code $this maybe_center] if {[$image_ cmap isprivate]} { # set the WM_COLORMAP_WINDOWS property wm colormapwindows [winfo toplevel $w_] $canvas_ } eval itk_initialize $args } # destructor - clean up when deleted destructor { catch {$itk_component(draw) deselect_objects} catch {$canvas_ delete $image_} catch {image delete $image_} } # this method is called from the base class (TopLevelWidget or FrameWidget) # after all the options have been evaluated protected method init {} { if {$itk_option(-with_warp)} { # make arrow keys move mouse pointer by one pixel bind $canvas_ "+$image_ warp -1 0" bind $canvas_ "+$image_ warp 1 0" bind $canvas_ "+$image_ warp 0 -1" bind $canvas_ "+$image_ warp 0 1" global ::$w_.focus set $w_.focus {} bind $canvas_ "+[code $this focus_ in]" bind $canvas_ "+[code $this focus_ out]" } # create a blank image and set default scaling factors if {[$image_ isclear]} { $image_ clear } $image_ scale $xscale_ $yscale_ $image_ config -newimagecmd [code $this new_image_cmd] } # Control the focussing of the canvas. Only take focus if the # top-level window associated with this canvas has the focus # (i.e. it's not in another toplevel somewhere). If this isn't # done then mysterious raises of the main image window can occur # with some window managers (mainly CDE, with click-to-focus). # # allan: 19.6.98: disabled the above behavior, since it causes # problems with mouse warping and confuses people. Can't verify # the CDE behavior... protected method focus_ {way} { global ::$w_.focus set top [winfo toplevel $w_] set focus [focus -displayof $top] if { $focus != {} } { #if {[winfo toplevel $focus] == "$top" } { # This toplevel has the focus (or at least a child of it # has), so it's ok to proceed. if { $way == "in" } { set $w_.focus [focus -displayof .] catch {focus $canvas_} } else { catch {focus [set $w_.focus]} } #} } } # utility to update an option in the image # Note: this works automatically with "widgets", but itk doesn't work # with "images"... protected method imageconfig_ {option} { $image_ config $option $itk_option($option) } # return the name of the underlying rtdimage object public method get_image {} { return $image_ } # return the name of the underlying canvas widget public method get_canvas {} { return $canvas_ } # return the canvas Id for the image public method get_imageId {} { return $imageId_ } # return name of global variable which contains the statistics # of the pick window. This allows applications to trace on this variable. public method get_pickVar {} { if {[winfo exists $w_.pick]} { return [$w_.pick get_pickVar] } return "" } # update the allowed interactive drawing area in the canvas protected method set_drawing_area {} { if {[info exists itk_component(draw)] && ! [$image_ isclear]} { $image_ convert coords 1 1 image x0 y0 canvas $image_ convert coords \ [expr {[$image_ width]-1}] \ [expr {[$image_ height]-1}] \ image x1 y1 canvas set cx0 [expr {int([min $x0 $x1])}] set cy0 [expr {int([min $y0 $y1])}] set cx1 [expr {int([max $x0 $x1])}] set cy1 [expr {int([max $y0 $y1])}] $itk_component(draw) configure -bbox "$cx0 $cy0 $cx1 $cy1" } } # make the graphics toolbox and menu protected method make_toolbox {} { # CanvasDraw(n) object, used to manage the canvas graphics itk_component add draw { util::CanvasDraw $w_.draw \ -canvas $canvas_ \ -transient 1 \ -withdraw 1 \ -center 0 \ -shorthelpwin $itk_option(-shorthelpwin) \ -withtoolbox $itk_option(-withtoolbox) \ -defaultcursor $itk_option(-cursor) \ -show_object_menu $itk_option(-show_object_menu) \ -regioncommand $itk_option(-regioncommand) } set_drawing_area # clicking on the image or image background deselects other objects $canvas_ bind $image_ <1> [code $itk_component(draw) deselect_objects] } # display the toolbox window public method show_toolbox {} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } if {! [info exists itk_component(draw)]} { # user must have deleted window... make_toolbox } else { # $itk_component(draw) center_window wm deiconify $itk_component(draw) wm transient $itk_component(draw) $w_ } } # resize the image and the canvas graphics by the given integer factors # (1 is no scale, -2 = 50%, 2 = 200% etc...) # - deselect canvas graphics (so handles don't get scaled) public method scale {x y} { # don't resize selection grips if {$itk_option(-graphics)} { $itk_component(draw) deselect_objects } save_scroll_pos_ set xscale_ $x set yscale_ $y # note previous scale and position lassign [$image_ scale] xs ys if {"$xs" == ""} { set xs [set ys 1] } else { # scale the image if {[catch {$image_ scale $x $y} msg]} { error_dialog $msg $w_ return } # if we passed the max scale factor, it will be ignored if {"[$image_ scale]" == "$xs $ys"} { return } } # scale the canvas items (need relative floating point factor) if {$xs < 0} { set xs [expr {-1.0/$xs}] set ys [expr {-1.0/$ys}] } if {$x < 0} { set x [expr {-1.0/$x}] set y [expr {-1.0/$y}] } # carefull in case scale factor is zero set fx [expr {double($x)/$xs}] set fy [expr {double($y)/$ys}] $canvas_ scale all 0 0 $fx $fy # set new scrollregion to include all of image set w [$image_ dispwidth] set h [$image_ dispheight] set_scrollregion 0 0 $w $h # notify rapid frame to change size if necessary if {[winfo exists $w_.rapid]} { $w_.rapid notify_cmd scale } restore_scroll_pos_ maybe_center # update interactive drawing area set_drawing_area # update pick window, if needed if {[winfo exists $w_.pick]} { $w_.pick update_scale $fx $fy } } # save the current scrolling positions protected method save_scroll_pos_ {} { lassign [$canvas_ xview] xScroll0_ xScroll1_ lassign [$canvas_ yview] yScroll0_ yScroll1_ # XXX needed for bug in tcl 8.4.3 set bug "$xScroll0_ $xScroll1_ $yScroll0_ $yScroll1_" } # restore the relative scrolling positions protected method restore_scroll_pos_ {} { $canvas_ xview moveto $xScroll0_ $canvas_ yview moveto $yScroll0_ lassign [$canvas_ xview] x0 x1 lassign [$canvas_ yview] y0 y1 $canvas_ xview moveto [expr {$x0-($x1-$xScroll1_)/2.0}] $canvas_ yview moveto [expr {$y0-($y1-$yScroll1_)/2.0}] } # toggle rotation of the image and canvas items public method rotate {bool} { if {$bool != [$image_ rotate]} { $image_ rotate $bool if {[info exists itk_component(draw)]} { $itk_component(draw) rotate all } if {[$image_ dispwidth] != [$image_ dispheight]} { center } # notify rapid frame to move if necessary if {[winfo exists $w_.rapid]} { $w_.rapid notify_cmd rotate $bool } # update interactive drawing area set_drawing_area } } # flip or unflip the image and canvas items about the # x or y axis, as given by $xy public method flip {xy bool} { if {$bool != [$image_ flip $xy]} { set coords [$canvas_ coords $image_] $image_ flip $xy $bool if {[info exists itk_component(draw)]} { if {"$xy" == "x"} { $itk_component(draw) flipx all [expr {[$image_ dispwidth]-1}] } else { $itk_component(draw) flipy all [expr {[$image_ dispheight]-1}] } } eval "$canvas_ coords $image_ $coords" # notify rapid frame to move if necessary if {[winfo exists $w_.rapid]} { $w_.rapid notify_cmd flip $xy $bool } # update interactive drawing area set_drawing_area } } # if the image is smaller than the canvas window, center it public method maybe_center {} { set cw [winfo width $canvas_] set ch [winfo height $canvas_] set dw [$image_ dispwidth] set dh [$image_ dispheight] if {$cw != 1} { if {$dw < $cw && $dw} { set x [expr {(($dw-$cw)/2.0)/$dw}] $canvas_ xview moveto $x } if {$dh < $ch && $dh} { set y [expr {(($dh-$ch)/2.0)/$dh}] $canvas_ yview moveto $y } } else { update maybe_center return } set_scrollregion 0 0 $dw $dh } # set the canvas scrollregion protected method set_scrollregion {x0 y0 x1 y1} { $canvas_ config -scrollregion "$x0 $y0 $x1 $y1" } # center the image in the canvas window public method center {} { set dw [$image_ dispwidth] set dh [$image_ dispheight] set_scrollregion 0 0 $dw $dh set cw [winfo width $canvas_] set ch [winfo height $canvas_] if {$cw != 1 && $dw && $dh} { $canvas_ xview moveto [expr {(($dw-$cw)/2.0)/$dw}] $canvas_ yview moveto [expr {(($dh-$ch)/2.0)/$dh}] } } # arrange to interactively create a rapid frame to display # a section of the image. # If popup is 1, the frame is displayed in a popup window, # otherwise at the selected position in the canvas public method rapid_frame {popup} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } if {[winfo exists $w_.rapid]} { destroy $w_.rapid } if {[action_dialog \ "Please select and drag out a region of the image with mouse button 1" \ $w_]} { $itk_component(draw) set_drawing_mode region [code $this make_rapid_frame $popup] } } # delete the rapid frame public method delete_rapid_frame {} { if {[winfo exists $w_.rapid]} { destroy $w_.rapid } } # Create a rapid frame to display a section of the image. # If popup is 1, the frame is displayed in a popup window, # otherwise at the selected position in the canvas # "region_id" is the canvas id of the object used to position # and resize the image. protected method make_rapid_frame {popup region_id x0 y0 x1 y1} { set xoffset [expr {int($x0)}] set yoffset [expr {int($y0)}] set width [expr {int($x1-$x0+1)}] set height [expr {int($y1-$y0+1)}] if {$popup} { rtd::RtdImagePopup $w_.rapid \ -target_image $this \ -xoffset $xoffset \ -yoffset $yoffset \ -width $width \ -height $height \ -zoomwin $itk_option(-zoomwin) \ -subsample $itk_option(-subsample) \ -usexshm $itk_option(-usexshm) \ -usexsync $itk_option(-usexsync) \ -withdraw [expr {!$popup}] \ -region_id $region_id \ -verbose $itk_option(-verbose) \ -shorthelpwin $itk_option(-shorthelpwin) \ -transient 1 \ -min_scale $itk_option(-min_scale) \ -max_scale $itk_option(-max_scale) \ -command $itk_option(-rapid_frame_command) \ } else { rtd::RtdImageFrame $w_.rapid \ -target_image $this \ -xoffset $xoffset \ -yoffset $yoffset \ -width $width \ -height $height \ -subsample $itk_option(-subsample) \ -usexshm $itk_option(-usexshm) \ -usexsync $itk_option(-usexsync) \ -region_id $region_id \ -verbose $itk_option(-verbose) \ -command $itk_option(-rapid_frame_command) } } # attach the named camera. public method attach_camera {camera} { # these commands are evaluated before/after real-time events set preCmd [code $this camera_pre_command] set postCmd [code $this camera_post_command] if {[catch {$image_ camera attach $camera $preCmd $postCmd} msg]} { # try again. Maybe rtdServer wasn't started yet. catch {exec rtdServer &} after 2000 } if {[catch {$image_ camera attach $camera $preCmd $postCmd} msg]} { error_dialog $msg } update idletasks } # stop the camera. # note: race conditions might cause display to lag behind the socket data. # force an update here. public method detach_camera {} { $image_ camera detach $image_ update } # This method is called when a new image has been received from # the camera and before it is displayed. # The frameid will be 0 for the main image and non-zero for a rapid frame. public method camera_pre_command {frameid} { if {$frameid != 0} { return } if {"$cameraPreCmd_" != ""} { catch {eval $cameraPreCmd_} } } # This method is called whenever a new image has been received from # the camera and displayed. # Update the widgets that need to display new values # The frameid will be 0 for the main image and non-zero for a rapid frame. public method camera_post_command {frameid} { if {$frameid != 0} { return } if {[winfo exists $w_.spectrum]} { $w_.spectrum notify_cmd } if {"$preview_var_" != ""} { global ::$preview_var_ if {[info exists $preview_var_]} { set $preview_var_ 0 } } # update picked object if {[winfo exists $w_.pick] && $updatePick_ != 0} { $w_.pick update_now } # set up world coordinate info, if needed set_rtd_wcs_info $frameid if {"$cameraPostCmd_" != ""} { catch {eval $cameraPostCmd_} } } # Set up world coordinate info for an image received from the rtdServer. public method set_rtd_wcs_info {frameid} { } # popup a window to display a table of nrows x ncols pixel values # from the image public method pixel_table {nrows ncols} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } if {[winfo exists $w_.pixtable]} { destroy $w_.pixtable } rtd::RtdImagePixTable $w_.pixtable \ -image $this \ -nrows $nrows \ -ncols $ncols \ -shorthelpwin $itk_option(-shorthelpwin) \ -transient 1 } # arrange to interactively create a spectrum line to display # a graph of the image values along a given line. public method spectrum {} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } if {[winfo exists $w_.spectrum]} { $w_.spectrum quit } if {[action_dialog \ "Press OK and then drag out a line over the image with button 1" \ $w_]} { $itk_component(draw) set_drawing_mode line [code $this make_spectrum] } } # display a dialog for selecting objects in the image and displaying information # about the selected area of the image public method pick_dialog {{command ""}} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } utilReUseWidget rtd::RtdImagePick $w_.pick \ -target_image $this \ -command $command \ -verbose $itk_option(-verbose) \ -orient $itk_option(-pickobjectorient) \ -debug $itk_option(-debug) \ -shorthelpwin $itk_option(-shorthelpwin) $w_.pick pick_object } # this method can be used in bindings to cause a selection in the # image (to pick an object/star) to return the given position rather than the # calculated center pos. If the optional args are not specified, they are # calculated. protected method picked_wcs_object {x y ra dec {equinox J2000} {fwhmX ""} {fwhmY ""} \ {angle ""} {object ""} {background ""}} { if {[winfo exists $w_.pick]} { if {"$angle" == ""} { $w_.pick picked_special_object $x $y $ra $dec $equinox } else { $w_.pick picked_wcs_object \ [list $x $y $ra $dec $equinox $fwhmX $fwhmY $angle $object $background] } } } # make a hard copy of the image display public method print {} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } set object [$image_ object] set file [file tail $itk_option(-file)] set center [$image_ wcscenter] set user [id user] set app [lindex [winfo name .] 0] set date [clock format [clock seconds] -format {%b %d, %Y at %H:%M:%S}] utilReUseWidget rtd::RtdImagePrint $w_.print \ -image $this \ -show_footer 1 \ -whole_canvas 0 \ -transient 1 \ -top_left "ESO\n$object" \ -top_right "$file\n$center" \ -bot_left "$user/$app" \ -bot_right "$date" } # Save the current image or a section of the current image to a file in # FITS format chosen from a file name dialog. If dir and pattern are specified, # they are used as defaults for the file selection dialog. # If x0, y0, x1 and y1 are specified (canvas coordinates), then a section # of the image is saved. # # The return value is the name of the new file, if any, or an empty string. public method save_as {{dir "."} {pattern "*"} {x0 ""} {y0 ""} {x1 ""} {y1 ""}} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } set file [filename_dialog $dir $pattern $w_] if {"$file" != ""} { if {[file isfile $file]} { if {![confirm_dialog \ "[file tail $file] exists - Do you want to overwrite it ?" $w_]} { return } if {[file isdir $file]} { error_dialog "$file is a directory" $w_ return } } if {"$x0" == ""} { $image_ dump $file } else { if {[catch { $image_ convert coords $x0 $y0 canvas x0 y0 image $image_ convert coords $x1 $y1 canvas x1 y1 image $image_ dump $file $x0 $y0 $x1 $y1 } msg]} { error_dialog $msg return } } return $file } } # save a section of the current image to a file in FITS format # chosen from a file name dialog. public method save_region_as {} { # check if we have an image if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } # can't convert DSS plate cooeficients correctly if {"[$image_ fits get PLTRAH]" != ""} { if { ! [confirm_dialog "Can't convert DSS plate coefficients.\ Please get the image from the DSS image server.\n\n\ \tContinue anyway?" $w_] } { return } } # first get the region to save if {[action_dialog \ "Please select and drag out a region of the image with mouse button 1" \ $w_]} { $itk_component(draw) set_drawing_mode region [code $this save_region] } } # save the given section of the current image to a file in FITS format # chosen from a file name dialog. The canvas_id is the id if the canvas # object used to select the region . The canvas coordinates of the region # are also passed as arguments. protected method save_region {canvas_id x0 y0 x1 y1} { save_as . * $x0 $y0 $x1 $y1 $itk_component(draw) delete_object $canvas_id } # Create a graph to display the image data values along the line # just created. # "line_id" is the canvas id of the line. protected method make_spectrum {line_id x0 y0 x1 y1} { if {[winfo exists $w_.spectrum]} { $w_.spectrum quit } rtd::RtdImageSpectrum $w_.spectrum \ -x0 [expr {int($x0)}] \ -y0 [expr {int($y0)}] \ -x1 [expr {int($x1)}] \ -y1 [expr {int($y1)}] \ -image $this \ -transient 1 \ -shorthelpwin $itk_option(-shorthelpwin) \ -line_id $line_id } # toggle the visibility of the line graphics # (The trace variable name is passed here, if 1, hide the graphics...) public method hide_graphics {variable} { global ::$variable if {[set $variable]} { $canvas_ raise $image_ } else { $canvas_ lower $image_ } } # this method is called by the image code whenever a new image is loaded # (for updates, see camera command) protected method new_image_cmd {} { # only runs the first time, if the user chose a different color scale if {"$itk_option(-color_scale)" != "linear"} { if {[catch {$image_ colorscale $itk_option(-color_scale)} msg]} { error_dialog $msg } set itk_option(-color_scale) linear } if {[winfo exists $w_.rapid]} { destroy $w_.rapid } if {[info exists itk_component(draw)]} { $itk_component(draw) clear set_drawing_area } # update biasimage status $image_ biasimage update if {"$itk_option(-newimagecmd)" != ""} { eval $itk_option(-newimagecmd) } center } # set preview mode on or off in the image. In this case, the # arg is the "name" of a global variable controlling the preview # mode. It will be kept up to date by this class. public method preview {var} { global ::$var $image_ preview [set [set preview_var_ $var]] } # set the performance test mode on or off. public method perftest {} { if {[catch {$image_ perftest on} msg]} { error_dialog $msg return } utilReUseWidget rtd::RtdImagePerf $w_.perf \ -target_image $this \ -shorthelpwin $itk_option(-shorthelpwin) } # Methods for the playing and recording of images. public method record {camera} { utilReUseWidget RtdRecorderTool $w_.rec \ -target_image $this \ -server_camera $camera \ -shorthelpwin $itk_option(-shorthelpwin) } # clear the current image display and remove any windows that # access it public method clear {} { $image_ config -file "" set itk_option(-file) "" set w [$image_ dispwidth] set h [$image_ dispheight] set_scrollregion 0 0 $w $h if {[info exists itk_component(draw)]} { $itk_component(draw) clear } $canvas_ delete objects if {[winfo exists $w_.rapid]} { destroy $w_.rapid } if {[winfo exists $w_.spectrum]} { destroy $w_.spectrum } if {[winfo exists $w_.pixtable]} { destroy $w_.pixtable } if {[winfo exists $w_.pick]} { $w_.pick close } } # reload the image file, if there is one public method reopen {} { $image_ update } # load a FITS file (internal version: use -file option/public variable) protected method load_fits_ {} { if {[file exists $itk_option(-file)] || "$itk_option(-file)" == "-"} { if {[catch {$image_ config -file $itk_option(-file)} msg]} { error_dialog $msg $w_ clear } set w [$image_ dispwidth] set h [$image_ dispheight] set_scrollregion 0 0 $w $h } else { error_dialog "'$itk_option(-file)' does not exist" $w_ set file "" clear } } # pass these methods on to the image widget unchanged # (this just generates methods on the fly...) ::foreach i {view cut cmap itt colorscale alloccolors zoom zoomview object convert wcscenter wcsradius isclear dispwidth dispheight freq} { method $i {args} [::format {return [eval "$image_ %s $args"]} $i] } # -- public vars -- # fits image file to display itk_option define -file file File {} { if {"$itk_option(-file)" != ""} { # this code makes it easier to center the image on startup if {[winfo width $w_] <= 1 || [$image_ isclear]} { after 0 [code $this load_fits_] } else { load_fits_ } } } # for compatibility with saoimage itk_option define -fits fits Fits {} { if {"$itk_option(-fits)" != ""} { config -file $itk_option(-fits) } } # set displaymode flag 0 to optimize for smooth scrolling, # 1 for faster updates and less memory (works best for main image) itk_option define -displaymode displayMode DisplayMode {1} { imageconfig_ -displaymode } # X shared memory option. # DISABLED: pbi 01/03/05 # Dynamic re-configuration crashes rtd but has never been used # by any application or by rtd itself. itk_option define -usexshm useXshm UseXshm 1 { ###imageconfig_ -usexshm } # X synchronisation option itk_option define -usexsync useXsync UseXsync 1 { imageconfig_ -usexsync } # -name option itk_option define -name name Name {MainImage} { imageconfig_ -name } # minimum allowed scale value itk_option define -min_scale min_scale Min_scale -10 # maximum allowed scale value itk_option define -max_scale max_scale Max_scale 20 # This flag controls whether the FITS image header is kept in # SysV shared memory (see the rtdRemote interface for use of this) itk_option define -shm_header shm_header Shm_header 0 { imageconfig_ -shm_header } # This flag controls whether the FITS image data is kept in # SysV shared memory (see the rtdRemote interface for use of this) itk_option define -shm_data shm_data Shm_data 0 { imageconfig_ -shm_data } # Specify the min number of colors to allocate before using # a private colormap. Note: this option is currently ignored. itk_option define -min_colors min_colors Min_colors 30 { imageconfig_ -min_colors } # Specify the max number of colors to allocate before using # a private colormap. Note: this option is currently ignored. itk_option define -max_colors max_colors Max_colors 60 { imageconfig_ -max_colors } # if non-zero, shrink image to fit width itk_option define -fitwidth fitWidth FitWidth {0} { if {$itk_option(-fitwidth)} { config -canvaswidth $itk_option(-fitwidth) imageconfig_ -fitwidth } } # if non-zero, shrink image to fit height itk_option define -fitheight fitHeight FitHeight {0} { if {$itk_option(-fitheight)} { config -canvasheight $itk_option(-fitheight) imageconfig_ -fitheight } } # if non-zero, fill image to fit width itk_option define -fillwidth fillWidth FillWidth {0} { if {$itk_option(-fillwidth)} { config -canvaswidth $itk_option(-fillwidth) imageconfig_ -fillwidth } } # if non-zero, fill image to fit height itk_option define -fillheight fillHeight FillHeight {0} { if {$itk_option(-fillheight)} { config -canvasheight $itk_option(-fillheight) imageconfig_ -fillheight } } # flag: if true, print diagnostic messages itk_option define -verbose verbose Verbose {0} { imageconfig_ -verbose } # flag: if true, use quick and dirty algorithm to shrink images itk_option define -subsample subsample Subsample {1} { imageconfig_ -subsample } # sampling method to used when option -subsample is 0 itk_option define -sampmethod sampmethod Sampmethod {0} { imageconfig_ -sampmethod } # flag: if true, display horizontal and vertical scrollbars itk_option define -scrollbars scrollbars Scrollbars 0 { if {$itk_option(-scrollbars)} { # optional vertical scrollbar if {![info exists itk_component(vscroll)]} { itk_component add vscroll { scrollbar $itk_component(vscrollf).vscroll \ -relief sunken \ -command [code $canvas_ yview] } pack $itk_component(vscroll) -side right -fill y $canvas_ config -yscrollcommand "$itk_component(vscroll) set" } if {![info exists itk_component(hscroll)]} { # optional horizontal scrollbar itk_component add hscroll { scrollbar $itk_component(hscrollf).hscroll \ -relief sunken \ -orient horiz \ -command [code $canvas_ xview] } pack $itk_component(hscroll) -side bottom -fill x $canvas_ config -xscrollcommand "$itk_component(hscroll) set" } } else { $canvas_ config -xscrollcommand "" -yscrollcommand "" if {[info exists itk_component(vscroll)]} { destroy $itk_component(vscroll) destroy $itk_component(hscroll) unset itk_component(vscroll) unset itk_component(hscroll) } } } # flag: if true, set bindings to scroll with the middle mouse button itk_option define -drag_scroll drag_scroll Drag_scroll 0 { global EDITING ; # panel editor set pe 0 if {[info exists EDITING]} { set pe $EDITING } if { ! $pe } { if {$itk_option(-drag_scroll)} { bind $canvas_ <2> [code $canvas_ scan mark %x %y] bind $canvas_ [code "$canvas_ scan dragto %x %y; $this maybe_center"] } else { bind $canvas_ <2> { } bind $canvas_ { } } } } # flag: if true, create a CanvasDraw object to manage the canvas graphics itk_option define -graphics graphics Graphics 1 { if {$itk_option(-graphics) && ![info exists itk_component(draw)]} { # create an object to manage the canvas graphics make_toolbox } else { $canvas_ config -cursor $itk_option(-cursor) } } # if true (default) create the GUI interface (toolbox), otherwise don't itk_option define -withtoolbox withToolbox WithToolbox {1} # default cursor itk_option define -cursor cursor Cursor {target} # Tcl command to evaluate whenever a "region" of the image is selected # via the graphic toolbox "region" selection item. Can be used to # select graphic items or a section of the image for an operation. itk_option define -regioncommand regionCommand RegionCommand {} # optional tcl command to be evaluated when a rapid frame is created, moved, # resized or deleted: 6 args will be appended: # # name = unique name for the frame # op = {move,resize or delete}, # x, y = coords of upper left corner of frame in image # width, height = dimensions of frame. itk_option define -rapid_frame_command rapid_frame_command Rapid_frame_command {} # default cmap file itk_option define -default_cmap default_cmap Default_cmap {real} # default ITT file itk_option define -default_itt default_itt Default_itt {ramp} # Set the default color scale algorithm to one of: {linear log sqrt histeq} itk_option define -color_scale color_scale Color_scale linear # Colormap initialization and directory search path for colormap # and ITT files itk_option define -cmap_dir cmap_dir Cmap_dir {} { if {!$colormap_initialized_} { global ::rtd_library if {"$itk_option(-cmap_dir)" == ""} { set itk_option(-cmap_dir) $rtd_library/colormaps } # find default cmap and itt, could be on the search path set basename $itk_option(-default_cmap).$itk_option(-cmap_suffix) set cmap {} set dirlist [split $itk_option(-cmap_dir) {;}] foreach dir $dirlist { set offered_cmap ${dir}/${basename} if { [::file exists $offered_cmap] } { set cmap $offered_cmap break } } if { $cmap == {} } { set cmap [lindex $dirlist 0]/$basename } $image_ cmap file $cmap set basename $itk_option(-default_itt).$itk_option(-itt_suffix) set itt {} foreach dir $dirlist { set offered_itt ${dir}/${basename} if { [::file exists $offered_itt] } { set itt $offered_itt break } } if { $itt == {} } { set itt [lindex $dirlist 0]/$basename } $image_ itt file $itt set colormap_initialized_ 1 } } # suffix for colormap files itk_option define -cmap_suffix cmap_suffix Cmap_suffix {lasc} # suffix for ITT files itk_option define -itt_suffix itt_suffix Itt_suffix {iasc} # flag: if true, display menus over graphic objects when selected with <3> itk_option define -show_object_menu show_object_menu Show_object_menu 0 # name of zoom window to update when mouse enters this window itk_option define -zoomwin zoomWin ZoomWin {} { if {"$itk_option(-zoomwin)" != ""} { bind $canvas_ "+$itk_option(-zoomwin) enter_image $image_" bind $canvas_ "+$itk_option(-zoomwin) leave_image $image_" } } # short help text itk_option define -shelp shelp Shelp "image window" { if {"$itk_option(-shelp)" != ""} { catch {add_short_help $w_ $itk_option(-shelp)} msg catch {add_short_help $canvas_ $itk_option(-shelp)} msg } } # -orient option for Pick Object window itk_option define -pickobjectorient pickObjectOrient PickObjectOrient {vertical} # option to update RtdImagePick after a real-time image event itk_option define -updatePick updatePick UpdatePick {1} { set updatePick_ $itk_option(-updatePick) } # command to eval when a new image is loaded itk_option define -newimagecmd newImageCmd NewImageCmd "" # optionally specify TopLevelWidget to display short help messages itk_option define -shorthelpwin shortHelpWin ShortHelpWin {} # debugging flag itk_option define -debug debug Debug {0} { imageconfig_ -debug } # option to warp the mouse pointer itk_option define -with_warp with_warp With_warp 0 # default scaling factors itk_option define -xscale xscale Xscale {1} { set xscale_ $itk_option(-xscale) if {[winfo width $w_] > 1} { scale $xscale_ $yscale_ } } itk_option define -yscale yscale Yscale {1} { set yscale_ $itk_option(-yscale) if {[winfo width $w_] > 1} { scale $xscale_ $yscale_ } } # commands to be evaluated before/after image events itk_option define -cameraPreCmd cameraPreCmd CameraPreCmd {} { set cameraPreCmd_ $itk_option(-cameraPreCmd) } itk_option define -cameraPostCmd cameraPostCmd CameraPostCmd {} { set cameraPostCmd_ $itk_option(-cameraPostCmd) } # -- protected vars -- # internal rtd image protected variable image_ # canvas widget protected variable canvas_ # canvas Id for image protected variable imageId_ # name of a global variable controlling preview mode protected variable preview_var_ {} # saved x0 relative scrolling position protected variable xScroll0_ 0 # saved x1 relative scrolling position protected variable xScroll1_ 0 # saved y0 relative scrolling position protected variable yScroll0_ 0 # saved y1 relative scrolling position protected variable yScroll1_ 0 # camera pre/post commands protected variable cameraPreCmd_ "" protected variable cameraPostCmd_ "" # values for xscale, yscale protected variable xscale_ 1 protected variable yscale_ 1 # update RtdImagePick after a real-time event protected variable updatePick_ 1 # --- common to all instances -- # flag: true if the colormap has been initialized common colormap_initialized_ 0 } skycat-3.1.2-starlink-1b/rtd/library/RtdImageBias.tcl000066400000000000000000000357521215713201500224050ustar00rootroot00000000000000#****************************************************************************** # E.S.O. - VLT project # "@(#) $Id: RtdImageBias.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageBias.tcl - class for bias data subtraction # # who when what # -------- -------- ---------------------------------------------- # P.Biereichel 22/03/99 Created itk::usual RtdImageBias {} # RtdImageBias is a class for controlling the subtraction of # a bias frame. itcl::class rtd::RtdImageBias { inherit util::TopLevelWidget constructor {args} { eval itk_initialize $args wm title $w_ "Bias Image" wm protocol $w_ WM_DELETE_WINDOW "$this close" set biasWdg_ $this } public method init {} { set maxbias_ [$image_ biasimage maxbias] add_menubar make_layout update idletasks wm minsize $w_ [winfo reqwidth $w_] [winfo reqheight $w_] update_cuts } # Method to add the menu bar to the top of the dialogue. protected method add_menubar {} { TopLevelWidget::add_menubar # File menu set m [add_menubutton File] add_menuitem $m cascade "Load File" \ {Load a file for bias subtraction} \ -menu [menu $m.biasf] for {set i 0} {$i < $maxbias_} {incr i} { $m.biasf add command -label "Bias [expr {$i+1}]..." \ -command [code $this load $i] } add_menuitem $m cascade "Clear" \ {Clear a bias image} \ -menu [menu $m.biasc] for {set i 0} {$i < $maxbias_} {incr i} { $m.biasc add command -label "Bias [expr {$i+1}]" \ -command [code $this clear $i] } $m.biasc add command -label "All" \ -command [code $this clear all] add_menuitem $m cascade "Copy image to ->" \ {Copy current image to a bias frame} \ -menu [menu $m.biaso] for {set i 0} {$i < $maxbias_} {incr i} { $m.biaso add command -label "Bias [expr {$i+1}]" \ -command [code $this copy $i] } add_menuitem $m command "Close" \ {Close this window} \ -command [code $this close] # View menu set m [add_menubutton View] add_menuitem $m command "Display selected bias image" \ {Display the bias image} \ -command [code $this display] } # make the widget layout protected method make_layout {} { # frames foreach el "bias status cuts buttons" { itk_component add $el { frame $w_.$el -relief groove -borderwidth 2 } pack $itk_component($el) -fill x -expand 1 } itk_component add copy { button $w_.copy \ -text "Copy image -> bias" \ -command [code $this copy] } # checkbutton to turn bias subtraction on/off itk_component add onoff { checkbutton $w_.onoff \ -text "Subtract " \ -variable $w_.onoff \ -onvalue 1 -offvalue 0 \ -anchor w \ -borderwidth 2 -relief raised -pady 3 \ -command [code $this onOff] } { keep -state } blt::blttable $itk_component(bias) \ $itk_component(onoff) 0,0 -pady 3 \ $itk_component(copy) 0,1 -pady 3 set i 0 foreach el "Nr Select Load Copy Clear Filename" { set comp [string tolower $el] itk_component add label$comp { label $w_.label$comp \ -anchor c } blt::blttable $itk_component(status) \ $itk_component(label$comp) 0,$i blt::blttable configure $itk_component(status) c$i -resize none incr i } blt::blttable configure $itk_component(status) c5 -resize expand foreach el "Load Copy Clear" { set s [string tolower $el] catch {bitmap compose $s $el -rotate 90.0 -font $itk_option(-valuefont)} $itk_component(label$s) config -bitmap $s -anchor w } for {set i 0} {$i < $maxbias_} {incr i} { set n [expr {$i+1}] itk_component add labelnr$i { label $w_.labelnr$i \ -text " [expr {$i+1}] " \ -font $itk_option(-labelfont) \ -anchor c } global ::$w_.select itk_component add select$i { radiobutton $w_.select$i \ -variable $w_.select \ -anchor c \ -value $i \ -padx 1 -pady 1 \ -borderwidth 2 \ -command [code $this select] } set select_ [set $w_.select 0] itk_component add choose$i { button $w_.choose$i \ -text "..." \ -width 2 \ -padx 0 \ -anchor c \ -font $itk_option(-valuefont) \ -borderwidth 2 \ -relief raised \ -command [code $this load $i] } itk_component add copy$i { button $w_.copy$i \ -text "->" \ -width 2 \ -anchor c \ -padx 0 \ -font $itk_option(-valuefont) \ -borderwidth 2 \ -relief raised \ -command [code $this copy $i] } itk_component add clear$i { button $w_.clear$i \ -text "C" \ -anchor c \ -width 2 \ -padx 0 \ -font $itk_option(-valuefont) \ -borderwidth 2 \ -relief raised \ -command [code $this clear $i] } itk_component add filename$i { util::LabelValue $w_.filename$i \ -text "" \ -labelwidth 2 \ -valuefont $itk_option(-valuefont) \ -labelfont $itk_option(-labelfont) \ -valuewidth 30 \ -anchor e \ -relief groove \ -orient horizontal } $itk_component(filename$i) component entry config -highlightthickness 0 -takefocus 0 blt::blttable $itk_component(status) \ $itk_component(labelnr$i) $n,0 \ $itk_component(select$i) $n,1 \ $itk_component(choose$i) $n,2 \ $itk_component(copy$i) $n,3 \ $itk_component(clear$i) $n,4 \ $itk_component(filename$i) $n,5 -anchor e -fill x -pady 1 } itk_component add labelcut { label $w_.labelcut \ -text "Cut levels:" \ -font $itk_option(-labelfont) \ -anchor c } foreach el "Low High" { set s [string tolower $el] itk_component add $s { LabelEntry $w_.$s \ -text "$el:" \ -command [code $this set_cut_levels] \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -anchor e \ -relief sunken \ -validate real } { keep -state } } itk_component add autocut { button $w_.autocut \ -text "Auto Set Cut Levels" \ -font $itk_option(-labelfont) \ -command [code $this auto_set_cut_levels] } blt::blttable $itk_component(cuts) \ $itk_component(labelcut) 0,0 -columnspan 3 -pady 4 \ $itk_component(low) 1,0 -anchor w -ipady 3 -pady 2 \ $itk_component(high) 1,1 -anchor w -ipady 3 -pady 2 \ $itk_component(autocut) 1,2 -anchor w -ipady 3 -pady 2 itk_component add close { button $itk_component(buttons).close \ -text Close \ -command [code $this close] } blt::blttable $itk_component(buttons) \ $itk_component(close) 0,0 -pady 3 } # add short help text public method make_short_help {} { add_help $itk_component(copy) "Copy: Copy current image to selected bias image" add_help $itk_component(onoff) "Subtract: Switch subtraction of bias image on/off" for {set i 0} {$i < $maxbias_} {incr i} { set n [expr {$i+1}] add_help $itk_component(labelnr$i) "Number of bias image" add_help $itk_component(select$i) "Select: Select bias image $n for image subtraction" add_help $itk_component(choose$i) "...: Load bias image $n from file" add_help $itk_component(copy$i) "->: Copy current image -> bias image $n" add_help $itk_component(clear$i) "C: Clear bias image $n" add_help $itk_component(filename$i) "File: Filename of bias image $n or env. RTD_CAMERA \ for real-time image" } add_help $itk_component(low) "Low: Image low cut level, hit Return after editing value" add_help $itk_component(high) "High: Image high cut level, hit Return after editing value" add_help $itk_component(autocut) "Autocut: Auto set cut levels" add_help $itk_component(close) "Close: Close this window" } protected method add_help {compo msg} { # XXX would be nice to have an option for TopLevelWidget bind $compo {} bind $compo {} add_short_help $compo $msg } # close this window public method close {} { wm withdraw $w_ } # trace status of a global variable which is set by the rtdimage # subcommand 'biasimage' protected method trace_status {} { global ::$image_ trace variable ${image_}(BIAS) w [code $this updateStatus] } # copy current image -> bias image public method copy {{nr -1}} { if [$image_ isclear] { warning_dialog "No image is currently loaded" $w_ return } if {$nr == -1} { set nr $select_ } if {$nr == $select_ && $onoff_} { set update_ 1 } if {[catch {$image_ biasimage copy $nr} msg]} { error_dialog $msg } } # clear bias image public method clear {nr} { if {$nr == $select_ && $onoff_} { set update_ 1 } $image_ biasimage clear $nr } # select bias image for image subtraction public method select {} { global ::$w_.select if {$select_ == [set $w_.select]} { return } set select_ [set $w_.select] set update_ $onoff_ $image_ biasimage select $select_ } # open and load a new FITS image file via file name dialog public method load {nr {dir "."} {pattern "*.*fit*"}} { set file [filename_dialog $dir $pattern $w_] if {"$file" != ""} { if {[file isfile $file]} { if {$nr == $select_ && $onoff_} { set update_ 1 } if {[catch {$image_ biasimage file $file $nr} msg]} { error_dialog $msg } } else { error_dialog "There is no file named '$file'" $w_ } } } # switch bias subtraction on/off public method onOff {} { global ::$w_.onoff set onoff_ [set $w_.onoff] set update_ 1 if {$onoff_} { if {[catch {$image_ biasimage on} msg]} { set onoff_ [set $w_.onoff 0] error_dialog $msg } } else { $image_ biasimage off } } # display selected bias image public method display {} { if {[catch {$image_ biasimage display} msg]} { error_dialog $msg } } # update status of this widget and all images when necessary public method updateStatus {{args}} { global ::$image_ ::$w_.onoff if {[$image_ biasimage status] == -1} { set onoff_ [set $w_.onoff 0] config -state disabled } else { config -state normal } set isclear [$image_ isclear] set stat normal if {$isclear} { set stat disabled } foreach el "copy low high" { $itk_component($el) config -state $stat } for {set i 0} {$i < $maxbias_} {incr i} { set fn "" set fn [file tail [$image_ biasimage file $i]] # set fn [$image_ biasimage file $i] $itk_component(filename$i) config -value $fn if {"$fn" != ""} { $itk_component(filename$i) config -relief sunken $itk_component(clear$i) config -state normal } else { $itk_component(filename$i) config -relief groove $itk_component(clear$i) config -state disabled } $itk_component(copy$i) config -state $stat } # update all images when requested if {$update_} { foreach el $images_ { $el update } set update_ 0 } } # set the cut levels when the user types them in and hits return public method set_cut_levels {args} { set low [$itk_component(low) get] set high [$itk_component(high) get] if {[catch {expr {$low}} msg] || [catch {expr {$high}} msg]} { error_dialog $msg } else { $image_ cut $low $high if {"$itk_option(-command)" != ""} { eval $itk_option(-command) } } } # set the cut levels automatically using median filtering... public method auto_set_cut_levels {} { busy {$image_ autocut} if {"$itk_option(-command)" != ""} { eval $itk_option(-command) } } # update cut level display public method update_cuts {} { lassign [$image_ cut] low high entry_value low $low entry_value high $high } # write value into entry field protected method entry_value {compo value} { set w [$itk_component($compo) component entry] $w delete 0 end $w insert 0 $value } # add an image object whose bias subtraction is managed # by this class public proc add_image {Img} { set img [$Img get_image] lvarpush images_ $img global ::$img set ${img}(BIAS) 0 } # remove an image object whose bias subtraction is managed # by this class public proc remove_image {Img} { set img [$Img get_image] if {[set idx [lsearch $images_ $img]] == -1} { return } set images_ [lreplace $images_ $idx $idx] set image_ [lindex $images_ 0] global ::$img catch {unset ${img}(BIAS) 0} if {[set idx [lsearch $Images_ $Img]] != -1} { set Images_ [lreplace $Images_ $idx $idx] } set Img [lindex $Images_ 0] if {"$Img" != ""} { $biasWdg_ config -shorthelpwin [[$Img cget -shorthelpwin] component hull] -image $Img } } # called after configuring itk_option(-image) public method newTarget {} { make_short_help update_cuts updateStatus } # -- options -- # target widget itk_option define -image image Image {} { set Img $itk_option(-image) set image_ [$Img get_image] if {[set idx [lsearch $Images_ $Img]] == -1} { lvarpush Images_ $Img set newimg [$Img cget -newimagecmd] # install callback for new image events $Img config -newimagecmd "$newimg; [code $this updateStatus]" trace_status } else { set Images_ [lreplace $Images_ $idx $idx] lvarpush Images_ $Img } after idle [code $this newTarget] } # font used for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # font used for values itk_option define -valuefont valueFont ValueFont TkDefaultFont # set the width for displaying labels and values itk_option define -labelwidth labelWidth LabelWidth 4 itk_option define -valuewidth valueWidth ValueWidth 8 # set the state to normal/disabled to enable/disable editing itk_option define -state state State {disabled} # tcl command to evaluate when cut levels were changed itk_option define -command command Command {} # display number of main image itk_option define -dsplnr dsplnr Dsplnr {1} { set nr $itk_option(-dsplnr) if {$nr > 1} { set mains_ $nr } if {$mains_} { wm title $w_ "Bias Image ($nr)" } } # -- protected vars -- # max. numbers of bias frames protected variable maxbias_ # copy of ::$w_.select protected variable select_ # copy of ::$w_.onoff protected variable onoff_ 0 # flag for image update request protected variable update_ 0 # set when more than one instances of main windows are used protected variable mains_ 0 # -- common (shared) variables -- # name of current rtd image protected common image_ {} # list of RtdImage objects handled by this class protected common images_ {} protected common Images_ {} # name of this widget protected common biasWdg_ {} } skycat-3.1.2-starlink-1b/rtd/library/RtdImageColorRamp.tcl000066400000000000000000000135431215713201500234170ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: RtdImageColorRamp.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageColorRamp.tcl - itcl widget used to display contents of the # colormap for an RtdImage in a generated image # # See man page RtdImageColorRamp(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created # Peter W. Draper 06 Mar 98 Added viewmaster and associated changes # to support non-pseudocolor visuals # (changes to colorramp do not get to other # images "automagically" any more. itk::usual RtdImageColorRamp {} # This [incr Tk] widget class displays the colors in the colormap from # left to right in a generated rtdimage. In addition, bindings are added # to the colorramp to rotate, shift, stretch and squeeze the colormap by # dragging the mouse pointer with a button pressed. itcl::class rtd::RtdImageColorRamp { inherit util::FrameWidget # constructor: create an RtdImage widget with generated # data to display all the values in the colormap constructor {args} { itk_option add hull.borderwidth hull.relief eval itk_initialize $args # RtdImage item used to display colors in colormap itk_component add image { rtd::RtdImage $w_.image \ -displaymode 0 \ -usexshm $itk_option(-usexshm) \ -borderwidth 2 \ -relief raised \ -scrollbars 0 \ -drag_scroll 0 \ -graphics 0 \ -shelp $itk_option(-shelp) \ -cursor $itk_option(-cursor) \ -canvasheight $itk_option(-height) } { } pack $itk_component(image) -fill x set canvas_ [$itk_component(image) get_canvas] set image_ [$itk_component(image) get_image] # catch resize event: color ramp should always fill width of the window bind $canvas_ [code $this update_colors] # add bindings for rotating the colormap # (these will change later when more functions are available) # Note: need shift of single color ? (see saoimage) bind $canvas_ <1> [code $this mark_for_shift %x] bind $canvas_ <2> [code $this mark %x] bind $canvas_ <3> [code $this reset_colors] bind $canvas_ [code $this shift_colors %x] bind $canvas_ [code $this rotate_colors %x] bind $canvas_ [code $this scale_itt %x] bind $canvas_ " " bind $canvas_ [code $this save_cmap] bind $canvas_ [code $this save_cmap] } # update the colorramp after the window has been resized or the number of # colors has changed (need to delay to always get the correct size) public method update_colors {} { after 0 [code $image_ colorramp] } # mark the given position for later reference protected method mark {pos} { set mark_ $pos } # mark the given position for later reference and set # things up for a shift operation. # (The dummy rotate op causes an internal copy between cmap and itt # that initializes the shift from the current itt.) protected method mark_for_shift {pos} { set mark_ $pos $image_ cmap rotate 0 } # rotate the colormap by the difference between the given # position and the position set with mark. protected method rotate_colors {pos} { set val [expr {$pos-$mark_}] $image_ cmap rotate $val if { $itk_option(-viewmaster) != {} } { $itk_option(-viewmaster) cmap rotate $val } mark $pos } # shift the colormap by the difference between the given # position and the position set with mark. protected method shift_colors {pos} { set val [expr {$pos-$mark_}] $image_ cmap shift $val if { $itk_option(-viewmaster) != {} } { $itk_option(-viewmaster) cmap shift $val } } # scale the current ITT based on the difference between the given # position and the position set with mark. protected method scale_itt {pos} { set val [expr {$pos-$mark_}] $image_ itt scale $val if { $itk_option(-viewmaster) != {} } { $itk_option(-viewmaster) itt scale $val } } # reset the colormap method reset_colors {} { $image_ cmap reset if { $itk_option(-viewmaster) != {} } { $itk_option(-viewmaster) cmap reset } } # Called after a shift or scale operation is done (button up) # to save the colormap state. We just do a null rotate here, # since it does what we want. This prevents the colormap from # reverting to the original state before each shift or scale # operation. The reason it would revert is that otherwise colors # shifted off to the left or right, for example, would be lost. protected method save_cmap {} { $image_ cmap rotate 0 } # -- public vars -- # height of colorramp (width is same as window) itk_option define -height height Height 12 # help text displayed when mouse enters widget itk_option define -shelp shelp Shelp "Colormap display: \ {bitmap dragb1} = shift colormap, \ {bitmap shiftdragb1} = rotate, \ {bitmap dragb2} = stretch, \ {bitmap b3} = reset" # cursor for window itk_option define -cursor cursor Cursor {exchange} # X shared memory option itk_option define -usexshm useXshm UseXshm 1 # "viewmaster" image. This is also updated when colorramp # changes. This allows changes to be propagated, even if using a # read-only visual. itk_option define -viewmaster viewmaster ViewMaster {} # -- protected vars -- # canvas window containing ramp image protected variable canvas_ # internal rtdimage widget for colorramp protected variable image_ # used to save a position for rotating the colormap protected variable mark_ 0 } skycat-3.1.2-starlink-1b/rtd/library/RtdImageColors.tcl000066400000000000000000000260251215713201500227610ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImageColors.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageColors.tcl - itcl widget for managing colormap for an rtdimage # # See man page RtdImageColors(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created # pbiereic 04/11/03 Workaround bug in tcl 8.4.3 (SourceForge Request ID 835020) # Peter W. Draper 21/07/12 Make cmap_dir a PATH-like list. itk::usual RtdImageColors {} # This [incr Tk] widget presents a user interface for manipulating # colors and colormaps for an RtdImage widget. The widget creates a new # toplevel window containing items for "color scaling" the image, # loading a MIDAS style colormap or ITT (intensity transfer table) and # for setting the number of color cells allocated in the colormap. itcl::class rtd::RtdImageColors { inherit util::TopLevelWidget # constructor: create a new instance of this class constructor {args} { wm title $w_ "Image Colors" wm iconname $w_ "Image Colors" # evaluate the options eval itk_initialize $args # top frame itk_component add top { frame $w_.top -borderwidth 2 -relief groove } pack $itk_component(top) \ -side top -fill both -ipadx 2m -ipady 2m -expand 1 # LabelChoice(n) widget for choosing a color scale algorithm itk_component add scale { util::LabelChoice $w_.scale \ -text "Color Scale Algorithm:" \ -orient vertical \ -choice {Linear Logarithmic {Square Root} {Histogram Equalization}} \ -command [code $this set_color_scale] } pack $itk_component(scale) -side left -fill x -in $w_.top $itk_component(scale) config -value Linear # choose colormap/ITT set cmap_files [lsort [$image_ cmap list]] set itt_files [lsort [$image_ itt list]] # Chooser(n) widget listing available colormaps itk_component add colormaps { util::Chooser $w_.colormaps \ -title "Colormap" \ -relief groove -borderwidth 2 \ -width 0 \ -suffix $itk_option(-cmap_suffix) \ -files $cmap_files \ -default $itk_option(-default_cmap) \ -command [code $this set_cmap] } # Chooser(n) widget listing available intensity tables. itk_component add itts { util::Chooser $w_.itts \ -title "Intensity" \ -relief groove -borderwidth 2 \ -width 0 \ -suffix $itk_option(-itt_suffix) \ -files $itt_files \ -default $itk_option(-default_itt) \ -command [code $this set_itt] } pack $itk_component(colormaps) $itk_component(itts) \ -side left -fill both -expand 1 -in $itk_component(top) # Frame for displaying allocated/free colors itk_component add alloc { frame $w_.alloc -borderwidth 2 -relief groove } pack $itk_component(alloc) -side top -ipadx 2m -ipady 2m -fill x # if we are using a private colormap, ignore -max_colors if {[$image_ cmap isprivate]} { set itk_option(-max_colors) 128 } # if we are using a read-only colormap, ignore -min and max colors if {[$image_ cmap isreadonly]} { set itk_option(-min_free) 0 set itk_option(-max_colors) 256 } # LabelEntryScale widget displaying the number of allocated colors itk_component add allocated { util::LabelEntryScale $w_.allocated \ -text "Allocated Colors" \ -valuewidth 4 \ -show_arrows 1 \ -increment 1 \ -from $itk_option(-min_free) \ -to $itk_option(-max_colors) \ -value $itk_option(-min_free) \ -validate numeric } pack $itk_component(allocated) \ -in $itk_component(alloc) -side left -fill x -expand 1 # LabelValue(n) widget displaying the number of free colors itk_component add free { util::LabelValue $w_.free \ -text "Free Colors:" \ -valuewidth 4 \ -value 0 } pack $itk_component(free) \ -side left -padx 2m -in $itk_component(alloc) update_allocated $itk_component(allocated) config -command [code $this set_allocated] # Frame for buttons itk_component add buttons { frame $w_.buttons -borderwidth 2 -relief groove } pack $itk_component(buttons) -side top -fill x -padx 1m -pady 1m # Apply button itk_component add apply { button $w_.apply \ -text "Reallocate" \ -command [code $this reallocate] } # Close button itk_component add close { button $w_.close \ -text "Close" \ -command "wm withdraw $w_" } # Defaults button itk_component add defaults { button $w_.defaults \ -text "Defaults" \ -command "[code $this set_defaults]" } pack $itk_component(apply) $itk_component(close) $itk_component(defaults) \ -side left -expand 1 -padx 2m -pady 2m -in $w_.buttons # add short help make_short_help # Default values may have been changed by the command line args set_color_scale [$image_ colorscale] } # set the default colormap and itt public method set_defaults {} { $itk_component(colormaps) set_choice $itk_option(-default_cmap) $itk_component(itts) set_choice $itk_option(-default_itt) $itk_component(scale) config -value Linear set_color_scale Linear } # if flag is true, use a private colormap, otherwise the default public method use_private_colormap {} { $image_ cmap private reallocate } # add a short help window protected method make_short_help {} { # TopLevelWidget::make_short_help add_short_help $itk_component(scale) \ {Color Scaling: {bitmap b1} = apply selected color scaling algorithm} add_short_help $itk_component(colormaps) \ {MIDAS Colormaps: {bitmap b1} = apply selected color map} add_short_help $itk_component(itts) \ {Intensity transfer tables: {bitmap b1} = apply selected ITT} add_short_help $itk_component(allocated) \ {Color allocation: {bitmap dragb1} = use more/less colors (press Reallocate to apply)} add_short_help $itk_component(free) \ {Free colors: displays number of colors not being used} add_short_help $itk_component(apply) \ {Reallocate: {bitmap b1} = reallocate colors to use the selected number of colors} add_short_help $itk_component(close) {Close: {bitmap b1} = close this window} add_short_help $itk_component(defaults) {Defaults: {bitmap b1} = reset to use default values} } # this method is called to set the number of allocated colors protected method set_allocated {num_colors} { set free [expr {$free_ + ($allocated_ - $num_colors)}] if {$free >= 0} { set free_ $free set allocated_ $num_colors $itk_component(free) config -value $free } else { set free_ 0 set allocated_ [expr {$num_colors+$free}] $itk_component(free) config -value $free_ $itk_component(allocated) config -value $allocated_ } set free_ [$itk_component(free) get] set allocated_ [$itk_component(allocated) get] } # called when the scale value is changed to reallocate the colors public method reallocate {} { busy { set free_ [$itk_component(free) get] set allocated_ [$itk_component(allocated) get] foreach i [array names images_] { $images_($i) alloccolors $allocated_ $i update_colors } update_allocated } } # update the display to show the number of free and allocated colors public method update_allocated {} { update idletasks busy { lassign [$image_ alloccolors] allocated_ free_ # XXX needed for bug in tcl 8.4.3 set bug "$allocated_ $free_" set n $itk_option(-min_free) set to [max $n [expr {($free_+$allocated_)-$n}]] $itk_component(allocated) config \ -to $to \ -value $allocated_ $itk_component(free) config -value $free_ } } # this method is called to set the colormap for the image public method set_cmap {cmap} { # strip ./ from front. set cmap [string range $cmap 2 end] $image_ cmap file $cmap # if the colormap is read-only, we need to regenerate the color ramp if {[$image_ cmap isreadonly]} { catch {$itk_option(-image) component colorramp update_colors} } } # this method is called to set the itt for the image public method set_itt {itt} { # strip ./ from front. set itt [string range $itt 2 end] $image_ itt file $itt # if the colormap is read-only, we need to regenerate the color ramp if {[$image_ cmap isreadonly]} { catch {$itk_option(-image) component colorramp update_colors} } } # this method is called to set the color scaling algorithm public method set_color_scale {alg} { # choice variable global ::$w_.scale.choice set var $w_.scale.choice switch $alg { Linear - linear { $image_ colorscale linear set $var Linear } Logarithmic - log { $image_ colorscale log set $var Logarithmic } {Square Root} - sqrt { $image_ colorscale sqrt set $var {Square Root} } {Histogram Equalization} - histeq { $image_ colorscale histeq set $var {Histogram Equalization} } } } # add the given image to the list of images whose colormaps are managed # by this class public proc add_image {im} { set images_($im) [$im get_image] } # remove the given image from the list of images whose colormaps are managed # by this class public proc remove_image {im} { if {[info exists images_($im)]} { set i $images_($im) unset images_($im) if {"$image_" == "$i"} { set i [lindex [array names images_] 0] if {"$i" != ""} { set image_ $images_($i) } } } } # update the display with the values set in the given rtdimage public method update_values {im} { component colormaps set_choice [file rootname [$im cmap file]] component itts set_choice [file rootname [$im itt file]] set_color_scale [$im colorscale] } # -- public vars -- # name of RtdImage itcl widget, set by caller itk_option define -image image Image {} { set image_ [$itk_option(-image) get_image] } # directory path for colormap and ITT files itk_option define -cmap_dir cmap_dir Cmap_dir "" { if {"$itk_option(-cmap_dir)" == ""} { global ::rtd_library set itk_option(-cmap_dir) "$rtd_library/colormaps" } } # suffix for colormap files itk_option define -cmap_suffix cmap_suffix Cmap_suffix {lasc} # suffix for ITT files itk_option define -itt_suffix itt_suffix Itt_suffix {iasc} # max number of colors to allocate itk_option define -max_colors max_colors Max_colors 200 # min number of free colors to leave itk_option define -min_free min_free Min_free 5 # default (midas) colormap itk_option define -default_cmap default_cmap Default_cmap {real} # default (midas) intensity transfer table itk_option define -default_itt default_itt Default_itt {ramp} # -- protected vars -- # number of colors allocated protected variable allocated_ 0 # number of free colors protected variable free_ 0 # -- common (shared) variables -- # name of current internal rtdimage object protected common image_ {} # array (itk RtdImage) of C++ RtdImage objects, for updating clone colors protected common images_ } skycat-3.1.2-starlink-1b/rtd/library/RtdImageCtrl.tcl000066400000000000000000000645571215713201500224400ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: RtdImageCtrl.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageCtrl.tcl - Widget combining an RtdImage with a control panel # zoom and panning windows. # # See man page RtdImageCtrl(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01/06/95 Created # P.Biereichel 05/08/96 Added itk_option(-with_warp) # A.Brighton 22/03/98 Added -float_panel option to allow info panel to be # in a popup window (default is off, no change), # added -panel_layout option to allow changing the # order of the zoom and pan windows in the layout # (default is the same as before, no change). # P.W.Draper 22/01/99 Added -viewmaster option to RtdImageColorRamp # instance. # P.Biereichel 22/03/99 Added handling of bias widget # P.Biereichel 29/06/99 Added HDU code (copied from skycat) # pbiereic 25/05/00 Added method 'autoscale' # pbiereic 16/08/01 Added method 'reopen' to update FITS HDU's # Adapted for new widget RtdImageFitsHeader for viewing # FITS HDU headers. # P.W.Draper 05/12/06 Allow autoscale of image whose dimensions are 1. # 27/11/07 Autoscale for all items on canvas, not just image. itk::usual RtdImageCtrl {} # RtdImageCtrl is an itcl widget combining the RtdImage itcl widget with # a control panel, zoom and panning windows. # # RtdImageCtrl inherits all of the features described in # RtdImage(n) and also adds the following user interface components: # Zoom window (see RtdImageZoomView(n)), Panning window (see # RtdImagePan(n)), Colormap display widget (see RtdImageColorRamp(n)), # Image Control panel (see RtdImagePanel(n)). # # Each of the added user interface components is defined in a separate # [incr Tk] widget class. In addition, some methods from RtdImage are # redefined in order to update the user interface display. itcl::class rtd::RtdImageCtrl { inherit rtd::RtdImage # constructor: create a new instance of this class constructor {args} { # register with colormap handler window if it is already there (clones) rtd::RtdImageColors::add_image $this # register with bias image handler rtd::RtdImageBias::add_image $this # set the colormap on this window to the one used by the rtdimage # and arrange for all other top level windows to use that colormap rtd_set_cmap $w_ rtd_set_cmap [winfo toplevel $w_] util::TopLevelWidget::set_command "rtd_set_cmap" # see "init" method for layout eval itk_initialize $args } # destructor destructor { rtd::RtdImageColors::remove_image $this rtd::RtdImageBias::remove_image $this } # this method is called from the base class (TopLevelWidget) after all # the options have been evaluated protected method init {} { RtdImage::init feedback "control panel..." make_control_panel if ($itk_option(-with_colorramp)) { feedback "color ramp..." make_colorramp } # the "measure band" is displayed while the right mouse button # is pressed to show the distance between points rtd::RtdImageMBand $w_.mband \ -image $this \ -defaultcursor $itk_option(-cursor) # Add mouse bindings to select a region in the image $canvas_ bind $imageId_ \ "+$itk_component(draw) set_drawing_mode region" # set short help message to be displayed whenever # the mouse enters the image window (see Toplevel.tcl) set msg "image: \ {bitmap b1} = select object,\ {bitmap dragb2} = scroll image,\ {bitmap dragb3} = measure WCS, \ Control {bitmap dragb1} = select region" config -shelp $msg #set w [winfo toplevel $w_] #$canvas_ bind $imageId_ "+[code $w_ short_help $msg]" #$canvas_ bind $imageId_ "+[code $w_ short_help {}]" # set up remote control if {[catch {$image_ remote $itk_option(-port)} msg]} { error_dialog $msg $w_ } if {"$itk_option(-file)" == ""} { after 0 [code $this clear] } if { $itk_option(-float_panel) } { after 0 [code wm deiconify $itk_component(panel)] } } # make the control panel for operating on the image protected method make_control_panel {} { if { $itk_option(-float_panel) } { # The RTD control panel, may be put in a frame or optionally # in a popup window itk_component add panel { set panel [TopLevelWidget $w_.panel] } wm withdraw $panel # Stop this window from being destroyed. wm protocol $panel WM_DELETE_WINDOW {} wm title $panel "Control Panel ([$panel cget -number])" } else { itk_component add panel { set panel [frame $w_.panel] } if { "$itk_option(-panel_orient)" == "vertical" } { pack $panel -side left -fill y -before $w_.imagef } else { pack $panel -side top -fill x -before $w_.imagef } } # add the subwindows make_panel_subwindows $panel } # add the panel subwindows protected method make_panel_subwindows {panel} { switch -exact -- $itk_option(-panel_layout) { saoimage { make_panel_info $panel make_pan_window $panel make_zoom_window $panel } reverse { make_pan_window $panel make_panel_info $panel make_zoom_window $panel } default { make_zoom_window $panel make_panel_info $panel make_pan_window $panel } } } # make the panel info subwindow protected method make_panel_info {panel} { # add info panel feedback "info panel..." # Info panel, RtdImagePanel(n) object used to display image controls itk_component add info { rtd::RtdImagePanel $panel.info \ -image $this \ -state disabled \ -panel_orient $itk_option(-panel_orient) \ -min_scale $itk_option(-min_scale) \ -max_scale $itk_option(-max_scale) \ -shorthelpwin $itk_option(-shorthelpwin) \ -borderwidth 3 -relief groove } if { "$itk_option(-panel_orient)" == "vertical" } { pack $itk_component(info) -side top -fill y -expand 1 } else { pack $itk_component(info) -side left -fill both -expand 1 } # add an item to control the grid size if {$itk_option(-with_grid)} { make_grid_item } # flash background color of object label for real-time events config -cameraPreCmd "$itk_component(info) flash 1" \ -cameraPostCmd "$itk_component(info) flash 0" } # update camera status display public method updateCameraStatus {camera} { if {[info exists itk_component(info)]} { $itk_component(info) updateCameraStatus $camera [$image_ camera attach] } } # make the pan window protected method make_pan_window {panel} { # panning window if {$itk_option(-with_pan_window)} { feedback "pan window..." # pan window (RtdImagePan(n) widget). itk_component add pan { rtd::RtdImagePan $panel.pan \ -target_image $this \ -width $itk_option(-pan_width) \ -height $itk_option(-pan_height) \ -usexshm $itk_option(-usexshm) \ -usexsync $itk_option(-usexsync) \ -verbose $itk_option(-verbose) \ -borderwidth 3 \ -relief groove } if { "$itk_option(-panel_orient)" == "vertical" } { pack $itk_component(pan) -side top } else { pack $itk_component(pan) -side left -fill y } } } # make the zoom window in the panel protected method make_zoom_window {panel} { if {! $itk_option(-with_zoom_window)} { return } feedback "zoom window..." # set on/off by default global ::$panel.zoom.dozoom set $panel.zoom.dozoom $itk_option(-dozoom) if {$itk_option(-use_zoom_view)} { # Zoom window (RtdImageZoomView(n) widget) itk_component add zoom { rtd::RtdImageZoomView $panel.zoom \ -target_image $this \ -verbose $itk_option(-verbose) \ -width $itk_option(-zoom_width) \ -height $itk_option(-zoom_height) \ -factor $itk_option(-zoom_factor) \ -propagate $itk_option(-zoom_view_propagate) \ -usexshm $itk_option(-usexshm) \ -usexsync $itk_option(-usexsync) \ -borderwidth 3 \ -relief groove } } else { # Zoom window: this version is not really supported any more... itk_component add zoom { rtd::RtdImageZoom $panel.zoom \ -target_image $this \ -width $itk_option(-zoom_width) \ -height $itk_option(-zoom_height) \ -factor $itk_option(-zoom_factor) \ -usexshm $itk_option(-usexshm) \ -usexsync $itk_option(-usexsync) \ -borderwidth 3 \ -relief groove } } if { "$itk_option(-panel_orient)" == "vertical" } { pack $itk_component(zoom) -side top -fill both -expand 0 } else { pack $itk_component(zoom) -side left -fill both -expand 0 } # tell the base class to use this zoom window when entered config -zoomwin $itk_component(zoom) } # create an item in the panel to control the ra,dec grid size protected method make_grid_item {} { # Frame at lower right for the grid checkbutton and size entry itk_component add gridf { set gridf [frame [$itk_component(info) component lrframe].gridf] } pack $gridf -anchor se -padx 1m -pady 1m -fill x # Check button for optional WCS grid itk_component add gridcheck { checkbutton $gridf.gridcheck \ -text "Grid:" \ -font [$itk_component(info) cget -labelfont] \ -variable $w_.grid -command [code $this show_grid $w_.grid] } pack $itk_component(gridcheck) -side left # LabelEntry for grid size itk_component add gridsize { LabelEntry $gridf.gridsize \ -value 60 \ -relief sunken \ -anchor w \ -valuewidth [$itk_component(info) cget -valuewidth] \ -valuefont [$itk_component(info) cget -valuefont] \ -command [code $this set_grid_size] \ -validate real } pack $itk_component(gridsize) -side left add_short_help $itk_component(gridcheck) \ {Grid: Toggle the visibility of the image ra,dec grid} add_short_help $itk_component(gridsize) \ {Grid Size: set space between grid lines in arcseconds of degrees} $itk_component(gridsize) configure -state disabled } # toggle the visibility of the control panel # (argument is the name of the checkbutton variable to use) public method hide_control_panel {variable} { set panel $itk_component(panel) global ::$variable ::$panel.zoom.dozoom if {[set $variable]} { # hide the panel, turn off the zoom window, keep the canvas width set zoom_state_ [set $panel.zoom.dozoom] set $panel.zoom.dozoom 0 set w [winfo width $canvas_] pack forget $panel $canvas_ config -width $w } else { # show the panel, restore the zoom window set $panel.zoom.dozoom $zoom_state_ if { "$itk_option(-panel_orient)" == "vertical" } { pack $panel -side left -fill y -before $w_.imagef } else { pack $panel -side top -fill x -before $w_.imagef } } } # toggle the visibility of the image ra,dec grid # (argument is the name of the checkbutton variable to use) public method show_grid {variable} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } set grid_var_ $variable global ::$grid_var_ if {[set $grid_var_]} { # show the grid if {![winfo exists $w_.grid]} { rtd::RtdImageGrid $w_.grid -image $this } $w_.grid show $itk_component(gridsize) configure -state normal -value [$w_.grid size] } else { # don't show the grid if {[winfo exists $w_.grid]} { $w_.grid hide } $itk_component(gridsize) configure -state disabled } } # set the size of the grid (space between lines) in arc seconds of dec degrees public method set_grid_size {size} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } if {[winfo exists $w_.grid]} { global ::$grid_var_ if {[info exists $grid_var_] && [set $grid_var_]} { $w_.grid configure -size $size $w_.grid reset $itk_component(gridsize) configure -state normal -value [$w_.grid size] } } } # add a generated image to display the colors in the colormap protected method make_colorramp {} { # color ramp widget (RtdImageColorRamp(n)) itk_component add colorramp { rtd::RtdImageColorRamp $w_.colorramp \ -height $itk_option(-colorramp_height) \ -usexshm $itk_option(-usexshm) \ -viewmaster $image_ } pack $itk_component(colorramp) -side bottom -fill x -before $w_.imagef } # This method is redefined here to update the scale display. # resize the image and the canvas graphics by the given integer factors # (1 is no scale, -2 = 50%, 2 = 200% etc...) public method scale {x y} { RtdImage::scale $x $y if {[info exists itk_component(zoom)]} { $itk_component(zoom) scale } $itk_component(info) component trans update_trans } # add the given increment to the current zoom factor and re-scale # the image public method inc_zoom {inc} { $itk_component(info) component trans inc_zoom $inc } # this method is called by the image code whenever a new image is loaded. # (for real-time updates, see camera command) protected method new_image_cmd {} { RtdImage::new_image_cmd # display HDU list, if there are multiple HDUs update_fits_hdus if {[info exists itk_component(zoom)]} { $itk_component(zoom) zoom $itk_component(zoom) scale } if {! [$image_ isclear]} { $itk_component(info) config -state normal } autoscale $itk_component(info) updateValues if {[winfo exists $w_.cut]} { $w_.cut update_graph } if {[winfo exists $w_.spectrum]} { destroy $w_.spectrum } if {[winfo exists $w_.draw]} { $w_.draw set_menu_state normal } if {[winfo exists $w_.wcs_info]} { $w_.wcs_info configure -values [$image_ wcsset] } if {[winfo exists $w_.fits_header]} { view_fits_header } if {[winfo exists $w_.fits_hdu_header]} { if { [$image_ hdu count] < 1 } { destroy $w_.fits_hdu_header } else { view_fits_hdu_header } } if {[winfo exists $w_.grid]} { # update grid, if on global ::$grid_var_ if {[info exists $grid_var_] && [set $grid_var_]} { # reset size, since new image may have a much different scale # setting size to {} means it will be chosen based on the image size... $w_.grid configure -size {} $w_.grid reset $itk_component(gridsize) configure -state normal -value [$w_.grid size] } } } # open and load a new FITS image file via file name dialog public method open {{dir "."} {pattern "*.*fit*"}} { if { "$dir" == "." && "[cget -image_directory]" != "" } { set dir [cget -image_directory] } set file [filename_dialog $dir $pattern $w_] if {"$file" != ""} { if {[file isfile $file]} { detach_camera config -file $file } else { error_dialog "There is no file named '$file'" $w_ } } } # view the FITS header in a text window public method view_fits_header {} { set s [$image_ object] if {"$s" == ""} { set s [$image_ cget -file] } if {"$s" == ""} { set s "FITS Header" } else { set s "FITS Header for $s" } set existed [winfo exists $w_.fits_header] utilReUseWidget util::TextDialog $w_.fits_header \ -bitmap {} \ -textwidth 80 \ -buttons "Close" \ -modal 0 \ -text "$s" \ -title "$s" \ -messagewidth 5i \ -contents [$image_ fits get] if {! $existed} { $w_.fits_header activate } } # view the FITS HDU headers public method view_fits_hdu_header {} { if { [$image_ hdu count] < 1 && "[$image_ object]" == "[cget -camera]"} { warning_dialog "No FITS header available for real-time images" $w_ return } utilReUseWidget rtd::RtdImageFitsHeader $w_.fits_hdu_header \ -image $this \ -shorthelpwin $itk_option(-shorthelpwin) update idletasks $w_.fits_hdu_header activate } # pop up a dialog to display/edit the basic world coordinate # parameters public method wcs_info_dialog {} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } utilReUseWidget util::EntryForm $w_.wcs_info \ -title "Basic WCS Information" \ -labels [list \ "Center right ascension (H:M:S):" \ "Center declination (D:M:S)" \ "Number of arcseconds per pixel:" \ "Reference pixel X coordinate:" \ "Reference pixel Y coordinate:" \ "Number of pixels along x-axis:" \ "Number of pixels along y-axis:" \ "Rotation angle (clockwise positive) in degrees:" \ "Equinox (1950 and 2000 supported):" \ "Epoch (for FK4/FK5 conversion, no effect if 0):" \ "Projection:" ] \ -values [$image_ wcsset] \ -scroll 0 \ -command [code $this set_wcs_info] } # This command is called with a list of values from wcs_info_dialog above # to set new world coordinates information for the current image. public method set_wcs_info {list} { if { "[lindex $list 10]" == "ZPN" } { # $image_ wcsset $list crashes for ZPN projection (bug in WCSLIB?) error_dialog "Setting WCS information for ZPN projection is not yet supported." return } if {[catch "$image_ wcsset $list" msg]} { error_dialog $msg $w_ } } # pop up a window to edit the image colors public method set_colors {} { # note that this window must be shared by all instances utilReUseWidget rtd::RtdImageColors .colors \ -image $this \ -shorthelpwin $itk_option(-shorthelpwin) \ -cmap_dir $itk_option(-cmap_dir) \ -cmap_suffix $itk_option(-cmap_suffix) \ -itt_suffix $itk_option(-itt_suffix) \ -default_cmap $itk_option(-default_cmap) \ -default_itt $itk_option(-default_itt) .colors update_allocated wm transient .colors [winfo toplevel $w_] } # Update the settings in the color popup to reflect those of the image public method update_color_window {} { if {[winfo exists .colors]} { .colors update_values $image_ } } # This method is called when the colormap has been changed to # update the display public method update_colors {} { if {$itk_option(-with_colorramp)} { $itk_component(colorramp) update_colors } } # pop up a window to control bias subtraction public method set_bias {} { # note that this window must be shared by all instances utilReUseWidget rtd::RtdImageBias .bias \ -image $this \ -shorthelpwin $itk_option(-shorthelpwin) \ -dsplnr [[winfo toplevel $w_] cget -number] \ -command [code $itk_component(info) updateValues] wm transient .bias [winfo toplevel $w_] } # clear the current image display and remove an windows that # access it (extend parent class version) public method clear {} { RtdImage::clear $itk_component(info) config -state disabled if {[winfo exists $w_.cut]} { destroy $w_.cut } if {[winfo exists $w_.draw]} { $w_.draw set_menu_state disabled wm withdraw $w_.draw } if {[winfo exists $w_.grid]} { $w_.grid hide $itk_component(gridsize) configure -state disabled } } # this method is called at startup to give feedback while building the interface public method feedback {msg} { eval $itk_option(-feedback) [list $msg] } # reopen file and update HDU's public method reopen {} { rtd::RtdImage::reopen update_fits_hdus } # display a popup window listing the HDUs in the current image, if any public method display_fits_hdus {} { if {[catch {set n [$image_ hdu count]}]} { set n 0 } if {$n <= 1} { warning_dialog "There are no FITS extensions" $w_ return } utilReUseWidget rtd::RtdImageHduChooser $w_.hdu \ -image $this \ -shorthelpwin $itk_option(-shorthelpwin) \ -verbose $itk_option(-verbose) } # Update the popup window listing the HDUs in the current image public method update_fits_hdus {} { if {[catch {set n [$image_ hdu count]}]} { set n 0 } # display and hide window automatically as needed if {[winfo exists $w_.hdu]} { if {$n > 1} { after idle [code $this show_hdu] } else { after idle "destroy $w_.hdu" } } else { # if there is more than one HDU, display the HDU select window if {$n > 1} { display_fits_hdus } } } public method show_hdu {} { if {[winfo exists $w_.hdu]} { $w_.hdu show_hdu_list } else { display_fits_hdus } } # This method is redefined here to update the scale display when # 'autoscale' is set public method maybe_center {} { rtd::RtdImage::maybe_center maybe_autoscale } # This method is redefined here to update the scale display when # 'autoscale' is set public method rotate {bool} { rtd::RtdImage::rotate $bool maybe_autoscale } # auto scale image to the max. visible size public method autoscale { {variable ""} } { if {"$variable" != ""} { global ::$variable set autoscale_ [set $variable] } if {! [catch {$itk_component(info) component trans} trans]} { if { $autoscale_ } { foreach compo "larger smaller choose" { catch {$trans component $compo config -state disabled} } } else { $trans config -state normal } } maybe_autoscale } # if the image does not fill the visible canvas, scale it # # XXX allan: don't use $image_ config -fillwidth ..., # need to use RtdImage itcl widget so graphics are updated # to use the new scale. public method maybe_autoscale {} { if { [$image_ isclear] || ! $autoscale_} { $image_ configure -fillwidth 0 -fillheight 0 } else { set cw [winfo width $canvas_] set ch [winfo height $canvas_] if {[$image_ rotate]} { lassign "$cw $ch" ch cw } #$image_ configure -fillwidth $cw -fillheight $ch fill_to_fit $cw $ch center } } # Use this method instead of $image_ configure -fillwidth $cw -fillheight $ch # so that graphics transformations are handled correctly. # The arguments are the dimensions of the image canvas. protected method fill_to_fit {cw ch} { # Fit to all items on the canvas, not just the image. lassign [$canvas_ bbox all] x0 y0 x1 y1 $image_ convert coords $x0 $y0 canvas x0 y0 image $image_ convert coords $x1 $y1 canvas x1 y1 image set w [expr int(abs($x1-$x0))] set h [expr int(abs($y1-$y0))] set factor [expr {min(150,min($cw/$w, $ch/$h))}] if {$factor == 0} { set factor [expr {-max(($w-1)/$cw+1, ($h-1)/$ch+1)}] if {$factor >= -1} { set factor 1 } } scale $factor $factor } # -- options -- # Panel layout order: set to one of {saoimage reverse default} # to change the layout ordering of the panel windows. # "saoimage" puts the info first, followed by pan and zoom, # "reverse" reverses the default order, which is {zoom info pan}. itk_option define -panel_layout panel_layout Panel_layout {} # Panel orient: one of {horizontal vertical} (default: horizontal) itk_option define -panel_orient panel_orient Panel_orient {} # width of zoom window itk_option define -zoom_width zoom_width Zoom_width 152 # height of zoom window itk_option define -zoom_height zoom_height Zoom_height 152 # zooming factor itk_option define -zoom_factor zoom_factor Zoom_factor 4 # width of panning window itk_option define -pan_width pan_width Pan_width 152 # height of panning window itk_option define -pan_height pan_height Pan_height 152 # height of the colorramp subwindow itk_option define -colorramp_height colorramp_height Colorramp_height 12 # flag: if true (default), show the color ramp window itk_option define -with_colorramp with_colorramp With_colorramp 1 # flag: if true, make zoom window a view of the main image # otherwise do a faster, but less accurate (by shrunken images) zoom # from the xImage itk_option define -use_zoom_view use_zoom_view Use_zoom_view 1 # flag: if true, changes in main image scale will propagate to the zoom window, # otherwise controls are displayed so the user can manually change it (ZoomView only) itk_option define -zoom_view_propagate zoom_view_propagate Zoom_view_propagate 1 # flag: if true (default) make a zoom window itk_option define -with_zoom_window with_zoom_window With_zoom_window 1 # flag: if true (default) make a panning window itk_option define -with_pan_window with_pan_window With_pan_window 1 # flag: if true, turn on zoom window itk_option define -dozoom dozoom Dozoom 1 # default cmap file itk_option define -default_cmap default_cmap Default_cmap {real} # default ITT file itk_option define -default_itt default_itt Default_itt {ramp} # default port for remote connections (0 means system chooses a port) itk_option define -port port Port 0 # command used to display feedback during startup itk_option define -feedback feedback Feedback "#" # option to warp the mouse pointer itk_option define -with_warp with_warp With_warp 0 # option to include grid button (default to off, since it doesn't work # well yet on some images) itk_option define -with_grid with_grid With_grid 0 # Floating panel option (for small displays). itk_option define -float_panel float_panel Float_Panel 0 # default scaling factor itk_option define -xscale xscale Xscale 1 itk_option define -yscale yscale Yscale 1 itk_option define -camera camera Camera {} # Default directory for loading images itk_option define -image_directory image_directory Image_directory {} # -- protected vars -- # saved zoom button state protected variable zoom_state_ 0 # cut values frame protected variable cut_ # name of trace var for grid protected variable grid_var_ # auto scale image protected variable autoscale_ 0 } skycat-3.1.2-starlink-1b/rtd/library/RtdImageCut.tcl000066400000000000000000000363471215713201500222630ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImageCut.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageCut.tcl - itcl widget for setting cut levels for an RtdImage widget # # See man page RtdImageCut(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01/06/95 Created # # P. Biereichel 09/10/97 Enter cut sets also scale range # # Allan Brighton 24/03/98 Added $initialized_ variable to fix bug # when image is blank (generated for plotting). # Added Peter Draper's (Starlink) fixes, # bindings, -resolution argument. # # Allan Brighton 10/04/98 Moved constructor code to "init" method for # easier subclassing. # Removed bg_set and the code for setting the # color on the "Set" button, as it didn't always # work correctly. # Removed the calls to "update_increment", since it # caused endless event looping in some cases. # (The event code is getting too complex to follow...) itk::usual RtdImageCut {} # This widget displays a toplevel window containing a plot of the pixel # value distribution in the target image and buttons and scales for # manipulating the image cut levels. The cut levels are two values: the # lowest and highest pixel values considered when color scaling the # image, i.e.: mapping image pixel values to color values, and are used # to filter out noise and other extreme values in the image. # # The plot displayed uses the rtdimage "getdist" subcommand to get the # pixel value distribution. This is an array of values that specify, for # example, how many pixel values are between 0 and 100, between 100 and # 200, and so on. This information can also be used to set the cut levels, # by specifying a percent of the total number of pixels that should be within # the cut levels. # # A second, faster algorithm is supported by the "Median Filter" button. # This is a standard algorithm that works very fast to determine # reasonable cut levels. # # After setting the cut levels, either manually or by one of the # buttons, the new pixel value distribution is displayed. The plotting # is done directly from the rtdimage C++ code to the BLT graph over its # C interface. itcl::class rtd::RtdImageCut { inherit util::TopLevelWidget # constructor: create a new instance of this class constructor {args} { eval itk_initialize $args } # destructor - clean up when deleted destructor { global ::tcl_version if {$tcl_version >= 8.0} { blt::vector destroy $xVector_ $yVector_ } } # called after constructors have run method init {} { wm minsize $w_ 10 10 wm title $w_ "Cut Levels ($itk_option(-number))" wm iconname $w_ "Cut Levels ($itk_option(-number))" # get internal image handle set image_ [$itk_option(-image) get_image] make_graph make_controls make_buttons make_short_help incr initialized_ update_graph 0 } # add a short help window protected method make_short_help {} { # TopLevelWidget::make_short_help add_short_help $itk_component(graph) \ {Graph: shows distribution of pixel values in image \ {bitmap b1} ... {bitmap b1} = Zoom in, {bitmap b3} = Zoom out, Cancel zoom} add_short_help $itk_component(percent) \ {Auto set: {bitmap b1} = set so that given percent of pixels are within cut levels} add_short_help [$itk_component(lowcut) component scale] \ {Low cut: {bitmap dragb1} = adjust low cut value} add_short_help [$itk_component(lowcut) component entry] \ {Low cut: enter low cut value and set low cut scale range} add_short_help [$itk_component(highcut) component scale] \ {High cut: {bitmap dragb1} = adjust high cut value} add_short_help [$itk_component(highcut) component entry] \ {High cut: enter high cut value and set high cut scale range} add_short_help $itk_component(set) \ {Set: {bitmap b1} = set cut levels to selected values} add_short_help $itk_component(reset) \ {Reset: {bitmap b1} = apply min, max to set cut levels} add_short_help $itk_component(median) \ {Auto Set Cut Levels: {bitmap b1} = apply median filtering algorithm to set cut levels} add_short_help $itk_component(update) \ {Update: {bitmap b1} = update pixel value distribution (e.g. after a real-time image event)} add_short_help $itk_component(close) \ {Close: {bitmap b1} = close this window} } # make the graph subwindow protected method make_graph {} { global ::tcl_version # BLT graph widget for displaying pixel distribution itk_component add graph { blt::graph $w_.graph \ -width 4i \ -height 3i \ -borderwidth 2 \ -relief groove \ -title "Pixel Value Distribution" } { } set graph_ $w_.graph pack $itk_component(graph) \ -fill both -expand 1 -padx 1m -pady 1m $graph_ xaxis configure -title {} -command [code $this notify_blt_zoom] $graph_ yaxis configure -title {} # tcl8/blt2.4f vector names ust start with a letter, no dots... # Someone also changed the default symbol to circle also - why? regsub -all {\.} v$graph_.xVector _ xVector_ regsub -all {\.} v$graph_.yVector _ yVector_ if {$tcl_version >= 8.0} { $graph_ legend config -hide 1 if {![info exists $xVector_]} { blt::vector create $xVector_ $yVector_ } set symbol {} } else { global ::$xVector_ ::$yVector_ $graph_ legend config -mapped 0 if {![info exists $xVector_]} { blt::vector $xVector_ $yVector_ } set symbol none } $graph_ element create elem -xdata $xVector_ -ydata $yVector_ -symbol $symbol # plot the distribution of pixel values if {[catch {$image_ graphdist $graph_ elem $itk_option(-num_points) \ $xVector_ $yVector_} msg]} { #warning_dialog $msg } # add BLT features ::Blt_ZoomStack $graph_ ::Blt_ActiveLegend $graph_ ::Blt_ClosestPoint $graph_ } # make the control panel protected method make_controls {} { # frame containing scale widgets to adjust cut levels itk_component add scales { frame $w_.scales -borderwidth 2 -relief groove } pack $itk_component(scales) \ -side top -fill x -padx 1m -pady 1m # LabelChoice(n) widget displaying percent values for setting cut levels itk_component add percent { util::LabelChoice $itk_component(scales).percent \ -text "Auto Set:" \ -choice "90% 95% 98% 99% 99.5% 100%" \ -value "" \ -command [code $this set_by_percent] } foreach lab "Low High" { set el [string tolower $lab] # Lowscale and Highscale component frames itk_component add ${el}scale { frame $itk_component(scales).${el}scale -borderwidth 2 -relief groove } global ::$w_.${el}cut # Lowcut and Highcut components (LabelEntryScale(n) widgets) # for displaying and adjusting the cut levels itk_component add ${el}cut { util::LabelEntryScale $itk_component(${el}scale).${el}cut \ -text $lab \ -valuewidth 8 \ -show_arrows 1 \ -validate real \ -value 0 \ -command [code $this setb_${el}cut 0] \ -entrycommand [code $this setb_${el}cut 1] } $itk_component(${el}cut) component scale config -variable $w_.${el}cut pack $itk_component(${el}cut) -padx 1m } blt::blttable $itk_component(scales) \ $itk_component(lowscale) 1,0 -anchor w -fill x -padx 1m -pady 1m \ $itk_component(highscale) 1,1 -anchor w -fill x -padx 1m -pady 1m \ $itk_component(percent) 2,0 -anchor c -fill x -columnspan 2 -padx 1m \ } # make the button frame at the bottom of the window protected method make_buttons {} { # Tk frame for buttons itk_component add buttons { frame $w_.buttons -borderwidth 2 -relief groove } pack $itk_component(buttons) \ -side top -fill x -padx 1m -pady 1m add_button set Set set_cutlevels add_button reset Reset reset_cutlevels add_button median "Median Filter" set_by_median add_button update Update update_graph add_button close Close quit blt::blttable $itk_component(buttons) \ $itk_component(set) 1,0 -anchor w -fill x -padx 1m -pady 2m \ $itk_component(reset) 1,1 -anchor w -fill x -padx 1m -pady 2m \ $itk_component(median) 1,2 -anchor w -fill x -padx 1m -pady 2m \ $itk_component(update) 1,3 -anchor w -fill x -padx 1m -pady 2m \ $itk_component(close) 1,4 -anchor w -fill x -padx 1m -pady 2m } # add a button to the buttons frame public method add_button {compo text command} { # Button components: set, reset, median, update, or close itk_component add $compo { button $itk_component(buttons).$compo \ -text $text \ -command [code $this $command] } } # update the graph after a new image has been loaded or the image has been # modified public method update_graph {{modimg 1}} { # no image is loaded ? if {[$image_ isclear] || ! $initialized_} { quit return } if {$modimg} { lassign [$image_ cut] low high } else { set low_ [set low [$image_ min]] entry_value lowcut $low set high_ [set high [$image_ max]] entry_value highcut $high } if {$low > $high} { lassign "$low $high" high low } lassign [get_cuts] plow phigh if {$plow != $low || $phigh != $high} { $itk_component(percent) config -value "" } # adapt new scale range setb_lowcut [expr {$low <= $low_}] $low setb_highcut [expr {$high >= $high_}] $high update # plot the distribution of pixel values if {[catch { $image_ graphdist $graph_ elem $itk_option(-num_points) \ $xVector_ $yVector_} msg]} { #warning_message $msg } update_increment } # return the current low/high cut values public method get_cuts {} { set low [$itk_component(lowcut) get] set high [$itk_component(highcut) get] if {"$low" == ""} { set low [$image_ min] } if {"$high" == ""} { set high [$image_ max] } return "$low $high" } # this method is called when blt changes the tick labels after a zoom protected method notify_blt_zoom {pathname tickvalue} { if {[$image_ isclear] || ! $initialized_} { quit return } set min [$graph_ xaxis cget -min] set max [$graph_ xaxis cget -max] lassign [get_cuts] low high if {$min != $low || $max != $high} { setb_cut 0 $min $max } return $tickvalue } # update xaxis after rescaling protected method update_xaxis {{value 0}} { lassign [get_cuts] low high if {$low >= $high} { return } set clow [$graph_ xaxis cget -min] set chigh [$graph_ xaxis cget -max] if {$low != $clow || $high != $chigh} { $graph_ xaxis configure -min $low -max $high } } # set low and high cut protected method setb_cut {flg low high} { setb_lowcut $flg $low setb_highcut $flg $high } # write value into entry field protected method entry_value {compo value} { set w [$itk_component($compo) component entry] $w delete 0 end $w insert 0 $value } # update the increment for the slider buttons depending on the range # XXX not currently used - problems with looping in event handlers (allan) protected method update_increment {} { lassign [get_cuts] low high set increment [expr {($high-$low)/100.0}] if {$increment <= 0} { return } set resolution $increment $itk_component(lowcut) configure -increment $increment \ -resolution $resolution $itk_component(highcut) configure -increment $increment \ -resolution $resolution } # set entry values of the lowcut scale widget and update scale widgets protected method setb_lowcut {setlow value} { lassign [get_cuts] low high if {$value >= $high} { set value [expr {$high - 1}] } if {$setlow} { set low_ $value } entry_value lowcut $value update_cut $value $high } # set entry values of the highcut scale widget and update scale widgets protected method setb_highcut {sethigh value} { lassign [get_cuts] low high if {$value <= $low} { set value [expr {$low + 1}] } if {$sethigh} { set high_ $value } entry_value highcut $value update_cut $low $value } # update min, max values of the lowcut and highcut scale widgets protected method update_cut {low high} { foreach el "lowcut highcut" { update_$el $low $high } update_xaxis } # update min, max values of the lowcut scale widget protected method update_lowcut {low high} { global ::$w_.lowcut set from $low_ set to [expr {$high - 1.0}] if {$from > $low} { set from $low } if {$to < $low} { set to $low } $itk_component(lowcut) config -from $from -to $to set $w_.lowcut $low } # update min, max values of the highcut scale widget protected method update_highcut {low high} { global ::$w_.highcut set from [expr {$low + 1.0}] set to $high_ if {$from > $high} { set from $high } if {$to < $high} { set to $high } if {$from == $to} { set from [expr {$from - 1.0}] } $itk_component(highcut) config -from $from -to $to set $w_.highcut $high } # set the cut levels in the image protected method set_cutlevels {} { lassign [get_cuts] low high busy {$image_ cut $low $high} if {"$itk_option(-command)" != ""} { eval $itk_option(-command) } $itk_component(percent) config -value "" } # reset the cut levels to the original min/max values public method reset_cutlevels {} { set low [$image_ min] set high [$image_ max] busy {$image_ cut $low $high} setb_cut 1 $low $high $itk_component(percent) config -value 100 if {"$itk_option(-command)" != ""} { eval $itk_option(-command) } } # automatically set the cut values by percent of distribution # that should be inside the cut levels public method set_by_percent {percent} { scan $percent "%d" percent busy {$image_ autocut -percent $percent} lassign [$image_ cut] low high setb_cut 1 $low $high if {"$itk_option(-command)" != ""} { eval $itk_option(-command) } } # automatically set the cut values by median filtering public method set_by_median {} { busy {$image_ autocut} lassign [$image_ cut] low high setb_cut 1 $low $high if {"$itk_option(-command)" != ""} { eval $itk_option(-command) } $itk_component(percent) config -value "" } # -- public vars -- # target RtdImage itcl class object itk_option define -image image Image {} # number of points to plot itk_option define -num_points num_points Num_points {2048} # tcl command to evaluate when cut levels are changed itk_option define -command command Command {} # -- protected vars -- # internal rtdimage object protected variable image_ # name of graph widget protected variable graph_ # lowest value to display (image(min) or set by user) protected variable low_ 0 # highest value to display (image(max) or set by user) protected variable high_ 1 # set to 1 after widget has been initizlized protected variable initialized_ 0 # x vector for graph protected variable xVector_ # y vector for graph protected variable yVector_ } skycat-3.1.2-starlink-1b/rtd/library/RtdImageFitsHeader.tcl000066400000000000000000000251371215713201500235410ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: RtdImageFitsHeader.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageFitsHeader.tcl - Itcl widget for displaying FITS header HDU's # # See man page RtdImageFitsHeader(n) for a complete description. # # who when what # ---------- --------- ----------------------------------------------------- # pbiereic 14/08/01 Created # pbiereic 17/02/03 fixed problems with tabnotebook, packing order # and labels of tabsets # pdraper 05/04/06 Treat HISTORY like COMMENT # pdraper 20/02/07 Formatting changes: keep empty lines (one anyway) # and print blank COMMENT/HISTORY lines with blanks, do # not fake that they start with COMMENT/HISTORY. itk::usual RtdImageFitsHeader {} # RtdImageFitsHeader is an itcl widget for displaying the FITS header of all # Header Data Units (HDU's) contained in a FITS file. The user can view the # FITS header in different ways, print it, search for keyword etc. # RtdImageFitsHeader uses public methods of class util::TableList itcl::class rtd::RtdImageFitsHeader { inherit util::TopLevelWidget constructor {args} { eval itk_initialize $args wm protocol $w_ WM_DELETE_WINDOW [code $this quit] } # This method is called after the options have been evaluated. protected method init {} { package require Iwidgets # set default table configuration parameters set tconfig_(sort_cols) "" set tconfig_(sort_order) "" set tconfig_(Keyword) 1 set tconfig_(Value) 1 set tconfig_(Comment) 1 add_menubar make_notebook $w_ add_buttons $w_ # tabnotebook's configure event doesn't work (oszillates) bind [$tabnotebook_(w) component canvas] {} # pack the button frame first to ensure that it # doesn't get obscured when the window is resized (shrinked). pack $itk_component(buttons) -side bottom -fill both -expand 0 pack $tabnotebook_(w) -fill both -expand 1 -side top } # Quit this widget public method quit { } { set activated_ 0 destroy $w_ } # add the menubar at the top of the window protected method add_menubar {} { TopLevelWidget::add_menubar # add menubuttons and menus set m [add_menubutton File] add_menuitem $m command "Print..." \ {Print all FITS tables} \ -command [code $this print] add_menuitem $m command "Close" \ {Close this window} \ -command [code $this quit] set m [add_menubutton Header] add_menuitem $m cascade "Sort..." \ {Sort FITS header} \ -menu [menu $m.sort] global $w_.sort set $w_.sort 2 $m.sort add radiobutton -label "Keyword - increasing" \ -command [code $this sort Keyword increasing] \ -variable $w_.sort -value 0 $m.sort add radiobutton -label "Keyword - decreasing" \ -command [code $this sort Keyword decreasing] \ -variable $w_.sort -value 1 $m.sort add radiobutton -label "No sort" \ -command [code $this sort "" ""] \ -variable $w_.sort -value 2 add_menuitem $m cascade "Show / Hide" \ {Configure layout of table} \ -menu [menu $m.show] global $w_.show_keyword $w_.show_value $w_.show_comment set $w_.show_keyword 1 $m.show add checkbutton -label "Keyword" \ -command [code $this show Keyword $w_.show_keyword] \ -variable $w_.show_keyword -onvalue 1 -offvalue 0 set $w_.show_value 1 $m.show add checkbutton -label "Value" \ -command [code $this show Value $w_.show_value] \ -variable $w_.show_value -onvalue 1 -offvalue 0 set $w_.show_comment 1 $m.show add checkbutton -label "Comment" \ -command [code $this show Comment $w_.show_comment] \ -variable $w_.show_comment -onvalue 1 -offvalue 0 } # add the buttons protected method add_buttons { f } { itk_component add buttons { frame $f.buttons } itk_component add close { button $itk_component(buttons).close \ -text Close -width 8 \ -command [code $this quit] } itk_component add search { LabelEntry $itk_component(buttons).search \ -text Search -valuewidth 10 \ -command [code $this search] } pack $itk_component(search) -side left -fill x -expand 1 pack $itk_component(close) -side left -fill none -expand 0 } # Make the layout protected method make_notebook { f } { set tabnotebook_(w) [iwidgets::tabnotebook $f.tab \ -tabpos n -width 400 -height 500 \ -equaltabs false -raiseselect 1 \ -font $itk_option(-labelfont) \ -backdrop [$w_ cget -background]] add_short_help $f.tab \ {Drag {bitmap b2} = Drag mouse button 2 to scroll} } # Sort FITS header protected method sort { sort_cols sort_order } { set tconfig_(sort_cols) $sort_cols set tconfig_(sort_order) $sort_order loop i 0 $num_hdus_ { $tabnotebook_(table$i) config -sort_cols $sort_cols \ -sort_order $sort_order $tabnotebook_(table$i) new_info } } # Show / Hide table column protected method show { label var } { global $var set val [set $var] set tconfig_($label) $val loop i 0 $num_hdus_ { $tabnotebook_(table$i) set_option $label Show $val $tabnotebook_(table$i) new_info } } # Print current selected header protected method print { } { set idx [$tabnotebook_(w) index select] set tbl $tabnotebook_(table$idx) busy { set w $w_.tblprint if {[winfo exists $w]} { $w config -table $tbl wm deiconify $w } else { TableListPrint $w -table $tbl -printcmd [$tbl cget -printcmd] } } } # Search and highlight pattern protected method search { string } { $itk_component(search) select set idx [$tabnotebook_(w) index select] set tbl $tabnotebook_(table$idx) set listbox [$tbl component listbox] set string [string tolower $string] set start_idx $search_idx_ set search_idx_ 0 if { "$string" != "$search_str_" } { set start_idx 0 set search_str_ $string } set end_idx [$listbox index end] if { $start_idx >= $end_idx } { set start_idx 0 } set length [string length [$listbox get 0]] loop n $start_idx $end_idx { set row [string tolower [$listbox get $n]] if {[catch {regexp -indices $string $row indices} idx] } { continue } if { $idx > 0 } { $tbl select_row $n lassign $indices i1 i2 set i1 [expr {double($i1) + ($i2 - $i1) / 2.}] lassign [$listbox bbox $n] x0 y0 w h set offs [expr {double($length) / $w * [winfo width $w_] / 2.0}] set i1 [expr {$i1 - $offs}] $listbox xview moveto [expr {(1.0 - (double($length - $i1) / $length))}] set search_idx_ [incr n] break } } } # Set title protected method set_title { } { set s [$image_ object] if {"$s" == ""} { set s [$image_ cget -file] } if {"$s" == ""} { set s "FITS Header" } else { set s "FITS Header for $s" } wm title $w_ $s wm iconname $w_ $s return $s } # Activate this widget public method activate { } { set activated_ 1 set title [set_title] set w $tabnotebook_(w) set hdu_count [$image_ hdu count] if { $hdu_count > 0 && "[$image_ cget -file]" == "$file_" } { show_hdu_header [$image_ hdu] return } set file_ [$image_ cget -file] if { $num_hdus_ > 0 } { $w delete 0 [expr {$num_hdus_ - 1}] } set num_hdus_ $hdu_count set hlist [$image_ hdu list] set ExtName "HDU 1" loop i 0 $hdu_count { set hdu [expr {$i + 1}] set list [lindex $hlist $i] set tabnotebook_($i) [$w add -label $ExtName -gap overlap \ -command [code $this show_hdu_header [expr {$i + 1}]]] set ExtName " [expr {$hdu + 1}] " set child [$w childsite $i] set tabnotebook_(table$i) $child.tab$i # use TableList(n) widget for displaying the FITS header pack [util::TableList $child.tab$i \ -title $title \ -hscroll 1 -vscroll 1 \ -headings "Keyword Value Comment" \ -sort_cols $tconfig_(sort_cols) \ -sort_order $tconfig_(sort_order)] \ -fill both -expand 1 $tabnotebook_(table$i) set_option Keyword Show $tconfig_(Keyword) $tabnotebook_(table$i) set_option Value Show $tconfig_(Value) $tabnotebook_(table$i) set_option Comment Show $tconfig_(Comment) } show_hdu_header [$image_ hdu] } # Show HDU header info public method show_hdu_header { hdu } { set search_idx_ 0 if { [$image_ hdu count] < 1 || $hdu < 1 } { return } catch {$tabnotebook_(w) select [expr {$hdu -1}]} set idx [expr {$hdu - 1}] set w $tabnotebook_(table$idx) set fits [$image_ hdu fits $hdu] # TableList needs formatting... set lastblank 0 foreach line [split $fits "\n"] { set l [string trim $line] if {"$l" == "END"} { lappend info [list END {} {}] break } if { [lempty $l] } { if { ! $lastblank } { lappend info [list {} {} {}] } set lastblank 1 continue } set lastblank 0 set triple [get_kvc $line] if { [lempty $triple] } { set triple [list INVALID {} $line] } lappend info $triple } if { [info exists info] && ! [lempty $info] } { $w config -info $info } [$w component listbox] xview moveto 0.0 } # return a tcl list with keyword, value and comment (kvc) protected method get_kvc { line } { set key [string range $line 0 6] if { [lempty $key] || "$key" == "COMMENT" || "$key" == "HISTORY" } { return [list $key {} [string trim [string range $line 7 end]]] } lassign [split $line =] l1 l2 if { [lempty $l1] } { return "" } set key [string trim $l1] lassign [split $l2 /] l1 l2 l3 if { [info exists l3] && $l3 !={} } { # value = 'name/name' /comment? set l1 "$l1/$l2" set l2 "$l3" } set val [string trim $l1] set com [string trim $l2] return [list $key $val $com] } # -- options -- # target (main) RtdImage itcl widget itk_option define -image image Image {} { set image_ [$itk_option(-image) get_image] } # Font to use for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # -- protected vars -- # internal rtdimage object protected variable image_ # array for tabnotebook protected variable tabnotebook_ # array for table configuration protected variable tconfig_ # last file protected variable file_ "" # widget activated, bool protected variable activated_ 0 # number of HDU of last file protected variable num_hdus_ 0 # last serach index protected variable search_idx_ 0 # last serach string protected variable search_str_ "" } skycat-3.1.2-starlink-1b/rtd/library/RtdImageFrame.tcl000066400000000000000000000176001215713201500225510ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImageFrame.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageFrame.tcl - itcl widget for displaying a section of an rtdimage # at a given position in a canvas window # # See man page RtdImageFrame(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created # 23 Jun 96 assume rapid frame data has separate mem area # itk::usual RtdImageFrame {} # This widget is used to display rapid frames for an RtdImage widget. A # rapid frame is an instance of a RtdImage widget that displays a small # section of the main image and can be updated faster with real-time # images because it is smaller than the main image. # # The area in the main image being used for the rapid frame is marked # with one black and one white dashed rectangle. The rapid frame can be # moved or resized in in the same way as any other graphic objects by # dragging with the left mouse button over it or on one of the 8 resize # handles displayed around it when it is selected. One of the dashed # rectangles shows the current position of the rapid frame while the # other one shows the new position and size being set. # # Two types of rapid frames are supported. The first type is an # RtdImage "view" of the main image embedded into its canvas window at a # given x,y offset, so that it appears that main image is being updated # more frequently inside the dashed box. In this case, the rapid frame # is a separate rtdimage canvas image item in the same canvas with the # main image, but at a different offset. The second type of rapid frame # is displayed in a popup window and is implemented by the class # RtdImagePopup(n). # # Creating and manipulating a rapid frame usually involves communication # with the rtdServer and camera, to tell the camera to start sending # images at the given rate from the given area. Since this is very # application specific, you can arrange to have your own Tcl command # evaluated whenever a rapid frame is created, moved, resized or # deleted. See the RtdImage(n) -rapid_frame_command option for how to do # this. # # Note that currently, only one rapid frame is allowed at a time. # Creating a second one automatically deletes the first. This may be # changed in a future release. itcl::class rtd::RtdImageFrame { inherit util::FrameWidget # constructor: create a new instance of this class constructor {args} { eval itk_initialize $args } # this method is called from the base class (FrameWidget) after all # the options have been evaluated protected method init {} { # put image in target canvas # note: create in global namespace to avoid problems in C++ side set cmd \ [list image create rtdimage \ -name "rapidFrame" \ -displaymode 1 \ -usexshm $itk_option(-usexshm) \ -usexsync $itk_option(-usexsync) \ -verbose $itk_option(-verbose) \ -subsample $itk_option(-subsample)] set image_ [uplevel "#0" $cmd] set imageId_ [$canvas_ create image $itk_option(-xoffset) $itk_option(-yoffset) \ -image $image_ \ -anchor nw \ -tags $image_] # make sure the stacking order is correct $canvas_ raise $image_ $target_image_ $canvas_ raise $itk_option(-region_id) $image_ # create a dummy rect to get events for image set rectId_ [$canvas_ create rectangle \ $itk_option(-xoffset) $itk_option(-yoffset) \ [expr {$itk_option(-xoffset)+$itk_option(-width)-1}] \ [expr {$itk_option(-yoffset)+$itk_option(-height)-1}] \ -tags imagerect \ -fill black \ -stipple pat7] # add bindings for moving and resizing the rapid frame $draw_ add_object_bindings $rectId_ $itk_option(-region_id) $target_image_ view add $image_ 1 1 set frameId_ [$image_ frameid] # setup callbacks for moving and resizing image $draw_ add_notify_cmd $itk_option(-region_id) [code $this notify_cmd] notify_cmd resize # handle interaction between zoom window and rapid frame $canvas_ bind $rectId_ "+[code $target_image_ view enter $image_]" $canvas_ bind $rectId_ "+[code $target_image_ view leave $image_]" } # return the name of the underlying rtdimage object public method get_image {} { return $image_ } # destructor - clean up when deleted destructor { $canvas_ delete $imageId_ image delete $image_ $draw_ remove_notify_cmd $itk_option(-region_id) $draw_ delete_object $rectId_ $draw_ delete_object $itk_option(-region_id) } # This method is called (from the main image's CanvasDraw(n) widget) # whenever an embedded rapid frame is moved, resized or deleted. # If the "-command" option was given to this class, then that tcl command is # evaluated with the frameId, operation name (move, resize, delete) the x, y coords # and the width and height of the frame. public method notify_cmd {op args} { if {"$op" == "delete"} { if {"$itk_option(-command)" != ""} { eval "$itk_option(-command) $frameId_ $this $op 0 0 0 0" } delete object $this return 0 } lassign [$canvas_ bbox $itk_option(-region_id)] x0 y0 x1 y1 set w [expr {$x1-$x0+1}] set h [expr {$y1-$y0+1}] $canvas_ coords $imageId_ $x0 $y0 $canvas_ coords $rectId_ $x0 $y0 $x1 $y1 # note: we assume here that the rapid frame has its own memory area # starting at 0,0 $target_image_ view update $image_ 0 0 $w $h $x0 $y0 0 0 canvas if {"$itk_option(-command)" != ""} { eval "$itk_option(-command) $frameId_ $this $op $x0 $y0 $w $h" } } # -- public vars -- # target rtdimage itk_option define -target_image target_image Target_image {} { # get internal widget names for target image set target_image_ [$itk_option(-target_image) get_image] set canvas_ [$itk_option(-target_image) get_canvas] set draw_ [$itk_option(-target_image) component draw] } # canvas id of the (region) object used to position and move the image # in the canvas itk_option define -region_id region_id Region_id {} # X offset of image frame itk_option define -xoffset xoffset Xoffset 0 # Y offset of image frame itk_option define -yoffset yoffset Yoffset 0 # Width of image frame itk_option define -width width Width 0 # Height of image frame itk_option define -height height Height 0 # tcl command to be evaluated whenever the frame is created moved, # resized or deleted: 7 args will be appended: # # frameId = unique rapid frame id for use with rtdServer # # name = unique name for the frame # # op = {move,resize or delete} # # x, y = coords of upper left corner of frame in image # # width, height = dimensions of frame. itk_option define -command command Command {} # flag: if true, pan image is "subsampled" when shrinking, # otherwise the pixels are averaged itk_option define -subsample subsample Subsample 1 # X shared memory option itk_option define -usexshm useXshm UseXshm 1 # X synchronisation option itk_option define -usexsync useXsync UseXsync 1 # flag: if true, print diagnostic messages itk_option define -verbose verbose Verbose {0} # -- protected vars -- # target internal rtdimage protected variable target_image_ # CanvasDraw object, for setting up move, resize operations on embedded image protected variable draw_ # internal rtdimage for rapid frame protected variable image_ # canvas window containing rapid frame image protected variable canvas_ # canvas image id protected variable imageId_ # canvas id of rectangle used to get events for moving/resizing image protected variable rectId_ # rapid frame Id, needed to communicate with rtdServer protected variable frameId_ } skycat-3.1.2-starlink-1b/rtd/library/RtdImageGrid.tcl000066400000000000000000000146321215713201500224060ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: RtdImageGrid.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageGrid.tcl - itcl class to display an ra,dec grid over an image. # # See man page RtdImageGrid(n) for a complete description. # # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 24 Oct 96 Created itk::usual RtdImageGrid {} # RtdImageGrid is an itcl class to display an ra,dec grid over # the image. itcl::class rtd::RtdImageGrid { inherit util::FrameWidget # create a new object (the frame only ensures that this class # will be deleted along with its parent) constructor {args} { set canvas_ "" eval itk_initialize $args set image_ [$itk_option(-image) get_image] set canvas_ [$itk_option(-image) get_canvas] } # return ra + inc in deg protected method inc_ra {ra inc} { set ra [expr {$ra+$inc}] if {$ra >= 360} { set ra [expr {$ra-360}] } elseif {$ra < 0} { set ra [expr {360+$ra}] } return $ra } # return dec + inc in deg protected method inc_dec {dec inc} { set dec [expr {$dec+$inc}] if {$dec >= 90} { set dec [expr {180-$dec}] } elseif {$dec <= -90} { set dec [expr {-180-$dec}] } return $dec } # draw a line with the given points protected method draw_line {points} { if {[llength $points] >= 4} { if {[catch "$canvas_ create line $points -tags {grid objects}" msg]} { #puts $msg } } } # show the grid with the current settings public method show {} { if {"[$image_ wcswidth]" == ""} { warning_dialog "Can't create WCS grid, image does not support world coordinates" $w_ return } # display busy cursor over image while drawing grid $itk_option(-image) busy [code $this draw] } # draw the grid based on the current settings protected method draw {} { # get image size in arcsec set wcsw [expr {[$image_ wcswidth]*60}] set wcsh [expr {[$image_ wcsheight]*60}] # puts "wcswidth in arcsec: $wcsw, height: $wcsh" # size of grid box in arcsecs, choose default is not specified # or if specified value would generate too many lines (and be slow # to draw). set maxlines 20 set minlines 10 set size_ $itk_option(-size) if {"$size_" == ""} { set size_ 60 } while {$wcsw/$size_ > $maxlines} { set size_ [expr {$size_*2}] } while {$wcsw/$size_ < $minlines} { set size_ [expr {$size_/2}] if {"$size_" <= 0.0} { return } } # size in deg set size_deg [expr {$size_/3600.}] # get image equinox set equinox [$image_ wcsequinox] set deg_eq "deg $equinox" # start at center of image (in deg) lassign [$image_ wcscenter -format 1] ra0 dec0 # check if at north or south pole, since that is a special case if {90-abs($dec0) < $wcsh/3600} { # at pole set at_pole 1 set nx 13 set ny [expr {int($wcsh/$size_+1)}] set ra0 0 set ra_inc [expr {360./($nx-1)}] if {$dec0 < 0} { # puts "at south pole" set dec0 -90 set dec_inc $size_deg } else { # puts "at north pole" set dec0 90 set dec_inc -$size_deg } # only need to inc in one direction set ra_inc_list $ra_inc set dec_inc_list $dec_inc } else { # not at pole # get max number of ra,dec lines set nx [expr {int($wcsw/$size_+1)}] set ny [expr {int($wcsh/$size_+1)}] # round ra and dec to $size border set ra_inc $size_deg set ra_sec [expr {int($ra0*3600.)}] set ra_sec [expr {$ra_sec + ($size_ - fmod($ra_sec,$size_))}] set ra0 [expr {$ra_sec/3600.}] set dec_inc $size_deg set dec_sec [expr {int($dec0*3600.)}] set dec_sec [expr {$dec_sec + ($size_ - fmod($dec_sec,$size_))}] set dec0 [expr {$dec_sec/3600.}] # make the ra increment relative to dec0 (ra changes faster as dec nears the pole) set ra_inc [expr {$ra_inc/cos(($dec0/180.)*$pi_)}] # start in the center and inc in both directions set ra_inc_list "$ra_inc -$ra_inc" set dec_inc_list "$dec_inc -$dec_inc" } # puts "grid size_ = $size_, nx = $nx, ny = $ny, ra_inc = $ra_inc, dec_inc = $dec_inc" # draw the grid # lines along ra (start in center and extend in both directions) foreach ra_inc $ra_inc_list { foreach dec_inc $dec_inc_list { set dec $dec0 for {set i 0} {$i < $ny} {incr i} { set ra $ra0 set points {} for {set j 0} {$j < $nx} {incr j} { if {[catch {$image_ convert coords $ra $dec $deg_eq x y canvas}]} { set points [draw_line $points] } else { append points " $x $y" } set ra [inc_ra $ra $ra_inc] } set points [draw_line $points] set dec [inc_dec $dec $dec_inc] } } } # lines along dec foreach ra_inc $ra_inc_list { foreach dec_inc $dec_inc_list { set ra $ra0 for {set i 0} {$i < $nx} {incr i} { set dec $dec0 set points {} for {set j 0} {$j < $ny} {incr j} { if {[catch {$image_ convert coords $ra $dec $deg_eq x y canvas}]} { set points [draw_line $points] } else { append points " $x $y" } set dec [inc_dec $dec $dec_inc] } set points [draw_line $points] set ra [inc_ra $ra $ra_inc] } } } $canvas_ itemconfigure grid \ -fill $itk_option(-color) } # hide (stop showing) the grid public method hide {} { $canvas_ delete grid } # reset the grid (redraw it, if needed, probably for a new image) public method reset {} { hide show } # return the actual size of the grid (space between lines) in arcsecs of degrees public method size {} { return $size_ } # -- options -- # main RtdImage widget (set by caller) itk_option define -image image Image {} # grid spacing, size of a grid box in arcsecs # if not specified, a default is chosen based on the image itk_option define -size size Size {} # grid line color itk_option define -color color Color white { if {$canvas_ != ""} { $canvas_ itemconfigure grid -fill $itk_option(-color) } } # -- protected vars -- # internal rtdimage widget for main image protected variable image_ # canvas window for image protected variable canvas_ # const PI protected variable pi_ 3.14159265358979323846 # current size of grid in arc secs of deg (same as -size if specified, # otherwise it is calculated based on the size of the image) protected variable size_ 60 } skycat-3.1.2-starlink-1b/rtd/library/RtdImageHduChooser.tcl000066400000000000000000000537151215713201500235710ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: RtdImageHduChooser.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageHduChooser.tcl - Itcl widget for displaying FITS extensions # (HDU's = Header Data Units) # # See man page RtdImageHduChooser(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 09/11/98 Created # Peter W. Draper 08/12/00 Slight corrections for missing CRPIX values. # pbiereic 14/08/01 Added default method display_fits_table() # for binary tables. # Display HDU images only on request (for # faster display of main image) # pbiereic 11/10/08 Break image display loop after failure. # pbiereic 26/11/08 Using 'view update' for HDU images display. # Using a toplevel window for the HDU images display. itk::usual RtdImageHduChooser {} # This class defines a widget for displaying the HDUs in the current FITS # image. The user can select an image extension to display # by clicking on an entry the list or on one of the small images displayed # in a table. itcl::class rtd::RtdImageHduChooser { inherit util::TopLevelWidget # constructor: create a toplevel window constructor {args} { eval itk_initialize $args wm protocol $w_ WM_DELETE_WINDOW [code $this quit] } # This method is called after the options have been evaluated. protected method init {} { wm title $w_ "FITS HDUs ($itk_option(-number))" wm iconname $w_ "FITS HDUs ($itk_option(-number))" set topf $w_.topf itk_component add topf { frame $topf } pack $itk_component(topf) -fill both -expand 1 set cmap [$image_ cmap file] set itt [$image_ itt file] set colorscale [$image_ colorscale] set settings_ "$cmap $itt $colorscale"; # save for later comparison make_buttons $topf make_table $topf show_hdu_list } # Quit this widget public method quit { } { destroy $w_ } # add a row of buttons at bottom protected method make_buttons {f} { global $w_.show set $w_.show $itk_option(-show_images) # Button frame at bottom of window itk_component add buttons { frame $f.buttons -borderwidth 2 } itk_component add open { button $itk_component(buttons).open \ -text Open \ -command [code $this set_hdu] } add_short_help $itk_component(open) \ {Open and display the selected HDU image or table} itk_component add display { button $itk_component(buttons).display \ -text "Display as one Image" \ -state disabled \ -command [code $this display_as_one_image] } add_short_help $itk_component(display) \ {Display the image extensions as a single image using the CRPIX values from the FITS header} itk_component add show { checkbutton $itk_component(buttons).show \ -text "Show HDU images" \ -variable $w_.show \ -onvalue 1 -offvalue 0 \ -borderwidth 2 \ -relief raised \ -state disabled \ -pady 4 \ -highlightthickness 0 \ -command [code $this show_images] } add_short_help $itk_component(show) \ {Show/Hide the display of the miniature versions of the image extensions} itk_component add delete { button $itk_component(buttons).delete \ -text Delete \ -state disabled \ -command [code $this delete_hdu] } add_short_help $itk_component(delete) \ {Delete the selected HDU from the FITS file} itk_component add close { button $itk_component(buttons).close \ -text Close \ -command [code $this quit] } add_short_help $itk_component(close) {Close the selected HDU} pack $itk_component(open) $itk_component(display) $itk_component(show) \ $itk_component(delete) $itk_component(close) \ -side left -expand 1 -fill x -padx 0.5m -ipadx 0.5m pack $itk_component(buttons) -side bottom -fill x -expand 0 } # Make the table component for displaying the HDU info protected method make_table {f} { set headings [$image_ hdu listheadings] # TableList(n) widget for displaying the list of HDUs itk_component add table { util::TableList $f.table \ -title {FITS HDUs} \ -headings $headings \ -width [string length $headings] } add_short_help $itk_component(table) \ {Table: Click to select HDU, double-click to display image or table} pack $itk_component(table) -side top -fill both -expand 1 set listbox [$itk_component(table) component listbox] bind $listbox [code $this select_hdu] bind $listbox [code $this set_hdu] } # Update the list of HDUs and the image displays, if needed public method show_hdu_list {} { set old_filename $filename_ set filename_ [$image_ cget -file] set hdu_list [$image_ hdu list] set headings [$image_ hdu listheadings] # update the table listing $itk_component(table) clear set h [llength $hdu_list] if { $h > 10 } { set h 10 } $itk_component(table) config -height $h -info $hdu_list # avoid endless loop due to new image commands caused by '$image_ hdu set' if { "$filename_" == "$old_filename" && ! [$image_ isclear] } { return } $itk_component(show) config -state disabled $itk_component(display) config -state disabled # cleanup first catch {destroy $itk_component(bintable)} if {"$filename_" == ""} { return } # See if there is more than one image, otherwise skip it. # If there are multiple images and they are the same size, # put them in "crpix" order also. set num_images_ 0 catch {unset ext_} set max_crpix1 [set max_crpix2 0] set naxis1 [set naxis2 0] set first_image -1 set use_crpix 1 foreach hdu $hdu_list { eval lassign [list $hdu] $headings if {"$CRPIX1" == ""} { set CRPIX1 0 } if {"$CRPIX2" == ""} { set CRPIX2 0 } if {"$Type" == "image" && "$NAXIS" >= 2 && "$NAXIS1" > 0 && "$NAXIS2" > 0} { set ext_($num_images_,HDU) $HDU set ext_($num_images_,ExtName) $ExtName set ext_($num_images_,NAXIS1) $NAXIS1 set ext_($num_images_,NAXIS2) $NAXIS2 set ext_($num_images_,CRPIX1) $CRPIX1 set ext_($num_images_,CRPIX2) $CRPIX2 if {$first_image == -1} { set first_image $HDU set max_crpix1 $CRPIX1 set max_crpix2 $CRPIX2 set naxis1 $NAXIS1 set naxis2 $NAXIS2 } else { if {$naxis1 != $NAXIS1 || $naxis2 != $NAXIS2} { # PWD: allow for slight rounding error or trim of a # small number of pixels, let's say 10. set dx [expr abs($naxis1 - $NAXIS1)] set dy [expr abs($naxis2 - $NAXIS2)] if { $dx > 10 || $dy > 10 } { set use_crpix 0 } } if {$CRPIX1 > $max_crpix1} { set max_crpix1 $CRPIX1 } if {$CRPIX2 > $max_crpix2} { set max_crpix2 $CRPIX2 } } incr num_images_ } } if {$num_images_ < 1} { return } # determine the table index for each image if {$use_crpix} { # put images in correct order based on crpix values set max_row_ 0 set max_col_ 0 for {set i 0} {$i < $num_images_} {incr i} { set crpix1 $ext_($i,CRPIX1) set crpix2 $ext_($i,CRPIX2) set naxis1 $ext_($i,NAXIS1) set naxis2 $ext_($i,NAXIS2) set row -1 set col -1 catch { set row [expr {round(($max_crpix2 - $crpix2)/$naxis2)}] set col [expr {round(($max_crpix1 - $crpix1)/$naxis1)}] } if {$row<0 || $col<0 || [info exists check($row,$col)]} { # put in sequential order set use_crpix 0 break } set check($row,$col) 1 set ext_($i,row) $row set ext_($i,col) $col set max_row_ [max $max_row_ $row] set max_col_ [max $max_col_ $col] } } if {! $use_crpix} { # different sized images: put in sequential order set num_cols 4 set num_rows [expr {$num_images_/$num_cols+$num_cols}] set max_row_ 0 set max_col_ 0 set n 0 for {set row 0} {$row < $num_rows} {incr row} { for {set col 0} {$col < $num_cols} {incr col} { if {$n == $num_images_} { break } set ext_($n,row) $row set ext_($n,col) $col incr n set max_row_ [max $max_row_ $row] set max_col_ [max $max_col_ $col] } } } # PWD: XXX commented out for now. Problem when loading cubes # as this causes the cube to load, which displays an NDF (as the # slice) that destroys this object (to make way for the NDF # chooser) before the latter lines are executed. # Select the HDU being displayed, if any #if {$first_image == -1} { # select_image_hdu [$image_ hdu] #} else { # select_image_hdu $first_image #} if { $num_images_ > 1 } { $itk_component(show) config -state normal if { $use_crpix } { $itk_component(display) config -state normal } } show_images } # Switch off the show button and remove all image minature versions protected method quit_images {} { global $w_.show set $w_.show 0 delete_images } # Remove all image minature versions protected method delete_images {} { if {! [info exists itk_component(hduimages)]} {return} save_images_geometry catch {destroy $itk_component(hduimages)} } # Save the geometry of the HDU images window so we can reload it the next time protected method save_images_geometry {} { set svgeoimg_ [wm geometry $itk_component(hduimages)] } # Show all image minature versions (called by checkbutton) protected method show_images {} { global $w_.show if { [set $w_.show] } { busy { if { ![info exists itk_component(hduimages)] || "$svinfo_" != [svinfo] } { delete_images create_images wm protocol $itk_component(hduimages) WM_DELETE_WINDOW [code $this quit_images] set svinfo_ [svinfo] } display_images } } else { delete_images } } # Put the images in the table protected method create_images {} { if { [info exists itk_component(hduimages)] } {return} catch {unset wdg_} set topw [winfo parent $w_] itk_component add hduimages { util::TopLevelWidget $topw.hduimages -transient 0 } set name "FITS HDU images: [file tail $filename_]" wm title $itk_component(hduimages) $name wm iconname $itk_component(hduimages) "FITS HDU images" # Frame (BLT table) used to display images in FITS extensions itk_component add imagetab { frame $itk_component(hduimages).imagetab } for {set i 0} {$i < $num_images_} {incr i} { set f [frame $itk_component(imagetab).f$i -borderwidth 1 -relief raised] set im [RtdImage $f.im \ -graphics 0 \ -displaymode 0 \ -usexshm 0 \ -usexsync 0 \ -fillwidth 100 \ -fillheight 100] pack $im -fill both -expand 1 -padx 1 -pady 1 # save widget names for later reference set wdg_($i,frame) $f set wdg_($i,RtdImage) $im set wdg_($i,image) [$im get_image] } itk_component add butframe { frame $itk_component(hduimages).butframe } itk_component add settings { button $itk_component(butframe).settings \ -text "Use Settings from Main Image" \ -command [code $this use_settings_from_main_image] } add_short_help $itk_component(settings) \ {Set the cut levels and colormap for the preview images to the one used in the main image} itk_component add closeimages { button $itk_component(butframe).closeimages \ -text Close \ -command [code $this quit_images] } add_short_help $itk_component(closeimages) \ {Close the HDU images display window} itk_component add autocut { button $itk_component(butframe).autocut \ -text Autocut \ -command [code $this auto_set_cut_levels] } add_short_help $itk_component(autocut) \ {Auto set cut levels individually to 99% for each HDU image} pack $itk_component(settings) $itk_component(autocut) $itk_component(closeimages) \ -fill x -expand 1 -side left -padx 0.5m -ipadx 0.5m pack $itk_component(butframe) -fill x -expand 0 -side bottom pack $itk_component(imagetab) -fill both -expand 1 -side top # save the geometry of the HDU images window whenever it is resized bind $itk_component(imagetab) [code $this save_images_geometry] if { "$svinfo_" == "[svinfo]" && ![lempty $svgeoimg_] } { wm geometry $itk_component(hduimages) $svgeoimg_ } # Uncomment the following when a transient window is required # tkwait visibility $itk_component(hduimages) # wm transient $itk_component(hduimages) $topw } # Return saved info about the HDUs private method svinfo {} { set list [array get ext_ *NAXIS*] loop i 0 [llength $list] 2 { lappend newlist "[lindex $list $i] [lindex $list [expr {$i+1}]]" } set newlist [lsort -increasing -index 0 $newlist] return $newlist } # Display the images protected method display_images {} { lassign [$image_ cut] low high for {set i 0} {$i < $num_images_} {incr i} { set width $ext_($i,NAXIS1) set height $ext_($i,NAXIS2) # '$image_ view update' is much faster than '$image_ config -file' as used by earlier versions if { [catch {$image_ view update $wdg_($i,image) $width $height image} msg] } { error_dialog "HDU $ext_($i,HDU), Extension '$ext_($i,ExtName)':\n$msg" break } add_image_bindings $wdg_($i,RtdImage) $ext_($i,HDU) $ext_($i,ExtName) $wdg_($i,image) cut $low $high } # position the images in the table catch {blt::blttable forget $itk_component(imagetab)} set hdu [$image_ hdu] set idx [expr {$hdu -1}] if { $ext_(0,HDU) == 2 } { set idx [expr {$idx -1}] } set naxis1 $ext_($idx,NAXIS1) if { $hdu > 0 && [$image_ width] != $naxis1 } { set hdu -1 } for {set i 0} {$i < $num_images_} {incr i} { set row [expr {$max_row_-$ext_($i,row)}] set col $ext_($i,col) blt::table $itk_component(imagetab) ${row},${col} $itk_component(imagetab).f$i -fill both if {"$ext_($i,HDU)" == $hdu} { $wdg_($i,frame) configure -relief sunken -bg red } } } # Set the cut levels and colormap for the image extensions to the ones # used in the main image method use_settings_from_main_image {} { # return if no image if {! [info exists wdg_(0,image)]} { return } lassign [$image_ cut] low high if { "$low" == "" || "$high" == "" || [$image_ isclear] } { return } set cmap [$image_ cmap file] set itt [$image_ itt file] set colorscale [$image_ colorscale] set setflag 0 set settings "$cmap $itt $colorscale" if { "$settings" != "$settings_" } { set settings_ $settings set setflag 1 } $itk_component(hduimages) busy { for {set i 0} {$i < $num_images_} {incr i} { if { $setflag } { $wdg_($i,image) colorscale $colorscale $wdg_($i,image) cmap file $cmap $wdg_($i,image) itt file $itt } $wdg_($i,image) cut $low $high update idletasks } } } # Set the cut levels for the image extensions to the given percent method auto_set_cut_levels {{percent 99}} { $itk_component(hduimages) busy { for {set i 0} {$i < $num_images_} {incr i} { $wdg_($i,image) autocut -percent $percent update idletasks } } } # This method is called when the user clicks on an image HDU icon. # Display the selected image and disable the delete button. protected method select_image_hdu {hdu} { $itk_component(delete) config -state disabled # display only a real image set headings [$image_ hdu listheadings] eval lassign [list [lindex [$image_ hdu list] [expr {$hdu -1}] ]] $headings if {"$Type" == "image" && "$NAXIS" < 1} { return } for {set i 0} {$i < $num_images_} {incr i} { if {[info exists wdg_($i,frame)] && [winfo exists $wdg_($i,frame)]} { if {"$ext_($i,HDU)" == "$hdu"} { $wdg_($i,frame) configure -relief sunken -bg red } else { $wdg_($i,frame) configure -relief raised -bg [$itk_component(imagetab) cget -background] } } } lassign [$image_ cut] low high busy { $image_ hdu $hdu update idletasks $image_ cut $low $high } catch {$itk_component(table) select_row [expr {$hdu-1}]} } # Add bindings to the given RtdImage itcl class object and set it to # display the given HDU when clicked on. # The image's extension name is also given. protected method add_image_bindings {im hdu name} { set image [$im get_image] set canvas [$im get_canvas] # set the HDU for the image $image hdu $hdu # need to add 2 bindings: one for the image, one for the background bind $canvas <1> [code $this select_image_hdu $hdu] # set up a resize handler to change the image size bind $canvas [code $this resize $im %w %h] # add a help message indicating which image it is set s $name if {"$s" != ""} { set s "($s)" } add_short_help $canvas "Click here to display HDU $hdu $s" } # This method is called when the image window is resized. # The RtdImage widget and the new width and height are given. protected method resize {im new_width new_height} { set image [$im get_image] $image config -fillwidth $new_width -fillheight $new_height $im center } # Set the HDU to display. Makes the currently selected HDU the current HDU protected method set_hdu {} { set sel [$itk_component(table) get_selected] if {[llength $sel]} { lassign [lindex $sel 0] hdu type name if {"$type" == "image"} { busy { select_image_hdu $hdu } } elseif {"$type" == "ascii" || "$type" == "binary"} { display_fits_table $name $hdu } } } # This method is called when a line in the HDU list is selected. # Update the states of the buttons depending on the selection. protected method select_hdu {} { set sel [$itk_component(table) get_selected] if {[llength $sel]} { lassign [lindex $sel 0] hdu type name if {"$type" == "image"} { $itk_component(delete) config -state disabled } elseif {"$type" == "ascii" || "$type" == "binary"} { $itk_component(delete) config -state normal } } } # Display all of the image extensions as a single image (combine based # on CRPIX1 and CRPIX2 keywords). protected method display_as_one_image {} { for {set i 0} {$i < $num_images_} {incr i} { if {[info exists wdg_($i,frame)] && [winfo exists $wdg_($i,frame)]} { $wdg_($i,frame) configure -relief raised \ -bg [$itk_component(imagetab) cget -background] } } busy { $image_ hdu display } } # Select an HDU to display. This makes it the current HDU protected method delete_hdu {} { set hdu [$image_ hdu] set selected_hdu [lindex [lindex [$itk_component(table) get_selected] 0] 0] set type [$image_ hdu type $selected_hdu] if {"$type" == "image"} { error_dialog "Deleting image HDUs is not allowed" return } else { append type " table" } if {! [confirm_dialog "Delete the $type at HDU $selected_hdu ?"]} { return } if {"$type" == "image"} { catch {destroy $imagetab.f.im$selected_hdu} } if {[catch {$image_ hdu delete $selected_hdu} msg]} { error_dialog $msg } set n [$image_ hdu count] if {$hdu == $selected_hdu || $n <= 0 || $hdu > $n} { $itk_option(-image) clear return } # current HDU my have moved up... $image_ hdu $hdu # update the list show_hdu_list } # Display the current FITS table. Needs to be redefined by parent class # when other tables than binary are to be displayed. protected method display_fits_table {name hdu} { set sel [$itk_component(table) get_selected] lassign [lindex $sel 0] hdu type name if {"$type" != "binary"} { return } set bintbl $w_.bintable # toggle the visibility of the binary table if { [winfo exists $bintbl] && $hdu == $hdu_bin_ } { destroy $bintbl return } if { ! [winfo exists $bintbl] } { # TableList(n) widget for displaying the binary table itk_component add bintable { util::TableList $bintbl \ -hscroll 1 } pack $itk_component(bintable) -fill both -expand 1 } set hdu_bin_ $hdu set headings [$image_ hdu headings $hdu] busy { set info [$image_ hdu get $hdu] } $itk_component(bintable) config -title $name -headings $headings -info $info } # -- options -- # target SkyCatCtrl itcl class object itk_option define -image image Image {} { set image_ [$itk_option(-image) get_image] } # flag: if true, images are "subsampled" when shrinking, # otherwise the pixels are averaged itk_option define -subsample subsample Subsample {1} # X shared memory option itk_option define -usexshm useXshm UseXshm {0} # X synchronisation option itk_option define -usexsync useXsync UseXsync {0} # flag: if true, print diagnostic messages itk_option define -verbose verbose Verbose {0} # Default: show image extensions, bool itk_option define -show_images show_images Show_images {0} # optionally specify TopLevelWidget to display short help messages itk_option define -shorthelpwin shortHelpWin ShortHelpWin {} # -- protected vars -- # internal rtdimage object protected variable image_ # name of image file protected variable filename_ {} # number of image HDUs in the current FITS file protected variable num_images_ 0 # array(HDUIndex,keyword) of image keyword protected variable ext_ # array(HDUIndex,keyword) of widget info protected variable wdg_ # max row and column protected variable max_row_ 0 protected variable max_col_ 0 # HDU number of last binary table protected variable hdu_bin_ -1 # saved info for images display protected variable svinfo_ {} protected variable svgeoimg_ {} protected variable settings_ {} } skycat-3.1.2-starlink-1b/rtd/library/RtdImageIcon.tcl000066400000000000000000000040211215713201500224000ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImageIcon.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageIcon.tcl - itcl widget to display current image in icon window # # See man page RtdImageIcon(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 08 Jun 96 Created itk::usual RtdImageIcon {} # RtdImageIcon is an itcl widget used to display the current image in the # icon window. itcl::class rtd::RtdImageIcon { inherit util::TopLevelWidget # constructor: create a new instance of this class constructor {args} { eval itk_initialize $args # RtdImage widget itk_component add image { rtd::RtdImage $w_.image \ -name "IconImage" \ -scrollbars 0 \ -graphics 0 \ -drag_scroll 0 \ -displaymode 0 \ -fitwidth $itk_option(-width) \ -fitheight $itk_option(-height) \ -subsample $itk_option(-subsample) \ -verbose $itk_option(-verbose) \ -usexsync $itk_option(-usexsync) \ -usexshm $itk_option(-usexshm) \ -show_object_menu 0 } pack $itk_component(image) -side right -anchor n [$itk_option(-image) get_image] view add [$itk_component(image) get_image] 0 bind $this [code $itk_component(image) center] } # -- public vars -- # target RtdImage (itcl widget) itk_option define -image image Image {} # dimensions of pan frame itk_option define -width width Width 48 itk_option define -height height Height 48 # flag: if true, pan image is "subsampled" when shrinking, # otherwise the pixels are averaged itk_option define -subsample subsample Subsample 1 # X shared memory option itk_option define -usexshm useXshm UseXshm 1 # X synchronisation option itk_option define -usexsync useXsync UseXsync 1 # flag: if true, print diagnostic messages itk_option define -verbose verbose Verbose {0} } skycat-3.1.2-starlink-1b/rtd/library/RtdImageMBand.tcl000066400000000000000000000116751215713201500225060ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: RtdImageMBand.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageMBand.tcl - itcl class to display a "measure band" # showing the distance between 2 points in world coordinates # # See man page RtdImagMBand(n) for a complete description. # # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created itk::usual RtdImageMBand {} # RtdImageMBand is an itcl widget class used to display a "measure band" # showing the distance between two points in world coordinates. itcl::class rtd::RtdImageMBand { inherit util::FrameWidget # create a new object (the frame only ensures that this class # will be deleted along with its parent) constructor {args} { eval itk_initialize $args set image_ [$itk_option(-image) get_image] set canvas_ [$itk_option(-image) get_canvas] bind $canvas_ <3> "+[code $this start %x %y]" } # start displaying the measure band public method start {x y} { $canvas_ delete mband if {"[$image_ wcscenter]" == ""} { return } set x_ $x set y_ $y set x [$canvas_ canvasx $x] set y [$canvas_ canvasy $y] # create diagonal line with arrows $canvas_ create line $x $y $x $y \ -width $itk_option(-line_width) \ -fill $itk_option(-line_color) \ -arrow $itk_option(-arrow_type) \ -arrowshape $itk_option(-arrow_shape) \ -tags {mband mband_line} # dashed angle line shows width and height $canvas_ create line $x $y $x $y $x $y \ -width $itk_option(-line_width) \ -fill $itk_option(-line_color) \ -stipple pat8 \ -tags {mband mband_angle} # create labels for width, height, diagonal foreach i {width height diag} { $canvas_ create rectangle $x $y [expr {$x+1}] [expr {$y+1}] \ -fill $itk_option(-fill_color) \ -outline $itk_option(-outline_color) \ -tags "mband mband_${i}_rect" $canvas_ create text $x $y \ -fill $itk_option(-text_color) \ -font $itk_option(-text_font) \ -anchor w \ -tags "mband mband_${i}_text" } # save and set cursor $canvas_ config -cursor $itk_option(-cursor) # save and set bindings set saved_bindtags_ [bindtags $canvas_] # use a unique name set tag mband$w_ bind $tag <3> [code $this stop] bind $tag [code $this check_stop %x %y] bind $tag [code $this mband %x %y 1] bind $tag { } bind $tag [code $this mband %x %y 0] bind $tag [code $this mband %x %y 0] #bind $tag [code $this mband %x %y 0] bind $tag { } # make arrow keys move mouse pointer by one pixel bind $tag "$image_ warp -1 0" bind $tag "$image_ warp 1 0" bind $tag "$image_ warp 0 -1" bind $tag "$image_ warp 0 1" bindtags $canvas_ $tag } # stop displaying the measure band and restore cursor and bindings public method stop {} { $canvas_ delete mband $canvas_ config -cursor $itk_option(-defaultcursor) bindtags $canvas_ $saved_bindtags_ } # stop displaying the mband if the user has moved the mouse since it was # created public method check_stop {x y} { if {$x != $x_ && $y != $y_} { stop } } # update the display of the measure band to show the distance # between the endpoints in WCS public method mband {x y show_angle} { $image_ mband $x_ $y_ $x $y screen $show_angle update idletasks } # -- public vars -- # main RtdImage widget (set by caller) itk_option define -image image Image {} # line width option for measure band itk_option define -line_width line_width Line_width 1 # line color option for measure band itk_option define -line_color line_color Line_color white # line arrow type option for measure band itk_option define -arrow_type arrow_type Arrow_type both # line arrow shape option for measure band itk_option define -arrow_shape arrow_shape Arrow_shape {8 10 3} # outline color for label rectangle itk_option define -outline_color outline_color Outline_color {grey90} # fill color for label rectangle itk_option define -fill_color fill_color Fill_color {yellow} # text color for label itk_option define -text_color text_color Text_color {blue} # font to use for labels itk_option define -text_font text_font Text_font TkFixedFont # default cursor when drawing itk_option define -cursor cursor Cursor {draft_small} # default cursor when not drawing itk_option define -defaultcursor defaultCursor DefaultCursor {} # -- protected vars -- # internal rtdimage widget for main image protected variable image_ # canvas window for image protected variable canvas_ # X starting point of line protected variable x_ 0 # Y starting point of line protected variable y_ 0 # saved canvas bindings, restored later protected variable saved_bindtags_ } skycat-3.1.2-starlink-1b/rtd/library/RtdImagePan.tcl000066400000000000000000000306441215713201500222400ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImagePan.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImagePan.tcl - itcl widget managing the RtdImage panning window # # See man page RtdImagePan(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created # Peter W. Draper 15 Feb 01 Changed notify_cmd method to deal with # very narrow images (spectra). # pbiereic 14/12/04 Fixed: Panning while image events are received # Peter W. Draper 02 Apr 05 Slight correction to logic of above. Make sure # panning changes are always seen for new images # and images with orientation changes (pan with # changed=1) # 02 Nov 06 Make the compass a fixed size of the width, not # some size that depends on the image scale. More # consistent. # pbiereic 30/03/05 Fixed: pan image width for long, narrow spectra # in method notify_cmd itk::usual RtdImagePan {} # This widget displays a "view" of another RtdImage widget at a # smaller magnification, so that the entire image is visible in # a small window. A rectangle displayed over the image can be # used to pan or move the image when the target image is to # large to be viewed at all at once in its window. The rectangle # is always notified of changes in the target image or its # window, so it always displays the relative size of the visible # image to the entire image. The pan window is based on the # rtdimage "pan" subcommand and uses canvas graphics to display # the rectangle. # # Since it is not known ahead of time how large or small an # image will be, the pan window is given a maximum size when # created. When an image is loaded, it shrinks the image by # equal integer factors until it fits in the window. Then it # fits the window around the image, so as not to leave a blank # (black) space around it. Rotated and flipped images are also # displayed as rotated and flipped in the pan window. Only the # scale factor remains fixed. itcl::class rtd::RtdImagePan { inherit util::FrameWidget # constructor: create a new RtdImagePan widget constructor {args} { itk_option add hull.borderwidth hull.relief # evaluate the options eval itk_initialize $args # RtdImage(n) widget for displaying a copy of the image itk_component add image { rtd::RtdImage $w_.image \ -name "Panner" \ -scrollbars 0 \ -drag_scroll 0 \ -displaymode 0 \ -show_object_menu 0 \ -withtoolbox 0 \ -graphics 1 \ -fitwidth $itk_option(-width) \ -fitheight $itk_option(-height) \ -subsample $itk_option(-subsample) \ -shelp $itk_option(-shelp) \ -zoomwin $itk_option(-zoomwin) \ -cursor $itk_option(-cursor) \ -verbose $itk_option(-verbose) \ -usexsync $itk_option(-usexsync) \ -usexshm $itk_option(-usexshm) \ } { keep -subsample -zoomwin -cursor -verbose rename -fitwidth -width width Width rename -fitheight -height height Height } pack $itk_component(image) -side right -fill y -anchor n set image_ [$itk_component(image) get_image] set canvas_ [$itk_component(image) get_canvas] # create a rectangle to mark previos position set marker_ [$canvas_ create rectangle 0 0 0 0 \ -outline black \ -width 2] # create the panning rectangle for resizing and positioning set panner_ [$canvas_ create rectangle 0 0 0 0 \ -outline white \ -fill black \ -stipple pat7 \ -width 1] # get name of CanvasDraw widget for image set draw_ [$itk_component(image) component draw] # don't allow resize for now (difficult to implement right) $draw_ config -show_selection_grips 0 # add bindings for moving and resizing the panning rect $draw_ add_object_bindings $panner_ # setup callbacks for moving and resizing image $draw_ add_notify_cmd $panner_ [code $this notify_cmd] # zoom in and out with mouse 2 and 3 (1 is for panning) bind $canvas_ <2> "$itk_option(-target_image) inc_zoom 1" bind $canvas_ <3> "$itk_option(-target_image) inc_zoom -1" # make this image a "view" of the target image $target_image_ view add $image_ 0 # center image on resize bind $w_ [code $itk_component(image) center] add_short_help $w_ $itk_option(-shelp) # only start panning after the image is displayed after 0 [code $this init_panning] } # Initialize the pan window after a new image has been loaded and # arrange to be notified of changes in the position and size of the # visible image. public method init_panning {} { set panImageWidth_ [$image_ dispwidth] set panImageHeight_ [$image_ dispheight] if {$panImageWidth_ == 0} { $target_image_ pan start [code $this pan] 1 return } # just center image in canvas window $itk_component(image) center # max pan factor is -1 (no shrink, -2 is 1/2 size...) set panFactor_ [lindex [$image_ scale] 0] if {"$panFactor_" == "" || $panFactor_ >= 0} { set panFactor_ -1 } $target_image_ pan start [code $this pan] $panFactor_ # set the valid area to move the panning rect $draw_ configure -bbox [$canvas_ bbox $image_] # draw a compass indicating N and E catch draw_compass } # stop the panning callback public method stop_panning {} { $target_image_ pan stop } # update the panner rectangle to display the current position and size # of the target image # x1 y1 x2 y2 give the visible portion of the image # if "changed" is 1, there is a new image with pos. different dimensions. # PWD: if changed is true always do this, includes cases when orientation # is changed (want to see the compass update). protected method pan {x1 y1 x2 y2 changed} { set scale [lindex [$image_ scale] 0] if { [info exists coords_] && ! $changed } { if { $x1 == $coords_(pan_x1) && $y1 == $coords_(pan_y1) && \ $x2 == $coords_(pan_x2) && $y2 == $coords_(pan_y2) && \ "$scale" == "$coords_(scale)" && \ $panImageHeight_ == $coords_(panImageHeight) && \ $panImageWidth_ == $coords_(panImageWidth) && $panImageWidth_ > 1 } { return } } set coords_(pan_x1) $x1 set coords_(pan_y1) $y1 set coords_(pan_x2) $x2 set coords_(pan_y2) $y2 set coords_(scale) $scale set coords_(panImageWidth) $panImageWidth_ set coords_(panImageHeight) $panImageHeight_ if {$changed} { init_panning } else { if {$x1 == 0 && $y1 == 0 && abs($x2-$panImageWidth_)<3 && abs($y2-$panImageHeight_)<3} { $itk_option(-target_image) center } $canvas_ coords $marker_ [incr x1 -2] [incr y1 -2] [incr x2 2] [incr y2 2] $canvas_ coords $panner_ $x1 $y1 $x2 $y2 } } # this method is called when the user moves or resizes the panning rect. # op is set to "resize" or "move" (resize not currently supported) # PWD: changed to deal with very narrow images (i.e. spectra). public method notify_cmd {op} { if {$panImageWidth_ == 0 && $panImageHeight_ == 0} { return } lassign [$canvas_ coords $panner_] x1 y1 x2 y2 if {"$op" == "move" } { if {$panImageWidth_ > 1} { $target_canvas_ xview moveto [expr $x1/($panImageWidth_-1)] } else { $target_canvas_ xview moveto $x1 } if { $panImageHeight_ > 1 } { $target_canvas_ yview moveto [expr $y1/($panImageHeight_-1)] } else { $target_canvas_ yview moveto $y1 } $target_image_ pan update $itk_option(-target_image) maybe_center } return 0 } # draw an ra,dec compass indicating N and E by following lines along ra and dec # near the center of the image protected method draw_compass {} { $canvas_ delete compass # get image size in arcsec if {[$image_ isclear] || "[$image_ wcswidth]" == ""} { return } set wcsw [expr {[$image_ wcswidth]*60}] set wcsh [expr {[$image_ wcsheight]*60}] # set initial size of compass to percent of the image size in arcsecs set size_ [expr {[min $wcsw $wcsh]/4}] # size in deg set size_deg [expr {$size_/3600.}] # get image equinox set equinox [$image_ wcsequinox] set deg_eq "deg $equinox" # start at center of image (in deg) lassign [$image_ wcscenter -format 1] ra0 dec0 # check if at north or south pole, since that is a special case if {90-abs($dec0) < $wcsh/3600} { # skip this if at the pole (for now) return } # get end points of compass so we can determine the directions set ra1 [expr {$ra0+$size_deg/cos(($dec0/180.)*$pi_)}] if {$ra1 < 0} { set ra1 [expr {360+$ra1}] } set dec1 [expr {$dec0+$size_deg}] if {$dec1 >= 90} { set dec1 [expr {180-$dec1}] } # end points in canvas coords $image_ convert coords $ra0 $dec0 $deg_eq cx0 cy0 canvas $image_ convert coords $ra1 $dec0 $deg_eq cx1 cy1 canvas $image_ convert coords $ra0 $dec1 $deg_eq cx2 cy2 canvas # directions set t1 [expr atan2($cy1-$cy0,$cx1-$cx0)] set t2 [expr atan2($cy2-$cy0,$cx2-$cx0)] # make sure lengths are 0.25 of the width pixels set w [expr 0.25*$itk_option(-width)] set cx1 [expr $cx0+$w*cos($t1)] set cy1 [expr $cy0+$w*sin($t1)] set cx2 [expr $cx0+$w*cos($t2)] set cy2 [expr $cy0+$w*sin($t2)] # East line $canvas_ create line $cx0 $cy0 $cx1 $cy1 \ -tags {compass objects} \ -fill white \ -arrow last # North line $canvas_ create line $cx0 $cy0 $cx2 $cy2 \ -tags {compass objects} \ -fill white \ -arrow last # factor for positioning N and E labels set f 0.25 # label "E" $canvas_ create text [expr {$cx1+($cx1-$cx0)*$f}] [expr {$cy1+($cy1-$cy0)*$f}] \ -text E \ -anchor c \ -font $compassfont_ \ -fill white \ -tags {compass objects} # label "N" $canvas_ create text [expr {$cx2+($cx2-$cx0)*$f}] [expr {$cy2+($cy2-$cy0)*$f}] \ -text N \ -anchor c \ -font $compassfont_ \ -fill white \ -tags {compass objects} } # -- public vars -- # target RtdImage (itcl widget) itk_option define -target_image target_image Target_image {} { # save name of target image and canvas window it is in set target_image_ [$itk_option(-target_image) get_image] set target_canvas_ [$itk_option(-target_image) get_canvas] } # width of pan frame itk_option define -width width Width 150 # height of pan frame itk_option define -height height Height 150 # flag: if true, pan image is "subsampled" when shrinking, # otherwise the pixels are averaged itk_option define -subsample subsample Subsample 1 # X shared memory option itk_option define -usexshm useXshm UseXshm 1 # X synchronisation option itk_option define -usexsync useXsync UseXsync 1 # flag: if true, print diagnostic messages itk_option define -verbose verbose Verbose {0} # default cursor itk_option define -cursor cursor Cursor {} # zoom window to update itk_option define -zoomwin zoomWin ZoomWin {} # help text displayed when mouse enters widget itk_option define -shelp shelp Shelp {Pan window: \ {bitmap dragb1} = position image, \ {bitmap b2} = zoom in, \ {bitmap b3} = zoom out} # -- protected vars -- # internal target image being panned (rtdimage) protected variable target_image_ # target image's canvas window protected variable target_canvas_ # panning image protected variable image_ # canvas for panning image protected variable canvas_ # name of CanvasDraw widget for image protected variable draw_ # canvas id of the panning rectangle protected variable panner_ # canvas id of a second rectangle used to mark old position protected variable marker_ # width of the panning image, after shrinking protected variable panImageWidth_ # height of the panning image, after shrinking protected variable panImageHeight_ # amount panning image was shrunk (=2 = 1/2, -4 = 1/4, ...) protected variable panFactor_ # const PI protected variable pi_ 3.14159265358979323846 # compass label fonts protected variable compassfont_ TkTooltipFont # current pan coords protected variable coords_ } skycat-3.1.2-starlink-1b/rtd/library/RtdImagePanel.tcl000066400000000000000000000435761215713201500225710ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: RtdImagePanel.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImagePanel.tcl - widget for displaying relevant image information # in tabular (blt_table) format # # # See man page RtdImagePanel(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 12 Oct 95 Created # P.Biereichel 22/03/99 Added code for bias subtraction # P.Biereichel 09/08/99 Added camera status # pbiereic 19/03/03 Always update lcut/hcut (method updateValues) # Peter W. Draper 20/07/09 Use unicode values for greek alpha and delta. # Switch to modern fonts. itk::usual RtdImagePanel {} # RtdImagePanel is a display and control panel for the RtdImageCtrl(n) widget. # It displays the following information: # # the object name, the name of the file or camera being viewed # # the x,y pixel and world coordinates and pixel value under the # mouse pointer # # the minimum and maximum image pixel values # # the image data type # # the low and high cut levels # # the scale (magnification), flip(X,Y) and rotate settings # # In addition to displaying the current image information, the cut # levels can be set by editing them and hitting return, the scale factor # can be selected from a menu and the rotation and flip X/Y settings can # be toggled with checkbuttons. itcl::class rtd::RtdImagePanel { inherit util::FrameWidget # constructor constructor {args} { itk_option add hull.borderwidth hull.relief # do this first so we can use the option values eval itk_initialize $args make_layout } # do the widget layout, aligning the items in rows and colums protected method make_layout {} { blt::blttable $w_ add_short_help $w_ {Image information area} # frame at the lower right of the panel that optionally # holds the "Auto Set Cut Levels" button, ... itk_component add lrframe { frame $w_.lrframe } # auto cut button if {$itk_option(-showcut)} { # "Auto Set Cut Levels" button itk_component add autocut { button $w_.autocut \ -text "Auto Set Cut Levels" \ -font $itk_option(-labelfont) \ -command [code $this auto_set_cut_levels] } pack $itk_component(autocut) \ -anchor ne -padx 1m -pady 1m -fill x -in $itk_component(lrframe) } # the RtdImage code sets this array for us to speed up the panel # update by using the -textvariable option set var $image_ global ::$var set row -1 # XXX should probably use blt table for labels and values here... # display object name if {$itk_option(-showobject)} { # LabelValue(n) object displaying object name or file name itk_component add object { util::LabelValue $w_.object \ -text "Object:" \ -valuefont $itk_option(-valuefont) \ -orient horizontal \ -labelfont $itk_option(-labelfont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -anchor e \ -relief groove } if { "$itk_option(-panel_orient)" == "vertical" } { blt::blttable $w_ $itk_component(object) [incr row],0 -fill x -anchor e } else { blt::blttable $w_ $itk_component(object) [incr row],0 -fill x -anchor e -columnspan 3 } add_short_help $itk_component(object) \ {Object name (file or camera name, if object not known)} } # X and Y if {$itk_option(-showxy)} { # LabelValue(n) widget for X image coordinate itk_component add x { util::LabelValue $w_.x \ -text "X:" \ -textvariable ${var}(X) \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for Y image coordinate itk_component add y { util::LabelValue $w_.y \ -text "Y:" \ -textvariable ${var}(Y) \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for pixel value itk_component add value { util::LabelValue $w_.value \ -text "Value:" \ -textvariable ${var}(VALUE) \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } if { "$itk_option(-panel_orient)" == "vertical" } { blt::blttable $w_ \ $itk_component(x) [incr row],0 -fill x -anchor w \ $itk_component(y) [incr row],0 -fill x -anchor w \ $itk_component(value) [incr row],0 -fill x -anchor w } else { blt::blttable $w_ \ $itk_component(x) [incr row],0 -fill x -anchor w \ $itk_component(y) $row,1 -fill x -anchor w \ $itk_component(value) $row,2 -fill x -anchor w } # workaround for bug in itcl2.0 $itk_component(x) config -textvariable ${var}(X) $itk_component(y) config -textvariable ${var}(Y) $itk_component(value) config -textvariable ${var}(VALUE) add_short_help $itk_component(x) \ {X image coordinate at mouse pointer (or X detector chip coordinate, if known)} add_short_help $itk_component(y) \ {Y image coordinate at mouse pointer (or Y detector chip coordinate, if known)} add_short_help $itk_component(value) \ {Raw image value at X,Y coordinates} } # ra and dec if {$itk_option(-showwcs)} { # LabelValue(n) widget for RA coordinate itk_component add ra { util::LabelValue $w_.ra \ -text "\u03b1:" \ -textvariable ${var}(RA) \ -labelfont $itk_option(-wcsfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for DEC coordinate itk_component add dec { util::LabelValue $w_.dec \ -text "\u03b4:" \ -textvariable ${var}(DEC) \ -labelfont $itk_option(-wcsfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } itk_component add equinox { # LabelValue(n) widget for the equinox util::LabelValue $w_.equinox \ -text "Equinox:" \ -textvariable ${var}(EQUINOX) \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } if { "$itk_option(-panel_orient)" == "vertical" } { blt::blttable $w_ \ $itk_component(ra) [incr row],0 -fill x -anchor w \ $itk_component(dec) [incr row],0 -fill x -anchor w \ $itk_component(equinox) [incr row],0 -fill x -anchor w } else { blt::blttable $w_ \ $itk_component(ra) [incr row],0 -fill x -anchor w \ $itk_component(dec) $row,1 -fill x -anchor w \ $itk_component(equinox) $row,2 -fill x -anchor w } # workaround for bug in itcl2.0 $itk_component(ra) config -textvariable ${var}(RA) $itk_component(dec) config -textvariable ${var}(DEC) $itk_component(equinox) config -textvariable ${var}(EQUINOX) add_short_help $itk_component(ra) {World Coordinates RA value} add_short_help $itk_component(dec) {World Coordinates DEC value} add_short_help $itk_component(equinox) {World Coordinates equinox (default: J2000)} } # min max values if {$itk_option(-showminmax)} { # LabelValue(n) widget for the min pixel value itk_component add min { util::LabelValue $w_.min \ -text "Min:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for the max pixel value itk_component add max { util::LabelValue $w_.max \ -text "Max:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for the FITS bitpix value itk_component add bitpix { util::LabelValue $w_.bitpix \ -text "Bitpix:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } if { "$itk_option(-panel_orient)" == "vertical" } { blt::blttable $w_ \ $itk_component(min) [incr row],0 -fill x -anchor w \ $itk_component(max) [incr row],0 -fill x -anchor w \ $itk_component(bitpix) [incr row],0 -fill x -anchor w } else { blt::blttable $w_ \ $itk_component(min) [incr row],0 -fill x -anchor w \ $itk_component(max) $row,1 -fill x -anchor w \ $itk_component(bitpix) $row,2 -fill x -anchor w } add_short_help $itk_component(min) {Estimated minimum raw image value} add_short_help $itk_component(max) {Estimated maximum raw image value} add_short_help $itk_component(bitpix) {Raw image FITS data type code} } # cut level controls if {$itk_option(-showcut)} { # LabelEntry(n) widget for the low cut level itk_component add low { LabelEntry $w_.low \ -text "Low:" \ -command [code $this set_cut_levels] \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -anchor e \ -relief sunken \ -validate real } { keep -state } # LabelEntry(n) widget for the high cut level itk_component add high { LabelEntry $w_.high \ -text "High:" \ -command [code $this set_cut_levels] \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -anchor e \ -relief sunken \ -validate real } { keep -state } if { "$itk_option(-panel_orient)" == "vertical" } { blt::blttable $w_ \ $itk_component(low) [incr row],0 -fill x -anchor w \ $itk_component(high) [incr row],0 -fill x -anchor w \ $itk_component(lrframe) [incr row],0 -fill x -anchor w } else { blt::blttable $w_ \ $itk_component(low) [incr row],0 -fill x -anchor w \ $itk_component(high) $row,1 -fill x -anchor w \ $itk_component(lrframe) $row,2 -fill x -anchor w } add_short_help $itk_component(low) \ {Image low cut value, type return after editing value} add_short_help $itk_component(high) \ {Image high cut value, type return after editing value} add_short_help $itk_component(autocut) \ {Set the image cut levels using median filtering} } # image transformation controls if {$itk_option(-showtrans)} { # RtdImageTrans(n) widget displaying the rotate, flip and zoom controls itk_component add trans { rtd::RtdImageTrans $w_.trans \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth [max $itk_option(-labelwidth) 5] \ -relief flat \ -panel_orient $itk_option(-panel_orient) \ -min_scale $itk_option(-min_scale) \ -max_scale $itk_option(-max_scale) \ -image $itk_option(-image) } { keep -state } blt::blttable $w_ \ $itk_component(trans) [incr row],0 -fill x -anchor w -columnspan 2 } # canvas for real-time status display itk_component add cameraStatus { canvas $w_.status -height 0 -width 0 } if { "$itk_option(-panel_orient)" == "vertical" } { blt::blttable $w_ \ $itk_component(cameraStatus) [incr row],0 -fill both -anchor nw } else { blt::blttable $w_ \ $itk_component(cameraStatus) $row,2 -fill both -anchor nw } blt::blttable configure $w_ c2 -padx 1m } public method camSts { args } { set var $image_ global ::$var lassign [set ${var}(ATTACHED)] sts camera updateCameraStatus $camera $sts } # update camera status display public method updateCameraStatus {camera status} { if {$status == 0} { set sts Detached } else { set sts Attached } $itk_component(cameraStatus) delete cameraStatus if {"$camera" == "RTDSIMULATOR"} { return } $itk_component(cameraStatus) create text 6 3 \ -text "Camera: \t$camera\n\t$sts" \ -anchor nw -font $itk_option(-labelfont) -tags cameraStatus } # Flash a green circle for real-time image events public method flash {onoff} { if {$onoff == 1} { $itk_component(cameraStatus) create oval 25 17 35 27 -fill green -tags flash } else { $itk_component(cameraStatus) delete flash } } # set the cut levels when the user types them in and hits return protected method set_cut_levels {args} { set low [$itk_component(low) get] set high [$itk_component(high) get] if {[catch {expr {$low}} msg] || [catch {expr {$high}} msg]} { error_dialog $msg } else { $image_ cut $low $high updateValues } } # set the cut levels public method cut_level_dialog {} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } utilReUseWidget rtd::RtdImageCut $w_.cut \ -image $itk_option(-image) \ -shorthelpwin $itk_option(-shorthelpwin) \ -transient 1 \ -command [code $this updateValues] } # update the cut level display window, if needed public method update_cut_window {} { if {[winfo exists $w_.cut] && [winfo viewable $w_.cut]} { $w_.cut update_graph } } # update the HDU window with the latest cut levels, if needed public method update_hdu_window {} { lassign [$image_ cut] low high if {"$low" == "" || "$high" == ""} { return } set l [$itk_component(low) cget -value] set h [$itk_component(high) cget -value] if {$low != $l || $high != $h} { set w [utilNamespaceTail $itk_option(-image)].hdu if {[winfo exists $w] && [winfo viewable $w]} { $w set_cut_levels $low $high } } } # set the cut levels automatically using median filtering... public method auto_set_cut_levels {} { busy {$image_ autocut} updateValues } # update the display with the current image values public method updateValues {} { if {$itk_option(-showobject)} { set s [$image_ object] if {"$s" == ""} { set s [file tail [$image_ cget -file]] } $itk_component(object) config -value $s } if {$itk_option(-showminmax)} { $itk_component(min) config -value [$image_ min] $itk_component(max) config -value [$image_ max] $itk_component(bitpix) config -value [$image_ bitpix] } #update_hdu_window if {$itk_option(-showcut)} { # avoid conflict with user typing lassign [$image_ cut] low high $itk_component(high) config -value $high $itk_component(low) config -value $low # set f [focus] # if {"$f" != "[$itk_component(low) component entry]"} { # $itk_component(low) config -value $low # } # if {"$f" != "[$itk_component(high) component entry]"} { # $itk_component(high) config -value $high # } } update_cut_window # update the bias display window, if needed if {[winfo exists .bias]} { .bias update_cuts } if {$itk_option(-showtrans)} { $itk_component(trans) update_trans } } # -- options -- # main RtdImage widget (set by caller) itk_option define -image image Image {} { set image_ [$itk_option(-image) get_image] set var $image_ global ::$var set ${var}(ATTACHED) "0 0" trace variable ${var}(ATTACHED) w [code $this camSts] } # Flag: if true, display the object name itk_option define -showobject showObject ShowObject 1 # Flag: if true, display x,y coordinates itk_option define -showxy showXy ShowXy 1 # Flag: if true, display ra,dec coordinates itk_option define -showwcs showWcs ShowWcs 1 # Flag: if true, display the min and max pixel values itk_option define -showminmax showMinMax ShowMinMax 1 # Flag: if true, display the image cut levels. itk_option define -showcut showCut ShowCut 1 # Flag: if true, display the transformation widgets (zoom factor, etc). itk_option define -showtrans showTrans ShowTrans 1 # Font to use for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # Font to use for values. itk_option define -valuefont valueFont ValueFont TkDefaultFont # Font to use for RA,DEC (a, b) labels (symbol). itk_option define -wcsfont wcsFont WcsFont TkDefaultFont # set the width for displaying labels itk_option define -labelwidth labelWidth LabelWidth 6 # set the width for displaying values itk_option define -valuewidth valueWidth ValueWidth 10 # set the state to normal/disabled to enable/disable editing itk_option define -state state State {normal} # optionally specify TopLevelWidget to display short help messages itk_option define -shorthelpwin shortHelpWin ShortHelpWin {} # minimum allowed scale value itk_option define -min_scale min_scale Min_scale -10 # maximum allowed scale value itk_option define -max_scale max_scale Max_scale 20 # Panel orient: one of {horizontal vertical} (default: horizontal) itk_option define -panel_orient panel_orient Panel_orient {} # -- protected vars -- # internal rtdimage widget for main image protected variable image_ # saved x coordinate for update after image event protected variable x_ 0 # saved y coordinate for update after image event protected variable y_ 0 } skycat-3.1.2-starlink-1b/rtd/library/RtdImagePerf.tcl000066400000000000000000000147561215713201500224240ustar00rootroot00000000000000# E.S.O. - VLT project # # RtdImagePerf.tcl - itcl widget to show current performance statistics. # # See man page RtdImagePerf(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # D. Hopkinson 31 Jan 97 Created # P.Biereichel 21/07/97 % display is the default + some bug fixes # P.Biereichel 01/03/01 Only % display suported + code revised itk::usual RtdImagePerf {} # RtdImagePerf is an itcl widget to show current performance statistics. itcl::class rtd::RtdImagePerf { inherit util::TopLevelWidget constructor {args} { eval itk_initialize $args wm title $w_ "Performance Test ($itk_option(-number))" wm protocol $w_ WM_DELETE_WINDOW "[code $this cancel]" make_layout } # make the window layout protected method make_layout {} { # main controls frame pack [set topf [frame $w_.topf]] -fill both -expand 1 # frame for labels pack [set labelf [frame $topf.labelf -borderwidth 2 -relief groove]] \ -fill x -expand 0 make_labels $labelf add_buttons } protected method new_field {w label txtvar txtvar2 shelp} { set var $target_image_ global ::$var util::LabelValue2 $w \ -text $label \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -valuewidth $itk_option(-valuewidth) \ -labelwidth $itk_option(-labelwidth) \ -relief groove \ -justify right \ -orient horizontal \ -shelp $shelp \ -anchor w if {[lempty $label]} { $w config -value $txtvar -value2 $txtvar2 -relief flat } else { $w config -textvariable ${var}($txtvar) $w config -textvariable2 ${var}($txtvar2) } } # make the window to display the statistics in the given frame protected method make_labels {w} { set var $target_image_ global ::$var new_field $w.actual "" "Actual" "Average" "" new_field $w.freq "Update Frequency:(Hz)" PERF_FREQ PERF_FREQ_AVE \ "Image Update Frequency (Hz)" new_field $w.gen "Processing time:\t(%)" PERF_GEN PERF_GEN_AVE \ "General Code Processing" new_field $w.tclf "Tcl code:\t\t(%)" PERF_TCL PERF_TCL_AVE \ "TCL code interpretation" new_field $w.xf "X Function calls:\t(%)" PERF_XFUNC PERF_XFUNC_AVE \ "X function calls" new_field $w.tf "Total time/image\t(msec):" PERF_TOTAL PERF_TOTAL_AVE \ "Total time spent per image event (msec)" itk_component add count { LabelValue $w.count \ -textvariable ${var}(PERF_COUNT) \ -text "Image counter:\t\t" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -valuewidth $itk_option(-valuewidth) \ -labelwidth $itk_option(-labelwidth) \ -relief groove \ -justify right \ -anchor w } pack $itk_component(count) \ -side bottom -padx 1m -pady 0m -anchor w -fill none -expand 1 [$itk_component(count) component entry] config -justify right add_short_help $itk_component(count) "Number of image events:" } # add a row of dialog buttons at the bottom of the window protected method add_buttons {} { # dialog buttons frame itk_component add buttons { frame $w_.buttons -borderwidth 2 -relief groove } pack $itk_component(buttons) \ -side top -fill x -expand 1 -padx 1m -pady 1m foreach {btn text shelp} { \ save "Save..." "Save: save the current performance settings to file" \ attach "Attach" "Attach: attach to camera" \ reset "Reset" "Reset: start new averaging" \ cancel "Close" "Close: close the test window"} { itk_component add $btn { button $w_.$btn \ -text $text \ -command [code $this $btn] } add_short_help $itk_component($btn) $shelp pack $itk_component($btn) \ -side left -expand 1 -padx 2m -pady 2m -in $itk_component(buttons) } } # attach to camera public method attach {} { global env if {! [catch {$itk_option(-target_image) attach_camera $env(RTD_CAMERA)} msg]} { return } error_dialog $msg } # Save the current performance parameters and image information to file. public method save {} { set var $target_image_ global ::$var set genvalue [set ${var}(PERF_GEN)] set tclvalue [set ${var}(PERF_TCL)] set xvalue [set ${var}(PERF_XFUNC)] set timevalue [set ${var}(PERF_TOTAL)] # Check that there is something to save before doing anything else. if {$genvalue == "" || $tclvalue == "" || $xvalue == ""} { return } # Get the required filename to save to. set imageFile [filename_dialog [pwd] * $w_] if {$imageFile == ""} { return } set file [open $imageFile w] puts $file "Performance Statistics Output" puts $file "" puts $file "STATS: Units - percentage of total time/image event" puts $file "General processing: $genvalue" puts $file "TCL code interpretation: $tclvalue" puts $file "X function calls: $xvalue" puts $file "Total time/image event (msecs): $timevalue" puts $file "" puts $file "IMAGE INFORMATION:" puts $file "Image width: [$target_image_ width]" puts $file "Image height: [$target_image_ height]" puts $file "Bytes/pixel: [expr {abs([$target_image_ bitpix])}]" puts $file "Image size (bytes): [expr {[$target_image_ width] * \ [$target_image_ height] * abs([$target_image_ bitpix]) / 8}]" puts $file "" puts $file "DISPLAY INFORMATION:" puts $file "Unscaled height: [$target_image_ height]" puts $file "Unscaled width: [$target_image_ width]" puts $file "Scaled height: [$target_image_ dispheight]" puts $file "Scaled width: [$target_image_ dispwidth]" puts $file "Scaling (x y): [$target_image_ scale]" puts $file "Flip (X): [$target_image_ flip x]" puts $file "Flip (Y): [$target_image_ flip y]" puts $file "Rotation: [$target_image_ rotate]" close $file } public method reset {} { $target_image_ perftest reset } # close this window public method cancel {} { $target_image_ perftest off destroy $w_ } # -- options -- # target (main) RtdImage itcl widget itk_option define -target_image target_image Target_image {} { set target_image_ [$itk_option(-target_image) get_image] } # font used for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # font used for values itk_option define -valuefont valueFont ValueFont TkDefaultFont # set the width for displaying labels itk_option define -labelwidth labelWidth LabelWidth 21 # set the width for displaying values itk_option define -valuewidth valueWidth ValueWidth 8 # -- protected vars -- # internal target image protected variable target_image_ } skycat-3.1.2-starlink-1b/rtd/library/RtdImagePick.tcl000066400000000000000000000706561215713201500224170ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: RtdImagePick.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImagePick.tcl - widget to select an object in an image using a centroid alg. # # See man page RtdImagePick(n) for a complete description. # # who when what # -------- -------- ---------------------------------------------- # Allan Brighton 25 Jun 96 Created # Peter Biereichel 01 Jul 97 modified for SOFI/ISAAC # Allan Brighton 23 Apr 98 Merged in Peter's changes, which include using # RtdImageZoomView for the image. # Fixed bug in "scale_changed" method (need to handle # width and height, not just width of image). # Added -orient option to change layout and changed # default to vertical. # Use init {} method, added "initialized_" flag. # Fixed comments for itcldoc and added public and # protected keywords to methods (for doc). # pbiereic 14/12/99 Apply transformations when a picked object is zoomed # pbiereic 04/11/03 Workaround bug in tcl 8.4.3 (SourceForge Request ID 835020) # Peter W. Draper 21/05/08 Add FWHM estimates in arcseconds. # 21/11/08 Add get_stats_ method to make access to image # statistics uniform for subclassing. itk::usual RtdImagePick {} # RtdImagePick is an itcl widget to select an object (a star, for example) in an # image and get statistics for it. It is based on the rtdimage(3) "statistics" # subcommand, which uses a centroid algorithm to locate the center of the object. itcl::class rtd::RtdImagePick { inherit util::TopLevelWidget # constructor: create a new RtdImagePick widget constructor {args} { eval itk_initialize $args } # destructor destructor { catch {cancel} catch {$target_image_ view remove $image_} } # This method is called after the options have been evaluated. protected method init {} { wm title $w_ "Pick Object ($itk_option(-number))" wm iconname $w_ "Pick Object ($itk_option(-number))" make_layout update_scale incr initialized_ wm resizable $w_ 0 0 } # This method is responsible for the window layout protected method make_layout {} { # main controls frame pack [set mainf [frame $w_.mainf]] \ -side top -fill both -expand 0 -padx 2 -pady 2 -ipadx 0 -ipady 0 pack [set topf [frame $mainf.topf]] \ -side top -fill both -expand 1 if {"$itk_option(-orient)" == "horizontal"} { make_labels $topf left make_rect $topf left } else { make_rect $topf top make_labels $topf top } add_buttons } # Create the window for displaying the statistics in the given frame. # The optional "side" arg is used for packing. protected method make_labels {w {side left}} { # frame for labels set labelf [frame $w.labelf -bd 2 -relief groove] pack $labelf -side $side -fill both -expand 1 # title for label area pack [label $labelf.title -text "Image Statistics:" ] \ -side top -pady 1m # LabelValue(n) widget: "Image X" itk_component add x { util::LabelValue $labelf.x \ -text "Image X:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } # LabelValue(n) widget: "Image Y" itk_component add y { util::LabelValue $labelf.y \ -text "Image Y:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for RA (alpha) itk_component add ra { util::LabelValue $labelf.ra \ -text "a:" \ -labelfont $itk_option(-wcsfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for DEC (delta) itk_component add dec { util::LabelValue $labelf.dec \ -text "d:" \ -labelfont $itk_option(-wcsfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for equinox itk_component add equinox { util::LabelValue $labelf.equinox \ -text "Equinox:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -valuewidth $itk_option(-valuewidth) \ -labelwidth $itk_option(-labelwidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for "Peak object level above bg" itk_component add object { util::LabelValue $labelf.object \ -text "Peak above bg:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -valuewidth $itk_option(-valuewidth) \ -labelwidth $itk_option(-labelwidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for "Background level" itk_component add background { util::LabelValue $labelf.background \ -text "Background level:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -valuewidth $itk_option(-valuewidth) \ -labelwidth $itk_option(-labelwidth) \ -relief groove \ -anchor e } # LabelValue(n) for "FWHM X:Y pixels" in pixels. itk_component add fwhm { util::LabelValue $labelf.fwhm \ -text "FWHM X:Y pixels:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -valuewidth $itk_option(-valuewidth) \ -labelwidth $itk_option(-labelwidth) \ -relief groove \ -anchor e } # LabelValue(n) for FHWM in "arcsecs". itk_component add fwhmarc { util::LabelValue $labelf.fwhmarc \ -text "arcsecs:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -valuewidth $itk_option(-valuewidth) \ -labelwidth $itk_option(-labelwidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for "Angle of X axis" itk_component add angle { util::LabelValue $labelf.angle \ -text "Angle of X axis:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -valuewidth $itk_option(-valuewidth) \ -labelwidth $itk_option(-labelwidth) \ -relief groove \ -anchor e } # LabelValue(n) widget for number of "Pixels in x,y" itk_component add nsize { util::LabelValue $labelf.nsize \ -text "Pixels in x,y:" \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -valuewidth $itk_option(-valuewidth) \ -labelwidth $itk_option(-labelwidth) \ -relief groove \ -anchor e } foreach el {x y ra dec equinox object background fwhm angle nsize fwhmarc} { [$itk_component($el) component entry] config -justify right -highlightthickness 0 pack [$itk_component($el) component label] [$itk_component($el) component entry] \ -ipadx 0 -ipady 0 -pady 1 -padx 0 } pack \ $itk_component(x) \ $itk_component(y) \ $itk_component(ra) \ $itk_component(dec) \ $itk_component(equinox) \ $itk_component(object) \ $itk_component(background) \ $itk_component(fwhm) \ $itk_component(fwhmarc) \ $itk_component(angle) \ $itk_component(nsize) \ -side top -padx 0.0m -pady 0.0m -fill x -expand 1 add_short_help $itk_component(x) \ {X image pixel coordinate (or X detector chip coord if known)} add_short_help $itk_component(y) \ {Y Image pixel coordinate (or Y detector chip coord if known)} add_short_help $itk_component(ra) \ {World Coordinates RA value} add_short_help $itk_component(dec) \ {World Coordinates DEC value} add_short_help $itk_component(equinox) \ {World Coordinates equinox (default: J2000)} add_short_help $itk_component(object) \ {Object: peak value of object above background} add_short_help $itk_component(background) \ {Background: mean background level} add_short_help $itk_component(fwhm) \ {FWHM: full width half maximum in pixels along X and Y} add_short_help $itk_component(fwhmarc) \ {FWHM: full width half maximum in arcsecs along X and Y} add_short_help $itk_component(angle) \ {Angle: angle of major axis, degrees, along X = 0} add_short_help $itk_component(nsize) \ {Number of pixels: along x and y-axis } } # Create the window used to display the part of the image being examined. # $w is the parent frame. # The optional "side" arg is used for packing. protected method make_rect {w {side left}} { # frame for rect pack [set rectf [frame $w.rectf -bd 2 -relief groove]] \ -side $side -fill both -expand 0 # add a frame to show the size of the square selected by the scale pack [label $rectf.label -text "Area of image to be examined:" ] \ -side top -padx 0 -pady 1m set rf [frame $rectf.rf \ -bd 0 -relief flat \ -width $itk_option(-maxsize) \ -height $itk_option(-maxsize)] pack $rf -fill none -expand 1 -anchor c # This component displays the section of the image that will be used for # the centroid algorithm and statistics. itk_component add zoomView { rtd::RtdImageZoomView $rf.zoomView \ -target_image $itk_option(-target_image) \ -verbose $itk_option(-verbose) \ -width $itk_option(-maxsize) \ -height $itk_option(-maxsize) \ -factor $itk_option(-factor) \ -propagate 0 \ -usexshm 1 \ -usexsync 1 \ -borderwidth 0 \ -relief groove \ -shelp {PickImage: displays section of image being examined} } set zoomImage [$itk_component(zoomView) component image] set image_ [$zoomImage get_image] set canvas_ [$zoomImage get_canvas] catch {pack forget [$itk_component(zoomImage) component hscrollf] \ [$itk_component(zoomImage) component vscrollf]} catch {destroy [$itk_component(zoomView) component check]} global ::$itk_component(zoomView).dozoom set $itk_component(zoomView).dozoom 1 $itk_component(zoomView) inc_zoom 0 pack [$itk_component(zoomView) component larger] -expand 1 pack [$itk_component(zoomView) component smaller] -expand 1 pack $itk_component(zoomView) -anchor c -fill none -expand 0 $itk_component(zoomView) inc_zoom 0 } # add a row of dialog buttons at the bottom of the window protected method add_buttons {} { # dialog buttons frame itk_component add buttons { frame $w_.buttons -borderwidth 2 -relief groove } pack $itk_component(buttons) \ -side top -fill x -expand 1 -ipadx 2 -padx 0 -pady 0 # "Pick Object" button itk_component add pick { button $w_.pick \ -text "Pick Object" \ -padx 0.1m \ -command [code $this pick_object] } # Cancel button itk_component add cancel { button $w_.cancel \ -text "Cancel" \ -padx 0.1m \ -command [code $this cancel] } # Close button itk_component add close { button $w_.close \ -text "Close" \ -padx 0.1m \ -command [code $this close] } pack \ $itk_component(pick) \ $itk_component(cancel) \ $itk_component(close) \ -side left -fill x -expand 1 -padx 0.5m -pady 0.5m -in $itk_component(buttons) add_short_help $itk_component(pick) \ {Pick Object: {bitmap b1} = select object in image and display center and other statistics} add_short_help $itk_component(cancel) {Cancel: cancel the current pick operation} add_short_help $itk_component(close) {Close: close the pick window} } # Let the user select a point in the image and get the statistics on # the area. The optional argument "parms" may be set to {x0, y0}, the # size of the image box. If given, pick_object returns the result without # user interaction. public method pick_object {{parms ""} {wait 0}} { if {! $initialized_} { after 1000 [code $this pick_object] return } cancel set waiting_ $wait $itk_component(zoomView) config -command {} $itk_component(zoomView) enter_image $target_image_ $itk_component(zoomView) config -command [code $this scale_changed] $w_ configure -cursor cross_reverse $itk_component(pick) config -state disabled set_values {} if {"$parms" == ""} { # wait for user to click in image set list_ [pick_object_in_image] } else { lassign $parms imageX_ imageY_ n # XXX needed for bug in tcl 8.4.3 set bug "$imageX_ $imageX_" set scale [expr {double($itk_option(-maxsize)) / $n}] set scale [round $scale] lassign [$image_ scale] cscale $itk_component(zoomView) inc_zoom [expr {$scale - $cscale}] update } $itk_component(pick) config -state normal $w_ configure -cursor {} $target_image_ zoomview stop #utilRaiseWindow $w_ ; # too slow if already raised (on Linux guest) if { $waiting_ } { return } if {[llength $list_] == 12} { set_values $list_ } } # This method is called to allow the user to pick an object in the main image. # The return value is a list of: # "ra dec equinox fwhmX fwhmY angle objectPeak meanBackground fwhmXa fwhmYa" # as returned from the rtdimage "statistics" subcommand, # or an error. protected method pick_object_in_image {} { set cursor [$target_canvas_ cget -cursor] $target_canvas_ configure -cursor cross_reverse set bindtags [bindtags $target_canvas_] set tag pick$w_ bind $tag [code $this picked_object] bindtags $target_canvas_ $tag global ::$w_.picked set $w_.picked {} tkwait variable $w_.picked bindtags $target_canvas_ $bindtags $target_canvas_ configure -cursor $cursor set ret [set $w_.picked] if {"$itk_option(-command)" != ""} { eval $itk_option(-command) [list $ret] } return $ret } # this method is called when the user clicks in the image to select an object # or star for the "pick_object" method. public method picked_object {} { # display busy cursor in image and pick window... $itk_option(-target_image) busy { busy { if {[catch {set list [get_stats_]} msg]} { error_dialog $msg cancel_pick } else { picked_wcs_object $list } } } } # This method can be called when the user has selected an object # or star for the "pick_object" method. # The argument should be the value returned from the rtdimage # "statistics" subcommand public method picked_wcs_object {retval} { global ::$w_.picked set $w_.picked $retval } # return the center image coordinates of the blinking marker or # -1 if the marker is not active. If user defined coordinates # are defined then return them instead. protected method getMarkCoords {} { if {$imageX_ > 0 && $imageY_ > 0} { return "$imageX_ $imageY_" } lassign [$target_canvas_ coords $pickc_] cx cy if {"$cx" == "" || "$cy" == ""} { return -1 } $target_image_ convert coords $cx $cy canvas x y image return "$x $y" } # callback from isrtdZoomView when the scaling was changed protected method scale_changed {} { set width [set height $itk_option(-maxsize)] $image_ convert dist $width $height canvas nxsize nysize image $itk_component(nsize) config -value [format_val $nxsize] lassign [getMarkCoords] imageX imageY set_values {} cancel 0 # update the view if fwhm has been calculated if {$imageX < 1} { return } # handle transformations for updating the view set flip [expr {[$target_image_ flip X] << 1 | [$target_image_ flip Y]}] switch $flip { 0 { #; none set xc [expr {$imageX - ($nxsize/2.0)}] set yc [expr {[$image_ height] - $imageY - ($nysize/2.0)}] } 1 { #; flipY set xc [expr {$imageX - ($nxsize/2.0)}] set yc [expr {$imageY - ($nysize/2.0)}] } 2 { #; flipX set xc [expr {[$image_ width] - $imageX - ($nxsize/2.0)}] set yc [expr {[$image_ height] - $imageY - ($nysize/2.0)}] } 3 { #; flipX and flipY set xc [expr {[$image_ width] - $imageX - ($nxsize/2.0)}] set yc [expr {$imageY - ($nysize/2.0)}] } } $target_image_ view update $image_ $xc $yc $width $height 0 0 0 0 image set list_ {} if { $waiting_ } { return } $itk_option(-target_image) busy { busy { if {! [catch {set list_ [get_stats_]} msg]} { if {[llength $list_] == 12} { set_values $list_ 0 } } } } } # format a floating point value (which may also be empty) protected method format_val {val} { if {"$val" == ""} { return } return [format {%.1f} $val] } # set the values of the labels from the list (results of "pick_object" call). # If list is empty the labels are cleared. # If the list is not empty, mark the ra,dec spot in the image. protected method set_values {list {with_rmt 1}} { lassign $list x y ra dec equinox fwhmX fwhmY angle object background fwhmXa fwhmYa # create a dot which is used to mark the center pixel $target_canvas_ delete $pickc_ if {"$x" != "" && "$y" != ""} { $target_image_ convert coords $x $y image xc yc canvas $target_canvas_ create oval $xc $yc $xc $yc \ -tags "$pickc_ objects" } # display x,y in chip coords if {"$x" != "" && "$y" != ""} { $target_image_ convert coords $x $y image xc yc chip } else { set xc $x set yc $y } $itk_component(x) config -value [format_val $xc] $itk_component(y) config -value [format_val $yc] $itk_component(ra) config -value $ra $itk_component(dec) config -value $dec $itk_component(equinox) config -value $equinox $image_ convert dist 0 $itk_option(-maxsize) canvas 0 nsize image $itk_component(nsize) config -value [format_val $nsize] $itk_component(object) config -value [format_val $object] $itk_component(background) config -value [format_val $background] if {"$fwhmX" == "" || $fwhmX > 0 && $fwhmY > 0} { $itk_component(fwhm) config -value "[format_val $fwhmX] : [format_val $fwhmY]" [$itk_component(fwhm) component entry] config -foreground black $itk_component(angle) config -value [format_val $angle] } else { $itk_component(fwhm) config -value "Can't do" [$itk_component(fwhm) component entry] config -foreground red $itk_component(angle) config -value "" } if { "$fwhmXa" != {} } { $itk_component(fwhmarc) config -value "[format_val $fwhmXa] : [format_val $fwhmYa]" } else { $itk_component(fwhmarc) config -value "" } if {"$x" != "" && "$y" != ""} { set imageX_ $x set imageY_ $y } if {"$x" != "" && "$y" != "" && $fwhmX < 50 && $fwhmY < 50} { mark_spot $x $y $image_ $canvas_ $angle $fwhmX $fwhmY mark_spot $x $y $target_image_ $target_canvas_ $angle $fwhmX $fwhmY 1 if {$set_result_ && $with_rmt} { if {$x < 0 || $y < 0 || $x > [$image_ width] || $y > [$image_ height]} { set_result -1 } else { set_result "$x $y $fwhmX $fwhmY" } set set_result_ 0 } } } # set the set_result_ variable to 1 protected method set_result_value {} { set set_result_ 1 } # mark the given x,y image coordinate point in the given image/canvas with # a cross with the given width, height (image pixels) and angle (deg). protected method mark_spot {xc yc image canvas angle w h {blink 0}} { # convert to radian set rad [expr {$angle/57.2958}] # deltas for X and Y axis set dxX [expr {cos($rad) * $w/2.0}] set dyX [expr {sin($rad) * $w/2.0}] set dxY [expr {cos($rad) * $h/2.0}] set dyY [expr {sin($rad) * $h/2.0}] # compute end points for X-axis and convert them to canvas coordinates $image convert coords [expr {$xc + $dxX}] [expr {$yc + $dyX}] image x1X y1X canvas $image convert coords [expr {$xc - $dxX}] [expr {$yc - $dyX}] image x2X y2X canvas # the Y-axis is rotated "by hand" so that it appears perpendicular to the X-axis $image convert coords [expr {$xc + $dyY}] [expr {$yc - $dxY}] image x1Y y1Y canvas $image convert coords [expr {$xc - $dyY}] [expr {$yc + $dxY}] image x2Y y2Y canvas # draw X and Y axis lines with an outer thick black line # and inner thin white line set bg black set tags "mark objects" $canvas delete $tags foreach width {5 2} { $canvas create line $x1X $y1X $x2X $y2X \ -fill $bg \ -width $width \ -tags "$tags $bg" $canvas create line $x1Y $y1Y $x2Y $y2Y \ -fill $bg \ -width $width \ -tags "$tags $bg" set bg white } if {$blink} { blink_mark $canvas $tags } } # This method is used to make the marker given by "tags" blink on # and off. protected method blink_mark {canvas tags {color 0}} { catch {after cancel $afterId_} set tag [lindex $tags 0] if {"[$canvas gettags $tag]" == ""} { return } set idx1 $color set cols "black white" set col1 [lindex $cols $idx1] set idx2 [expr {! $color}] set col2 [lindex $cols $idx2] $canvas itemconfigure white -fill $col2 $canvas itemconfigure black -fill $col1 set afterId_ [after 500 [code $this blink_mark $canvas $tag $idx2]] return } # cancel the current pick operation public method cancel {{with_pick 1}} { $canvas_ delete mark $target_canvas_ delete mark $pickc_ if {$with_pick} { cancel_pick set imageX_ -1 set imageY_ -1 set waiting_ 0 } } # close this window public method close {} { cancel if {$set_result_} { set set_result_ 0 set_result -1 } after idle "wm withdraw $w_" } # this method is called when the user clicks in the image to select an object # or star for the "pick_object" method. In this case, the x,y and ra,dec position # are fixed and only the other info should be calculated (used). public method picked_special_object {x y ra dec equinox} { # display busy cursor in image and pick window... $itk_option(-target_image) busy { busy { if {[catch {set list [get_stats_]} msg]} { error_dialog $msg cancel_pick } else { lassign $list {} {} {} {} {} fwhmX fwhmY angle object background fwmhXa fwhmYa picked_wcs_object \ [list $x $y $ra $dec $equinox $fwhmX $fwhmY $angle $object $background $fwhmXa $fwhmYa] } } } } # cancel the wait for the pick_object method and reset the cursor public method cancel_pick {} { global ::$w_.picked set $w_.picked "" } # dummy (called by RtdImage.tcl which assumes that the scaling is propagated) public method update_scale {{fx 1} {fy 1}} { } # returns statistics after image event public method update_now {} { global ::$w_.picked if [$image_ isclear] { return } if {! $waiting_ } { if {"[set $w_.picked]" == ""} { return } } set waiting_ 0 if {[catch {set list [get_stats_]} msg]} { return } $canvas_ delete mark $target_canvas_ delete mark set_values $list } # return name of global variable which contains the statistics public method get_pickVar {} { return $w_.picked } # return the image statistics. protected method get_stats_ {} { return [$image_ statistics] } # -- options -- # target (main) RtdImage itcl widget itk_option define -target_image target_image Target_image {} { set img [cget -target_image] set target_image_ [$img get_image] set target_canvas_ [$img get_canvas] } # X shared memory option itk_option define -usexshm useXshm UseXshm 1 # X synchronisation option itk_option define -usexsync useXsync UseXsync 1 # flag: if true, print diagnostic messages itk_option define -verbose verbose Verbose {0} # font to use for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # font to use for values itk_option define -valuefont valueFont ValueFont TkDefaultFont # font to use for ra,dec labels (alpha, delta) itk_option define -wcsfont wcsFont WcsFont {Symbol -14} # set the width for displaying labels and values itk_option define -labelwidth labelWidth LabelWidth 16 # set the width for displaying labels and values itk_option define -valuewidth valueWidth ValueWidth 11 # set the max size of the image sample area (screen dist) itk_option define -maxsize maxSize MaxSize 200 # command to evaluate when a selection is made or canceled itk_option define -command command Command {} # debugging flag itk_option define -debug debug Debug 0 # default zoom magnification factor itk_option define -factor factor Factor {10} { set factor_ [cget -factor] } # Specify the orientation of image and panel, one of {vertical horizontal} itk_option define -orient orient Orient "vertical" # -- protected vars -- # internal target image protected variable target_image_ # internal target canvas protected variable target_canvas_ # internal canvas widget protected variable canvas_ # internal zoomView rtd image protected variable image_ protected variable set_result_ 0 # output of last statistics command after scaling and pick object command protected variable list_ # id for blink after job protected variable afterId_ # waiting for image event before returning result protected variable waiting_ 0 # set to 1 after init {} was called protected variable initialized_ 0 # requested X coordinate protected variable imageX_ -1 # requested Y coordinate protected variable imageY_ -1 # tag Id for dot in canvas protected variable pickc_ "pickc" } skycat-3.1.2-starlink-1b/rtd/library/RtdImagePick2.tcl000066400000000000000000000721401215713201500224670ustar00rootroot00000000000000#************************************************************************* # E.S.O. - VLT project/ ESO Archive # # "@(#) $Id: RtdImagePick2.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImagePick2.tcl - Pick object with a given sample size # # See the man page for a complete description. # # who when what # -------- -------- ---------------------------------------------- # pbiereic 01/07/01 created # RtdImagePick2 is used to pick an object with a given sample size which # can be changed interactively with a slider. # Two pick modes are implemented: pick object and pick cursor (that's why # it is called RtdImagePick2). # Pick object uses a centroiding algorithm for finding the object center # and displays the statistics likewise RtdImagePick does. # Pick cursor simply displays the picked x, y coordinates. # # The itk option -pickedCmd is evaluated whenever an object was picked. # It returns a tcl list with the following values: # # { x y ra dec equinox fwhmX fwhmY angle peak background } { nsamples } # # The command option -newSizeCmd is evaluated whenever the sample # size is changed. It returns the number of samples. # # The command option -newImageCmd is evaluated whenever a new image (i.e. an image with # a different type or size) is loaded and also when it is cleared. # # RtdImagePick2 uses the second zoom provided by RTD via class RtdImagePickView. # # It can co-exist with RtdImagePick, i.e. it checks the X cursor font to # determine if the click in the canvas is assigned to this widget. # # RtdImagePick2 listens to image events which are either a new image or # real-time image events. When the option -postImageEvent is true then # the statistics is updated with every new image event (which may slow down # the display rate). # # Applications (like tcscam) can inherit this class and add their own widgets. # With method 'add_my_button' one can add a control button. # The main frame components are public (i.e. the component name will not # change). They are: # # $itk_component(infof) - info frame # $itk_component(zoomf) - zoom frame # $itk_component(sliderf) - slider frame # $itk_component(choicef) - choice frame # $itk_component(buttonf) - button frame # # The frames (and all other widgets) are packed with the blt::blttable geometry # manager. The 'pack' geometry manager should not be used (see LIMITATIONS # on man page of table(BLT 2.4). # # There are options like -with_info, -with_choice which are set to 1 by default # to show all frames (see options). They can be set to 0 and the application # can re-arrange the frames (via blt::blttable) as required. # # NOTES # - In contrast to RtdImagePick, RtdImagePick2 does not use tkwait which may # cause problem for an inheriting class due to nested calls to tkwait. itk::usual RtdImagePick2 { } itcl::class rtd::RtdImagePick2 { inherit util::TopLevelWidget constructor { args } { eval itk_initialize $args } destructor { catch { close } } # init is called by the TopLevelWidget after the itk options # have been evaluated. protected method init { } { wm protocol $w_ WM_DELETE_WINDOW [code $this close] wm title $w_ "Pick Object" config -samplesize 40 ; # sample size at start if { [cget -with_menu] } { make_menu ; # Make the menu } make_layout ; # Make the window layout $itk_component(smaller) config -command [code $this inc_zoom -1] $itk_component(larger) config -command [code $this inc_zoom 1] # set canvas and widget bindings $canvas_ bind all "+[code $this picked_object]" $canvas_ bind $image_ "+[code $this config_cursor]" bind enter$w_ "+[code $this this_entered 1]" bind leave$w_ "+[code $this this_entered 0]" bindtags $w_ "enter$w_ leave$w_" wm resizable $w_ 0 0 ; # resizing is possible but makes layout worse } # Make the menu. Add menubar and menus protected method make_menu { } { add_menubar set m [add_menubutton File] add_menuitem $m command "Close" \ {Close this window} \ -command [code $this close] set m [add_menubutton View] add_menuitem $m checkbutton "Update after image events" \ {Update statistics after every new real-time image event} \ -variable $w_.postImageEvent -onvalue 1 -offvalue 0 \ -command [code $this setPostImageEvent] global ::$w_.postImageEvent set $w_.postImageEvent [cget -postImageEvent] set magMenu_ $m.mag add_menuitem $m cascade "Magnification" \ {Set the magnification factor of the zoom} \ -menu [menu $magMenu_] loop i 2 31 { $m.mag add radiobutton -label " ${i}x" \ -command [code $this scaleZoom $i] \ -variable $magMenu_ } } # Make the window layout protected method make_layout { } { if { [cget -with_menu] } { set w $w_.mainf # use same geometry manager as for the menubar pack [frame $w] -expand 1 -fill both } else { set w $w_ } if { "[cget -panel_orient]" == "horizontal" } { add_mframe $w infof make_info [cget -with_info] raised 0,0 "-fill both" add_mframe $w zoomf make_zoom 1 raised 0,1 "-fill both" add_mframe $w sliderf make_sldframe [cget -with_slider] raised 1,0 "-fill both" add_mframe $w choicef make_choice [cget -with_choice] raised 1,1 "-fill both" add_mframe $w buttonf make_buttons [cget -with_buttons] groove 2,0 \ "-columnspan 2 -fill x" } else { add_mframe $w infof make_info [cget -with_info] raised 2,0 "-fill both" add_mframe $w zoomf make_zoom 1 raised 0,0 "-fill both" add_mframe $w sliderf make_sldframe [cget -with_slider] raised 3,0 "-fill both" add_mframe $w choicef make_choice [cget -with_choice] raised 1,0 "-fill both" add_mframe $w buttonf make_buttons [cget -with_buttons] groove 4,0 "-fill x" } } # Add a frame to the main blt table of this mega widget. # Add frame component, execute the method which create the widgets # within the component and add the component to the blt table. protected method add_mframe { w compo methd map relief idx opts } { itk_component add $compo { frame $w.$compo -borderwidth 2 -relief $relief } eval $methd $itk_component($compo) if { $map } { eval blt::blttable $w $itk_component($compo) $idx $opts } } # Add short help text for a component protected method add_shelp { compo text } { add_short_help $itk_component($compo) $text } # Add a LabelValue widget to a blt table protected method add_label { w compo text idx { font labelfont } } { set wdg $w.$compo itk_component add $compo { util::LabelValue $wdg \ -text $text \ -labelfont $itk_option(-$font) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor e } catch { [$wdg component entry] config -justify right -highlightthickness 0 [$wdg component label] config -pady 0 } blt::blttable $w $wdg $idx -fill x -anchor e } # Create the widgets for displaying the statistics protected method make_info { w } { set idx -1 add_label $w x "Image X:" [incr idx],0 add_label $w y "Image Y:" [incr idx],0 add_label $w ra "a:" [incr idx],0 wcsfont add_label $w dec "d:" [incr idx],0 wcsfont add_label $w equin "Equinox:" [incr idx],0 add_label $w peak "Peak above bg:" [incr idx],0 add_label $w back "Background level:" [incr idx],0 add_label $w fwhm "FWHM X:Y:" [incr idx],0 add_label $w angle "Angle of X axis:" [incr idx],0 add_label $w nsize "Pixels in x,y:" [incr idx],0 add_shelp x "X image pixel coordinate (or X detector chip coord if known)" add_shelp y "Y Image pixel coordinate (or Y detector chip coord if known)" add_shelp ra "World Coordinates RA value" add_shelp dec "World Coordinates DEC value" add_shelp equin "World Coordinates equinox (default: J2000)" add_shelp peak "Object: peak value of object above background" add_shelp back "Background: mean background level" add_shelp fwhm "FWHM: full width half maximum in X and Y" add_shelp angle "Angle: angle of major axis, degrees, along X = 0" add_shelp nsize "Number of pixels: along x and y-axis " } # Create a zoom window used to display the part of the # image to be examined. protected method make_zoom { w } { itk_component add zoomView { rtd::RtdImagePickView $w.zoomView \ -target_image $itk_option(-target_image) \ -factor $itk_option(-zoomFact) \ -command [code $this zoomScaledCb] } blt::blttable $w $itk_component(zoomView) 0,0 } # Add a button and add to blt table protected method add_button { w compo text idx command } { itk_component add $compo { button $w.$compo -text $text -command $command } blt::blttable $w $itk_component($compo) $idx -fill x } # Add an application specific button public method add_my_button { idx compo text command shelp } { set w $itk_component(buttonf) if { "[cget -panel_orient]" == "horizontal" } { # add button and redo packing set names [blt::blttable search $w -pattern *] add_button $w $compo $text 0,$idx $command set names [linsert $names $idx $itk_component($compo)] set i -1 foreach name $names { blt::blttable $w $name 0,[incr i] -fill x } } else { add_button $w $compo $text 1,$idx $command } add_shelp $compo $shelp return $itk_component($compo) } # Add control buttons protected method make_buttons { w } { set idx -1 add_button $w pick "Pick Object" 0,[incr idx] [code $this pick_object] add_button $w cancel "Cancel" 0,[incr idx] [code $this cancel 1] add_button $w close "Close" 0,[incr idx] [code $this close] add_shelp pick \ {Pick Object: {bitmap b1} = select object in image and display \ center and other statistics} add_shelp cancel {Cancel: cancel the current pick operation} add_shelp close {Close: close the pick window} } # Create the slider widget protected method make_slider { w } { itk_component add slider { util::LabelEntryScale $w.slider \ -show_arrows 1 -increment 1 -valuewidth 4 \ -text "Sample size (in image pixels):" \ -orient vertical \ -length $itk_option(-maxSsize) \ -value [cget -samplesize] \ -from $itk_option(-minSsize) \ -to $itk_option(-maxSsize) \ -validate numeric \ -scaleWidth 10 } add_shelp slider \ {Slider: set the size of the image area to examine (in image pixels)} # configure slider widget and change the layout set sldWdg $itk_component(slider) $sldWdg config -command [code $this update_rect] \ -entrycommand [code $this update_rect] [$sldWdg component label] config -justify left blt::blttable $sldWdg \ [$sldWdg component label] 0,0 -anchor w -fill x \ [$sldWdg component entry] 0,1 -anchor e \ [$sldWdg component scaleframe] 1,0 -fill x -columnspan 2 -padx 1m } # add slider widget protected method make_sldframe { w } { make_slider $w blt::blttable $w $itk_component(slider) 0,0 -anchor w -fill x } # Create pick control frame protected method make_choice { w } { # pick mode choice set rbChoice $w.rbChoice itk_component add rbChoice { util::LabelChoice $rbChoice \ -text "Select pick mode" \ -orient vertical \ -choice {"Pick Object" "Pick Cursor"} \ -variable $w_.pickMode \ -value "Pick Object" \ -anchor c \ -command [code $this set_pickmode] } # cross marker checkbutton and zoom buttons set zoomctrlf $w.zoomctrlf itk_component add zoomctrlf { frame $zoomctrlf } # button to show cross markers set var $w_.pickMark global ::$var itk_component add pickMark { checkbutton $zoomctrlf.pickMark -text "X" -variable $var \ -command [code $this toggleMarker $var] } set $var $itk_option(-showMarker) add_shelp pickMark {Show/hide cross marker when object was picked} # Zoom buttons itk_component add larger { button $zoomctrlf.larger -bitmap magnify -command [code $this inc_zoom 1] } itk_component add smaller { button $zoomctrlf.smaller -bitmap shrink -command [code $this inc_zoom -1] } add_shelp larger {Zoom larger: {bitmap b1} = increase magnification of zoom image} add_shelp smaller {Zoom smaller: {bitmap b1} = decrease magnification of zoom image} # label for scale factor itk_component add scalelab { label $zoomctrlf.label -text "" -width 3 -font $itk_option(-labelfont) } blt::blttable $zoomctrlf \ $itk_component(pickMark) 0,0 -fill y -anchor w -columnspan 3 \ $itk_component(larger) 1,0 -fill x \ $itk_component(smaller) 1,1 -fill x \ $itk_component(scalelab) 1,2 -fill x blt::blttable $w \ $itk_component(rbChoice) 0,0 -fill both \ $itk_component(zoomctrlf) 0,1 -fill both } # activate / de-activate the widget. protected method activate { bool } { if { $bool == $activated_ || ( $bool != 0 && [$image_ isclear] ) } { return } set im $itk_option(-target_image) if { $bool } { # use the "new image" callback for initialization newImageCb # expand zoom window to fill the zoom frame (minus the borderwidth) set bd 6 set width [expr {[winfo width $itk_component(zoomf)] - $bd}] set height [expr {[winfo height $itk_component(zoomf)] - $bd}] $itk_component(zoomView) change_size $width $height # activate the zoom view widget $itk_component(zoomView) activate 1 # install callbacks for new images and image events set cmd [$im cget -newimagecmd] set newImgCmd_ " ; [code $this newImageCb]" $im config -newimagecmd "$cmd$newImgCmd_" set cmd [$im cget -cameraPostCmd] set postCmd_ " ; [code $this updateImageCb]" $im config -cameraPostCmd "$cmd$postCmd_" } else { # de-activate the zoom view widget $itk_component(zoomView) activate 0 # remove callbacks for new images and image events set cmd [$im cget -newimagecmd] regsub $newImgCmd_ $cmd "" cmd $im config -newimagecmd $cmd set cmd [$im cget -cameraPostCmd] regsub $postCmd_ $cmd "" cmd $im config -cameraPostCmd $cmd } set activated_ $bool } # newImageCb is called whenever a new image (i.e. an image with # a different type or size) is loaded and also when it is cleared. protected method newImageCb { args } { if { [$image_ isclear] } { cancel if { "$itk_option(-newImageCmd)" != ""} { eval $itk_option(-newImageCmd) } return } updateMarker 0 # check that the last picked coords are within the range # of the new image. If not, use the center coords. set width [$image_ width] set height [$image_ height] # check if there was one pick if {"$pickx_" == ""} { $image_ convert coords \ [expr {$width / 2.0}] [expr {$height / 2.0}] image \ pickx_ picky_ chip } $image_ convert coords $pickx_ $picky_ chip x y image # check if center coords are in bounds if { $x > $width || $y > $height } { $image_ convert coords $x $y image pickx_ picky_ chip set_values {} } $itk_component(zoomView) moveTo $pickx_ $picky_ # check sample size set size [cget -samplesize] set maxsize [min $width $height] if { $size > $maxsize } { set size $maxsize config -samplesize $size } $itk_component(slider) config -value $size $itk_component(zoomView) config -ssize $size if { "$itk_option(-newImageCmd)" != ""} { eval $itk_option(-newImageCmd) } } # updateImageCb is called after an image event protected method updateImageCb { args } { catch { # check if the statistics of the actual image can be updated if { ! [cget -postImageEvent] || $picking_ || ! $activated_ || \ $pickMode_ == 1 || [ $image_ isclear ] } { return } if { [lempty $pickx_] } { return } set result [$itk_component(zoomView) statistics $pickx_ $picky_] $itk_component(zoomView) moveTo $pickx_ $picky_ set_values $result 1 } } # setup new center coords and sample size for method pick_object public method setup_pick { xref yref sampleSize } { update_rect $sampleSize set_values "$xref $yref" set pickx_ $xref set picky_ $yref $itk_component(zoomView) moveTo $xref $yref } # pick an object in the image and get the statistics on # the area. Currently the args list is not used. public method pick_object { args } { if { $picking_ || [$image_ isclear] } { return } # update and raise is needed for method activate raise $w_ update idletasks updateMarker 0 # prepare for event which calls method picked_object activate 1 ; # activate zoom picking 1 ; # change mode to "picking" } # picked_object is called when the user has clicked in the image # to select an object or star for the "pick_object" method. protected method picked_object { } { # return if the mouse click is not for us set cs [lindex "$cs_pick_ $cs_click_" $pickMode_] if { ! $picking_ || "$cs" != "[$canvas_ cget -cursor]" } { return } # get chip coordinates at cursor position set by the rtdimage code global ::$image_ lassign "[set ${image_}(X)] [set ${image_}(Y)]" x y picking 0 ; # stop the zoom if { [$image_ isclear] } { return } # set result according to the current pick mode if { $pickMode_ == 0 } { # get statistics $itk_option(-target_image) busy { set result [$itk_component(zoomView) statistics $x $y] } } else { # set result to the displayed x,y coords set result "$x $y" } lassign $result xc yc set pickx_ $xc set picky_ $yc # move to new center of image $itk_component(zoomView) moveTo $xc $yc raise $w_ set_values $result if { "$itk_option(-pickedCmd)" != "" } { eval $itk_option(-pickedCmd) {"[list $result [cget -samplesize]]"} } } # close this window protected method close { } { cancel 1 ; # cleanup activate 0 ; # de-activate the zoom and events wm withdraw $w_ } # set pick mode protected method set_pickmode { args } { global ::$w_.pickMode if { "[set $w_.pickMode]" == "Pick Object" } { set pickMode_ 0 } else { set pickMode_ 1 } $itk_component(pick) config -text \ [lindex [$itk_component(rbChoice) cget -choice] $pickMode_] config_cursor } # cancel pick operation public method cancel { { eval_cmd 0 } } { if { $eval_cmd } { updateMarker 0 if { "$itk_option(-cancelCmd)" != ""} { eval $itk_option(-cancelCmd) } } picking 0 } # Show image at last picked coords when mouse ptr. enters this widget. # Otherwise: switch zoom on when picking is active, else off. public method this_entered { bool } { if { ! $bool && $picking_ } { $itk_component(zoomView) zoom 1 } else { $itk_component(zoomView) zoom 0 if { [lempty $pickx_] } { return } $itk_component(zoomView) moveTo $pickx_ $picky_ } } # change cursor when mouse pointer enters or leaves the image. # This is only done when the default cursor is displayed. protected method config_cursor { } { set cursor [$canvas_ cget -cursor] set cs [lindex "$cs_pick_ $cs_click_" $pickMode_] if { $picking_ } { if { "$cursor" == "" || "$cursor" == "$cs_pick_" || \ "$cursor" == "$cs_click_"} { $canvas_ configure -cursor $cs $w_ configure -cursor $cs } } else { if { "$cursor" == "$cs_pick_" || "$cursor" == "$cs_click_"} { $canvas_ configure -cursor {} $w_ configure -cursor {} } } } # set state picking / zooming and configure the widgets protected method picking { bool } { if { $bool == $picking_ } { return } if { $bool } { $itk_component(zoomView) zoom 1 $itk_component(pick) config -state disabled } else { $itk_component(zoomView) zoom 0 $itk_component(pick) config -state normal } set picking_ $bool config_cursor } # set the values of the labels from the list (results of "pick_object" call). # If list is empty the labels are cleared. protected method set_values { list { imgEvt 0 } } { set list_ "" foreach wdg [winfo children $itk_component(infof)] { catch { $wdg config -value "" } } if { [lempty $list] } { return } set pickOk 1 lassign $list x y ra dec equin fwhmX fwhmY angle peak back $itk_component(x) config -value [format_val $x] $itk_component(y) config -value [format_val $y] $itk_component(nsize) config -value [format_val [cget -samplesize]] if { $pickMode_ == 0 } { if {"$fwhmX" == "" || $fwhmX > 0 && $fwhmY > 0} { $itk_component(ra) config -value $ra $itk_component(dec) config -value $dec $itk_component(equin) config -value $equin $itk_component(peak) config -value [format_val $peak] $itk_component(back) config -value [format_val $back] $itk_component(angle) config -value [format_val $angle] $itk_component(fwhm) config -value "[format_val $fwhmX] : [format_val $fwhmY]" set fgcol black } else { # "Can't do" was displayed by the first astronomical image processing # system in the world, named IHAP. if { ! $imgEvt } { $itk_component(fwhm) config -value "Can't do" } $itk_component(angle) config -value "" set fgcol red set pickOk 0 } [$itk_component(fwhm) component entry] config -foreground $fgcol } lappend list_ $list "$pickMode_ $pickOk" updateMarker } # update the size of the square in the zoom canvas from the slider widget. # "size" is the size of the sample image in image pixels public method update_rect { {size 0} } { # check requested size if {$size < $itk_option(-minSsize) || \ $size > $itk_option(-maxSsize) || \ $size > [min [$image_ width] [$image_ height]]} { $itk_component(slider) select ; # just select - no warning message return } config -samplesize $size $itk_component(zoomView) config -ssize $size $itk_component(zoomView) update_rect $itk_component(slider) config -value $size if { "$itk_option(-newSizeCmd)" != "" } { eval $itk_option(-newSizeCmd) $size } } # increment or decrement the zoom factor protected method inc_zoom { inc } { $itk_component(zoomView) inc_zoom $inc updateMarker } # display the scale factor of the zoom widget protected method zoomScaledCb { args } { set f [$itk_component(zoomView) get_scale] $itk_component(scalelab) config -text "${f}x" } # scale the zoom widget protected method scaleZoom { scale } { $itk_component(zoomView) set_scale $scale zoomScaledCb updateMarker } # format a floating point value (which may also be empty) protected method format_val { val } { if {"$val" == ""} { return } return [format {%.1f} $val] } # configure the -postImageEvent option protected method setPostImageEvent { args } { global ::$w_.postImageEvent config -postImageEvent [set $w_.postImageEvent] } # toggle the visibility of the blinking marker protected method toggleMarker { var } { global ::$var config -showMarker [set $var] updateMarker } # show/hide blinking marker when object was picked. In pick # cursor mode a simple cross is displayed and in pick object # mode the cross marking the fwhm values. protected method updateMarker { {show -1} } { if { [lempty $list_] && $show != 0 } { return } set zoomIm [$itk_component(zoomView) get_image] set zoomCv [$itk_component(zoomView) get_canvas] if { $show == -1 } { set show [cget -showMarker] } lassign [lindex $list_ 0] x y ra dec equinox fwhmX fwhmY angle peak background lassign [lindex $list_ 1] pickMode pickOk if { $show && $pickOk } { $image_ convert coords $x $y chip x y image if { $pickMode == 0 } { mark_spot $x $y $zoomIm $zoomCv $angle $fwhmX $fwhmY mark_spot $x $y $image_ $canvas_ $angle $fwhmX $fwhmY 1 } else { $image_ convert coords 5 5 image nx ny image mark_spot $x $y $zoomIm $zoomCv 0 $nx $ny mark_spot $x $y $image_ $canvas_ 0 $nx $ny 1 } } else { catch {$zoomCv delete mark$zoomIm} catch {$canvas_ delete mark$image_} } } # mark the x,y image coordinate point in the canvas with # a cross with the width, height (image pixels) and angle (deg). protected method mark_spot {xc yc image canvas angle w h {blink 0}} { set tags "mark$image objects" catch { $canvas delete mark$image } if { $xc > [$image width] || $yc > [$image height] || \ $xc < 1 || $yc < 1 || [catch {expr {$angle / 2.0}}] } { return } # convert angle to radian set rad [expr {$angle / 57.2958}] # deltas for X and Y axis set dxX [expr {cos($rad) * $w/2.0}] set dyX [expr {sin($rad) * $w/2.0}] set dxY [expr {cos($rad) * $h/2.0}] set dyY [expr {sin($rad) * $h/2.0}] # compute end points for X-axis and convert points to canvas coordinates $image convert coords [expr {$xc + $dxX}] [expr {$yc + $dyX}] image x1X y1X canvas $image convert coords [expr {$xc - $dxX}] [expr {$yc - $dyX}] image x2X y2X canvas # the Y-axis is rotated "by hand" so that it appears perpendicular to the X-axis $image convert coords [expr {$xc + $dyY}] [expr {$yc - $dxY}] image x1Y y1Y canvas $image convert coords [expr {$xc - $dyY}] [expr {$yc + $dxY}] image x2Y y2Y canvas # draw X and Y axis lines with an outer thick black line # and inner thin white line foreach width {3 1} bg {black white} { set opts "-fill $bg -width $width -tags {$tags $bg}" eval $canvas create line $x1X $y1X $x2X $y2X $opts eval $canvas create line $x1Y $y1Y $x2Y $y2Y $opts } if { $blink } { blink_mark $canvas $tags } } # blink a cross in the main image, showing the marker created # by method mark_spot protected method blink_mark { canvas tags { color 0 } } { catch {after cancel $afterId_} set tag [lindex $tags 0] if { "[$canvas gettags $tag]" == "" } { return } set cols "black white" if { $color } { set cols "white black" } $canvas itemconfigure white -fill [lindex $cols 0] $canvas itemconfigure black -fill [lindex $cols 1] set afterId_ [after 700 [code $this blink_mark $canvas $tag [expr {! $color}]]] } # -- options -- # target (main) RtdImage itcl widget itk_option define -target_image target_image Target_image { } { set image_ [[cget -target_image] get_image] set canvas_ [[cget -target_image] get_canvas] } # actual sample size itk_option define -samplesize sampleSize SampleSize {} # min. and max. values for slider itk_option define -minSsize minSsize MinSsize 5 itk_option define -maxSsize maxSsize MaxSsize 100 # command to evaluate when a an object was picked itk_option define -pickedCmd pickedCmd PickedCmd {} # command to evaluate when the sample size changed itk_option define -newSizeCmd newSizeCmd NewSizeCmd {} # command to evaluate after a new image itk_option define -newImageCmd newImageCmd NewImageCmd {} # command to evaluate when the pick was canceled itk_option define -cancelCmd cancelCmd CancelCmd {} # cursors to use itk_option define -pick_cursor pick_cursor Pick_cursor {target} { set cs_pick_ [cget -pick_cursor] } itk_option define -click_cursor click_cursor Click_cursor {plus} { set cs_click_ [cget -click_cursor] } # update statistics after every image event, bool itk_option define -postImageEvent postImageEvent PostImageEvent 1 # default: show marker (blinking cross) when object was picked, bool itk_option define -showMarker showMarker ShowMarker 1 # default zoom factor itk_option define -zoomFact zoomFact ZoomFact 4 # "show" options: menubar, slider, info, ... itk_option define -with_menu with_menu With_menu 0 itk_option define -with_slider with_slider With_slider 1 itk_option define -with_info with_info With_info 1 itk_option define -with_choice with_choice With_choice 1 itk_option define -with_buttons with_buttons With_buttons 1 # Specify the orientation of image and panel, one of {vertical horizontal} itk_option define -panel_orient panel_orient Panel_orient {horizontal} # fonts, widths, etc. itk_option define -labelfont labelFont LabelFont TkDefaultFont itk_option define -valuefont valueFont ValueFont TkDefaultFont itk_option define -wcsfont wcsFont WcsFont {Symbol -14} itk_option define -labelwidth labelWidth LabelWidth 15 itk_option define -valuewidth valueWidth ValueWidth 11 # -- protected vars -- protected variable image_ ;# internal target image protected variable canvas_ ;# target canvas protected variable picking_ 0 ;# user is picking object, bool protected variable pickMode_ 0 ;# pick mode (0=object, 1=cursor) protected variable afterId_ ;# id for blink after job protected variable list_ {} ;# result of last pick operation protected variable activated_ 0 ;# widget activated, bool protected variable newImgCmd_ ;# our callback for a new image cmd protected variable postCmd_ ;# our callback for a post image cmd protected variable magMenu_ ;# widget name of magnification menu protected variable cs_pick_ ;# cursor used for picking object protected variable cs_click_ ;# cursor used for clicking object protected variable pickx_ {} ;# last picked x coord protected variable picky_ {} ;# last picked y coord } skycat-3.1.2-starlink-1b/rtd/library/RtdImagePickView.tcl000066400000000000000000000232641215713201500232430ustar00rootroot00000000000000#************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImagePickView.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImagePickView.tcl - itcl widget for zooming and computing statistics # # See the man page for a complete description. # # who when what # -------- -------- ---------------------------------------------- # pbiereic 01/07/01 created # # RtdImagePickView handles a zoom window which is used to display # a magnified area of the main image at mouse pointer position # (=mode zooming) and to compute the statistics on an area with a given # sample size (=mode picking). The mode is set with method update_view. # The area is surrounded by a rectangular box and can be changed # with the option -ssize. The center coords for the statistics area # are in chip coordinates. # # RtdImagePickView uses the second zoom view provided by RTD, so that the # main zoom window should not be effected. # itk::usual RtdImagePickView {} itcl::class rtd::RtdImagePickView { inherit util::FrameWidget constructor {args} { eval itk_initialize $args itk_component add image { rtd::RtdImage $w_.image \ -name ZoomWin \ -scrollbars 0 \ -graphics 0 \ -canvaswidth $cwidth_ \ -canvasheight $cheight_ \ -borderwidth 0 \ -fillwidth 0 \ -fillheight 0 \ -shelp $itk_option(-shelp) } catch {pack forget [$w_.image component hscrollf] \ [$w_.image component vscrollf]} blt::blttable $w_ \ $itk_component(image) 0,0 -fill both set image_ [$itk_component(image) get_image] set canvas_ [$itk_component(image) get_canvas] # add help text displayed when mouse enters widget add_short_help $w_ {Zoom Image: displays section of image being examined \ {bitmap b2} = zoom in, \ {bitmap b3} = zoom out} # disable configure events bind $canvas_ {} # create a box to show the area for computing the statistics # (will be resized later) $canvas_ create rectangle 0 0 1 1 -outline white -tags rect1 $canvas_ create rectangle 0 0 1 1 -outline black -tags rect2 # add canvas bindings $canvas_ bind all "+[code $this inc_zoom 1]" $canvas_ bind all "+[code $this inc_zoom -1]" } # return canvas width and height (dimensions) of the visible image protected method get_canvas_dims { } { set cw [expr {double(min($cwidth_, [$image_ width] * $factor_))}] set ch [expr {double(min($cheight_, [$image_ height] * $factor_))}] return "$cw $ch" } # center the image protected method center { } { dbg "center" lassign [get_canvas_dims] cw ch # canvas scroll region is set to twice the canvas set xscroll [expr {0.5 - 0.25 * (1.0 - $cw / $cwidth_)}] set yscroll [expr {0.5 - 0.25 * (1.0 - $ch / $cheight_)}] $canvas_ xview moveto $xscroll $canvas_ yview moveto $yscroll } # increment or decrement the zoom factor public method inc_zoom { inc } { if { ! [checkInit] } { return } dbg "inc_zoom $inc" set f $factor_ incr f $inc if {$f < 2} { set f [max 2 $factor_] } set f [min $f 50] $image_ scale $f $f config -factor $f center ; # center the image update_view ; # update the view update_rect ; # update the rectangular box if {"$itk_option(-command)" != ""} { eval $itk_option(-command) $f } } # change the size of the zoom window (in canvas coords) public method change_size { cw ch } { set cwidth_ $cw set cheight_ $ch $canvas_ config -width $cwidth_ -height $cheight_ $canvas_ config -scrollregion "-$cwidth_ -$cheight_ $cwidth_ $cheight_" center } # set the zoom factor public method set_scale { sx } { if { ! [checkInit] } { return } dbg "set_scale $sx" inc_zoom [expr {$sx - $factor_}] } # update the view of the image. If parameter $picking is 1 then # set the size of the view equal to the sample size (for computing # the statistics), else to the size of the visible image. public method update_view { { picking 0 } } { if { ! [checkInit] } { return } dbg "update_view $picking" lassign [cget -pickc] xc yc # "view update" requires offsets in canvas coords $target_image_ convert coords $xc $yc chip x0 y0 canvas # get scale factor of target image ("ti_" means "target image") $target_image_ convert dist 1 1 image ti_xs ti_ys canvas set f [expr {double($factor_)}] set iw [$image_ width] set ih [$image_ height] # compute offsets and image dimension in canvas coords: # - when picking compute coords for the sample area. # - when zooming compute coords for the zoom window. if { $picking } { # compute values for updating the view for the sample area set ssize [expr {double([cget -ssize])}] set cw [expr {$ssize * $f}] set ch [expr {$ssize * $f}] set nx $ssize set ny $ssize } else { # compute values for updating the view for the zoom image lassign [get_canvas_dims] cw ch set nx [expr {$cw / $f}] set ny [expr {$ch / $f}] } # compute offsets in target image (canvas coords) set x0 [expr {$x0 - $nx / 2.0 * $ti_xs}] set y0 [expr {$y0 - $ny / 2.0 * $ti_ys}] # update the view $target_image_ view update $image_ $x0 $y0 \ [expr {$cw * $ti_xs}] [expr {$ch * $ti_ys}] 0 0 0 0 canvas } # compute statistics on the image currently viewed public method statistics { xc yc } { if { ! [checkInit] } { return } dbg "statistics $xc $yc" config -pickc "$xc $yc" update_view 1 ; # set picking mode # compute statistics on the image currently viewed if { [catch {$image_ statistics} result] } { error_dialog $result return {} } # convert x,y to chip coords $target_image_ convert coords [lindex $result 0] [lindex $result 1] image \ xc yc chip set result [lreplace $result 0 1 $xc $yc] return $result } # move the zoom view to xc, yc public method moveTo { xc yc } { dbg "moveTo $xc $yc" config -pickc "$xc $yc" $image_ scale $factor_ $factor_ center update_view } # display a rectangular box showing the area for computing # the statistics public method update_rect { } { if { ! [checkInit] } { return } dbg "update_rect" set hsize [expr {double([cget -ssize]) / 2.0}] lassign [get_canvas_dims] cw ch set xc [expr {$cw / $factor_ / 2.0}] set yc [expr {$ch / $factor_ / 2.0}] $image_ convert dist [expr {$xc - $hsize}] [expr {$xc + $hsize}] image x0 x1 canvas $image_ convert dist [expr {$yc - $hsize}] [expr {$yc + $hsize}] image y0 y1 canvas $canvas_ coords rect1 $x0 $y0 $x1 $y1 $canvas_ coords rect2 \ [expr {$x0 - 1.1}] [expr {$y0 - 1.1}] [expr {$x1 + 1.1}] [expr {$y1 + 1.1}] } # activate / de-activate zoom public method activate { bool } { if { $bool == $activated_ } { return } dbg "activate $bool" if { $bool } { # add view without propagating the scale factor of the main image $target_image_ view add $image_ 0 } else { $target_image_ view remove $image_ } set activated_ $bool } # start / stop zoom public method zoom { bool } { if { $bool == $zooming_ } { return } dbg "zoom $bool" if { $bool } { if { ! $activated_ } { return } # start zoomview: scale 1, don't propagate scale factor, 2'nd zoom $target_image_ zoomview start $image_ 1 0 $zoomNr_ # set scale, update view and rectangular box inc_zoom 0 } else { $target_image_ zoomview stop $zoomNr_ } set zooming_ $bool } # clear zoom image public method clear { } { dbg "clear" $image_ clear ximage } # check that this widget is properly initialized. # Returns 1 for yes and 0 for no. protected method checkInit { } { lassign [cget -pickc] xc yc if { "$xc" == "" || "$yc" == "" || "[cget -ssize]" == "" || \ [$image_ isclear] } { return 0 } return 1 } # return name of the rtdimage object public method get_image { } { return $image_ } # return canvas pathname of zoom image public method get_canvas { } { return $canvas_ } # return scale factor public method get_scale { } { return $factor_ } # debug for development protected method dbg { msg } { return puts "RtdImagePickView: $msg" } # -- options -- # target (main) RtdImage itcl widget itk_option define -target_image target_image Target_image {} { set target_image_ [[cget -target_image] get_image] } # help text when mouse enters the widget itk_option define -shelp shelp Shelp {} # eval command after scale changed itk_option define -command command Command {} # default zoom magnification factor itk_option define -factor factor Factor {4} { set factor_ [cget -factor] } # sample size for computing statistics itk_option define -ssize ssize Ssize {} { set ssize [cget -ssize] if { ! [lempty $ssize] } { dbg "config -ssize [cget -ssize]" update_rect } } # picked target image coords itk_option define -pickc pickc Pickc {} # -- protected vars -- protected variable target_image_ ; # target image protected variable canvas_ ; # ZoomView's canvas protected variable image_ ; # ZoomView's canvas image tag protected variable zoomNr_ 2 ; # use the second view zoom of RtdImage protected variable cwidth_ 185 ; # default width of zoom frame protected variable cheight_ 185 ; # default height of zoom frame protected variable activated_ 0 ; # ZoomView activated, bool protected variable zooming_ 0 ; # zooming started / stopped, bool # Scale factor: we cannot rely on the scale factor of the image # since the main image propagates always the scale factor when there was # a new image. protected variable factor_ 4 ; # scale factor } skycat-3.1.2-starlink-1b/rtd/library/RtdImagePixTable.tcl000066400000000000000000000224361215713201500232320ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImagePixTable.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImagePixTable.tcl - itcl widget for displaying a table of pixel values # for an RtdImage widget # # See man page RtdImagePixTable(n) for a complete description. # # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created # Peter Biereichel 22/07/97 Added statistics # Peter W. Draper 24/04/03 Added high-lighting for maximum and minimums itk::usual RtdImagePixTable {} # This widget displays a variable sized table of raw image pixel # values from an RtdImage widget with the given pixel at the # center. This is meant to be bound to mouse motion events to # display pixel values as the mouse moves across the image. itcl::class rtd::RtdImagePixTable { inherit util::TopLevelWidget # constructor: create a new instance of this class constructor {args} { eval itk_initialize $args # Tk label "Pixel Table" itk_component add label { label $w_.label -text "Pixel Table" } pack $itk_component(label) -side top make_table make_buttons global ::pixtstat if {![info exists pixtstat]} { make_statistics set pixtstat 1 } elseif {$pixtstat} { make_statistics set pixtstat 1 } $image_ pixtab start $itk_option(-nrows) $itk_option(-ncols) $image_ zoom slow } # destructor destructor { $image_ pixtab stop $image_ zoom fast } # make the table of pixel values with the X,Y coords at the # top and left resp. protected method make_table {} { set var $image_ global ::$var # BLT table frame itk_component add tab { set f [frame $w_.tab] } pack $f -side top -fill both -expand 1 blt::blttable $f set ncols $itk_option(-ncols) set nrows $itk_option(-nrows) for {set col 0} {$col <= $ncols} {incr col} { set trow $nrows for {set row 0} {$row <= $nrows} {incr row} { blt::blttable $f \ [label $f.p$row,$col \ -font $itk_option(-valuefont) \ -borderwidth 1 \ -relief groove \ -width 6 \ -textvariable ${var}($row,$col)] \ $trow,$col -fill both incr trow -1 } } # use different font for X and Y values for {set row 0} {$row <= $nrows} {incr row} { $f.p$row,0 config -font $itk_option(-labelfont) -borderwidth 2 -relief raised } for {set col 0} {$col <= $ncols} {incr col} { $f.p0,$col config -font $itk_option(-labelfont) -borderwidth 2 -relief raised } # trace pixel showing maximum and minimum values trace variable ${var}(PIXTAB_MAXX) w [code $this update_max_pixel_] trace variable ${var}(PIXTAB_MAXY) w [code $this update_max_pixel_] trace variable ${var}(PIXTAB_MINX) w [code $this update_min_pixel_] trace variable ${var}(PIXTAB_MINY) w [code $this update_min_pixel_] # 0,0 unused $f.p0,0 config -relief flat -textvariable RtdPixTab(xy) set RtdPixTab(xy) {Y\X} # highlight center pixel and X,Y values set col [expr {$ncols/2+1}] set row [expr {$nrows/2+1}] $f.p$row,$col config -relief raised -foreground red $f.p0,$col config -relief raised -foreground red $f.p$row,0 config -relief raised -foreground red # standard background colour set bgcol_ [$f.p$row,$col cget -background] blank_values add_short_help $itk_component(tab) {Shows pixels around the last cursor position in the image} } # statistics on pixels protected method make_statistics {} { set var $image_ global ::$var set ncols $itk_option(-ncols) set nrows $itk_option(-nrows) # Tk label "Statistics" itk_component add slabel { label $w_.slabel -text "Statistics" } pack $itk_component(slabel) -side top -before $itk_component(buttons) # statistics Tk frame itk_component add stat { set sf [frame $w_.stat -relief raised -borderwidth 1] } pack $sf -side top -fill both -expand 1 -before $itk_component(buttons) set col 0 set row 1 foreach el {Min Max Ave RMS N} { set lel [string tolower $el] # LabelValue(n) widgets: pixtab_Min, pixtab_Max, pixtab_Ave, # pixtab_RMS, pixtab_N itk_component add pixtab_$lel { util::LabelValue $sf.$lel \ -text "$el:" \ -textvariable ${var}(PIXTAB_[string toupper $el]) \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth $itk_option(-valuewidth) \ -relief groove \ -anchor w} blt::blttable $sf $itk_component(pixtab_$lel) \ $row,$col -fill both incr col if {$col >= $ncols} { set col 0 incr row } } # Max and min match highlight colours as visual clue $itk_component(pixtab_max) configure \ -foreground $itk_option(-maxhighlight) $itk_component(pixtab_min) configure \ -foreground $itk_option(-minhighlight) add_short_help $itk_component(pixtab_min) {Min: Shows the min value of the pixel table} add_short_help $itk_component(pixtab_max) {Min: Shows the max value of the pixel table} add_short_help $itk_component(pixtab_ave) {Min: Shows the average value of the pixel table} add_short_help $itk_component(pixtab_rms) {Min: Shows the RMS value of the pixel table} add_short_help $itk_component(pixtab_n) {N: Shows the number of pixels in the pixel table} } # set the background of one of the tabel cells protected method set_cell_bg_colour_ {x y colour} { catch { $itk_component(tab).p${x},${y} configure -background $colour } } # update the cell coloured to show that it has the maximum value protected method update_max_pixel_ { args } { set var $image_ global ::$var set_cell_bg_colour_ $maxx_ $maxy_ $bgcol_ set maxx_ [set ${var}(PIXTAB_MAXX)] set maxy_ [set ${var}(PIXTAB_MAXY)] set_cell_bg_colour_ $maxx_ $maxy_ $itk_option(-maxhighlight) } # update the cell coloured to show that it has the minimum value protected method update_min_pixel_ { args } { set var $image_ global ::$var set_cell_bg_colour_ $minx_ $miny_ $bgcol_ set minx_ [set ${var}(PIXTAB_MINX)] set miny_ [set ${var}(PIXTAB_MINY)] set_cell_bg_colour_ $minx_ $miny_ $itk_option(-minhighlight) } # make the button frame at the bottom of the window protected method make_buttons {} { # button frame itk_component add buttons { frame $w_.buttons -borderwidth 0 -relief flat} pack $itk_component(buttons) -side top -fill none -expand 0 pack \ [button $w_.close \ -text "Close" \ -command [code delete object $this]] \ -padx 2m -pady 2m -side right -in $w_.buttons global ::pixtstat pack \ [checkbutton $w_.statistics \ -text "Statistics" \ -variable pixtstat \ -anchor w \ -font $itk_option(-labelfont) \ -command [code $this statistics]] \ -padx 2m -pady 2m -side left -in $w_.buttons add_short_help $w_.close {Close: {bitmap b1} = Close this window} add_short_help $w_.statistics {Statistics: {bitmap b1} = Switch statistics info on/off} } # method to switch statistics window on/off public method statistics {} { global ::pixtstat if {$making_stat_} { if {[winfo exists $itk_component(stat)]} { set pixtstat 1 } else { set pixtstat 0 } return } set making_stat_ 1 if {$pixtstat} { blank_values catch {make_statistics} update idletasks } else { catch { destroy $itk_component(slabel) destroy $itk_component(stat) } } set making_stat_ 0 } # method to blank out all pixel values public method blank_values {} { set var $image_ global ::$var set ncols $itk_option(-ncols) set nrows $itk_option(-nrows) for {set col 0} {$col <= $ncols} {incr col} { for {set row 0} {$row <= $nrows} {incr row} { set ${var}($row,$col) "" } } } # -- public vars -- # caller's RtdImage itcl object itk_option define -image image Image {} { # get internal image object and canvas set image_ [$itk_option(-image) get_image] set canvas_ [$itk_option(-image) get_canvas] } # number of rows/columns of pixels to display itk_option define -nrows nrows Nrows 3 itk_option define -ncols ncols Ncols 3 # fonts used itk_option define -labelfont labelFont LabelFont TkDefaultFont itk_option define -valuefont valueFont ValueFont TkDefaultFont # set the width for displaying labels and values itk_option define -labelwidth labelWidth LabelWidth 4 itk_option define -valuewidth valueWidth ValueWidth 8 # maximum and minimum highlight colours itk_option define -maxhighlight maxhighlight MaxHighlight lightblue itk_option define -minhighlight minhighlight MinHighlight lightgreen # -- protected vars -- # internal rtdimage object protected variable image_ # canvas for image protected variable canvas_ # flag for "making statistics widget" protected variable making_stat_ 0 # indices of last cells to hold the maximum and minimum colours protected variable maxx_ 1 protected variable maxy_ 1 protected variable minx_ 1 protected variable miny_ 1 # background colour of a cell that isn't highlighted protected variable bgcol_ lightgrey } skycat-3.1.2-starlink-1b/rtd/library/RtdImagePopup.tcl000066400000000000000000000261441215713201500226250ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImagePopup.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImagePopup.tcl - A toplevel widget for displaying rapid frames for RtdImage # # See man page RtdImagePopup(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 13 Mar 96 Created # 23 Jun 96 assume rapid frame data has separate mem area # starting at 0,0 itk::usual RtdImagePopup {} # This widget is used to display rapid frames in a popup window for an # RtdImage widget. A rapid frame is an instance of a RtdImage widget # that displays a small section of the main image and can be updated # faster with real-time images because it is smaller than the main # image. # # The area in the main image being used for the rapid frame is marked # with one black and one white dashed rectangle. The rapid frame can be # moved or resized in in the same way as any other graphic objects by # dragging with the left mouse button over it or on one of the 8 resize # handles displayed around it when it is selected. One of the dashed # rectangles shows the current position of the rapid frame while the # other one shows the new position and size being set. # # Creating and manipulating a rapid frame usually involves communication # with the rtdServer and camera, to tell the camera to start sending # images at the given rate from the given area. Since this is very # application specific, you can arrange to have your own Tcl command # evaluated whenever a rapid frame is created, moved, resized or # deleted. See the RtdImage(n) -rapid_frame_command option for how to do # this. # # Note that currently, only one rapid frame is allowed at a time. # Creating a second one automatically deletes the first. This may # be changed in a future release. itcl::class rtd::RtdImagePopup { inherit util::TopLevelWidget # constructor: create a new instance of this class constructor {args} { eval itk_initialize $args } # add bindings and callbacks after the constructor was called protected method init {} { wm title $w_ "Rapid Frame ($itk_option(-number))" wm iconname $w_ Rapid # RtdImage(n) widget to display in a popup window itk_component add image { rtd::RtdImage $w_.image \ -name "RapidFrame" \ -canvasheight $itk_option(-height) \ -displaymode 1 \ -graphics 0 \ -drag_scroll 0 \ -zoomwin $itk_option(-zoomwin) \ -usexshm $itk_option(-usexshm) \ -verbose $itk_option(-verbose) \ -subsample $itk_option(-subsample) \ -scrollbars 1 \ -newimagecmd [code $this new_image_cmd] } set canvas_ [$itk_component(image) get_canvas] set image_ [$itk_component(image) get_image] add_menubar make_panel pack $itk_component(image) -fill both -expand 1 # create a dummy rect to get events for image set rectId_ [$target_canvas_ create rectangle \ $itk_option(-xoffset) $itk_option(-yoffset) \ [expr {$itk_option(-xoffset)+$itk_option(-width)-1}] \ [expr {$itk_option(-yoffset)+$itk_option(-height)-1}] \ -tags imagerect \ -fill black \ -stipple pat7] # set help text displayed when mouse enters widget add_short_help $canvas_ $itk_option(-shelp) $target_image_ view add $image_ 0 1 set frameId_ [$image_ frameid] # RtdImageMBand(n) widget: # The "measure band" is displayed while the right mouse button # is pressed to show the distance between points. itk_component add mband { rtd::RtdImageMBand $w_.mband -image $itk_component(image) } bind $w_ [code $itk_component(image) center] # handle interaction between zoom window and rapid frame $canvas_ bind [$itk_component(image) get_imageId] \ "+[code $target_image_ view enter $image_]" $canvas_ bind [$itk_component(image) get_imageId] \ "+[code $target_image_ view leave $image_]" notify_cmd resize # add bindings for moving and resizing the rapid frame $draw_ add_object_bindings $rectId_ $itk_option(-region_id) # setup callbacks for moving and resizing image $draw_ add_notify_cmd $itk_option(-region_id) [code $this notify_cmd] } # destructor - clean up when deleted destructor { $draw_ remove_notify_cmd $itk_option(-region_id) $draw_ delete_object $rectId_ $draw_ delete_object $itk_option(-region_id) } # return the name of the underlying rtdimage object public method get_image {} { return $image_ } # add the menubar at the top of the window protected method add_menubar {} { # menu bar TopLevelWidget::add_menubar set image $itk_component(image) # File menu set m [add_menubutton File] add_menuitem $m command "Save as..." \ {Save the current image to a (FITS) file} \ -command [code $image save_as] add_menuitem $m command "Print..." \ {Print the current image to a file or printer} \ -command [code $image print] #add_menuitem $m command Clear \ # {Clear the image display} \ # -command [code $image clear] add_menuitem $m command "Close" \ {Close the window} \ -command "destroy $w_" add_short_help $itk_component(menubar).file \ {File menu: save, clear, print image, close window} # View menu set m [add_menubutton View] add_menuitem $m command "Cut Levels..." \ {Display a window for manipulating the image cut levels} \ -command [code $w_.info cut_level_dialog] add_short_help $itk_component(menubar).view \ {View menu: manipulate image cut levels} } # make the upper panel protected method make_panel {} { # RtdImagePanel(n) widget, control panel itk_component add info { rtd::RtdImagePanel $w_.info \ -image $itk_component(image) \ -showobject 0 \ -showxy 0 \ -showwcs 0 \ -showminmax 0 \ -shorthelpwin $itk_option(-shorthelpwin) \ -state normal \ -min_scale $itk_option(-min_scale) \ -max_scale $itk_option(-max_scale) \ -borderwidth 3 -relief groove } pack $itk_component(info) \ -side top -fill x } # set the cut levels public method set_cut_levels {} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } utilReUseWidget rtd::RtdImageCut $w_.cut \ -image $this \ -transient 1 \ -command "$itk_component(info) updateValues" } # this method is called by the image code whenever a new image is loaded # (for updates, see camera command) protected method new_image_cmd {} { $itk_component(info) updateValues } # This method is called (from the main image's CanvasDraw(n) # widget) whenever an embedded rapid frame is moved, resized # or deleted. # If the "-command" option was given to this class, then that tcl command is # evaluated with the frameId, operation name (move, resize, delete) the x, y coords # and the width and height of the frame. public method notify_cmd {op args} { if {"$op" == "delete"} { if {"$itk_option(-command)" != ""} { eval "$itk_option(-command) $frameId_ $this $op 0 0 0 0" } delete object $this return 0 } elseif {"$op" == "flip"} { eval $itk_component(image) flip $args $itk_component(info) component trans update_trans } elseif {"$op" == "rotate"} { eval $itk_component(image) rotate $args $itk_component(info) component trans update_trans after idle [code $itk_component(image) center] } elseif {"$op" == "resize" || "$op" == "move"} { lassign [$target_canvas_ bbox $itk_option(-region_id)] x0 y0 x1 y1 set w [expr {$x1-$x0+1}] set h [expr {$y1-$y0+1}] $target_canvas_ coords $rectId_ $x0 $y0 $x1 $y1 # note: we assume here that the rapid frame has its own memory area # starting at 0,0 $target_image_ view update $image_ 0 0 $w $h 0 0 $x0 $y0 canvas if {"$itk_option(-command)" != ""} { eval "$itk_option(-command) $frameId_ $this $op $x0 $y0 $w $h" } } after idle [code $itk_component(image) center] } # -- public vars -- # target rtdimage itk_option define -target_image target_image Target_image {} { # get internal widget names for target image set target_image_ [$itk_option(-target_image) get_image] set target_canvas_ [$itk_option(-target_image) get_canvas] set draw_ [$itk_option(-target_image) component draw] } # canvas id of the (region) object used to position and move the image # in the canvas itk_option define -region_id region_id Region_id {} # X offset of image frame itk_option define -xoffset xoffset Xoffset 0 # Y offset of image frame itk_option define -yoffset yoffset Yoffset 0 # width of image frame itk_option define -width width Width 0 # height of image frame itk_option define -height height Height 0 # This tcl command is evaluated whenever the frame is created # moved, resized or deleted: 7 arguments will be appended to the # command before it is evaluated: # # frameId: Unique rapid frame id for use with rtdServer. # # name: Unique name for the frame. # # op: Operation: one of: move,resize or delete. # # x, y: Coordinates of upper left corner of frame in main image. # # width, height: Dimensions of rapid frame. itk_option define -command command Command {} # flag: if true, pan image is "subsampled" when shrinking, # otherwise the pixels are averaged itk_option define -subsample subsample Subsample 1 # X shared memory option itk_option define -usexshm useXshm UseXshm 1 # X synchronisation option itk_option define -usexsync useXsync UseXsync 1 # flag: if true, print diagnostic messages itk_option define -verbose verbose Verbose {0} # zoom window to update itk_option define -zoomwin zoomWin ZoomWin {} # text of short help message to be displayed whenever # the mouse enters the image window (see Toplevel.tcl) itk_option define -shelp shelp Shelp "image window: {bitmap b1} = select graphics, \ {bitmap b2} = scroll image, \ {bitmap dragb3} = measure world coordinates" # optionally specify TopLevelWidget to display short help messages itk_option define -shorthelpwin shortHelpWin ShortHelpWin {} # minimum allowed scale value itk_option define -min_scale min_scale Min_scale -10 # maximum allowed scale value itk_option define -max_scale max_scale Max_scale 20 # -- protected vars -- # target internal rtdimage protected variable target_image_ # canvas widget for main image and region object marking frame. protected variable target_canvas_ # CanvasDraw object, for setting up move, resize operations on embedded image protected variable draw_ # internal rtdimage for rapid frame protected variable image_ # canvas window containing rapid frame image, # different than target_canvas for popup frames protected variable canvas_ # canvas id of rectangle used to get events for moving/resizing image protected variable rectId_ # rapid frame Id, needed to communicate with rtdServer protected variable frameId_ } skycat-3.1.2-starlink-1b/rtd/library/RtdImagePrint.tcl000066400000000000000000000321671215713201500226200ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImagePrint.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImagePrint.tcl - popup dialog for printing an RTD image # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created # P. Biereichel 05/08/97 Modified for xgrabsc (screen dump) # Allan Brighton 21 Nov 97 Renamed to RtdImagePrint, since it is # now rtd specific, pass image as option. # Peter W. Draper 14 May 98 Added changes to use Canvas postscript # printing with a suitably patched Tk. # Now only get a footer. # Peter W. Draper 21 Aug 02 Added swap of width and height values # when toggling between portrait and landscape # 05 Aug 09 Tweak footer positions for new fonts. itk::usual RtdImagePrint {} # RtdImagePrint defines a popup dialog for printing an RTD image. # This class extends the PrintDialog class. itcl::class rtd::RtdImagePrint { inherit util::PrintDialog # constructor constructor {args} { eval itk_initialize $args } # this method is called after all options have been evaluated protected method init {} { util::PrintDialog::init # get internal image handle and canvas set image_ [$itk_option(-image) get_image] set canvas_ [$itk_option(-image) get_canvas] wm title $w_ "RTD Postscript print ($itk_option(-number))" global ::$w_.color ::$w_.rotate ::$w_.fit_to_page ::$w_.footer \ ::$w_.whole # print options frame itk_component add options { frame $w_.options -borderwidth 3 -relief groove } pack $w_.options -side top -fill x -expand 1 -in $w_.config # title for option frame itk_component add title { label $w_.options.title -text "Postscript Options" } pack $w_.options.title -side top # color options pack [frame $w_.color -borderwidth 5] \ -side top -fill x -expand 1 -in $w_.options pack [radiobutton $w_.color.color -text "Color" \ -variable $w_.color \ -value color] \ [radiobutton $w_.color.gray -text "Gray-Scale" \ -variable $w_.color \ -value gray] \ [radiobutton $w_.color.mono -text "Black & White" \ -variable $w_.color \ -value mono] \ -side left -fill x -expand 1 ::set $w_.color color # rotate options pack [frame $w_.rotate -borderwidth 5] \ -side top -fill x -expand 1 -in $w_.options pack [radiobutton $w_.rotate.yes -text "Landscape" \ -variable $w_.rotate \ -value yes \ -command [code $this toggle_rotate_] ] \ [radiobutton $w_.rotate.no -text "Portrait" \ -variable $w_.rotate \ -value no \ -command [code $this toggle_rotate_] ] \ -side left -fill x -expand 1 ::set $w_.rotate no set last_rotate_ no # Capture whole of displayed canvas. pack [frame $w_.whole -borderwidth 5] \ -side top -fill x -expand 1 -in $w_.options pack [checkbutton $w_.whole.yes -text "Print whole window" \ -variable $w_.whole \ -onvalue 1 -offvalue 0 \ -command [code $this set_whole_canvas] ] \ -side left ::set $w_.whole $itk_option(-whole_canvas) # page size options pack [frame $w_.pagesize -borderwidth 5] \ -side top -fill x -expand 1 -in $w_.options checkbutton $w_.pagesize.fit -text "Encapsulated Postscript" \ -variable $w_.fit_to_page \ -command [code $this toggle_fit_pagesize] checkbutton $w_.pagesize.footer -text "Footer text" \ -variable $w_.footer LabelEntry $w_.pagesize.width \ -text "Page width " \ -value $itk_option(-pagewidth) \ -valuewidth 6 LabelEntry $w_.pagesize.height \ -text "Page height" \ -value $itk_option(-pageheight) \ -valuewidth 6 blt::blttable $w_.pagesize \ $w_.pagesize.fit 1,0 -anchor w \ $w_.pagesize.footer 1,1 -anchor e \ $w_.pagesize.width 2,0 -anchor w \ $w_.pagesize.height 2,1 -anchor e ::set $w_.fit_to_page $itk_option(-fit_to_page) ::set $w_.footer $itk_option(-show_footer) add_short_help } # add short help texts protected method add_short_help {} { global ::env set tp [winfo parent $w_] $tp add_short_help $w_.color.color \ "Write output in Postscript format for color printers" $tp add_short_help $w_.color.gray \ "Write output in Postscript format for greyscale printers" $tp add_short_help $w_.color.mono \ "Write output in Postscript format in black and white" $tp add_short_help $w_.rotate.yes \ "Use landscape layout (with page width and height exchanged) for \ Postscript output" $tp add_short_help $w_.rotate.no \ "Use portrait layout for Postscript output" $tp add_short_help $w_.pagesize.width \ "Paper width in inches (default for A4: $itk_option(-pagewidth))" $tp add_short_help $w_.pagesize.height \ "Paper height in inches (default for A4: $itk_option(-pageheight))" $tp add_short_help $w_.pagesize.fit \ "Encapsulated Postscript for including the image into a document \ (e.g. LaTeX/FrameMaker). No translation or scaling!" $tp add_short_help $w_.whole.yes \ "Print whole of main image region (needed to keep off-image \ graphics, e.g. grid plots)" $tp add_short_help $w_.pagesize.footer "Add footer to image" } # called when the "Encapsulate" button is pressed protected method toggle_fit_pagesize {} { global ::$w_.fit_to_page if {![set $w_.fit_to_page]} { $w_.pagesize.width config -state normal $w_.pagesize.height config -state normal } else { $w_.pagesize.width config -state disabled $w_.pagesize.height config -state disabled } } # switch the "width" and "height" when changing between landscape # and portrait mode protected method toggle_rotate_ {} { global ::$w_.rotate if { $last_rotate_ == [set $w_.rotate] } { return } set width [$w_.pagesize.width get] $w_.pagesize.width configure -value [$w_.pagesize.height get] $w_.pagesize.height configure -value $width set last_rotate_ [set $w_.rotate] } # print the contents of the canvas to the open filedescriptor protected method print {fd} { global ::$w_.color ::$w_.rotate $w_.colormap ::$w_.footer global ::$w_.fit_to_page ::$w_.whole set cmd [list $canvas_ postscript \ -colormode [set $w_.color] \ -rotate [set $w_.rotate]] # Get the offsets that correct for the apparent shift of the # image when zoomed. set xoff [expr {int([$canvas_ canvasx 0])}] set yoff [expr {int([$canvas_ canvasy 0])}] set xoff [max $xoff 0] set yoff [max $yoff 0] if { $itk_option(-x0) == {} } { # no prefered canvas section so adjust things to the size # of the displayed rtd image if available. If not then # use a bounding box that encompasses all the displayed items. if { ! [set $w_.whole] } { # The origin of the image is always 0,0 for a canvas # print to work. set x0 0 set y0 0 set x1 [min [winfo width $canvas_] [$image_ dispwidth]] set y1 [min [winfo height $canvas_] [$image_ dispheight]] } else { # Use whole printing surface. set x0 [min 0 [$canvas_ canvasx 0]] set y0 [min 0 [$canvas_ canvasy 0]] set x1 [expr {$x0+[winfo width $canvas_]}] set y1 [expr {$y0+[winfo height $canvas_]}] } } # Set the background (use a filled rectangle to simulate this). if { [set $w_.whole] } { set_background } # Now add footer. if {[set $w_.footer]} { add_footer } # Set the width, height and corner. lappend cmd \ -width [expr {$x1-$x0+1}] \ -height [expr {$y1-$y0+1}] \ -x $x0 \ -y $y0 if {! [set $w_.fit_to_page]} { lappend cmd \ -pagewidth [$w_.pagesize.width get] \ -pageheight [$w_.pagesize.height get] } if {"[set $w_.color]" == "mono"} { # you can add to this array, see canvas(n) man page set $w_.colormap(grey) "0.0 0.0 0.0 setrgbcolor" lappend cmd -colormap $w_.colormap } # Shift all canvas items so that they align to the image # with its origin of 0,0. $canvas_ move all [expr {-1.0*$xoff}] [expr {-1.0*$yoff}] $canvas_ move $image_ $xoff $yoff $canvas_ move print $xoff $yoff # Write postscript into file stream. puts $fd [eval $cmd] # Shift everything back to original position. $canvas_ move all $xoff $yoff $canvas_ move $image_ \ [expr {-1.0*$xoff}] [expr {-1.0*$yoff}] # Remove footer. if {[set $w_.footer]} { rm_footer } # Remove background. if { [set $w_.whole] } { remove_background } } # add footer labels below draw area by temporarily inserting # the text protected method add_footer {} { set hy0 [expr {$y1+25}] set hy1 [expr {$y1+50}] # white background for labels $canvas_ create rect $x0 $y1 $x1 $hy1 \ -outline white \ -fill white \ -tags print set hx0 $x0 set hy0 [expr {$y1+30}] set hx1 $x1 set hy1 [expr {$y1+40}] if {"$itk_option(-top_left)" != ""} { $canvas_ create text $hx0 $hy0 \ -text $itk_option(-top_left) \ -font $itk_option(-footer_font) \ -anchor sw \ -tags print } if {"$itk_option(-top_right)" != ""} { $canvas_ create text $hx1 $hy0 \ -text "$itk_option(-top_right)" \ -font $itk_option(-footer_font) \ -anchor se \ -justify right \ -tags print } if {"$itk_option(-bot_left)" != ""} { $canvas_ create text $hx0 $hy1 \ -text $itk_option(-bot_left) \ -font $itk_option(-footer_font) \ -anchor nw \ -tags print } if {"$itk_option(-bot_right)" != ""} { $canvas_ create text $hx1 $hy1 \ -text "$itk_option(-bot_right)" \ -font $itk_option(-footer_font) \ -anchor ne \ -justify right \ -tags print } # add margin set y1 [expr {$y1+50}] set x1 [expr {$x1+15}] } # remove the footer, if any and restore the original state protected method rm_footer {} { $canvas_ delete print } # modify capture all canvas items protected method set_whole_canvas {} { global ::$w_.whole configure -whole_canvas [set $w_.whole] } # modify show_footer protected method set_show_footer {} { global ::$w_.footer configure -show_footer [set $w_.footer] } # set/remove the background of the canvas. protected method set_background {} { set xlow [$canvas_ canvasx 0] set ylow [$canvas_ canvasy 0] set xhigh [$canvas_ canvasx [winfo width $canvas_]] set yhigh [$canvas_ canvasy [winfo height $canvas_]] set xlow [expr {round($xlow-1)}] set ylow [expr {round($ylow-1)}] set xhigh [expr {round($xhigh+1)}] set yhigh [expr {round($yhigh+1)}] $canvas_ create rectangle $xlow $ylow $xhigh $yhigh \ -fill white \ -outline white \ -tags ${this}_back $canvas_ lower ${this}_back all } # remove the background of the canvas. protected method remove_background {} { $canvas_ delete ${this}_back } # -- options -- # name of Itcl RtdImage or derived widget, set by caller itk_option define -image image Image {} # flag, it true whole canvas is captured, this includes any # graphics that extends outside the image. itk_option define -whole_canvas whole_canvas Whole_Canvas 1 # flag, if true, scale output to fit on page itk_option define -fit_to_page fit_to_page Fit_to_page 0 # page width, used when fit_to_page is 1 itk_option define -pagewidth pageWidth Pagewidth 8.268i # page height, used when fit_to_page is 1 itk_option define -pageheight pageHeight Pageheight 11.693i # flag, if true (1), insert footers before printing itk_option define -show_footer show_footer Show_footer 1 # alias for -show_footer, for backward compatibility itk_option define -show_headers show_headers Show_headers -1 { if {$itk_option(-show_headers) >= 0} { config -show_footer $itk_option(-show_headers) } } # footer text to appear at top left itk_option define -top_left top_left Top_left {} # footer text to appear at top right itk_option define -top_right top_right Top_right {} # footer text to appear at bottom left itk_option define -bot_left bot_left Bot_left {} # footer text to appear at bottom right itk_option define -bot_right bot_right Bot_right {} # footer fonts itk_option define -footer_font footer_font Footer_font TkFixedFont # upper left X coordinate of area of canvas to print (default bbox all) itk_option define -x0 x0 X0 {} {set x0 $itk_option(-x0)} # upper left Y coordinate itk_option define -y0 y0 Y0 {} {set y0 $itk_option(-y0)} # bottom right X coordinate itk_option define -x1 x1 X1 {} {set x1 $itk_option(-x1)} # bottom right Y coordinate itk_option define -y1 y1 Y1 {} {set y1 $itk_option(-y1)} # -- protected variables -- # x0 of area to print protected variable x0 {} # y0 of area to print protected variable y0 {} # x1 of area to print protected variable x1 {} # y1 of area to print protected variable y1 {} # internal rtdimage object protected variable image_ # canvas widget protected variable canvas_ # last/initial rotate value protected variable last_rotate_ no } skycat-3.1.2-starlink-1b/rtd/library/RtdImageSpectrum.tcl000066400000000000000000000164171215713201500233260ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImageSpectrum.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageSpectrum.tcl - itcl widget for displaying graph of image data values # along a line # # See man page RtdImageSpectrum(n) for a complete description. # # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created # Allan Brighton 28 Jun 96 Changed GUI name to "Cuts", # (suggested by M. Albrecht) # pbiereic 22/07/97 Added value display at cursor position # pbiereic 27/06/03 VLTSW20030157: Motion bindings itk::usual RtdImageSpectrum {} # This [incr Tk] widget is used to display a BLT graph in a # popup window plotting the raw image pixel values along a given # line drawn interactively on the image. Once created, the graph # can be continuously updated as the line is moved or resized. # This widget only sets up the layout. The real work is done in # the rtdimage spectrum subcommand (see rtdimage(3)), that communicates # directly with the BLT graph using its C interface. itcl::class rtd::RtdImageSpectrum { inherit util::TopLevelWidget # constructor: create a new instance of this class constructor {args} { eval itk_initialize $args wm minsize $w_ 10 10 wm title $w_ "Cuts ($itk_option(-number))" make_graph make_buttons $draw_ add_notify_cmd $itk_option(-line_id) [code $this notify_cmd] 1 } # destructor - clean up when deleted destructor { global ::tcl_version $draw_ remove_notify_cmd $itk_option(-line_id) $draw_ delete_object $itk_option(-line_id) if {$tcl_version >= 8.0} { global $xVector_ $yVector_ blt::vector destroy $xVector_ $yVector_ } } # make the graph subwindow protected method make_graph {} { global ::tcl_version # Note: make the graph in the global namespace for now so that # the old blt utils (features.tcl) still work. Shouldn't be needed # with blt-2.0 or later... set cmd \ [list blt::graph $w_.graph \ -width 5i \ -height 3i \ -borderwidth 3 \ -relief groove \ -title "Pixel Values" ] # BLT graph of pixel values itk_component add graph { set graph_ [uplevel "#0" $cmd] } { } pack $itk_component(graph) \ -fill both -expand 1 -padx 1m -pady 1m add_short_help $itk_component(graph) \ {Graph: plot image pixel values along line, {bitmap dragb1} = zoom, {bitmap b2} = restore} $graph_ yaxis configure -title {} # blt2.4f vector names must start with a letter, no dots... # someone also changed the default symbol to circle. Why? regsub -all {\.} v$graph_.xVector _ xVector_ regsub -all {\.} v$graph_.yVector _ yVector_ if {$tcl_version >= 8.0} { $graph_ legend config -hide 1 if {![info exists $xVector_]} { blt::vector create $xVector_ $yVector_ } set symbol {} } else { global $xVector_ $yVector_ $graph_ legend config -mapped 0 if {![info exists $xVector_]} { blt::vector $xVector_ $yVector_ } set symbol none } $graph_ element create elem -xdata $xVector_ -ydata $yVector_ -symbol $symbol # plot the distribution of pixel values notify_cmd # add BLT features ::Blt_ZoomStack $graph_ ::Blt_ActiveLegend $graph_ ::Blt_Crosshairs $graph_ ::Blt_ClosestPoint $graph_ if {$tcl_version >= 8.3} { bind $graph_ "catch {$this dispXY %x %y; %W crosshairs configure -position @%x,%y}" } else { bind bltCrosshairs "catch {$this dispXY %x %y; %W crosshairs configure -position @%x,%y}" } # Tk frame for X,Y positions. itk_component add fpos { frame $w_.fpos -relief flat } # Tk label for X position. itk_component add xpos { label $itk_component(fpos).xpos -width 20 -anchor w } # Tk label for Y position. itk_component add yval { label $itk_component(fpos).yval -width 20 -anchor w } pack $itk_component(xpos) $itk_component(yval) -fill x -expand 0 -side left pack $itk_component(fpos) -fill none -expand 0 } # make a hard copy of the graph display public method print {} { utilReUseWidget util::GraphPrint $w_.print \ -graph $graph_ } # display x, y values at cursor position public method dispXY {x y} { global ::tcl_version if {$tcl_version < 8.0} { global $yVector_ } if {![$graph_ element closest $x $y "" -interpolate 1 -halo 10000]} { return } lassign [$graph_ invtransform $x $y] x y set x [expr {int(round($x))}] if {$x < 1 || $x >= $numValues_} { return } set yval [$yVector_ range $x $x] $itk_component(xpos) config -text "X: $x" $itk_component(yval) config -text "Value: $yval" } # make the button frame at the bottom of the window protected method make_buttons {} { pack [set b [frame $w_.buttons -borderwidth 2 -relief groove]] \ -side bottom -fill x pack \ [button $b.print -text "Print..." -command [code $this print]] \ [button $b.close -text "Close" -command [code $this quit]] \ -side left -expand 1 -padx 2m -pady 2m add_short_help $b.print \ {Print: Display a dialog window for printing the graph} add_short_help $b.close \ {Close: Close this window} } # quit the window public method quit {} { catch {$draw_ delete_object $itk_option(-line_id)} catch {destroy $w_} } # This method is called whenever the spectrum line is moved, resized # or deleted or when the image changed and the graph should be updated. # It updates the graph to show the image values along the line. public method notify_cmd {{op update}} { global ::tcl_version if {"$op" == "delete"} { destroy $w_ return 0 } lassign [$canvas_ coords $itk_option(-line_id)] x0 y0 x1 y1 # plot the distribution of pixel values if {$tcl_version < 8.0} { global $xVector_ $yVector_ } if {[catch {set numValues_ [$image_ spectrum $graph_ elem $x0 $y0 $x1 $y1 canvas \ $xVector_ $yVector_]}]} { return 0 } $graph_ xaxis configure -max $numValues_ return 0 } # -- options -- # name of RtdImage itcl widget, set by caller itk_option define -image image Image {} { # get internal widgets set canvas_ [$itk_option(-image) get_canvas] set image_ [$itk_option(-image) get_image] set draw_ [$itk_option(-image) component draw] } # canvas id of the spectrum line itk_option define -line_id line_id Line_id {} # x0 canvas coordinate of the spectrum line itk_option define -x0 x0 X0 0 # y0 canvas coordinate of the spectrum line itk_option define -y0 y0 Y0 0 # x1 canvas coordinate of the spectrum line itk_option define -x1 x1 X1 0 # y1 canvas coordinate of the spectrum line itk_option define -y1 y1 Y1 0 # -- protected vars -- # name of graph widget protected variable graph_ # name of image's canvas widget protected variable canvas_ # name of internal rtdimage object protected variable image_ # name of RtdImage's CanvasDraw object protected variable draw_ # number of values displayed protected variable numValues_ 0 # x vector for graph protected variable xVector_ # y vector for graph protected variable yVector_ } skycat-3.1.2-starlink-1b/rtd/library/RtdImageTrans.tcl000066400000000000000000000204771215713201500226140ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImageTrans.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageTrans.tcl - itcl widget for scaling, rotating and flipping an RtdImage widget # # See man page RtdImageTrans(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created # Peter W. Draper 15 Apr 08 Don't assume X and Y scales are already set # to the same value itk::usual RtdImageTrans {} # RtdImageTrans is an [incr Tk] widget class for setting and displaying # image transformation states, such as rotation, flipX, flipY and scale # (magnification). The widget displays a menubutton with a selection of # image scale factors (from 1/5x to 9x magnification), 2 optional # buttons for incrementing and decrementing the scale factor, and buttons # for setting rotation, flipX and flipY. itcl::class rtd::RtdImageTrans { inherit util::FrameWidget # constructor: create a new instance of this class constructor {args} { itk_option add hull.borderwidth hull.relief # do this first so we can use the option values eval itk_initialize $args set image_ [$itk_option(-image) get_image] # LabelMenu(n) widget to choose scale factor itk_component add choose { set m [util::LabelMenu $w_.choose \ -text "Scale:" \ -relief groove \ -labelfont $itk_option(-labelfont) \ -valuefont $itk_option(-valuefont) \ -labelwidth $itk_option(-labelwidth) \ -valuewidth 5 \ -anchor e] } { keep -state -background -foreground } if { "$itk_option(-panel_orient)" == "vertical" } { pack $itk_component(choose) -side top -fill x -ipadx 0.5m -ipady 0.5m } else { pack $itk_component(choose) -side left -fill x -ipadx 0.5m -ipady 0.5m } # help text displayed when mouse enters widget add_short_help $w_ {Image Scale: {bitmap b1} = select the magnification of the image} frame $w_.trans_frame if {$itk_option(-show_Zz_buttons)} { # Tk button to zoom in itk_component add larger { button $w_.larger \ -bitmap magnify \ -command [code $this inc_zoom 1] } { keep -state -background -foreground } # Tk button to zoom out itk_component add smaller { button $w_.smaller \ -bitmap shrink \ -command [code $this inc_zoom -1] } { keep -state -background -foreground } pack $itk_component(larger) $itk_component(smaller) \ -side left -fill x -padx 0.5m -ipadx 0.5m -ipady 0.5m -in $w_.trans_frame add_short_help $itk_component(larger) {Zoom larger: {bitmap b1} = zoom in on the image} add_short_help $itk_component(smaller) {Zoom smaller: {bitmap b1} = zoom out on the image} } if {$itk_option(-show_trans)} { # Tk checkbutton to rotate (swap X/Y axis) itk_component add rotate { checkbutton $w_.rotate \ -bitmap rotate \ -selectcolor {} \ -indicatoron 0 \ -variable $w_.var(rotate) \ -command [code $this rotate] } { keep -state -background -foreground } # Tk checkbutton to flip the X axis itk_component add flipx { checkbutton $w_.flipx \ -bitmap flipx \ -selectcolor {} \ -indicatoron 0 \ -variable $w_.var(flipx) \ -command [code $this flip x] } { keep -state -background -foreground } # Tk checkbutton to flip the Y axis itk_component add flipy { checkbutton $w_.flipy \ -bitmap flipy \ -selectcolor {} \ -indicatoron 0 \ -variable $w_.var(flipy) \ -command [code $this flip y] } { keep -state -background -foreground } pack $itk_component(rotate) \ -side left -fill x -padx 1m -ipadx 1.5m -ipady 0.5m -in $w_.trans_frame pack $itk_component(flipx) $itk_component(flipy) \ -side left -fill x -padx 0.5m -ipadx 0.5m -ipady 0.5m -in $w_.trans_frame add_short_help $itk_component(rotate) \ {Exchange: {bitmap b1} = swap the image X and Y axes} add_short_help $itk_component(flipx) \ {Flip X: {bitmap b1} = flip the image about the X axis} add_short_help $itk_component(flipy) \ {Flip Y: {bitmap b1} = flip the image about the Y axis} } if { "$itk_option(-panel_orient)" == "vertical" } { pack $w_.trans_frame -side top -fill x -pady 0.5m } else { pack $w_.trans_frame -side left -fill x } for {set i $itk_option(-min_scale)} {$i<=-2} {incr i 1} { $m add -label "1/[expr {-$i}]x" -command "$itk_option(-image) scale $i $i" } for {set i 1} {$i<=$itk_option(-max_scale)} {incr i} { $m add -label " ${i}x" -command "$itk_option(-image) scale $i $i" } $m config -value { 1x} } # add the given increment to the current zoom factor and re-scale # the target image public method inc_zoom {inc} { lassign [$image_ scale] xs ys if {"$xs" == ""} { return } incr xs $inc incr ys $inc # PWD: treat xs and ys independently if {$xs == 0 || $xs == -1} { if {$inc == -1} { set xs -2 } else { set xs 1 } } elseif {$xs < $itk_option(-min_scale)} { set xs $itk_option(-min_scale) } elseif {$xs > $itk_option(-max_scale)} { set xs $itk_option(-max_scale) } if {$ys == 0 || $ys == -1} { if {$inc == -1} { set ys -2 } else { set ys 1 } } elseif {$ys < $itk_option(-min_scale)} { set ys $itk_option(-min_scale) } elseif {$ys > $itk_option(-max_scale)} { set ys $itk_option(-max_scale) } $itk_option(-image) scale $xs $ys update_trans } # fill the given menu with radiobuttons for changing the magnification # of the image and keep them updated with the other controls public method fill_mag_menu {m} { global ::$w_.mag for {set i $itk_option(-min_scale)} {$i<=-2} {incr i 1} { $m add radiobutton \ -label "1/[expr {-$i}]x" \ -command "$itk_option(-image) scale $i $i" \ -variable $w_.mag } for {set i 1} {$i<=$itk_option(-max_scale)} {incr i} { $m add radiobutton \ -label " ${i}x" \ -command "$itk_option(-image) scale $i $i" \ -variable $w_.mag } set $w_.mag { 1x} } # update the display based on the image scale factors # (note that the menu values are referenced to here by their labels) public method update_trans {} { global ::$w_.var ::$w_.mag if {$itk_option(-show_trans)} { set $w_.var(rotate) [$image_ rotate] set $w_.var(flipx) [$image_ flip x] set $w_.var(flipy) [$image_ flip y] } lassign [$image_ scale] xs ys if {"$ys" == ""} { return } if {$xs >= 0} { $itk_component(choose) config -value [set $w_.mag " ${xs}x"] } else { $itk_component(choose) config -value [set $w_.mag "1/[expr {-$xs}]x"] } } # toggle rotation of the image public method rotate {} { global ::$w_.var $itk_option(-image) rotate [set $w_.var(rotate)] } # flip or unflip the image about the x or y axis, as given by $xy public method flip {xy} { global ::$w_.var $itk_option(-image) flip $xy [set $w_.var(flip$xy)] } # -- public vars -- # target RtdImage (itcl widget) itk_option define -image image Image {} # font for label and value itk_option define -labelfont labelFont LabelFont TkDefaultFont itk_option define -valuefont valueFont ValueFont TkDefaultFont # set the width for displaying the label itk_option define -labelwidth labelWidth LabelWidth 5 # set the width for displaying the value itk_option define -valuewidth valueWidth ValueWidth 12 # flag: if true, display buttons for zooming the image in and out itk_option define -show_Zz_buttons show_Zz_buttons Show_Zz_buttons 1 # flag: if true, display the rotate, flipxy items itk_option define -show_trans show_trans Show_trans 1 # minimum allowed scale value itk_option define -min_scale min_scale Min_scale -10 # maximum allowed scale value itk_option define -max_scale max_scale Max_scale 20 # set the state to normal/disabled to enable/disable editing itk_option define -state state State {normal} # Panel orient: one of {horizontal vertical} (default: horizontal) itk_option define -panel_orient panel_orient Panel_orient {} # -- protected vars -- # internal rtdimage protected variable image_ } skycat-3.1.2-starlink-1b/rtd/library/RtdImageZoom.tcl000066400000000000000000000072121215713201500224410ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImageZoom.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageZoom.tcl - itcl widget managing the RtdImage zoom window # # See man page RtdImageZoom(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created itk::usual RtdImageZoom {} # Note: It is better to use the RtdImageZoomView class, since this # class is outdated and being phased out. # # This [incr Tk] widget class can be used to display a magnified portion # of the image while tracking mouse motion events in the image window. # There are two versions of this widget, see RtdImageZoomView(n) for the # other one. This version takes a caller supplied Tk frame and zooms # directly from the main image's XImage to the frame, but does not # display an accurate image when the main image is "subsampled" # (shrunk). # # The main part of this widget is implemented in C++ by the # rtdimage subcommand "zoom". # # This widget is a subclass of FrameWidget, so it inherits its # methods and options. In addition the options and methods below # are defined. itcl::class rtd::RtdImageZoom { inherit util::FrameWidget # constructor: create a new instance of this class constructor {args} { itk_option add hull.borderwidth hull.relief eval itk_initialize $args # zoom frame itk_component add frame { set zoom_ [frame $w_.frame \ -background black \ -borderwidth 3 \ -relief groove \ -width $itk_option(-width) \ -height $itk_option(-height)] } { } pack $itk_component(frame) -side top global ::$w_.dozoom # checkbutton to turn zoom on/off itk_component add check { checkbutton $w_.check -text Zoom \ -variable $w_.dozoom \ -onvalue 1 -offvalue 0 \ -anchor w \ -borderwidth 2 \ -relief raised \ -command [code $this zoom] } { } pack $itk_component(check) -side bottom -fill both # add help text displayed when mouse enters widget add_short_help $w_ $itk_option(-shelp) } # called when the zoom checkbutton is pressed public method zoom {} { global ::$w_.dozoom if {[winfo width $zoom_] <= 1} { update } if {[set $w_.dozoom]} { $itk_option(-target_image) zoom start $zoom_ $itk_option(-factor) } else { $itk_option(-target_image) zoom stop } } # called when the main image is scaled. public method scale {} { } # This method is called when the mouse ptr enters an RtdImage. # Set the target scale factor from the given rtdimage public method enter_image {image} { } # This method is called when the mouse ptr leaves an RtdImage. # clear out the zoom image. public method leave_image {image} { } # -- public vars -- # target RtdImage itcl widget itk_option define -target_image target_image Target_image {} # width of zoom frame itk_option define -width width Width 128 # height of zoom frame itk_option define -height height Height 128 # zoom factor (window size should be a multiple of this) itk_option define -factor factor Factor 4 # help text displayed when mouse enters widget itk_option define -shelp shelp Shelp \ {Image Zoom: magnified section of image. {bitmap b1} = toggle on/off} # X shared memory option itk_option define -usexshm useXshm UseXshm 1 # X synchronisation option itk_option define -usexsync useXsync UseXsync 1 # -- protected vars -- # internal zoom frame protected variable zoom_ } skycat-3.1.2-starlink-1b/rtd/library/RtdImageZoomView.tcl000066400000000000000000000215261215713201500233000ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdImageZoomView.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdImageZoomView.tcl - itcl widget managing the RtdImage zoom window # # See man page RtdImageZoomView(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created # 16 Sep 96 added code from P. Biereichel to clear # zoom win when leaving window # Peter W. Draper 11 Dec 01 Stopped zoom window retaining a reference # to an image that has been closed in the # main window (i.e. keep the view master current). itk::usual RtdImageZoomView {} # This [incr Tk] widget class can be used to display a magnified portion # of the image while tracking mouse motion events in the image window. # There are two versions of this widget, see RtdImageZoom(n) for the # other one. This version uses an rtdimage "view" of the main image and # changes the x and y offsets as needed. This has the advantage that it # always displays the correct pixels, even when the main image is # "subsampled" and there are no restrictions on the size or shape of the # zoom window. The main part of this widget is implemented in C++ by the # rtdimage subcommand "zoomview". This widget is a subclass of # FrameWidget, so it inherits its methods and options. In addition the # options and methods below are defined. itcl::class rtd::RtdImageZoomView { inherit util::FrameWidget # constructor: create a new instance of this class constructor {args} { itk_option add hull.borderwidth hull.relief global ::$w_.dozoom # evaluate arguments (the following code depends on them) eval itk_initialize $args # RtdImage(n) widget for zoom itk_component add image { rtd::RtdImage $w_.image \ -name "ZoomWin" \ -verbose $itk_option(-verbose) \ -displaymode 1 \ -scrollbars 0 \ -drag_scroll 0 \ -show_object_menu 0 \ -graphics 0 \ -canvaswidth $itk_option(-width) \ -canvasheight $itk_option(-height) \ -usexshm $itk_option(-usexshm) \ -usexsync $itk_option(-usexsync) \ -shelp $itk_option(-shelp) \ -relief groove \ -borderwidth 2 } { rename -canvaswidth -width width Width rename -canvasheight -height height Height } pack $itk_component(image) -side top -fill both -expand 1 set image_ [$itk_component(image) get_image] set canvas_ [$itk_component(image) get_canvas] # draw a box around the center pixel $canvas_ create rectangle 0 0 1 1 \ -outline white -tags rect1 $canvas_ create rectangle 0 0 1 1 \ -outline black -tags rect2 # frame with on/off button and scale menu itk_component add f { frame $w_.f } { keep -background } pack $itk_component(f) -side bottom -fill both # checkbutton to turn zooming on/off itk_component add check { checkbutton $w_.check \ -text Zoom \ -variable $w_.dozoom \ -onvalue 1 -offvalue 0 \ -anchor w \ -borderwidth 2 -relief raised \ -command [code $this zoom] } { keep -background rename -font -labelfont labelFont LabelFont } pack $itk_component(check) \ -side left -fill x -expand 1 -padx 0.5m -ipadx 0.5m -ipady 0.5m -in $w_.f # if the scale factor doesn't propagate automatically, add buttons to set it if {! $itk_option(-propagate)} { # optional button to increase zoom factor itk_component add larger { button $w_.larger \ -bitmap magnify \ -command [code $this inc_zoom 1] } # optional button to decrease zoom factor itk_component add smaller { button $w_.smaller \ -bitmap shrink \ -command [code $this inc_zoom -1] } # optional label for zoom factor itk_component add label { label $w_.label \ -text "" \ -width 3 \ -font $itk_option(-labelfont) } pack $itk_component(larger) $itk_component(smaller) $itk_component(label) \ -side left -fill x -padx 0.5m -ipadx 0.5m -ipady 0.5m -in $w_.f add_short_help $w_.larger \ {Zoom larger: {bitmap b1} = increase magnification of zoom image} add_short_help $w_.smaller \ {Zoom smaller: {bitmap b1} = decrease magnification of zoom image} } # add help text displayed when mouse enters widget add_short_help $w_.check {Zoom On/Off: {bitmap b1} = turn zooming on/off} add_short_help $w_ $itk_option(-shelp) } # increment or decrement the zoom factor public method inc_zoom {inc} { lassign [$image_ scale] xs if {"$xs" == ""} { return } incr xs $inc if {$xs < 2} { set xs 2 } elseif {$xs > 50} { set xs 50 } $image_ scale $xs $xs config -factor $xs scale if {"$itk_option(-command)" != ""} { eval $itk_option(-command) } } # called when the main image is scaled to draw a box around the center pixel. public method scale {} { if {$itk_option(-propagate)} { set f [expr {$target_scale_*$itk_option(-factor)}] } else { set f [lindex [$image_ scale] 0] if {"$f" != ""} { $w_.label config -text "${f}x" } else { # no image loaded... return } } if {$f <= 1} { # box around pixel set x0 [expr {$itk_option(-width)/2.0}] set y0 [expr {$itk_option(-height)/2.0}] } else { # box part of pixel set x0 [expr {$itk_option(-width)/2.0-$f/2.0}] set y0 [expr {$itk_option(-height)/2.0-$f/2.0}] } set x1 [expr {$x0+$f}] set y1 [expr {$y0+$f}] $canvas_ coords rect1 $x0 $y0 $x1 $y1 $canvas_ coords rect2 [expr {$x0-1}] [expr {$y0-1}] [expr {$x1+1}] [expr {$y1+1}] } # This method is called when the mouse ptr enters an RtdImage. # Set the target scale factor from the given rtdimage public method enter_image {image} { lassign [$image scale] target_scale_ if {$target_scale_ < 1} { set target_scale_ 1 } zoom scale } # This method is called when the mouse ptr leaves an RtdImage. # clear out the zoom image. public method leave_image {image} { #$image_ clear ximage zoom 1 } # called when the zoom checkbutton is pressed public method zoom {{clear 0}} { global ::$w_.dozoom if {[set $w_.dozoom] && ! $clear} { catch {$target_image_ view remove $image_} $target_image_ view add $image_ $itk_option(-propagate) $target_image_ view update $image_ 0 0 $itk_option(-width) $itk_option(-height) 0 0 0 0 image if {$itk_option(-propagate)} { $target_image_ zoomview start $image_ $itk_option(-factor) $itk_option(-propagate) } else { $image_ scale $itk_option(-factor) $itk_option(-factor) $target_image_ zoomview start $image_ 1 0 } scale } else { $target_image_ zoomview stop $image_ clear ximage # PWD: remove this line. This removes the zoom image as a # view of the main image, which is fine in principle, # however this doesn't clear the zoom image, which # therefore retains a copy of the image displayed in the # main image, until it receives a new image or is # cleared. This is bad for NDF access, as we need to # really close the file when the main image is # closed. Otherwise reloading files of the same name can # be very bad. #catch {$target_image_ view remove $image_} } } # -- options -- # target (main) RtdImage itcl widget itk_option define -target_image target_image Target_image {} { set target_image_ [$itk_option(-target_image) get_image] } # width of zoom frame itk_option define -width width Width 152 # height of zoom frame itk_option define -height height Height 152 # zoom magnification factor itk_option define -factor factor Factor 4 # flag: if true, make scale of zoom window relative to target window itk_option define -propagate propagate Propagate 1 # X shared memory option itk_option define -usexshm useXshm UseXshm 1 # X synchronisation option itk_option define -usexsync useXsync UseXsync 1 # fonts used itk_option define -labelfont labelFont LabelFont TkDefaultFont # help text displayed when mouse enters widget itk_option define -shelp shelp Shelp \ {Image Zoom: magnified section of image. {bitmap b1} = toggle on/off} # flag: if true, print diagnostic messages itk_option define -verbose verbose Verbose {0} # optional command to evaluate when the zoom factor changes itk_option define -command command Command {} # -- protected vars -- # internal target image protected variable target_image_ # scale of the target (or current target) image protected variable target_scale_ 1 # internal canvas widget protected variable canvas_ # internal rtd image protected variable image_ } skycat-3.1.2-starlink-1b/rtd/library/RtdInit.tcl000066400000000000000000000010331215713201500214500ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: RtdInit.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdInit.tcl # # script which is executed by RtdImage.C to initialize tcl # # who when what # -------- --------- ---------------------------------------------- # pbiereic 24/08/99 created # What we depend on. package require Tclutil package require Astrotcl if {![lcontain $auto_path $rtd_library]} { lappend auto_path $rtd_library } namespace eval rtd {namespace export *} namespace import -force rtd::* skycat-3.1.2-starlink-1b/rtd/library/RtdRecorder.tcl000066400000000000000000000554451215713201500223320ustar00rootroot00000000000000#****************************************************************************** # E.S.O. - VLT project # # RtdRecorderTool.tcl - class for recording or playback of images. # # who when what # -------- -------- ---------------------------------------------- # D.Hopkinson 19/02/97 Created # P.Biereichel 15/07/97 Bugs fixed - revised itk::usual RtdRecorderTool {} # RtdRecorderTool is a class for controlling the recording or playing # back of images. # # This widget doubles as a recorder and playback tool. As a recorder, # it acts as an effective RTD, receiving images from the camera named # in the camera_ variable. As a playback, the camera becomes # hardwired to RTDRPTOOL. itcl::class rtd::RtdRecorderTool { inherit util::TopLevelWidget constructor {args} { eval itk_initialize $args global ::recorder_init set rtdplayback_ [image create rtdplayback] set rtdrecorder_ [image create rtdrecorder] wm title $w_ "Video Record/Playback Images ($itk_option(-number))" wm resizable $w_ 0 0 wm protocol $w_ WM_DELETE_WINDOW "" # Widget layout add_menubar make_layout make_shorthelp trace_counts set recorder_init 1 } destructor { # Stop any recordings/playings before closing. stop $rtdrecorder_ close $rtdplayback_ close # Set back to the original camera before going. $mainwidg_ config -camera $itk_option(-server_camera) } # make the widget layout protected method make_layout {} { global ::$w_.comp ::$w_.pbspeed ::$w_.direction ::$w_.protect ::recorder_init ::$w_.cmode # Tk frame for status itk_component add status { frame $w_.status -relief groove -borderwidth 2 } # Tk label: "File Position:" itk_component add progressLabel { label $itk_component(status).progressLabel \ -text "File Position:" \ -width 11 \ -font $itk_option(-labelfont) \ -anchor w } # Tk scale for progress bar itk_component add progressBar { scale $itk_component(status).progressBar \ -orient horizontal \ -sliderlength 0 \ -from 0 \ -to 1 \ -showvalue 0 \ -width 8 \ -highlightthickness 0 } { keep -width -length } # LabelEntry(n) widget, image count itk_component add imagecount { util::LabelEntry $itk_component(status).imagecount \ -disabledforeground black \ -text "Image Count:" \ -labelfont $itk_option(-labelfont) \ -labelwidth 12 \ -valuewidth 8 \ -validate integer \ -valuefont $itk_option(-valuefont) \ -relief sunken \ -command [code $this gotoImage] \ -borderwidth 2 \ -orient horizontal } { keep -state } # LabelEntry(n) widget "of:" itk_component add ncounts { util::LabelEntry $itk_component(status).ncounts \ -text "of:" \ -labelfont $itk_option(-labelfont) \ -labelwidth 3 \ -valuewidth 5 \ -valuefont $itk_option(-valuefont) \ -relief groove \ -disabledforeground black \ -state disabled \ -borderwidth 2 \ -orient horizontal } # Tk frame for file name itk_component add fileframe { frame $w_.file -relief groove -borderwidth 2 } # LabelEntry(n) widget File Name:" itk_component add filename { util::LabelEntry $itk_component(fileframe).filename \ -text "File Name:" \ -value $imageFile_ \ -labelwidth 12 \ -justify right \ -labelfont $itk_option(-labelfont) \ -valuewidth 28 \ -valuefont $itk_option(-valuefont) \ -relief sunken \ -borderwidth 2 \ -command [code $this chooseFile] \ -orient horizontal } { keep -state } # Set the default camera set camera_ $itk_option(-server_camera) # LabelEntry(n) widget "Camera Name:" itk_component add cameraname { util::LabelEntry $itk_component(fileframe).cameraname \ -text "Camera Name:" \ -labelwidth 12 \ -command [code $this chooseCamera] \ -labelfont $itk_option(-labelfont) \ -valuewidth 28 \ -valuefont $itk_option(-valuefont) \ -relief sunken \ -borderwidth 2 \ -value $camera_ \ -orient horizontal } { keep -state } # action frame itk_component add action { frame $w_.action -relief groove -borderwidth 2 } # Tk frame pbaction1 itk_component add pbaction1 { frame $itk_component(action).pbaction1 -relief flat -borderwidth 2 } # checkbutton "Reverse direction" itk_component add direction { checkbutton $itk_component(pbaction1).direction \ -text "Reverse direction" \ -command [code $this stop] \ -variable $w_.direction \ -anchor w \ -font $itk_option(-labelfont) } { keep -state } # checkbutton "Protect" itk_component add protect { checkbutton $itk_component(pbaction1).protect \ -text "Protect" \ -command [code $this protect] \ -variable $w_.protect \ -anchor e \ -font $itk_option(-labelfont) } { keep -state } set $w_.protect 1 # Tk frame pbaction2 itk_component add pbaction2 { frame $itk_component(action).pbaction2 -relief raised -borderwidth 2 } # Play button itk_component add play { button $itk_component(pbaction2).play \ -bitmap big_right \ -command [code $this play] } { keep -state } # Rewind button itk_component add rewind { button $itk_component(pbaction2).rewind \ -bitmap double_left \ -command [code $this spool "rewind"] } { keep -state } # fast forward button itk_component add ff { button $itk_component(pbaction2).ff \ -bitmap double_right \ -command [code $this spool "ff"] } { keep -state } # single step button itk_component add single { button $itk_component(pbaction2).single \ -bitmap Right \ -command [code $this single] } { keep -state } # Record button itk_component add record { button $itk_component(pbaction2).record \ -bitmap record \ -foreground red \ -disabledforeground red \ -command [code $this record] } # Stop button itk_component add stop { button $itk_component(pbaction2).stop \ -bitmap rect \ -command [code $this stop] } # Set the defaults if {![info exists recorder_init] || $recorder_init != 1} { set $w_.direction 0 set $w_.pbspeed 1 set $w_.cmode 1 } # do the packing blt::blttable $itk_component(status) \ $itk_component(progressLabel) 1,0 -anchor w -fill x \ $itk_component(progressBar) 1,1 -anchor e -fill x -columnspan 2 \ $itk_component(imagecount) 2,0 -anchor w -fill x -columnspan 2 \ $itk_component(ncounts) 2,2 -anchor w -fill x blt::blttable $itk_component(fileframe) \ $itk_component(filename) 1,0 -anchor w -fill x \ $itk_component(cameraname) 2,0 -anchor w -fill x blt::blttable $itk_component(pbaction1) \ $itk_component(direction) 1,0 -anchor w -fill x \ $itk_component(protect) 1,1 -anchor e -fill x blt::blttable $itk_component(pbaction2) \ $itk_component(play) 1,0 -anchor w -fill none \ $itk_component(rewind) 1,1 -anchor w -fill none \ $itk_component(ff) 1,2 -anchor w -fill none \ $itk_component(single) 1,3 -anchor w -fill none \ $itk_component(record) 1,4 -anchor w -fill none \ $itk_component(stop) 1,5 -anchor w -fill none pack $itk_component(status) $itk_component(fileframe) $itk_component(action) \ $itk_component(pbaction1) -side top -anchor w -fill x -expand 0 -padx 5 -pady 5 pack $itk_component(pbaction2) \ -side top -anchor c -fill none -expand 0 -padx 5 -pady 5 } # add short help text protected method make_shorthelp {} { add_short_help $itk_component(progressBar) {Displays the proportion of the maximum file size that has been recorded or proportion played back} add_short_help $itk_component(imagecount) {Image counter when playing back images from file} add_short_help $itk_component(ncounts) {Number of images in file} add_short_help $itk_component(filename) {Displays the name of the file to record/play. Use after editing.} add_short_help $itk_component(cameraname) {Sets the camera from which images are to be received} add_short_help $itk_component(direction) {Reverse the playback direction} add_short_help $itk_component(protect) {Set write protect/unprotect file} add_short_help $itk_component(play) {Playback images from file} add_short_help $itk_component(rewind) {Rewind image file} add_short_help $itk_component(ff) {Fast-forward image file} add_short_help $itk_component(single) {Single-step through file} add_short_help $itk_component(record) {Record images from camera to file} add_short_help $itk_component(stop) {Stop record/playback} } # Method to add the menu bar to the top of the dialogue. protected method add_menubar {} { global ::$w_.cmode ::$w_.pbspeed TopLevelWidget::add_menubar # File menu set m [add_menubutton File] add_menuitem $m command "Load File..." \ {Load a file for recording or playing} \ -command [code $this chooseFile] add_menuitem $m command "Exit" \ {Exit the application} \ -command [code $this close] # Options menu set m [add_menubutton "Options"] # Change the maximum allowed file size add_menuitem $m command "Maximum File Size..." \ {Alter the minimum possible interval between image send events} \ -command [code $this set_max_filesize] # Image cycle mode add_menuitem $m checkbutton \ "Cycle Mode" \ {Turn the image cycling on or off} \ -variable $w_.cmode -onvalue 1 -offvalue 0 \ -command [code $this stop] # Change the playback speed add_menuitem $m cascade "Playback Speed" \ {Set the speed at which to play back images} \ -menu [menu $m.pb] # NB the values given to these compression types correspond to the # ENUM which defines the Playback speed in RtdRPTool.h. $m.pb add radiobutton \ -label "Real Time" \ -command [code $this stop] \ -variable $w_.pbspeed \ -value 2 $m.pb add radiobutton \ -label "Slow" \ -command [code $this stop] \ -variable $w_.pbspeed \ -value 0 $m.pb add radiobutton \ -label "Fast" \ -command [code $this stop] \ -variable $w_.pbspeed \ -value 1 $m add separator # Edit the window add_menuitem $m command "Edit Record Window..." \ {Edit the region of the image to record} \ -command [code $this edit_window] add_menuitem $m command "Reset Record Window" \ {Reset the region of the image to record to full image} \ -command [code $this reset_window] } # inititialize trace variables protected method trace_counts {} { set var1 $rtdrecorder_ global ::$var1 set var2 $rtdplayback_ global ::$var2 set ${var1}(COUNT) 1 set ${var2}(COUNT) 1 trace variable ${var1}(COUNT) w [code $this update_progress] trace variable ${var2}(COUNT) w [code $this update_progress] } # update progress bar and image count public method update_progress {args} { global ::$w_.cmode ::$w_.direction if {$recording_} { set var $rtdrecorder_ } else { set var $rtdplayback_ } global ::$var lassign [set ${var}(COUNT)] count ncount bof eof if {[set $w_.direction] != 0 && !$recording_} { lassign "$bof $eof" eof bof } $itk_component(imagecount) config -value $count $itk_component(ncounts) config -value $ncount set w $itk_component(progressBar) $w config -state normal $w config -from 0 -to $ncount -sliderlength 25 -troughcolor blue -bg grey80 $w set [expr {$count -1}] update $w config -state disabled # puts "$count,$ncount bof=$bof eof=$eof" if {([set $w_.cmode] == 0 && $eof != 0)} { # return to interpreter. Do not send commands to a subimage! after idle "$this stop" } } # method to set/reset cycle mode public method set_cycle_mode {} { global ::$w_.cmode $rtdrecorder_ cycle [set $w_.cmode] } # Reset the window to send to full image. public method reset_window {} { stop set subimage_ 0 if {[winfo exists $w_.subimage]} { destroy $w_.subimage } } # Set the recorder properties prior to starting recording. public method recorder_props {} { global ::$w_.cmode $rtdrecorder_ file size $maxFile_ $rtdrecorder_ cycle [set $w_.cmode] $rtdrecorder_ filename $imageFile_ $rtdrecorder_ camera $camera_ set attached_ 0 if {$subimage_ == 0} { $rtdrecorder_ subimage off } else { $rtdrecorder_ subimage on $x0_ $y0_ $width_ $height_ } } # Set the playback props prior to starting a playback. public method playback_props {} { global ::$w_.cmode ::$w_.pbspeed ::$w_.direction if {[set $w_.direction] == 1} { set dir 0 } else { set dir 1 } $rtdplayback_ filename $imageFile_ $rtdplayback_ cycle [set $w_.cmode] if {[catch {$rtdplayback_ props speed [set $w_.pbspeed]} msg]} { error_dialog $msg return 1 } $rtdplayback_ props direction $dir return 0 } # Set file protect mode public method protect {} { global ::$w_.protect if {[set $w_.protect]} { $itk_component(record) config -state disabled } else { $itk_component(record) config -state normal } } # Edit the record window public method edit_window {} { stop if {[$target_image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } if {$playing_ == 1 || $spooling_ == 1} { warning_dialog "Stop playback before selecting record window" $w_ return } if {[winfo exists $w_.subimage]} { destroy $w_.subimage } if {[action_dialog \ "Please select and drag out a region of the image with mouse button 1" \ $w_]} { [$target_image_ component draw] set_drawing_mode region [code $this make_rapid_frame] } } # create a rapid frame. protected method make_rapid_frame {region_id x0 y0 x1 y1} { set xoffset [expr {int($x0)}] set yoffset [expr {int($y0)}] set width [expr {int($x1-$x0+1)}] set height [expr {int($y1-$y0+1)}] set subimage_ 1 RtdImageFrame $w_.subimage \ -target_image $target_image_ \ -xoffset $xoffset \ -yoffset $yoffset \ -width $width \ -height $height \ -region_id $region_id \ -verbose 0 \ -command [code $this set_subimage] } # set the values of x0_, y0_, width_ and height_ from # the subimage coordinates protected method set_subimage {frameId name op x y w h} { set im [$target_image_ get_image] $im convert coords $x $y canvas x0_ y0_ image $im convert dist $w $h canvas width_ height_ image } # Set the maximum allowed file size in recording images public method set_max_filesize {} { utilReUseWidget InputDialog $w_.maxfsize \ -title "Maximum File Size" \ -text "Set maximum recording file size in Mb (currently $maxFile_ Mb)" \ -modal 1 \ -bitmap information \ -buttons {OK Cancel} set val_returned [$w_.maxfsize activate] if {$val_returned != ""} { set maxFile_ $val_returned } } # Creates the dialog for choosing the file to record to or to # play from public method chooseFile {{file ""}} { global ::$w_.protect if {"$file" == ""} { set file [filename_dialog [pwd] * $w_] if {"$file" == ""} { $itk_component(filename) config -value $imageFile_ return } } set file [fits_pathname $file] if {[file isdir $file]} { error_dialog "$file is a directory" $w_ return } if {[llength $file] != 0} { set $w_.protect 1 stop $rtdplayback_ reset set imageFile_ $file } $itk_component(filename) config -value $imageFile_ } # return 'globbed' pathname for a fits file. If the extension is # not set in $file then .fits is used public method fits_pathname {file} { set dirname [lindex [file dirname $file] 0] if {[catch {glob $dirname} dirname]} { return $file } set basename [file split $file] set basename [lindex $basename [expr {[llength $basename] -1}]] set ext [file extension $file] if {"$ext" == ""} { set file [file join $dirname $basename.fits] } else { set file [file join $dirname $basename] } if {[catch {glob $file} gfile]} { return $file } return $gfile } # Set camera name public method chooseCamera {camera {stop 0}} { set recflg 0 if {($stop && ! $recording_) || ([llength $camera] != 0 && "$camera_" != "$camera")} { if {$recording_} { set recflg 1 } stop set camera_ $camera $rtdplayback_ reset } $itk_component(cameraname) config -value $camera_ if {$recflg} { # resume recording after camera name has changed after idle "$this record" } } # Loads the file into the recorder object property table, and starts # recording. public method record {} { global ::$w_.protect ::$w_.direction if {$recording_ == 1} { return } if {[set $w_.protect]} { error_dialog "Unset 'Protect' in order to write to file $imageFile_" return } stop 0 if {[check_file]} { return } if {$camera_ == ""} { error_dialog "You must choose a camera name" return } $rtdplayback_ reset recorder_props if {[catch {$rtdrecorder_ record} msg]} { error_dialog $msg return } set recording_ 1 set $w_.direction 0 $itk_component(filename) config -value $imageFile_ $itk_component(imagecount) config -value "" $itk_component(ncounts) config -value "" config -state disabled $itk_component(menubar).file config -state disabled $itk_component(menubar).options config -state disabled $itk_component(record) config -relief sunken } # start playback. public method play {} { global ::$w_.pbspeed if {[winfo exists $w_.subimage]} { destroy $w_.subimage } set err 0 if {[catch {set err [playcmd $itk_component(play) play]} msg] || $err} { if {! $err} { warning_dialog "$msg" } return } set playing_ 1 if {![$rtdplayback_ hastime] && [set $w_.pbspeed] == 2} { warning_dialog "File does not include timestamp information for real-time playback" } } # check that the image file name is valid public method check_file {} { if {[llength $imageFile_] == 0} { error_dialog "You must choose a file name" return 1 } return 0 } # set the spool mode ("rewind", "ff"). public method spool {arg} { set widg "" if {"$arg" == "ff"} { set widg $itk_component(ff) } if {[playcmd $widg spool $arg] != 0} { return } if {"$arg" == "ff"} { set spooling_ 1 } } # single step image public method single {} { playcmd "" step } # start playing back images public method playcmd {widg cmd args} { # Check the current state of the dialogue if {$recording_} { return 1 } set_normal if {[winfo exists $widg]} { $widg config -relief sunken } stop 0 if {[check_file]} { return 1 } # Attach the RTD camera to the recorder/playback tool. if {[attach_to_camera] != 0} { return 1 } # Reset the playback properties before starting if {[playback_props]} { return 1 } # Execute command set cmd "$rtdplayback_ $cmd [set args]" if {[catch {eval $cmd} msg]} { stop warning_dialog $msg return 1 } return 0 } # stop the recorder public method stop {{hardstop 1}} { if {$hardstop} { catch {$target_image_ detach_camera} set attached_ 0 } # Call the appropriate stop method if {$recording_ == 1} { $rtdrecorder_ stop } if {$playing_ == 1 || $spooling_ == 1} { $rtdplayback_ stop } # Configure the original server camera $mainwidg_ config -camera $itk_option(-server_camera) set recording_ 0 set playing_ 0 set spooling_ 0 if {![winfo exists $w_]} { return } if {$hardstop} { set_normal } } # set the state to normal. public method set_normal {} { config -state normal $itk_component(menubar).file config -state normal $itk_component(menubar).options config -state normal foreach el {play ff rewind single record} { $itk_component($el) config -relief raised } } # stop all actions and delete window. public method close { } { stop destroy $w_ } # This method attaches the RTD to the RTDRPTOOL camera for the purposes # of image playback. A check is made to see if the RTD is already # attached. public method attach_to_camera {} { # If we are already attached then return immediately. if {$attached_ == 1} { return 0 } # Attach the RTD to RTDRPTOOL. if {[catch {$target_image_ attach_camera "RTDRPTOOL"} msg]} { if {"$smg" != ""} { #warning_dialog $msg } return 1 } set attached_ 1 # Allow the re-attachment of the RTD to RTDRPTOOL to complete before # the next action takes place; occasionally an image would be sent to # the rtdServer between detachment and re-attachment and so would be lost. update idletasks return 0 } # go to the selected image public method gotoImage {arg} { global ::$w_.cmode ::$w_.direction if {$arg == ""} { return } set cmodesv $w_.cmode if {![set $w_.cmode]} { set $w_.cmode 1 } if {[set $w_.direction]} { incr arg } playcmd "" gotoimage $arg single if {$cmodesv != [set $w_.cmode]} { set $w_.cmode $cmodesv playback_props } } # set global parameters public method set_globals {vars value} { foreach el [set vars] { global ::$w_.$el set $w_.$el $value } } #-------------------------------------------------------------------- # variables #-------------------------------------------------------------------- # target (main) RtdImage itcl widget itk_option define -target_image target_image Target_image {} { set target_image_ $itk_option(-target_image) set mainwidg_ [winfo parent [$target_image_ component hull]] } # font used for labels itk_option define -labelfont labelFont LabelFont TkDefaultFont # font used for values itk_option define -valuefont valueFont ValueFont TkDefaultFont # server camera name itk_option define -server_camera server_camera Server_camera {} # set the state to normal/disabled itk_option define -state state State {normal} # main widget name protected variable mainwidg_ # name of target rtd image protected variable target_image_ # name of rtdrecorder image object for recording images protected variable rtdrecorder_ # name of rtdplayback image object for playback of images protected variable rtdplayback_ # flag: true if playing back images protected variable playing_ 0 # flag: true if recording images protected variable recording_ 0 # flag: true if spooling (rewind, ff) protected variable spooling_ 0 # max record file size in MB protected variable maxFile_ 5 # name of rtdimage camera for receiving images from the rtdserver protected variable camera_ # file for recording images protected variable imageFile_ "RTDRPTOOL.fits" # Variables pertaining to the subimage sampling facility protected variable subimage_ 0 protected variable x0_ 0 protected variable y0_ 0 protected variable width_ 0 protected variable height_ 0 # Variable for indicating whether RTD is currently attached to RTDRPTOOL. protected variable attached_ 0 } skycat-3.1.2-starlink-1b/rtd/library/RtdRemoteTcl.tcl000077500000000000000000000027511215713201500224560ustar00rootroot00000000000000#******************************************************************************* # E.S.O. - VLT project # # "@(#) $Id: RtdRemoteTcl.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # RtdRemoteTcl.tcl - procedures for the Rtd remote Tcl interface # # who when what # -------------- --------- ---------------------------------------- # Peter Biereichel 11/08/99 created # connect to a running Rtd process and return the file descriptor # for the connection socket. proc connect_to_rtd {} { global env # get the hostname and port info from the file ~/.rtd-remote, # which is created by rtdimage when the remote subcommand is used if {[catch {set fd [open $env(HOME)/.rtd-remote]} msg]} { puts "can't open ~/.rtd-remote: make sure rtd is running: $msg" return 0 } lassign [read $fd] pid host port #puts ".rtd-remote: pid=$pid, host=$host, port=$port" close $fd if {[catch {exec kill -0 $pid} msg]} { return 0 } set fd [server_connect -nobuf $host $port] return $fd } # send the command to rtd and return the result proc send_to_rtd {rtd_fd cmd} { puts $rtd_fd $cmd lassign [gets $rtd_fd] status length set result {} if {$length > 0} { set result [read $rtd_fd $length] } if {$status != 0} { #puts $result } return $result } # execute tcl command proc etcl {rtd_fd cmd} { #puts "Tcl command: $cmd" set ret [send_to_rtd $rtd_fd "remotetcl {$cmd}"] #puts "Reply: $ret" return $ret } skycat-3.1.2-starlink-1b/rtd/library/main.tcl000066400000000000000000000124551215713201500210310ustar00rootroot00000000000000# -*-tcl-*- # # E.S.O. - VLT project # # "@(#) $Id: main.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # rtd - main entry point for real-time image display application # # Usage: rtd ?options? # # where ?options? are the same as the "public" variables in the main # itcl class Rtd and take the form: -option value ...` # # See man page rtd(1) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 20/05/95 created # pbiereic 16/08/99 added option -help # pbiereic 05/02/03 added rtd_versionId so that the version can # be printed with what rtd (see SPR). # A.Brighton 29/12/05 rewrote for new setup package require Rtd set rtd_versionId {@(#) $Id: main.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $} set rtd_usage { Usage: rtd ?fitsFile? ?-option value ...? Options: -attach bool - attach to camera -camera - camera name: def: \$RTD_CAMERA, if set, otherwise \$RTDSIMULATOR -colorramp_height - height of colorramp window (default: 12) -colorramp_height - height of color bar -debug bool - debug flag: turn on real-time simulation -default_cmap - default colormap -default_itt - default intensity transfer table -disp_image_icon bool - display a copy of the image in the icon (default) -dozoom bool - turn on zoom window (default) -file - fits file to load ('-' for stdin) -float_panel bool - put info panel in a popup window (default: 0) -help - print this text -image_directory - default directory for loading images -interval - for real-time simulation: update interval in ms (def: 500) -max_scale - maximum scale for magnification menu (default: 20). -min_scale - minimum scale for magnification menu (default: -10). -pan_height - height of pan window (default: 152) -pan_width - width of pan window (default: 152) -panel_layout - panel layout, one of: "saoimage", "reverse", "default" -panel_orient - panel orientation, one of: "horizontal", "vertical" -port - listen for remote cmds on port (default: 0 = choose port) -subsample bool - use subsampling when shrinking the image (default: 1 = on). -sampmethod - sampling method when subsample=0 (default: 0 = max value). -rtd_geometry - window geometry -rtd_title - string for title bar -scrollbars bool - display scrollbars (not displayed by default) -testprog - prog to use for real-time simulation (default: tRtd) -usexshm bool - use X shared mem, if available (default) -verbose bool - print diagnostic messages -with_colorramp bool - display the color bar (default) -with_grid bool - Include a WCS grid button (default: 0 = off). -with_pan_window bool - display the pan window (default)) -with_warp bool - add bindings to move mouse ptr with arrow keys (default: 1). -with_zoom_window bool - display the zoom window (default)) -xscale - default scaling factor -yscale - default scaling factor -zoom_factor - zooming factor (default: 4) -zoom_height - height of zoom window (default: 152) -zoom_width - width of zoom window (default: 152) } if {[info exists argv]} { if {[regexp -- "-help" $argv]} { puts $rtd_usage exit 0 } } set tk_strictMotif 1 catch {tk appname Rtd} tk_focusFollowsMouse if { [catch {utilPrintErrors} msg ] } { puts "Error when autoloading 'utilPrintErrors'.\nauto_path=$auto_path\nCheck installation:\n\n$msg" exit 1 } # XXX temp hack until panel editor is fixed to only require Rtd when needed image delete [image create rtdimage] # Start the application class Rtd: # # Note that "start" is a "member" proc in the TopLevelWidget class # (of which Rtd is a subclass). It creates an instance of the Rtd # application class and handles options and error checking. # Specify a list of valid options (workaround for tcl or itcl bug (?) that # crashes app if option is unknown...) set optlist [list \ -attach \ -camera \ -color_scale \ -colorramp_height \ -debug \ -default_cmap \ -default_itt \ -disp_image_icon \ -dozoom \ -drag_scroll \ -feedback \ -file \ -float_panel \ -image_directory \ -interval \ -max_scale \ -min_scale \ -pan_height \ -pan_width \ -panel_layout \ -panel_orient \ -pickobjectorient \ -port \ -rapid_frame_command \ -regioncommand \ -remote \ -rtd \ -rtd_geometry \ -rtd_title \ -scrollbars \ -shm_data \ -shm_header \ -shorthelpwin \ -subsample \ -sampmethod \ -testprog \ -updatePick \ -use_zoom_view \ -usexshm \ -usexsync \ -verbose \ -with_colorramp \ -with_grid \ -with_pan_window \ -with_perftest \ -with_warp 1 \ -with_zoom_window \ -xscale \ -yscale \ -zoom_factor \ -zoom_height \ -zoom_view_propagate \ -zoom_width \ ] util::TopLevelWidget::start Rtd "-file" "$rtd_usage" "" 1 $optlist skycat-3.1.2-starlink-1b/rtd/library/mkIndex.tcl000077500000000000000000000003231215713201500214760ustar00rootroot00000000000000#!../bin/rtdimage_wish # # mkIndex.tcl - generate a tclIndex file in the current directory # "@(#) $Id: mkIndex.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" package require Itcl auto_mkindex . *.tcl exit 0 skycat-3.1.2-starlink-1b/rtd/library/rtd_defaults.tcl000066400000000000000000000012711215713201500225570ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: rtd_defaults.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # defaults.tcl - set widget defaults # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 11 Oct 95 created # set general widget defaults proc rtd::setXdefaults {} { util::setXdefaults option add *RtdImage.canvasBackground black option add *RtdImageCtrl.canvasBackground black option add *RtdImageCtrl.canvasWidth 520 option add *RtdImageCtrl.canvasHeight 520 option add *RtdImagePan.background black option add *RtdImageTrans.relief flat option add *RtdImageColorRamp.cursor exchange } skycat-3.1.2-starlink-1b/rtd/library/tRtd.tcl000066400000000000000000000137021215713201500210160ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: tRtd.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # tRtd.tcl - itcl widget for starting tRtd # # This class starts the camera test task tRtd with user defined options. # If the name of the testprogram is not tRtd then the testprogram is # started in a backwards compatible way. # # who when what # -------------- --------- ---------------------------------------- # pbiereic 01/03/01 Created itk::usual tRtd {} itcl::class rtd::tRtd { inherit util::TopLevelWidget constructor {args} { eval itk_initialize $args wm protocol $w_ WM_DELETE_WINDOW [code $this close] wm title $w_ "tRtd Control" } destructor { if { $tRtdPid_ > 0 } { catch { kill $tRtdPid_ } } } protected method init {} { # compatible to previous versions (maybe this option was never used) if { "$itk_option(-testprog)" != "$tRtd_" } { wm withdraw $w_ if { $tRtdPid_ > 0} { catch {kill $tRtdPid_} } if {[catch {set tRtdPid \ [exec $itk_option(-testprog) \ -v $itk_option(-verbose) \ -t $itk_option(-interval) &]} msg]} { error_dialog "error starting $itk_option(-testprog): $msg" } return } make_layout start } protected method make_layout {} { global ::$rtdimage_ set optf [frame $w_.optf -borderwidth 2 -relief groove] pack $optf -fill both -expand 1 foreach {opt text validate default} { \ v "Verbose flag" numeric 0 \ c "Camera name" alphanumeric rtdtest \ t "Update interval in msecs" numeric 500 \ W "Main frame width" numeric 255 \ H "Main frame height" numeric 255 \ x "Rapid frame start x" numeric 0 \ y "Rapid frame start y" numeric 0 \ w "Rapid frame width (N/A)" numeric 255 \ h "Rapid frame height (N/A)" numeric 255 \ f "Rapid frame Id" numeric 0 \ b "#of shared memory buffers" numeric 2 \ l "Use semaphore locking" numeric 1 \ I "File ngc1275.fits. Directory:" none ""} { set wdg $optf.tRtd$opt set var ${rtdimage_}(tRtd$opt) itk_component add $opt { LabelValue $wdg \ -textvariable $var \ -text $text \ -relief groove \ -justify right \ -state normal \ -valuewidth 10 \ -labelwidth 22 \ -validate $validate \ -command [code $this start] \ -anchor w } { keep -state } lappend vars_ "-$opt [$wdg cget -textvariable]" set $var $default [$wdg component entry] config -state normal \ -relief sunken pack $wdg -fill both -expand 1 } set butf [frame $w_.butf -borderwidth 2 -relief groove] pack $butf -fill both -expand 1 foreach {but} {start stop rapid default close} { itk_component add $but { button $butf.$but -text [string toupper $but] \ -command [code $this $but] -padx 1 } { keep -state } pack $butf.$but -fill none -expand 1 -side left -ipadx 2 -padx 2 } } # start process tRtd with options. Before make sure that the previous # process has terminated. public method start {args} { stop if {$tRtdPid_ > 0 } { after 100 [code $this start] return } global ::$rtdimage_ foreach el $vars_ { if {! [lempty [set [lindex $el 1]]]} { append opts "[lindex $el 0] [set [lindex $el 1]] " } } # puts $opts $rtdimage attach_camera $itk_option(-camera) if { [set ${rtdimage_}(tRtdv)] } { set tRtdPid_ [eval exec xterm -e $itk_option(-testprog) $opts &] } else { set tRtdPid_ [eval exec $itk_option(-testprog) $opts &] } } public method stop {args} { if {"[cget -state]" == "disabled"} { return } $rtdimage detach_camera if { $tRtdPid_ > 0 } { catch { kill $tRtdPid_ } config -state disabled tRtdWait } } public method tRtdWait {args} { if { [catch {wait -nohang $tRtdPid_} msg]} { config -state normal set tRtdPid_ -1 } else { update after 100 [code $this tRtdWait] } } public method default {args} { stop destroy $w_.optf $w_.butf make_layout } public method rapid {args} { stop $rtdimage config -rapid_frame_command [code $this rapid_frame_command] $rtdimage rapid_frame 1 } public method rapid_frame_command {f name op x y w h} { global ::$rtdimage_ stop if {"$op" == "delete"} { return } set y [expr {[$rtdimage_ height] - $y - $h}] $rtdimage_ convert dist $x $y canvas x y image $rtdimage_ convert dist $w $h canvas w h image if {$x < 0} { set x 0 } if {$y < 0} { set y 0 } foreach el "f x y w h" { set ${rtdimage_}(tRtd$el) [set $el] } start } public method close {} { stop # compatible to previous versions: if { "$itk_option(-testprog)" != "$tRtd_" } { return } wm withdraw $w_ } # -- public variables (also program options) -- # camera name itk_option define -camera camera Camera {} # Main Rtd image itk_option define -rtdimage rtdimage Rtdmage {} { if {[winfo exists [cget -rtdimage]]} { set rtdimage [cget -rtdimage] set rtdimage_ [$rtdimage get_image] } } # for testing: name of test program used to generate real-time updates itk_option define -testprog testProg TestProg {} # default interval between updates in ms itk_option define -interval interval Interval {} # flag: if true, print diagnostic messages itk_option define -verbose verbose Verbose {0} itk_option define -buttons buttons Buttons {start stop cancel} itk_option define -state state State {normal} # -- protected variables -- # pathname of main image protected variable rtdimage # name of main image object protected variable rtdimage_ # pid of test prog used to generate frames (debug) protected variable tRtdPid_ -1 # default name of test program protected variable tRtd_ "tRtd" # variables used by entries protected variable vars_ } skycat-3.1.2-starlink-1b/rtd/man/000077500000000000000000000000001215713201500165015ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/rtd/man/ColorMapInfo.man3000066400000000000000000000065461215713201500216240ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: ColorMapInfo.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created NAME ColorMapInfo - A C++ class for reading and managing color map files SYNOPSIS #include "ColorMapInfo.h" enum {MAX_COLOR=256}; /* work with 8 bit color */ // one of these is used to hold colormap info for each colormap // file read class ColorMapInfo { ... public: ColorMapInfo(char* name, ColorMapInfo* next = NULL); ~ColorMapInfo(); // create and return ColorMap from a file description static ColorMapInfo* read(char* filename, ColorMapInfo* next = NULL); // member access char* name(); ColorMapInfo* next(); // set the red, green and blue values from the colormap data // and interpolate based on the count of available colors void interpolate(XColor* colorCells, int colorCount); // rotate the colormap by the given amount void rotate(int amount, XColor* src, XColor* dest, int colorCount); // shift the colormap by the given amount void shift(int amount, XColor* src, XColor* dest, int colorCount); }; DESCRIPTION This class is used by class ImageColor to read in and manage a single colormap file. The constructor is not normally called from outside the class. To create an object of this class, the static "read" member function reads in a colormap file (256 lines of RGB values between 0.0 and 1.0) and returns a pointer to a new ColorMapInfo instance for the file. Reading in the colormap only stores the values in memory, To apply the colormap file to the default colormap, the interpolate method is called. Most methods take a colorCount argument, which is the number of colors allocated in the colormap. The rotate and shift methods take an integer "amount" argument, which is typically the difference in mouse movements in some widget and is used to rotate (with wrap around) or shift (without wrap around) the colormap by the given amount. METHODS static ColorMapInfo* read(char* filename, ColorMapInfo* next = NULL) Create and return a ColorMapInfo from a file description. The next argument is used to build a list of loaded colormaps. char* name() Return the name (file name) of the colormap loaded. ColorMapInfo* next() Return a pointer to the next colormap in the list. void interpolate(XColor* colorCells, int colorCount) Set the red, green and blue values in the colormap (in the colorCells array) from the loaded colormap data and interpolate based on the count of available colors. void rotate(int amount, XColor* src, XColor* dest, int colorCount) Rotate the colormap by the given amount. "src" is the source colormap, dest is the destination colormap and colorCount gives the number of colors in src and dest. void shift(int amount, XColor* src, XColor* dest, int colorCount); Shift the source colormap by the given amount, putting the result in dest. colorCount is the number of colors in src and dest. FILES $RTD_LIBRARY/../colormaps/*.lasc - MIDAS colormap files SEE ALSO ImageColor, ITTInfo(3C++) -------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/ITTInfo.man3000066400000000000000000000054311215713201500205400ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: ITTInfo.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created NAME ITTInfo - C++ class for reading and managing MIDAS ITT (intensity transfer table) files SYNOPSIS #include "ITTInfo.h" // one of these is used to hold ITT info for each ITT // file read class ITTInfo { ... public: ITTInfo(char* name, ITTInfo* next = (ITTInfo*)NULL); ~ITTInfo(); // create and return ITT from a file description static ITTInfo* read(char* filename, ITTInfo* next = (ITTInfo*)NULL); // member access char* name() {return name_;} ITTInfo* next() {return next_;} // Copy the rgb color values from colorCells to copyCells and interpolate based // on the ITT table and the count of available colors void interpolate(XColor* src, XColor* dest, int colorCount); // Copy the rgb color values from colorCells to copyCells as above, // and also scale the ITT values by the given amount void scale(int amount, XColor* src, XColor* dest, int colorCount); }; DESCRIPTION This class is used to read in and manage an ITT (intensity transfer table) file in MIDAS format, which is 256 lines of values between 0.0 and 1.0, which are applied to the colormap color values to modify the colormap. Most methods take a colorCount argument, which is the number of colors allocated in the colormap. The scale method take an integer "amount" argument, which is typically the difference in mouse movements in some widget and is used to stretch or squeeze the ITT (and colormap) by the given amount. METHODS static ITTInfo* read(char* filename, ITTInfo* next = NULL) Create and return an ITTInfo from a file description. The next argument is used to build a list of loaded ITTs. char* name() Return the name (file name) of the ITT loaded. ITTInfo* next() Return a pointer to the next ITT in the list. void interpolate(XColor* src, XColor* dest, int colorCount) Copy the rgb color values from src to dest and interpolate based on the ITT table and the count of available colors. void scale(int amount, XColor* src, XColor* dest, int colorCount); Copy the rgb color values from src to dest as above, and also scale the ITT values by the given amount. Values greater than 1.0 "stretch" the ITT/colormap, values between 0.0 and 1.0 "sqeeze" it. FILES $RTD_LIBRARY/../colormaps/*.iasc - MIDAS ITT files SEE ALSO ImageColor, ColorMapInfo(3C++) -------------------------------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/ImageColor.man3000066400000000000000000000117671215713201500213160ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: ImageColor.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created NAME ImageColor - A C++ class for managing image colors SYNOPSIS #include "ImageColor.h" /* * An instance of this class is used to manage colors and colormaps * for RtdImage and derived widgets */ class ImageColor { ... public: // constructor ImageColor(Display*, Visual*, int numColors); // member functions int numFreeColors(); int allocate(int numFreeColors); int reallocate(int numFreeColors); // load (reload) a color map from the given file int loadColorMap(char* filename); // load (reload) an ITT from the given file int loadITT(char* filename); // rotate the colormap by the given amount int rotateColorMap(int amount); // shift the colormap by the given amount int shiftColorMap(int amount); // scale the current colormap/ITT by the given amount int scaleITT(int amount); // reset colormap to original state int reset(); // start using a private colormap int usePrivateCmap(); // return true if we are using a private colormap int usingPrivateCmap() {return (colormap_ != defaultCmap_);} // if we are using a private colormap, set it for the given window int setColormap(Tk_Window); // member access int freeCount() {return freeCount_;} int colorCount() {return colorCount_;} unsigned long* pixelval() {return pixelval_;} unsigned long pixelval(int i) {return pixelval_[i];} XColor* colorCells() {return itt_ ? ittCells_ : colorCells_;} }; DESCRIPTION This class is used to manage the colormap for an image display application. This is normally the default colormap, however, if not enough colors can be allocated, a private colormap can be created and an attempt is made to reduce color flashing by copying the colors from the default colormap to the new one. Normally, only a single instance of the ImageColor class is required per application. Class ImageColor modifies the colormap by allocating a given number of color cells and assigning color values to cells based on MIDAS colormap and ITT (intensity transfer table) files. Methods are also available for rotating, shifting, stretching and squeezing the colormap. MIDAS COLORMAP FILES The colormap files used here were taken in ascii form from the MIDAS distribution. A colormap file has 256 lines of red, green, blue floating point values between 0.0 and 1.0. The values are scaled to the size of the colormap (the number of allocated colors) at run time. MIDAS ITT FILES An ITT file is like a colormap file, except that there is only one value per line (256 lines). Each value is between 0.0 and 1.0 and is used to modify the colormap. For example, to get a negative of an image, a negative ITT would have values starting at 1.0 and ending at 0.0, equally spaced. CONSTRUCTOR The constructor takes as arguments, a pointer to the X display (for colormap operations) and the number of colors to allocate. If there are not that many colors available, then the actual number allocated will be less. METHODS int numFreeColors() Return the number of free color cells available (uses a binary search between 0 and MAX_COLOR). int allocate(int numFreeColors) Allocate at most numColors color cells. If there are not that many colors available, then the actual number allocated will be less. int reallocate(int numFreeColors) Free and then re-allocate at most numColors color cells. int loadColorMap(char* filename) Load a color map from the given file, where file contains 256 lines of (r g b) values. int loadITT(char* filename) Load an intensity transfer table (ITT) from the given file where file contains 256 ITT values, one per line. int rotateColorMap(int amount) Rotate the colormap by the given amount. int shiftColorMap(int amount) Shift the colormap by the given amount. int scaleITT(int amount) Scale (squeeze or stretch) the current colormap/ITT by the given amount. int reset() Reset colormap to original state. int freeCount() Return the number of free colors available. int colorCount() Return the number of colors allocated. unsigned long* pixelval() Return the array of pixel values for the allocated colors in the colormap. unsigned long pixelval(int i) Return the colormap pixel value at the given index. XColor* colorCells() Return pointer to array of XColors used for colormap. int usePrivateCmap() Start using a private colormap. int usingPrivateCmap() Return true if we are using a private colormap. int setColormap(Tk_Window) If we are using a private colormap, set it for the given window. SEE ALSO ColorMapInfo, ITTInfo(3C++) ----------------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/ImageDisplay.man3000066400000000000000000000047101215713201500216330ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: ImageDisplay.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created NAME ImageDisplay - A C++ class for managing the display of an XImage SYNOPSIS #include "ImageDisplay.h" class ImageDisplay { ... public: // constructor ImageDisplay(Display *display, Visual *visual, GC gc, int depth, int useXShm, int verbose); // destructor ~ImageDisplay(); // create or update an XImage with the given size int update(int width, int height); // copy the XImage to a Drawable in the X Server void put(Drawable, int src_x, int src_y, int dest_x, int dest_y, int width, int height); // return a pointer to the XImage data unsigned char* data(); // inline query methods int width(); int height(); int bitmapPad(); int bytesPerLine(); // return true if we are really using X shared memory int usingXShm(); }; DESCRIPTION This class manages the creation, display and disposal of an XImage, optionally using X shared memory, if available. CONSTRUCTOR The constructor takes as arguments: the X display, visual, GC and image depth, all for later reference in X calls. In addition, 2 flags may be specified: "useXshm" is set to true if X shared memory should be tried for and "verbose" is set to true if diagnostic messages should be printed out at run time. METHODS There are two main methods. One to create or update an XImage and one to copy it to the X server: int update(int width, int height) Create or update the XImage so that it has the given width and height, using X shared memory, if applicable. void put(Drawable d, int src_x, int src_y, int dest_x, int dest_y, int width, int height) Copy the contents of the XImage to the given drawable with the given arguments, using X shared memory, if applicable. In addition, there are inline methods defined to query the XImage width and height, bytes per line and padding. Note: always use "bytesPerLine()" rather than width() in calculations, since padding in X shared memory can make the two different. SEE ALSO RtdImage --------------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/ImageZoom.man3000066400000000000000000000054761215713201500211640ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: ImageZoom.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created NAME ImageZoom - C++ class for RtdImage Zoom Window SYNOPSIS #include "ImageZoom.h" /* * This class implements the Zoom window for the RtdImage class */ class ImageZoom { protected: Tk_Window tkwin_; // zoom window GC gc_; // graphics context for copying pixels GC rect_gc_; // graphics context for drawing box aroung center pixels int width_; // width of displayed image int height_; // height of displayed image int zoomFactor_; // zoom factor (1...n) int zoomStep_; // value used to calculate zoom = width/factor ImageDisplay *xImage_; // class object for zoom window's X image int status_; // return value from constructor public: // constructor: initialize the zoom window ImageZoom(Tk_Window tkwin, GC copyGC, int width, int height, int factor, int usingXShm, int verbose); // destructor: clean up resources ~ImageZoom(); // called for motion events in the image to do the zooming void zoom(unsigned char* data, int x, int y, int w, int h, int xs, int ys); // return status after constructor for error checking int status() {return status_;} }; DESCRIPTION This class is used to implement one version of the RtdImage zoom window, a small window displaying a magnified area of the main image while tracking mouse pointer motion events. See RtdImageZoomView(n) for the other, which is implemented as "view" of an RtdImage widget. This simple class gets the necessary X window information from the constructor arguments. The "zoom()" method is then called for mouse pointer motion events with a pointer to the XImage data for the main image, the mouse coordinates, the width of the zoom image and the zoom factor. The zoom is done at the given factor directly from the given X Image data and a rectangle is drawn in the middle to indicate the size of a pixel in the main image. METHODS void zoom(unsigned char* data, int x, int y, int w, int h, int xs, int ys) Called for motion events in image window when zooming is on. Args: data - pointer to data being displayed x, y - coords in displayed image (XImage coordinates) w, h - width (bytesPerLine) and height of displayed image xs, ys - x and y magnification factors int status() Return status after constructor for error checking. SEE ALSO RtdImage, RtdImageCtrl(n), RtdImageZoom(n), RtdImageZoomView(n) ----------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/RtdCamera.man3000066400000000000000000000101351215713201500211230ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: RtdCamera.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created NAME RtdCamera - A C++ class for managing realtime image updates SYNOPSIS #include "RtdCamera.h" class RtdCamera { protected: char* name_; // some unique name (name of Tk image...) int verbose_; // flag: if true, print diagnostic messages Tcl_Interp* interp_; // Tcl interp (for file events, error handling) rtdIMAGE_EVT_HNDL* eventHndl_; // image event handle int evtError_; // error count for image events char* eventScript_; // tcl script to evaluate for each event void* shmPtr_; // pointer to shared memory area for image int shmId_; // shared memory ID for image event char* camera_; // camera name int attached_; // flag: true if we are attached to the image event // server int width_, height_; // image dimensions int type_; // image type // member called by fileEventProc for realtime image events int fileEvent(); // called to display new image from shared memory // (defined in a derived class) virtual int display(int frameId, int type, int width, int height, void* data) = 0; // start accepting events from the camera int attach(const char* camera); // stop accepting events from the camera int detach(); public: // constructor RtdCamera(const char* name, Tcl_Interp*, int verbose); // destructor ~RtdCamera(); // static file handler, called by Tk file handler for realtime image events static void fileEventProc(ClientData, int mask); // start/stop/pause or continue accepting images int start(const char* camera); int stop(); int pause(); int cont(); // make a allocated copy of the shared memory image data void* copyImage(); // return the current status of the camera int paused(); int attached(); int stopped(); void* shmPtr(); }; DESCRIPTION RtdCamera is the abstract base class for managing real-time images coming from a CCD camera. It is designed as a base class, so that it doesn't have to know anything about how to actually display an image. Class RtdImage derives a simple class from this base class and redefines the "display" method to display the incoming image. An instance of this class (actually a derived class) is created for the rtdimage(n) "camera start" command. It opens a connection to the RtdServer(1) daemon process and sets up a Tk file event handler to listen for image events. When an image event is received, this class decodes it and calls the virtual "display" method to display the image. METHODS int fileEvent() This method is called when there is a message to read from the realtime event server. Read the message and call a virtual method to display the image and evaluate the tcl event script, if there is one (not currently used, see rtdimage(n) camera command). void* copyImage() return a malloc'ed copy of the shared memory image data. void fileEventProc(ClientData clientData, int mask) This static method is called when there is a message to read from the realtime event server: pass it on to a member function. int attach(const char* camera) Start accepting events from the camera. int detach() Stop accepting events from the camera. int start(const char* camera) Start accepting images from the named camera. The "name" argument is some string that identifies the caller, such as the image name. "camera" is a string that identifies the camera. int stop() Stop accepting images from the camera. int pause() This is like stop, but keeps the camera around so that you can use "cont" to continue. int cont() Continue the camera after a pause. SEE ALSO RtdImage, rtdImageEvt, RtdServer(1), rtdimage(n) ----------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/RtdImage.man3000066400000000000000000000617711215713201500207710ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: RtdImage.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created # Allan Brighton 10 Apr 96 updated NAME RtdImage - The C++ class implementing the rtdimage Tk image type PARENT CLASS TkImage SYNOPSIS #include "RtdImage.h" class RtdImageOptions : public TkImageOptions {...}; #define RTD_OPTIONS ... class RtdImage : public TkImage { ... public: RtdImage(Tcl_Interp*, const char* instname, int argc, char** argv, Tk_ImageMaster master, const char* imageType, Tk_ConfigSpec* specs = (Tk_ConfigSpec*)NULL, RtdImageOptions* options = (RtdImageOptions*)NULL); ~RtdImage(); virtual int call(const char* name, int len, int argc, char* argv[]); static int CreateImage(Tcl_Interp*, char *name, int argc, char **argv, Tk_ImageType*, Tk_ImageMaster, ClientData*); static void eventProc(ClientData clientData, XEvent *eventPtr); static void motionProc(ClientData clientData); int displayImageEvent(int frameId, int type, int width, int height, int xoffset, int yoffset, const Mem& data); static int rtd_set_cmap(ClientData, Tcl_Interp* interp, int argc, char** argv); int alloccolorsCmd(int argc, char* argv[]); int autocutCmd(int argc, char* argv[]); int bitpixCmd(int argc, char* argv[]); int cameraCmd(int argc, char* argv[]); int clearCmd(int argc, char* argv[]); int cmapCmd(int argc, char* argv[]); int colorrampCmd(int argc, char* argv[]); int colorscaleCmd(int argc, char* argv[]); int convertCmd(int argc, char* argv[]); int cutCmd(int argc, char* argv[]); int dispheightCmd(int argc, char* argv[]); int dispwidthCmd(int argc, char* argv[]); int dumpCmd(int argc, char* argv[]); int fitsCmd(int argc, char* argv[]); int flipCmd(int argc, char* argv[]); int frameidCmd(int argc, char* argv[]); int freqCmd(int argc, char *argv[]); int getCmd(int argc, char* argv[]); int graphdistCmd(int argc, char* argv[]); int heightCmd(int argc, char* argv[]); int isclearCmd(int argc, char* argv[]); int ittCmd(int argc, char* argv[]); int maxCmd(int argc, char* argv[]); int maxFreqCmd(int argc, char* argv[]); int mbandCmd(int argc, char* argv[]); int minCmd(int argc, char* argv[]); int mmapCmd(int argc, char* argv[]); int motioneventCmd(int argc, char* argv[]); int objectCmd(int argc, char* argv[]); int panCmd(int argc, char* argv[]); int perfTestCmd(int argc, char *argv[]); int pixtabCmd(int argc, char* argv[]); int previewCmd(int argc, char* argv[]); int radecboxCmd(int argc, char* argv[]); int remoteCmd(int argc, char* argv[]); int remoteTclCmd(int argc, char* argv[]); int rotateCmd(int argc, char* argv[]); int scaleCmd(int argc, char* argv[]); int shmCmd(int argc, char* argv[]); int spectrumCmd(int argc, char* argv[]); int statisticsCmd(int argc, char* argv[]); int typeCmd(int argc, char* argv[]); int updateCmd(int argc, char* argv[]); int viewCmd(int argc, char* argv[]); int warpCmd(int argc, char* argv[]); int wcssetCmd(int argc, char* argv[]); int wcsshiftCmd(int argc, char* argv[]); int wcscenterCmd(int argc, char* argv[]); int wcsdistCmd(int argc, char* argv[]); int wcsequinoxCmd(int argc, char* argv[]); int wcsheightCmd(int argc, char* argv[]); int wcsradiusCmd(int argc, char* argv[]); int wcswidthCmd(int argc, char* argv[]); int widthCmd(int argc, char* argv[]); int zoomCmd(int argc, char* argv[]); int zoomviewCmd(int argc, char* argv[]); CoordinateType getCoordinateType(const char* s); int convertCoordsStr(int dist_flag, char* inx_buf, char* iny_buf, char* outx_buf, char* outy_buf, double& x, double& y, char* in_type, char* out_type); int convertCoords(int dist_flag, double& x, double& y, char in_type, char out_type); int canvasToScreenCoords(double& x, double& y, int dist_flag); int canvasToImageCoords(double& x, double& y, int dist_flag); int canvasToWorldCoords(double& x, double& y, int dist_flag); int screenToCanvasCoords(double& x, double& y, int dist_flag); int screenToImageCoords(double& x, double& y, int dist_flag); int screenToWorldCoords(double& x, double& y, int dist_flag); int imageToCanvasCoords(double& x, double& y, int dist_flag); int imageToScreenCoords(double& x, double& y, int dist_flag); int imageToWorldCoords(double& x, double& y, int dist_flag); int worldToCanvasCoords(double& x, double& y, int dist_flag); int worldToImageCoords(double& x, double& y, int dist_flag); int worldToScreenCoords(double& x, double& y, int dist_flag); int imageToChipCoords(double& x, double& y, int dist_flag); int canvasToChipCoords(double& x, double& y, int dist_flag); int screenToChipCoords(double& x, double& y, int dist_flag); int worldToChipCoords(double& x, double& y, int dist_flag); int chipToImageCoords(double& x, double& y, int dist_flag); int chipToCanvasCoords(double& x, double& y, int dist_flag); int chipToScreenCoords(double& x, double& y, int dist_flag); int chipToWorldCoords(double& x, double& y, int dist_flag); static ImageColor* colors(); int displaymode() const; int fitWidth() const; int fitHeight() const; int subsample() const; char* file() const; char* newImageCmd() const; char* name() const; int usexshm() const; int usexsync() const; int shm_header() const; int shm_data() const; int min_colors() const; int max_colors() const; int verbose() const; int dispWidth(); int dispHeight(); int imageType(); int isWcs(); char* cameraPreCmd(); char* cameraPostCmd(); ImageData* image(); }; DESCRIPTION The RtdImage C++ class implements the rtdimage Tk image type. It is a subclass of class TkImage, which implements the more general, Tk image related interface, while RtdImage implements the more specific real-time display features (see TkImage). Class RtdImage is not normally accessed from other classes (other than derived classes) directly, only via the Tcl command interface (see RtdImage(n)) and the remote control interface (see rtdRemote), so this description is aimed at those who want to understand the class inorder to modify it or subclass from it. The main interface is to the Tcl interpreter and the Tk image code. The main entry point is through the initialization routine: extern "C" int Rtd_Init(Tcl_Interp* interp) This routine is declared extern "C", since the C routine tclAppInit() needs to call it (note: tclAppInit() is usually found in the file tkAppInit.c and is required in any Tcl/Tk application for adding extensions). To add the rtdimage extension to an application, the following lines are added to its tclAppInit() routine: if (Rtd_Init(interp) == TCL_ERROR) return TCL_ERROR; Note that, since the rtdimage extension is implemented in C++, main() also needs to be compiled and linked with a C++ compiler. Since main() is also included in the tkAppInit.c file in the standard Tk distribution, you either have to compile tkAppInit.c with a C++ compiler (rename it to tkAppInit.C first) or you have to extract the main() routine and put it in a separate file (say, main.C) and compile it with a C++ compiler (In this case, main() is a very simple two-liner that simply calls Tk_Main() and returns). Rtd_Init() installs the new image type "rtdimage" so that static RtdImage member functions are called (from a table of function pointers) whenever an rtdimage is created, displayed or deleted. The static member functions are passed a pointer to client data, which is actually a pointer to the RtdImage class instance (set in the image create procedure). This pointer is used to access the class member functions to implement the image display and subcommands. IMAGE CREATION When an image of type rtdimage is created (by the Tk "image create" command), the static method "CreateImage" is called. It creates an instance of the RtdImage class and sets the client data pointer to the class instance for later reference (in the display and delete static methods). IMAGE DISPLAY HANDLING Once an image has been created, a static method in the parent class (TkImage::DisplayImage) is called whenever the image needs to be displayed or redisplayed. It, in turn calls the non-static RtdImage method displayImage() with the coordinates of the area of the image that needs to be redrawn and the X "drawable" to draw to. The display method updates the XImage for the given area and displays it in the given X drawable (see class ImageDisplay). X SHARED MEMORY RtdImage attempts to use X shared memory, if the "-usexshm" option is on (default). This improves performance, but is only available when working on the workstation console. This is taken into consideration in the display routine, when deciding whether or not to use X pixmaps to cache image data in the X server. DISPLAY MODES Two different display modes are supported: In displaymode 0, the image is always copied completely to the X server as needed. This makes scrolling smoother, since fewer trips to the X server are needed, but is not practical for large images or greatly magnified images due to memory and bandwidth constraints. This mode is however used for example, by the pan window, since it must always display the entire image (at a small size). In displaymode 1 (default), only the part of the image that is visible in the image window is considered. This generally means more frequent trips to the X server, but with less data, so in the end the performance remains acceptable for any size image. The "-displaymode" option in the Tcl command controls the setting of the display mode. UPDATING THE DISPLAY Image redisplay can be forced at any time by calling the parent class method imageChanged(). This is done, for example, when an rtdimage subcommand modifies the image in some way, for example by rotating or scaling it. The imageChanged() method tells Tk the "logical" size of the image, which is independent of the window size or the size of the XImage and/or Pixmap being used. SCROLLING AND CANVAS WINDOW An image of type rtdimage can only be displayed in a canvas window. The RtdImage class keeps track of the canvas window's scrolling offsets and uses them to help determine which part of the image to display. The image handling code (TkImage::GetImage) gets called for each widget in which the image is displayed, and this is where the check is made and the canvas window handle is saved for later reference. VIEWS Normally, a Tk image can be displayed in multiple widgets and changes in size, etc. are propagated. For the rtdimage, a different scheme was needed for sharing images, since changes in size should not be propagated to all instances of the image. For example, a panning window should display the same image, but at a smaller size and a zoom window should display the same image at a larger size, etc. The concept of a "view" of an rtdimage was implemented. This is a simple array of pointers to RtdImage objects that is updated whenever the main image is updated. ADDING NEW OPTIONS The return value from the "image create rtdimage" command in Tk is the name of the image and also the name of a new Tcl command. The options to the create command are the same as the options to the image "configure" subcommand. These options are kept in a table and can be fairly easily extended by adding entries to the table and to a simple class. Derived classes can also use the RTD_OPTIONS macro to avoid duplicating code. #define RTD_OPTION(x) Tk_Offset(RtdImageOptions, x) #define RTD_OPTIONS \ {TK_CONFIG_BOOLEAN, "-usexshm", NULL, NULL, "1", RTD_OPTION(usexshm), 0}, \ {TK_CONFIG_BOOLEAN, "-usexsync", NULL, NULL, "1", RTD_OPTION(usexsync), 0}, \ {TK_CONFIG_BOOLEAN, "-verbose", NULL, NULL, "0", RTD_OPTION(verbose), 0}, \ {TK_CONFIG_BOOLEAN, "-shm_header", NULL, NULL, "0", RTD_OPTION(shm_header), 0}, \ {TK_CONFIG_BOOLEAN, "-shm_data", NULL, NULL, "0", RTD_OPTION(shm_data), 0}, \ {TK_CONFIG_INT, "-displaymode", NULL, NULL, "1", RTD_OPTION(displaymode), 0}, \ {TK_CONFIG_INT, "-min_colors", NULL, NULL, "1", RTD_OPTION(min_colors), 0}, \ {TK_CONFIG_INT, "-max_colors", NULL, NULL, "1", RTD_OPTION(max_colors), 0}, \ {TK_CONFIG_INT, "-fitwidth", NULL, NULL, "0", RTD_OPTION(fitWidth), 0}, \ {TK_CONFIG_INT, "-fitheight", NULL, NULL, "0", RTD_OPTION(fitHeight), 0}, \ {TK_CONFIG_BOOLEAN, "-subsample", NULL, NULL, "1", RTD_OPTION(subsample), 0}, \ {TK_CONFIG_STRING, "-file", NULL, NULL, "", RTD_OPTION(file), 0}, \ {TK_CONFIG_STRING, "-newimagecmd", NULL, NULL, "", RTD_OPTION(newImageCmd), 0}, \ {TK_CONFIG_STRING, "-name", NULL, NULL, "", RTD_OPTION(name), 0} For each rtdimage configuration option, you need an entry in the above table (from RtdImage.C) and a member in the RtdImageOptions class in RtdImage.h: class RtdImageOptions : public TkImageOptions { public: int displaymode; // set mode used to display image: // 0 ==> XImage is size of image, update whole image to pixmap // 1 ==> XImage is size of window (default mode) int fitWidth; // fit the image in a window with this width int fitHeight; // and this height by shrinking the image int subsample; // if true, don't count neighboring pixels when shrinking image int usexshm; // if true, use X shared memory if available. int usexsync; // if true, use X synchronisation if available. int verbose; // if true, print program info to stdout int shm_header; // if true, keep image FITS headers in shared memory int shm_data; // if true, keep image FITS data in shared memory // (see RtdRemote remote access interface) int min_colors; // min (max) number of colors to allocate, if this many are int max_colors; // not available, use private colormap. char* file; // name of image file, if any char* name; // name for image (for debugging) char* newImageCmd; // tcl command to evaluate whenever a new (different) // image is loaded (for updates, see camera command) int fixUpdateRate; // flag: user has specified a fixed update rate, as below. double userUpdateTime; // the minimum time between updates, as specified // by the user. // constructor RtdImageOptions() : displaymode(1), fitWidth(0), fitHeight(0), subsample(0), usexshm(1), usexsync(1), verbose(0), shm_header(0), shm_data(0), min_colors(30), max_colors(60), file(NULL), name(NULL), newImageCmd(NULL), fixUpdateRate(0), userUpdateTime(0.) {} }; The values in this class are treated as read-only for the most part by RtdImage. They are normally only set by Tk_ConfigureWidget when the image is created or configured. RtdImage accesses these options through inline functions defined at the end of RtdImage.h: // read-only access to configuration options static ImageColor* colors() {return colors_;} int displaymode() const {return options_->displaymode;} int fitWidth() const {return options_->fitWidth;} int fitHeight() const {return options_->fitHeight;} int subsample() const {return options_->subsample;} char* file() const {return options_->file;} char* newImageCmd() const {return options_->newImageCmd;} char* name() const {return ((options_->name && *options_->name) ? options_->name : instname_);} int usexshm() const {return options_->usexshm;} int usexsync() const {return options_->usexsync;} int shm_header() const {return options_->shm_header;} int shm_data() const {return options_->shm_data;} int min_colors() const {return options_->min_colors;} int max_colors() const {return options_->max_colors;} int verbose() const {return options_->verbose;} Where options_ is the name of the RtdImageOptions class object. ADDING NEW IMAGE SUBCOMMANDS The rtdimage subcommands are also defined in a table. In the TclCommand class hierarchy, there is a scheme that allows subcommands to be inherited and extended at any level of the inheritance hierarchy. (Options can also be inherited by deriving a subclass of RtdImageOptions and using the #define RTD_OPTIONS in the option array.) The following table is used to declare rtdimage subcommands in RtdImage.C: /* * declare a table of image subcommands and the methods that handle them. * * NOTE: keep this table sorted, so we can use a binary search on it ! * (select lines in emacs and use M-x sort-lines) */ static class RtdImageSubCmds { public: char* name; // method name int (RtdImage::*fptr)(int argc, char* argv[]); // ptr to method int min_args; // minimum number of args int max_args; // maximum number of args } subcmds_[] = { {"alloccolors", &RtdImage::alloccolorsCmd, 0, 1}, {"autocut", &RtdImage::autocutCmd, 0, 2}, {"bitpix", &RtdImage::bitpixCmd, 0, 0}, {"camera", &RtdImage::cameraCmd, 1, 4}, {"clear", &RtdImage::clearCmd, 0, 14}, {"cmap", &RtdImage::cmapCmd, 1, 2}, {"colorramp", &RtdImage::colorrampCmd, 0, 0}, {"colorscale", &RtdImage::colorscaleCmd, 0, 1}, {"convert", &RtdImage::convertCmd, 7, 7}, {"cut", &RtdImage::cutCmd, 0, 2}, {"dispheight", &RtdImage::dispheightCmd, 0, 0}, {"dispwidth", &RtdImage::dispwidthCmd, 0, 0}, {"dump", &RtdImage::dumpCmd, 1, 5}, {"fits", &RtdImage::fitsCmd, 1, 2}, {"flip", &RtdImage::flipCmd, 1, 2}, {"frameid", &RtdImage::frameidCmd, 0, 0}, {"get", &RtdImage::getCmd, 3, 5}, {"graphdist", &RtdImage::graphdistCmd, 5, 5}, {"height", &RtdImage::heightCmd, 0, 0}, {"isclear", &RtdImage::isclearCmd, 0, 0}, {"itt", &RtdImage::ittCmd, 1, 2}, {"max", &RtdImage::maxCmd, 0, 0}, {"mband", &RtdImage::mbandCmd, 6, 6}, {"min", &RtdImage::minCmd, 0, 0}, {"mmap", &RtdImage::mmapCmd, 0, 7}, {"motionevent", &RtdImage::motioneventCmd, 0, 1}, {"object", &RtdImage::objectCmd, 0, 0}, {"pan", &RtdImage::panCmd, 1, 3}, {"perftest", &RtdImage::perfTestCmd, 1, 2}, {"pixtab", &RtdImage::pixtabCmd, 1, 3}, {"preview", &RtdImage::previewCmd, 1, 1}, {"radecbox", &RtdImage::radecboxCmd, 3, 3}, {"remote", &RtdImage::remoteCmd, 0, 1}, {"remotetcl", &RtdImage::remoteTclCmd, 1, 1}, {"rotate", &RtdImage::rotateCmd, 0, 1}, {"scale", &RtdImage::scaleCmd, 0, 2}, {"shm", &RtdImage::shmCmd, 0, 7}, {"spectrum", &RtdImage::spectrumCmd, 9, 9}, {"statistics", &RtdImage::statisticsCmd, 0, 0}, {"type", &RtdImage::typeCmd, 0, 0}, {"update", &RtdImage::updateCmd, 0, 1}, {"userfreq", &RtdImage::maxFreqCmd, 1, 1}, {"view", &RtdImage::viewCmd, 2, 11}, {"warp", &RtdImage::warpCmd, 2, 2}, {"wcscenter", &RtdImage::wcscenterCmd, 0, 2}, {"wcsdist", &RtdImage::wcsdistCmd, 4, 4}, {"wcsequinox", &RtdImage::wcsequinoxCmd, 0, 0}, {"wcsheight", &RtdImage::wcsheightCmd, 0, 0}, {"wcsradius", &RtdImage::wcsradiusCmd, 0, 0}, {"wcsset", &RtdImage::wcssetCmd, 0, 11}, {"wcsshift", &RtdImage::wcsshiftCmd, 3, 3}, {"wcswidth", &RtdImage::wcswidthCmd, 0, 0}, {"width", &RtdImage::widthCmd, 0, 0}, {"zoom", &RtdImage::zoomCmd, 1, 3}, {"zoomview", &RtdImage::zoomviewCmd, 1, 5} }; The above table maps subcommand name to class method that implements the command. The additional fields indicate the minimum and maximum number of arguments the subcommand expects (for the subcommands, argc is the number of arguments and argv[0] the first argument after the subcommand name). The parent class (and any future derived classes) also declare a similar table and also the virtual method "call", that calls a method in a class, given the method name: /* * Call the given method in this class with the given arguments * If the method is not defined here, pass on the search to the * parent class. Since this is a virtual function, the search starts * in the most specific class. */ int RtdImage::call(const char* name, int len, int argc, char* argv[]) { ... } DERIVING A SUBCLASS OF RTDIMAGE If you want to derive a class from RtdImage, in order to modify or extend its behavior in some way, this is the way you would do it: In tkAppInit.C, replace the call to Rtd_Init with your own copy of that function: say MyRtd_Init(), so that you can install your own derived class. The new function and declarations would look something like this: class MyRtdImage : public RtdImage { ... } // image structure needed for Tk images static Tk_ImageType myRtdImageType = { "rtdimage", /* name */ MyRtdImage::CreateImage, /* createProc */ TkImage::GetImage, /* getProc */ TkImage::DisplayImage, /* displayProc */ TkImage::FreeImage, /* freeProc */ TkImage::DeleteImage, /* deleteProc */ (Tk_ImageType *) NULL /* nextPtr */ }; // called from tkAppInit extern "C" int Rtd_Init(Tcl_Interp* /* interp */) { Tk_CreateImageType(&myRtdImageType); return TCL_OK; } /* * This static method is called by the Tk image code to create * a new (MyRtdImage) image. */ int RtdImage::CreateImage( Tcl_Interp *interp, // Interpreter for application containing image. char *name, // Name to use for image. int argc, // Number of arguments. char **argv, // Argument strings for options // (not including image name or type) Tk_ImageType *typePtr, // Pointer to our type record (not used). Tk_ImageMaster master, // Token for image, to be used by us in // later callbacks. ClientData *clientDataPtr)// Store manager's token (this ptr) // for image here, // it will be returned in later callbacks. { MyRtdImage* im = new MyRtdImage(interp, name, argc, argv, master); *clientDataPtr = (ClientData) im; return im->status(); } After this, you can define methods for new image commands (to be called from Tcl level), redefine some existing behavior or add interfaces to C/C++ code or other processes. To add new Tcl image subcommands, declare a table like the one described above (each class in the hierarchy that defines subcommands declares one of these). For example: /* * declare a table of image subcommands and the methods that handle them. */ static class MyRtdImageSubCmds { public: char* name; // method name int (MyRtdImage::*fptr)(int argc, char* argv[]); // ptr to method int min_args; // minimum number of args int max_args; // maximum number of args } subcmds_[] = { {"foo", &MyRtdImage::fooCmd, 1, 3}, {"bar", &MyRtdImage::barCmd, 2, 4}, .... }; Now we need to declare the virtual member function "call" to call the method to handle the Tcl subcommands (this is the same in every class, but still needs to be redefined - it probably could also be defined as a macro): /* * Call the given method in this class with the given arguments * If the method is not defined here, pass on the search to the * parent class. Since this is a virtual function, the search starts * in the most specific class. */ int MyRtdImage::call(const char* name, int len, int argc, char* argv[]) { ... } The rtdimage options can also be extended, if needed, for example: class MyRtdImageOptions : public RtdImageOptions { public: char *grid_tag; // canvas tag for all grid items char *component; // NDF component to display MyRtdImageOptions() : grid_tag(NULL), component(NULL) {} }; #define MYRTD_OPTION(x) Tk_Offset(MyRtdImageOptions, x) #define MYRTD_OPTIONS \ RTD_OPTIONS, \ {TK_CONFIG_STRING, "-grid_tag", NULL, NULL, "ast_grid_item", MYRTD_OPTION(grid_tag), 0}, \ {TK_CONFIG_STRING, "-component", NULL, NULL, "data", MYRTD_OPTION(component), 0} Each class in the hierarchy should follow these conventions and define the options as above, so that derived classes can access them and add to them. SEE ALSO TkImage, RtdImage(n), image(n), canvas(n) -------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/RtdRemote.man3000066400000000000000000000044521215713201500211730ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: RtdRemote.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 10 Apr 96 Created NAME RtdRemote - C++ class supporting remote access to an rtdimage SYNOPSIS #include "RtdRemote.h" class RtdRemote { ... public: RtdRemote(Tcl_Interp*, int port, int verbose); virtual ~RtdRemote(); static void fileEventProc(ClientData, int mask); static void clientEventProc(ClientData, int mask); int status() {return status_;}}; DESCRIPTION This class is used internally (through subclassing) by the RtdImage C++ class to support remote access via a socket interface. See rtdRemote for a description of that interface. When a remote process wants access a running rtdimage application, rtdimage commands are sent via the socket interface. A subclass of this class defines the "call" virtual method to determine the correct method to call for each message. In this case, RtdImage defines a local class that is a subclass of RtdRemote and passes the "call" method on to its own "call" method that it uses for image subcommands. This class keeps a table of client connections (there could be multiple connections at once, although this is probably not the norm). For each client, there is a socket connection used to send commands and receive results and an additional socket connection used for callbacks. A socket message contains the length of the command (as a binary int in network byte order), a one byte flag indicating whether the answer should be immediate or via the callback socket and finally the contents of the command. EXTENDING THE COMMAND SET There are a number of ways to extend the available commands for the remote interface. One is through subclassing of class RtdImage at the C++ level (and extending the "call" method). Another way is by adding a command to the rtdimage Tcl interface to allow for a Tcl command to be evaluated for any "unknown" remote commands. SEE ALSO RtdImage, rtdRemote ----------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/rtd.man1000066400000000000000000000110671215713201500200550ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: rtd.man1,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created # Allan Brighton 10 Nov 97 Updated # NAME rtd - real-time image display application SYNOPSIS rtd ?options? ?filename? DESCRIPTION The rtd application is used to diplay FITS images in real-time. The application is based on "rtdimage", a Tk image extension for displaying FITS images. OPTIONS -file name "name" specifies a FITS format file to load and display. -subsample bool If bool is true, subsampling is used when shrinking the image, i.e.: if the image is shrunk by 1/3, only every third pixel is displayed. Otherwise, the maximum value is taken from the group of pixels. -sampmethod n (experimental) If option 'subsample' is false, the following methods can be used for displaying a shrunk image (i.e. an image with a scale factor < 1): SAMP_METHOD_MAX 0 /* max value of all pixels in a NxN box (default) */ SAMP_METHOD_MIN 1 /* min value of all pixels in a NxN box */ SAMP_METHOD_MEAN 2 /* mean value of all pixels in a NxN box */ SAMP_METHOD_MEDIAN 3 /* median value of all pixels in a NxN box */ SAMP_METHOD_MAX_CROSS 4 /* max value of pixels on a diagonal cross in a NxN box */ SAMP_METHOD_MIN_CROSS 5 /* min value of pixels on a diagonal cross in a NxN box */ SAMP_METHOD_MEAN_CROSS 6 /* mean value of pixels on a diagonal cross in a NxN box */ SAMP_METHOD_MEDIAN_CROSS 7 /* median value of pixels on a diagonal cross in a NxN box */ SAMP_METHOD_MEDIAN_CHESS 8 /* median value of pixels in a chess-board like box */ SAMP_METHOD_MEDIAN_9 9 /* median value of a 3x3 box */ -usexshm bool If bool is true (default), attempt to use X shared memory for the image display, if available. This improves performance considerably, but is only available when working on the system console. -usexsync bool If true, try to use X synchronisation. -verbose bool If bool is true, diagnostic messages are printed out to show what is going on internally (for debugging use). -default_cmap This option sets the default colormap file to use when starting up. Only the root of the filename should be specified for this option, for example: "ramp" for a grey level colormap. For a list of available colormap files, see the colormaps directory in the rtd release. -min_colors n -max_colors n Specify the min and max number of colors to allocate before using a private colormap. -default_itt This option is similar to -default_cmap, except it sets the default ITT (intensity transfer table) file to use at startup. ITT files are also stored in the colormaps directory. -xscale xs -yscale ys Set the default scaling factors (default: 1). -camera name Set the camera name for real-time image events: default: taken from the RTD_CAMERA environment variable, if set, otherwise set to RTDSIMULATOR, for simulation test mode. -zoom_factor number Set the scale factor for the zoom window (default 5 x the original image). -colorramp_height h Set the height of the colorramp subwindow (default: 20). -with_zoom_window bool If bool is true (default), add a zoom window. -with_pan_window bool If bool is true (default), add a panning window. -dozoom bool If true, turn on zoom window. -disp_image_icon bool If true, display a copy (view) of the image as an icon. -drag_scroll bool If true, set bindings to scroll with the middle mouse button. -scrollbars bool If true, display scrollbars to scroll the image. -port port Default port for remote connections (0 means system chooses a port). -debug bool Debugging flag: enables real-time simulation with testProg (below). -testprog path For testing: name of test program used to generate real-time updates (tRtd). -interval n For testing: interval between updates in ms. -with_perftest bool If true, display performance tester utility in menu bar. -with_warp bool Option to warp the mouse pointer. FILES $RTD_LIBRARY/../demos/rtd.tcl SEE ALSO rtdimage(n), RtdImageCtrl(n), rtdimage_wish(1), rtdServer(1), RtdServerTool(n), RtdImageZoom(n), RtdImageZoomView(n) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/rtd_remote.man3000066400000000000000000000101361215713201500214260ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: rtd_remote.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 10 Apr 96 Created # NAME rtdRemote - C interface for remote access to rtdimage based widgets SYNOPSIS #include "rtdRemote.h" typedef void (*RtdRemoteErrorHandler)(char* message); int rtdRemoteConnect(int pid, char* host, int port); void rtdRemoteDisconnect(); int rtdRemoteSend(char* cmd, char** result); int rtdRemoteGetResult(int socket, char** result); RtdRemoteErrorHandler rtdRemoteSetErrorHandler(RtdRemoteErrorHandler); char* rtdRemoteGetError(); DESCRIPTION This man page describes a simple remote interface to rtdimage based applications. With this interface, a client application can connect to a running application displaying an rtdimage, send commands and get results. REMOTE COMMANDS The commands are sent as ASCII strings via socket and have the same syntax as the rtdimage Tcl commands, except that no instance name is required. The command strings are not "evaluated" by Tcl, but are interpreted by the rtdimage code. Any commands that are not handled directly by the rtdimage C++ code may be passed on to a registered Tcl handler proc or [incr Tk] method. In this way, the list of available remote commands can be extended in the Tcl/Tk application. INTERFACE rtdRemoteConnect(pid, hostname, port) Connect to a remote rtdimage application. If pid, hostname and port are zero (null), they are read from the file $HOME/.rtd-remote, if it exists. This file is created by by an rtdimage widget when it starts to listen for a remote connection (see rtdimage, "remote" subcommand). Otherwise, if you know the pid, hostname and port, you can specify them here. This routine initializes an internal static structure with information about the connection. rtdRemoteDisconnect() Disconnect from remote rtdimage. rtdRemoteSend(cmd, result) The routine sends the given command to the remote rtdimage for evaluation and returns the status of the command. The result argument is set to point to the command results. The result pointer points to an internal buffer that is only valid until the next call to this routine. The command syntax is the same as for the "rtdimage" widget (image type), except that the instance name is missing. Example: char* result; int status = rtdRemoteCmd("wcscenter", &result); if (status == 0) { ... } If the command could not be sent, result is set to a NULL pointer and an error status (1) is returned. The error message can be retrieved with rtdRemoteGetError(). rtdRemoteSetErrorHandler(errorHandler) Set an error handler to be called when errors occur, format: void errorhandler(char* msg). rtdRemoteGetError(); Return the text of the last error message. EXAMPLE /* * The following example demonstrates the use of the remote rtd interface: */ /* * this routine is used for convenience in testing below * Send the command to the rtdimage, then print and return the result. */ static char* send_rtd(char* cmd) { char* result = NULL; int status = rtdRemoteSend(cmd, &result); printf("%s ==> %s: %s\n", cmd, (status ? "FAILED" : "OK"), result); return result; } main() { int data_id, header_id; /* * connect to running rtd. * uses default args taken from ~/.rtd-remote file */ if (rtdRemoteConnect(0, NULL, 0) != 0) exit(1); /* send some commands to RTD to be evaluated */ send_rtd("wcscenter"); send_rtd("bitpix"); send_rtd("scale"); send_rtd("width"); send_rtd("height"); send_rtd("config -file ngc1316r.fits"); send_rtd("width"); send_rtd("height"); data_id = atoi(send_rtd("shm get data")); header_id = atoi(send_rtd("shm get header")); exit(0); } SEE ALSO rtdimage, RtdRemote ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/rtdimage.mann000066400000000000000000001001531215713201500211500ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: rtdimage.mann,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created # Allan Brighton 10 Apr 96 updated for recent changes # Allan Brighton 24 Oct 96 updated for recent changes # Allan Brighton 22 Jan 98 updated for recent changes NAME rtdimage - Real-Time Display Image, a Tk Image Type SYNOPSIS image create rtdimage ?option value ...? DESCRIPTION Tk4.0 introduced a new "image" command and a C interface for adding new image types. A Tk image is much like a Tk widget in that it is both an object and a Tcl command. "rtdimage" is an extended Tk image type designed for real-time image display. Images can be loaded from shared memory or FITS format files, over sockets or HTTP. For real-time usage, a background daemon process rtdServer(1) communicates with the rtdimage software over a socket interface to display and update images rapidly from shared memory. A more general purpose remote control interface is also available (see rtdRemote(3)). CREATING RTDIMAGES An "rtdimage" is created with the "image create" Tk command. After this, you can use the image in a Tk canvas by specifying it with the "-image" option. For example: set image [image create rtdimage ...] $canvas create image 0 0 -image $image ... Most Tk image types may be used in any Tk widget, however, for our purposes, it was necessary to restrict the use to canvas widgets only. This was necessary in order to handle scrolling efficiently. OPTIONS The following options may be specified when creating or configuring an rtdimage: -displaymode mode The rtdimage supports two different display modes: 0 and 1. In display mode 0, space is allocated in the X server for the entire image. This makes scrolling faster, but uses enormous amounts of memory when the image is very large or is scaled to a large size. Still, this mode is useful in cases where the entire image is always displayed, such as in a panning window. In displaymode 1 (default), space is only allocated for the visible part of the image. This makes scrolling somewhat slower, but uses much less memory. -file name "name" specifies a FITS format file to load and display. -fitwidth winwidth -fitheight winheight These two options specify the size of the window into which the image must fit. The image will be scaled (shrunk) equally in the X and Y directions to fit as closely as possible inside the window. -newimagecmd command The given tcl command is evaluated every time a new image is loaded. This command is not called for real-time image updates, unless the image dimensions or data type changed. See the "camera" subcommand for getting notification of real-time image updates. -subsample bool If bool is true, subsampling is used when shrinking the image, i.e.: if the image is shrunk by 1/3, only every third pixel is displayed. Otherwise, the maximum value is taken from the group of pixels. -usexshm bool If bool is true (default), attempt to use X shared memory for the image display, if available. This improves performance considerably, but is only available when working on the system console. -verbose bool If bool is true, diagnostic messages are printed out to show what is going on internally (for debugging use). shm_header bool shm_data bool If bool is true, the image FITS header (or data) is kept in shared memory so that it can be accessed from a remote process (see rtdRemote(3)). COORDINATES The rtdimage subcommands support the following types of coordinates: canvas - canvas coordinates (canvas scroll area) screen - canvas window coordinates (visible area) image - basic image pixel coords (at mag 1, no transformations) chip - detector chip/CCD coordinates wcs - world coordinates in H:M:S D:M:S deg - world coordinates in degrees For image coordinates, the origin of the image is at (1,1) (or .5,.5 if the image is zoomed). Detector chip coordinates may be the same as image coordinates, but can also have an additional offset and/or binning factor. The FITS keywords "HIERARCH ESO DET WIN1 STRX" and "...STRY" are used for the offset, if present. The rtdimage "convert" subcommand can be used to convert between any two coordinate systems. In addition, most rtdimage subcommands accept coordinates using the following syntax: $x $y coord_type For example: set val [$image get $x $y canvas] set val [$image get $ra $dec "wcs 1950"] set val [$image get 42.1 38.3 "deg 2000"] For world coordinates, the equinox may be optionally specified as part of the coordinate type. The default is 2000. IMAGE FORMATS An rtdimage can load and display FITS format images or images written to shared memory via rtdServer(1). The following FITS image data types are supported: float, long, short, ushort, byte or XImage. Except for XImage, The order of lines is the same as for FITS files, with the origin at lower left. XImage is a special image type, which is taken to be already in a format that can be displayed with no color scaling. Support for other image types is planned, however the internal image type will remain FITS. New image types can be added by deriving a new subclass from the ImageIO(3) class. COLOR ALLOCATION All rtdimages in an application share the same default colormap. On startup, the rtdimage attempts to allocate as many color cells as possible, leaving about 10 free for other applications. The number of color cells allocated can be changed with the "alloccolors" subcommand. If another application (netscape, for example) has already grabbed all of the colors, a private colormap will be used. An attempt is made to keep most of the window manager colors intact, to avoid color flashing, at least in the GUI elements. MOTION EVENTS Since handling pointer motion events in Tcl code is fairly slow, the rtdimage code does some of the common work internally by setting values in a global array called "RtdImage". These values can be best accessed by specifying the "-textvariable" option to a Tk label or entry widget. The global "RtdImage" array contains the following values, which are updated on motion events: RtdImage(X) X image coordinate RtdImage(Y) Y image coordinate RtdImage(VALUE) pixel value at X,Y RtdImage(RA) world coordinate RA value RtdImage(DEC) world coordinate DEC value RtdImage(EQUINOX) world coordinate equinox The world coordinate values are set to empty strings if the image header does not support world coordinates. The same motion handler that sets the above variables also contains support for zoom windows (zoom and zoomview commands) and pixel tables (pixtab command). IMAGE COMMANDS The return value from the "image create rtdimage" command is the name of the image and also the name of a new Tcl command that can be used to operate on the image. The Tcl command has the following subcommands: alloccolors ?numColors? With no arguments, this command returns a Tcl list containing the number of allocated and the number of free colors. With one argument, the command attempts to reallocate numColors colors. The number of colors actually allocated depends on what other applications are running (see COLOR ALLOCATION). autocut ?-percent number? This command automatically sets the cut levels (the lowest and highest image pixel values considered in colormap scaling). Two different algorithms are supported. The default (and fastest version) is median filtering. If -percent is specified, the argument is a number between 0 and 100, such as 90 for 90%, where that percent of the image pixels should be within the cut values. i.e.: if you look at the graph (see graphdist command) of the pixel value distribution, you would take the top 90% of the graph and set the cut levels to left and right ends of the graph. Note: if this command is called, it is assumed that cut levels can be set automatically when a new image is loaded. See also the "cut" command. camera start cameraName ?tclCommand? camera stop camera pause camera continue The "camera start" command sends a message to the rtdServer daemon process telling it to start sending images from the given camera. Actually the server sends only image events, short messages over a socket interface, while the images are written to and read from shared memory. Camera is the name of a camera that must be known to the rtdServer (see rtdServer(1) for more information). The optional ?tclCommand? argument to "start" should be a string containing a Tcl command to be evaluated whenever a new image event is received and displayed. The "camera stop" command tells the rtdServer to stop sending image events. The "pause" and "continue" subcommands can be used to temporarily stop the image events and restart them, without having to know the name of the camera. clear clear ximage clear ?-reuse $reuse -ra $ra -dec $dec -equinox $equinox -radius $radius -width $width -height $height? This command is used to blank out the display by generating and loading a blank image. With no arguments a small blank image is generated with a default header. If "-ximage" is specified, the image is only cleared temporarily, until the next image update. In the last case, the optional arguments are used to generate a dummy image that supports world coordinates, so that you can plot objects on a blank background. Any missing values are set to a default value. Optional arguments: reuse - flag: if true, reuse previous image, if it is the same ra, dec - center point for WCS coords (in decimal degrees) radius - used to initialize WCS coords (CDELT1 and 2) equinox - equinox for WCS coords width - width of generated image in pixels height - height of generated image in pixels cmap file ?? cmap rotate cmap shift cmap pixels cmap reset cmap list cmap private cmap isprivate This command performs operations and queries on the colormap. If a colormap file is specified, it should contain 256 lines of red, green and blue values between 0.0 and 1.0 (MIDAS colormaps are saved in this format). The values will be distributed among the available colors and installed as a new colormap. For rotate and shift, the amount can be any integer. The colormap will be rotated (or shifted) by that amount. "pixels" returns a Tcl list of the colormap pixel values (for use by external applications using the RTI library, class ImageData). To get the number of colors in the colormap, you can use the "alloccolors" subcommand with no arguments or "llength" on the result of the pixels subcommand. "reset" resets the colormap to its original state. The RTD release includes a large number of MIDAS colormap files in the colormap directory. For "cmap file", if the filename is not specified, the current colormap file name is returned. "cmap list" returns a list of all of the colormap files currently loaded. "cmap private" says to start using a private colormap. "cmap isprivate" returns true if the colormap is private. colorramp This command generates an rtdimage displaying the colors in the colormap as a ramp or colorbar. This image will have the same size as the window containing it. This command should be called again from Tcl if the window is resized. colorscale ?scale_type? This command sets or queries the algorithm to be used for assigning the limited number of available colors to image pixels. If scale_type is specified, it should be one of: linear, log, sqrt or histeq, indicating the color scaling algorithm: linear scaling, logarithmic, square root or histogram equalization, resp. With no arguments, the current color scale type is returned. convert coords inx iny in_coord_type outx outy out_coord_type convert dist inx iny in_coord_type outx outy out_coord_type This command is used to convert between different coordinate representations. inx and iny and the input coords (or distance) in the given input coordinate system. "convert coords" treats x,y as a point, while "convert dist" treats it as a distance. outx and outy, if not empty, are the names of variables that will hold the resulting coordinates. If outx and outy are empty strings, the values are returned as a tcl list "x y". The available coordinate systems are: canvas - canvas coordinates (canvas scroll area) screen - canvas window coords (visible area) image - basic image pixel coords (at mag 1, no transformations) wcs - world coordinates in H:M:S deg - world coordinates in degrees The world coordinate types: "wcs" and "deg" may also include the epoch: Example: $image convert coords $ra $dec "wcs 1950" x y canvas Note: the coordinate types may be abbrieviated, since only the first char is actually checked. cut cut low high cut low high fromUser This command sets or queries the cut levels. If low and high are specified, then the cut levels are set so that pixels below the low value will all have the lowest color while those above high will all have the highest color value. The optional fromUser argument indicates whether or not this is a result of a user action and defaults to 1 (true). Once a user has set the cut levels, automatic cut level setting is disabled. If the fromUser argument is 1, it is assumed that they should not be changed automatically when a new image is loaded. Calling the autocut subcommand resets this again (see the autocut subcommand). If no arguments are given, the current cut values are returned in a Tcl list {min max}. dispwidth dispheight These commands return the logical width and height of the image after transformations (scaling and rotating). This is the size of the displayed image, assuming the window is large enough. This command also takes the image's "requested width" into account (set by by "view update" subcommand). dump This command dumps the current image to the given file in FITS format. If a FITS header is present, it is used, otherwise FITS keywords are inserted indicating the image type, width and height along with the date and a number of numbered "blank cards" or FITS keyword fields that can be modified by other applications as needed. The fields have names starting with BLANK followed by 2 digits (from BLANK00 to BLANK28). flip ?bool? With two arguments, flip (or stop flipping) the image in the given direction, where direction is one of x, y, xy or "none" for flipping in the x, y, or x and y directions or neither. The boolean value turns flipping on (1) or off (0) in the given direction(s). With one argument, the command returns the current value for the given argument. frameid This command returns the frame Id of this image. The frame Id is a unique number used to identify the image to the rtdServer for use with rapid frames. get x y coord_type ?nrows ncols? Returns a Tcl list of image values at the given X,Y coordinates. X and Y are interpreted in the given coordinate system (see COORDINATES above). The return value is a tcl list where each item consists of a list of {X Y Value}, where X and Y are the adjusted coordinates in the raw image and Value is the raw data value at that point or "-" if out of range. If nrows and ncols are greater than 1, the command returns a Tcl list of nrows x ncols values, each a list of rows, centered at the given point. graphdist bltGraph bltElem numValues This command displays the distribution of pixel values in the image in the given BLT graph widget. The data for the given BLT graph element will be set directly to the graph without going through tcl (see blt_graph(n)). The number of points to plot is given by the numValues argument. itt file itt scale This command operates on MIDAS style intensity transfer tables or ITTs. If an ITT file is specified, it should contain 256 intensity values in the range 0.0 to 1.0, one per line. The colormap will be modified by applying the intensities to it. The colormap can also be stretched or squeezed by applying an integer scale factor to the ITT. The RTD release contains a number of ITTs in the colormaps directory. max Returns the highest pixel value in the image. mband x0 y0 x1 y1 cord_type show_angle Draw a measure band on the canvas to show the distance in world coordinates (diagonal, vertical and horizontal). This method was originaly implemented in Tcl/[incr Tk], but was redone here for better performance. x0 and y0 are the starting coordinates of the drag, x1 and y1 are the coordinates from the motion events and show_angle is a flag: if true, show the horizontal and vertical distance, otherwise only the diagonal. The coordinates are accepted in the given coordinate system "coord_type", see COORDINATES above. min Returns the lowest pixel value in the image. mmap set $data_filename $data_offset $data_owner ?$header_filename $header_offset $header_owner? mmap get data mmap get header mmap create $filename $size mmap delete $filename mmap update This subcommand provides access to the mmap shared memory in which the FITS image data and header are stored. Image files are always mapped with mmap by default (since it is faster than reading the file). Applications can take advantage of this to modify the image data and then notify the application to update the image. This command makes it posible to put the image data and header in separate files, so that they can be more easily updated by other applications. If you want to put both header and data in the same file in the normal way, just use " config -file". Otherwise you can use this command to quickly update the image data in a separate file. The "set" command allow you to set the files to use to for the image data and header. The data and header in the specified files should be in FITS format (i.e.:, a FITS file split in 2 parts). If the header is not specified, the previous header is reused, if there was one. The offset arguments indicate an offset in the file where the header or data start. If the file contains only the data or only the header, the offset argument should be set to 0. A flag indicating who "owns" the file may be specified (if true, then the file will be deleted when no longer needed). Example: mmap set datafile1 0 0 headerfile1 0 0 mmap set datafile2 0 0 ... The "get" command returns mmap information about the data or header. If the data or header is not currently mapped, an error is returned. The return value is a list of the form {filename offset owner}, the same as the arguments to the " mmap set" command. The "create" command creates a new mmapped file with the given name and the given size. The mmaped file/memory should be released with the "delete" subcommand when no longer needed. The "delete" command unmaps the given file and deletes it, if it was created with the "mmap create" subcommand. The "update" command causes the display to be updated to reflect any changes in the image memory. pan start pan stop This command supports a panning image, which is, in this case, a second rtdimage image or "view" of the main image, scaled to a small size with a rectangle indicating the visible portion of the image. If "start" is specified, the given tcl command will be evaluated whenever the image size changes, due to scaling or loading a new image, or whenever the image position has changed due to scrolling. The tcl command will be called with 5 arguments: x1 y1 x2 y2, which are the coordinates of the visible part of the image, scaled by the given "shrinkFactor", and a flag indicating whether the image is new (1) or an update of the existing image (0). This can be used to draw the panning rectangle on the panning image. To stop the command from being called, use the "pan stop" subcommand. pixtab start pixtab stop This command supports displaying a table of pixel values around a point. All this commmand does is set a flag causing Tcl array variables to be updated on motion events, which can cause the display to be updated via the "-textvariable" widget option on the table items. The array name is fixed as: RtdPixTab and the elements are indexed as $RtdPixTab(i,j), where the left and top sides of the table (array) are the X and Y image coordinates, resp. and the rest are image pixel values. preview If bool is true and real-time images are being displayed, the viewing mode is set to "preview mode", otherwise, it is set back to "real-time mode". In preview mode, the camera is stopped (if it was running) and a local copy of the shared memory image is made, so that it can be freed or modified without affecting the image. radecbox ra and dec are the world coords (h:m:s or decimal deg) and radius is expected in arcmin. The return value in Tcl is a list of 4 values {ra0 dec0 ra1 dec1} that form a ra,dec box with the given center point and radius. remote ?$port? This command implements a remote control of the RTD image. If a port number argument is specified The widget will start listening for commands on the given port. If port is 0, a port number will be chosen. If no port number is specified, the current port number is returned, or "" if there is none. This is a way to determine the port number at the Tcl level. remotetcl ?$command? Evaluate a Tcl command in the RTD Tcl interpreter. rotate ?bool? Rotate (or stop rotating) the image. Currently, rotation is only done by swapping the x and y axis. If bool is specified, rotation is turned on(1) or off(0). Otherwise, the current setting is returned. scale ?sx sy? With 2 arguments, the image is scaled (magnified) by the given X and Y amount. With no arguments, the current scaling factors are returned (as a tcl list of 2 integers). The scaling factors are positive or negative integers (default 1). Positive integers are used to zoom in on the image (2 means twice the original size). Negative integers are used to zoom out (-2 means 1/2 the original size). The software imposes an arbitrary limit on the minimum and maximum scaling factor allowed. shm set $data_size $data_id $data_owner ?$header_size $header_id $header_owner? shm get data shm get header shm create $size shm delete $Id shm update This subcommand provides access to the shared memory in which the FITS raw image data and header are stored. The raw image is stored in shared memory if the -shm_data option was specified when creating the image and the header is stored in shared memory if the -shm_header option was specified. The "set" command allow you to set the shared memory Ids to use to access the image data and header. The data and header in the area specified should be in FITS format. If the header is not specified, the previous header is reused. For both data and header, the size of the area (in bytes) and the shared memory Id must be specified. In addition a flag indicating who "owns" the shared memory is specified (if true, then the area will be deleted when no longer needed). The "get" command returns the shared memory Id of the data or header. If the data or header is not currently in shared memory, it is copied to a new shared memory area and the Id for this area is returned. The "create" command creates a new shared memory area with the given size and returns the Id. The memory should be deleted with the "delete" subcommand when no longer needed. The "delete" command deletes the shared memory with the given Id (which should have been returned from the "create" subcommand). The "update" command causes the display to be updated to reflect any changes in the image memory. spectrum x0 y0 x1 y1 coord_type This command is used to display a graph of a "cut" of the image along a given line. x0, y0, x1 and y1 are the end points of a line in the image (in the given coordinate system, see COORDINATES above). is the path name of a BLT graph widget to display the plot of the pixel intensities along the line. is the name of the element in the graph that should receive the data. The data is sent directly to the graph for display. The return value in Tcl is the number of points to plot. statistics statistics subcommand: calculate statistics on the section of the image being displayed. The return value in Tcl is a list of the following values: {x y ra dec equinox fwhmX fwhmY angle objectPeak meanBackground} where: x = adjusted X image coordinate y = adjusted Y image coordinate ra = RA position (calculated from mean X pos within array) dec = DEC position (calculated from mean Y position within array) equinox = equinox of RA and DEC fwhmX = FWHM in X fwhmY = FWHM in Y angle = angle of major axis, degrees, along X = 0 objectPeak = peak value of object above background meanBackground = mean background level type Returns the data type of the raw image as a string: one of: float, long, short, ushort, byte or XImage. The last type, XImage is a special pseudo type, the same as a byte image, except that the Y axis is reversed and it is assumed to not need color scaling. update This command makes sure that the image is up to date with the raw data (which may have changed via shared memory, mmap, etc). view add ?propagateScale? view remove view update x y width height viewx viewy coord_type view enter view leave The view command is used to specify a viewing image to view the same image, possibly at a different size. The new view will share data with the original and be updated when the original is updated. This can be used, for example, to build a panning window or a rapid frame. must be the name of a second rtdimage image. The two images will communicate internally to always display the same image, possibly scaled to different sizes. The subcommands are: add Adds a new view to this image. remove Removes the view. update Updates the view from this image with the given image x,y offset, width and height and the position of the image view origin in the given coordinate type. This command can be used to implement a zoom window or rapid frame, since it controls which portion of the image is displayed. enter If 2 images are in the same canvas, make the current one (receives motion events, ...). leave Undo the enter command. If the optional "add" argument "propagateScale" is true, changes in the scale factors in the master image will propagate to the view (this is the default behavior). warp Warp (move) the mouse pointer by the given x and y amounts (pixels). wcscenter ?-format ? This command returns the world coordinates of the center of the image. The optional format option determines the format of the result: -format 0 ==> H:M:S [+-]D:M:S (default) -format 1 ==> RA DEC (in degrees) The return value is a tcl list, formatted according to the format option, or an empty string if the coordinates are out of range or WCS is not supported. wcsdist x0 y0 x1 y1 This command returns the world coordinate distance between 2 points after transformations. The arguments are expected in canvas coords (canvasx, canvasy, doubles). The return value in Tcl is the WCS distance between the given points after transformations. wcsheight This command returns the height of the image in arcmin or the empty string if WCS is not supported. wcswidth This command returns the width of the image in arcmin or the empty string if WCS is not supported. wcsradius This command returns the radius (distance from center to corner) of the image in arcmin or the empty string if WCS is not supported. wcsset wcsset If arguments are specified, this subcommand sets up the WCS structure from the given information about the image: Arguments: ra = Center right ascension in H:M:S dec = Center declination in D:M:S secpix = Number of arcseconds per pixel xrefpix = Reference pixel X coordinate yrefpix = Reference pixel Y coordinate nxpix = Number of pixels along x-axis nypix = Number of pixels along y-axis rotate = Rotation angle (clockwise positive) in degrees equinox = Equinox of coordinates, 1950 and 2000 supported epoch = Epoch of coordinates, used for FK4/FK5 conversion no effect if 0 proj = Projection With no arguments, the command returns a list of the basic WCS parameter values: {ra dec secpix nxpix nypix rotate equinox epoch}. wcsshift This command resets the center of the WCS structure. Arguments: ra = New center right ascension in degrees dec = New center declination in degrees equinox = must be 2000 or 1950 width height These commands return the width and height of the raw image in pixels. zoom start zoom stop (Note: This command is no longer supported: please use zoomview (below) instead.) This command is used to implement a zoom window, a window displaying a magnified section of the image at the location of the mouse pointer. There are currently two versions of this command (see the zoomview subcommand below). In this version, a Tk frame is specified to hold the zoomed image, which is copied directly from the XImage whenever the mouse pointer moves over the image. This version is faster, but when the main image is shrunk, the zoom will not be very accurate. If "start" is specified, zooming begins in the given window, and can be stopped with the "zoom stop" subcommand. zoomview start zoomview stop This command can be used as an alternative to the zoom command above. It uses a "view" of the main rtdimage, so the zoom image is always accurate, even when main image is shrunk. The "view" argument to "zoomview start" should be the name of a second rtdimage, which is a "view" of the main image, added with the rtdimage "view" subcommand. The zoomFactor is the magnification relative to the main image. For example, if the zoomFactor is 5 and the main image is scaled to 1/2, the zoom window scale factor would be 4. Once started, the main image will automatically track mouse movements and update the zoom window's x and y offsets as needed to display the relevant magnified section of the image. ENVIRONMENT VARIABLES RTD_LIBRARY - If set, this should point to the directory containing the rtdimage Tcl library files. FILES $RTD_LIBRARY/ - Tcl/Itcl library files $RTD_LIBRARY/colormaps - MIDAS colormap/ITT files $RTD_LIBRARY/images - sample FITS images $RTD_LIBRARY/bitmaps - X bitmaps used at runtime $RTD_LIBRARY/demos - rtdimage demo application SEE ALSO RtdImage(n), rtdServer(1), rtdImageEvt(3), BLT(n), canvas(n) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/man/rtdimage_wish.man1000066400000000000000000000034351215713201500221120ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: rtdimage_wish.man1,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 Jul 95 Created # NAME rtdimage_wish - a Tk wish shell with the rtdimage extension SYNOPSIS rtdimage_wish ?fileName arg arg ...? DESCRIPTION rtdimage_wish is the Tk wish shell created by the RTD package to demonstrate the real-time display widget features. This version of wish(1) contains, in addition to the rtdimage extension, the BLT, [incr Tk] and TclX extensions. BLT is required for displaying graphs and tables, [incr Tk] is used for its class system and TclX is used for various utility commands and interprocess communication (rtdServer(1). ADDING THE RTDIMAGE EXTENSION The rtdimage extension can be included in a Tk application shell in the standard way, by adding a call to RtdImage_Init(interp) in the Tcl_AppInit() routine, which every Tk application must define: /* initialize the rtdimage type */ if (RtdImage_Init(interp) == TCL_ERROR) { return TCL_ERROR; } Note that since the rtdimage extension is implemented in C++, it is required that main() also be compile with C++. Normally, main() is included in the same C file with Tcl_AppInit(), so you have 2 choices: you can rename the file tkAppInit.c to tkAppInit.C and compile and link it with a C++ compiler, or you can put main() in a separate file and compile and link it with a C++ compiler. SEE ALSO rtdimage(n), wish(1), BLT(n), incrTcl(n), TclX(n) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/rtd/pkgIndex.tcl.in000066400000000000000000000002151215713201500206060ustar00rootroot00000000000000# Tcl package index file, version 1.0 package ifneeded Rtd @PACKAGE_VERSION@ [list load [file join [file dirname $dir] @PKG_LIB_FILE@] Rtd] skycat-3.1.2-starlink-1b/rtd/rtd.in000077500000000000000000000027561215713201500170640ustar00rootroot00000000000000#!/bin/sh # Start script for rtd # # "@(#) $Id: rtd.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 28 Jan 06 created # pbiereic 29/12/08 ignore error output from 'ps -x' # Determine rtd base dir, following any symbolic links, if needed. PRG="$0" cwd=`pwd` cd `dirname "$PRG"` while [ -h "$PRG" ]; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '.*/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`/"$link" fi done DIR=`dirname "$PRG"`/.. RTD_BASE=`(cd $DIR; pwd)` cd $cwd # If we're NOT ssh'd in if [ ! ${SSH_TTY} ]; then # make sure X is running (on Mac OS X) if [ `uname` = "Darwin" -a "`ps -x 2>/dev/null | awk '{print $5}' | grep X11`" = "" ]; then for i in /Applications/Utilities $HOME/Desktop ; do if [ -e $i/X11.app ] ; then open $i/X11.app & fi done fi # Make sure DISPLAY is set if [ x${DISPLAY} = x ]; then export DISPLAY=:0 fi fi # Make sure we can find the shared libs @LD_LIBRARY_PATH_VAR@="$RTD_BASE/lib:@BLT_LIB_DIR@:${@LD_LIBRARY_PATH_VAR@}" export @LD_LIBRARY_PATH_VAR@ # and the Tcl packages TCLLIBPATH="$RTD_BASE/lib" export TCLLIBPATH # Make sure we start the correct wish binary PATH=$RTD_BASE/bin:$PATH export PATH test -d $HOME/.rtd || mkdir $HOME/.rtd exec wish8.4 $RTD_BASE/lib/rtd@PACKAGE_VERSION@/main.tcl ${1+"$@"} | tee $HOME/.skycat/log 2>&1 skycat-3.1.2-starlink-1b/rtd/rtdConfig.sh.in000066400000000000000000000031501215713201500206050ustar00rootroot00000000000000# E.S.O. - VLT project # $Id: rtdConfig.sh.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # rtdConfig.sh -- # # This shell script (for sh) is generated automatically by Rtd's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. # This script is intended to be included by the configure scripts # for Rtd extensions so that they don't have to figure this all # out for themselves. This file does not duplicate information # already provided by tclConfig.sh, so you may need to use that # file in addition to this one. # # The information in this file is specific to a single platform. # Rtd's version number. rtd_VERSION='@PACKAGE_VERSION@' # The name of the Rtd library: rtd_LIB_FILE=@rtd_LIB_FILE@ # String to pass to linker to pick up the Rtd library from its # build directory. rtd_BUILD_LIB_SPEC='@rtd_BUILD_LIB_SPEC@' # Rtd build directory. rtd_BUILD_DIR='@rtd_BUILD_DIR@' # String to pass to linker to pick up the Rtd library from its # installed directory. rtd_LIB_SPEC='@rtd_LIB_SPEC@' # Location of the top-level source directories from which Rtd # was built. This is the directory that contains generic, unix, etc. # If Rtd was compiled in a different place than the directory # containing the source files, this points to the location of the sources, # not the location where Rtd was compiled. rtd_SRC_DIR='@rtd_SRC_DIR@' # List of object files used to build the library (for merging packages). rtd_PKG_OBJECTS='@rtd_PKG_OBJECTS@' # List of header filesinstalled for this library (for merging packages). rtd_PKG_HEADERS='@rtd_PKG_HEADERS@' skycat-3.1.2-starlink-1b/rtd/rtd_version.tcl.in000066400000000000000000000001551215713201500213760ustar00rootroot00000000000000# This file is generated by configure: DO NOT EDIT BY HAND proc rtd_version {} { return @PACKAGE_VERSION@ } skycat-3.1.2-starlink-1b/rtd/rtdctrl000077500000000000000000000012741215713201500173360ustar00rootroot00000000000000#!/bin/sh # -*-tcl-*- # # E.S.O. - VLT project # # "@(#) $Id: rtdctrl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # Start the rtd image server as a standalone program # # Usage: rtdctrl # # who when what # -------- -------- ------------------ # abrighto 11/10/95 created # abrighto 29/12/05 adapted for new setup # Make sure the shared libraries can be found # The next line is executed by sh, the rest by tcl: \ LD_LIBRARY_PATH="/home/abrighto/work/eso/skycat/src/install/lib:${LD_LIBRARY_PATH}" TCLLIBPATH="/home/abrighto/work/eso/skycat/src/install/lib" exec /usr/bin/wish8.4 "$0" ${1+"$@"} # -*-tcl-*- package require Rtd setXdefaults util::TopLevelWidget::start RtdServerTool skycat-3.1.2-starlink-1b/rtd/rtdevt/000077500000000000000000000000001215713201500172365ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdCLNT.C000066400000000000000000000117721215713201500206240ustar00rootroot00000000000000/******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: rtdCLNT.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------- -------- ---------------------------------------------- * pbiereic 01/03/01 created */ /************************************************************************ * NAME * rtdCLNT - class to handle a client which has connected to rtdServer * * SYNOPSIS * * * DESCRIPTION * An instance of this class handles all functions for the connection * to a rtdServer client which can be either a camera (CCD) or RTD * application. * * PUBLIC METHODS * * rtdCLNT::~rtdCLNT() * Destructor: close socket and cleanup the semaphores used by client * * void rtdCLNT::Cleanup() * Cleanup the semaphores used by client * * void rtdCLNT::Attach(char* reqName, char *camName) * Attach: keep name of producer and requestor * * void rtdCLNT::Detach() * Detach: clear name of producer and requestor * * int rtdCLNT::Accept(int listenSocket) * Accept connection from port 'listenSocket' * * int rtdCLNT::Forward(rtdPACKET *rtdPacket, int numbyte) * Forward the image event to the RTD client * * int rtdCLNT::AttachedToCamera(char *camera) * Are we attached to camera 'camera'? * * Other methods which just store/return data can be found in * the include file. * * FILES * * ENVIRONMENT * * COMMANDS * * RETURN VALUES * * CAUTIONS * * EXAMPLES * * SEE ALSO * * BUGS * *------------------------------------------------------------------------ */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_SYS_FILIO_H #include #endif #include "rtdCLNT.h" static const char *rcsId="@(#) $Id: rtdCLNT.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; rtdCLNT::rtdCLNT(int verbose, int index) : rtdLOG(verbose), reqName_(reqNameBuf_), camName_(camNameBuf_), semId_(-1), type_(-1), shmNum_(0), index_(index), socket_(0) { BufClear(reqNameBuf_); BufClear(camNameBuf_); } rtdCLNT::~rtdCLNT() { if (socket_) close(socket_); Cleanup(); } void rtdCLNT::Cleanup() { // Clear semaphores used by client for (int i = 0; i <= shmNum(); i++) rtdSemReset(semId(), i); shmNum_ = 0; } void rtdCLNT::SetSemPar(int semId, int shmNum) { /* * if a client uses a different shared memory than before, * reset the previously set semaphores first. */ if (semId_ != semId && semId_ >= 0) Cleanup(); semId_ = semId; shmNum_ = max(shmNum, shmNum_); } void rtdCLNT::Attach(char* reqName, char *camName) { ReqName(reqName); CamName(camName); } void rtdCLNT::Detach() { BufClear(reqName_); BufClear(camName_); } int rtdCLNT::AttachedToCamera(char *camera) { if (ReqName() == '\0') return RTD_ERROR; // not attached to any requestor if (strcmp(camera, CamName()) == 0) return RTD_OK; // that's it ! return RTD_ERROR; // not my camera to which I am attached to } int rtdCLNT::Accept(int listenSocket) { struct sockaddr_in sockAddr; // used by accept() socklen_t addrLen = sizeof(sockAddr); int optval; // used by setsockopt() int socket; // socket file descriptor // Accept connection from client socket = accept(listenSocket, (struct sockaddr *)&sockAddr, &addrLen); if (socket <= 0) { log("Unable to accept socket connection\n"); return RTD_ERROR; } // Set socket options optval = 1; setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, (const char *)&optval, sizeof optval); log("Connection request accepted on port: %d\n", sockAddr.sin_port); // init this object Socket(socket); Port(sockAddr.sin_port); return RTD_OK; } int rtdCLNT::Forward(rtdPACKET *rtdPacket) { rtdIMAGE_INFO *info = &(rtdPacket->body.data.rtdImageInfo); log("frameId=%d, dataType=%d, bytePerPixel=%d, shmId=%d, semId=%d, shmNum=%d,\n\t\t" "frameX=%d, frameY=%d, xPixels=%d, yPixels=%d, highCut=%d, lowCut=%d,\n\t\t" "ra=%g,dec=%g, secpix=%g, xrefpix=%g, yrefpix=%g,\n\t\t" "rotate=%g, equinox=%d, epoch=%g, proj=%s, wcsFlags=%d\n", info->frameId, info->dataType, info->bytePerPixel, info->shmId, info->semId, info->shmNum, info->frameX, info->frameY, info->xPixels, info->yPixels, info->highCut, info->lowCut, info->ra, info->dec, info->secpix, info->xrefpix, info->yrefpix, info->rotate, info->equinox, info->epoch, info->proj, info->wcsFlags); // Pass the UTC in the packet gettimeofday(&info->timeStamp, NULL); if (write(Socket(), (char *)rtdPacket, sizeof(rtdPACKET)) == sizeof(rtdPACKET)) return RTD_OK; log("socket write error\n"); return RTD_ERROR; } char *rtdCLNT::TypeName() { switch(Type()) { case RTDWIDGET: return((char *)"RTDWIDGET"); case IMAGETRANS: return((char *)"IMAGETRANS"); case EAVESDROP: return((char *)"EAVESDROP"); case OTHER: return((char *)"OTHER"); default: return((char *)"UNKNOWN"); } } skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdCLNT.h000066400000000000000000000061031215713201500206610ustar00rootroot00000000000000#ifndef rtdCLNT_H #define rtdCLNT_H /******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: rtdCLNT.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------- -------- ---------------------------------------------- * pbiereic 01/03/01 created */ /************************************************************************ * *---------------------------------------------------------------------- */ #ifndef _POSIX_SOURCE #define _POSIX_SOURCE 1 #endif #include "rtdImageEvent.h" #include "rtdSem.h" #include "rtdLOG.h" #include "define.h" #include #include #include #include #include #include #include #include #include #include class rtdCLNT : rtdLOG { public: // constructor and destructor rtdCLNT(int verbose, int index); ~rtdCLNT(); // store/return the name of the requestor char *ReqName() { return reqName_; } void ReqName(char *name) { strncpy (reqNameBuf_, name, RTD_NAMELEN); } // store/return the name of the camera char *CamName() { return camName_; } void CamName(char *name) { strncpy (camNameBuf_, name, RTD_NAMELEN); } // store/return the name of the socket file descriptor int Socket() { return socket_; } void Socket(int socket) { socket_ = socket; } // return the semaphore params set by the requestor int semId() { return semId_; } // return the number of semaphores int shmNum() { return shmNum_; } // set the values for semId and shmNum void SetSemPar(int semId, int shmNum); // store/return the index int Index() { return index_; } void Index(int index) { index_ = index; } // store/return the port number int Port() { return port_; } void Port(int port) { port_ = port; } // store/return the type number int Type() { return type_; } void Type(int type) { type_ = type; } // clear a buffer void BufClear(char *name) { memset (name, '\0', RTD_NAMELEN); } // are we attched? int Attached() { return (*reqName_ == '\0' || *camName_ == '\0'); } void Attach(char* reqName, char *camName); void Detach(); int Forward(rtdPACKET *rtdPacket); void Cleanup(); int Accept(int listenSocket); int AttachedToCamera(char *camera); char *TypeName(); private: char *reqName_; // name of requestor char *camName_; // name of camera char reqNameBuf_[RTD_NAMELEN]; // name of requestor char camNameBuf_[RTD_NAMELEN]; // name of camera int socket_; // socket file descriptor int index_; // socket file descriptor index int port_; // port number int type_; // type number int semId_; // semaphore Id int shmNum_; // number of semaphores protected: }; #endif /*!rtdCLNT_H*/ skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdClient.c000066400000000000000000000100151215713201500213270ustar00rootroot00000000000000/************************************************************************* * E.S.O. - VLT project * "@(#) $Id: rtdClient.c,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * rtdClient.c * * who when what * -------- -------- ---------------------------------------------- * T.Herlin 08/02/95 Created * P.W. Draper 16/12/97 Modified to use fd_set as a type rather than * struct. */ /************************************************************************ * NAME * rtdClient * * SYNOPSIS * * rtdClient [-v] * * DESCRIPTION * * FILES * * ENVIRONMENT * * RETURN VALUES * * CAUTIONS * * EXAMPLES * * SEE ALSO * * BUGS * *------------------------------------------------------------------------ */ static const char* const rcsId="@(#) $Id: rtdClient.c,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; /* * System Headers */ #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_SYS_FILIO_H #include #endif /* * Local Headers */ #include "rtdImageEvent.h" static int verbose=0; static void usage(void) { printf("rtdClient [-v]\n"); exit(1); } /* */ int main(int argc, char *argv[]) { char c,*buf, camera[RTD_NAMELEN],reqName[RTD_NAMELEN]; int readable; int status=0,attach=0,image=0; rtdIMAGE_EVT_HNDL eventHndl; rtdPACKET rtdPacket; rtdIMAGE_INFO imageInfo; fd_set readFds; extern char *optarg; extern int optind; strcpy(reqName,"rtdClient"); while ((c = getopt(argc,argv,":cvsia:r:")) != -1) { #ifndef SYSV char* optopt = argv[optind]; #endif switch(c) { case 'v': verbose++; break; case 's': status++; break; case 'i': image++; break; case 'a': attach++; strcpy(camera,optarg); break; case 'r': strncpy(reqName,optarg,RTD_NAMELEN); break; case ':': fprintf(stderr,"Option -%s requires an argument\n",optopt); usage(); break; case '?': fprintf(stderr,"Invalid argument -%s \n",optopt); usage(); break; } } if (rtdInitImageEvt(reqName,&eventHndl,NULL) == RTD_ERROR) { printf("Could not initialize image event !\nCheck if rtdServer is running !\n"); exit(1); } if (attach) { rtdAttachImageEvt(&eventHndl,camera,NULL); } if (status) { rtdPacket.opcode = STATUS; strncpy(rtdPacket.body.data.hdr.reqName,reqName,RTD_NAMELEN); write(eventHndl.socket,&rtdPacket,sizeof(rtdPACKET)); } if (image) { memset(&imageInfo,'\0',sizeof(rtdIMAGE_INFO)); imageInfo.dataType = FLOAT; imageInfo.xPixels = 512; imageInfo.yPixels = 512; /* send to server */ rtdSendImageInfo(&eventHndl,&imageInfo,NULL); sleep(2); exit(0); } FD_ZERO(&readFds); FD_SET(eventHndl.socket, &readFds); for (;;) { if (select(32,(fd_set *)&readFds, 0, 0, NULL) == -1) { if (verbose) printf("Select fails\n"); continue; } if (FD_ISSET(eventHndl.socket, &readFds) > 0) { if (verbose) printf("Input on client socket: %d\n",eventHndl.socket); ioctl(eventHndl.socket,FIONREAD,&readable); if (verbose) printf("Bytes readable: %d\n",readable); if (readable) { if (readable == sizeof(rtdPACKET)) { memset(&rtdPacket,'\0',sizeof(rtdPACKET)); read(eventHndl.socket,&rtdPacket, sizeof(rtdPACKET)); if (verbose) printf("Packet received: %d, %s, %s\n", rtdPacket.opcode, rtdPacket.body.data.hdr.reqName, rtdPacket.body.data.hdr.camName); } else { buf = malloc(readable+1); read(eventHndl.socket,buf,readable); buf[readable] = '\0'; printf("Read from server:\n%s\n",buf); free(buf); } } if (status) exit(0); } } } /*___oOo___*/ skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdCubeDisplay.c000066400000000000000000000207501215713201500223240ustar00rootroot00000000000000/************************************************************************* * E.S.O. - VLT project * "@(#) $Id: rtdCubeDisplay.c,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * rtdClient.c * * who when what * -------- -------- ---------------------------------------------- * T.Herlin 08/02/95 Created * P.W. Draper 16/12/97 Modified to use fd_set as a type rather than * struct. * 12/09/01 Added UKIRT Quick Look member initialisations, should * be harmless to other uses. */ static const char* const rcsId="@(#) $Id: rtdCubeDisplay.c,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; /************************************************************************ * NAME * rtdCubeDisplay - simple FITS cube display program * * SYNOPSIS * * rtdCubeDisplay -f -c [-t ] [-l] [-v] * * DESCRIPTION * * rtdCubeDisplay displays FITS cube images for the real-time display. * By specifying a FITS cube file (option -f) and a camera name (option -c) * the images are extracted from the file and an image event is sent to * the rtdServer. In order to display the image a rtd widget application * e.g. 'rtd' must register to the same camera name as specified above. * For the 'rtd' application this is done by setting the RTD_CAMERA * environment. * * Options: * * -f FITS cube images * -c Camera name to identify real time source * -v Enables verbose mode * -t Delay time between images (default 500msec) * -l Loop (forever) * * SEE ALSO * rtdServer(1) * *------------------------------------------------------------------------ */ /* * System Headers */ #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_SYS_FILIO_H #include #endif typedef void (*MySigFunc)(int); /* allan: prototype cast to keep Sun cc quiet */ /* * Local Headers */ #include "rtdImageEvent.h" static int verbose=0; static int shmId; static void usage() { printf("rtdCubeDisplay -f -c [-t ] [-l] [-v]\n"); printf("-l = loop indefinetly\n"); printf("-t = delay time between cube images (in msec) default 500 ms\n"); printf("-v = switch on verbose\n"); exit (1); } static int readFitsCube(FILE *fptr, int *type, int *width, int *height, int *count, float *bscale, float *bzero, int *fileoffset) { char buffer[81],*ptr,*vptr; int cnt=0; do { fgets(buffer,sizeof(buffer),fptr); ptr = strtok(buffer,"="); while(*ptr == ' ') ptr++; if (strncmp(ptr,"NAXIS1",6) == 0) { vptr = strtok(NULL,"/"); *width = atoi(vptr); } if (strncmp(ptr,"NAXIS2",6) == 0) { vptr = strtok(NULL,"/"); *height = atoi(vptr); } if (strncmp(ptr,"NAXIS3",6) == 0) { vptr = strtok(NULL,"/"); cnt = atoi(vptr); } if (strncmp(ptr,"BITPIX",6) == 0) { vptr = strtok(NULL,"/"); *type = atoi(vptr); } if (strncmp(ptr,"BZERO",5) == 0) { vptr = strtok(NULL,"/"); *bzero = (float)atof(vptr); } if (strncmp(ptr,"BSCALE",6) == 0) { vptr = strtok(NULL,"/"); *bscale = (float)atof(vptr); } } while(strncmp(ptr,"END ",4) !=0); *fileoffset = ((ftell(fptr)/2880L) + ((ftell(fptr)%2880)?1:0))*2880; if (!cnt) { printf("Warning: NAXIS3 not specified - hmm I'm not shure this is a cube !\n"); cnt = 1; } *count = cnt; return RTD_OK; } static void cleanup() { if (shmId) shmctl(shmId,IPC_RMID,NULL); if (verbose) printf("Exiting !\n"); exit(0); } main(int argc, char *argv[]) { char c,camera[RTD_NAMELEN],reqName[RTD_NAMELEN],fileName[256]; int count,fileoffset,typeSize=0; int loop=0,timer=500,type,i,j; rtdIMAGE_EVT_HNDL eventHndl; rtdIMAGE_INFO imageInfo; extern char *optarg; extern int optind; int shmWidth,shmHeight,shmImageType=0; char *shmPtr; FILE *fptr; float bscale = 0, bzero = 0; signal(SIGINT,(MySigFunc)cleanup); signal(SIGTERM,(MySigFunc)cleanup); signal(SIGHUP,(MySigFunc)cleanup); while ((c = getopt(argc,argv,":vlf:c:t:")) != -1) { #ifndef SYSV char* optopt = argv[optind]; #endif switch(c) { case 'v': verbose++; break; case 'l': loop++; break; case 't': timer = atoi(optarg); break; case 'r': strncpy(reqName,optarg,RTD_NAMELEN); break; case 'f': strncpy(fileName,optarg,256); break; case 'c': strncpy(camera,optarg,RTD_NAMELEN); break; case ':': fprintf(stderr,"Option -%s requires an argument\n", optopt); usage(); break; case '?': fprintf(stderr,"Invalid argument -%s \n",optopt); usage(); break; } } if (strlen(camera) == 0) { printf("camera name not specified - unable to continue !\n"); usage(); } if (rtdInitImageEvt(camera,&eventHndl,NULL) == RTD_ERROR) { printf("Could not initialize image event !\nCheck if rtdServer is running !\n"); usage(); } if (strlen(fileName) == 0) { printf("filename not specified - unable to continue !\n"); usage(); } fptr = fopen(fileName,"r"); if (fptr == NULL) { printf("invalid filename specified: %s\n",fileName); usage(); } if (readFitsCube(fptr,&type,&shmWidth,&shmHeight,&count, &bscale,&bzero,&fileoffset) == RTD_ERROR) { printf("Error in readFitsCube \n"); usage(); } if (verbose) printf("Filename: %s type:%d width:%d height:%d\n", fileName,type,shmWidth,shmHeight); switch (type) { case 8: shmImageType = BYTE; typeSize = 1; break; case -16: shmImageType = USHORT; typeSize = 2; break; case 16: shmImageType = SHORT; typeSize = 2; break; case 32: shmImageType = INT; typeSize = 4; break; case -32: shmImageType = FLOAT; typeSize = 4; break; } /* remove previous shm area */ if (shmId) shmctl(shmId,IPC_RMID,NULL); shmId = shmget(IPC_PRIVATE,shmWidth*shmHeight*typeSize,0666); if (verbose) printf("Shared Memory area created, id: %d size:%d \n", shmId,shmWidth*shmHeight*typeSize); shmPtr = (void *)shmat(shmId,NULL,0); if (shmPtr != NULL && shmPtr != (void *)-1) { /* read though file */ do { /* set correct file pointer */ rewind(fptr); fseek(fptr,fileoffset, SEEK_SET); for (i=0;i * #include * #include "rtdImageEvent.h" * * rtdIMAGE_EVT_HNDL eventHndl; * rtdIMAGE_INFO imageInfo; * char errMsg[256]; * int shmId; * char *shmPtr; * * if (rtdInitImageEvt("My_CCD_Camera",&eventHndl,errMsg) == RTD_ERROR) * { * fprintf(stderr,"rtdInitImageEvt error:%s",errMsg); * ... handle error ... * } * * shmId = shmget(IPC_PRIVATE,512*512*sizeof(short),0666); * * shmPtr = (char *)shmat(shmId,NULL,0); * if (shmPtr == -1) * { .. handle error ... } * * ... generate the image ... * * memset(&imageInfo, '\0', sizeof(rtdIMAGE_INFO)); * imageInfo.dataType = SHORT; * imageInfo.shmId = shmId; * imageInfo.xPixels = 512; * imageInfo.yPixels = 512; * * // send image event * if (rtdSendImageInfo(&eventHndl,&imageInfo,errMsg) == RTD_ERROR) * { * fprintf(stderr,"rtdSendImageInfo error:%s",errMsg); * ... handle error ... * } * * // if finishing close connection and delete shared memory * rtdClose((&eventHndl,errMsg); * * if (shmId) shmctl(shmId,IPC_RMID,NULL); * * WARNINGS * If you are not using semaphore locking then set semId=-1 in the * image event structure (see rtdImageEvent.h). Since semId=0 is * a valid number it can happen that rtdServer decrements a * semaphore created by another process which can lead to serious * problems! * * SEE ALSO * * rtdServer(1) * *------------------------------------------------------------------------- */ static const char* const rcsId="@(#) $Id: rtdImageEvent.c,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; /* * System Headers */ #include #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifdef HAVE_SYS_FILIO_H #include #endif #include #include #include #include #include #include /* * Local Headers */ #include "rtdImageEvent.h" int rtdInitImageEvt(char *requestor, rtdIMAGE_EVT_HNDL *eventHndl, char *error) { char *subr = "rtdInitImageEvt"; int s; /* connected socket descriptor */ struct hostent *hp; /* pointer to host info for remote host */ struct servent *sp; /* pointer to service information */ char *ctime(); /* declare time formatting routine */ struct sockaddr_in rtdClientAddr; /* for local socket address */ struct sockaddr_in rtdServerAddr; /* for peer socket address */ #if HAVE_SOCKLEN_T socklen_t addrlen; #else int addrlen; #endif int optval; char buf[256]; /* clear out address structures */ memset ((char *)&rtdClientAddr, 0, sizeof(struct sockaddr_in)); memset ((char *)&rtdServerAddr, 0, sizeof(struct sockaddr_in)); /* check input parameters */ if (eventHndl == NULL) return RTD_ERROR; /* This version only supports the local host connection */ gethostname(buf,sizeof(buf)); /* Set up the peer address to which we will connect. */ rtdServerAddr.sin_family = AF_INET; /* Get the host information for the hostname that the * user passed in. */ hp = gethostbyname (buf); if (hp == NULL) { rtdSetError(subr, error, RTD_ERR_GETHOSTNAME); return RTD_ERROR; } rtdServerAddr.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr; /* Assign the rtdServer port number: * 1: check the environment RTD_SERVER_PORT * 2: else read in the /etc/services * 3: if everything fails try the fallback RTD_FALLBACK_PORT */ if (getenv(RTD_SERVER_PORT)) rtdServerAddr.sin_port = htons(atoi(getenv(RTD_SERVER_PORT))); /* Find the information for the rtdServer * in order to get the needed port number. */ if (rtdServerAddr.sin_port == 0) { sp = getservbyname (RTD_SERVICE, "tcp"); if (sp != NULL) rtdServerAddr.sin_port = sp->s_port; else { /*fprintf(stderr, "%s: service not found ",RTD_SERVICE); */ rtdServerAddr.sin_port = htons(RTD_FALLBACK_PORT); } } /* Create the socket. */ s = socket (AF_INET, SOCK_STREAM, 0); if (s == -1) { rtdSetError(subr, error, RTD_ERR_CREAT_SOCKET); return RTD_ERROR; } optval = 1; setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (const char *)&optval, sizeof optval); /* Try to connect to the remote server at the address * which was just built into rtdServerAddr. */ if (connect(s, (struct sockaddr *)&rtdServerAddr, sizeof(struct sockaddr_in)) == -1) { rtdSetError(subr, error, RTD_ERR_CONNECT_SOCKET); close(s); return RTD_ERROR; } /* */ addrlen = sizeof(struct sockaddr_in); if (getsockname(s, (struct sockaddr*)&rtdClientAddr, &addrlen) == -1) { close(s); return RTD_ERROR; } /* printf("Connected to %s on port %u at %s", RTD_SERVICE, ntohs(rtdClientAddr.sin_port), ctime(&timevar)); */ /* Insert event handle data */ eventHndl->socket = s; memcpy(&eventHndl->clientAddr,&rtdClientAddr,sizeof(rtdClientAddr)); strncpy(eventHndl->reqName,requestor,RTD_NAMELEN); return RTD_OK; } /* * rtdSetError prints an error message on stdout if the error pointer * is NULL; otherwise it just returns. */ void rtdSetError(char *subr, char *error, char *msg) { if (error) strcpy(error, msg); else fprintf(stderr,"%s:%s !\n",subr, msg); } int rtdInitServer(int *listenSocket, int portNumber, char *error) { char *subr = "rtdInitServer"; int ls; /* listen socket descriptor */ struct servent *sp; /* pointer to service information */ struct sockaddr_in rtdServerAddr; /* for local socket address */ int optval; /* check output parameters */ if (listenSocket == NULL) { rtdSetError(subr, error, RTD_ERR_NULL_PTR); return RTD_ERROR; } /* clear out address structures */ memset ((char *)&rtdServerAddr, 0, sizeof(struct sockaddr_in)); rtdServerAddr.sin_family = AF_INET; rtdServerAddr.sin_addr.s_addr = INADDR_ANY; /* Assign the rtdServer port number: * 1: check if portnumber set by user * 2: else read in the /etc/services * 3: if everything fails try the fallback RTD_FALLBACK_PORT */ if (portNumber != 0) rtdServerAddr.sin_port = htons(portNumber); if (rtdServerAddr.sin_port == 0) { sp = getservbyname (RTD_SERVICE, "tcp"); if (sp != NULL) rtdServerAddr.sin_port = sp->s_port; else rtdServerAddr.sin_port = htons(RTD_FALLBACK_PORT); } /* Create the listen socket. */ ls = socket (AF_INET, SOCK_STREAM, 0); if (ls == -1) { rtdSetError(subr, error, RTD_ERR_CREAT_SOCKET); return RTD_ERROR; } /* set socket options (for HP set all bytes to 1!) */ optval = 0x1111; setsockopt(ls, SOL_SOCKET, SO_REUSEADDR, (const char *)&optval, sizeof optval); /* Bind the listen address to the socket. */ if (bind(ls, (struct sockaddr *)&rtdServerAddr, sizeof(struct sockaddr_in)) == -1) { rtdSetError(subr, error, RTD_ERR_BIND_SOCKET); return RTD_ERROR; } /* Initiate the listen on the socket so remote users * can connect. The listen backlog is set to 5. 20 * is the currently supported maximum. */ if (listen(ls, 5) == -1) { rtdSetError(subr, error, RTD_ERR_LISTEN_SOCKET); return RTD_ERROR; } *listenSocket = ls; return RTD_OK; } /* * Write nbyte to socket. If the pipe is broken (i.e. when rtdServer was * killed) ignore the signal for backwards compatibility, so that the * client can continue. */ int rtdWrite(int fd, void* buf, int nbyte) { signal(SIGPIPE, SIG_IGN); return write(fd, buf, nbyte); } int rtdSendImageInfo(rtdIMAGE_EVT_HNDL *eventHndl, rtdIMAGE_INFO *imageInfo, char *error) { char *subr = "rtdSendImageInfo"; static rtdPACKET *rtdPacket; /* check input parameters */ if (eventHndl == NULL || imageInfo == NULL) { rtdSetError(subr, error, RTD_ERR_NULL_PTR); return RTD_ERROR; } if (rtdPacket == NULL) rtdPacket = calloc(1, sizeof(rtdPACKET)); if (eventHndl->socket == 0) { rtdSetError(subr, error, RTD_ERR_NO_SOCKET); return RTD_ERROR; } /* setup protocol packet */ rtdPacket->opcode = IMAGEINFO; rtdPacket->body.data.hdr.reqType = IMAGETRANS; /* IT SW */ strncpy(rtdPacket->body.data.hdr.reqName,eventHndl->reqName, RTD_NAMELEN); memcpy(&rtdPacket->body.data.rtdImageInfo, imageInfo, sizeof(rtdIMAGE_INFO)); rtdPacket->body.data.rtdImageInfo.version = RTD_EVT_VERSION; /* use unbuffered write operation */ if (rtdWrite(eventHndl->socket, rtdPacket,sizeof(rtdPACKET)) != sizeof(rtdPACKET)) { rtdSetError(subr, error, RTD_ERR_DATAWRITE); return RTD_ERROR; } return RTD_OK; } /* * read a message from the rtd server and return it in imageInfo. * - "eventHndl" is the handle initialized by rtdInitImageEvt. * - if "verbose" is non-zero, print diagnostic messages to stdout. * - "error" is reserved for future use. */ int rtdRecvImageInfo(rtdIMAGE_EVT_HNDL *eventHndl, rtdIMAGE_INFO *imageInfo, int verbose, char *error) { char *subr = "rtdRecvImageInfo"; rtdPACKET rtdPacket; long nbytes = 0; int n = 0; /* check input parameters */ if (eventHndl == NULL || imageInfo == NULL) { rtdSetError(subr, error, RTD_ERR_NULL_PTR); return RTD_ERROR; } if (eventHndl->socket == 0) { rtdSetError(subr, error, RTD_ERR_NO_SOCKET); return RTD_ERROR; } while (1) { /* If there is more than one message to read, skip all but the last unless * the shm buffer is locked */ if (ioctl(eventHndl->socket, FIONREAD, &nbytes) != 0) { if (verbose) rtdSetError(subr, error, "rtdRecvImageInfo: ioctl failed\n"); return RTD_ERROR; } if (nbytes == 0) break; memset(&rtdPacket,'\0',sizeof(rtdPACKET)); n = read(eventHndl->socket, &rtdPacket, sizeof(rtdPACKET)); if (n < 0) { rtdSetError(subr, error, strerror(errno)); return RTD_ERROR; } if (n == sizeof(rtdPACKET)) { if (rtdPacket.body.data.rtdImageInfo.semId) { break; } } if (nbytes > sizeof(rtdPACKET)) { if (verbose) printf("%s: ignoring unread packets\n", subr); } else break; } if (n < 32) /* hardcoded! We need at least the info struct until binningY */ { rtdSetError(subr, error, RTD_ERR_UNKNOWN_SIZE); return RTD_ERROR; } if (rtdPacket.body.data.rtdImageInfo.version != RTD_EVT_VERSION) rtdSetError(subr, error, RTD_ERR_INCOMPAT); /* setup protocol packet */ if (rtdPacket.opcode == IMAGEINFO || rtdPacket.body.data.hdr.reqType == IMAGETRANS) { memcpy(imageInfo, &rtdPacket.body.data.rtdImageInfo, sizeof(rtdIMAGE_INFO)); return RTD_OK; } rtdSetError(subr, error, RTD_ERR_UNKNOWN_OPCODE); return RTD_ERROR; } int rtdAttachImageEvt(rtdIMAGE_EVT_HNDL *eventHndl, char *camera, char *error) { char *subr = "rtdAttachImageEvt"; rtdPACKET rtdPacket; memset(&rtdPacket,'\0',sizeof(rtdPACKET)); /* check input parameters */ if (eventHndl == NULL || camera == NULL) { rtdSetError(subr, error, RTD_ERR_NULL_PTR); return RTD_ERROR; } if (eventHndl->socket == 0) { rtdSetError(subr, error, RTD_ERR_NO_SOCKET); return RTD_ERROR; } /* setup protocol packet */ rtdPacket.opcode = ATTACH; rtdPacket.body.data.hdr.reqType = RTDWIDGET; /* RTD SW */ strncpy(rtdPacket.body.data.hdr.reqName,eventHndl->reqName, RTD_NAMELEN); strncpy(rtdPacket.body.data.hdr.camName,camera, RTD_NAMELEN); /* use unbuffered write operation */ if (rtdWrite(eventHndl->socket, &rtdPacket,sizeof(rtdPACKET)) != sizeof(rtdPACKET)) { rtdSetError(subr, error, RTD_ERR_DATAWRITE); return RTD_ERROR; } return RTD_OK; } int rtdDetachImageEvt(rtdIMAGE_EVT_HNDL *eventHndl, char *camera, char *error) { char *subr = "rtdDetachImageEvt"; rtdPACKET rtdPacket; memset(&rtdPacket,'\0',sizeof(rtdPACKET)); /* check input parameters */ if (eventHndl == NULL) { rtdSetError(subr, error, RTD_ERR_NULL_PTR); return RTD_ERROR; } if (eventHndl->socket == 0) { rtdSetError(subr, error, RTD_ERR_NO_SOCKET); return RTD_ERROR; } /* setup protocol packet */ rtdPacket.opcode = DETACH; rtdPacket.body.data.hdr.reqType = RTDWIDGET; /* RTD SW */ strncpy(rtdPacket.body.data.hdr.reqName,eventHndl->reqName, RTD_NAMELEN); strncpy(rtdPacket.body.data.hdr.camName,camera, RTD_NAMELEN); /* use unbuffered write operation */ if (rtdWrite(eventHndl->socket, &rtdPacket,sizeof(rtdPACKET)) != sizeof(rtdPACKET)) { rtdSetError(subr, error, RTD_ERR_DATAWRITE); return RTD_ERROR; } return RTD_OK; } int rtdServerPing(rtdIMAGE_EVT_HNDL *eventHndl, char *error) { char *subr = "rtdServerPing"; rtdPACKET rtdPacket; memset(&rtdPacket,'\0',sizeof(rtdPACKET)); /* check input parameters */ if (eventHndl == NULL) { rtdSetError(subr, error, RTD_ERR_NULL_PTR); return RTD_ERROR; } if (eventHndl->socket == 0) { rtdSetError(subr, error, RTD_ERR_NO_SOCKET); return RTD_ERROR; } /* setup protocol packet */ rtdPacket.opcode = PING; rtdPacket.body.data.hdr.reqType = RTDWIDGET; /* RTD SW */ strncpy(rtdPacket.body.data.hdr.reqName,eventHndl->reqName, RTD_NAMELEN); /* use unbuffered write operation */ if (rtdWrite(eventHndl->socket, &rtdPacket,sizeof(rtdPACKET)) != sizeof(rtdPACKET)) { rtdSetError(subr, error, RTD_ERR_DATAWRITE); return RTD_ERROR; } return RTD_OK; } int rtdClose(rtdIMAGE_EVT_HNDL *eventHndl, char *error) { /* check input parameters */ if (eventHndl == NULL || eventHndl->socket == 0) { return RTD_OK; } /* simply close the connection */ close(eventHndl->socket); eventHndl->socket = 0; return RTD_OK; } void rtdSleep(int msec) { struct timeval time; time.tv_sec = msec / 1000; time.tv_usec = (msec % 1000) * 1000; select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &time); } skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdImageEvent.h000066400000000000000000000202131215713201500221430ustar00rootroot00000000000000/************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: rtdImageEvent.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * rtdImageEvent.h * * who when what * --------- -------- ---------------------------------------------- * T.Herlin 11/05/95 Created * T.Herlin 05/12/95 Added rtdClose() * D.Hopkinson 02/12/96 Added multi-buffering shared memory with semaphores * P.Biereichel 17/06/97 Added function prototype for rtdClose() * pbiereic 11/10/99 Added wcsFlags * pbiereic 25/11/99 Rotation angle is anticlockwise positive (changed comment) * pbiereic 10/10/02 Added a remark that semId must be set to -1 if * semaphore locking is not used. Note that semaphore Id=0 * is indeed a valid number. * pbiereic 05/02/03 Added shmEndian flag to image event structure. * pbiereic 12/08/07 added support for data types double and long long int */ /************************************************************************* * * ************************************************************************* */ #ifndef RTD_IMAGE_EVENT_H #define RTD_IMAGE_EVENT_H /* POSIX hack for solaris platforms */ #ifdef _POSIX_SOURCE #define rtdEVT_POSIX 1 #undef _POSIX_SOURCE #endif /* * Required system headers */ #include #include #include #include #ifdef rtdEVT_POSIX #define _POSIX_SOURCE 1 #undef rtdEVT_POSIX #endif #ifdef __cplusplus extern "C" { #ifndef CONST #define CONST const #endif #else /* __cplusplus */ #ifndef CONST #define CONST #endif #endif /* __cplusplus */ /* * DEFINES */ #define RTD_EVT_VERSION 2 /* increment when rtdIMAGE_INFO is not backwards compat */ #define RTD_SERVICE "rtdServer" #define RTD_FALLBACK_PORT 5555 #define RTD_SERVER_PORT "RTD_SERVER_PORT" #define RTD_PTEST_FNAME "/tmp/perftest.txt" #define RTD_PERFTEST "RTDPERFTEST" #define RTD_EAVESDROPCAMERA "RTDEAVESDROP" #define RTD_SIMULATOR "RTDSIMULATOR" #define RTD_ENDPROC 127 /* Data type for end-of-process */ #define RTD_NAMELEN 32 #define RTD_OK 0 #define RTD_ERROR 1 #define RTD_NUMSHM 1 /* Number of shm buffers in simulator. */ #define RTD_WCS_FLIP_RA 1 /* flip display for RA */ #define RTD_WCS_FLIP_DEC 2 /* flip display for DEC */ #define RTD_HAVE_SHMENDIAN 1 /* info structure has shmEndian */ /* * Image types (also corresponds to FITS BITPIX field) */ typedef enum rtdIMAGE_TYPE { BYTE = 8, /* 8 bit images */ XIMAGE = -8, /* prescaled ximage */ SHORT = 16, /* 16 bit signed */ USHORT = -16, /* 16 bit unsigned */ INT = 32, /* 32 bit integer */ FLOAT = -32, /* 32 bit floating point */ LONG64 = 64, /* 64 bit integer (long long int) */ DOUBLE = -64 /* 64 bit double precision */ } rtdIMAGE_TYPE; /* * STRUCTURES */ typedef struct { char version; /* protocol version (filled by rtdSendImageInfo) */ char frameId; /* Frame Id */ char dataType; /* BYTE, SHORT, FLOAT etc. */ char bytePerPixel; /* No. of bytes used per pixel */ int shmId; /* ID for the shared memory block */ short frameX; /* X Coord. for upper left corner */ short frameY; /* Y Coord. for upper left corner */ short xPixels; /* Pixels in horisontal direction */ short yPixels; /* Pixels in vertical direction */ short blockLines; /* NOT USED! Number of lines contained in block. If 0 no block mode */ short blockOffset; /* NOT USED! Y offset on image */ int highCut; /* High cut level when auto cut */ int lowCut; /* Low cut level when auto cut */ /* The binning factors in X and Y must be the same for WCS display */ short binningX; /* Binning factor applied on image */ short binningY; /* Binning factor applied on image */ struct timeval timeStamp; /* UTC time when image was aquired */ /* * The following fields were added to support World Coordinates * Set all fields to 0 if World Coordinates are not supported */ double ra; /* Center right ascension in degrees */ double dec; /* Center declination in degrees */ double secpix; /* Number of arcseconds per pixel */ double xrefpix; /* Reference pixel X coordinate */ double yrefpix; /* Reference pixel Y coordinate */ double rotate; /* Rotation angle (anticlockwise positive) in degrees */ int equinox; /* Equinox of coordinates, 1950 and 2000 supported */ double epoch; /* Epoch of coordinates, used for FK4/FK5 conversion, no effect if 0 */ char proj[8]; /* Projection: one of: "-SIN", "-TAN", "-ARC", "-NCP", "-GLS", "-MER", "-AIT", "-STG", "PLATE", "LINEAR", "PIXEL" */ /* The following fields were added to support image synchronization */ int semId; /* ID of semaphore set. Set to -1 if not used! */ int shmNum; /* Number of semaphore in the set */ /* *These fields were added to support detector "chip" coordinates for real-time * images. The chip origin is assumed by be at lower left, as for FITS. */ short startX; /* First window pixel in X (Y) direction within the */ short startY; /* detector physical system. */ unsigned short wcsFlags; /* flags for WCS display: see RTD_WCS defines above */ short shmEndian; /* Byte order of shm data: 0=big Endian, 1=little Endian, -1 native byte order */ int reserved[8]; /* reserved for future use */ } rtdIMAGE_INFO; typedef struct { int socket; struct sockaddr_in clientAddr; char reqName[RTD_NAMELEN]; } rtdIMAGE_EVT_HNDL; #ifdef STATUS #undef STATUS #endif typedef enum rtdSERVER_CMDS { ATTACH = 1, /* RTD Widget Event Attachment */ DETACH, /* RTD Widget Event Detachment */ IMAGEINFO, /* IMAGE Update Event */ CONTROL, /* Control of rtdServer (N/A) */ STATUS, /* Status of rtdServer */ PING /* PING rtdServer */ } rtdSERVER_CMDS; typedef enum rtdCLIENT_TYPE { /* Client types */ RTDWIDGET = 1, /* RTD Widget */ IMAGETRANS, /* Image Transfer SW */ EAVESDROP , /* Eaves Drop Servers */ OTHER /* Other's e.g. control panels */ } rtdCLIENT_TYPE; typedef struct { rtdCLIENT_TYPE reqType; /* requestor type */ char reqName[RTD_NAMELEN]; /* requestor type */ char camName[RTD_NAMELEN]; /* requestor name */ } rtdHEADER; typedef struct { rtdHEADER hdr; rtdIMAGE_INFO rtdImageInfo; } rtdFORMAT_DATA; typedef union { rtdFORMAT_DATA data; char text[sizeof(rtdFORMAT_DATA)]; } rtdDATA; typedef struct { rtdSERVER_CMDS opcode; rtdDATA body; } rtdPACKET; /* * ERROR DEFINES */ #define RTD_ERR_DATAWRITE "Not all data written to rtdServer" #define RTD_ERR_NULL_PTR "Null pointer passed as argument" #define RTD_ERR_NO_SOCKET "No socket connection in eventHndl" #define RTD_ERR_CREAT_SOCKET "Could not create socket" #define RTD_ERR_LISTEN_SOCKET "Could not listen on socket" #define RTD_ERR_CONNECT_SOCKET "Could not connect socket" #define RTD_ERR_BIND_SOCKET "Could not bind socket" #define RTD_ERR_UNKNOWN_SIZE "Packet received with unknown size" #define RTD_ERR_UNKNOWN_OPCODE "Packet received with unknown opcode" #define RTD_ERR_GETHOSTNAME "Hostname not found in /etc/hosts" #define RTD_ERR_INCOMPAT "Incompatible version of rtdIMAGE_INFO structure received" /* * Real Time Display Image Event external function prototypes */ int rtdInitImageEvt(CONST char *requestor, rtdIMAGE_EVT_HNDL *eventHndl, char *error); int rtdInitServer(int *listenSock, int portNo, char *error); int rtdSendImageInfo(rtdIMAGE_EVT_HNDL *imageEvtHndl, rtdIMAGE_INFO *imageInfo, char *error); int rtdRecvImageInfo(rtdIMAGE_EVT_HNDL *imageEvtHndl, rtdIMAGE_INFO *imageInfo, int verbose, char *error); int rtdAttachImageEvt(rtdIMAGE_EVT_HNDL *imageEvtHndl, char *camera, char *error); int rtdDetachImageEvt(rtdIMAGE_EVT_HNDL *imageEvtHndl, char *camera, char *error); int rtdServerPing(rtdIMAGE_EVT_HNDL *eventHndl, char *error); int rtdClose(rtdIMAGE_EVT_HNDL *imageEvtHndl, char *error); void rtdSetError(char *subr, char *error, char *msg); void rtdSleep(int msec); #ifdef __cplusplus } #endif #endif /*!RTD_IMAGE_EVENT_H*/ skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdLOG.C000066400000000000000000000023701215713201500204770ustar00rootroot00000000000000/******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: rtdLOG.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------- -------- ---------------------------------------------- * pbiereic 01/03/01 created */ /************************************************************************ * NAME * * * SYNOPSIS * rtdLOG::rtdLOG(int verbose) : * verbose: 0 don't log, 1 print logging messages * * DESCRIPTION * rtdLOG is a class for printing logging messages * * PUBLIC METHODS * void rtdLOG::log(const char *format, ...) * Prints logs on stdout * * FILES * * ENVIRONMENT * * COMMANDS * * RETURN VALUES * * CAUTIONS * * EXAMPLES * * SEE ALSO * * BUGS * *------------------------------------------------------------------------ */ #define _POSIX_SOURCE 1 #include "rtdLOG.h" static const char *rcsId="@(#) $Id: rtdLOG.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; rtdLOG::rtdLOG(int verbose) : verbose_(verbose) { } rtdLOG::~rtdLOG() {} void rtdLOG::log(const char *format, ...) { if (! verbose_) return; printf("rtdServer: "); va_list ap; va_start(ap, format); vprintf(format, ap); va_end(ap); } skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdLOG.h000066400000000000000000000014031215713201500205400ustar00rootroot00000000000000#ifndef rtdLOG_H #define rtdLOG_H /******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: rtdLOG.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------- -------- ---------------------------------------------- * pbiereic 01/03/01 created */ /************************************************************************ * *---------------------------------------------------------------------- */ #include #include class rtdLOG { public: // constructor and destructor rtdLOG(int); ~rtdLOG(); void log(const char *format, ...); int Verbose() { return verbose_; } private: int verbose_; protected: }; #endif /*!rtdLOG_H*/ skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdSERVER.C000066400000000000000000000264161215713201500210730ustar00rootroot00000000000000/******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: rtdSERVER.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------- -------- ---------------------------------------------- * pbiereic 01/03/01 created (adapted from previous rtdServer) */ /************************************************************************ * NAME * rtdSERVER - class which manages all clients which connect to the rtdServer * * SYNOPSIS * #include "rtdSERVER.h" * rtdSERVER::rtdSERVER(int verbose, int socketFd, int delay) * verbose - verbose flag * socketFd - socket file descriptor as returned by rtdInitServer() * delay - delay after each client request in msec * * DESCRIPTION * * rtdSERVER accepts client connections and serves requests from connected * clients such as forwarding image events, attach/detach etc. For each * client which connect to the rtdServer, a "client object" is created * which executes the requests from the client. * The main loop enables new connection requests and requests from clients * already connected (via a select() call). Then it processes all active requests * within another loop, so that all clients are served with the same priority, * in particular, no client can block another client. * Clients which use an incompatible info package structure are simply * disconnected. * rtdSERVER "knows" the number of attached RTD clients and sets the semaphore * accordingly. It also provides for multicasting of event notification. * * PUBLIC METHODS * * int rtdSERVER::Loop() * The main loop which accepts connections and forwards image events to * RTD clients which are attached to the image producer (camera). Cameras * use rtdSendImageInfo() for sending image events. * The command opcodes currently provided are: * ATTACH / DETACH: used by RTD to receive or block image events * IMAGEINFO: used by camera clients to send image events * * rtdCLNT *rtdSERVER::Accept() * Accept connection from RTD or camera (i.e. rtdServer clients). * The Accept() sets the required socket options and creates a * "client object" for handling all requests coming from the client * socket. * * void rtdSERVER::DisconnectClient(rtdCLNT *client) * Dsiconnect a client which either sent a wrong event request or died * * void rtdSERVER::ServImageCmd(rtdPACKET *rtdPacket, int numbyte) * This methods serves the image event. It first increments the semaphore * according to the number of RTD clients attached. The semaphore is released * by the RTD client when the image was displayed. * Then it calls the client object for actually forwarding the image event. * * int rtdSERVER::IncrSem(rtdPACKET *rtdPacket, int increment) * Increment the semaphore: this is done only when the camera client has * implemented the semaphore (see rtdSem.c). * * rtdCLNT *rtdSERVER::GetCurrClient() * Return the object for a client which has sent a request. * * FILES * * ENVIRONMENT * * COMMANDS * * RETURN VALUES * * CAUTIONS * * EXAMPLES * * SEE ALSO * rtdInitImageEvt(3), rtdSendImageInfo(3), rtdSem(1) * * BUGS * *------------------------------------------------------------------------ */ #include "rtdSERVER.h" static const char *rcsId="@(#) $Id: rtdSERVER.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; rtdSERVER::rtdSERVER(int verbose, int socketFd, int delay) : rtdLOG(verbose), socketFd_(socketFd), delay_(delay), numClnt_(0), reqClnt_(0), reqCount_(0) { for (int i = 0; i <= MAX_CLNT; i++) clnt_[i] = NULL; } rtdSERVER::~rtdSERVER() { for (int i = 0; i < numClnt_; i++) delete clnt_[i]; } int rtdSERVER::Loop() { fd_set readFd; // file descriptor for port RTD_SERVER_PORT (default 5555) readFd_ = (fd_set *) &readFd; time_t timeVal; rtdPACKET rtdPacket; // copy of the standard info package structure int packetSize = sizeof(rtdPACKET); rtdHEADER *hdr = &(rtdPacket.body.data.hdr); int socket; int n; timeVal = time(NULL); strcpy(startTime_, ctime(&timeVal)); log("Entering main loop and waiting for client connections...\n"); while ( 1 ) { /* * sleep a bit to give the RTD clients more time. A delay can * be used to slow down the image event rate from ultra-fast cameras * provided the camera process is using semaphore locking. */ if (delay_ > 0) rtdSleep(delay_); FD_ZERO(readFd_); // enable read for connection requests FD_SET(socketFd_, readFd_); // Enable read for all clients connected. for (int i = 0; i < numClnt_; i++) FD_SET(clnt_[i]->Socket(), readFd_); ///////////////////////////////////////////// int status = select(32, readFd_, 0, 0, NULL); ///////////////////////////////////////////// if (status <= 0) { log("Select error !!!\n"); return RTD_ERROR; // timeout or error (signals) should not happen } log("*** Handling new event (%d) ....\n", reqCount_++); // total number of requests // check if a client wants to connect if (FD_ISSET(socketFd_, readFd_) > 0) { Accept(); continue; // accept or refuse, anyway continue the loop... } /* * service clients on all active client sockets i.e. the ones which are * currently in the readFd set. This ensures that all clients are * serviced even when there is a client which sends events at very * high speed. */ rtdCLNT *currClient = NULL; // current client object while ((currClient = GetCurrClient()) != NULL) { socket = currClient->Socket(); n = read(socket, &rtdPacket, packetSize); // check if client died or sent a wrong event structure if (n < 0 || n != packetSize) { if (n > 0) log("Client sent a wrong request. Will be disconnected.\n"); else log("Client apparently closed the connection.\n"); DisconnectClient(currClient); // Disconnect the client continue; } currClient->Type(hdr->reqType); // keep the requestor type // execute command given in the event info structure switch (rtdPacket.opcode) { case ATTACH: currClient->Attach(hdr->reqName, hdr->camName); log("ATTACH command received from %s, %s\n", currClient->ReqName(), currClient->CamName()); break; case DETACH: log("DETACH command received from %s, %s\n", currClient->ReqName(), currClient->CamName()); currClient->Detach(); break; case IMAGEINFO: log("IMAGEINFO command received (port %d)\n", currClient->Port()); ServImageCmd(&rtdPacket); break; #ifdef STATUS #undef STATUS #endif case STATUS: log("STATUS command received (port %d)\n", currClient->Port()); ServStatusCmd(socket); break; case PING: log("PING command received (port %d)\n", currClient->Port()); break; default: log("Unknown opcode received: %d. Client will be disconnected.\n", rtdPacket.opcode); DisconnectClient(currClient); // Disconnect the client } } } } /* * Accept connection from RTD or camera */ rtdCLNT *rtdSERVER::Accept() { rtdCLNT *client; reqClnt_++; // for statistics // Create a new object for handling the request for this connection client = clnt_[numClnt_++] = new rtdCLNT(Verbose(), numClnt_); if (client->Accept(socketFd_) == RTD_OK && numClnt_ < MAX_CLNT) return client; if (numClnt_ >= MAX_CLNT) log("Too many cameras and RTD's connected to rtdServer\n"); DisconnectClient(client); return NULL; } void rtdSERVER::DisconnectClient(rtdCLNT *client) { int idx = client->Index(); log("Closing connection (port %d)\n", client->Port()); delete client; clnt_[idx] = NULL; numClnt_--; /* * shuffle up the clnt_[] pointer buffer to simplify programatic access. * The last pointer of the buffer is not used but set to NULL. */ for (int i = idx; i < MAX_CLNT; i++) clnt_[i] = clnt_[i+1]; } /* * return a client object for which a request is pending */ rtdCLNT *rtdSERVER::GetCurrClient() { for (int i = 0; i < numClnt_; i++) { if (FD_ISSET(clnt_[i]->Socket(), readFd_) <= 0) continue; FD_CLR(clnt_[i]->Socket(), readFd_); // needed for next FD_ISSET clnt_[i]->Index(i); // client index return clnt_[i]; } return NULL; } void rtdSERVER::ServImageCmd(rtdPACKET *rtdPacket) { int numClients = 0; // number of RTD clients attached to the camera char *camera = rtdPacket->body.data.hdr.reqName; rtdIMAGE_INFO *info = &(rtdPacket->body.data.rtdImageInfo); log("Image event received from: %s\n", camera); if (*camera == '\0') return; // Get the number of RTD clients which are currently attached to the camera for (int i = 0; i < numClnt_; i++) { if (clnt_[i]->AttachedToCamera(camera) == RTD_OK) numClients++; } /* * Increment the shared memory semaphore with (numClients - 1). One * increment was already done by the camera. */ if (IncrSem(rtdPacket, numClients - 1) != RTD_OK) return; if (! numClients) { log("No RTD clients are currently attached to '%s'\n", camera); return; } /* * Now loop over the clients to send the packets to all attached RTD's. */ for (int i = 0; i < numClnt_; i++) { if (clnt_[i]->AttachedToCamera(camera) != RTD_OK) continue; /* * The attached RTD client object needs to cleanup semaphores * when it's associated RTD terminates. */ clnt_[i]->SetSemPar(info->semId, info->shmNum); log("Forwarding event to: %s\n", clnt_[i]->ReqName()); if (clnt_[i]->Forward(rtdPacket) != RTD_OK) log("Forwarding event message failed\n"); } return; } void rtdSERVER::ServStatusCmd(int socket) { char buf[4096], buf2[256]; sprintf(buf, "rtdServer info:\n" "rtdServer was started: %s" "Delay was set to: %d\n" "Total number of connections: %d\n" "Total number of requests: %d\n", startTime_, delay_, reqClnt_, reqCount_); strcat(buf, "Current rtdServer clients:\n"); for (int i=0; i < numClnt_; i++) { if (socket == clnt_[i]->Socket()) continue; sprintf(buf2, "Entry: %d \tName: %s\tCamera: %s\t Type: %s\t\n", i, clnt_[i]->ReqName(), clnt_[i]->CamName(), clnt_[i]->TypeName()); if (strlen(buf) + sizeof(buf2) + 1 < sizeof(buf)) strcat(buf, buf2); } log(buf); write(socket, buf, strlen(buf)+1); } int rtdSERVER::IncrSem(rtdPACKET *rtdPacket, int increment) { rtdIMAGE_INFO *rtdImageInfo = &(rtdPacket->body.data.rtdImageInfo); int semId = rtdImageInfo->semId; int shmNum = rtdImageInfo->shmNum; /* * First thing is to check that semaphores were implemented by the camera. * Note that semId=0 is a valid id. */ int val = rtdSemGetVal(semId, shmNum); if (val < 0) return RTD_OK; // for applications not using semaphores log("Semaphores implemented: semId = %d, shmNum=%d, val = %d\n", semId, shmNum, val); /* * Check also that the semaphore given in the image information * is set to one. */ if (val != 1) { log("Warning: sending image event without semaphore set to 1\n"); return RTD_OK; } /* * Now increment the semaphore by increment. First set the required * semaphore to change in the sembuf structure. */ if (increment != 0) rtdSemIncrement(semId, shmNum, increment); return RTD_OK; } skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdSERVER.h000066400000000000000000000036541215713201500211370ustar00rootroot00000000000000#ifndef rtdSERVER_H #define rtdSERVER_H /******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: rtdSERVER.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * who when what * -------- -------- ---------------------------------------------- * pbiereic 01/03/01 created */ /************************************************************************ * *---------------------------------------------------------------------- */ #define MAX_CLNT 300 // max. number of clients which can connect #include "rtdCLNT.h" // includes almost all we need #include "rtdLOG.h" #include #include // This class is handling semaphores, not rtdCLNT #ifndef HAVE_UNION_SEMUN // argument type needed by semctl - not used here union semun { int val; // used for SETVAL only struct semid_ds *buf; // for IPC_STAT and IPC_SET ushort *array; // used for GETALL and SETALL }; #endif class rtdSERVER : public rtdLOG { public: // constructor and destructor rtdSERVER(int, int, int); ~rtdSERVER(); int Loop(); protected: rtdCLNT *GetCurrClient(); void ServImageCmd(rtdPACKET *rtdPacket); void ServStatusCmd(int socket); int IncrSem(rtdPACKET *rtdPacket, int increment); rtdCLNT *Accept(); void DisconnectClient(rtdCLNT *client); private: int socketFd_; // listen socket int delay_; // delay in msec int numClnt_; // number of clients which are currently connected rtdCLNT *clnt_[MAX_CLNT+1]; // pointer array to camera objects int reqCount_; // total number of requests int reqClnt_; // total number of clients which connected fd_set *readFd_; // read file descriptor mask char startTime_[256]; // start time }; #endif /*!rtdSERVER_H*/ skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdSem.c000066400000000000000000000556471215713201500206610ustar00rootroot00000000000000/******************************************************************************* * E.S.O. - VLT project * * rtdSem.c * * who when what * -------- -------- ---------------------------------------------- * D.Hopkinson 21/01/97 Created. * D.Hopkinson 27/02/97 Updated to include shared memory creation/ * destruction. * pbiereic 14/06/97 Added rtdShmFillNext() * pbiereic 22/10/99 Bug fixed in rtdShmDelete * pbiereic 01/03/01 Added: rtdSemIncrement(), rtdSemGetVal() * pbiereic 28/05/01 Removed SEM_UNDO in rtdShmFill (see system parameter * semaem on HP which specifies the maximum amount the value * of a semaphore can be changed by an undo operation) * * Description: * This module contains several utility routines for the creation, * activation, and destruction of semaphores and associated shared * memory areas. */ /************************************************************************ * NAME * rtdSem - utility routines for semaphores and shared memory * * rtdShmCreate - Initialise shared memory and semaphore set. * * rtdShmFill - Fill chosen piece of shared memory with data. * * rtdShmStruct - Fill image information structure prior to send. * * rtdShmDelete - Remove the shared memory/semaphore set. * * rtdShmLocked - Detect if a particular shm segment is locked. * * rtdShmFillFirst - Fill the first free segment of shared memory. * * rtdShmFillNext - Fill the next free segment of shared memory. * * rtdShmServicePacket- Clear a semaphore given image event information. * * rtdSemDecrement - Decrement the chosen semaphore. * * rtdSemReset - Reset the chosen semaphore to zero. * * SYNOPSIS * #include "rtdSem.h" * * int rtdShmCreate(int num, * rtdShm *shmPtr, * int width, * int height, * int type) * * int rtdShmFill(int index, * char *data, * rtdShm *shmPtr, * int verbose) * * int rtdShmStruct(int index, * rtdIMAGE_INFO *imageInfo, * rtdShm *shmPtr) * * int rtdShmDelete(rtdShm *shmPtr) * * int rtdShmLocked(rtdShm *shmPtr, * int index) * * int rtdShmFillFirst(char *data, * rtdShm *shmPtr) * * int rtdShmFillNext(int index, * char *data, * rtdShm *shmPtr) * * void rtdShmServicePacket(rtdIMAGE_INFO *imageInfo) * * void rtdSemDecrement(int semId, * int semNum) * * void rtdSemReset(int semId, * int semNum) * * * DESCRIPTION * * These routines are (mostly) for the benefit of CCD software * developers who wish to interface with the shared memory/ * semaphore locking implemented within the RTD. The exception * to this are the routines rtdSemDecrement and rtdSemReset, * which are currently used by the RTD and rtdServer, although * there may be a use for them in the future on the CCD side. * * These routines all use a structure (defined in rtdSem.h): * typedef struct rtdShm { * int *shmId; Array of shared memory Ids * int semId; Semaphore Id * int num; Number of shared memory buffers * int shmWidth; Width of image (pixels) * int shmHeight; Height of image (pixels) * int shmImageType; Type of image (BYTE, SHORT, etc) * double *timestamp; Array of semaphore timestamps * } rtdShm; * The use of this structure should be transparent when using the * following convenience routines, although the fields of the * structure should be self-explanatory. * * - rtdShmCreate() allocates the required number of buffers of shared * memory of the required size, given the height, width, and data * type of the FITS image that is to be created. It also creates a * single semaphore set, the number of items in the set being equal * to the number of shared memory buffers. This means that each shared * memory area correspnds to, and can be locked by, a single semaphore * item from the set. The information is stored in the rtdShm structure, * shown above. * * If the shared memory has already been allocated, this routine returns * immediately. * * - rtdShmFill() is used to fill a particular piece of shared memory * (specified by the index argument) with data. Before doing so, the * semaphore corresponding to the shared memory is set to one. * * If the shared memory is currently locked, the routine returns * immediately. The exception to this is when the routine detects * that the semaphore is in a 'zombie' state, i.e. it has not been * set by the CCD for a period of time longer then RTD_SEM_TIMEOUT * (defined in rtdSem.h). In this case, the semaphore is reset and * the processing continues. * * If the data pointer is NULL then it is assumed that the data in * shared memory will be filled by the camera process after successful * call to rtdShmFill(). This is usually done when the camera process * transfers huge images (or image arrays) directly to shared memory. * * - rtdShmStruct() fills the image information structure with the * information that is specific to the shared memory/semaphore * locking, i.e. the shared memory ID, the semaphore ID, and the * number of the shared memory in the multi-buffered cycle * (...imageInfo->shmNum). * * - rtdShmDelete() removes the shared memory areas and semaphore, and * frees the memory associated with their storage. * * - rtdShmLocked() is used to detect whether or not a particular piece * of shared memory is currently locked, and returns the semaphore state. * As with rtdShmFill, if it detects a semaphore timeout it resets the * semaphore, and returns the new value. * * - rtdShmFillFirst() cycles over the shared memory buffers and fills the * first free (unlocked) buffer with the data supplied in the argument. * The number of the filled buffer is returned. * * - rtdShmFillNext() cycles over the shared memory buffers and fills the * next free (unlocked) buffer with the data supplied in the argument. * The index starts at index+1. * The number of the filled buffer is returned. * * The following routines are only used within the RTD software at the * moment. * * - rtdShmServicePacket() processes an image event with respect to the * semaphore information that it holds, but does no more. This is used * (for example) in situations where image events may be skipped by the * RTD, but the skipped packets must still be serviced to free up the * shared memory. * * - rtdSemDecrement() decrements the chosen semaphore by one. * * - rtdSemReset() resets the chosen semaphore to zero. * * RETURN VALUES * * Depends on routine. See individual functions. * * NOTES * * The scheme that has been chosen for the shared memory locking is as * follows. In a multi-buffered system, each piece of shared memory is * made to correspond to a single item from a semaphore set. If the state * of this item is high, then the CCD does not write to that piece of * memory. The RTD is never prevented from reading memory. * * When a CCD writes into shared memory, it sets the semaphore for that * piece of memory to one. It then passes the semaphore/shared memory * information as fields in the image event structure. The server adds * to the semaphore a value equal to the number of RTD clients minus one. * When a client has finished reading the shared memory, it decrements * the corresponding semaphore by one. Thus when all clients have finished * reading the shared memory, the semaphore returns to zero and the CCD * is free to write once again. * * If the update rate of the CCD is too fast for the RTD such that the * RTD skips some image events, it is up to the RTD to service the skipped * events so that the semaphores unlock. If an RTD crashes (so leaving a * semaphore in a high state), a timeout mechanism resets the semaphore * after a certain amount of time (e.g. 20 seconds). * * The RTD/rtdServer code is semaphore transparent, i.e. if the CCD * developer chooses not to implemented semaphores, there should be * no effect on the operation of the RTD. * * EXAMPLE * * This is the simplest possible application that could send data to the * server using semaphore locking. It is not necessary to use all the * functions offered above; the idea was simply to allow the CCD developer * some flexibility in their choice of functionality. * * // sample application which sends locked CCD data to the server * #include "rtdSem.h" * #include "rtdImageEvent.h" * * #define WIDTH 128 // Width of image * #define HEIGHT 128 // Height of image * #define DATASIZE 16 // Size of pixel * #define NUM_BUF 5 // Number of shm buffers * * static void generate_data(char *); // General data generation routine * * void main() * { * rtdIMAGE_EVT_HNDL eventHndl; * rtdIMAGE_INFO imageInfo; * rtdShm shmInfo; // Required for CCD library routines * char *data; * unsigned int i = 0; * * memset(&imageInfo, '\0', sizeof(rtdIMAGE_INFO)); * * if (rtdInitImageEvt("My_CCD_Camera", &eventHndl, NULL) == RTD_ERROR) { * // ... handle error ... * } * * if (rtdShmCreate(NUM_BUF, &shmInfo, WIDTH, HEIGHT, DATASIZE) == -1) { * // ... handle error ... * } * * while ( [some condition] ) { * generate_data(data); * * // Fill up the first available (unlocked) shm buffer * // (rtdShmFillFirst has the same effect, except always starts * // from zero). * while (rtdShmFill(i, data, &shmInfo, 0) == -1) { * sleep(1); * } * * imageInfo.dataType = DATASIZE; * imageInfo.xPixels = WIDTH; * imageInfo.yPixels = HEIGHT; * imageInfo.frameX = 0; * imageInfo.frameY = 0; * imageInfo.frameId = 0; * * // Fill up the image information fields with semaphore/shm info * rtdShmStruct(i, &imageInfo, &shmInfo); * * // forward image event * rtdSendImageInfo(&eventHndl, &imageInfo, NULL); * * i = (i + 1) % NUM_BUF; * } * * // Free up the semaphore/shared memory allocation * rtdShmDelete(&shmInfo); * free(data); * } * * WARNINGS * If you are not using semaphore locking then set semId=-1 in the * image event structure (see rtdImageEvent.h). Since semId=0 is * a valid number it can happen that rtdServer decrements a * semaphore created by another process which can lead to serious * problems! * * SEE ALSO * * rtdServer(1), rtdImageEvent(3) * *------------------------------------------------------------------------- */ #include #include #include #include #include "rtdSem.h" #include "rtdImageEvent.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef HAVE_UNION_SEMUN /* argument type needed by semctl - not used here */ union semun { int val; /* used for SETVAL only */ struct semid_ds *buf; /* for IPC_STAT and IPC_SET */ ushort *array; /* used for GETALL and SETALL */ }; #endif static union semun semun_; /* * rtdShmCreate * * Description: * This routine creates a unique semaphore, along with an array of shared * memory areas if these do not already exist. * * Arguments: * int num * The number of semaphores to create in the set (this should be * equal to the number of shared memory areas in a multi-buffered * system). * rtdShm *shmPtr * Pointer to the shared memory/semaphore information structure. * int width * Width of the image (pixels) * int height * Height of the image (pixels) * int type * Image data type (SHORT, FLOAT,...) * * Return value: * The ID of the created semaphore, or -1 if an error occurred. */ int rtdShmCreate(int num, rtdShm *shmPtr, int width, int height, int type) { int i, shmSize, shmId, semId; /* * Check if the shared memory Ids have been allocated. If so, return. */ if (shmPtr->shmId) return 0; shmPtr->shmWidth = width; shmPtr->shmHeight = height; shmPtr->shmImageType = type; shmPtr->num = num; shmSize = width * height * (abs(type) / 8); /* * Create new shared memory areas and allocate memory for the IDs. */ if ((shmPtr->shmId = (int *)calloc(num, sizeof(int))) == NULL) { fprintf(stderr, "Unable to allocate memory\n"); return -1; } for (i = 0; i < num; i++) { shmId = shmget(IPC_PRIVATE, shmSize, RTD_PERMS | IPC_CREAT); if (shmId == -1) { perror("rtdShmCreate"); fprintf(stderr, "Error in creating shared memory #%d\n", i); return -1; } shmPtr->shmId[i] = shmId; } /* * Create the set of semaphores (one for each shared memory area) */ semId = semget(IPC_PRIVATE, num, RTD_PERMS | IPC_CREAT); if (semId == -1) { perror("Unable to create semaphore"); return 0; } shmPtr->semId = semId; /* * Allocate an array of timestamps for the semaphores */ if ((shmPtr->timestamp = (double *)calloc(num, sizeof(double))) == NULL) { fprintf(stderr, "Unable to allocate timestamp data\n"); return -1; } return semId; } /* * This routine fills the required shared memory area with the data. The * shared memory is 'locked' during the fill process by implementing the * semaphore for the shared memory. * * Arguments: * int index * The index of the shared memory area. This is not the shared * memory Id, but the position of the shared memory in the * buffering order (indices start at 0). * char *data * Pointer to the data to fill the shared memory with. * rtdShm *shmPtr * Structure containing the shared memory/semaphore information. * * Return value: * 0 if OK, -1 for error/shared memory locked. */ int rtdShmFill(int index, char *data, rtdShm *shmPtr, int verbose) { char *ptr; /* Pointer to shared memory area */ int shmSize; /* Size of shared memory area */ struct timeval tm; /* Timestamp structure for semaphore */ struct sembuf semLock[2] = { 0, 0, 0, /* Wait for [#] to equal zero */ 0, 1, 0 /* Increment [#] by one */ }; shmSize = shmPtr->shmWidth * shmPtr->shmHeight * abs(shmPtr->shmImageType) / 8; /* Check if the semaphore is locked. Return immediately if it is */ if (rtdShmLocked(shmPtr, index)) { if (verbose) printf("Semaphore %d is already locked\n", index); return -1; } /* Get the current timestamp information */ gettimeofday(&tm, NULL); /* * Set the required semaphore to one, if the semaphore was created * successfully. This will be reset to zero * when all the RTDs have finished reading the image information. * * At the same time as locking the semaphore, timestamp the operation * so that we can detect semaphore zombies. */ semLock[0].sem_num = (unsigned short)index; semLock[1].sem_num = (unsigned short)index; if (shmPtr->semId != -1) { semop(shmPtr->semId, &semLock[0], 2); shmPtr->timestamp[index] = tm.tv_sec + (tm.tv_usec / 1000000.); if (verbose && rtdSemGetVal(shmPtr->semId, index)) fprintf(stderr, "Semaphore %d locked\n", (index + 1)); } /* * Fill the shared memory up. First attach to the memory, then simply * copy the data across. */ if (data == NULL) return 0; ptr = (char *)shmat(shmPtr->shmId[index], NULL, 0); if (ptr != NULL && ptr != (void *)-1) { if (memcpy(ptr, data, shmSize) == NULL) { fprintf(stderr, "Unable to copy memory for segment %d", index); rtdSemReset(shmPtr->semId, index); return -1; } } else { if (verbose) fprintf(stderr, "Unable to attach to shared memory %d\n", shmPtr->shmId[index]); rtdSemDecrement(shmPtr->semId, index); return -1; } /* Finally, detach from the shared memory. */ shmdt(ptr); return 0; } /* * This is a convenience routine for the CCD software; given an rtdShm * structure, this fills up the first available (unlocked) buffer. * * Arguments: * char *data * Pointer to the data to fill the shared memory with. * rtdShm *shmPtr * Structure containing the shared memory/semaphore information. * * Return value: * the buffer number if OK, -1 for error/all shared memory locked. */ int rtdShmFillFirst(char *data, rtdShm *shmPtr) { int i; /* Index counter */ int status = -1; /* Return status */ /* * Cycle over all the buffers, chcking to see if they're locked. * When an unlocked buffer is found, fill it with the data. */ for (i = 0; i < shmPtr->num; i++) { if ((status = rtdShmFill(i, data, shmPtr, 0)) == 0) break; } return (status == -1 ? status : i); } /* * This is a convenience routine for the CCD software; given an rtdShm * structure, this fills up the next available (unlocked) buffer. * * Arguments: * int index * The current index of the shared memory area. * char *data * Pointer to the data to fill the shared memory with. * rtdShm *shmPtr * Structure containing the shared memory/semaphore information. * * Return value: * the buffer number if OK, -1 for error/all shared memory locked. */ int rtdShmFillNext(int index, char *data, rtdShm *shmPtr) { int i, j; /* Index counters */ int status = -1; /* Return status */ /* * Cycle over all the buffers, checking to see if they're locked. * When an unlocked buffer is found, fill it with the data. */ for (i = 0; i < shmPtr->num; i++) { j = (index+i) % shmPtr->num; if ((status = rtdShmFill(j, data, shmPtr, 0)) == 0) break; } return (status == -1 ? status : j); } /* * This routine fills in the image information structure with all the * information pertaining to the shared memory/semaphore Ids. This should * be invoked before the rtdPACKET is sent to the server. * * Arguments: * int index * The index of the shared memory area to send. See note in the above * routine. * rtdIMAGE_INFO *imageInfo * Image information structure for send. * rtdShm *shmPtr * Structure containing the shared memory/semaphore Id. * * Return value: * 0 if OK, -1 if error. */ int rtdShmStruct(int index, rtdIMAGE_INFO *imageInfo, rtdShm *shmPtr) { /* Fill in the required fields of the image information structure. */ imageInfo->shmId = shmPtr->shmId[index]; imageInfo->semId = shmPtr->semId; imageInfo->shmNum = index; return 0; } /* * This routine checks if a semaphore is locked. If it is locked, and it is * detected that the semaphore has been locked for a time longer than * RTD_SEM_TIMEOUT, then it is cleared and OK is returned. * * Arguments: * rtdShm *shmPtr * Structure containing shared memory/semaphore information. * int index * Element of semaphore set to check. * * Return value: * 0 if OK, 1 if locked. */ int rtdShmLocked(rtdShm *shmPtr, int index) { struct timeval tm; /* Current timestamp */ double tmStamp; /* 'Expanded' current timestamp */ int semval; gettimeofday(&tm, NULL); tmStamp = tm.tv_sec + (tm.tv_usec / 1000000.); /* * If the semaphore was not created successfully, then just return * "locked". */ if (shmPtr->semId == -1) return 1; /* * First check the current state of the semaphore. If it is high (1) * then return without doing anything. The exception to this is if * the semaphore appears to be a 'zombie' (no operations have been carried * out on the semaphore for over RTD_SEM_TIMEOUT), in which case clear * the semaphore and continue. */ semval = rtdSemGetVal(shmPtr->semId, index); if (semval < 0) return 1; if (semval == 0) return 0; if (tmStamp - shmPtr->timestamp[index] > RTD_SEM_TIMEOUT) { while(rtdSemGetVal(shmPtr->semId, index) > 0) rtdSemDecrement(shmPtr->semId, index); return 0; } return 1; } /* * This routine services an rtdPacket by decrementing the appropriate * semaphore. This routine is used in the image event library to remove * (decrement) the semaphores of missed image events when the CCD update * rate is too fast for the RTD. * * Arguments: * rtdIMAGE_INFO *imageInfo * The image information packet that requires treatment. * * Return value: * None. */ void rtdShmServicePacket(rtdIMAGE_INFO *imageInfo) { /* Simply decrement the semaphore specified in the image information */ if (imageInfo->semId != -1) rtdSemDecrement(imageInfo->semId, imageInfo->shmNum); } /* * This routine removes the semaphore and deletes the shared memory areas. * * Arguments: * rtdShm *shmPtr * Structure containing shared memory/semaphore information. * * Return value: * 0 if OK, -1 if error. */ int rtdShmDelete(rtdShm *shmPtr) { int i; if (shmPtr == NULL) return 0; if (shmPtr->num < 1) return 0; /* Delete the shared memory first. */ if (shmPtr->shmId) { for (i = 0; i < shmPtr->num; i++) shmctl(shmPtr->shmId[i], IPC_RMID, NULL); free(shmPtr->shmId); shmPtr->shmId = NULL; } /* Delete the semaphore. */ if (shmPtr->semId != -1) { if (semctl(shmPtr->semId, 0, IPC_RMID, semun_) != 0) return -1; } /* Delete the timestamp allocation */ free(shmPtr->timestamp); return 0; } /* * This routine decrements the chosen semaphore from a given set. * This is presently only used by those applications that have to reset * semaphores (in particular, the RTDs) - however, it is included in this * module in case this becomes useful to CCD software. * * Arguments: * int semId * The ID number of the semaphore set concerned. * int semNum * The number of the semaphore set to be decremented. * * Return value: * None. */ void rtdSemDecrement(int semId, int semNum) { int cnt; struct sembuf semDec = { 0, -1, IPC_NOWAIT }; /* Check the semaphore was created successfully */ if (semId == -1) return; /* Perform the decrementation */ semDec.sem_num = (unsigned short)semNum; cnt = rtdSemGetVal(semId, semNum); if (cnt > 0) semop(semId, &semDec, 1); } /* * This routine return the current value of a semaphore */ int rtdSemGetVal(int semId, int semNum) { if (semId == -1) return -1; return semctl(semId, semNum, GETVAL, semun_); } /* * This routine resets the semaphore to zero. * * Arguments: * int semId * The ID number of the semaphore set concerned. * int semNum * The number of the semaphore set to be decremented. * * Return value: * None. */ void rtdSemReset(int semId, int semNum) { struct sembuf semDec[1] = { 0, 0, IPC_NOWAIT | SEM_UNDO }; /* Check the semaphore was created successfully */ if (semId == -1) return; /* Perform the reset */ semDec[0].sem_num = (unsigned short)semNum; semDec[0].sem_op = -(short)rtdSemGetVal(semId, semNum); semop(semId, &semDec[0], 1); } int rtdSemIncrement(int semId, int semNum, int increment) { struct sembuf semInc; semInc.sem_num = 0; semInc.sem_op = increment; /* Increment [#] by increment */ semInc.sem_flg = SEM_UNDO; if (semId == -1) return RTD_ERROR; if (increment != 0) { semInc.sem_num = (unsigned short)semNum; semop(semId, &semInc, 1); } return RTD_OK; } skycat-3.1.2-starlink-1b/rtd/rtdevt/rtdSem.h000066400000000000000000000036461215713201500206560ustar00rootroot00000000000000#ifndef RTDSEM_H #define RTDSEM_H /*+ * E.S.O. - VLT project * * * rtdSem.h * * This header contains prototypes for the semaphore manipulation routines * of rtdSem.c * * See rtdSem(1) for more information. * * who when what * --------- -------- ---------------------------------------------- * D.Hopkinson 21/01/97 Created. -*/ #include #include #include #include "rtdImageEvent.h" #define RTD_PERMS 0666 /* Access permissions for shared memory */ #define RTD_SEM_TIMEOUT 20 /* Timeout period for an un-reset semaphore */ /* * This structure is provided for use with the multibuffering/semaphore * convenience routines. */ typedef struct rtdShm { int *shmId; /* Array of shared memory Ids */ int semId; /* Semaphore Id */ int num; /* Number of shared memory buffers */ int shmWidth; /* Width of image (pixels) */ int shmHeight; /* Height of image (pixels) */ int shmImageType; /* Type of image (BYTE, SHORT, etc) */ double *timestamp; /* Array of semaphore timestamps */ } rtdShm; #ifdef __cplusplus extern "C" { #endif int rtdShmCreate (int num, rtdShm *shmPtr, int width, int height, int type); int rtdShmFill (int index, char *data, rtdShm *shmPtr, int verbose); int rtdShmFillFirst (char *data, rtdShm *shmPtr); int rtdShmFillNext (int index, char *data, rtdShm *shmPtr); int rtdShmStruct (int index, rtdIMAGE_INFO *imageInfo, rtdShm *shmPtr); int rtdShmDelete (rtdShm *shmPtr); int rtdShmLocked (rtdShm *shmPtr, int index); int rtdSemGetVal (int semId, int semNum); int rtdSemIncrement (int semId, int semNum, int increment); void rtdSemDecrement (int semId, int semNum); void rtdSemReset (int semId, int semNum); int rtdSemGetVal (int semId, int semNum); void rtdShmServicePacket(rtdIMAGE_INFO *imageInfo); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* RTDSEM_H */ skycat-3.1.2-starlink-1b/rtd/rtdevt/rtd_server.C000066400000000000000000000134411215713201500215240ustar00rootroot00000000000000/******************************************************************************* * E.S.O. - VLT project * * "@(#) $Id: rtd_server.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * rtdServer.C * * who when what * -------- -------- ---------------------------------------------- * pbiereic 01/03/01 Adapted from previous version * pbiereic 11/09/07 VLTSW20070184: rtdServer should not ignore SIGTERM */ static const char* const rcsId="@(#) $Id: rtd_server.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; /************************************************************************ * NAME * rtdServer - image event dispatcher for RTD * * SYNOPSIS * * rtdServer [-v ] [-p ] [-t ] * * DESCRIPTION * * rtdServer is the process that manages all image events from cameras * which are forwared to RTD client(s) which display the images. * "Cameras" are acquisition processes like a CCD, IRACE-DCS, etc. which readout the * detector image. * * Clients register (and connect) to the rtdServer via the rtdInitImageEvt() call. * * Connected RTD clients will receive image events from a camera if they are attached * to this camera. If not, then image events are simply discarded. * * Cameras use the rtdSendImageInfo() call when there is a new image to be displayed. * * Several RTD clients can attach to the same camera as the multicasting * of event notification is supported by the rtdServer. * RTD clients can also attach to cameras that not have registered yet * as the rtdServer supports a independence between image event producer * and image event consumer. * * The rtdServer also implements semaphore locking of shared memory, to * avoid the possibility of the RTD client reading the shared memory * at the same time as the camera writes (this is known as "image jitter"). * * The rtdServer expects the camera software to lock the semaphore. * * The rtdServer will then increment this semaphore by the number of RTD * clients less one (one was already set by the camera). If semaphores * are not implemented in the incoming image event, no action is taken. * The overall locking scheme is discussed in more detail in rtdSem(3). * * CAUTIONS * * o The rtdServer must not be killed when other clients are still * connected to it. * o rtdServer should not be started when there is another instance running on * the same machine, since there is only one standard server port to which * clients can connect to. If it is nevertheless started, then it will delay * for some seconds before terminating. * * ENVIRONMENTS * * The rtdServer (and RTD clients) use 5555 as the default, standard port number. * The port number can be changed within a user session by setting the * environment variable RTD_SERVER_PORT before starting rtdServer and it's * clients. * * SEE ALSO * rtdInitImageEvt(3), rtdSendImageInfo(3), rtdSem(3) *------------------------------------------------------------------------ */ /* * System Headers */ #include #include #include #include #include /* * Local Headers */ #include "rtdSERVER.h" #include "rtdLOG.h" #define DELAY 5 // default time to sleep before new events are read typedef void (*MySigFunc)(int); // prototype cast to keep Sun cc quiet /* * Globals needed for cleanup() after signals */ static int socketFd = 0; static rtdSERVER *mainLoop = NULL; // rtdSERVER object void usage(void) { printf("Usage: rtdServer ?-v -p -s?\n" " -v verbose mode\n" " -p port number, default %d. Set with RTD_SERVER_PORT\n" " -t delay between image events in msec (default %d)\n", RTD_FALLBACK_PORT, DELAY); exit(1); } /* * cleanup resources before terminating. Note that rtdServer does not * create any "global resources" such as shared memory or semaphores. */ void cleanup(int sig=0) { close(socketFd); if (mainLoop != NULL) delete mainLoop; if (sig >= 0) fprintf(stderr, "rtdServer: signal received\n"); exit(0); } int main(int argc, char *argv[]) { extern char *optarg; extern int optind; int portNo = 0; int delay = DELAY; char c; int verbose = 0; /* * rtdServer is a central server for all cameras and RTD's on * a host machine. It only terminates after certain signals, such as * an interrupt from keyboard and signals which cannot be caught. * See the list of signals and their action below. */ // signals which are ignored: //signal(SIGTERM, SIG_IGN); /* VLTSW20070184 */ signal(SIGHUP, SIG_IGN); signal(SIGUSR1, SIG_IGN); signal(SIGUSR2, SIG_IGN); // signals which must terminate rtdServer: signal(SIGINT, (MySigFunc)cleanup); // parse command line options while ((c = getopt(argc, argv, "v:p:t:")) != -1) { #ifndef SYSV char* optopt = argv[optind]; #endif switch(c) { case 'v': verbose = 1; break; case 'p': portNo = atoi(optarg); break; case 't': delay = atoi(optarg); break; case ':': fprintf(stderr,"Option -%s requires an argument\n",(char *)optopt); usage(); case '?': usage(); case 'h': usage(); } } // Check argument parameters if (portNo < 0 || delay < 0) usage(); rtdLOG logs = rtdLOG(verbose); // create log object if (getenv(RTD_SERVER_PORT) != NULL) portNo = atoi(getenv(RTD_SERVER_PORT)); if (rtdInitServer(&socketFd, portNo, NULL) == RTD_ERROR) { fprintf(stderr, "Could not initialize server (maybe it is already running ?)\n" "Now sleeping for 10 seconds to avoid an automatic, immediate restart\n"); sleep(10); exit (1); } logs.log("rtdServer started.\n"); mainLoop = new rtdSERVER(verbose, socketFd, delay); mainLoop->Loop(); cleanup(-1); } skycat-3.1.2-starlink-1b/rtd/tests/000077500000000000000000000000001215713201500170705ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/rtd/tests/all.tcl000066400000000000000000000005531215713201500203470ustar00rootroot00000000000000#!/bin/sh # The next line restarts using tclutil.sh \ exec wish $0 ${1+"$@"} set n 0 foreach testfile [lsort [glob t*.tcl]] { if {"$testfile" != "test.tcl"} { incr n set name [string range [file rootname $testfile] 1 end] pack \ [button .b$n \ -text $name \ -command "exec wish $testfile -geometry +300+300 &"] \ -side top -fill x } } skycat-3.1.2-starlink-1b/rtd/tests/tImageEvent.C000066400000000000000000000115421215713201500214070ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tImageEvent.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tImageEvent.C - simulate a moving star within the ngc1275 image * * tImageEvent is an auxiliary tool to test RtdImagePick with * image events. The image data are read from file ../images/ngc1275.fits * and a rectangular around a star is shifted randomly while image events * are being sent. * * For using it: * o start rtdServer in background * o start rtd * o attach rtd to camera (defined by RTD_CAMERA) * o pick object at 230, 250 * o run tImageEvent and enjoy ... * * who when what * -------------- -------- ---------------------------------------- * pbiereic 14/12/99 Created */ // window size of the rectangular which contains the star #define WINSIZE 50 // start point of the rectangular which contains the star #define XS 200 #define YS 230 // max. shift of the rectangular (+/- MAXSHIFT) #define MAXSHIFT 5 // parameters for ngc1275 #define DFILE "../images/ngc1275.fits" #define TYPE short #define XSIZE 353 #define YSIZE 353 #define NUMBYTE 2 #define DTYPE 16 #define OFFSET 11520 // update rate in msec #define DELAY 2000 #include #include #include #include #include #include #include #include "rtdSem.h" #include "rtdImageEvent.h" extern "C" { void *shmat(int shmid, void *shmaddr, int shmflg); int shmdt(void *shmaddr); } static rtdShm main1; /* * cleanup and exit */ static void cleanup(int i=0) { i=1; sleep(1); rtdShmDelete(&main1); exit(1); } void errexit(char *msg1, char *msg2) { printf("%s %s\n", msg1, msg2); cleanup(); } void copyArrayToImage(TYPE *array, TYPE *image, int xs, int ys) { TYPE *s1, *s2; for (int idx = 0; idx < WINSIZE; idx++) { s1 = array + idx * WINSIZE; s2 = image + (ys - 1 + idx) * XSIZE + xs - 1; memcpy(s2, s1, WINSIZE * NUMBYTE); } } void copyImageToArray(TYPE *image, TYPE *array, int xs, int ys) { TYPE *s1, *s2; for (int idx = 0; idx < WINSIZE; idx++) { s1 = array + idx * WINSIZE; s2 = image + (ys - 1 + idx) * XSIZE + xs - 1; memcpy(s1, s2, WINSIZE * NUMBYTE); } } /* * sleep for some msec. */ void msecSleep(int msec) { timeval t; t.tv_sec = msec / 1000; msec -= t.tv_sec * 1000; t.tv_usec = msec * 1000; select(0, NULL, NULL, NULL, &t); } /* * get a random shift with a size of -MAXSHIFT to +MAXSHIFT */ int getRandomShift() { int random = rand(); double shift, r; r = (double)(RAND_MAX / 2.); shift = ((random - r) / r) * MAXSHIFT; return (int)shift; } /* * Main: */ main(int argc, char** argv) { rtdIMAGE_EVT_HNDL eventHndl; rtdIMAGE_INFO info; // name of camera char* rtd_camera = getenv("RTD_CAMERA"); if (! rtd_camera) errexit("please set the environment RTD_CAMERA first", ""); memset(&info, '\0', sizeof(rtdIMAGE_INFO)); if (rtdInitImageEvt(rtd_camera, &eventHndl, NULL) != 0) errexit("Could not initialize image event: check if rtdServer is running", ""); // clean up shared memory on exit signal(SIGINT, cleanup); signal(SIGTERM, cleanup); signal(SIGHUP, cleanup); // create shared memory area if (rtdShmCreate(1, &main1, XSIZE, YSIZE, DTYPE) == -1) errexit("error creating shared memory", ""); /* * fill image event info */ info.shmId = main1.shmId[0]; info.frameId = 0; info.dataType = DTYPE; info.bytePerPixel = NUMBYTE; info.xPixels = XSIZE; info.yPixels = YSIZE; // attach to shm TYPE *ptrInfo = (TYPE *)shmat(info.shmId, NULL, 0); if (ptrInfo <= NULL) errexit("Unable to attach to shared memory", ""); // get data from FITS file int fd = open(DFILE, O_RDONLY); if (fd < 0) errexit("error opening file", DFILE); if ((read(fd, ptrInfo, OFFSET)) < 0) errexit("error reading file", DFILE); if ((read(fd, ptrInfo, XSIZE * YSIZE * NUMBYTE)) < 0) errexit("error reading file", DFILE); close(fd); // allocate buffers for saving and copying data int arraySize = WINSIZE * WINSIZE * NUMBYTE; TYPE *array = (TYPE *)malloc(arraySize); TYPE *array2 = (TYPE *)malloc(arraySize); // save the rectangular around the star into array copyImageToArray(ptrInfo, array, XS, YS); int xs = XS, ys = YS; for (;;) { ys = YS + getRandomShift(); xs = XS + getRandomShift(); // copy array starting at xs,ys to the area starting at XS, YS copyImageToArray(ptrInfo, array2, xs, ys); copyArrayToImage(array2, ptrInfo, XS, YS); // send image event to rtdServer if (rtdSendImageInfo(&eventHndl, &info, NULL) != 0) errexit("error from rtdSendImageInfo", ""); msecSleep(DELAY); // restore the area starting at XS, YS copyArrayToImage(array, ptrInfo, XS, YS); } // ... and loop exit(0); } skycat-3.1.2-starlink-1b/rtd/tests/tRemote.tcl000077500000000000000000000033701215713201500212210ustar00rootroot00000000000000#!/usr/local/bin/tcl # # tRemote.tcl # # test the remote RTD interface # # open a socket to a running Rtd application and return the file # descriptor for remote commands proc connect_to_rtd {} { global env # get the hostname and port info from the file ~/.rtd-remote, # which is created by rtdimage when the remote subcommand is used if {[catch {set fd [open $env(HOME)/.rtd-remote]} msg]} { puts "can't open ~/.rtd-remote: make sure rtd is running: $msg" exit 1 } lassign [read $fd] pid host port close $fd if {[catch {exec kill -0 $pid} msg]} { puts "could it be that rtd is not running? ($msg)" exit 1 } set fd [server_connect -nobuf $host $port] return $fd } # send the command to rtd and return the results or generate an error proc send_to_rtd {args} { global rtd_fd puts $rtd_fd $args lassign [gets $rtd_fd] status length set result {} if {$length > 0} { set result [read $rtd_fd $length] } if {$status != 0} { error $result } return $result } puts "testing the RTD remote interface..." # open the connection set rtd_fd [connect_to_rtd] # this allows us to use the remote rtdimage as if it were local set image send_to_rtd # send some commands to RTD to be evaluated puts "WCS image center is: [$image wcscenter]" puts "image type: [$image bitpix]" puts "current scale factor: [$image scale]" puts "image dimensions: [$image width] x [$image height] pixels" puts "loading a new file: ngc1316r.fits [$image config -file ngc1316r.fits]" puts "setting cut levels: [$image autocut]" puts "new image dimensions: [$image width] x [$image height] pixels" puts "shared memory Id for image data: [$image shm get data]" puts "shared memory Id for image header: [$image shm get header]" skycat-3.1.2-starlink-1b/rtd/tests/tRtd.C000066400000000000000000000225121215713201500201130ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tRtd.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tRtd.C - test RTD real-time updates by sending image and rapid frame * * * who when what * -------------- -------- ---------------------------------------- * pbiereic 05/02/03 Complete new version which supports all * data types implemented in RTD. */ /************************************************************************ * * DESCRIPTION * tRtd is used as a "test camera" for testing RTD image events. * The options for tRtd can be set either via command line options * or the RTD widget (tRtd.tcl) which is shown when RTD is started with the * "-debug 1" option. * tRtd generates image events at a defined speed (option -t). By default, * it uses semaphore locking to avoid "image jitters" and other (nasty) * side effects which can be seen when the option "-l 0" is set. * tRtd generates the images in a sort of "movie" style, i.e. images continuously * change so that image updates can be seen in the RTD image. A reference * point at the position REF_PIXEL is generated which is used for analysis. * Another point moves continuously across the image. * * All data types which are implemented in RTD are supported (option -D). * Byte swapped images can be generated with option (-E); this allows to * test eg. images which were produced on a Linux-PC and which are transferred * to a HP/Sun machine for display via RTD. * * Three different images can be generated with tRtd: * o a continuously changing image pattern * o a Fits image (eg. ngc1275.fits) with a moving area at the star position * (XS, YS). This image is used for tests with "pick object" * o a rapid frame. The rapid frame is displayed at a higher frequency * than the main image (option "-t" value / 5). * * * The sequence to generate images is: * - Attach to rtdServer. * - Create shared memory area(s). * - Install signal handlers which cleanup the shared memory area(s). * - Create an object which handles data of type dataType. * - Loop start - * - Generate data for the image. * - Wait until the next shared memory buffer is unlocked. * - Copy data to shared memory and lock it. * - Fill the image event info structure. * - Fill the image information fields with semaphore/shm info. * - Send the image information to rtdServer. * - Delay before next event. * - Cycle shm index and goto Loop * * * For the implementation tRtd uses classes since there are two image frames * (main and rapid) and the images can be of any data type supported by RTD. * Class tRtdEvt handles one image event cycle and loads Fits images when * required. * Class tRtdEvtData generates the data type specific classes via tRtdEvtTemplate.icc * and creates an data handling object required for the image. * The Template contains the code for all data type dependent classes, oa. byte * swap simulation (native and non-native) for all data types. * */ #include #include #include #include #include #include #include "error.h" #include "define.h" #include "rtdSem.h" #include "tRtd.h" #include "tRtdEvt.h" extern char *optarg; // structures for multibuffering/semaphore convenience routines static rtdShm shmMain; static rtdShm shmRapid; // the "big" data buffer static char data[MAX_NX * MAX_NY * 4]; /* * Main: */ int main(int argc, char** argv) { rtdIMAGE_EVT_HNDL eventHndl; // image event handle struct opts opt; // structure holding the options tRtdEvt *mainObj; // object which handles the main frame tRtdEvt *rapidObj; // object which handles the rapid frame ZERO(eventHndl); parseInput(argc, argv, &opt); // parse the user's input if (opt.verbose && ! opt.useFits) // print arguments usage(&opt); set_error_handler(&errprint); // error handler (see rtd/tclutil/util/src/error.C) if (rtdInitImageEvt(opt.rtd_camera, &eventHndl, NULL) != 0) { errexit("Could not initialize image event: check if rtdServer is running"); } // clean up shared memory on exit signal(SIGINT, cleanup); signal(SIGTERM, cleanup); signal(SIGHUP, cleanup); // create the object which handles the main image mainObj = new tRtdEvt((char *)"Main", &shmMain, (char *)&data, &opt, opt.main_width, opt.main_height, 0); // create the object which handles the rapid frame if (opt.rapid_id != 0 && ! opt.useFits) rapidObj = new tRtdEvt((char *)"Rapid", &shmRapid, (char *)&data, &opt, opt.rapid_width, opt.rapid_height, opt.rapid_id); // Loop until tRtdEvt gets aborted by the user while ( 1 ) { rtdSleep(opt.delay); mainObj->start(&eventHndl); if (opt.rapid_id == 0 || opt.useFits) continue; for (int i = 0; i < RAPIDS; i++) { rapidObj->start(&eventHndl); rtdSleep(opt.delay / RAPIDS); } } // -- end while( 1 ) return 0; } /* * cleanup and exit */ void cleanup(int i) { rtdShmDelete(&shmMain); rtdShmDelete(&shmRapid); exit(i); } /* * error message handler */ void errprint(const char* buf) { #ifdef DEBUG printf("errprint: %s\n", buf); #endif } /* * print error message and exit */ void errexit(const char* msg1, const char* msg2) { printf("%s %s\n", msg1, msg2); cleanup(1); } /* * print usage */ void usage(opts *opt) { printf("tRtdEvt \n" "\t -v Verbose flag..................(%d)\n" "\t -c Camera name...................(%s)\n" "\t -t Update interval in msecs......(%d)\n" "\t -W Main frame width..............(%d)\n" "\t -H Main frame height.............(%d)\n" "\t -w Rapid frame width.............(%d)\n" "\t -h Rapid frame height............(%d)\n" "\t -x Rapid frame start x...........(%d)\n" "\t -y Rapid frame start y...........(%d)\n" "\t -f Rapid frame Id................(%d)\n" "\t -l Use semaphore locking.........(%d)\n" "\t -b # of shared memory buffers....(%d)\n" "\n" "\t -I FITS image pathname...........(%s)\n" "\t -0 FITS image star center x......(%d)\n" "\t -1 FITS image star center y......(%d)\n" "\t -2 FITS image star bbox..........(%d)\n" "\t -3 FITS image star max. jitter...(%d)\n" "\n" "\t -E Endian flag...................(%d)\n" "\t -D Data type (16 short, -16 ushort, 32 int, -32 float, else byte...(%d)\n", opt->verbose, opt->rtd_camera, opt->delay, opt->main_width, opt->main_height, opt->rapid_width, opt->rapid_height, opt->rapid_x, opt->rapid_y, opt->rapid_id, opt->lock, opt->numShm, opt->fitsFile, opt->starx, opt->stary, opt->starbbox, opt->starjitter, opt->shmEndian, opt->dataType); } /* * parse input */ void parseInput(int argc, char** argv, opts *opt) { /* * set defaults */ opt->rapid_x = opt->rapid_y = opt->verbose = opt->rapid_id = opt->useFits = 0 ; opt->main_width = opt->main_height = opt->rapid_width = opt->rapid_height = 255; opt->shmEndian = -1; opt->delay = 500; opt->rtd_camera = getenv("RTD_CAMERA"); opt->fitsFile = (char *)"../images/ngc1275.fits"; opt->dataType = 16; opt->lock = 1; opt->numShm = 2; opt->starx = 252; opt->stary = 171; opt->starbbox = 50; opt->starjitter = 3; int c; while ((c = getopt(argc, argv, "x:y:w:h:W:H:f:v:c:t:b:l:I:E:D:0:1:2:3:")) != -1) { switch(c) { case 'x': opt->rapid_x = atoi(optarg); break; case 'y': opt->rapid_y = atoi(optarg); break; case 'W': opt->main_width = atoi(optarg); break; case 'H': opt->main_height = atoi(optarg); break; case 'w': opt->rapid_width = atoi(optarg); break; case 'h': opt->rapid_height = atoi(optarg); break; case 'f': opt->rapid_id = atoi(optarg); break; case 'v': opt->verbose = atoi(optarg); break; case 'c': opt->rtd_camera = optarg; break; case 't': opt->delay = atoi(optarg); break; case 'b': opt->numShm = atoi(optarg); break; case 'l': opt->lock = atoi(optarg); break; case 'I': opt->fitsFile = optarg; opt->useFits = 1; break; case 'E': opt->shmEndian = atoi(optarg); break; case 'D': opt->dataType = atoi(optarg); break; case '0': opt->starx = atoi(optarg); break; case '1': opt->stary = atoi(optarg); break; case '2': opt->starbbox = atoi(optarg); break; case '3': opt->starjitter = atoi(optarg); break; default: usage(opt); exit(1); } } // check arguments int dt = opt->dataType; if (dt != 8 && dt != 16 && dt != -16 && dt != 32 && dt != -32) errexit("wrong data type"); if (opt->rapid_x < 0 || opt->rapid_y < 0 || opt->rapid_width < 0 || opt->rapid_height < 0 || opt->main_width <= 0 || opt->main_height <= 0 || opt->rapid_id < 0 || opt->delay < 0 || opt->numShm <= 0) errexit("wrong argument"); // limit ranges opt->main_width = min(opt->main_width, MAX_NX); opt->main_height = min(opt->main_height, MAX_NY); opt->rapid_width = min(opt->rapid_width, MAX_NX); opt->rapid_height = min(opt->rapid_height, MAX_NY); opt->rapid_x = min(opt->rapid_x, MAX_NX); opt->rapid_y = min(opt->rapid_y, MAX_NY); if (! opt->rtd_camera) errexit("please use '... -c camera' or 'setenv RTD_CAMERA ...' first"); } skycat-3.1.2-starlink-1b/rtd/tests/tRtd.h000066400000000000000000000032271215713201500201620ustar00rootroot00000000000000#ifndef tRtd_h #define tRtd_h /* * E.S.O. - VLT project * "@(#) $Id: tRtd.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * tRtd.h - definitions for tRtd * * who when what * -------------- -------- ---------------------------------------- * pbiereic 05/02/03 Created */ #define MAX_NX 1500 // max #of pixels in x #define MAX_NY 1500 // max #of pixels in x // default FITS file (for option -I). #define DFILE "../images/ngc1275.fits" /* struct for command line options */ typedef struct opts { int rapid_x; // rapid frame start x int rapid_y; // rapid frame start y int main_width; // image width int main_height; // main image height int rapid_width; // rapid image width int rapid_height; // rapid image height int rapid_id; // rapid frame id int verbose; // verbose flag char *rtd_camera; // name of camera int delay; // delay between updates int numShm; // number of shm buffers to use int lock; // Flag: use semaphore locking char *fitsFile; // FITS file to use for image updates int starx; // FITS image star center x int stary; // FITS image star center y int starbbox; // FITS image star box length (and width) int starjitter; // FITS image star max. jitter int shmEndian; // native byte order, big or little Endian data int useFits; // use Fits file for generating the image int dataType; // image data type } opts; void errexit(const char* msg1, const char* msg2 = ""); void cleanup(int i=0); void errprint(const char* buf); void usage(opts *opt); void parseInput(int argc, char** argv, opts *opt); #endif /* tRtd_h */ skycat-3.1.2-starlink-1b/rtd/tests/tRtdEndian.tcl000077500000000000000000000261301215713201500216350ustar00rootroot00000000000000#!/bin/sh #\ exec rtdimage_wish "$0" ${1+"$@"} # E.S.O. - VLT project # "@(#) $Id: tRtdEndian.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # tRtdEndian.tcl - automatic test procedure for Rtd byte swap handling # # Test anything which is releated to Big/Little/Native Endian # and this for every data type supported by RTD (with special attention # to float data). # Eg. data are produced by a detector system on a Sparc and transferred # (without byte swap) to a Linux-PC where RTD is running on. # # # who when what # -------------- --------- ---------------------------------------- # P. Biereichel 11/08/99 Created # # -------------------------------------------------------------- # Common procedures # -------------------------------------------------------------- # proc feedback { args } { global debug if {$debug != 0} { puts $args } } proc startRtd {} { feedback "starting rtd ..." return [exec rtd -rtd_geometry -0+0 -attach 1 \ -rtd_title {RTD TEST ** RTD TEST ** RTD TEST} &] } proc connectToRtd {} { global ::rtd_fd while {1} { feedback "connecting to Rtd..." # open the connection set rtd_fd [connect_to_rtd] if {$rtd_fd > 0} { break } sleep 2 } feedback "connected to rtd." } proc sendTclCmd {cmd} { global ::rtd_fd # feedback "sending rtd tcl command: $cmd" set ret [etcl $rtd_fd $cmd] # feedback "received reply: $ret\n" return $ret } proc sendRtdCmd {cmd} { global ::rtd_fd # feedback "sending rtd subimage command: $cmd" set ret [send_to_rtd $rtd_fd $cmd] # feedback "received reply: $ret\n" return $ret } # run tRtd for some seconds and abort it afterwards proc run_tRtd {endian dataType} { set pid [exec tRtd -E $endian -D $dataType -t 200 &] after 2000 kill $pid after 500 } # get min,max values of the reference pixel proc getRefPix { } { set minvalues [sendRtdCmd "get 11 11 image"] set maxvalues [sendRtdCmd "get 11 12 image"] lassign $minvalues x y minvalue lassign $maxvalues x y maxvalue return "$minvalue $maxvalue" } # # -------------------------------------------------------------- # Test procedures # -------------------------------------------------------------- # # # run tRtd check the value of the reference pixel # proc Test1 { text endian dataType minval maxval } { global TestError run_tRtd $endian $dataType lassign [getRefPix] minvalue maxvalue if {$minvalue != $minval || $maxvalue != $maxval} { feedback "FAILED... $text\: Expected values $minval, $maxval .. got .. $minvalue, $maxvalue" set TestError 1 return 1 } feedback "OK... $text\: values at ref. (11,11-12) = $minvalue, $maxvalue" return 0 } # # write shm image to disk, clear image and load shm image from disk. Then test ref. pixel. # proc Test2 { text endian dataType minval maxval } { global TestError fitsfile run_tRtd $endian $dataType sendRtdCmd "dump $fitsfile" sendRtdCmd "clear" after 100 sendRtdCmd "config -file $fitsfile" after 500 lassign [getRefPix] minvalue maxvalue if {$minvalue != $minval || $maxvalue != $maxval} { feedback "FAILED... $text\: Expected values $minval, $maxval .. got .. $minvalue, $maxvalue" set TestError 1 return 1 } feedback "OK... $text\: values at ref. (11,11-12) = $minvalue, $maxvalue" return 0 } # # run tRtd, store bias frame, subtract and check that the # image is zero # proc Test3 { text endian dataType } { global TestError sendRtdCmd "biasimage off" sendRtdCmd "biasimage select 0" run_tRtd $endian $dataType sendRtdCmd "camera pause" sendRtdCmd "update" sendRtdCmd "biasimage copy 0" sendRtdCmd "biasimage on" sendRtdCmd "update" after 100 set val1 [sendRtdCmd "get 10 40 image"] set val2 [sendRtdCmd "get 10 41 image"] sendRtdCmd "camera continue" lassign $val1 x y val1 lassign $val2 x y val2 if {$val1 != 0 || $val2 != 0} { feedback "FAILED... $text\: Expected values 0, 0 .. got .. $val1, $val2" set TestError 1 return 1 } feedback "OK... $text\: image is cleared" return 0 } # # run tRtd, load bias frame from disk, subtract and check the # reference pixels # proc Test4 { text endian dataType1 dataType2 minval1 maxval1 minval2 maxval2 } { global TestError fitsfile sendRtdCmd "biasimage off" run_tRtd $endian $dataType2 sendRtdCmd "dump $fitsfile" sendRtdCmd "update" sendRtdCmd "biasimage file $fitsfile 0" sendRtdCmd "biasimage on" sendRtdCmd "biasimage select 0" run_tRtd $endian $dataType1 lassign [getRefPix] val1 val2 set expmin [expr $minval1 - $minval2] set expmax [expr $maxval1 - $maxval2] # take into account the tcl_precision if {[format "%.6g" $expmin] != $val1 || [format "%.6g" $expmax] != $val2} { feedback "FAILED... $text\: Expected values $expmin, $expmax .. got .. $val1, $val2" set TestError 1 return 1 } feedback "OK... $text" return 0 } # # run tRtd, copy images of different data types to bias images, # generate a main image of type dataType, subtract # # proc Test5 { text endian dataType nr minval1 maxval1 minval2 maxval2} { global TestError Test5Inititialized if {! $Test5Inititialized } { sendRtdCmd "biasimage off" set Test5Inititialized 1 set i 0 foreach type "-32 32 -16 16 8" { run_tRtd $endian $type sendRtdCmd "biasimage copy $i" incr i } sendRtdCmd "biasimage on" } run_tRtd $endian $dataType sendRtdCmd "biasimage select $nr" lassign [getRefPix] val1 val2 set expmin [expr $minval1 - $minval2] set expmax [expr $maxval1 - $maxval2] # take into account the tcl_precision if {[format "%.6g" $expmin] != $val1 || [format "%.6g" $expmax] != $val2} { feedback "FAILED... $text\: Expected values $expmin, $expmax .. got .. $val1, $val2" set TestError 1 return 1 } feedback "OK... $text (bias number $nr)" return 0 } # # -------------------------------------------------------------- # Procedures which call the test programs # -------------------------------------------------------------- # proc callTest1 { } { feedback "\nTest 1: Checking that RTD handles byte-swapped data in shm correctly..." foreach nameTypeype {"Little Endian" "Big Endian" "Native"} endian {1 0 -1} { Test1 "$nameTypeype, Byte Data" $endian 8 0 255 Test1 "$nameTypeype, Short Data" $endian 16 -10000 10000 Test1 "$nameTypeype, UShort Data" $endian -16 0 30000 Test1 "$nameTypeype, Int Data" $endian 32 -100000 100000 Test1 "$nameTypeype, Float Data" $endian -32 -1.E7 1.E7 } } proc callTest2 { } { feedback "\nTest 2: Write shm image to disk, clear image and load shm image from disk. Then test ref. pixel." foreach nameTypeype {"Little Endian" "Big Endian" "Native"} endian {1 0 -1} { Test2 "$nameTypeype, Float Data" $endian -32 -1.E7 1.E7 Test2 "$nameTypeype, Int Data" $endian 32 -100000 100000 Test2 "$nameTypeype, UShort Data" $endian -16 0 30000 Test2 "$nameTypeype, Short Data" $endian 16 -10000 10000 Test2 "$nameTypeype, Byte Data" $endian 8 0 255 } } proc callTest3 { } { feedback "\nTest 3: Generate image, store as bias frame, subtract. Then test that ref. pixel. is zero" foreach nameTypeype {"Little Endian" "Big Endian" "Native"} endian {1 0 -1} { Test3 "$nameTypeype, Byte Data" $endian 8 Test3 "$nameTypeype, Short Data" $endian 16 Test3 "$nameTypeype, UShort Data" $endian -16 Test3 "$nameTypeype, Int Data" $endian 32 Test3 "$nameTypeype, Float Data" $endian -32 } } proc callTest4 { } { feedback "\nTest 4: Generate image, load bias frame from disk, subtract. Then test ref. pixel." foreach nameTypeype {"Little Endian" "Big Endian" "Native"} endian {1 0 -1} { Test4 "$nameTypeype, Float - Float " $endian -32 -32 -1.E7 1.E7 -1.E7 1.E7 Test4 "$nameTypeype, Float - Int " $endian -32 32 -1.E7 1.E7 -100000 100000 Test4 "$nameTypeype, Float - UShort" $endian -32 -16 -1.E7 1.E7 0 30000 Test4 "$nameTypeype, Float - Short " $endian -32 16 -1.E7 1.E7 -10000 10000 Test4 "$nameTypeype, Float - Byte " $endian -32 8 -1.E7 1.E7 0 255 Test4 "$nameTypeype, Int - Int " $endian 32 32 -100000 100000 -100000 100000 Test4 "$nameTypeype, Int - UShort" $endian 32 -16 -100000 100000 0 30000 Test4 "$nameTypeype, Int - Short " $endian 32 16 -100000 100000 -10000 10000 Test4 "$nameTypeype, Int - Byte " $endian 32 8 -100000 100000 0 255 Test4 "$nameTypeype, UShort- UShort" $endian -16 -16 0 30000 0 30000 Test4 "$nameTypeype, UShort- Byte " $endian -16 8 0 30000 0 255 Test4 "$nameTypeype, Short - Short " $endian 16 16 -10000 10000 -10000 10000 Test4 "$nameTypeype, Short - Byte " $endian 16 8 -10000 10000 0 255 Test4 "$nameTypeype, Byte - Byte " $endian 8 8 0 255 0 255 } } proc callTest5 { biasEndianName biasEndian } { feedback "\nTest 5: Test subtraction of different bias frame numbers (bias: $biasEndianName)" sendRtdCmd "biasimage off" set i 0 foreach type "-32 32 -16 16 8" { run_tRtd $biasEndian $type sendRtdCmd "biasimage copy $i" incr i } sendRtdCmd "biasimage on" foreach nameTypeype {"Little Endian" "Big Endian" "Native"} endian {1 0 -1} { Test5 "$nameTypeype, Float Data" $endian -32 0 -1.E7 1.E7 -1.E7 1.E7 Test5 "$nameTypeype, Float Data" $endian -32 1 -1.E7 1.E7 -100000 100000 Test5 "$nameTypeype, Float Data" $endian -32 2 -1.E7 1.E7 0 30000 Test5 "$nameTypeype, Float Data" $endian -32 3 -1.E7 1.E7 -10000 10000 Test5 "$nameTypeype, Float Data" $endian -32 4 -1.E7 1.E7 0 255 Test5 "$nameTypeype, Int Data" $endian 32 1 -100000 100000 -100000 100000 Test5 "$nameTypeype, Int Data" $endian 32 2 -100000 100000 0 30000 Test5 "$nameTypeype, Int Data" $endian 32 3 -100000 100000 -10000 10000 Test5 "$nameTypeype, Int Data" $endian 32 4 -100000 100000 0 255 Test5 "$nameTypeype, UShort Data" $endian -16 2 0 30000 0 30000 Test5 "$nameTypeype, UShort Data" $endian -16 4 0 30000 0 255 Test5 "$nameTypeype, Short Data" $endian 16 3 -10000 10000 -10000 10000 Test5 "$nameTypeype, Short Data" $endian 16 4 -10000 10000 0 255 Test5 "$nameTypeype, Byte Data" $endian 8 4 0 255 0 255 } } # # -------------------------------------------------------------- # "Main" # -------------------------------------------------------------- # lappend auto_path ../library package require Rtd # debug flag for development set debug 0 set rtdPid [startRtd] connectToRtd set TestError 0 set Test5Inititialized 0 set fitsfile /tmp/$env(USER)tRtdEndian.fits callTest1 callTest2 callTest3 callTest4 callTest5 "Little Endian" 1 callTest5 "Big Endian" 0 callTest5 "Native" -1 if {$TestError} { puts "\ntRtdEndian Test FAILED !" } else { feedback "tRtdEndian OK" } catch {kill $rtdPid} catch {exec rm -f $fitsfile"} catch {exec rm -f "$fitsfile.BAK"} exit 0 skycat-3.1.2-starlink-1b/rtd/tests/tRtdEvt.C000066400000000000000000000104431215713201500205720ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tRtdEvt.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tRtdEvt.C - test RTD real-time updates by sending image and rapid frame * * * who when what * -------------- -------- ---------------------------------------- * pbiereic 05/02/03 Created */ /************************************************************************ * * DESCRIPTION * tRtdEvt is class for generating image events (RTD main * or rapid frame) * */ #include #include #include "tRtdEvt.h" /* * constructor */ tRtdEvt::tRtdEvt(char *id, rtdShm *rtdShm, char *data, opts *opt, int width, int height, int frameId) { id_ = id; rtdShm_ = rtdShm; data_ = data; opt_ = opt; width_ = width; height_ = height; frameId_ = frameId; count_ = COUNT_INC+1; countM_ = 0; countMSign_ = 1; index_ = 0; dataType_ = opt->dataType; shmEndian_ = opt->shmEndian; int nbytes; // check if Fits file is specified if (opt->useFits) { fits_ = FitsIO::read(opt->fitsFile); if (fits_ == NULL) errexit("cannot open file"); shmEndian_ = 0; // get parameters from image dataType_ = fits_->bitpix(); width_ = fits_->width(); height_ = fits_->height(); nbytes = width_ * height_ * abs(dataType_ / 8); if (nbytes > MAX_NX * MAX_NY * 4) errexit("not enough memory allocated"); if (width_ < 3 || height_ < 3) errexit("image too small (HDU?)"); memcpy(data_, (char *)fits_->data().ptr(), nbytes); delete fits_; } // create main shared memory area if (rtdShmCreate(opt->numShm, rtdShm, width_, height_, dataType_) == -1) errexit("error creating shared memory"); // create an object of type dataType dataObj_ = DataObj_.makeImage(width_, height_, rtdShm, dataType_, shmEndian_); if (opt->useFits) dataObj_->initArea(data_, opt->starx - opt->starbbox/2, opt->stary - opt->starbbox/2, opt->starbbox, width_, height_); } tRtdEvt::~tRtdEvt() {}; void tRtdEvt::start(rtdIMAGE_EVT_HNDL *eventHndl) { if (! opt_->useFits) { dataObj_->genImage(data_, width_, height_, count_); } else { dataObj_->jitterArea(opt_->starjitter); } while (rtdShmFill(index_, data_, rtdShm_, 0) == -1) rtdSleep((int)LOCK_DELAY); int cnt = count_ + countMSign_ * COUNT_INC; if (cnt >= width_ || cnt <= COUNT_INC) countMSign_ = -countMSign_; count_ = count_ + countMSign_ * COUNT_INC; fillImageInfo(); if (rtdShmStruct(index_, &imageInfo_, rtdShm_) == -1) errexit("rtdShmStruct failed"); if ( ! opt_->lock) rtdSemReset(imageInfo_.semId, index_); printImageInfo(++countM_); if (rtdSendImageInfo(eventHndl, &imageInfo_, NULL) == RTD_ERROR) errexit("rtdSendImageInfo failed"); if (opt_->useFits) dataObj_->restoreArea(); index_ = (index_ + 1) % opt_->numShm; } /* * print image event info */ void tRtdEvt::printImageInfo(int count) { if (! opt_->verbose) return; printf("update #%d %s frame: frameId=%d, %dx%d+%d+%d, semId=%d, buffer %d(%d)\n", count, id_, imageInfo_.frameId, imageInfo_.xPixels, imageInfo_.yPixels, imageInfo_.frameX, imageInfo_.frameY, imageInfo_.semId, imageInfo_.shmNum + 1, opt_->numShm); } /* * fill image event info structure */ void tRtdEvt::fillImageInfo() { // clear info in rtdIMAGE_INFO ZERO(imageInfo_); imageInfo_.dataType = dataType_; imageInfo_.frameX = 0; imageInfo_.frameY = 0; imageInfo_.xPixels = width_; imageInfo_.yPixels = height_; imageInfo_.frameId = frameId_; imageInfo_.shmEndian = shmEndian_; // add some dummy world coordinates for testing imageInfo_.ra = 49.951; imageInfo_.dec = 41.5117; imageInfo_.secpix = 1.70127; imageInfo_.xrefpix = width_/2.0; imageInfo_.yrefpix = height_/2.0 ; imageInfo_.rotate = double(count_ % 360); imageInfo_.equinox = 2000; imageInfo_.epoch = 1957.97; strcpy(imageInfo_.proj, "-TAN"); #ifdef DEBUG // add some dummy detector information if (frameId == 0) { imageInfo_.startX = count_; imageInfo_.startY = count_; imageInfo_.binningX = 2; imageInfo_.binningY = 2; imageInfo_.lowCut = 0; imageInfo_.highCut = 100; } #endif } skycat-3.1.2-starlink-1b/rtd/tests/tRtdEvt.h000066400000000000000000000032271215713201500206410ustar00rootroot00000000000000#ifndef tRtdEvt_h #define tRtdEvt_h /* * E.S.O. - VLT project * "@(#) $Id: tRtdEvt.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * tRtdEvt.h - definitions for tRtdEvt * * who when what * -------------- -------- ---------------------------------------- * pbiereic 05/02/03 Created */ #include "Fits_IO.h" #include "rtdSem.h" #include "tRtd.h" #include "rtdSem.h" #include "rtdImageEvent.h" #include "tRtdEvtData.h" #define LOCK_DELAY 50 // delay when all shm buffers are locked (in msec) #define RAPIDS 5 // number of rapid frames displayed before main image #define ZERO(x) memset((void *)(&x), '\0', sizeof(x)) class tRtdEvt { public: // public member functions tRtdEvt(char *id, rtdShm *rtdShm, char *data, opts *opt, int width, int height, int frameId); ~tRtdEvt(); void start(rtdIMAGE_EVT_HNDL *eventHndl); private: char *id_; // id, e.g "Main" or "rapid" rtdShm *rtdShm_; // rtdShm struct char *data_; // ptr to static ("big") data buffer opts *opt_; // tRtd options struct int width_; // image width int height_; // image height int frameId_; // frame Id (eg. 0=main, 1=rapid) int count_; // counter int countM_; // counter int countMSign_; // counter sign void fillImageInfo(); void printImageInfo(int count); rtdIMAGE_INFO imageInfo_; // image info structure tRtdEvtData DataObj_; // data object tRtdEvtData *dataObj_; // data handling object int index_; // index for shared memory buffer FitsIO *fits_; // FITS I/O object int dataType_; // data type int shmEndian_; // shmEndian }; #endif /* tRtdEvt_h */ skycat-3.1.2-starlink-1b/rtd/tests/tRtdEvtData.C000066400000000000000000000075471215713201500213770ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tRtdEvtData.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tRtdEvtData.C - data class for tRtd * * * who when what * -------------- -------- ---------------------------------------- * pbiereic 05/02/03 Created */ /************************************************************************ * * DESCRIPTION * class tRtdEvtData contains methods for handling classes of different * data types. * */ #include "tRtdEvt.h" #include "tRtdEvtData.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" /* * ----------------------------------------------------------- * Include the Template code for each supported data type * ----------------------------------------------------------- */ /* * data classes which need byte swap. */ #define DATA_TYPE unsigned char #define CLASS_NAME ByteSubs #define SWAP(x) x #include "tRtdEvtTemplate.icc" #undef DATA_TYPE #undef CLASS_NAME #undef SWAP #define DATA_TYPE short #define CLASS_NAME ShortSubs #define SWAP(x) SWAP16(x) #include "tRtdEvtTemplate.icc" #undef DATA_TYPE #undef CLASS_NAME #undef SWAP #define DATA_TYPE unsigned short #define CLASS_NAME UShortSubs #define SWAP(x) SWAP16(x) #include "tRtdEvtTemplate.icc" #undef DATA_TYPE #undef CLASS_NAME #undef SWAP #define DATA_TYPE int #define CLASS_NAME IntSubs #define SWAP(x) SWAP32(x) #include "tRtdEvtTemplate.icc" #undef DATA_TYPE #undef CLASS_NAME #undef SWAP #define DATA_TYPE float #define CLASS_NAME FloatSubs #define SWAP(x) SWAP_FLOAT(x) #include "tRtdEvtTemplate.icc" #undef DATA_TYPE #undef CLASS_NAME #undef SWAP /* * data classes which do not need byte swap. */ #define SWAP(x) x #define DATA_TYPE short #define CLASS_NAME NativeShortSubs #include "tRtdEvtTemplate.icc" #undef DATA_TYPE #undef CLASS_NAME #define DATA_TYPE unsigned short #define CLASS_NAME NativeUShortSubs #include "tRtdEvtTemplate.icc" #undef DATA_TYPE #undef CLASS_NAME #define DATA_TYPE int #define CLASS_NAME NativeIntSubs #include "tRtdEvtTemplate.icc" #undef DATA_TYPE #undef CLASS_NAME #define DATA_TYPE float #define CLASS_NAME NativeFloatSubs #include "tRtdEvtTemplate.icc" #undef DATA_TYPE #undef CLASS_NAME #undef SWAP /* * ----------------------------------------------------------- * Class tRtdEvtData * ----------------------------------------------------------- */ /* * constructor */ tRtdEvtData::tRtdEvtData() : ref_pixel_(11), ref_size_(3) {}; /* * create and initialize the objects which handle data of type dataType */ tRtdEvtData* tRtdEvtData::makeImage(int width, int height, rtdShm *shm, int dataType, int shmEndian) { tRtdEvtData *obj; // data type object /* * make the image which handles the data of type dataType. * BIGENDIAN = 1 for Hp/Sun..., 0 for Linux-PC... * shmEndian = 0: produce big endian data, 1: little endian data, -1 native data */ int native = ((BIGENDIAN == ! shmEndian) || (shmEndian == -1)); if (native) { if (dataType == 16) obj = new NativeShortSubs(-10000, 10000); else if (dataType == -16) obj = new NativeUShortSubs(0, 30000); else if (dataType == 32) obj = new NativeIntSubs(-100000, 100000); else if (dataType == -32) obj = new NativeFloatSubs(-1.E7, 1.E7); else obj = new ByteSubs(0, 255); } else { if (dataType == 16) obj = new ShortSubs(-10000, 10000); else if (dataType == -16) obj = new UShortSubs(0, 30000); else if (dataType == 32) obj = new IntSubs(-100000, 100000); else if (dataType == -32) obj = new FloatSubs(-1.E7, 1.E7); else obj = new ByteSubs(0, 255); } return obj; } /* * get a random shift with a size of +/- starjitter */ int tRtdEvtData::getRandomShift(int starjitter) { int random = rand(); double shift, r; r = (double)(RAND_MAX / 2.); shift = ((random - r) / r) * starjitter; return (int)shift; } skycat-3.1.2-starlink-1b/rtd/tests/tRtdEvtData.h000066400000000000000000000026101215713201500214260ustar00rootroot00000000000000#ifndef tRtdEvtData_h #define tRtdEvtData_h /* * E.S.O. - VLT project * "@(#) $Id: tRtdEvtData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * tRtdEvt.h - definitions for tRtdEvtData * * who when what * -------------- -------- ---------------------------------------- * pbiereic 05/02/03 Created */ #include #include "rtdSem.h" #define COUNT_INC 3 // count increment after an image was displayed class tRtdEvtData { public: // public member functions tRtdEvtData(); int getRandomShift(int starjitter); tRtdEvtData* makeImage(int width, int height, rtdShm *shm, int dataType, int shmEndian); virtual void genRef(char *p, int width, int height, int ref) {}; virtual void genImage(char *p, int width, int height, int count) {}; virtual void copyArrayToImage(char *array, char *image, int xs, int ys, int width) {}; virtual void copyImageToArray(char *image, char *array, int xs, int ys, int width) {}; virtual void initArea(char *ptr, int xs, int ys, int winsize, int width, int height) {}; virtual void jitterArea(int starjitter) {}; virtual void restoreArea() {}; int ref_pixel() {return ref_pixel_;}; // center of reference pixel int ref_size() {return ref_size_;}; // size of reference area (must be an odd number) protected: int ref_pixel_; int ref_size_; }; #endif /* tRtdEvtData_h */ skycat-3.1.2-starlink-1b/rtd/tests/tRtdEvtTemplate.icc000066400000000000000000000121471215713201500226450ustar00rootroot00000000000000/* * E.S.O. - VLT project * $Id: tRtdEvtTemplate.icc,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * tRtdEvtTemplate.icc - data type dependent class for tRtd * * * who when what * -------------- -------- ---------------------------------------- * pbiereic 05/02/03 Created */ /************************************************************************ * * DESCRIPTION * Type dependent class for tRtdEvt.C. The routines are included * by tRtdEvtData.C with the following definitions: * * CLASS_NAME - class name * DATA_TYPE - data type (short, float...) * SWAP - bytes swapping routine for non-native byte order * * The definitions are undef'd at the end of this file. */ #include #include #include #include #include "define.h" #include "tRtdEvtData.h" /* * -------------------------------- * Template Class definitions * -------------------------------- */ class CLASS_NAME : tRtdEvtData { friend class tRtdEvtData; public: // public member functions CLASS_NAME(DATA_TYPE valmin, DATA_TYPE valmax); void genRef(char *p, int width, int height, int ref); void genImage(char *p, int width, int height, int count); void copyArrayToImage(char *array, char *image, int xs, int ys, int width); void copyImageToArray(char *image, char *array, int xs, int ys, int width); void initArea(char *ptr, int xs, int ys, int winsize, int width, int height); void jitterArea(int starjitter); void restoreArea(); DATA_TYPE valmin_; DATA_TYPE valmax_; char *array_; char *array2_; char *aptr_; int awinsize_; int awidth_; int aheight_; int axs_; int ays_; }; /* * -------------------------------- * Template Class code * -------------------------------- */ // constructor CLASS_NAME::CLASS_NAME(DATA_TYPE valmin, DATA_TYPE valmax) : valmin_(valmin), valmax_(valmax) {}; /* * generate a reference pixel */ void CLASS_NAME::genRef(char *ptr, int width, int height, int ref) { DATA_TYPE *p = (DATA_TYPE *)ptr; int refPixel = ref_pixel() / 2; // generate a n x n area around the reference pixel if (ref <= refPixel || width < ref + refPixel || height < ref + refPixel) return; ref--; // for indexing for (int k = ref - refPixel; k <= ref + refPixel; k++) for (int i = ref - refPixel; i <= ref + refPixel; i ++) *(p + k * width + i) = (DATA_TYPE)SWAP(valmax_); *(p + ref * width + ref) = (DATA_TYPE)SWAP(valmin_); } /* * generate some dummy image data based on the given count. */ void CLASS_NAME::genImage(char *ptr, int width, int height, int count) { DATA_TYPE *p = (DATA_TYPE *)ptr; DATA_TYPE lineBuffer[MAX_NX * 3]; // generate a line with color values DATA_TYPE *ptmp = lineBuffer; DATA_TYPE v = -width / 2; if (abs(v) != width /2) // for unsigned short v = width / 2; for (int i = 0; i < MAX_NX * 3; i++, v++) *ptmp++ = SWAP(v); for (int k = 0; k < height; k++) { int cnt = (count + COUNT_INC) % width; memcpy(p + k * width, lineBuffer + cnt, width * sizeof(DATA_TYPE)); } // we need some reference pixels for tests genRef(ptr, width, height, ref_pixel()); genRef(ptr, width, height, count); genRef(ptr, width, height, width - count); } void CLASS_NAME::copyArrayToImage(char *ptr1, char *ptr2, int xs, int ys, int width) { DATA_TYPE *array = (DATA_TYPE *)ptr1; DATA_TYPE *image = (DATA_TYPE *)ptr2; DATA_TYPE *s1, *s2; for (int idx = 0; idx < awinsize_; idx++) { s1 = array + idx * awinsize_; s2 = image + (ys - 1 + idx) * width + xs - 1; memcpy(s2, s1, awinsize_ * sizeof(DATA_TYPE)); } } void CLASS_NAME::copyImageToArray(char *ptr1, char *ptr2, int xs, int ys, int width) { DATA_TYPE *image = (DATA_TYPE *)ptr1; DATA_TYPE *array = (DATA_TYPE *)ptr2; DATA_TYPE *s1, *s2; for (int idx = 0; idx < awinsize_; idx++) { s1 = array + idx * awinsize_; s2 = image + (ys - 1 + idx) * width + xs - 1; memcpy(s1, s2, awinsize_ * sizeof(DATA_TYPE)); } } void CLASS_NAME::initArea(char *ptr, int xs, int ys, int awinsize, int width, int height) { awinsize_ = awinsize; axs_ = xs; ays_ = ys; awidth_ = width; aheight_ = height; aptr_ = ptr; // allocate buffers for saving and copying data int arraySize = awinsize * awinsize * sizeof(DATA_TYPE); array_ = (char *)malloc(arraySize); array2_ = (char *)malloc(arraySize); if (array_ == NULL || array2_ == NULL) errexit("not enough memory for malloc()"); // save the rectangular around the star into array copyImageToArray(ptr, array_, xs, ys, width); } void CLASS_NAME::jitterArea(int starjitter) { int y = ays_ + getRandomShift(starjitter); int x = axs_ + getRandomShift(starjitter); // copy array starting at xs,ys to the area starting at XS, YS copyImageToArray(aptr_, array2_, x, y, awidth_); copyArrayToImage(array2_, aptr_, axs_, ays_, awidth_); } void CLASS_NAME::restoreArea() { // restore the area starting at xs, ys copyArrayToImage(array_, aptr_, axs_, ays_, awidth_); } skycat-3.1.2-starlink-1b/rtd/tests/tRtdImage.tcl000077500000000000000000000010061215713201500214540ustar00rootroot00000000000000source test.tcl set w [RtdImage .rtd \ -file ../images/ngc1275.fits \ -canvaswidth 100 -canvasheight 100 \ -scrollbars 1 \ -drag_scroll 1 \ ] pack $w -fill both -expand 1 tkwait visibility $w #puts "getting shared memory id..." #puts "id = [[$w get_image] shm get data]" #[$w component draw] center_window #update #puts "image name: [$w get_image], canvas name: [$w component canvas]" #puts "image cget -file: [[$w get_image] cget -file]" #puts "canvas config: [[$w component canvas] config]" skycat-3.1.2-starlink-1b/rtd/tests/tRtdImageCtrl.tcl000077500000000000000000000012451215713201500223060ustar00rootroot00000000000000source test.tcl set w [RtdImageCtrl .rtd \ -scrollbars 1 \ -drag_scroll 1 \ -with_zoom_window 1 \ -with_pan_window 1 \ -with_colorramp 1 \ -zoom_view_propagate 1 \ -pan_width 180 \ -pan_height 180 \ ] pack $w -fill both -expand 1 update $w config -file ../images/ngc1275.fits #after 2000 [code [$w component pan] config -width 200 -height 200] #after 4000 [code [$w component zoom] config -width 200 -height 200] #[$w component draw] center_window #update #puts "image name: [$w get_image], canvas name: [$w component canvas]" #puts "image cget -file: [[$w get_image] cget -file]" #puts "canvas config: [[$w component canvas] config]" skycat-3.1.2-starlink-1b/rtd/tests/tRtdImageCut.tcl000077500000000000000000000002721215713201500221340ustar00rootroot00000000000000source test.tcl set w [RtdImage .rtd \ -file ../images/ngc1275.fits \ -scrollbars 1 \ -drag_scroll 1 \ ] pack $w -fill both -expand 1 update RtdImageCut $w.cut -image $w skycat-3.1.2-starlink-1b/rtd/tests/tRtdImageGraphics.tcl000077500000000000000000000010011215713201500231300ustar00rootroot00000000000000source test.tcl set w [RtdImage .rtd \ -file ../images/ngc1275.fits \ -canvaswidth 100 -canvasheight 100 \ -scrollbars 1 \ -drag_scroll 1 \ ] pack $w -fill both -expand 1 tkwait visibility $w #puts "getting shared memory id..." #puts "id = [[$w get_image] shm get data]" [$w component draw] center_window update puts "image name: [$w get_image], canvas name: [$w component canvas]" puts "image cget -file: [[$w get_image] cget -file]" puts "canvas config: [[$w component canvas] config]" skycat-3.1.2-starlink-1b/rtd/tests/tRtdImagePick.tcl000077500000000000000000000003061215713201500222650ustar00rootroot00000000000000source test.tcl set w [RtdImage .rtd \ -file ../images/ngc1275.fits \ -scrollbars 1 \ -drag_scroll 1 \ ] pack $w -fill both -expand 1 update RtdImagePick $w.pick -target_image $w skycat-3.1.2-starlink-1b/rtd/tests/tRtdImageSpectrum.tcl000077500000000000000000000007471215713201500232120ustar00rootroot00000000000000proc make_spectrum {line_id x0 y0 x1 y1} { RtdImageSpectrum .rtd.spectrum \ -x0 [expr int($x0)] \ -y0 [expr int($y0)] \ -x1 [expr int($x1)] \ -y1 [expr int($y1)] \ -image .rtd \ -transient 1 \ -line_id $line_id } source test.tcl set w [RtdImage .rtd \ -file ../images/ngc1275.fits \ -scrollbars 1 \ -drag_scroll 1 \ -graphics 1 \ ] pack $w -fill both -expand 1 update .rtd.draw set_drawing_mode line make_spectrum skycat-3.1.2-starlink-1b/rtd/tests/test.tcl000066400000000000000000000011761215713201500205600ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: test.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # test.tcl - tcl defs to set up environment for test scripts # # Usage: source test.tcl # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 08 Apr 97 created proc tkerror {msg} { global errorInfo puts stderr "$errorInfo" tkerror__ "error: $msg" } # for debugging: print all errors on stderr catch {tkerror} rename tkerror tkerror__ #lappend auto_path ../library package require Rtd set tk_strictMotif 1 tk appname Tclutil utilPrintErrors util::setXdefaults skycat-3.1.2-starlink-1b/rtd/tests/trtdRemote.c000066400000000000000000000062331215713201500213710ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * "@(#) $Id: trtdRemote.c,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * trtdRemote.C - test cases for remote interface to the RTD * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 6 Mar 96 Created */ #include #include #include #include #include #include "rtd_remote.h" /* * declare an optional error handler to print out error messages * automatically. */ static void errorHandler(char* msg) { /* this part is just added for the sake of testing */ if (strcmp(rtdRemoteGetError(), msg) != 0) { printf("errorHandler test failed\n"); } printf("trtdRemote: %s\n", msg); } /* * this routine is used for convenience in testing below Send the command * to the rtdimage, then print and return the result. */ static char* send_rtd(char* cmd) { char* result = NULL; int status = rtdRemoteSend(cmd, &result); printf("%s ==> %s: %s\n", cmd, (status ? "FAILED" : "OK"), result); return result; } /* * return a shared memory pointer given the id */ static void* get_shm(int shmId) { void* ptr = shmat(shmId, NULL, 0); if (ptr == NULL || ptr == (void *)-1) { printf("Invalid shared memory id specified: %d", shmId); return NULL; } printf("shmId %d ==> %x\n", shmId, ptr); return ptr; } /* * do some tests on the shared memory from the Rtd image header and data * The arguments should be the shared memory Ids. */ static void test_shm(int data_id, int header_id) { void* data = get_shm(data_id); char* header = (char*)get_shm(header_id); char buf[81]; int i, j, n, w, h, bitpix; char* p; short* rawimage; if (header) { printf("got image header (%d):\n", header_id); p = header; for(i = 0; i < 10; i++) { for (j=0; j<80; j++) { printf("%c", *p++); } printf("\n"); } printf("...\n"); } if (data) { printf("got image data (%d)\n", data_id); /* do something to the data... */ w = atoi(send_rtd("width")); h = atoi(send_rtd("height")); bitpix = atoi(send_rtd("bitpix")); if (bitpix == 16) { printf("modifying 'short' raw data (mult by 2):\n"); rawimage = (short*)data; for(i = 0; i < w; i++) { for (j=0; j

SKYCAT FAQ
FREQUENTLY ASKED QUESTIONS

Return to skycat Main Page


FEATURES
  1. What command-line options does skycat support?
  2. Where can I get the source code for skycat?
  3. Where can I get a binary release of skycat?
  4. How can I add my own catalogs to skycat?
  5. What are the special MORE and PREVIEW catalog columns?
  6. What remote interfaces are there to access skycat?
  7. What commands can I send to skycat with Tk send?
  8. How does the remote socket interface to skycat work?
  9. How can I access skycat images in shared memory?

PROBLEMS
  1. Why do I sometimes get color flashing when using skycat?
  2. skycat uses up all of the colors in my colormap. How do I make it stop?
  3. What does the catalog window take so long to pop up?


What command-line options does skycat support?

In general, the syntax is:
skycat fileName -option value ...
An argument not starting with "-" is taken to be a FITS image file to load. A "-" by itself means: read the FITS file from the standard input. A file with the suffix ".hfits" is taken to be an H-compressed FITS file and is decompressed automatically. A ".gfits" or ".gzfits" suffix indicates that the FITS file is GZIP compressed and a suffix of ".cfits" is assumed to be UNIX compressed. Image formats other than FITS are not currently supported, but will be in a future release.

The following options are supported:

-file FITSfile Specify a FITS file to load. The '-file' part is optional, so you can also simply specify a file name, as described above.
-cat bool If bool is 1, include 'Data-Servers' menu in the menubar (This is the default). The 'Data-Servers' menu gives you access to the ESO/Archive extensions for browsing astronomical catalogs, plotting objects in the image window and getting images over the network from the image servers, such as the Digitized Sky server.
-rtd bool If bool is 1, include the Real-Time menu in the menubar (default is 0). The Real-Time menu gives you access to the VLT Real-Time Display features, such as camera control and rapid frames. To use these features, the rtdServer daemon must be running on the local host. A client application, linked with the Rtd image event library can then send images via shared memory to be displayed in rapid succession.
-port portnum Specify a port number to ue for the remote socket interface. The default is 0, which means choose an unused port. See the RTD User's Guide for a description of the remote socket interface.
-disp_image_icon bool If bool is 1 (default), display a miniature version of the image in the tool's icon window.
-default_cmap cmap Specify the default colormap. This should be one of the names listed in the 'Colors' popup window (default is 'real').
-default_itt itt Specify the default intensity transfer table. This should be one of the names listed in the 'Colors' popup window (default is 'ramp').
-colorramp_height pixels This option can be used to change the height of color bar (the widget at the bottom of the screen displaying the image colors).
-with_colorramp bool If bool is true, display the color bar (default).
-with_zoom_window bool If bool is true, display the zoom window (default).
-with_pan_window bool If bool is true, display the pan window (default).
-dozoom bool If bool is true, turn the zoom window on automatically (default).
-debug bool If bool is true (default: false) turn on debugging features. This also enables the real-time simulation (when the -rtd option was specified).
-verbose bool If bool is true (default: false) display debugging messages at run-time (for debugging).
-display dpy Specify the X server to use.

Arguments which are not switches are interpreted as image files.

Where can I get the source code for skycat?
The software is available as source code for research and other non-profit organizations. If you are interested to obtain the package send us a note.

Where can I get a binary release of skycat?
Single binary versions of skycat are available for Solaris, HP-UX and SunOS. These binaries were built using code borrowed from GNU emacs (unexec) that makes it possible to include interpreted sources and other files in an executable.

How can I add my own catalogs to skycat?
First of all, you should have a look at the skycat config file This file lists the catalogs available by default. You can use a different list by setting the environment variable SKYCAT_CONFIG to a valid URL on an http server. If you want us to add your catalog to the default list, send us an email.
More about catalog servers can be found in the note written by Clive Davenhall (Starlink).

To include your own catalog in skycat, you have to implement a catalog server, and add an entry to the skycat config file for it.

Note that there has been some discussion about standards for catalog servers and the URL syntax used to access them. Please see Astronomical Server URL for more information on that.

A catalog server is called via HTTP as a cgi-bin application. The syntax for the URL is taken from the skycat config file. The URL contains the query parameters, such as RA, DEC, RADIUS, etc. The format of the return value is a tab separated table with column headings separated from data by a dashed line "---".

TableTitle # comments, text, etc... ... ID RA DEC OtherCols ---- ---- ---- --------- someId1 42.331 43.233 etc... ...

skycat expects the first three columns to always be: ID, RA and DEC. The following columns can be anything. RA and DEC should be in degrees, J2000. In the the query arguments, RA and DEC are specified in HH:MM:SS.sss format and the radius in arcmin.

What are the special MORE and PREVIEW catalog columns?
There are two special (optional) catalog column names: MORE and PREVIEW. They are expected to contain a URL in the format M=http://... for MORE and P=http://... for PREVIEW.

The MORE URL should point to an HTML page with more information on the object. skycat passes the URL to netscape for display.

The PREVIEW URL should point to either a FITS image (possibly compressed) of the selected object or a tab table with data to plot as an X,Y graph. The Content-type of the HTTP result is used to determine whether the data is a FITS image or a tab table and whether or not it is compressed. The Astronomical Server URL document mentioned above describes the allowed Mime-type/Content-type values. These have been implemented in skycat.

If the Content-type of the PREVIEW data returned from an HTTP server is recognized as a tab table (text/x-starbase, etc., or even text/plain), it it should be an ASCII tab table with 2 columns. The first column is plotted as X and the second as Y and the column headings are displayed as the X and Y graph labels.

What remote interfaces are there to access skycat?
There are a number of ways to access skycat data or commands from an external process:

  • Tk send, plus a collection of simple Tcl procs defined by Skycat
    (see below and also the comments at end of skycat/interp/library/Skycat.tcl)

  • Remote socket interface
    (see rtd/rtdrmt module for examples)

  • SysV shared memory for image header and data
    (see rtdimage "shm" subcommand)

  • MMAP shared file/memory for image header and data
    (mmap is used by default to read the image files)

  • Rtd real-time interface (rtdServer)

What commands can I send to skycat with Tk send?
If Skycat is compiled with Tk send enabled (you have to edit the Tk Makefile to do this if you compile yourself) there are some simple Tcl procedures defined that can easily be called from another Tk based application:

  • get_catalog_info {}
    - return contents of catalog listing in the format {{selected_row} {{row1} {row2} ...}}

  • display_image {ra dec width height {equinox 2000}}
    - display image from DSS

  • mark_image {ra dec width height}
    - draw a rectangle on the image, return id

  • unmark_image {id}
    - remove the rectangle given by id

  • load_image {filename}
    - load and display an image file

  • pick_object {{cmd ""}}
    - display the "PickObject" dialog window to allow the user to select an object/star and return the info for it in the form: {$x $y $ra $dec $equinox $fwhmX $fwhmY $angle $object $background}

See also the comments at end of source file: cat/tclcat/library/SkyCat.tcl. The PickObject interface is (or will be) described in the man page RtdImagePick(n).

How does the remote socket interface to skycat work?
The remote socket interface is an RTD feature described in the RTD User's Guide, which can be found in the doc directory of the skycat ftp dir.

Basically, what you can do is open a socket connection and send ASCII strings to Skycat (since it is based on the RTD). The port number can be specified on the Skycat command line with the -port num option.

The strings are interpreted as RTD subcommands. The command method is called with the given arguments and the result is returned via socket again. It is similar to Tk send, except that it is more secure (you can only access RTD subcommands) and can easily be used by a C application (or any other language).

The format to send a command is:

command\n (command followed by newline) where command is one of the RTD subcommands (without an instance name). The result read from the socket has the format: status length \n result[length] That is, 2 lines: the first line contains 2 numbers: the command status (0 is OK) and the length of the result. The next line contains the result, which has the given length.

Check out RTD User's Guide and the rtd/rtdrmt directory in the Skycat source tree for examples of how to use the remote interface.

How can I access skycat images in shared memory?
Skycat doesn't put images in sysV shared memory by default, since some systems have a very low default limit on the number of available sysV shared memory areas. However, there are commands (rtdimage subcommands) to tell skycat to use shared memory for the internal FITS image header or data or both. (Note: by default skycat maps the image files using mmap(2).)

  • You can use the -shm_header 1 and -shm_data 1 options when starting skycat, so that shared memory is used automatically.

  • Use the rtdimage subcommand "shm" (also available via the remote socket interface) to tell skycat to use shared memory and to get the shared memory ids.

See the RTD User's Guide for a description of the rtdimage subcommands.

Why do I sometimes get color flashing when using skycat?
If you are running other applications, such as netscape, that use many colors, you may have this problem. Try running netscape with the "-ncols 60" option, to limit the number of colors it uses to 60. You can limit the number of colors skycat uses via the View menu (Colors item).

skycat uses up all of the colors in my colormap. How do I make it stop?
Select Colors... from the skycat View menu. There you can adjust the number of colors skycat uses by moving the slider and pressing the Allocate button.

What does the catalog window take so long to pop up?
When you display the catalog (Data-Server or Image-Server) window for the first time, it reads the skycat configuration file over HTTP for the list of catalogs. You can specify a local configuration file by setting the environment variable SKYCAT_CONFIG to a valid URL (http://... or file:/... for a local file). The default URL is: http://archive.eso.org/skycat/skycat2.0.cfg


Please send questions or comments to abrighto@eso.org.
Copyright © 1996 ESO - European Southern Observatory

Last modified: Thu Aug 6 20:37:07 MEST 1998 skycat-3.1.2-starlink-1b/skycat/htmldoc/skycat-list.html000066400000000000000000000026341215713201500232270ustar00rootroot00000000000000 The SkyCat Tool Mailing List

The SkyCat Tool Mailing List

This mailing list is managed by the majordomo mailing manager. You can include one or more of the following command in a message to the ESO majordomo. Commands should be sent in the BODY of an email message to majordomo@eso.org.

Commands in the "Subject:" line are NOT processed.

If you have any questions or problems, please contact don't hesitate to contact Miguel Albrecht <malbrech@eso.org>

A Hypermail archive is also available.


Last update: Dec 9, 1996 skycat-3.1.2-starlink-1b/skycat/htmldoc/skycat-logo.gif000066400000000000000000000131241215713201500230110ustar00rootroot00000000000000GIF89a;c9k1R{!,;@H#0B 8mB 4T]p 'E a? hPȳt WhڌN`V2q4 $hʩ+x[E[eT$lsV7N%JFmtIP &zni^J>Ks%X~ABqHc~N}j18px¡"6MnȲy| _Wy,^-Sg{'ʻsW[ fC")^DAgB!`Kg'u҇HaXSR%=FsH+3&EN+)Z3!>mFyϜ-uksФ/nڮ:V GE]\8ˑ jOD(u-`ǬWMe1la1>AMf_MQ93$I5ў{%GUlz]!uHUh=0P!N]y!sP-Ԏ;NulZUVvm|^4BBq ɗNdP@hZ(wYwM҉.dX}׋/MyZxojB:[T(@a!РÚ@RiFev*餠z**ȍ"Z:Hjf*X H ɝiʩe6G0,T*hjiRZ~{)ziK,Κ»{j:o.n Sì M`a:T`f%Iq*rDߜ)}ZʒjD#/RR5*ROMO-5@=uINAbA vRڦUD<N}EYTzN4 .ي2`=ʕ!</[%Ҥ"F(-{Q`,Pp4I< $S]L)@ب (3P*ҕiiÛXbs  O*ԈSO#'>Ġ6(RHF|E(%J[¢-&2Ndyuσ(0'7"& #V Ԥ +Ja_JCNLIT g#C ZGqR)BU*IXGhL[[|)]֒a=hi!NnYFg%JtJ/†]ҋ[iN~+`bױN~_' VO`rh*˞OfJ*y;iIO5qtf1!ja#lK2QPhneȅ(ѷAIjbN4\ʸqBo4 ᴒ bTX>|{ii=~f!AT'6ߠE䳶mLZ baULɚ -ݪ-ڪf?CRG>#^yX.mپQXmIj6âs#jhw֫u~;KǸJ`dI)Tu0p iuQmu,*#('W|W3]c[m4TJ,;*Κ:vտu׵6 )66#D\a;K nybh$庾;Ydg>!n'QX79y ,!hH7+ˎ8f4६ [߾,9mq4.:R3V&hB)NVAvȼ5n2 ͸ʐnx~TT4=eSz$uԍ$(</!-Z3^6`gN(&R(LaLn(23кZ* BH/u > ;>VTW$oν!(V9M>03ZcI\nEĒ$!0mEO0Eo.wlUo`Ԁ 5r&7~Zac<~3^w$zcql e51Mz8LΜyPY{E_N2S@ocTiyMm-9zF=Yͩ:P)z@]0҂wH%!߷QNzXdRY Y ~@hG( l z/lhFOKy\ǟq^nEY^UT:5U0scJ51V%?`[(f} DR@6E9E}őyD Z4sWDU#W4U^]c:)VZjQs8T;YɕhcbwUsu*U#WP]9Œ=U.Fb^V TyPS,s\c@9uUc bP9Vc 9fP >6xE d)\Cc=^qcYjg6Sg7^EzYT\8ZK (#_"8?6R2p[љ?jE bY7k0iU!8(<+IpR68)Zu^ tX7*4Sa27ne9s %,p B9jU;*`2#D6_eC7>J8C7HT: ^i^ ]!:4F^ ZU7dU^X_8 Y6nYX$< 04^hrFav5iz03`e]hʅD- ]q3AJ`"a$uiMҨy5]u[wڟ %P\9.qU6<;,lq`bYh1fCA icSnpkDM !4 SDb$&gfJ a;vbI+&QSNYj]j~j:y2ge=ʰݖBe9)XIí 7~VdEBCmcId#&sp@1q%nxiI rY_"I<ꦘRsC A#/"(?; }t iguAZ/7Z52D:uՃlw wdZ\gdokJzA`x7qJV}~ƄK9gtUIk!$jyHVzH<. ±Wjrk*'^er?=wnCN.g D39;24kvSPGe U ´AAel(0J%3񬸹(HENw&[;~52@t/H$D Iҫ[dyw|y#U z(b%I[3&F"oi4cyڠn^'5b :Ʃ* &ZX1pDnXFWr`svk0=!Ӳd~|/~A5dmj,!c^l4HъUVJ|qHvf̟fG]ZN5hAu$sI'&nrBlllUuzp<xQG20G ,i L@5Bav@o$t${Aʄ8&…t,zF$Tkˮsp< mZ0LΓ%ep2sHL΂$"r̖p|=VBKfpbN=!eɬa5fL;ju(mJ=模ytD]vz?|f0kotě=)uAsP4in˜Iѧu}iTbhf"-NeCC{SLDxsK(+NR)؇)y3겇MD.2{(L* N2b?ю6猘xʽB({)Qx7p|>zM-XkHINQ4^AОMdlОУh-Nؤt 5.^ʾN0ᄍS+MҏYtO4:eԈc$NʸឆQ!(/°a- (X}S..N8ECHc,HQ<P #->hOoho>ĈPjNXŒTh4+ONo<] ~O%hO/HTb0){cxxj߅rxXhxBꏨލXo?\bߞ#*;skycat-3.1.2-starlink-1b/skycat/htmldoc/skycat-server.html000066400000000000000000000422031215713201500235560ustar00rootroot00000000000000 SkyCat Server

CCLRC / RUTHERFORD APPLETON LABORATORY
Particle Physics & Astronomy Research Council
Starlink Project

Clive Davenhall
Institute for Astronomy, University of Edinburgh & Starlink
27th October 1996

Notes on Writing an AstroCatalog Server
(DRAFT)
Version 1.0

These notes are an incomplete draft. Queries, asides and things I'm unsure about are shown in a sans serif font like this.

Contents

Introduction

The ESO AstroCatalog library allows applications to access remote databases, catalogues and archives across the internet. It is used by the ESO skycat image display tool and various other applications. In order to make a database accessible to the AstroCatalog library a `server' must be provided for it. This server will accept remote queries sent in a standardised format, interrogate the database and return a table of results corresponding to the objects in the database which satisfied the query. These notes are intended to assist in writing such a server. They should be used in conjunction with listings for one or more existing servers.

The communication between the remote application and the server uses the Hyper-Text Transfer Protocol (HTTP) developed for the World Wide Web. The servers are, strictly speaking, gateways using the Common Gateway Interface (CGI). One way of thinking of the remote application is as a very specialised Web browser. One consequence of this approach is that if a site is to provide an AstroCatalog server it must also be running a Web server. The HTTP and CGI protocols are, of course, enormously flexible and there are additional protocols and conventions for communicating between an AstroCatalog application and server. These protocols and conventions are described in subsequent sections. The format for queries is described in Section 3 and that for the returned results in Section 4.

Though the protocols for communicating between an AstroCatalog application and server are (reasonably) well defined, there are an unlimited number of ways in which a server could be written to accept standard queries and return standard results. Thus, these notes cannot prescribe how a server must be written, but merely suggest some alternatives. An AstroCatalog server is a CGI script and CGI scripts are usually (but not necessarily) written in Perl. For the rest of these notes I shall assume that the server is to be implemented as a Perl script. The entire server could be written in Perl, with the database being accessed directly from the Perl script. However, it is more likely that the Perl script will invoke a Database Management System (DBMS) or special-purpose program to interrogate the database.

This document assumes that you have some familiarity with the AstroCatalog library or, at least, skycat. The AstroCatalog library is documented in Astronomical Catalog Library Interface Specification by Allan Brighton. It also assumes that you are familiar with HTTP, writing CGI scripts and Perl. There are numerous books describing the HTTP and CGI protocols. The HTML Source Book by Ian Graham seems to be a particularly good one. Similarly there are various books on Perl. Learning Perl by Randall Schwartz and Programming Perl by Larry Wall and Randall Schwartz are comprehensive and easy to use.

Accessing a New Server with the AstroCatalog Library

It might seem perverse to describe how to access a new server with the AstroCatalog library before describing how to write the server. However, access to the new server will often be the first thing that you set up, so that you can try it out during development and debugging.

The servers for catalogues, databases and archives are identified to the AstroCatalog library using a syntax of the form:

name@location

where name is an abbreviation for the name of the catalogue and location an abbreviation for the institution where it is held. By convention both name and location are usually quite short. For example:

ppm@eso

is the abbreviation for the version of Bastian and Roeser's accents? Positions and Proper Motion catalogue available at ESO.

A list of all the catalogues, databases and archives which the AstroCatalog library can access is held in a configuration file. You must take a copy of this configuration file, add details for your new server and then instruct your copy of the AstroCatalog library to access this modified file.

By default the AstroCatalog library uses a configuration file kept at ESO. You can retrieve a copy of it from URL:

http://archive.eso.org/skycat/skycat2.0.cfg

To access your own copy of this file you must place it in a directory accessible to your local HTTP server (that is, one which is `visible to the Web'). Then set environment variable SKYCAT_CONFIG to a URL which points to this file.

You must now add an entry for your catalogue to this file. The file is simply a text file which can be modified with a text editor. It contains extensive comments which should be read in conjunction with these notes.

For example, the entry for the PPM catalogue is:

serv_type:      catalog
long_name:      PPM at ESO
short_name:     ppm@eso
url:            http://archive.eso.org/skycat/servers/ppm-server...
symbol:         mag circle 15-$mag

The purposes of the various items are as follows.

serv_type:
The alternatives are: catalog, archive, namesvr or imagesvr. catalog is the simplest and most common option; it used for simple catalogues and tables. A serv_type of catalog is assumed in the rest of these notes. See Section 2 of the Astronomical Catalog Library Interface Specification for a discussion of the alternatives.

long_name:
A name or short (one-line) description of the catalogue. It is intended to be read by humans rather than interpretted by computer.

short_name:
The name used to identify the server to the AstroCatalog library.

url:
The URL used to access the server. Following the usual conventions for a CGI gateway it consists of the directory specification and file name of the server followed by parameters passed to the server to define the query (see Section 3).

symbol:
Defines the plotting symbol to be used; see the comments in the configuration file for details.

symbol is optional; the other items are mandatory.

Finally, if you want your server to become generally available then remember to send either the details or your modified configuration file to the skycat/AstroCatalog library team at ESO.

Query parameters

 

The parameters at the end of the server URL pass values which define the query which objects in the catalogue must satisfy if they are to be selected. The types of queries which are currently supported are mostly concerned with selecting objects within a specified region of sky. The region may be either:

  • `circular' - within a given angular distance of a specified central point,
  • `annular' - within an annulus defined by a minimum and maximum angular distance from a specified central point,
  • `rectangular' - within a region bounded by specified great circles of Right Ascension and parallels of Declination.

The query parameters are as follows.

%ra
Right Ascension of the central position specified as sexagesimal hours check in J2000 coordinates.

%dec
Declination of the central position specified as sexagesimal degrees in J2000 coordinates.

%r1
The minimum radius for an annular query, in minutes of arc. For a circular query it should be set 0.0.

%r2
The maximum radius for an annular query or the radius for a circular query, in minutes of arc.

%w
The width or Right Ascension range of a rectangular query, in minutes of arc.

%h
The height or Declination range of a rectangular query, in minutes of arc.

%m1
The minimum (brightest) magnitude for an object to be selected,

%m2
The maximum (faintest) magnitude for an object to be selected,

%n
The maximum number of objects to be selected.

%cols
A list of columns to return. The list comprises a set of column names separated by commas, for example:

col1,col2,...coln

%id
ID field of item to return (if supported).

%mime-type
Value for HTTP mime-type field.

It is not always necessary (or possible) for a server to support all sorts of queries. For example, the minimum and maximum magnitude has no meaning in the case of the UK Schmidt Plate Catalogue.

Example

The query parameters to select objects within 120 minutes of arc of 10:00:00, +30:00:00 in the PPM catalogue was:

http://archive.eso.org/skycat/servers/ppm-server
 ?ra=10:00:0.00&dec=+30:00:0.00&radius=120&nout=101

Generalised queries

The query parameters used by the AstroCatalog library are special cases of a proposed general format for exchanging information between remote astronomical information services. A working document describing this proposal is available at URL:

http://archive.eso.org/~amicol/asu_94.html

Note that there seem to be differences between the query parameters currently implemented and the proposal.

Tab-separated list

 

The server must return the list of selected objects as a tab-separated list. The tab-separted list format is described in Section 2.3 of Astronomical Catalog Library Interface Specification. Briefly, it is a file or other stream of bytes, in which the values for individual fields in the list are separated by a tab character (ASCII character 9). A file in tab-separated list format can be modified with a text editor. The details of the format are as follows.

  1. The first line of a tab-separated list must be a header. Usually this header will be:

    Content-type: text/plain
  2. The next line gives the names of all the columns in the list, separated by tabs.
  3. The following line is a list of dashes (and tabs) which indicate that the table of values will follow immediately.
  4. The table follows, with one row (or object) per line.
  5. Within each line the fields corresponding to each column occur in the same order as the column names (given in 2 above) and are separated by tabs.
  6. The following two additional constraints apply:
    • the first column must be a name or identifier,
    • the second and third columns must be respectively be the Right Ascension and Declination in decimal degrees and J2000 coordinates.

The optional special columns MORE and PREVIEW can be used within information and image servers (see Section ???)

Example

A tab-separated list corresponding to a some columns in a subset of the PPM catalogue is listed below.

Content-type: text/plain

Id      ra      dec     mag
--      --      ---     ---
+29 1956        148.028620833333        29.2643666666667        9.2
+31 2059        148.081295833333        30.3859694444444        9.5
+29 1958p       148.092170833333        28.5661469444444        9.8
+32 1947        148.121254166667        31.5426083333333        8.6
+29 1959        148.179058333333        29.0041111111111        9.6

Hints

  1. When developing a server it is often useful to see the query that has been sent by the remote application. If you are using skycat as the remote application then the last query sent to the server is included in the skycat log, which is file:

    ~/.skycat/log

    If you are using some application of your own rather than skycat then the AstroCatalog library is easily modified to echo the query when it sends it. Proceed as follows.

    1. Locate and edit file AstroCatalog.C.
    2. Locate the lines:

      // send the query
      result_buf = http_.get(buf, nlines);
    3. Print out the value of buf by inserting something like:

      cout << buf << endl;

      between these two lines.

    4. Regenerate the execution module for your application.

  2. Special columns MORE and PREVIEW.
  3. plus others?

Related Documents

Specific references

  • The AstroCatalog library is documented in Astronomical Catalog Library Interface Specification, issue 2.1 by Allan Brighton, 26/6/96, ESO Very Large Telescope Data Management Division, document number GEN-SPE-ESO-0-0949.
  • The proposals for a format for the exchange of information between remote astronomical data services are described in Astronomical Server URL by Miguel Albrecht et al. It is available at URL:

    http://archive.eso.org/~amicol/asu_94.html

General references

There are numerous books about the HTTP and CGI protocols and the Perl language. I have found the following useful, though they are not necessarily the best. They are included for completeness.

The HTML Sourcebook
by Ian S. Graham, 1995 (John Wiley and Sons: New York).

Learning Perl
by Randal L. Schwartz, 1993 (O'Reilly and Associates Inc: Sebastopol, California). An introductory text for learning the language.

Programming Perl
by Larry Wall and Randal L. Schwartz, 1991 (O'Reilly and Associates Inc: Sebastopol, California). A reference manual.



ESO Archive
Mon Jun 2 11:27:07 MET DST 1997
skycat-3.1.2-starlink-1b/skycat/htmldoc/skycat.cfg000066400000000000000000000171271215713201500220540ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: skycat.cfg,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # -------------------------------------------------------------------- # skycat.cfg - config file for Astronomical Catalogs # # This file is read via http by the skycat software to get # the necessary information about the available catalogs. # # The syntax for each catalog entry is: # # serv_type: service type, one of: catalog, namesvr, imagesvr # (see Service Types below) # # long_name: long name of service for displaying # short_name: short name of service # url: URL used to access catalog, %ra,%dec, etc. expanded (see below) # # symbol: the symbol to use to plot the given column value # (see Plotting below) # copyright: any copyright notice applicable to this service # # Service Types #--------------- # # The valid service types are: # # catalog - server returns a tab separated table of row/col values # archive where the headings are followed by a dashed line # # namesvr - same as catalog or archive, except server returns a single # object with id, ra and dec to resolve the given object name # # imagesvr - server returns an image file # # # Syntax for "url" field: # -------------------------- # # The url field is used to build a URL to get the results via HTTP. # The syntax is like this: # # http://host:port/cgi-bin/server?arg1&arg2&...argn # # (if ":port" is missing, it defaults to 80.) # # Substitutions are performed on the URL as follows: # # %ra, %dec - coordinates of center point # # %w, %h - width and height in arcmin around center point # # %r1, %r2 - min and max radius (for circular query) # # %m1, %m2 - min and max magnitude # # %n - max number of rows to return # # %cols - list of columns to return (col1,col2,...coln) # # %id - ID field of item to return (if supported) # # %mime-type - value for http mime-type field # # Name servers only need the %id field, which is set to the object name. # # Plotting column values # ---------------------- # # The syntax for the "symbol:" field is as follows: # # symbol: col-name symbol expr : col-name symbol expr : ... # # where # col-name - is the name of the column to plot # # symbol - is the symbol to use, one of: # square, circle, triangle, cross, plus, diamond # # expr - is an expression in terms of the column used to # determine the size of the symbol at standard # magnification. The column name can be used as a # variable in the expression using "$". # example: # symbol: mag circle 15-$mag : xyz square (1-$xyz)*2.5 # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 11 Oct 95 created # M.Naumann 24 Jul 96 Updated URLs for catalog servers at the ESO # Science Archive (archive.eso.org and cgi-bin) # -- catalogs -- # GSC serv_type: catalog long_name: Guide Star Catalog at ESO short_name: gsc@eso #url: http://archive.eso.org/skycat/servers/gsc-server?%ra%dec&obj=%id&r=%r1,%r2&m=%m1,%m2&n=%n&f=8&s=R&F=* url: http://archive.eso.org/skycat/servers/gsc-server?%ra%dec&r=%r1,%r2&m=%m1,%m2&n=%n&f=8&s=R&F=* symbol: mag square 15-$mag serv_type: archive long_name: HST Archive at CADC short_name: hst@cadc url: http://cadcwww.dao.nrc.ca/cadcbin/hst-server?ra=%ra&dec=%dec&radius=%r2&nout=%n symbol: ra plus 2 copyright: Preview data provided courtesy of CADC/DAO/NRC serv_type: archive long_name: CFHT Archive at CADC short_name: cfht@cadc url: http://cadcwww.dao.nrc.ca/cadcbin/cfht-server?ra=%ra&dec=%dec&radius=%r2&nout=%n symbol: ra plus 3 copyright: Preview data provided courtesy of CADC/DAO/NRC serv_type: archive long_name: NTT Archive at ESO short_name: ntt@eso url: http://archive.eso.org/skycat/servers/ntt-server?ra=%ra&dec=%dec&radius=%r2&nout=%n symbol: ra plus 4 serv_type: catalog long_name: SAO at CADC short_name: sao@cadc url: http://cadcwww.dao.nrc.ca/cadcbin/sao-server?ra=%ra&dec=%dec&radius=%r2&nout=%n symbol: {V MAGNITUDE} circle {15-${V MAGNITUDE}/100.0} serv_type: catalog long_name: PPM at ESO short_name: ppm@eso url: http://archive.eso.org/skycat/servers/ppm-server?ra=%ra&dec=%dec&radius=%r2&nout=%n&mime=skycat symbol: mag circle 15-$mag serv_type: catalog long_name: PPM1 at ESO short_name: ppm1@eso url: http://archive.eso.org:8123/general-server/bin/general-server-V0.2?-source=ppm&-c.ra=%ra&-c.dec=%dec&-c.bm=%r2&-out.max=%n&-mime=skycat symbol: VMag circle 15-$VMag serv_type: archive long_name: HST Archive at ESO/ECF short_name: hst@eso url: http://archive.eso.org:8123/general-server/bin/general-server-V0.6?-source=hstscience&-c.ra=%ra&-c.dec=%dec&-c.bm=%r2&-out.max=%n&-mime=skycat&-pv_type_i=HFITS&-pv_type_s=ASCII symbol: RA plus 3 copyright: Preview data provided courtesy of CADC/DAO/NRC serv_type: catalog long_name: IRAS PSC at ESO short_name: iras_psc@eso url: http://archive.eso.org/skycat/servers/iras-server?ra=%ra&dec=%dec&radius=%r2&nout=%n symbol: ra triangle 2 serv_type: catalog long_name: ZCAT at CADC short_name: zcat@cadc url: http://cadcwww.dao.nrc.ca/cadcbin/zcat-server?ra=%ra&dec=%dec&radius=%r2&nout=%n symbol: VHELIO cross $VHELIO/100.0 serv_type: catalog long_name: QSO at CADC short_name: qso@cadc url: http://cadcwww.dao.nrc.ca/cadcbin/qso-server?ra=%ra&dec=%dec&radius=%r2&nout=%n symbol: REDSHIFT diamond 5-$REDSHIFT serv_type: catalog long_name: RC3 at CADC short_name: rc3@cadc url: http://cadcwww.dao.nrc.ca/cadcbin/rc3-server?ra=%ra&dec=%dec&radius=%r2&nout=%n symbol: ra square 3 serv_type: catalog long_name: ABELL at CADC short_name: abell@cadc url: http://cadcwww.dao.nrc.ca/cadcbin/abell-server?ra=%ra&dec=%dec&radius=%r2&nout=%n symbol: ra square 3 serv_type: catalog long_name: SIMBAD short_name: simbad@eso url: http://archive.eso.org/skycat/servers/sim-server?%ra%dec&r=%r2&n=%n symbol: mv circle 15-$mv : mb circle 15-$mb copyright: Provided by courtesy of CDS serv_type: namesvr long_name: SIMBAD Names short_name: simbad_ns@eso url: http://archive.eso.org/skycat/servers/sim-server?&o=%id serv_type: catalog long_name: NED short_name: ned@eso url: http://archive.eso.org/skycat/servers/ned-server?%ra%dec&r=%r2&n=%n symbol: Obj-Type square 2 copyright: Provided by courtesy of NASA/IPAC serv_type: catalog long_name: USNO at ESO short_name: usno@eso url: http://archive.eso.org/skycat/servers/usnoa-server?%ra%dec&radius=%r1,%r2&mag=%m1,%m2&format=8&sort=mr symbol: mag circle 15-$mag copyright: Provided by courtesy of the US Naval Observatory serv_type: namesvr long_name: NED Names short_name: ned_ns@eso url: http://archive.eso.org/skycat/servers/ned-server?&o=%id # -- image servers -- # DSS serv_type: imagesvr long_name: Digitized Sky at ESO short_name: dss@eso url: http://archive.eso.org/dss/dss?ra=%ra&dec=%dec&mime-type=%mime-type&x=%w&y=%h copyright: Digitized Sky Survey (c) by AURA, provided online by ESO # UKST serv_type: catalog long_name: UK Schmidt Plate Catalogue short_name: ukst@roe url: http://www.roe.ac.uk/cgi-bin/ukstsrv.wrap?%ra%dec&r=%r1,%r2&m=%m1,%m2&n=%n&f=8&s=R&F=* copyright: Provided by courtesy of ROE skycat-3.1.2-starlink-1b/skycat/htmldoc/skycat.html000066400000000000000000000253021215713201500222530ustar00rootroot00000000000000 the ESO SkyCat Tool  [the ESO SkyCat tool logo]

SkyCat is a tool that combines visualization of images and access to catalogs and archive data for astronomy.

See the SkyCat FAQ and the SkyCat Programmer's Manual for more information.

You can download the latest Skycat version here.

SkyCat features

  • Display FITS images, with support for the World Coordinate System (WCS), interactive measurement of offsets, and other standard visualization functions (SAOimage-like).

  • Overlay and edit color graphic objects on the image, `tagging' sources with text, arrows, circles, or other graphic elements.

  • Display a compass indicating where north and east are in the image, based on the world coordinates information.

  • PostScript color printing of the display (image + graphics).

  • Access and load images from network image servers, such as the Digitized Sky Survey (DSS).

  • Select previously viewed images from a history menu and catalog. The cut levels, color scale algorithm and colormap settings are remembered for each image.

  • Access and load catalog information from a number of popular astronomical catalogs, such as the HST Guide Star Catalog and many others.

  • Create, search and edit local user catalogs.

  • Save catalog data locally.

  • Overlay catalog sources on an image, taking object size and orientation into account.

  • Interact with Netscape to display more object information when available

  • Access the observations catalog from the NTT, HST and CFHT Science Archives.

  • Access to SIMBAD and NED both as name resolvers as well as for information on known objects.

  • Retrieve preview and other compressed images and decompress them on the fly.

  • Retrieve and plot tabular preview data for a selected object as an X/Y graph.

  • Calculate, display and plot the center position, FWHM, angle and other information for a selected star/object.

  • Load and save compressed images in hcompress, gzip or UNIX compress format.

  • Access SkyCat features from a remote process via socket interface or Tk "send".

  • Access image header and data (FITS format) via SysV shared memory or mmap.

  • Interact with WWW browser to access catalog documentation and other documents.

  • Support for dynamically loaded skycat plugins, such as the GAIA plugin, that add new features or modify existing ones.

  • Load lists of catalogs from other sites (ESO, CADC, CDS, local) and and allow users to select a preferred default catalog list.

Things we are working on

  • Save canvas graphics as a fits extension on the image file.

  • User customizable symbols to "label" objects on the canvas.

  • Add a user preferences dialog.

  • Add or edit WCS parameters for a given image.

  • Add support for 16 and 24 bit color currently requires that the display support an 8-bit pseudocolor X visual).

Caveats

  • Astrometry: SkyCat handles the astrometric positions by translating pixel positions into equatorial coordinates (RA, DEC). This translation is based on WCS (World Coordinate System) FITS keywords that are included in the image header and that give the astrometric solution for the image. The accuracy of the solution varies because, in many cases, an approximation is used.

  • Colors: If you are running netscape or some other color intensive applications before you start SkyCat, you may get some color flashing when you move the mouse in and out of the SkyCat image window. This is because SkyCat is using a private colormap to get enough colors to display the image. You can get around this problem by starting netscape with the "-ncols" option: for example:
          netscape -ncols 60 &.
    	
    You can also control how many colors SkyCat uses via the color dialog in the View menu.

About the software

SkyCat was developed by ESO's Data Management and Very Large Telescope (VLT) Project divisions with contributions from the Canadian Astronomical Data Center (CADC).

The tool was originally conceived as a demo of the capabilities of the class library that we are developing for the VLT.

The Skycat sources currently consist of five packages:

  • Tclutil - Generic Tcl and C++ utilities

  • Astrotcl - Astronomical Tcl and C++ utilities

  • RTD - Real-time Display classes and widgets (see The Messenger, 81, 1995)

  • Catlib - Catalog library and widgets

  • Skycat - Skycat application and library package
You can get the sources from the skycat ftp directory. All of the required packages are always included in the tarfile.

Java vs Tcl/Tk

Some users might wonder why we did this development in the Tcl/Tk environment rather than in Java. The main reason was the pragmatic need to get the functionality implemented in time for the VLT to come on-line (mid 1998). However, great care has been taken to develop as much as possible with object oriented languages (C++, [incr Tcl]), having in mind that the future lies in tele-scripting rather in the distribution of binary code.

SkyCat mailing list

A mailing list has been setup to support a wide collaboration on the SkyCat/RTD/CatLib project. Many people have shown interest in participating in such a venture. You can sign up with that list here. A hypermail archive is also available.

Distribution and support

The SkyCat binaries are freely available to any users who want to download and use the software at their own risk. Users who wish to modify the source code should contact malbrech@eso.org.

SkyCat is available as an executable for these platforms:

Solaris (SunOS-5.5.1)
HP-UX-10.20
Linux

ESO will maintain the Sun Solaris and HP versions in the longer term. They are the platforms on which VLT software will run. ESO does not have the resources to port to and maintain SkyCat on any other platforms. We will be glad to redistribute any port that other people or groups may support but decline any responsibility for them.

The software is available as source code for research and other non-profit organizations. If you are interested to obtain the package send us a note.

Please report problems or send suggestions to malbrech@eso.org or to abrighto@eso.org

Acknowledgments

We very much appreciated practicing wishful programming at large, i.e. wishing a utility, a function or just a code fragment that would just do that bit you badly need, then surfing the net, fetching it and re-using it in our code. Here is an incomplete list of packages that we either partially re-used or gave a source of inspiration.

  • STARCAT contributed many of its internals.

  • Tcl/Tk, TclX, BLT, Tix, ET and Itcl give the glue around the C++ classes, Tk provides the canvas graphics.

  • SAOimage lent the WCS lib (now a separate package, provided by courtesy of Doug Mink).

  • GSC server provided by courtesy of A. Preite-Martinez &. F. Ochsenbein.

  • SIMBAD and NED client routines allow name resolving.

  • The CADC press library is used to automatically compress and decompress (hcompress, gzip, ...) images.

  • Midas routines are used to calculate the centroid position, FWHM and angle of selected stars/objects.

Authors

Allan Brighton (ESO), Thomas Herlin (ESO), Miguel Albrecht (ESO), Daniel Durand (CADC), Peter Biereichel (ESO)


SkyCat is copyright by ESO, 1996. All rights reserved.

Send comments to malbrech@eso.org
Last modified: Thu Oct 1 20:26:01 MEST 1998
skycat-3.1.2-starlink-1b/skycat/install000077500000000000000000000042121215713201500200260ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 skycat-3.1.2-starlink-1b/skycat/install.sh000077500000000000000000000042121215713201500204370ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 skycat-3.1.2-starlink-1b/skycat/library/000077500000000000000000000000001215713201500200775ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/skycat/library/SkyCat.tcl000066400000000000000000000625731215713201500220160ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # "@(#) $Id: SkyCat.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # SkyCat.tcl - image display application class with catalog extensions # # This class defines a top level window for the skycat application. # # The easiest way to use this class is via the "startSkyCat" method # # See man page SkyCat(1) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # pbiereic 11/12/08 config -file after SkyCat was fully constructed # A.Brighton 11 Oct 95 created # P.W.Draper 19 Jan 00 added concat to bindtags, itk ones were # being lost. Removed extra ] from ]] in title string. # 18 Nov 03 Now accepts a list of catalogues to display. # 04 Apr 06 Catch {wm deiconify $w_.init} as init window maybe # embedded in GAIA # set skycat_usage { Usage: skycat ?fitsFile? ?-option value ...? Options: -cat - Include ESO/Archive catalog extensions (default). -catalog \" \" - Open windows for the given catalogs on startup. -colorramp_height - height of colorramp window (default: 12). -float_panel - put info panel in a popup window (default: 0). -panel_layout - panel layout, one of: "saoimage", "reverse", "default" . -panel_orient - panel orientation, one of: "horizontal", "vertical" -pickobjectorient - orientation for pick object win: "horizontal", "vertical" -min_scale - minimum scale for magnification menu (default: -10). -max_scale - maximum scale for magnification menu (default: 20). -remote - Use existing skycat process, if available, with Tk send. -debug - debug flag: run bg processes in fg. -default_cmap - default colormap. -default_itt - default intensity transfer table. -file - fits file to load ('-' for stdin). -port - Listen for remote cmds on port (default: 0 = choose port). -rtd - Include ESO/VLT Real-Time Features. -scrollbars - Display scrollbars (not displayed by default). -shm_data - Put image data in sysV shared memory. -shm_header - Put image header in sysV shared memory. -usexshm - Use X shared mem, if available (default). -use_zoom_view - Use a "view" of the image for the zoom window (default). -verbose - Print diagnostic messages. -with_colorramp - Display the color bar (default). -with_warp - add bindings to move mouse ptr with arrow keys (default: 1). -with_grid - Include a WCS grid button (default: 0 = off). -with_pan_window - Display the pan window (default). -with_zoom_window - Display the zoom window (default). -zoom_factor - zooming factor (default: 4). } set about_skycat "\ Skycat version $skycat_version Copyright (C) 1996-2009 ESO - European Southern Observatory Please send any comments, suggestions or bug reports to: archive@eso.org " itk::usual SkyCat {} # This class defines a top level window for the skycat application. The # easiest way to create an instance this class is via the "startSkyCat" # proc. It sets up the environment, creates an instance of the class and # then waits for the application to exit. # # The SkyCat widget supports the same options as the Rtd widget, its # base class, and adds some of its own options. The widget options are # the same as the skycat command line options, since these are passed # unchanged to the widget. itcl::class skycat::SkyCat { inherit rtd::Rtd # constructor: create a toplevel window constructor {args} { eval itk_initialize $args if { "$itk_option(-panel_orient)" == "" } { config -panel_orient "vertical" } } # called after the options have been evaluated protected method init {} { global ::skycat_version Rtd::init load_toplevel_geometry wm title $w_ "Skycat - version $skycat_version ($itk_option(-number))" wm iconname $w_ feedback "catalog and help menu..." add_go_menu add_graphics_save_menu_item if {$itk_option(-cat)} { cat::AstroCat::add_catalog_menu \ $w_ [code $image_] ::skycat::SkySearch $itk_option(-debug) } if {"$itk_option(-dhshost)" != ""} { add_olaf_menu } add_help_menu if {[winfo exists $w_.init]} { # destroy init window destroy $w_.init # the logo uses up colors: the update forces the destroy and frees the colors update $itk_component(image) alloccolors 60 # Sometimes $w_.init is an embedded window. catch {wm deiconify $w_} } if {"$itk_option(-catalog)" != ""} { # make sure we use full path name for local catalogs # and process option as a list foreach f "$itk_option(-catalog)" { if {[file exists $f] && "[string index $f 0]" != "/"} { set $f [pwd]/$f } cat::AstroCat::open_catalog_window $f \ [code $image_] ::skycat::SkySearch $itk_option(-debug) $w_ } } # check the main window size to make sure it is not too large bind SkyCat::resize [code $this resize %w %h] bindtags $w_ [concat SkyCat::resize [bindtags $w_]] #bindtags $w_ SkyCat::resize after 0 [code $image_ config -file $itk_option(-file)] } # destructor - delete C++ based objects destructor { save_toplevel_geometry catch {$w_.cat delete} # kill any catalog windows referring to this image window foreach w [cat::AstroCat::instances all] { catch { if {"[$w cget -id]" == "[code $image_]"} { destroy $w } } } # remove this window from the list of skycat windows global ::skycat_images if {[info exists skycat_images]} { set tmp {} foreach w $skycat_images { if {[winfo exists $w] && "$w" != "$w_"} { lappend tmp $w } } set skycat_images $tmp } } # save the position of the top level window so we can reload it the next # time. protected method save_toplevel_geometry {} { set s [wm geometry $w_] # check for case where window was not initialized... if {"$s" != "1x1+0+0"} { if {[catch {set fd [::open $toplevel_geometry_ w]}]} { return } puts $fd $s ::close $fd } } # restore the position of the top level window from the previous session protected method load_toplevel_geometry {} { if {[catch {set fd [::open $toplevel_geometry_]}]} { return } catch {wm geometry $w_ [gets $fd]} ::close $fd } # Called when the main window is resized: # Check the geometry to make sure it fits on the screen. protected method resize {w h} { bind SkyCat::resize { } set sw [winfo screenwidth $w_] set sh [winfo screenheight $w_] if {$w > $sw || $h > $sh} { wm geometry $w_ "[min $w $sw]x[min $h $sh]+0+0" } } # Add the Real-time menubutton and menu, if the -rtd option was given. protected method add_realtime_menu {} { # add/remove some menus if {$itk_option(-rtd)} { Rtd::add_realtime_menu } else { # hide the realtime status #[[$itk_component(image) component info] component cameraStatus] config \ #-width 0 -height 0 } } # Add a "Go" menu with shortcuts to view images previously viewed protected method add_go_menu {} { set m [add_menubutton "Go" "Go: menu with shortcuts to view images previously viewed"] $m config -postcommand [code $image_ update_history_menu $this $m] } # Add a menu item to the Graphics menu for saving the line graphics in a FITS # table in the image. protected method add_graphics_save_menu_item {} { if {[catch {[$image_ get_image] hdu count} msg]} { # might be a plugin, such as GAIA that doesn't have the HDU features... return } set m [get_menu Graphics] $m add separator add_menuitem $m command "Save graphics with image" \ {Save line graphics in a FITS binary table in the image} \ -command [code $image_ save_graphics_with_image] } # set default X resources for colors and fonts, and set some default key # bindings. This method is called from the parent class and overridden here. # These are built-in defaults that the user can also override in the ~/.Xdefaults # file. protected method setXdefaults {} { # read rtd defaults Rtd::setXdefaults # read cat lib defaults cat::setXdefaults # read skycat defaults skycat::setXdefaults # since we know this method gets called early, this is a good place to # create window to display while starting up make_init_window } # add a menubutton with OLAF items protected method add_olaf_menu {} { set m [add_menubutton "OLAF" "OLAF menu: On-Line Archive Facility functions"] add_menuitem $m checkbutton "Subscribe to DHS on $itk_option(-dhshost)" \ {Subscribe/Unsubscribe to DHS images} \ -variable $w_.subscribe -onvalue 1 -offvalue 0 \ -command [code $image_ subscribe $w_.subscribe \ $itk_option(-dhshost) $itk_option(-dhsdata)] } # add a menubutton with help items protected method add_help_menu {} { set m [add_menubutton "Help" {} right] add_menuitem $m command "About Skycat..." \ {Display a window with information about this Skycat version} \ -command [code $itk_component(image) about] add_menuitem $m command "Help..." \ {Display information about Skycat in netscape (if netscape is available)} \ -command [code $itk_component(image) send_to_browser $itk_option(-help_url)] add_short_help $itk_component(menubar).help \ {Help menu: display information about this application} } # make a new main window (redefined from parent class) public method clone {} { global ::skycat_usage # use the -noop option to avoid reloading the main image (part of $argv list) after 0 [code util::TopLevelWidget::start skycat::SkyCat "-noop" "$skycat_usage"] } # create the rtd image widget with catalog extensions # (redefined from parent class to use class with catalog # features added) protected method make_rtdimage {} { set image_ $w_.image # SkyCatCtrl(n) widget (derived from RtdImageCtrl), for displaying # image and control panel itk_component add image { SkyCatCtrl $image_ \ -usexshm $itk_option(-usexshm) \ -shm_header $itk_option(-shm_header) \ -shm_data $itk_option(-shm_data) \ -drag_scroll $itk_option(-drag_scroll) \ -scrollbars $itk_option(-scrollbars) \ -verbose $itk_option(-verbose) \ -subsample $itk_option(-subsample) \ -use_zoom_view $itk_option(-use_zoom_view) \ -with_zoom_window $itk_option(-with_zoom_window) \ -with_pan_window $itk_option(-with_pan_window) \ -zoom_factor $itk_option(-zoom_factor) \ -colorramp_height $itk_option(-colorramp_height) \ -color_scale $itk_option(-color_scale) \ -default_cmap $itk_option(-default_cmap) \ -default_itt $itk_option(-default_itt) \ -with_colorramp $itk_option(-with_colorramp) \ -rapid_frame_command [code $this rapid_frame_command] \ -feedback [code $this feedback] \ -port $itk_option(-port) \ -shorthelpwin $this \ -debug $itk_option(-debug) \ -with_grid $itk_option(-with_grid) \ -with_warp 1 \ -regioncommand [code $this select_region] \ -float_panel $itk_option(-float_panel) \ -panel_layout $itk_option(-panel_layout) \ -panel_orient $itk_option(-panel_orient) \ -min_scale $itk_option(-min_scale) \ -max_scale $itk_option(-max_scale) \ -pickobjectorient $itk_option(-pickobjectorient) } # keep a list of skycat instances global ::skycat_images lappend skycat_images $itk_component(image) } # This method is called when a region of the image has been selected # (via -regioncommand option when creating image above). # The arguments are the bounding box of the region in canvas coords. # pass it on to any catalog windows to select any catalog symbols # in the region. protected method select_region {x0 y0 x1 y1} { foreach w [cat::AstroCat::instances] { $w select_region $x0 $y0 $x1 $y1 } } # display a window while the application is starting up protected method make_init_window {} { global ::about_skycat ::skycat_library set skycat_logo [image create photo -file $skycat_library/skycat-logo.xpm] set w [util::TopLevelWidget $w_.init -center 1] #catch {rtd_set_cmap $w} wm title $w " " wm withdraw $w_ pack \ [label $w.logo -image $skycat_logo \ -borderwidth 2 -relief groove] \ [message $w.msg -text $about_skycat \ -width 6i \ -justify center \ -borderwidth 2 -relief groove] \ [ProgressBar $w.progress \ -from 0 -to 10 -value 0 \ -borderwidth 2 -relief groove] \ -side top -fill x -padx 1m -pady 2m tkwait visibility $w } # this method is redefined here to get feedback during startup public method feedback {msg} { if {[winfo exists $w_.init.progress]} { $w_.init.progress config -text $msg -value [incr percent_done_] update idletasks } } # This method is called for the -remote option. If another skycat is running, # use it to display the image and exit, otherwise do it in this process. # Try Tk send, and if that fails, fall back on the RTD socket interface. protected method start_remote {} { global ::argc ::argv ::env set name [winfo name .] foreach interp [winfo interps] { if {"$interp" != "$name" && [string match "Skycat*" $interp]} { # command to eval in the remote skycat application set cmd [list skycat::SkyCat::remote_start $argc $argv] # try Tk send if {[catch {send $interp $cmd}]} { # failed: try rtd remote socket interface # (rtd creates the file below on startup with pid, host and port info) set file $env(HOME)/.rtd-remote if {[catch {set fd [open $env(HOME)/.rtd-remote]}]} { return } set s [gets $fd] close $fd set status 0 if {[scan $s {%d %s %d} pid host port] != 3} { return } if {[catch { # see if the process is still running exec kill -0 $pid set fd [server_connect -nobuf $host $port] }]} { return } if {[catch { # use the rtdimage "remotetcl" subcommand # (see rtd/rtdimg/src/RtdImage.C) puts $fd [list remotetcl $cmd] lassign [gets $fd] status length set result {} if {$length > 0} { set result [read $fd $length] } }]} { close $fd return } if {$status != 0} { return } } # looks like we were successful, so we can exit exit } } } # start the application with the above class as the main window # This proc is called from tkAppInit.c when we are running the single # binary version. # Note that the binary version doesn't need to set auto_path or look for # Tcl sources or colormaps at run-time, since they are already loaded in # the binary. public proc startSkyCat {} { global ::rtd_library ::skycat_library ::skycat_usage ::tk_strictMotif \ ::argv ::argc ::env # print errors also on stderr utilPrintErrors if {! [info exists rtd_library]} { set rtd_library . } # where to look for catalog config file: # use ~/.skycat/skycat.cfg if it exists, since it may contain user's # preferences, otherwise use $SKYCAT_CONFIG if set, or $CATLIB_CONFIG. set config_file $env(HOME)/.skycat/skycat.cfg if {[file exists $config_file]} { set env(CATLIB_CONFIG) "file:$config_file" } elseif {[info exists env(SKYCAT_CONFIG)]} { set env(CATLIB_CONFIG) $env(SKYCAT_CONFIG) } tk appname Skycat set tk_strictMotif 0 tk_focusFollowsMouse # insert some default options set argv [linsert $argv 0 -disp_image_icon 1] set argc [llength $argv] # specify a list of valid options (workaround for tcl or itcl bug (?) that # crashes app if option is unknown...) set optlist [list \ -cat \ -catalog \ -color_scale \ -colorramp_height \ -debug \ -default_cmap \ -default_itt \ -dhsdata \ -dhshost \ -disp_image_icon \ -drag_scroll \ -feedback \ -file \ -float_panel \ -help_url \ -max_scale \ -min_scale \ -panel_layout \ -panel_orient \ -pickobjectorient \ -port \ -rapid_frame_command \ -regioncommand \ -remote \ -rtd \ -scrollbars \ -shm_data \ -shm_header \ -shorthelpwin \ -subsample \ -use_zoom_view \ -usexshm \ -verbose \ -with_colorramp \ -with_grid \ -with_pan_window \ -with_warp 1 \ -with_zoom_window \ -zoom_factor \ ] # start the application util::TopLevelWidget::start skycat::SkyCat "-file" "$skycat_usage" "" 1 $optlist } # -- external interface via Tk send -- # This proc returns the instance name of the catalog (or image server) # widget # If more than one is open, it asks the user to select which one. # If it can't find one, it reports an error and returns "" public proc get_catalog {{what "catalog"}} { # get list of catalog windows if {"$what" == "catalog"} { set list [cat::AstroCat::instances] } else { set list [cat::AstroCat::instances imagesvr] } if {[llength $list] == 0} { error_dialog "There are no $what windows open" return } if {[llength $list] == 1} { return [lindex $list 0] } # need to choose which catalog set names {} set n 0 foreach w $list { lappend names "[incr n] [$w cget -catalog]" } set w [ChoiceDialog .d \ -text "Please specify which $what to use:" \ -cols 1 \ -messagewidth 3i \ -choice $names \ -value [lindex $names 0] \ ] set result [$w activate] if {"$result" == ""} { return } lassign $result n name incr n -1 return [lindex $list $n] } # This proc returns the instance name of the image server # widget # If more than one is open, it asks the user to select which one. # If it can't find one, it reports an error and returns "" public proc get_imagesvr {} { return [skycat::SkyCat::get_catalog "image server"] } # This proc can be called via send from another application to return the contents # of the catalog window as a Tcl list. # # The format of the return value is {{selected_row} {{row1} {row2} ...}} # where each row is a list of column values. The selected_row is empty if there is # no selection, otherwise it is a list of column values in the selected row. public proc get_catalog_info {} { if {"[set w [skycat::SkyCat::get_catalog]]" == ""} { return } set table [$w component results] return [list [lindex [$table get_selected] 0] [$table get_contents]] } # This proc can be called via send from another application to display an image # given the coordinates and a width and height in arcmin public proc display_image {ra dec width height {equinox 2000} {catalog "Digitized Sky at ESO"}} { global ::skycat_images set w [lindex $skycat_images 0] cat::AstroCat::open_catalog_window $catalog \ $w ::skycat::SkySearch 0 [winfo toplevel $w] update if {"[set w [get_imagesvr]]" == ""} { return } $w getimage_from_args $ra $dec {} $equinox $width $height } # This proc can be called via send from another application to display a catalog # given the catalog's name (long name or short name). public proc display_catalog {{catalog "Guide Star Catalog at ESO"}} { global ::skycat_images set w [lindex $skycat_images 0] cat::AstroCat::open_catalog_window $catalog \ $w ::skycat::SkySearch 0 [winfo toplevel $w] } # This proc can be called via send from another application to display a rectangle # on the image at the given center coords with the given width and height # and return the item's canvas tag or id public proc mark_image {ra dec width height} { global ::skycat_images #return [[winfo command [lindex $skycat_images 0]] mark_image $ra $dec $width $height] return [[lindex $skycat_images 0] mark_image $ra $dec $width $height] } # remove the given mark from the image (id returned from mark_image) public proc unmark_image {id} { global ::skycat_images # [winfo command [lindex $skycat_images 0]] unmark_image $id [lindex $skycat_images 0] unmark_image $id } # This proc can be called via send to load a fits image for viewing public proc load_image {filename} { global ::skycat_images #if {[catch {[winfo command [lindex $skycat_images 0]] config -file $filename} msg]} { # error_dialog $msg #} if {[catch {[lindex $skycat_images 0] config -file $filename} msg]} { error_dialog $msg } } # pop up a window, ask the user to select an object in the image, # wait for the selection and return the info for it in the form: # {$x $y $ra $dec $equinox $fwhmX $fwhmY $angle $object $background} # # An optional Tcl command may be specifed to be called whenever a new # object is selected. The command can include a "send ..." prefix to # call a proc in another application public proc pick_object {{cmd ""}} { global ::skycat_images set var [lindex $skycat_images 0].pick.picked global ::$var catch {unset $var} #if {[catch {[winfo command [lindex $skycat_images 0]] pick_dialog $cmd} msg]} { # error_dialog $msg # return #} if {[catch {[lindex $skycat_images 0] pick_dialog $cmd} msg]} { error_dialog $msg return } if {! [info exists $var]} { tkwait variable $var } return [set $var] } # return a list of SkyCatCtrl class instances in this process (there might be # multiple cloned instances...) public proc get_skycat_images {} { global ::skycat_images if {[info exists skycat_images]} { return $skycat_images } } # This proc is called via Tcl send from a remote skycat application when the # -remote option is used. The arguments are the argc and argv of the remote # skycat application. We extract the file and catalog arguments and ignore # the rest, since we are reusing the same window. public proc remote_start {ac av} { # get the image file option from the argv list set file {} set catalog {} for {set i 0} {$i < $ac} {incr i} { set opt [lindex $av $i] if {"[string index $opt 0]" == "-" && "$opt" != "-"} { set arg [lindex $av [incr i]] } else { set arg $opt set opt "-file" } if {"$opt" == "-file"} { set file $arg } elseif {"$opt" == "-catalog"} { set catalog $arg } } # open a new main window using the new arguments foreach w [get_skycat_images] { if {[winfo exists $w]} { if {"$file" != ""} { if {[file exists $file]} { $w configure -file $file } else { error_dialog "File does not exist: $file" return } } if {"$catalog" != ""} { # open a window for the given catalog cat::AstroCat::open_catalog_window $catalog \ $w ::skycat::SkySearch 0 [winfo toplevel $w] } return } } } # -- options -- # flag: if true, display the data-servers menu (catalog features) itk_option define -cat cat Cat 1 { if {$itk_option(-cat) != 0 && $itk_option(-cat) != 1} { set itk_option(-cat) 1 puts "The -cat option requires a value of 1 (true) or 0 (false)" exit 1 } } # flag: if true, display the real-time menu (VLT features) itk_option define -rtd rtd Rtd 0 { if {$itk_option(-rtd) != 0 && $itk_option(-rtd) != 1} { set itk_option(-rtd) 1 puts "The -rtd option requires a value of 1 (true) or 0 (false)" exit 1 } } # Specify a catalog (may be a local file) to load on startup itk_option define -catalog catalog Catalog {} # For OLAF (On-Line Archive Facility): name of DHS host machine itk_option define -dhshost dhshost DhsHost {} # directory used to hold image files from OLAF/DHS itk_option define -dhsdata dhsdata DhsData {} # url to use for the help menu - link to skycat WWW page itk_option define -help_url help_url Help_url {http://archive.eso.org/skycat} # if another skycat application is running on this display, use # it rather than this process (saves memory and colors in the colormap). itk_option define -remote remote Remote 0 { if {"$itk_option(-remote)" == "1"} { start_remote } } # -- protected variables -- # used in startup dialog protected variable percent_done_ 0 # name of the file used to save the positions of the top level windows global ::env protected common toplevel_geometry_ $env(HOME)/.skycat/geometry } # The following procs are now member procs of the SkyCat class, but are # defined here as wrappers for backward compatibility. See the member procs # above for the definitions. proc startSkyCat {} { skycat::SkyCat::startSkyCat } proc get_catalog {{what "catalog"}} { return [skycat::SkyCat::get_catalog $what] } proc get_imagesvr {} { return [skycat::SkyCat::get_imagesvr] } proc get_catalog_info {} { return [skycat::SkyCat::get_catalog_info] } proc display_image {ra dec width height {equinox 2000} {catalog "Digitized Sky at ESO"}} { return [skycat::SkyCat::display_image $ra $dec $width $height $equinox $catalog] } proc display_catalog {{catalog "Guide Star Catalog at ESO"}} { return [skycat::SkyCat::display_catalog $catalog] } proc mark_image {ra dec width height} { return [skycat::SkyCat::mark_image $ra $dec $width $height] } proc unmark_image {id} { return [skycat::SkyCat::unmark_image $id] } proc load_image {filename} { return [skycat::SkyCat::load_image $filename] } proc pick_object {{cmd ""}} { return [skycat::SkyCat::pick_object $cmd] } proc get_skycat_images {} { return [skycat::SkyCat::get_skycat_images] } skycat-3.1.2-starlink-1b/skycat/library/SkyCatCtrl.tcl000066400000000000000000000462561215713201500226430ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: SkyCatCtrl.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # SkyCatCtrl.tcl - image display widget with catalog extensions # # See man page SkyCatCtrl(1) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 11 Oct 95 created itk::usual SkyCatCtrl {} # This class extends the RtdImageCtrl class (see RtdImageCtrl(n)) by # adding image catalog extensions and user interface dialogs for use # with astronomical catalogs. itcl::class skycat::SkyCatCtrl { inherit rtd::RtdImageCtrl # constructor constructor {args} { eval itk_initialize $args } # destructor destructor { catch {kill $subscribe_pid_} } # this method is called from the base class (TopLevelWidget) after all # the options have been evaluated protected method init {} { RtdImageCtrl::init # make sure at least an empty history catalog is created add_history {} } # display the skycat logo in the center of the image window # with some copywrite text # Note that we assume here that the logo was created previously # and the name of the image is in the global var skycat_logo. protected method display_logo {} { global ::about_skycat ::skycat_library set skycat_logo [image create photo -file $skycat_library/skycat-logo.xpm] # center logo $canvas_ config -scrollregion "0 0 1 1" $canvas_ create image 0 0 \ -image $skycat_logo \ -tags "objects logo logo_image" \ -anchor c # place text under logo lassign [$canvas_ bbox logo_image] x0 y0 x1 y1 set y0 $y1 set iw [expr $x1-$x0] set ih [expr $y1-$y0] set x [expr ($x0+$x1)/2] set y [expr $y1+10] $canvas_ create text $x $y \ -tags "objects logo logo_text" \ -justify center \ -anchor n \ -fill lightblue \ -font -Adobe-Helvetica-Bold-R-Normal--*-120-*-*-*-*-*-* \ -text $about_skycat # center the whole thing lassign [$canvas_ bbox logo] x0 y0 x1 y1 set w [expr $x1-$x0] set h [expr $y1-$y0] $canvas_ move logo 0 [expr -($h/2-$ih/2)] # clicking in it deletes it $canvas_ bind logo <1> "$canvas_ delete logo" } # display a popup window with information about this application public method about {} { global ::about_skycat ::skycat_library set skycat_logo [image create photo -file $skycat_library/skycat-logo.xpm] DialogWidget $w_.about \ -image $skycat_logo \ -messagewidth 6i \ -justify center \ -text $about_skycat $w_.about activate } # send a URL to be displayed by a web browser (firefox, mozila, netscape) public method send_to_browser {url} { if {"[exec uname]" == "Darwin"} { if {[catch {exec open $url}]} { warning_dialog "Could not open $url" } } elseif {[catch {exec firefox $url &}]} { if {[catch {exec mozilla $url &}]} { if {[catch {exec netscape $url &}]} { warning_dialog "Could not start web browser to view $url" } } } } # This method is called by the image code whenever a new image is loaded. protected method new_image_cmd {} { RtdImageCtrl::new_image_cmd # check for saved line graphics after idle [code $this load_graphics_from_image] # delete temp files once they are loaded # PWD: let's not GAIA relies of access to the image for other reasons # (like the various toolboxes and catalogue access). These images # should be deleted by AstroCat. #set filename [$image_ cget -file] #if {[string match {/tmp/cat[0-9]*} $filename]} { # catch {file delete $filename} #} } # display a popup window listing the HDUs in the current image, if any public method display_fits_hdus {} { if {[catch {set n [$image_ hdu count]}]} { set n 0 } if {$n <= 1} { warning_dialog "There are no FITS extensions" $w_ return } utilReUseWidget skycat::SkyCatHduChooser $w_.hdu \ -image $this \ -shorthelpwin $itk_option(-shorthelpwin) \ -usexshm $itk_option(-usexshm) \ -usexsync $itk_option(-usexsync) \ -verbose $itk_option(-verbose) } # update the toplevel window header and icon name to include the name # of the file being displayed protected method update_title {} { global ::skycat_version set file "[file tail $itk_option(-file)]" set w [winfo toplevel $w_] wm title $w "Skycat - version $skycat_version: $file ([$w cget -number])" wm iconname $w $file } # If the current image is not saved in a file (came from a server, ...) # check if it should be saved before loading a new image. Then, if the # file exists, add image info for it to the history catalog. protected method check_save {} { if {"$filename_" != ""} { if {! [file exists $filename_] && ! [$image_ isclear]} { # XXX this doesn't always work as expected... # #set s [choice_dialog \ # "Do you want to save the current image to a file\ # and add it to the history list first before loading\ # a new one?" \ # {Yes No} \ # {No} \ # $w_] #if {"$s" == "Yes"} { # save_as #} else { # don't add to history set filename_ $itk_option(-file) return #} } add_history $filename_ } # set the new file name set filename_ $itk_option(-file) } # This method is redefined here from the base class to include the # file name in the window header and note the filename. protected method load_fits_ {} { check_save RtdImage::load_fits_ update_title apply_history $itk_option(-file) component colorramp update_colors } # Save the current image or a section of the current image to a file in # FITS format chosen from a file name dialog. If dir and pattern are specified, # they are used as defaults for the file selection dialog. # If x0, y0, x1 and y1 are specified (canvas coordinates), then a section # of the image is saved. # # The return value is the name of the new file, if any, or an empty string. # (redefined from parent class to set filename_, used in check_save). public method save_as {{dir "."} {pattern "*"} {x0 ""} {y0 ""} {x1 ""} {y1 ""}} { set file [RtdImage::save_as $dir $pattern $x0 $y0 $x1 $y1] if {"$x0" == ""} { set filename_ $file } return $file } # convert the given coordinates from $from_units to $to_units and return # the result. $coords may be a list of an even number of values # {x1 y1 x2 y2 x3 y3 ...}. The result is the same list, converted to the # output coordinates. public method convert_coords {coords from_units to_units} { set result {} set len [llength $coords] for {set i 0} {$i < $len} {incr i 2} { set ix [lindex $coords $i] set iy [lindex $coords [expr $i+1]] $image_ convert coords $ix $iy $from_units x y $to_units lappend result $x $y } return $result } # Save the current line graphics in a FITS binary table in the image. # The table has 3 columns: "type", "coords", and "config". # "type" gives the shape and is one of the Tk canvas item types. # "coords" is a list of coordinates for the item. # "config" is a Tcl list of configuration options for the item. # There can be one graphics table for each image extension. For each # image extension, the graphics table is called "${extname}.GRAPHICS". public method save_graphics_with_image {} { busy { save_graphics_with_image_ } } public method save_graphics_with_image_ {} { # deselect any objects $w_.draw deselect_objects # table headings set headings {type coords config} # table data set info {} # max table column widths set width(type) 0 set width(coords) 0 set width(config) 0 # loop through the canvas items foreach item [$canvas_ find all] { set type [$canvas_ type $item] if {"$type" == "image"} { continue } # get item coords and convert from canvas to image coords set coords [convert_coords [$canvas_ coords $item] canvas image] # add a special tag to this item so we can delete it before reloading it $canvas_ addtag "graphics" withtag $item # get list of configuration options for the item set config {} foreach cfg [$canvas_ itemconfigure $item] { lappend config [list [lindex $cfg 0] [lindex $cfg 4]] } set width(type) [max $width(type) [string length $type]] set width(coords) [max $width(coords) [string length $coords]] set width(config) [max $width(config) [string length $config]] lappend info [list $type $coords $config] } # set table column formats (FITS style: 16A, for char[16], etc...) set tform "$width(type)A $width(coords)A $width(config)A" set listheadings [$image_ hdu listheadings] set hdu_list [$image_ hdu list] set extname [$image_ fits get EXTNAME] set table "${extname}.GRAPHICS" # Look for an existing graphics table and delete it, so we can # replace it with a new one foreach row $hdu_list { eval lassign [list $row] $listheadings if {"$ExtName" == "$table"} { $image_ hdu delete $HDU break } } # create a new binary table and insert the info if {[catch { $image_ hdu create binary $table $headings $tform $info } msg]} { error_dialog "error creating FITS table '$table': $msg" return } # update and display the HDU window update_fits_hdus } # Check if there is a FITS table with the same name as the current # image extension, but with ".GRAPHICS" appended. # If found, restore the previously saved line graphics from the table. # This method is called automatically when a new image extension is # loaded. public method load_graphics_from_image {} { busy { load_graphics_from_image_ } } public method load_graphics_from_image_ {} { # only do this for image extensions if {[catch {set type [$image_ hdu type]}]} { return } if {"$type" != "image"} { return } # get the name of the graphics table set extname [$image_ fits get EXTNAME] set name "${extname}.GRAPHICS" # get the hdu set headings [$image_ hdu listheadings] if {[catch {set hdu_list [$image_ hdu list]}]} { # avoid problem when image and header are in separate files... return } set hdu 0 foreach i $hdu_list { eval lassign [list $i] $headings if {"$ExtName" == "$name"} { set hdu $HDU break } } if {$hdu == 0} { return } # make sure we don't create 2 of each object $canvas_ delete "graphics" # Now we have the hdu number of the graphics table. Read it and # restore the graphics set headings {type coords config} foreach row [$image_ hdu get $hdu] { eval lassign [list $row] $headings # convert from image to canvas coords if {[catch {set coords [convert_coords $coords image canvas]} msg]} { puts $msg continue } set id [eval $canvas_ create $type $coords] foreach cfg $config { lassign $cfg opt arg $canvas_ itemconfigure $id $opt $arg } # add bindings so that the items may be edited and saved again $w_.draw add_object_bindings $id } } # Add the current image to the history catalog under the given filename. # The current FITS header is used to extract information about the image # to put in the catalog. The file basename is assumed to be the unique id. public method add_history {filename} { skycat::SkySearch::add_history $this $filename if {"$filename" != "" && [file exists $filename]} { lappend back_list_ $filename } } # Check if the given filename is in the history catalog, and if so, # apply the cut levels and color settings for the file. public method apply_history {filename} { skycat::SkySearch::apply_history $this $filename } # Update the given menu with image history items. $w is the TopLevelWidget # containing the menubar public method update_history_menu {w m} { $m delete 0 end $w add_menuitem $m command "Back" \ {Go back again to the previous image} \ -command [code $w busy "$this previous_image"] \ -state disabled if {[llength $back_list_]} { $m entryconfig Back -state normal } $w add_menuitem $m command "Forward" \ {Go forward again to the next image} \ -command [code $w busy "$this forward_image"] \ -state disabled if {[llength $forward_list_]} { $m entryconfig Forward -state normal } $m add separator skycat::SkySearch::add_history_menu_items $w $this $m 20 } # go back to the previous image public method previous_image {} { while {[set n [llength $back_list_]]} { set filename [lindex $back_list_ end] if {"$filename" != "$itk_option(-file)" && [file exists $filename]} { lappend forward_list_ $itk_option(-file) configure -file $filename set back_list_ [lrange $back_list_ 0 [expr $n-2]] break } set back_list_ [lrange $back_list_ 0 [expr $n-2]] } } # go forward again to the next image public method forward_image {} { while {[set n [llength $forward_list_]]} { set filename [lindex $forward_list_ end] if {"$filename" != "$itk_option(-file)" && [file exists $filename]} { configure -file $filename set forward_list_ [lrange $forward_list_ 0 [expr $n-2]] break } set forward_list_ [lrange $forward_list_ 0 [expr $n-2]] } } # This method is also redefined from the parent class to set the window # header info public method clear {} { check_save set filename_ {} RtdImageCtrl::clear update_title } # subscribe to (or unsubscribe from) the OLAF DHS server images # (ESO/Archive On-Line Archive Facility project: use the -dhshost and # -dhsdata options to add this feature.) # The first argument is the name of the trace variable used in the checkbutton menuitem. # dhshost is the name of the host running the DHS server, to which we subscribe. # dhsdata is the directory to use to hold the images files (temporary files). public method subscribe {variable dhshost dhsdata} { global ::$variable catch {exec kill $subscribe_pid_} if {[set $variable]} { # subscribe set port [$image_ remote] if {[catch {set subscribe_pid_ \ [exec rtdSubscribe \ -rtdport $port \ -dhshost $dhshost \ -dhsdata $dhsdata \ -logpath /tmp >& /dev/null &] \ } msg]} { error_dialog "Couldn't exec rtdSubscribe: $msg" } # try to handle errors written to stderr #set subscribe_fd_ [::open "| tail -f $subscribe_tmpfile_"] #fileevent $subscribe_fd_ readable [code $this rtdSubscribeError $subscribe_fd_] } } # display a rectangle on the image at the given center coords # with the given width and height and return the items tag or id. public method mark_image {ra dec width height} { # get radius from width and height set a $width/2.0 set radw [expr sqrt(2.0*$a*$a)] set a $height/2.0 set radh [expr sqrt(2.0*$a*$a)] # combine 2 square boxes to get the rectangle lassign [$image_ radecbox $ra $dec $radw] wr0 wd0 wr1 wd1 lassign [$image_ radecbox $ra $dec $radh] hr0 hd0 hr1 hd1 set eq [$image_ wcsequinox] if {[catch { $image_ convert coords $wr0 $hd0 "wcs $eq" x0 y0 canvas $image_ convert coords $wr1 $hd1 "wcs $eq" x1 y1 canvas } msg]} { error_dialog $msg $w_ return } set id [$canvas_ create rectangle \ $x0 $y0 $x1 $y1 \ -width 2 \ -tags objects \ -fill yellow \ -outline white \ -stipple pat6] $itk_component(draw) add_object_bindings $id return $id } # remove the given mark from the image public method unmark_image {id} { $canvas_ delete $id } # Ask the user to select an area of the image by dragging out a region # and return as a result a list of the form {x0 y0 x1 y1} in pixels. public method select_area {{shape rectangle}} { if {[$image_ isclear]} { warning_dialog "No image is currently loaded" $w_ return } # if {[action_dialog \ # "Please select and drag out a region of the image with mouse button 1" \ # $w_]} global ::$w_.select_area set $w_.select_area {} $itk_component(draw) set_drawing_mode $shape [code $this selected_area] tkwait variable $w_.select_area return [set $w_.select_area] } # This method is called when the user has selected an area of the image. # The results are in canvas coordinates, clipped to the area of the image. public method selected_area {id x0 y0 x1 y1} { global ::$w_.select_area # make sure the coordinates don't go off the image if {"$x0" != ""} { set w [$image_ width] $image_ convert coords $x0 $y0 canvas x0 y0 image $image_ convert coords $x1 $y1 canvas x1 y1 image foreach i {x0 y0 x1 y1} { set v [set $i] if {$v < 1} { set $i 1 } elseif {$v > $w} { set $i $w } } $image_ convert coords $x0 $y0 image x0 y0 canvas $image_ convert coords $x1 $y1 image x1 y1 canvas } set $w_.select_area "$x0 $y0 $x1 $y1" after 0 [code $w_.draw delete_object $id] } # Draw a symbol on the image with the given shape at the given coordinates # (in the given x,y units), with the given radius (in radius_units), # bg and fg color, canvas tags list, x/y ratio and rotation angle. # # shape may be one of "circle", "square", "plus", "cross", "triangle", # "diamond", "ellipse", "compass", "line", "arrow". # # x and y are the coordinates in "xy_units", which is one of the units # accepted by the Rtd commands (canvas, image, screen, "wcs $equinox", # "deg $equinox"). # # The radius value is interpreted in radius_units. # # bg and fg are X color names for the symbol (may be the same). # # symbol_tags should be a Tcl list of canvas tags for the symbol. # # ratio and angle are optional and used to stretch/shrink and # rotate the symbol. The default ratio is 1, default angle 0. # # label is an optional text for a label to place near the symbol. # # label_tags should be a Tcl list of canvas tags for the label, or # an empty or null string, if there is no label. # # Returns an error if the coordinates or part of the symbol are off # the image. # # Uses world coordinates, if available, for the rotation and orientation, # for symbols that support it (i.e.: rotation is relative to WCS north). public method draw_symbol {shape x y xy_units radius radius_units bg fg symbol_tags {ratio 1} {angle 0} {label ""} {label_tags ""}} { $image_ symbol $shape $x $y $xy_units $radius $radius_units \ $bg $fg $symbol_tags $ratio $angle $label $label_tags } # -- options -- # flag: if true, run queries in the foreground for better debugging itk_option define -debug debug Debug 0 # see parent class for other options... # -- protected variables -- # pid of rtdSubscribe process (OLAF) protected variable subscribe_pid_ {} # const PI protected variable pi_ 3.14159265358979323846 # const PI/180. protected variable rad_ [expr 3.14159265358979323846/180.] # the name of the image file, if any protected variable filename_ {} # used for the Go=>Back/Forward menu itemes protected variable back_list_ {} protected variable forward_list_ {} } skycat-3.1.2-starlink-1b/skycat/library/SkyCatHduChooser.tcl000066400000000000000000000061461215713201500237740ustar00rootroot00000000000000# E.S.O. - VLT project # "@(#) $Id: SkyCatHduChooser.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # SkyCatHduChooser.tcl - Itcl widget for displaying FITS extensions # # See man page SkyCatHduChooser(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 09/11/98 Created itk::usual SkyCatHduChooser {} # This class defines a widget for displaying the HDUs in the current FITS # image. The user can select a FITS table or image extension to display # by clicking on an entry the list or on one of the small images displayed # in a table. itcl::class skycat::SkyCatHduChooser { inherit rtd::RtdImageHduChooser # constructor: create a toplevel window constructor {args} { eval itk_initialize $args } # Display the current FITS table protected method display_fits_table {name hdu} { # build the name from the catalog name and the file base name set file [file tail [file rootname [$image_ cget -file]]] if {[string first "$file-" $name] == 0} { set filename /tmp/$name } else { set filename "/tmp/$file-$name" } # get the catalog config entry from the $catinfo table set entry [get_config_entry_from_fits_table $name $filename] # copy the FITS table to a temporary local catalog if {[catch {$image_ hdu get $hdu $filename $entry} msg]} { error_dialog $msg return } # display the catalog cat::AstroCat::new_catalog $filename $itk_option(-image) ::skycat::SkySearch } # Return the catalog config entry for the named FITS table, if # available, or a default entry. If the current FITS file contains # an HDU named $catinfo, with an entry for the named catalog ($extname), # then extract and return that entry as a Tcl keyed list. protected method get_config_entry_from_fits_table {extname filename} { set headings [$image_ hdu listheadings] # the first part of the catalog config entry is always the same set entry {} lappend entry [list serv_type local] lappend entry [list short_name $extname] lappend entry [list long_name $extname] lappend entry [list url $filename] foreach row [$itk_component(table) cget -info] { eval lassign [list $row] $headings if {"$ExtName" == "$catinfo"} { # found table set headings [$image_ hdu headings $HDU] foreach row [$image_ hdu get $HDU] { eval lassign [list $row] $headings if {"$SHORT_NAME" == "$extname"} { # found entry foreach key $headings { set value [set $key] set key [string tolower $key] if {"[string trim $value]" != ""} { lappend entry [list $key $value] } } return $entry } } break } } # no entry found, use default (no plotting) foreach i {id_col ra_col dec_col x_col y_col} { lappend entry [list $i -1] } return $entry } # -- options -- # name of the FITS table containing catalog config info public variable catinfo "CATINFO" # -- protected vars -- # C++ astrocat object use here to access catalog entries common astrocat_ [astrocat ::cat::.cataloginfo] } skycat-3.1.2-starlink-1b/skycat/library/SkyQuery.tcl000066400000000000000000000165571215713201500224150ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: SkyQuery.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # SkyQuery.tcl - Widget for searching catalogs and plotting the results in an image. # # See man page SkyQuery(n) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 6 Jan 98 created itk::usual SkyQuery {} # A SkyQuery widget is a frame containing entries for search # options (inherited from class AstroQuery) with added support # for plotting objects in an image. itcl::class skycat::SkyQuery { inherit cat::AstroQuery # constructor constructor {args} { eval itk_initialize $args } # add (or update) the search options panel # (redefined from parent class AstroCat to add buttons) protected method add_search_options {} { AstroQuery::add_search_options if {[$astrocat iswcs] || [$astrocat ispix]} { frame $search_opts_.buttons pack \ [set setfromimg \ [button $search_opts_.buttons.setfromimg \ -text "Set From Image" \ -command [code $this set_from_image]]] \ [set selectarea \ [button $search_opts_.buttons.selectarea \ -text "Select Area..." \ -command [code $this select_area]]] \ -side right -padx 1m -pady 2m if {$iscat_} { # put it on the same row with the last entry: "Max Objects" incr search_opts_row_ -1 } add_search_option {} $search_opts_.buttons add_short_help $setfromimg {Set default values from the current image} add_short_help $selectarea \ {Select and drag out a region of the image with mouse button 1} } } # Set the default search values to the center position and radius of the image, # (for catalogs) of width and height of image (for image servers). public method set_from_image {} { if {$iscat_} { set_pos_radius [get_image_center_radius [$astrocat iswcs]] } else { set_pos_width_height [get_image_center_width_height [$astrocat iswcs]] } } # return a list of values indicating the center coordinates and radius # of the current image. # If wcs_flag is 1, the return list is {ra dec equinox radius-in-arcmin}, # otherwise {x y radius-in-pixels}. If no image is loaded, an empty # string is returned. public method get_image_center_radius {wcs_flag} { if {[$image_ isclear]} { return } if {$wcs_flag} { # using world coords set center [$image_ wcscenter] if {[llength $center] >= 2} { lassign $center ra dec equinox set radius [format "%.2f" [$image_ wcsradius]] if {$radius} { return [list $ra $dec $equinox $radius] } } } else { # using image coords set w [$image_ width] set h [$image_ height] set x [format "%.2f" [expr $w/2.]] set y [format "%.2f" [expr $h/2.]] set radius [format "%.2f" [expr sqrt($x*$x+$y*$y)/2.]] return [list $x $y $radius] } } # return a list of values indicating the center coordinates and the # width and height of the current image. # If wcs_flag is 1, the return list is {ra dec equinox width height}, # width and height in arcmin, # otherwise {x y width height} in pixels. If no image is loaded, an empty # string is returned. public method get_image_center_width_height {wcs_flag} { if {[$image_ isclear]} { return } if {$wcs_flag} { # using world coords set center [$image_ wcscenter] if {[llength $center] >= 2} { lassign $center ra dec equinox set width [$image_ wcswidth] set height [$image_ wcsheight] return [list $ra $dec $equinox $width $height] } } else { # using image coords set w [$image_ width] set h [$image_ height] set x [format "%.2f" [expr $w/2.]] set y [format "%.2f" [expr $h/2.]] set width [$image_ width] set height [$image_ height] return [list $x $y $width $height] } } # Ask the user to select an area to search interactively # and insert the resulting radius and center pos in the # catalog window. public method select_area {} { if {$iscat_} { set_pos_radius [select_image_area [$astrocat iswcs]] } else { set_pos_width_height [select_image_area [$astrocat iswcs]] } } # convert the given input coordinates in the given input units to the # given output units and return a list {x y} with the new values. # The units may be one of {canvas image wcs deg "wcs $equinox", "deg $equinox"} public method convert_coords {in_x in_y in_units out_units} { return [$image_ convert coords $in_x $in_y $in_units {} {} $out_units] } # Ask the user to select an area of the image by dragging out a region # on the image return the resulting center pos and radius as a list of # {x y radius-pixels}, or {ra dec equinox radius-in-arcmin} if wcs_flag # is 1. If we are dealing with an image server, the radius value is replaced # by width and height, i.e.: {ra dec equinox width height}, where width and # height are in arcmin for wcs or pixels otherwise. # An empty string is returned if there is no image or the user cancels # the operation. public method select_image_area {wcs_flag} { if {"$image_" == ""} { return } if {[$image_ isclear]} { error_dialog "No image is currently loaded" return } # get canvas coords of selected area set list [$skycat select_area] if {[llength $list] != 4} { return } lassign $list x0 y0 x1 y1 # get center and radius in canvas coords set x [expr ($x0+$x1)/2.] set y [expr ($y0+$y1)/2.] if {$wcs_flag} { # using world coords set equinox [get_catalog_equinox] if {[catch { lassign [convert_coords $x $y canvas "wcs $equinox"] ra dec } msg]} { error_dialog "error converting canvas ($x, $y) to world coordinates: $msg" $w_ return } if {$iscat_} { set radius [expr [$image_ wcsdist $x0 $y0 $x $y]/60.] return [list $ra $dec $equinox $radius] } else { set width [expr [$image_ wcsdist $x0 $y0 $x1 $y0]/60.] set height [expr [$image_ wcsdist $x0 $y0 $x0 $y1]/60.] return [list $ra $dec $equinox $width $height] } } else { # using image coords if {[catch { lassign [convert_coords $x $y canvas image] xi yi } msg]} { error_dialog "error converting canvas ($x, $y) to world coordinates: $msg" $w_ return } if {[catch { lassign [convert_coords $x0 $y0 canvas image] xi0 yi0 } msg]} { error_dialog "error converting canvas ($x0, $y0) to world coordinates: $msg" $w_ return } if {[catch { lassign [convert_coords $x1 $y1 canvas image] xi1 yi1 } msg]} { error_dialog "error converting canvas ($x1, $y1) to world coordinates: $msg" $w_ return } set w [expr abs($xi1-$xi0)] set h [expr abs($yi1-$yi0)] if {$iscat_} { set radius [expr sqrt($w*$w+$h*$h)/2.] return [list $x $y $radius] } else { return [list $x $y $w $h] } } } # Set the default values for the search panel entries: # (redefined from parent class AstroCat to set values from the image) public method set_default_values {} { AstroQuery::set_default_values set_from_image } # -- public variables -- # name of SkyCat itcl widget public variable skycat {} { if {"$skycat" != ""} { set image_ [$skycat get_image] } } # -- protected members -- # internal rtdimage image for main image protected variable image_ {} } skycat-3.1.2-starlink-1b/skycat/library/SkyQueryResult.tcl000066400000000000000000000157061215713201500236070ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: SkyQueryResult.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # SkyQueryResult.tcl - Widget for viewing query results with skycat image support. # # See man page SkyQueryResult(n) for a complete description. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 5 Jan 98 created # A SkyQueryResult widget is defined as a QueryResult (see cat package) # with some added support for skycat image access, used for selecting objects # to add to a local catalog. itcl::class skycat::SkyQueryResult { inherit cat::QueryResult # constructor constructor {args} { eval itk_initialize $args } # pop up a dialog to enter the data for a new object for a local catalog # The command is evaluated after the users enters the new data. # (redefined from parent class to add image support) public method enter_new_object {{command ""}} { catch {delete object $w_.ef} EnterObject $w_.ef \ -title {Please enter the data for the object below:} \ -labels $headings_ \ -center 0 \ -image $skycat \ -command [code $this enter_object $command] } # pop up a window so that the user can edit the selected object(s) # The optional command is evaluated with no args if the object is # changed. # (redefined from parent class AstroCat to add image support) public method edit_selected_object {{command ""}} { catch {destroy $w_.ef} set values [lindex [get_selected] 0] if {[llength $values] == 0} { error_dialog "No rows are selected" $w_ return; } EnterObject $w_.ef \ -title {Please enter the data for the object below:} \ -image $skycat \ -labels $headings_ \ -values $values \ -command [code $this enter_object $command] } # save the current data as a FITS table in the current image file. # The argument is the catalog config entry. public method save_with_image {entry} { set image [$skycat get_image] # make sure file exists set file [$image cget -file] set suffix [file extension $file] switch -exact -- "$suffix" { ".gz" - ".gzfits" - ".gfits" - ".Z" - ".cfits" - ".hfits" { error_dialog "Can't save catalog data to compressed image file." return } } set headings [$image hdu listheadings] # get the short name of the catalog and use it as the table name set extname "" foreach i $entry { lassign $i key value if {"$key" == "short_name"} { set extname $value break } } # build the name from the catalog name and the file base name set file [file tail [file rootname $file]] if {[string first "$file-" $extname] == 0} { set extname [string range $extname [expr [string length $file]+1] end] } if {"$extname" == ""} { set extname [input_dialog "Please enter a name for the FITS table"] } if {"$extname" == ""} { return } # use all ASCII formats (use inherited size_ array) set tform {} if {$num_cols_ <= 1} { error_dialog "No data to save" return } if {! [info exists size_]} { error_dialog "No column size info" return } for {set i 1} {$i <= $num_cols_} {incr i} { lappend tform "$size_($i)A" } # If there is aleady a table by this name in the file, delete it # and replace it with the new one. set hdu_list [$image hdu list] foreach hdu $hdu_list { eval lassign [list $hdu] $headings if {"$extname" == "$ExtName"} { if {[catch {$image hdu delete $HDU} msg]} { error_dialog $msg } } } # save the current HDU number and restore it before returning set saved_hdu [$image hdu] # create a new binary table if {[catch { $image hdu create binary $extname $headings_ $tform $info_ } msg]} { error_dialog "error creating FITS table '$extname': $msg" return } # create/update catalog config info to a special FITS table if {[catch { save_config_info_to_fits_table $extname $entry } msg]} { after idle [list error_dialog $msg] } # restore saved HDU set numHDUs [$image hdu count] if {$saved_hdu <= $numHDUs} { $image hdu $saved_hdu } else { # shouldn't happen, but if the HDU was deleted, use the new last one $image hdu $numHDUs } # update/display the HDU window $skycat update_fits_hdus } # Save the given catalog config entry in a FITS table with the name # $catinfo. The hdu arg gives the HDU number of the $catinfo table, # or 0 if it does not exist. protected method save_config_info_to_fits_table {extname entry} { set image [$skycat get_image] # Look for an existing $catinfo table set headings [$image hdu listheadings] set hdu_list [$image hdu list] set hdu 0 foreach row $hdu_list { eval lassign [list $row] $headings if {"$ExtName" == "$catinfo"} { set hdu $HDU break } } # If the table exists, get the data and remove it, so that # we can recreate it, with possibly new columns or column # widths set rowNum 0 if {$hdu} { if {[catch { set headings [$image hdu headings $hdu] set info [$image hdu get $hdu] $image hdu delete $hdu } msg]} { error_dialog $msg return } # scan the current info, allow for future additions to headings foreach row $info { eval lassign [list $row] $headings foreach i $headings { set ar($rowNum,$i) [set $i] } if {"$SHORT_NAME" == "$extname"} { # replace this entry with the new one continue } incr rowNum } } # set headings for catalog config table set headings "SHORT_NAME ID_COL RA_COL DEC_COL X_COL Y_COL EQUINOX SYMBOL \ SEARCH_COLS SORT_COLS SORT_ORDER SHOW_COLS HELP COPYRIGHT" # initialize min column widths foreach i $headings { set width($i) 1 } # get values from config entry foreach i $entry { lassign $i key value if {"$key" == "symbol" || "$key" == "search_cols"} { # special treatment needed here (see CatalogInfo.tcl) set value [join $value " : "] } set ar($rowNum,[string toupper $key]) $value } set ar($rowNum,SHORT_NAME) $extname # build table data list and get max col widths for FITS formats set info {} set numRows [incr rowNum] for {set rowNum 0} {$rowNum < $numRows} {incr rowNum} { set row {} foreach i $headings { if {[info exists ar($rowNum,$i)]} { lappend row $ar($rowNum,$i) set width($i) [max $width($i) [string length $ar($rowNum,$i)]] } else { lappend row {} } } lappend info $row } # build the tform argument set tform {} foreach i $headings { lappend tform "$width($i)A" } # create a new binary table and insert the info if {[catch { $image hdu create binary $catinfo $headings $tform $info } msg]} { error_dialog "error creating FITS table '$catinfo': $msg" return } } # -- public variables -- # name of SkyCatCtrl itcl widget public variable skycat {} # name of the FITS table containing catalog config info public variable catinfo "CATINFO" } skycat-3.1.2-starlink-1b/skycat/library/SkySearch.tcl000066400000000000000000000577501215713201500225150ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: SkySearch.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # SkySearch.tcl - Widget for searching a catalog and plotting the results # in the skycat image viewer. # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 10 Dec 97 created # P.W.Draper 08 Jan 07 only check for image isclear, don't use blank # name and image size < 10 pixels in plot, that # is no longer true # 03 Mar 08 change add_history to deal with images without # a WCS (fix from GAIA). # 16 Mar 09 Add a imgplot_ method for subclassing the plot # method (so that the call to the real imgplot # may be tweaked). itk::usual SkySearch {} # This class extends the AstroCat catalog widget browser class (see # AstroCat(n) to add support for plotting objects and displaying images. itcl::class skycat::SkySearch { inherit cat::AstroCat # constructor constructor {args} { eval itk_initialize $args } # called after options have been evaluated protected method init {} { AstroCat::init # these are the supported plot symbols foreach i "circle square plus cross triangle diamond ellipse compass line arrow" { set symbols_($i) 1 } # add a menu item to the File menu to save the catalog as a FITS table if {$iscat_} { set m [get_menu File] insert_menuitem $m "Add to..." command "Save with image" \ {Save the listed objects to the current FITS file as a binary table} \ -command [code $this save_with_image] } # this unique canvas tag is used for all symbols (see also SkySearch.C) set tag_ $w_.cat set object_tag_ $tag_.objects set label_tag_ $tag_.labels # add bindings for symbols $canvas_ bind $object_tag_ <1> "[code $this select_symbol current 0]" $canvas_ bind $object_tag_ "[code $this select_symbol current 1]" $canvas_ bind $object_tag_ "[code $this select_symbol current 1]" $canvas_ bind $object_tag_ "$canvas_ config -cursor tcross" $canvas_ bind $object_tag_ "$draw_ reset_cursor" # symbols can't be moved, but labels can (but not edited). # (See SkySearch.C:plot_symbol() for origin of tag name) $draw_ add_object_bindings $label_tag_ current $canvas_ bind $label_tag_ "+$canvas_ focus {}" # add short help for canvas objects set msg "Catalog symbol: {bitmap b1} = select object" set w [winfo toplevel $canvas_] $canvas_ bind $object_tag_ "+[code $w short_help $msg]" $canvas_ bind $object_tag_ "+[code $w short_help {}]" } # save the current data as a FITS table in the current image file. public method save_with_image {} { busy { $results_ save_with_image [$w_.cat entry get] } } # insert the id for the given object in the image near the object # and return a string containing status info. name identifies the # source catalog (short_name). public method label_object_in_image {id name} { if {"$canvas_" == ""} { return } if {[llength [set box [$canvas_ bbox cat$id]]]} { lassign $box x0 y0 x1 y1 make_label $name $id [expr ($x1+$x0)/2.0] [expr ($y1+$y0)/2.0] canvas $id white return "labeled object '$id' in image" } else { return "object '$id' is not visible" } } # remove any items in the query result list that have not been plotted # because they were not in the image (circular search/rectangualr image). public method filter_query_results {} { $w_.progress config -text "Filtering out off-image objects..." set new_info {} set n 0 busy { foreach row $info_ { set id [lindex $row [$w_.cat id_col]] if {[llength [$canvas_ find withtag cat$id]]} { lappend new_info $row incr n } } set t [$results_ total_rows] if {$n != $t} { $results_ config \ -info [set info_ $new_info] \ -title "Search Results ($n*)" plot $w_.progress config -text "Removed [expr $t-$n] objects from the list." } else { $w_.progress config -text "No change." } } } # add a label to the image at the given coordinates (in the given units) # with the given text and color. The id arg should be a unique id for the # label in the catalog and $name should be the short name of the catalog. # $units may be any of the units supported by the RTD {image canvas screen # "wcs $equinox" "deg $equinox"} public method make_label {name id x y units text color} { if {[catch {lassign [convert_coords $x $y $units canvas] x y} msg]} { return } set tags [list objects $tag_ label$id $name] $canvas_ delete label$id set cid [$canvas_ create text $x $y \ -text $text \ -anchor sw \ -fill $color \ -font $itk_option(-canvasfont) \ -tags $tags] $draw_ add_object_bindings $cid ct_add_bindings $canvas_ $cid } # display the given image file public method display_image_file {filename} { $skycat_ config -file $filename } # retun the width of the image display canvas public method get_display_width {} { return [winfo width $canvas_] } # retun the height of the image display canvas public method get_display_height {} { return [winfo height $canvas_] } # return the name (file or object name) of the currently loaded image, # or empty if no image is loaded. public method get_image_name {} { set name [$image_ cget -file] if {"$name" == ""} { set name [$image_ object] } return $name } # generate a blank image that supports world coordinates for the purpose # of plotting catalog objects. # ra_deg, dec_deg and equinox give the center of the image (in deg), # radius the radius in arcmin. # Returns "0" if all is OK. public method gen_wcs_image {ra_deg dec_deg equinox radius} { if {"$ra_deg" == "" || "$dec_deg" == ""} { info_dialog "please specify values for RA and DEC." $w_ return } if {"$radius" == ""} { info_dialog "please specify a radius value." $w_ return } if {"$equinox" == ""} { set equinox 2000 } elseif {[string match {[jJbB]} [string index $equinox 0]]} { set equinox [string range $equinox 1 end] } $image_ clear \ -reuse 1 \ -ra $ra_deg \ -dec $dec_deg \ -equinox $equinox \ -radius $radius \ -width [get_display_width] \ -height [get_display_height] # enable the options panel, since we now have an image catch {[[$skycat_] component info] configure -state normal} return 0 } # generate a blank image without WCS. radius is radius of the image in # pixels, # Returns "0" if all is OK. public method gen_pix_image {radius} { if {"$radius" == ""} { info_dialog "please specify a radius value." $w_ return } $image_ clear \ -reuse 1 \ -radius $radius \ -width [get_display_width] \ -height [get_display_height] # enable the options panel, since we now have an image catch {[[$skycat_] component info] configure -state normal} return 0 } # This method is called when the user clicks on a graphic symbol for a star. # The user might be selecting this star, so call the RtdImage method to do that public method picked_wcs_object {x y units} { if {[catch { lassign [convert_coords $x $y $units "wcs [$image_ wcsequinox]"] ra dec lassign [convert_coords $x $y $units image] ix iy } msg]} { return } catch {$skycat_ picked_wcs_object $ix $iy $ra $dec} } # deselect any objects in the image public method deselect_objects {} { $canvas_ delete grip } # delete any graphic objects in the image belonging to this catalog public method delete_objects {} { catch {$canvas_ delete $tag_} } # convert the given input coordinates in the given input units to the # given output units and return a list {x y} with the new values. # The units may be one of {canvas image wcs deg "wcs $equinox", "deg $equinox"} public method convert_coords {in_x in_y in_units out_units} { return [$image_ convert coords $in_x $in_y $in_units {} {} $out_units] } # add the dialog button frame # (redefined from parent class AstroCat to add Plot button) protected method add_dialog_buttons {} { AstroCat::add_dialog_buttons # only do this for catalogs, not for image servers... if {$iscat_} { pack \ [button $w_.plot \ -text "Plot" \ -command [code $this plot_again]] \ [button $w_.filter \ -text "Filter" \ -command [code $this filter_query_results]] \ -side left -expand 1 -pady 2m -in $w_.buttons -after $w_.search if {[llength [$w_.cat symbol]] == 0} { $w_.plot config -state disabled $w_.filter config -state disabled } } } # add a short help window and set the help texts # (redefined from parent class AstroCat) protected method make_short_help {} { AstroCat::make_short_help add_short_help $w_.plot \ {{bitmap b1} = Plot the listed objects again in the image} add_short_help $w_.filter \ {{bitmap b1} = Filter out off-image objects from the listing (circular search/rectangular image...)} } # insert the Id for the object selected in the Table in the image # near the object. protected method label_selected_object {} { set id [lindex [lindex [$results_ get_selected] 0] [$w_.cat id_col]] if {"$id" == ""} { return } set name [$w_.cat shortname $itk_option(-catalog)] $w_.progress config -text [label_object_in_image $id $name] } # add the search options panel # (redefined from parent class AstroCat to add image support) protected method add_search_options {} { # SkyQuery(n) widget (derived from AstroQuery(n)) for displaying # search options. itk_component add searchopts { set searchopts_ [SkyQuery $w_.searchopts \ -relief groove \ -borderwidth 2 \ -debug $itk_option(-debug) \ -astrocat [code $w_.cat] \ -skycat $skycat_ \ -searchcommand [code $this search] \ -feedbackcommand [code $this set_feedback] \ -command [code $this query_done]] } pack $itk_component(searchopts) \ -side top -fill x } # add the table for displaying the query results # (redefined from parent class AstroCat to add image support) protected method add_result_table {} { # SkyQueryResult(n) widget to display the results of a catalog query. itk_component add results { set results_ [SkyQueryResult $w_.results \ -astrocat [code $w_.cat] \ -skycat $skycat_ \ -title "Search Results" \ -hscroll 1 \ -height 12 \ -sortcommand [code $this set_sort_cols] \ -layoutcommand [code $this set_show_cols] \ -selectmode extended \ -exportselection 0] } { } pack $itk_component(results) -side top -fill both -expand 1 bind $results_.listbox [code $this select_result_row] $results_ set_options {MORE PREVIEW more preview} Show 0 # for history catalog, double-click opens file if {"[$w_.cat longname]" == "$history_catalog_"} { bind $results_.listbox [code $this preview] } else { bind $results_.listbox [code $this label_selected_object] } } # set/reset widget states while busy # (redefined from parent class AstroCat) public method set_state {state} { AstroCat::set_state $state if {$iscat_} { if {[llength [$w_.cat symbol]] == 0} { set state disabled } $w_.plot config -state $state $w_.filter config -state $state } } # re-plot the listed objects public method plot_again {} { busy {plot} } # plot the stars/objects found in the previous search in the image window. # The symbols to use are taken from the config file. public method plot {} { # can't plot with no coordinates if {![$w_.cat iswcs] && ![$w_.cat ispix]} { return } # can't plot without symbol info if {"[$w_.cat symbol]" == ""} { return } # if we have an image display, but no image is loaded, generate dummy image if {[$image_ isclear]} { if {[gen_blank_image] != 0} { return } } # if any objects are selected, deselect them first deselect_objects delete_objects $w_.progress config -text "Plotting objects..." update idletasks set equinox [$w_.searchopts get_equinox] imgplot_ $equinox } # Call the imgplot method with the local settings and the given # equinox. The equinox is that of the catalogue positions (and # should be matched to those of the image, iff different). protected method imgplot_ {equinox} { # the plot method was reimplemented in C++ for better performance # See SkySearch.C for the implementation of the astrocat plot subcommand. if {[catch {$w_.cat imgplot $image_ $info_ $equinox $headings_} msg]} { error_dialog $msg } } # Called when a row in the table is selected. Redefined from parent # clas to also select the plot symbol. protected method select_result_row {} { AstroCat::select_result_row # clear symbol selection deselect_symbol $w_.selected # select symbols matching selected rows foreach row [$results_ get_selected_with_rownum] { lassign $row rownum row set id [lindex $row [$w_.cat id_col]] if {"$id" == ""} { continue } select_symbol cat$id 1 $rownum } } # Select a symbol, given the canvas id and optional row number # in the table listing. If $toggle is 0, deselect all other symbols # first, otherwise toggle the selection of the items given by $id. public method select_symbol {id toggle {rownum -1}} { set tag [lindex [$canvas_ gettags $id] 0] if {$rownum < 0} { set rownum [get_table_row $id] if {$rownum < 0} { return } } if {$toggle} { # toggle selection if {[$draw_ item_has_tag $tag $w_.selected]} { deselect_symbol $tag $results_ deselect_row $rownum return } } else { # clear selection deselect_symbol $w_.selected } if {"$rownum" >= 0} { $results_ select_row $rownum [expr !$toggle] $results_ select_result_row } foreach i [$canvas_ find withtag $tag] { set width [$canvas_ itemcget $i -width] $canvas_ itemconfig $i -width [expr $width+2] } $canvas_ addtag $w_.selected withtag $tag $canvas_ raise $tag $image_ } # deselect the given symbol, given its canvas tag or id public method deselect_symbol {tag} { foreach i [$canvas_ find withtag $tag] { set width [$canvas_ itemcget $i -width] $canvas_ itemconfig $i -width [expr $width-2] } $canvas_ dtag $tag $w_.selected } # Return the table row index corresponding the given symbol canvas id. # Note: The plot subcommand in SkySearch.C adds a canvas tag "row#$rownum" # that we can use here. # Also: cat$id is first tag in the tag list for each object. public method get_table_row {id} { set tags [$canvas_ gettags $id] # look for row# tag (but only if not sorted!) if {[llength [$w_.cat sortcols]] == 0} { foreach tag $tags { if {[scan $tag "row#%d" rownum] == 1} { return $rownum } } } # search for $id in query results (slow way) set tag [lindex $tags 0] set rownum -1 foreach row [$results_ get_contents] { incr rownum set id [lindex $row [$w_.cat id_col]] if {"cat$id" == "$tag"} { return $rownum } } # not found return -1 } # This method is called when a region of the image has been selected # (From class SkyCat, via -regioncommand option when creating the image). # The arguments are the bounding box of the region in canvas coords. # Select any catalog symbols in the region. public method select_region {x0 y0 x1 y1} { # clear symbol selection first deselect_symbol $w_.selected $results_ clear_selection # make sure its is one of our objects foreach id [$canvas_ find enclosed $x0 $y0 $x1 $y1] { if {[$draw_ item_has_tag $id $object_tag_]} { set rownum [get_table_row $id] if {[info exists got_it($rownum)]} { continue } set got_it($rownum) 1 # select the object in the image and table if {$rownum >= 0} { select_symbol $id 1 $rownum } } } } # generate a dummy blank image for the purpose of plotting catalog # objects on it. Return 0 if OK, otherwise 1. public method gen_blank_image {} { if {[$w_.cat iswcs]} { # using world coords lassign [$w_.searchopts get_pos_radius] ra dec equinox radius if {"$equinox" == ""} { set equinox 2000 } if {"$ra" == "" || "$dec" == ""} { # can't create a blank image with no center # use coords from first row, if any set row [lindex $info_ 0] set ra [lindex $row [$w_.cat ra_col]] set dec [lindex $row [$w_.cat dec_col]] if {"$ra" == "" || "$dec" == ""} { return 1 } } if {[catch {lassign [$wcs_ hmstod $ra $dec] ra_deg dec_deg} msg]} { warning_dialog "$msg (ra = $ra, dec = $dec)" return 1 } # generate dummy image return [gen_wcs_image $ra_deg $dec_deg $equinox $radius] } else { # generate dummy image lassign [$w_.searchopts get_pos_radius] x y radius return [gen_pix_image $radius] } return 0 } # clear the table listing (done in base class) and remove any plot # symbols from the display. public method clear {} { AstroCat::clear # remove any catalog symbols (since table is also empty now) delete_objects } # Add the current image file to the history catalog under the given filename. # $skycat is the handle of the SkyCatCtrl itcl class object to use to extract image # infomation to put in the catalog. public proc add_history {skycat filename} { set catalog $history_catalog_ set image [$skycat get_image] # check if the directory for the catalog exists set dir [file dirname $catalog] if {! [file isdirectory $dir]} { if {[catch {exec mkdir $dir} msg]} { warning_dialog $msg return } } # make sure at least an empty catalog exists if {! [file exists $catalog] || [file size $catalog] == 0} { # If it doesn't exist yet, create an empty catalog file if {[catch {set fd [::open $catalog w]} msg]} { warning_dialog "can't create image history catalog: $msg" return } puts $fd "Skycat History Catalog v1.0" puts $fd "" puts $fd "ra_col: -1" puts $fd "dec_col: -1" puts $fd "x_col: -1" puts $fd "y_col: -1" puts $fd "show_cols: file ra dec object NAXIS NAXIS1 NAXIS2 NAXIS3" puts $fd "sort_cols: timestamp" puts $fd "sort_order: decreasing" puts $fd "" puts $fd [join $history_cols_ "\t"] puts $fd "----" ::close $fd # get the catalog into the list of known catalogs $astrocat_ open $catalog } if {"$filename" == "" || [string first /tmp $filename] == 0 \ || ! [file exists $filename]} { # ignore temporary and non-existant files return } # add an entry for the given image and filename set id [file tail $filename] lassign [$image wcscenter] ra dec equinox if { $ra == "" } { set ra "00:00:00" set dec "00:00:00" } set object [$image fits get OBJECT] set naxis [$image fits get NAXIS] set naxis1 [$image fits get NAXIS1] set naxis2 [$image fits get NAXIS2] set naxis3 [$image fits get NAXIS3] lassign [$image cut] lowcut highcut set colormap [$image cmap file] set itt [$image itt file] set colorscale [$image colorscale] set zoom [lindex [$image scale] 0] if {"$zoom" == ""} { set zoom 1 } set timestamp [clock seconds] # get full path name of file for preview URL if {"[string index $filename 0]" == "/"} { set fullpath $filename } else { set fullpath [pwd]/$filename } set preview file:$fullpath set data [list [list $id $ra $dec $object $naxis $naxis1 $naxis2 $naxis3\ $lowcut $highcut $colormap $itt $colorscale $zoom \ $timestamp $preview]] $astrocat_ open $catalog catch { $astrocat_ save $catalog 1 $data $equinox } # update history catalog window, if it is showing set w [cat::AstroCat::get_instance [file tail $catalog]] if {"$w" != "" && [winfo viewable $w]} { $w search } } # Check if the given filename is in the history catalog, and if so, # apply the cut levels and color settings for the file. # $skycat is the handle of a SkyCatCtrl itcl class object to use. public proc apply_history {skycat filename} { if {"$filename" == "" || [string first /tmp $filename] == 0 \ || ! [file exists $filename]} { # ignore temporary and non-existant files return } set catalog $history_catalog_ set image [$skycat get_image] if {[catch {$astrocat_ open $catalog}]} { # no catalog yet return } set list [$astrocat_ query -id [file tail $filename]] if {[llength $list] == 0} { # not in catalog return } set row [lindex $list 0] eval lassign {$row} $history_cols_ if {[catch {$image cut $lowcut $highcut 0}]} { # must be something wrong with this entry, remove it $astrocat_ remove $catalog return } $image cmap file $colormap $image itt file $itt $image colorscale $colorscale # after 1000 [list $skycat scale $zoom $zoom] # update the main panel and color window $skycat component info updateValues $skycat update_color_window } # Add at most $n image history entries to the given menu $m. # w is the TopLevelWidget containing the menubar and $skycat is # the handle to the SkyCatCtrl class to use to load an image. public proc add_history_menu_items {w skycat m n} { set catalog $history_catalog_ if {[catch {$astrocat_ open $catalog}]} { # no catalog yet return } set list [$astrocat_ query -nrows $n -sort timestamp -sortorder decreasing] foreach row $list { eval lassign {$row} $history_cols_ set filename [string range $PREVIEW 5 end] $m add command \ -label $file \ -command [list after idle $w busy \"$skycat config -file $filename\"] } } # -- options -- # Optional unique id, used in searching for already existing catalog widgets. itk_option define -id id Id "" { # in SkyCat.tcl, we passed the name of the SkyCatCtrl Itcl image widget as -id. set skycat_ $itk_option(-id) set canvas_ [$skycat_ get_canvas] set image_ [$skycat_ get_image] set draw_ [$skycat_ component draw] } # font used in canvas to mark objects itk_option define -canvasfont canvasFont CanvasFont -*-courier-medium-r-*-*-*-120-*-*-*-*-*-* # -- protected members -- # SkyCatCtrl widget instance protected variable skycat_ {} # internal rtdimage image for main image protected variable image_ {} # canvas window containing main image protected variable canvas_ {} # CanvasDraw object for drawing on image protected variable draw_ # array containing supported symbol names protected variable symbols_ # canvas tag used to identify all symbols for this instance protected variable tag_ # canvas tag used to identify all objects for this instance protected variable object_tag_ # canvas tag used to identify all labels for this instance protected variable label_tag_ # name of wcs object for converting between hh:mm:ss and double deg protected variable wcs_ ::skycat::.wcs # -- common class variables -- # name of the history catalog global ::env protected common history_catalog_ $env(HOME)/.skycat/history # list of columns in the history catalog protected common history_cols_ \ [list file ra dec object NAXIS NAXIS1 NAXIS2 NAXIS3 \ lowcut highcut colormap itt colorscale zoom timestamp PREVIEW] } # C++ wcs object used by procs below. wcs ::skycat::.wcs # convert a value in hh:mm:ss format to floating point format # (can be used in plot symbol expressions) proc hmstod {hms} { return [::skycat::.wcs hmstod $hms] } # convert a floating point format value to hh:mm:ss format # (can be used in plot symbol expressions) proc dtohms {d} { return [::skycat::.wcs dtohms $d] } skycat-3.1.2-starlink-1b/skycat/library/SkycatInit.tcl000066400000000000000000000011131215713201500226610ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: SkycatInit.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # SkycatInit.tcl # # script which is executed by Skycat.C to initialize the package # # who when what # -------- --------- ---------------------------------------------- # abrighto 02/01/06 created package require img::xpm package require Tclutil package require Astrotcl package require Cat if {![lcontain $auto_path $skycat_library]} { lappend auto_path $skycat_library } namespace eval skycat {namespace export *} namespace import -force skycat::* skycat-3.1.2-starlink-1b/skycat/library/main.tcl000066400000000000000000000003241215713201500215260ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # "@(#) $Id: main.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # main.tcl - main entry point for skycat application # package require Skycat skycat::SkyCat::startSkyCat skycat-3.1.2-starlink-1b/skycat/library/mkIndex.tcl000077500000000000000000000003211215713201500222010ustar00rootroot00000000000000#!../bin/skycat_wish # # mkIndex.tcl - generate a tclIndex file in the current directory # "@(#) $Id: mkIndex.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" package require Itcl auto_mkindex . *.tcl exit 0 skycat-3.1.2-starlink-1b/skycat/library/skycat-logo.xpm000066400000000000000000000651631215713201500230740ustar00rootroot00000000000000/* XPM */ static char * skycat_logo_xpm[] = { "454 59 8 1", " c #186130C2A699", ". c #38E369A6D75C", "X c #6185C71BFFFF", "o c #0000000079E7", "O c #BEFBFFFFFFFF", "+ c #000000005144", "@ c #000000000000", "# c #FFFFFFFFFFFF", " ....XXXXXXXX... o o o oo oo o o oo o oo oo oo . .....XXXXXX... oooooooooooooooooooooooooooooo ....XXXXXX... oooooooooooooooooooooooooooooo ....XXX.X.. oooooooooooooooooooooooooooooooo o ...X.X.X.. ooooooooooooooooooooooooooooooooo o o .....X.... oooooooooooooooooooooooooooooooooo o ooooo o .......... oooooooooooooooooooooooooooooooooo o oooooo ......... oooooooooooooooooooooooooooooooo", ". . .....XXXXXX... o o o o o o o o o oo oo o o . . . ...X.XXX.XX.. oo o o o o o o o o o oo oooo o .....X.X.X... oooooooooooooooooooooooooooooo . ..X..XX.... ooooooooooooooooooooooooooooooo o .....XX.X... ooooooooooooooooooooooooooooooo o o ...X.XX... ooooooooooooooooooooooooooooooooo o o ...XX.X.. ooooooooooooooooooooooooooooooooo o o o oo o ....X... ooooooooooooooooooooooooooooooo", " . . . ...X.XXXXXXX.. o o o o o o o o o o o ooo . . . . . ...X.XXXX.X.. oooooooooooooooooooo oooo oo . . ..X.XXXXXX... oooooooooooooooooooooooooooo . ....XXX.XX... ooooooooooooooooooooooooooooooo ....XX.X... oooooooooooooooooooooooooooooooo ...X..X... oooooooooooooooooooooooooooooooo o o o o o .....X..... oooooooooooooooooooooooooooooooooo o o oo ......... ooooooooooooooooooooooooooooooo", ". . . .....XXXXXXX.X.. o o o o ooo o o ooo oo o . . . . .....XXXXXXXX.. oo o o o o o o o ooo o oooo . . ....X.XXXX.X.. oooooooooooooooooooooooooooo . . ....X.XX.X.. ooooooooooooooooooooooooooooo ....XX.XXX... oooooooooooooooooooooooooooooo o o .....XX.X... oooooooooooooooooooooooooooooooo o o ...X.XX... ooooooooooooooooooooooooooooooo o oo o . ..X.XX... oooooooooooooooooooooooooooooo", ".. . . ...X.XXXXXXXX... o o o o o o o o o o ooo ... . .. ...X.XXXXXX.... oo oooooooooooooooo oooooo .. . . . ...XXXXXXX... o ooo oo ooooooooooooooooooo . . ....X.XXXXX.... oooooooooooooooooooooooooooo ...X.XX.X.... ooooooooooooooooooooooooooooo ...X.X.XX.X. oooooooooooooooooooooooooooooo o o ....X.X.X... ooooooooooooooooooooooooooooooo o o ....X..X... ooooooooooooooooooooooooooooo", "... . . ...X.XXXXXXXX... o o o o oo o oo o o o o . ..... . ....XXXXXXXXX... oo o o o o ooo o oooo . . . ...X.XXXXXXX... oo oo oo o ooooooooooooooo .. ...XXXXXXXX... oooooooo ooooooooooooooooooo . . ...XXXXXXX.. ooooooooooooooooooooooooooooo ...X.XXX..... ooooooooooooooooooooooooooooo o ....X.X.X... oooooooooooooooooooooooooooooo o o o ....XX.X... oooooooooooooooooooooooooooo", "..... ......XXXXXXXXXX... o oo o oo ooo o . .. ... . .....XXXXXXXX... o oo oooooo ooooo oo .. .. . . ...X.XXXXXXX... oooo o ooooooooooooooo . .... . . .....XXXXXX... ooooo o ooooooooooooooooo . ...X..XXX.X... oooooooo oooooooooooooooooo . ...XX.XXXX.. ooooooooooooooooooooooooooooo ..X.XXX.X.. oooooooooooooooooooooooooooooo o ...X..X.X... ooooooooooooooooooooooooooo", "....... ....XXXXXXXXX.X... o o o o oo oo ....... . ....XXXXXXXXX.X... o o oo oooo o ooo ..... . . .....XXXXXXXXX... o o ooooooooooooo .. . ...XXXXXXXXX... ooo o o o ooooooooooooooo ... . ....XXXXXXX... oooo o ooooooooooooooooo . . ....X.XXXX.... ooooooo o oooooooooooooooooo ....X.X.XX... oooooooooooooooooooooooooooo o ...XX.XX... oooooooooooooooooooooooooo", "..... .....X.XXXXXXXXXX... . . o o o o o o ...............XXXXXXXXXX... o ooo o oooo o . ..... . . ...X.XXXXXXX.X.. o ooooooooooooo o . ...... . .....X.XXXXX.X.. o ooooooooooooooo . . . . ...XX.XXXX.X... o o o o oooooooooooooo .. . . ...XXXXXXX... o ooo o o o ooooooooooooooo . ....XXXX.X... oooooo o oooooooooooooooooo .....XXX.X... ooooooooooooooooooooooooo", "............X.XXXXOXXXXX.... . . . oo o o oo oo ........ . .....XXXXXXXXXX... . oooooo ooooo ....... . . ...X.XXXXXXX.X.. oooooooooooo .... . . . ....XXXXXXXX.X... o ooooooooooooo ..... . . ...XXXXXXXX... oo ooooooooooooooo . . . ...X.XXXX.X.... o ooo o o ooooooooooooooo . ...X.X.XX.X... oooo o o oooooooooooooooo . ...X.X.XX.... ooooooo ooooooooooooooo", ".............XXXXXXXXXXXX.. . . . .... o oo o o ..............X.XXXXXXXXXX.... ... oo oooo oo ......... .....XXXXXXXXXX... . . oooooooooooo . ...... . . .....XXXXXXXX... oooooooooooo . .. ... . ......XXXXXXX... o ooooooooooooo . .... . . .....X.XXXXXX.. o o oooooooooooooo . ... ....XXXXX.X.. o oo ooooooooooooooo .. ....XXXXXX... ooo ooo oooooooooooo", ".X.X........X.XXXXXOXXXX.X... . ...... . oo o o oo ....X...........XXXXXOXXXX.X... . .... .. ooo oooooo ......... .....X.XXXXXXXX.X.... . .. . ooooooooo .......... ....XXXXXXXXX.X... . . oooooooooooo ...... . . ..X.XXXXXXXXX... . oooooooooooo .... .. ...XXXXXXXX..... o ooooooooooooo . ... ....XX.XXXXX... o o oooooooooooooo .. . ....X.X.X.X... o oo o ooooooooooo", "..X.X........XXXXXOXXOXXX..... .. ....... o o o o ......X........X.XXXXXXOXXXX.... . . . ... . oooo oo o ............ ...XXXXXXXXXXX... . . .. .. oooooooooo ......... ......X.XXXXXXXX... .. . oooooooooo .......... .....X.XXXXXX.X... . . . ooooooooooo . ..... .. .......XXXXXXXX.. . oooooooooooo .. .... . .....XXXXX.X... o oooooooooooo . ... . ...XXXXX.X... o o oooooooooo", "X.X.X.X........XXXXOXXXXXXX.... ........ ++oo o oo o ...X.X.X........X.XXXOXXXXXXX.... . ......... ooooooo ....X.X..........XXXXXXXXXXX... . . . ...... oooooooo ........... ....XXXXXXXXXXX. oooooo. ... ooooooooo ........ .. ....XXXXXXXXXX.... . .. . oooooooooo ....... . ...X.XXXXXXX.X... . . . ooooooooooo . .... .. . ...X.XXXXXX.X... . . oooooooooooo .. ..... . ... .......... o ooooooooo", ".X.X.X.X....X.XXXXXXOXOXXXXX..... ... ++++++oo+oo o o ...X.X.X........XXXXXXXOXXXXX...... ......... oo ooo ......X.......X..XXXXOXXXXXX... . . ......... oooooo ...X.X............XXXXXXXXX oooo o oo....... ooooooo ......... .. .....XXXXXXXXX.... . .... oooooooo ............ ...X.XXXXXXXX.... .. . ooooooooo ...... .. . ...X.XXXXXXX... . . oooooooooo ...... . ooo++++++ ... o . . ooooooo", "X.XXXX.X..X....o++.XXOXXXXX..........++++++++++ o o ...X.XX.X.X.....X.XXXXXOXXXXXX..... ............ o oooo ....XXX.X........XXXXXXXXXXX.X... . .......... o oooo .....X.X.........XXXXXXXXXX o++++oooo........ oooooooo ...X.X...........XXXXXXXXX.X... . . ......... oooooooo ............ .....XXXXXX.++@ . . ....... oooooooo oooo ...... ... .....XXXXXX.X.... ..... . oooooooooo ......... . oooo++@+@++++.... . . . ooooooo", ".XX.XXX.X...X.++++.OXXXOXXXXX........ +oo+++++o o ....X.XXX.X.X..X.X.XXXOXXOXXXX.X.........XX.... . o ...X.X.X.X......X.XXXXOXOXXXX.................. oo o ....XX.X.X.......X.XXXXOXXXX ++o+++ooo......... oooo .....X.X.........X.XXXXXXXXXX.... . ....... . ooooo ...X.X...........X.XXX.+@@@ ... . . . ...... oooooooo+oo ........ ....XXXXXXXXXX... . ... ooooooo ......... o o++@+++++ +..... .... . ooooo", "..XXXXXXXX.X. +o++.XOXOXOXXXXX.......... oooo++ ...XXXX.XX.X.X...XXXXXXOXXOXXXX............XX.... o o ...X.XXXX.X....... .. ..X.+ .... . ..... . ... o o ....XX.X.X.......X.XXXXXOXXX...++++oo.....X.... oooo ....X.XX.........X.XXXXXXXXX...... . ......... ooooo .....X.X..........XXXXX.@+@@..... . ........ ooooooo+++o..X.X...... .....XXXXXXXXX.... . ........ ooooooo ............ o + +++++ X.... . . ... . ooooo", "XXXXXXXX.XX.. o++ XXXOXXXXXXX.X......X.XX ooo+ . .....XXXXXX.X..X...XXXXXXOXXXXXXX......X.X.X.XX... ..........X.X. ++@++@@.++@++X..... +++++++ ...X.XXXX.XX......XXXXXXXXXXXX.+++ooo...X..X..... ...X.XX.XX........XXXXXXXXXXXX... . ............ o ...X.X.XX..........XXX.+++ .X...... ........... ooo++++o....X.X...........XXXXXXXXX.... . . ........ ooooo ..X.XX....... ....oo+++ XX..... ...... . ooo", "..XXXXXXXX.X. ++++XXXXOXOOXXXXX........XX.oooo+ ... ....XXXXXXXXXXXX..XXXXXXXOXXOXXXX.X........XXX. o+ o+++o+ .XX. +@+@++ +++@@++++X.... +@+++@++++@+ ...X.XXXXXXX.........XXXXXXXXXXX + +oo....X.X.X.... o ...X.XX.XXX.X.....X.XXXXOXXXXX.X... .. ....XX..... o ...X.XXXX.X........XXXX.+++ .XX... . .....X..... o o@+oo..XXX.X........X.XXXXXXXXX.... . . .......... o o o .....X..X...........oo+o+.X.X... . .......... o", "XXXXXXXXXXX..+@@@@ .XXXXXXXXX..X....X.X.X.ooo++... . . ....XXXXXXXXX.X.X....XX...XXXXXXX.......XX.X..++@+@@+@+@++++++@@@@@+...++@++++++++++++@ .XX.. +@+++@+++@+@++@ ....XXXXX... o++oo .. @@@.XXXX++++++.......X..... ...XX.XXX.X..X..X.X.XXXXXOXXXX..... ....X...... . ....X..X.X.X.....X.....++++++.... . . ...X.X..... oo++++oo....X..X........X.XXXXX. . ......X.... oo++ ...X.XX.X........X.o+o++.XXX..... . .......... o ", ".XXXXXXXX.o+@@@@@+@@@++.@++ + ..X.X...XX..++++@ . ooo o...XXXXXXXXXXX.. ++@@@++ .XXXXXX.......XXX.+++++++++++@++@++++++@ . @+++++ ....+++++.XX.X +++@+++ +++++++ . . .....XXX..+++++++++++++++++XXXXX +++ ..++o o ......XXXXXXXX..X...XXXXXXXXXXXXXX.. +@o . +++o . . . ...X.X....X. o+++++++@+++ +++++@ ..X.XX.... ooo++@+++oo o ooo+ ....XXXX.. ++++++ooo .....X.... o++++@+++ ..XXX.X.........+ ++.XXXX... . . ...X.X.... ", "X.XXXOXOX.++@@@@@@++++@@@+@+++ .X...X..XXX++++++ ++++++++++.XXXXXXXXXX ++++++++ ++ +o.XXXX.X.X..X.XXX.. +++@+++++++ + ++++@. +++@++.XXXXXO++@+.XXX. +@++++.X.X. ++@+@+ . . ...XXXX +++o++ ++++++++++@.OXXX.+++@+..o++++o+ +oo. . ...XXXXXXXXXXX.X.X..XXXXOXOXXX.. o++++@+++++ +oo .... oo oo++++++o .X.X... o+@+++@++@+@@@++++@+..X.X.X... ooooo++o+o+o+++o++++ .....X..++@++@+ooo o+oo ....X.XX. ++++++++++oo+++ .XX.X........o+ooo XXX.X... .. .......X.... ", ".XXXXXXXO +@+@+@+++@+@++++@++@.XX. ..X.X.++++++@+++++ +ooo+.XOXOOXX. +++o+++++ + + o.X.X.....X.XXXXXX.@++@ ......X.+@++ @+@+++.X.XXXXX.++++XXX +@++@ .X.XXXX +++++ ......X.X.+@++o++ + . +++++o+@.XOXX @+++o..o+++o+oooo+ooo.. ....X.XXXXXXXXX.X.X..XXXXXXXXXX.+ o+++++++@+o+ +oo.... oooooo+ +++++o ...X oo+++@+++@+@+@++++++ .X.XXX.X.. +ooooooo oooo+o+o+++ ..X.X..@++ooo++ooooo+++++..X..X. +oo++++++++++++@o.XXX.X....X ooooo.XXXXX..... ......XX.X.....", "XXXXXOXOX @+@@+@+@+++++....+..XXXX...X.XX.o+++++++.. ++ ++ XXXXXOX +++oo++o .+.++++ooo XX.X.X.X.XXXXXX @+++ .....XXX.+++@++++++.XXXXXXXO.@+@++X.+@+++ ...XXXXXX @+@++.......XX.++++++ ..X..X +o+o .XOXXX+++++ .. ++++o++++ +o ........XXXXXXXXXXX....X.X.XXXOXOX ++oo+++ ++o+o++oo.X...+o+oooo++ ++++@+ooo.X.. oo+++++@+++++ + + ...X.X.XXX. +oooooooooo+ ..X.....+++oo .X...oo+@++++ .XX..+++oooo . +o+++o .XXX.X.X...+oooo.XXXX.X... . ....X..X.X... ", ".XXXXXOXOXXX.+@+@++.XXXXXXXOXOXXXXX.X.X.X.o +++++ XX... +++oo.XOOXX o+++ooo..XXX..+++++++.XX...X.XXXXXXX ++@+ .... ...@+++@++@+..XXXXXXXX++++.X.@+++ ..X.X.XXXX. +++@ .....X.X.++@++.XXXXXXX.... + XXOXO.@+++o...o+++ooo++ ... .XXXXX. oo .OX +o o . .. +++ +o XX.. + @++o ..X +++ooooXXX.... +++++.X.X.........X.XXXX.X.... ooooo..X.XXXXX.XX.XX. +@++ .XXXXXX. ++@+@+ ....o++ooo . ... oo++o+ .XXX.X.X.. ooo.XXXXXXX..... ....XX.X.X...", "XXXXXOXOXOXOX.@@+@+.XXXOOOOXOXOXXXXX.X.XX.+++++o .XXXX..+oooo.XXXOX o+@+++ XXXXXOO.@+@+@+ XXXXX..X.XXXXX @++@.X..+++++..+++++@++@ .XXXXXXXX..XXXX++++@..X.X.XXXXXX.+@++ ......XX. ++@@XXOXXXXXXXXX+++XOXOX +@++oX.. o+oooo ...XX. oo ++++++@+OOXOX.++++++++@+@.. o+ooo .X...... +++o+..XX..++++ ..XXXXXX +oo .X.XXXX.oo++@XXXXXX........X.XXXXXXX... ooo o.XXXXXXXXXXXX.X ++++oo.XXOXXXXX. ++++++.X.o+++oo ..... ... oooooo.XXXX.X.X.++ ++.XXXXXXX.........X..XXXXXX.", ".XXXOXXOXOOXO.+++@+XXXOXXOXOOXOXXXX.XX.X..+@++o XXXXXXX.+ ooo XOOX o++++.XXXXXXXXO.+++++ XXX...X.XXXXXX.++++ .X @++@+..@.+. ++++@ .X.XXXXOXOOXO.@+@++.X....XXXXXX.@++@ .X.X.XXX. +@+++.OXXXXXXXX. .XXOXO.+++++..o+o ooo.XXXXXX. ooo++++ooo.XXXOX.+++++++++++. +++oo.XX..X.....++o + XXXX..+ ....XXXXXO.@+ o .XXXX.X.oo+++XOXXXXXX.....X.XXXXXXXXXX. ooooo.XXXOXOXOXXXXXX.+++oo.XXOXXXXXX.. +@+++ .. oooo XX........X ooooo.XXXXX.X..+.+++.XOXXXX.X..........XXXX.X..", "XXXXXOOXOOXOX.@++@ XXXXOXOXOXOXOXXXXX.X.X.@+++ XXXXXX.X.+oooo XXXX +++++ XXXXXXXOXOX@o+ XXXXXX.XXXXXXX+@+@++..+++@++XXOXOOX+@+++++ ....XXXXXOX.@++++.X.XXX.XXXXX.@++++..X.X.XX. +++++.XXXXXXXX...XXOXXOX.+++++.++ o o #XXOXXXXX ++ooo++o .XOOXOXX+++o+oooo+ @+++o XXXXX..X.X.++oo+ .XXXX.........XXXX.@ + o.XX.XXX oo++.XXOXXX........X.XXXXXXX.X. ooooo.XXXXXXOXXXXXXX..+o XXOXOXOXXXX..+++++ XX.+oo.XX.X......X..ooooo XXXXXXXX +@+++XXXOXXXXX.X......XX.XXXXXXX", "XXXXXXOOXOOOX.@++@+XXOXXOXOOOXOXOXXXXXXX..++++.OXOXXXXX.+ooo+ XOO.++o+++ . ++++ .XXX.X.X.XXXXX.@++++@++@+++@.XXOXOOX @+@+@@+@+@@@++XOO.++@+ .X...XXXXXXX.++@++.X.X.X.XX.++++++++ X. .XXXXOXOXOX.+ oo++ooo o.XXXXXXXXXX. +ooo+++.XXXOXOOOO.o+oo+ .OXX++++o.XXXX.X..... ++o+ XXXXXXX... @+@@@@@++++o .XXXXXX +++@+OXXOXXXXX...X..XXXXXXXXXXX +++o .XXXXOXXOOXXXXX @+ XXXXXXOXXXXXX. ++++ ..oooo.XXX.X......XX.oooo+XOXXXXXX ++.++.XOXOXXXXX.........X.XXXXXX", "XXXXXOXXOOXOO++@+@.XXXOXOXOXOOOOXOXXXX.XX.oo++.XOXOXXXX.++ +++XXX.+++++@+++oooo + +++ +++.XXXXXX.XXXXXX +++@++@+++++@.OXXOXOOO.+++++++++++@+@ O @++@+.XXXX..XXXXO.@+++@.XXX.XXXXO.++o+++@++. +++++ .XXOXO.oo oo+o o XXXXXXXOXXXXX. +oo++.OXOXOXOXO o++o+.XXXOOX.+oXOXXXXX.X.X.. . .XXXXXXX + o+++++++++++++.XXXXXX o+++ XOOXXXX.X.X..X.X.XXXXXXXX. ++++ .XXXXXXOXXOOXXX @++ XXXOXOXXOXXXX..oo+++ .ooo XXXXX.X.X..X.X.ooo+@.XOXXXXX.++@+@.XXXXOXXXXX........XXXXXXXX", "XXXXOXXOOOOOO+@++++XXOXXXOXOXOXOXOXXXXXX. o+o+.OXOXXOXXX++++++XXO++ ++++++++oooo++ +++.XXXXXX.X.XXXXX.@+@+++++@+@++.XXOXOOOXOX.+++@++++++++@.++++++XX.X..XXXXXX.++@++.XX.XXXXXXOX ++o+oo +++@+++@+XXOO.+ oooooooo+.XXXXXOXXXXXXX.. + XXOXOXOXOX++++++XXXX. ++ OXOXXX.X.X.XX.XXXXXXXX. ++o+o++@+@+@+++++ XXXXXXX +++++XXXXOXXXXX....X.XXXXXXXXXX +++oo.XXXXOOXOOXXOXX++++ XXXXXXOXOXXXXX.oooo+.oo o.XXXXXX.X..X.XX.ooo++XOXOXXXX.@.++@.XOXOXXXXXX.X....X.X.XXXXXX", "XXXXXOOOXOOOX+++++.OXXXOOXOOOOOXOXOXXXXXX ooo+.XOXOOXXXX+++ +.XOX+++++@+@+++++oo o+++ ..XOOXXXXXXXXXXXX.@+++@.X.++++@.XOXOXOOOOOXXX..XXX.+@+++@ @+@++.XXXXXX.XXXX.@+++@.XXXXX.XXXXX..X.X.. oo+@++++++.OXO. ++++oooo++ .XXXXXOXOXXXXX. + .XXOXOOOX@+@+@+XXXXX @+++.OXXOXXXX..X.XXXXXXOXO. ++oooo ..@+++ +XOXXXXX+++++.OOOOXXXXX.XX.X.XXXXXXOXXXX++++o.XXXXXXXOXOOOXO @+o+.XXXOXOXOXOXXXX.oo oo +ooo.XXXXXXXX.X.X.X.+++++XXOXOXXX.+@.@ .OXOXOXOXXXX......X.XXXXXXX", "XXXXXXXOOOOOO+++++.XOXOXXOXOXOOOOXOXXXXXX.oo++XOXOXXOOXX++o +XXO.++++++.. . . .X..OOXOXOXOXXXX.XXXXXX.@++++XXX.+@++.XXXXX.XX.XOOOOOXXXO.++@++.@++++.XXX.X.XXXXO.@++++XXXXXXXXX.. +.XOOOO.X...+++@+@.OOXO + +X. ++++ .XXOXXOXOXXXXX oo++ XOXOXO.@++++.XXXXX ++++.OOXXXXXXX.X.X.XXXXXX.+++++o ..X.XXO.++++o.XOXXXX ++o+ XXXOOXOXXX.X..X.XXXXXXOXXX +++ .XXXOXOXOXOXOX+++o+ XXXXOXOXOXOXXX. oooooooo+ XXXXXXXXX.X.XX.+@+o+XOOXOXOX..@@+@.XXXOXOXOXXXXX.....X.XXXXXX", "XXXOXOXOXOOOO++ ++@XXOXXOXOOOOXOOOXOOXXXX.o++@.XOXOOXXOX + + .OXX + ++.XOOXOOXXOXOOOXOOOOOOXOXXXX.XXXXX.+@+@+XOOX.++@.X..+@+@+@+XOOXXOXOXX++++@ ++@+@+XXXXXXXXXXX.++@++XXXXXXXX.+++++XOOOOOOOOOXO +@.OXOO.+ + XO. ++++ .XXXOXXXOOXXX. o+++ XOOOO ++++@XOXOXO +++@+XXOOOXXXXX.X.XXXXXOX @+++++.XXXXXXOXX o+.OXOOXX ++++ XOOXXOXXXXX.XX.X.XXXXXXXOX ++++ .XXXXOXOOOOOOO.+ooooXXOXXOXOXOXOXX oooo oo+++.XOXXXXXXXXX.X.+++o+XXOOXOXO.@.+ +.OXOXOXOXXXXX.X.X.X.XXXXXXX", "OXOXXXOXOOOOX.++++.XOOXOXOXOXOOXOXOOXXXXXXo++@XXOXOXOOOX++oo+ XXOX+++oo@OOOOOXXOOXOXOOXXXXXOXOXXXXXXXXXO.@++++XXXXX.. XX@@@++++++XOOOOXOXOX @++@X++++++XXXXX.XXXXX+@++@.XOOXXXXX.+o++XOOOOOOOOOXOXO. +.XOOX + + OXX. ++XXOXXOOXXOXXX.o+@++.XXO.+ooo+XOXOXXX.++@++XOOXXOXXXXXXX...XXXX.++++ .XXXXXXXXX++ooo .OOXXOX +++o+XOXOOOXOXXXX..X.XXXXXOXOXX oo+++.XXXXXOXOXOXXX.++oo .XXXOXXOXOXOXX++o++ .o+++@.OXXOXXXXX.XXX++@ +.XOOXOXOX.+@@ +.XOXXOXOXOXXXX.X.X..XXXXXOX", "XXXXOXOOOOOOO.@ +++XOXOXOXOOOX +.OOXOOXXX.++++.OXOXOXOXX@++ + XOXO.+ooo+.OOOXOOXXOXOXX.@@.OOOXOXXXXXXXXX.@++@ XOOOXXXXXX++++@+@++OOOXOOXOX.@++@+XX+@+++.XXXXXXXXX @++++XOXXOXXXXX ++++.OOOOOOXOXOX.++ XOOX.+ ++.OXOX.+ +++.XXOXOXOXXOXXXo+++ +XOX++ooo XOXXOXOX.@++++XOOOXXXXX.X..@+ XOX.+++o XXXXXXXX.++oo o+XOXOOXX.++++ XOOXOXOXOX. + .XX.XXXXOXOX.o+ ++XXXXOXXOXOX.+.X.@oo++XXXXOOXOXOXX.+++++.. +++o .XOXXOXXXXXX @++o+XOOOOOOXO+@ o+o.XXOOXOXOXOXXXX.X.XX.XXXXXO", "OOXOXOXXOOOOO.+++++XOOXOXO. o+.@+XOOXOXOX.+@+@.OXOOOOXOX ++++ XXOOX oo++@.OOOXOOXOXX.@@+o XOOOXOXXXXXXXX.+@++@XOXXOOXOX.@++++++++.XOOOOXOX++++++OO.@+@+@XOXXXXXX @++@+ XOOXXOXXXX.o+@+@.XOOOOOOX.@+ o XOXOX.+++.OXXXX. +@@.XXOXOXOXXOXXX.++o +XX.+oooXOOOXOXXO.+++++oXXOOOXXXXX ++@@ XOX +++ XXXXXXX.+o+oo o+.OOXOOX.o++@+.XOOOOXX.++ ++..XXXXXXXOXO.o +++.XXXXOXX.++ ++X.++++++XOXXOXOOOX +oo++ XX.++++ .XXOXXXXXX. ++++o OOXOOXOOX.++ooo.OXXOXOOXOXOXXXX.X..XXXXXXX", "XXOXXXOOXOOOOO+++ ++XXXOOX. +@+++.OOOXOXX.++++.XOXOXOOOX ++ ++XOXOO. +++++.XOOOXOX.+@+++oo OXOOXOXXXXXXX.+++@.XOOOXXXXOX+@+@++@+@@++ .XX ++@+@+XOOX +++++..XXX.++++++@XOOXOOXOXOX.oo+++++..X.. +@+@+oXXXXX. +@@.OOOOX.+++o+@+XXXXOXOOXOXOXXooo+ ++++ XOOOXOXOXX.++oo+o.XXXOXX. ++++++.XX +++++..XX. ooooo oo++XXOXXOX o++++XXXXOO.@+@+@+ XXXXXOXOXXO. ++++ .XXXXX.+++++@XO.++++@+ .XXOX.o ooooo@..X..++ ++ ..XOXX. +@+@+++XXOOOOOOOO.+o+++.XOXOXOXOXOXXXXXX.XX.XXXXXO", "OOOXOOOXOOOOOO.@++++ ...+@++++ .OOOOXXX.+o+ ..XXOX ..+++++ ....XO.o+@+++..XX. +@+++++o .OOOOOXOXXX. .+@+@ @.+...XXX.+@++++@+++++++@+@@+@+++ OOOO.+@+@++@.. +++@+@+XOOXOOXOXOXXooo ooo ++ ++@++++o.OXo+ +++++XOXXX. ++++ +@++XOOXOXOXXX oo ++++++XOOOOOOXOXOX oooo + .XX. +++++ .XOO o++++o o++ooooooo +.+.OOX.o++++ ..X.@++++++ X.XXXXXXXOOX.+ +++@++.X.+++++++XOO.++++++@++o+.. oooo+.XXXXX +++ ++++ +@.++++@+.XXOXOXOXXX.o+o+++.....XXXXOXOXXXXXX.XXXXXOX", "OXXOXXXOOOOOOOX@++oo+ o +@+++o..XXOOO. +..+ oo+ ++XO +++++o +++XOOXX ++++++ @+++++++ ..OOOOOXOOXOXX+@@++++++@@+@@+++@+++@++++@++@+@++++++++.XOOOOO.+++++++.@++@++ XOXOOXOXOXXO oo oo oooo+++oo+ .XOO.+oo+ +oo OOXOX.@++++oo++++.XOXOXXOXX.++++ +++ OOOOOXOOXOXOX+o o++++o o ++++ .XXOXXX.+++oooooo+++ooooooo+ ++XOOXX +++++++ +@++++...XXXXXXXOXOXXOX ++++++@++@++++ ..OOOX.+++ +++++ .. oo XXXXXXX..+++ +++++++..++@ .XOO.. .. +++ + + ++@@@@@.XOOXOXXXX.XX.XXXXO", "OOOXOOOXOXOOOO#X.@oo+++++++.XXXOOOOOO.@+@++oo +o +.O +o+++oo +@.OOOOX+ ++++@+@+. + .OOOOOOOOOOXOXOX ++@++++++++++@+++@+++@+++++ +++++++++..XOOXOOOOX++++++++@+ ..XOXOXOOOOXOOX.oooo o .XOOXO.+ .+ .XOOXOX.+ +oo o+++ XOOXOOXOO.++++++++.OOOOOOOXOXOOOX +o+++++oo+++o .XXXXOOOX.+++oo++++oo +oo o o + XOOOOX +++++++++ .X.XXXXXXXXXXXOXOOXOX+o+o++++++ ..XXOOOOOOO..+ @@+.@+ .X .XOXXXXXXXX..+ +o+++.@@XX .XXOXX+@@@@+++ + +o o o++++@@XOOOXOXXXXXXXXXXXX", "OOOOOXXOOOOOOOO#XX....+..XOOOOOOOOOOOX+++ + @.X o + oo +.+XOOOO#X. ++ +XX.XOXOOOOOOOOOOOXOX. + ++ ++++++ +++++++ ++ +XOOX.+..XXXOOOOOOOOOOOOX.X..++ XXOXOXOOOOXOOOXOX. o.XX......O#OOOOOOOXXXO.OOOOOOOOOXO.XX. +.XXOOOXOXOX++o++++ XOOOOOOOOOOOXOO#. ++ + + + XXXXXXXXOOOOX. + XX...... .+XOOXOOX. +..XXOOOOOOXXXXXXXXXXOXOOOX. .+.XXOOOOOOOOOOOOOX.. +@ XOOOOXOOXXXXXXXXX.. @ +.XOXXXXXO.+++++@++ o o o +@XOOXOXOXXXXXXXXXXO", "OOXOXOOOXOOOOOOO#O#OOOOOOOOOOOOOOOOOOX. .XXXX..X..XO...X.XXXX.XOXXOOOOOOO##OOXX.XOOOOOOOOOOOOOOOOXOOXOXOXOOOOOOOOOOOXXXX.XOXOOOOOOO#O##OOOOOOXOXOOOOOOOOOOOOOXXOXXXXXOXOXOOOOOOXOOXXXOOOOOOO###OOOOOXOXOOOOOOOOOOOOXOXOXOXXOOOXOXOOOOOXOOXOX ooooo+X#OOOOOOOOOXOXOOOOOOXX......XXXXXXXXOXOXOOOOOXXXX.XOOOOOOO#O#O#OOOOOXOOOOOOOOOOOOOOOXXOXXXXXXXOOXOOXOOOOOOOXOOXOXOOOOOOOOOOOOOOOOX.XXOOOOOOOOOXXXXXXXXXXXOOXX.XXOOOXXXOXOX @+++..XX.X.X.XX.X... XOOXOOXOXXXXXXXXXOX", "OOOOOOXOOOOOOO#OO#OO#OOOOOOOOOOOOOOOOOOOOOOOXOOXOOOXOOOOOOOOOOOXOOOOOOOOOOO#OO#OOOOOOOOOOOOOOOOOOOOXOXOXXXXOXOXOOOOOOOXOOOXOOOOOOOOO#OOOOOOOOOOOOOOOOOOOOOOOXOXXOXOXOXOOOOOOOXOOXOOXOXOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOXOXXOXXXOOOOOOOOOOXOXX.+oooo.#OOOOOOOOOOOOOXOXOOOOOOOOOOOOXOXXXOXXOXOOXOOOOOOXOOXXXOOOOOOOOOOOOOOOOXOXOOOOOOOOOOXOOXXXXXXXOXXOXOOOOOXOXXOXXOXOOOOOOOOOOOOOXOXOXOOOXOOOOOOXOXOXXXXXXXOXOXOOOOOOXXOXOXOXOXXOOOOOOOOOOOOOXOOOOOOOOOOOOOXOXXXXXXXXXX", "OOOOOOOXOOOOOOO#O##OOOOOOOOOOOOOOOOOOOOOOOXOOXXOXXOOOOOOOOOOOOOOXOXOOOOO#O#O#OOOOOOOOOOOOOOOOOOOOOOOXOXOXOXOOOOOOOOOOOOOXOOXOOOOOO#OO#OOOOOOOOXOOOOOOOOOOOOOOXOXXXXOXOXOOOOOOOOOOXOOXOXOOOOOO#OOOOOOOOXOOOOOOOOOOOOOOXOXOXXXOXXOXOOOOOOOOOOX@oooo.OOOOO#OOOOOOOXOOOOOOOOOOOOOOXOXXOXXXOXXOXOOOOOOOOOXOXOOXOOOOOOOOOOOOOOOOXOXOXOOOOOOOOOXOOXOXXXXOXOOXOXOOOXOXOXOXOXOOOOOOOOOOOOOOOXOXOOOOOOOOOOOOXOXXXXXXXOXOXOOXOXOOXOXXXOXOOOOOOOOOOOOOOOOXXXOXOOOOOOXOOXOXXXXXXXOX", "OOOOOOOOOXOOOOOO#OO###OOOOOOOOOOOOOOOOOOOOOOXOOXOXOXOOOOOOOOOOXOOOOOOOOOO#OO#O#OOOOOOOOOOOOOOOOOOOOOOXOXOXOXOXOOOOOOOOOOOXOOXOOOOOO#O#O#OOOOOOOOXOOOOOOOOOOOOOXOOOXXOXOOXOOOOOOOOOOXOOOOOOOOOO#O#OOOOOOOXOXOOOOOOOOOOOOOXOXOXXOXOOXOOOOOOOX.+ooooXOOOOOOOOOOOOOOOXOXOOOOOOOOOOOOOOXXOXXXOXOXOOOOOOXOXOXOXOXOOOOOO#OOOOOOXOOOOOOOOOOOOOOOOOXOXXXOXXOXOOOOOOOOOOXOXOXOXOOOOOOOOOOOOOOOOOOXOOOOOOOOXOOXOOXXXXXXOXOXOOOOXOXOXOOXOXOOOOOOOOOOOOOOXOOOXOOXOOOOOOOOXOXXXXXXXO", "OOOOOOOOOOOOOOOO#O##OO#OOOOOOOOOOOOOO#OOOOOXOOXXOXOOOOOOOOOOOOOOOXOXOOOOOOO#O#O#OOOOOOOOOOOOOOOOOOOOOOXOXOXOXOOOOOOOOOOOOOOOOOOOOOOO#OO#OOOOOOOOOOOOOOOOOOOOOOOOXXOXOXOXOOOOOOOOOOXOXOXOOOOO#OO#OOOOOOOOOOOOOOOOOOOOOOOXOXOXXOOXOXOOOOOOOO.@++ooOOOOOOO#O#OOOOOOOOOOOOOOOOOOOOOOXOXOXXOXOXOOOXOOOOOOOXOOXOOOOOOOOOOOOOOOOOXOXOXOOOOOOOOOOXOXOXOXXOXXOXOOOOOOOXOOXOXOOOOOOOOOOOOOOOXOXOXOOXOOOOOOOOXOXXXOXOXOXXOOOOOOOOOXOXXOXOOOOOOOOOOOOOOOOXOXOOXOOOOOOOOXOOXOXXXOXX", "OOOOOOOOOOOOOOO#O#OO#OOOOOOOOOOOOOO#OOOOOOOOOXOOXOOXOOOOOOOOOOOOOOOOOOOOO##O#O#OOOOOOOOOOOOOOOOOOOOOOOOXOXOXOOOOOOOOOOOOOOXOOOOOOOO#O#OO#OOOOOOOOOOOOOOOOOOOOOXOXOXOXOOOOOOOOOOOOOOOOOOOOOOOOO#OO#OOOOOOOOOOOOOOOOOOOOOOOXOXOXXOOOOOOOOXXX+++++o.OXOOOOOOOO#OOOOOOOOXOOOOOOOOOOOOOXOXOXOXOXOOOOOOOOOOOXOOXOOOOOOO#OOOOOOOOOOOOOOOOOOOOOOOOOXOXXXOXOOXOOOOOOOOOOXOXOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXXXXXXOOXOOOOOOOOOXOOXOXOXOOOOOOOOOOOOOOOOXOOOOOOOOOOOOXOXOXXXXO", "OOOOOOOOOOOOOOOO#O#O####OOOOOOOOOOOO#O#OOOOOOOXOOXOOOOOOOOOOOOOOOOOOOOOOOOO#O#O##OOOOOOOOOOOOO#OOOOOOOOOXOXOXOXOOOOOOOOOOOOOXOOOOOOO#O#OO#OOOOOOOOOOOOOOOOOOOOOOOXOXOXXOOOOOOOOOOOOOXOXOOOOOO#O#OO#OOOOOOOOOOOOOOOOOOOOOOOXOXOXXOXXX.X...+++ooo .OOO#O#OOOOOOOOOOOOOOOOOOOOOOOOOOXOXXXOXOXOOOOOOOOOOOXOOXOOOOOOOO#OOOOOOOOOXOOOOOOOOOOOOOOXOOXXXXOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOXOXOOOOOOOOOOOOXOOXOXOXXOOXOOOOOOXOOXOOXOOOOOOOOOOOOOOOOXOOOXOOOOOOOOOOOOXOXOXOXX", "O#OOOOOOOOOOOOOOO#O#OOOO#OOOOOOOOOOOOOO#OOOOOOOXOOXOXOOOOOOOOOOOOOOOOOOOOO#O#O#OO#OOOOOOOOOOOOOO#OOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOO#OOO#O#O#OOOOOOOOOOOOOO#OOOOOOOOXOXOOOXOOOOOOOOOOOOOOOOOOOOOOO#OO#OOOOOOOOOOOOOOOOOOOOOOOXOXOXOO.++++@@+ooo+ooo+ XOOOOOO#O#OOOOOOOOOOOOOOOOOOOOOOOXOOXOXOOOOOOOOOOOOOOXOOOOOOOOOOO#OOOOOOOOOOOOOOOOOOOOOOOOXXOXOOXOXOOOOOOOOOOXOOOXOOOOOOO#OOOOOOOOOOOXOOOOOOOOOOOOOXOXOXXOXXOOOOOOOOOOOOXOOXOOOOOOOOOOOOOOOOXOOOXOOOOOOOOOOOXOXXXXO", "OOO#OOOOOOOOOOO#O#O#O###O#OOOOOOOOO#O##O#OOOOOOOOXOOOOOOOO#OOOOOOOOOOOOOO#O#OO#O#O#OOOOOOOOOOOO#OOOOOOOOOOOXOXOOOOOOOOOOOOOOOOOOOOOO##OO#OO#OOOOOOOOOOOO#OOOOOOOOOOOOXOXOOOOOOOOOOOOOOOOOOOOO#O#OO#O#OOOOOOOOOOOOOOOOOOOOOOOXOXOOX ooo+++oooooooo+ OOOO#O#OOOOOOOOOOOOOOOOOOOOOOOOOOOOXOXOOXOOOOOOOOOOOOOOOXOOOOO#OOOO#OOOOOOOOOOOOOOOOOOOOOOOOXOXXOXOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOXXOXOOOXOOOOOOOOOXOOXOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOXOOOXOXOX", "O#OOOOOOOOOOOOOO#O#O#OOO#O#OOOOOOOOOOOO#O#OOOOOOOOOXOOOOOOOO#OOOOOOOOOOOOO#O##O#O#O#OOOOOOOOO#OO#O#OOOOOXOXOOOOOOOOO#OOOOOOOOOOOOOO#OO#OO#OO#OOOOOOOOOOOOO#OOOOOOOXOXOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOOOO#OOOOOOOOOOO#OOOOOOOXOOXOXOX.ooo+++ . +.OOOOOOOO#O#OOOOOOOOOOOOOOO#OOOOOOXOXOXOXOOOOOOOOOOOOOOOXOOOOOOOO#OOOOOOOOOOOXOOOOOOOOOOOOOXOXOXOXOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOXOOXOXOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOXOXXO", "O####O#OOOOOOOOO#O#O###O#O#OOOOOOOOO##O#O#OOOOOOOXOOOOOOOO#OO#OOOOOOOOOOOOO#OO#O#O#O#OOOOOOOOO#OO#O#OOOOOOOOXOOOOOOOO#O#OOOOOOOOOOOO#OO#OO#OO#OOOOOOOOO#O#O#O#OOOOOOOXOXOOOOOOO#OOOOOOOOOOOOO#O#O#O#O#OOOOOOOOOOOOO#O#OOOOOOOOOOOO...OXOO####OOOOXOOOOO#O#OOOO#OOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#OOOOOOOOOOOOOOOOOOOOOOOOXOXOXOOOOOOOOOOOOOOOOOOOOOOOO#OOOOOOOOOOOOOOOOOOOOOOOOOOOXOXOXOXOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOXOXO", "OOOOO#OOOOOOOO#OO#O#OOO#O#O##OOOOOOOOO#O#O##OOOOOOOOOOOOOOO##O##OOOOOOOOO#O#O#O#O#O#O#OOOOOOOOOO#O#OOOOOOOOOOXOOOOO#OO#O#OOOOOOOOOOOOO#O#O#O#OOOOOOOOOOOOO#O#OOOOOOOOOOOOOOOO#OO#OOOOOOOOOOOOOOOOO#OOO#OOOOOOOOOOOOO#OOOOOOOXOXOXOOOOO#OOOOOOOOOOOOOOOOOOOOO#OO#OOOOOOOOOOOO#O#OOOOOOOOOOXOXOOOOOOOOOOOOOOOOOOOOO#OOO#OOOOOOOOOOOOOOOOOOOOOOOOXOOXOOOXOOOOOOOOOOOOOOOOOOOOOOOOO#OOOOOOOOOOOOOOOOOOOOOOOOOOOXOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOX", "O#####O##OOOOOOOO#O#O###O#O#OO#OOOO#O#O#O#OO#OOOOOOOOOOOOO#OOO#OO#OOOOOOOO#O#O#O#O#O#OOOOOOOOOO#O#OO##OOOOOOOOOOOOOOO#O#OO#OOOOOOOOO##O#O#O#OO##OOOOOOOOO#OOOO#OOOOOOOXOOOOOOOO#OO#OOOOOOOOOOO#O#OO#O#OO#OOOOOOOOOO#OOO#OOOOOOOOOOOOOOOO#O#O#OOOOOOOOOO#O#O#OOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOO#OOOOOOOOOOOOOOOO#OOOOO#OOOOOOOOOOOOO#OOOOOOOOOOXOXOOOOOOOOOOOOOOOOOOOOOO#OOOOOOOOOOOOOOOOOOOOOOOOOOOOXOXOXOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOXO", "O#OOOO#OO#OOOO#O#O#O#OOO#O#O##OOOOOOOO#O#O##OOOOOOOOOOOOOOO###O##OOOOOOOOOO#O#O#O#O#O##OOOOOO#OO#O##OOOOOOOOOOOOOOOO#OOO#OOOOOOOOOO#OO#OOO#O#OOOOOOOOOOO#O#O#OO#OOOOOOOOOOOOOO#OO#OO#OOOOOOOO#OOO#OOOOO#OOOOOOOOOO#OO#OOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOO#O#O#OOOOOOOOOO#O#O#OOOOOOXOOXOOOOOOOOO#OOOOOOOOOOOOOOOOOO#OOOOOOOOOOOOOOOOO#OOOOOOXOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOX", "OO###O##O#O#OOOO#O#O###O#O#OO#O#O#OO#O#O#OO###OOOOOOOOOOO#OOO#OO#O##OOOO#O#O#O#O#OOO#OO##OOOOO#OO#OO###OOOOOOOOOOOOOO##O####O#OOOOOO#OO##OOOO##O#OOOOOOOOOO#O#OO#OOOOOOOOOOOOOO#OO#OOOOOOOOOOO#OOO#O#O#OO#OOOOOOOOO#OO#O#OOOOOOOOXOOOOOO#O#O#O#OOOOOOOO#O#O#OOOOOOO#OOOOOOOOOOOOO#OOOOOOOOOOOOOOOO#OOOOOOOOOOOOOO#OO#OOOOO#OOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOO#OOOOOOOOOOOOOOOO#OO#OOOOOOOOOOOOOOOO#OOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOO", "O#OOO#O#O#O#O#O#O#O#OOO#O#O#O#O#OO#OOOO#O##OOO##OOOOOOOOOOO##O##O#OO#O#OOOO#O#O#O##O#O#OO#O#OOO#O#O#OOO#OOOOOOOOOOOO#OOOOOOO#O#OOO#OO##OO#O##OO#O##OOOOO#O#OO#O#OOOOOOOOOOOOOO#OO#OO#O#OOOOOOOOO#OO#OOO#OO#OOOOOOOOOO#OOO#OOOOOOOOOOOOOOOOOOOOO#OOOOOOOOOOOOO#O#O#OOOOOOOOOOO#O#OO#OOOOOOOOXOOOOOOOOOO#OOOOOOOOOOOOOOOOO#OOOOOOOOOOOOOO#OO#OOOOOOOOXOOOOOOOOOOO#OOOOOOOOOOOOOOOOOO#OOOOOOOOOOOOOOOOOOOOOOOOOOXOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"}; skycat-3.1.2-starlink-1b/skycat/library/skycat_defaults.tcl000066400000000000000000000017511215713201500237740ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: skycat_defaults.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # catdefaults.tcl - X defaults for itk catalog widgets # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 20 May 96 created # itk widget defaults (normally you'd put these in the itk sources, but # putting them here makes it easier to "pre-load" the classes for the single # binary version... proc skycat::setXdefaults {} { option add *SkyCatCtrl.canvasBackground black option add *SkyCatCtrl.canvasBackground black option add *SkyCatCtrl.canvasWidth 520 option add *SkyCatCtrl.canvasHeight 520 option add *SkyQueryResult.relief sunken option add *SkyQueryResult.borderwidth 3 option add *SkyQueryResult.font TkFixedFont option add *SkyQueryResult.headingFont TkDefaultFont option add *SkyQueryResult.headingLines 1 option add *SkyQueryResult.titleFont TkDefaultFont } skycat-3.1.2-starlink-1b/skycat/linux/000077500000000000000000000000001215713201500175725ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/skycat/linux/make_rpm.sh000077500000000000000000000012071215713201500217240ustar00rootroot00000000000000#!/bin/sh # These commands need to be run as root to build the skycat RPM dir=/usr/src/redhat test -d $dir || dir=/usr/src/packages if test ! -d $dir ; then echo "Can't build RPM since there is no /usr/src/redhat or /usr/src/packages dir." exit 1 fi if test ! -f skycat.spec ; then echo "skycat.spec does not exist: Please run configure to generate." exit 1 fi version=`cat ../VERSION` src=../release/$version.tar.gz if test ! -f $src ; then echo "$src does not exist: Please run 'make release' to generate." exit 1 fi (cp $src $dir/SOURCES/ && cp skycat.spec $dir/SPECS/ && cd $dir/SPECS && rpmbuild -ba skycat.spec) skycat-3.1.2-starlink-1b/skycat/linux/skycat.spec.in000066400000000000000000000040151215713201500223510ustar00rootroot00000000000000Summary: FITS Image Display and Catalog Search Tool for Astronomy Name: skycat Version: @PACKAGE_VERSION@ Release: 1 License: GNU General Public License Group: Applications/Engineering URL: http://archive.eso.org/skycat/ Source0: %{name}-%{version}.tar.gz Requires: tcl, tk, itcl, tclx, blt, tkimg BuildRequires: %{_includedir}/tk.h, %{_includedir}/tcl.h BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root %description SkyCat is a tool that combines visualization of images and access to catalogs and archive data for astronomy. Note: There is also a Java version of Skycat called JSkycat available as part of the JSky package. Authors: -------- Allan Brighton (abrighto@eso.org) Thomas Herlin (therlin@eso.org) Miguel Albrecht (malbrech@eso.org) Daniel Durand (durand@dao.nrc.ca) Peter Biereichel (pbiereic@eso.org) %prep %setup -q -n %name-%version %build export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" mkdir build cd build ../configure \ --prefix=%_prefix \ --exec-prefix=%_prefix \ --libdir=%_libdir \ --mandir=%_mandir \ --with-tcl=%_libdir \ --with-tk=%_libdir make %install cd build make install DESTDIR=%buildroot %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc CHANGES COPYING README %{_bindir}/skycat %{_bindir}/rtd %{_bindir}/tRtd %{_bindir}/rtdServer %{_bindir}/rtdClient %{_bindir}/rtdCubeDisplay %{_libdir}/tclutil@tclutil_VERSION@ %{_libdir}/astrotcl@astrotcl_VERSION@ %{_libdir}/rtd@rtd_VERSION@ %{_libdir}/cat@cat_VERSION@ %{_libdir}/skycat@PACKAGE_VERSION@ %{_libdir}/@tclutil_LIB_FILE@ %{_libdir}/@astrotcl_LIB_FILE@ %{_libdir}/@rtd_LIB_FILE@ %{_libdir}/@cat_LIB_FILE@ %{_libdir}/@PKG_LIB_FILE@ %{_libdir}/librtdImgEvt.a %{_libdir}/librtdRemote.a %{_libdir}/tclutilConfig.sh %{_libdir}/astrotclConfig.sh %{_libdir}/rtdConfig.sh %{_libdir}/catConfig.sh %{_libdir}/skycatConfig.sh %{_includedir}/tclutil %{_includedir}/astrotcl %{_includedir}/rtd %{_includedir}/cat %{_includedir}/skycat %changelog * Mon Jan 30 2006 Allan Brighton - - Initial rpm build. skycat-3.1.2-starlink-1b/skycat/mac/000077500000000000000000000000001215713201500171735ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/skycat/mac/Info.plist000066400000000000000000000015661215713201500211530ustar00rootroot00000000000000 CFBundleDevelopmentRegion English CFBundleExecutable skycat CFBundleGetInfoString Skycat 3.0, © 2006 ESO CFBundleIconFile skycat CFBundleIdentifier org.eso.skycat CFBundleInfoDictionaryVersion 6.0 CFBundleName Skycat CFBundlePackageType APPL CFBundleShortVersionString 3.0 CFBundleSignature MOZM CFBundleVersion 3.0 NSAppleScriptEnabled skycat-3.1.2-starlink-1b/skycat/mac/PkgInfo000066400000000000000000000000111215713201500204430ustar00rootroot00000000000000APPL???? skycat-3.1.2-starlink-1b/skycat/mac/skycat.icns000066400000000000000000001660711215713201500213620ustar00rootroot00000000000000icns9ICN#p 7 W?sc>_>icl4 ޯ ު ޮ  icl8++V+VVVVVVVVVVVzVVVVVVVzzVVVUU+VVVU++VVVVUUOOVVVzVVVUVVVzzzzVVVVVzUVVUVV+1UUV+1UU+VVV*1+VVO*Oil32ǭپ͠wSIեsE=~yv{gKD@AK}noX0+~xn_NOPKHMr^<0)'ypgXSYTMRqaE>=+.~{vo``_[QWuiTKE1)|tkgff`YTxkWNE6,~|~uhqqi_^yvQD0*~vrxsgh}pKA..}}~|{on}kQB3&*wt}nTB4(,y||âxu{wjQ>0#*{|||prhP@2',tvwu_}ofK;+"(stpuy|}p`fy^gL;/$*lmlfmnjgbWX|^/'&jjkjdZb]UQPܒV%"%``a`]OLUQDLʳ3+yZUU_oXF@HXFɱP,Lqyy~mQHXʽuC'6G$p˖o?>Wcl?L^vHbu QĤKǭپ͡wUIզtF>}y~jLJDFMnr\4#/|rdUTULKMscA80")|sj\U_XSUpbHBB3"1~|ygdc[TYumYPI6+xtrjne_YymXRI<$0|t|vmd_xUF5+~}ynlrOE4!1ws~lPD7(,y~rVE9-!0|~ĥxkP?2&+}|lSB6, /vy}|cwoL<.%*xy{wjm}axR=4) .nppkz{rog\_g1* 'nprpjcmf[WS،X+''cbfcbSQ_XJPƭ5.y^Z\fv^JEPfJƪR.Lq{z~pRNgȵuF*8G$p˖o?>Wbm>M^vHby S۹R ȰٿЦ{\MةxKC}qRRIKPova:)"3xj][\OOPtfE91$,xpd\e\YYrcH=@3&6pki`Y^wpWOG4.~~rwnh`zmTPH;&5ypfx~WC2 /}xnNE4&6}ë}oOA6*/ʾvYH<1'5ǿ{mSA4)/qXE81%3{lyN=0)-~wziV?9.$1rvvt~uhkz2.$+tx{ytn|ufb[h.+!*fhmkiZYkbRW̹92zcadogQKYsO]0Lq|vWUsI/=H$p͗o?=WdnEL_xIfz W[l8mk^i2 V֚c-Atjuިsۢuuuuuuuuuuuuuuuuw34Gα|puI@?00@'??@ich4 ݯ ޮ  ich8 ++++VV++VVVV++VVVVVVVVVVVzVVVVVVzzVUVVzVVVVVzVVVVWVzVzzzzVVVVVVVzVVVVVVVVz+VVUUUVz++VVVUUU++Vz++VzVVVUU++zVVzVUUUzOVVVzVVVVVVUVVzVVzVVVVVVVzVVzzzzzzzVVVzVVzUVzzVVVO+yVVVUVVV+UUVVV1UUU+VV+1UUUUVV++UUUVVVVz*+++++V+*++*zih32Ͼ݀ɨiھ%ĞsV>8@ΤvL''%{pu{]CA?>BENwin{yO,6%}zjdSFHNTMMJDKukR4*-+')1%ywqrcYSQRLIIGKro`G:2* +%yvmn^VQOVTNKLS}qj\A864%&.%}vse[\X^\WSMQxrdMGKK=1#3 {{rzmb_`WROZwpfZMHE=.,%yxsmnabbcb\XRWurhUOF@:0.%~{vfpiikfa]WR{zq]ZQGA7% 4 ~}~{~sbspe`[]}w~u^ME>0,%z~{{mjwwvmg_dzwQJA7)/%zpzxtldi|wfQLB70#5%}x}zrgnukVIB7,)-%{}{xlozviTD;/%%,%}svylXKC8., 2%{~|¹zsp~}ysiVI>3('.%{y|w|ºnwytsdQB9.%#+%~{dwxureVJC7,-"2%xxzwz|~kUylu\OC<0#&,%truqywrpeb{a^NC7, #*%wvysqrwyy{wn^aexc_yLD<4+) ,%sprmm`luoonmhe]Qavxu{\86+!0%niminkedlidf_\ZRO~@,'&%ljnlmkndTbf[XVSMQݠK(%'($meead_e_SKSbTJKIP˹%!-%b`_]``b_SOEGXQAAJվ@(-`]a][SXSHGHI>PlB@xe,k&]VVUlqSG=1JkXte2i&sڿZ`|\;6bvyb:!0jƕ[7_||f!Ͼ݀ɩiڿ%ĠsU?;>ΥwO)&%~pw|_AEB?EMPwfq|yR/!9%mhUKLS^TQMIKxrT5/53.2$2~{|uzhc[SYMGJqteLB92%#*%yymq_ZTOZUONRV{mkZ@=97*.0%{ygbc]gbZXURyxfOPPQC<)'6%~}tyle`ebUSS[trh`QKI?4,%z|sq{ieahd]\X\prfTOI?96!0%~lsovngfbV}vc_YMGB-)8%}~yjvxugc`]{{|hPJ@6,%{|sqyokefwyVHA5//%z{uln{jZRI>:)&7%xpqylUMG>0/,%z|tsvxgPD:1$(,%z{ıq[PG>33%&5%|ĻuwxiUK@5*,/%}xxºywudQC8.%'*%i}{lZOG=26''6%}y{pYyq\MC=3%,-%vqysw{me{^gMD7, '*%}{ytenk~fgQH@:01%-%ypxpsbwzxwxpjcYlzuj87."&3%pgqirnkm|sflc_]VP~ŃA.(#&%plwrwsyj\psg_ZXURٙQ.*.)$ugkdj_h`WNZr[NRRUȳ( & %0%e^b^fdhfZSELcZCEKҹA (-e]ideZaWONLQBYJ?xܾf$,k&f[\XorTM@4S~ewѿe5i&uۿZ`}\<9pބzc;#1jƔZ7_|}e;Lps]_ ?hLHBZ  M܍ A[R+Ͼ݀ˮn¡$Ǧz[EA=Ӫ}V-*$r{fEMGBJSTweuY4&$>$rnZRSYg[VROMyvV72;:39)$6$~{olcXbQIMOKqvhRF82%'.${~qvd`[TaXSRXZ}mnYA:43&0#4%mkmeoh`^\T}~hNOPQB>,-:$zvnfmfYWX_tvk_OIF<3/%}xxtmgojcb`cntdMKF<45 !4%txyrpl[u`aYMEC//=%vsnjb{}qxLI=5/%~|xrovz\C>0. 3{y²zdVRI=>.,<%{yš~mULC;.4! /%}|˨wzgOE:2%,/%мt^UJB6:+,:%}˺x|jWN@7,2"#2%{}¹˵}weSF8/&+-%qʾr_TJA7=--:%~z`®}y_OG?5)1"#1$zsx}yo`rOG7.$+-%p|wjmWLB?67*$0%tvzi~woeyy793&,$7%ujwnzvtxt{qkiaXޱM/,'(%uq{}tfumfc_YéW3/4 -$|kqjrfqg_UcfV[\]й,$,$*4%haibnkroc[KSodILQĵH#*-iaqlobl_XWSYHbSBs )/l&k^c^xyZTF7[qv%!9k&zZ`aA>~|h?(5kǔZ 7_|g DKps]_  >hOGB[!PԀ"Jkd3h8mk {NRҖ^*+\aJ?yѕ^* 2e췃ѯ!%  'L_ܻbN* HlŦzssrypJ (Lp`XVYZZZ[[[YYaroTZdwO)  +m iP;  ics#H<<<<<<_ics4ޮުު ͪ ics8+VVVVVVVVVVVVVVVUVzVVVV*\+1+is32<㲆崆|y\GFqF!zjYUVjF0)|tjg]{^8*|wp~V-*z{qI((vseE'(lrul`H %.`_URK͂#%m?yyaRR貾M.'"Y.%5z'3Ih㳇嶈{`KHsJ%$}p_XYlJ6-{tla}c@E@E@E@E@E@E@E@E^cTkSXuyWj9it32jc0-.*-ƴsn%ǽѸ.òi]D3GijkSe ˉ.̶lXBM:336I®t[A:&Ö~/ҾiUUJ833L>:=;I©dZ3 $Rˉ~|tvu.ϲx_SN48E@FE9O?=:5OyĦqP,-  % RQˈ}zxsnlr{Ѹ{`NB@9CQ=C>?BC9L@8AC@FRDH==>==QKGIFZ|{jddlMNPW67*#)&7  &"\a͖{wzswywifddlaVH@?RMGEIKCKS>@LOKUQXNC@@YuxrkgmmSTME'9-#+*(!. %9B+5 V+͈}{usyhmleld]NEBUMGCCPITbTP]YOIEPB<2PxulggnSRPG*;.#",'"*.G3./)( Raʈ}{pmlcmd^NNBWPJOUh[Y]GFIHBBFUG@>:V~zxt\YLI2910-5GA460'= # Qaʈ~ytuzwyywv}odUVZj\X[OLFJSAEJJEHOOJE>>]vrss|miffNSHDA453 3( Paʇ{yzqw}nhgpyxyj^Q^OGGLQNLWLMLKHEITJA?=XxzrollqXYUS;D5(''80#!7%&Paʇ}vspv{oljfskePQTZOJNSVRMXKMNMMGERJHB9.0,96' 4% P&Ɇ|yuxsw{mjmfqibSSW`QLMNSKO_TLPLI7SHFF=V{yvoilqZZVN4?A3.+>6'%#:#*OaɆ~z}|q|mkppqhiUPQbSNVPNP\]PNUNJIHWKFGGZzwywmlr\dZW4FH/..D?51#!8#-Pa͗~{w{zwsqjrotifUPQ_ZTTQQS_]MPUPONN[VQOJa|vttknt]eZQ7D;47@JBB=/#3$!52&#YQɌ}~zspkjnvpjXUYdUQPSTYZc\c^Y\WPWNHH@Uv{lir\[US>H@4C,.Ta˘{yusrswf[Rz^ehdfkhhkfifca]_c]VRKS~yrt{hgrgK\ZQQHKHGFDCRD812.9.&"VɆYqiYWvanrppo}ofij`][_^ZVPLWyxrnWi_]cZ][ZTJBT8" ( Raƃ~}|tv|xy{{hUWrdmnknnmfhca`_Z^XUUO\~{rzytsp^o_UNNTF<968G0  / LƆ~}{}~vx{wyxu|yi_T^rdrp>mwheeb]e^W[Q`~z{}~gereYkPOJOF?>=7E)! ( K5Ɔz|~|x{xzylg`Xallsqqtyzigdbegh[WScy|kllPNHKM@>C6D(% TaƄ}|{z|}}|z||rqjeXmlktwxuomkhece`][Uf{wuw}x{`[SMHHJ>=<6B("*NaƆy|yw|{{y}}vwvoi]kos~uwyppnkfc_]_Vf||{ks[XOQKGD<;93=&+MaƁ}}}~}{{x{~xxzxvwzxo_mmsy|ztoljnmeb_\i}yv~iuX]RIMINJ:88.:$# JaȒ~|{{|{x{~ul^vjtyyutrkjgefc\l{~pjd`P[PDILQM@;58F1/-('7.)"Saƈwnd{mx{wtqnlifgg^ly}vmdhZSONRLF@=;G3%%"$+ XVā~|}zx~wvy|y{{sdzozzxsrpkgghbnxsuxklhgVWLG@?A7**)%8") Maƅ~z{ztio}xupsjhl`o{~yuuxjkb`OQF@?BF;19-%9"- MaĂ}|}yz{}}~ynr~|ysnklhcq|rxzpg`\KRH>?=EA2+%#8%+LaĀ|~zy{yz}}}ps~vqokf`rŷ}}yu{zkoa^PWQ=<;D7(*%!8() Ma}|yzwzyzy||qszuqnieqyy}xxtykjd[NZH><7>7(,'!7#& JaÀ}}xxyxut}}rqqeq{}{xwv{nf`[JPB=:6?=-'$"7 %Iaą}xrzwsyqst~|}{}pkeaRYKEC?IC50+-?'%",LVōsnvsvntvz~|sspgY]YPMGKK<::6C2-,8,'$Ta~zzxyvyzw|||xn{msnhurt{zxurvcjlXMPX?96F:&%(!2$ Ha{yww{|v{~¿toshlfsº}ruwxqtydd^\OPH@B7>81)%!=(% Ia}zx}|u~wxyvz¾okrccrwslxtvuwieaZGOG?>6A:).'"7"' Iay}wxyuxwvy||egsZniisrtufeaWGLD>96A9(')$1& Ka{ywu}vw|yzyr_dcj½rhqkvtgf[TQTC<:5<8)&#):( Ja{y|zzyz~xsvwxzhWe~fmfqsyg\WTHNG8;496'$" <#&Gaww~{}||z|~o_O{sc|nx|nklha[UMRJJD>4,'6)$"& Gađ||{{}rfSIu~pdggzia\XORF@K;@@9477F62.--:70-Ta}~vrsmzqwstvwz{siZEOv}xZqXq^Y[`GJA;97<9'#!/'Jayt|qu{s}t|zszu{}{{wri`PIwqyrbVb]\\WCKD;:7:6($ 2 "* Faxsxwtv{rpmwvxz{u|osngaWYxs}uhY_yT^[XFLF=A7:6($ /#& Gayrxvt|pzuom}pyvv}~}nivhkfaZfyn~q`PPQWXGLB?>496*%2%$ Hatr|oommxsnlxhwy~~}}}pe`xs]a_^fxtnzun`MYzHPXEP>873<5)#!/ "" Favq}uoolmnoi_fho}~yxz|~}xsj^XsnY\Yeqso|xslbUJ\M_JNH=7152#!1!3$ Fvxvspnsyup{n}vvzwvvzyBz|}wwuqkaYPpuUUfrogywu{o_XSWRXOJJKPG>3*$6*% K}~y{~|tyiZlyp|wqtvtstAuvtpqslia]RNmmNdgyk|utjZIat@@I<787>?7411?1**)&2!Ka}xrpstthffkik]UY}otnnowqopqpqmlkkhfea]UOJfl]zerfywsled[YP7S8G?76400",#+$$"Oalqxslmlnyiflknqd_ZYnakowspmnpnjhegebba\YUNE^wo[n^xnmppwtpcCH8CI>4016 -! Fnpxpjhovhdnmptgda][]_`k9lkjnigcc`aba\\WOG>dkXugѮx_BA5386;"1!EH=miyvjggjukengfwifebf]Ymncddggilfec`^`^\]YSTQBKyiSąd.01.240! Ey6 O߇>jmxkilefuidehlqijedne]LU}_[ccbfa`]]ZYWWZVRTQFM}i~ĦՁξh{\+*(36",$'D? ̆aspuqmlchvc`muimrtjz|rn\NPo`W[]`^^XXaWWVTSQNLIXrÑmh%*2.!+$ F!Ʌ8mlwqja`gqhjsyrwoonkrii\OJK]uWZ]`]WTVSRSWXLLJGW|r%Ӿ~zz,><2.(!0  D7gmxnptvvysqhchr`^a_ljg[SURDHt_OX\VWWUSOMQKLEDSy#²sY(-+,/.=1.& & Dl6zx{ngd`j\[]Z]n_]_^hhd]VTVKEC[oPSOQQNMOQRLKKHTz|Ѓ$v{7$!,!#&4("Pk6idsma]a]i]^b\]h[ZeegfcUQPYRIC=E|VHONJHJHLGHQHXt*}}0"-# Gz  5ccue]]eil[Wf_]l[_`_fcbSNN[VJGC@<\aGEGFECIECG>L{Ղ*% -$ Eq5e`qf__[`gZ\\[\nWb^Wf][SMMXRKIHEA9IuwL?CDGQB>D=Mn*žR .#$ Fjl_nhlaaUfWbrVXe]dWVecmjUPUMIFC>2\[>>CKA@E:L|n*ľ)# Dq7 eajckaXTcWWVPZf]cehrh_ZUQYUPJLIEHE7-E}gC8C@=D=Ny|ـ*ƾ)  Dee]h_^YSRe^bbdhp_WZW_\XHDDPLKNQQNNL>900nl>><>9Jq5)$* Deeaf]^fjirkdXTX^LNPMXVSG@EOJBDEHJFRLCC75lA4;7Fl¼;(*8+$#$  C edixtsm\TaVNMLP]IHMQju]NQJ>@CACDI@><;7/US32C~h¿»7,+-&. E epfke\YTN^YJKNTihzѲp]SH@:>G;>::33#;w9Aw¿* * *$M VSc_V_RMaT`vKźmZOMD;8941/+&U[zxnG..) F ZO^\TWpOq=(Q¸{iWJ<75-5-$6x^Xޓt}iYD3  D YeyY$H@jp]P@?0)-sLэ}iR?9C ª}KE@dmZI9,*fxKxpbKZ uB>ax`S{P8Vr ́ɍI Tsǹ) 4Zw T#1Uu}\/Li 6 3_U]  $:ZCsNu0 ѪeŦUAvz\ #OcrsnngT9 c0-.*-Ŵto%ǽҹ.òk]D3EųlTf ˈ.ͷlX@[>224G¯v[BC)Ṗ~/ҿiUVJ730YA8;9Gëfb6 .S͈~|twu.гy_W[27E@FD7]A:94M|zŧuP-<  / Saˈ}yysnkt{Ӻ|`NA?8G_;C>?BC6YB59MU~stldalɽ~]E*3-B .Q%Β|}{xxsntf`cdw~y^HaE:>AB>J_BH=99:`TPURd~z}yhbhwKNPV7A-#/-F#0#+abΞzwysw{jfddscUG@=_PFEIKBN`;>NSSf_mZFA?VrvqiepxQSLE&B0$,1/!; #/KZ:A(Ya͇~usgmldte]ME?bPFBBOJ\u_]kgYOE[D:;;OzvjchwPQPG)D0#"2-!&09^C<=4!4 Raˇ|zuqn`se\ML>bVMUavhjrJKJE@ADbJ?<9U^ZJG.A331=[TAD=/N" - Raˈ~yst{|xhX^flfgUPGM`?EJIDHM\MD=>]}rottwurqZhXQN;A>#@2 QEˇ~{yzpxlfhs}oVnTEFMRNQeJMKJGDGaM@?=XuxomimzSX@O9&&(A:(&#D(0QVʇ~vspxnlid{kdPORgTKOTWRSeILMLLFC^NFANE>;/$B)#!%E@20^aʎ}vnjjnsjYVXpYQPRW\btfnjehcVgUIG=Tx|ih{VYSQ=TE<@:LWFBDIbLB?<6I"Raɋz}njYVUvmkpmootz]`^QLPIaOHNAWqhaZMcUX]]jn\Y[HZ0)' 0 Saˆ|yrzu{wvsshef]S]p\h[QOSPcQHFEZztronyv{l}v^IFWO:8<5Q'&#4"OaɅ}wyuwspjoxmgk[v`WYbaXdoUcZTRYSbRJVGU||zqin}X]TgOUIB?AUT:;78W,!0 Paɇ|xwut}qrmghXYZ{iZ]`f[cqX]Z[UTMdUYRN{xtuop^a`bD_TFDAXW3<9Ozxtlrf_a\L_ODJEPL>646S/&"0Mb˒}yyuytsuusdUUtkdmdecixda\\^dYk`Z\TVzxurmvgbjhK_ULPCPK79;3O-; Xb͡~tsrsi[Qnhhdhoosqwsqojkxl_XOUzptbcqhKaYLPHQOIKLOhRF@@:L=0-ZaɅxm^Yo|~mmpfa]_k_VQMW|u^wjgqhppmeXKd=(& 2Raǂ~}}}zsu~}~ua^irsnor{fjecbb[k^XVP\}|zwp~yvz|jgTQT^L9758R3#  9 Madž}|zwy~xyxuzj`Uhdssrvmxjggd^ocX]Sa|wx}aaobc{LLJXN@?@7P,%$2Ladžy~~y|y~|pkbddlvsxz}lifefum\XTe|vw{f{}LKESVB@C3N- . UaDž~}|}{}}}{|vvlr]olv}tqonjgdsf^\Ug~xusys|z`OIDMP=<93N/"$4NaƆ||yx||z{{x}o^lrx{rrolfqe_`Wg|~ygmdYLNGLI8961L,!5Maƀ{|{||}{x|xy||z{|o`pyxspmnxgba^k~xrdpWfVGIDQN746/H)+ Kaʝ~}~|sd}~xw}snnjxƽnib\NdUGKLWU@=:AY<9731I<5.XaNjzn~ywrxolibpylzja\[c_SOLH\?-+('8"$[aŀ}{|zw~uux}z}wg|}ywtxokleoxotgjggT_PH?=E>+-+'D#3 NaDž~~~z}{zn{}zu|rmperày{rxeh_\KVF@ABLC4<1'D#7 Nł|}}{z}~B~r~w{tqmhuüħ{ozme]YFWG<=:&$ >##2 Gaxr{wtv|srlxxxszslf[\z͔{uhX^РS]ZWCRF:@5?:'$ <%/ Hayq{uu~pwonx}skppjf^izˉ}q_P`MUVCSB<<1=:'%>(-  Hatqnonmuolkyujcdedbiywąytn`LYJMVAW=550@9'$":#"* Gvpwnomloni\nrwAxnb[^`\ht|wrj_QHxLcLWK=7-84!!1!?!- Gauvytqqoy|}~{uoe\YYWh{p|{{~qil_[i[TX[dXH9.(D/ - Ka~~[nxy}~|wtnfaUzRbk»{naSbњ?=S?5540A(Mbtswt~heejku]VY}vvw|xyzyzx|qqnmmief[QshkuwvypjcbY\Z5l3M>44254 7"%8/..Takouklkmkgmlr|e`\Yympv{wuvxvtxjljgge^fYLDhp[pkqlnmtqoe?F?GI;3/7;! 9) Foopigojeomtgeb_e`nd}vqr6sqtfheffd^g[PJ>llXxʱwΪzuÁHA338;@"<* FH=mhyjgginfogiigfcpaZtrkjmkkmkqddab_^\eYUSDKyiRĬ˅zs./1-78<* Fy6 O߇>jlnhkdekefio}jkecvkcQXl\fgeihm__^]ZZ\bWURHO}g{ǿ܁̺`x[+*(8;"7&1E? ̆%so}ullbfeamsjzwxr|g[]tY^`bdjZ[dZ8V`UONKZqýݿgg(+62 6 - F!Ʌ8mjti_]f~np}~~|toj]ROYeifikl[XXTTUXdRMLIYq%йwu6ML<5+$=( E7fmvwqhn`]b_umh]UT\HHrScpbecb]UR_QLGEUz#ɽmX/505;:P>9/'!0 El7wlgat[Z^[`y__`_rke^XUaOFC^Z\PUWTW[\e[WVPX΃$żpw;)!7%*/F3,+Tk6lczn_]`[s^_c\`s[[ffrjcURPeWJE>EfGQPMJKIYOLYVg*Ľw~ 1"7 * Hz  5cb}h\]dhv]Wf``w\`a`qgcTONg[LIEBM҂*Ƽ}}(!8- Eq5e_yh^_[_q[[][_zXc^XpaZQMLbVLJIGB;QX>DEH]G?E?Np*¹~P!9$, Fj"k^vkkbaToYasV[p]cVXrm}]RaOHIJJG0bo>=BVEAF:JrȾ;1( 6 ' FJe_m_anwv{p]W[hLNPMc[UGADZNBDDJMOdUML=7qR2;7FlĿADBCHT>A?DC6\n50D}gƿ̾687<1?*G e}mxk[WSLh[IKMVsi{ҳq^TIA;BR;>::34%A̛GDƿ* 5 5,(*R SQkaU_RMkV`vKĺo[SUD<8:52/3(Vy{qF//4 &F ZNg`SXqOq=(Q¸|jYK=76,>/#5ϞeV½܏r~j]E4 & D Zd}Y$H@jq^Q@G4),yů^·~jS??!D ë}K!@do\J:,)fրρrKxqcL[ uB>ayaT|־܀ځL8Vr ́ɍI Tsǹ ) 4Zw T#1Uu}[ /Li 6 3_U] " $:bD} O݀2ᴧkĠWCǴg $[{e=c0--*-Ƹx%.ǸteK6Fɹv\p щ.ѾvaFfC535HǷeIM-V҇~/Dzr^[N:63dG:<:I˴oo=6 Z҉}syv׽h`f4;HDIH9gF;:4N)z{ͳY2G  8 Zaш~y{tolvðiUFB;Nj=FACFF7bF59NX}qsjccpDZgM/:3M6 Xbԕ|~{zztovgbeggMkK=AFFCPjDK@A@;;kZX]Yk}x}xfakJNRZ;J2&!63P& 9'1kbբzx{ux~ligg{gXKC?jWJIMOFUk=ASYZqi|cJEAWíqunhcqQUME&G4'0!86"D#%"6UhCH-aaӇvuinog|j`QICnVIFEROeiiupaUGeH<==Q{wi`hQRQH)J1$&73$*5AmLDD;&> Yaш}zzuqc{i_QPAm]R\lswQRNFABElN@?;V_\KH.F544EgaJNF4Y& 5Yaщ{tu~n^fpzqr]WLSkCHLKFJNfRF?@^|qntt{~{ybt`YU@HD"K: Xaш~{|r|nilx|]{[IJQVRXqMONMJGHkSBA?ZuxpmhnOY\]DW=&#!?<#" N+8X#чxvs|romhogTSVs\OTY[WZrKO9IDhSID>UwsnfpTTPJ.M=-.(A@(!!J$7 WaЈ|}wzu}oopirgYY[y]RSUZR\vSNRNKKHjPGH?WywumfpSWRN5NE0,(G>&'%P'< WaІ~vqoutpo[WT{`T\WUWgtOQWQLKFlQHNOeyvwvjqUbWV5UK-,*IC-/$"M'>Xb֧yy||yyunwtrkZVUygZ[XWWhsKPVWVW\odc_q̶ytrrirXbWN5S>228MC86* G&#(!PH97faА{qooryo^\]}bVUX]bhnysnql\r[LJ?U|~jkTWQP8UA6;3KXC@DLnQDEC=T'YЌsn_\Zyw}y@bebUORJjTKPDYvkbXFfWYaaqt_]^Ib1&$ 7 Zaш~{t|y~qlmaUbz^k]USWSmVLIH\ytspq|p`HDWO4262W%";% Uaφ{}y|wtnstosag]`ge\jzXg^XV\VlXNYJXz{ypiqW\RbJTD<:PK246,T*D%#`ըywMpaUrokpxy~~|vwxh`UXƷ|qw]]f\@^SDLCRPHKMPsZIECBWF63baχwf`~xyzpkfexg\VPYŸznW~njvmyztl[Lk>'$8Ya΄}wyngs~zx~qupnlkdzh_\U`è|{xwqwvxx|SNR_K31/2U1 "@SP͈}|~}~~{ti]so~yvtroi~macYf}ww}]^cX|PDEXN; 1S*"!:!SaΈ|~|wmsn¢xyvsqpxe`[jȚ}vt{crQD@TV=NQ885.R+#<Uả~}~iv~|yrsijao|~wb{ay\CHALI452,O(!<Tá|~~~}|m|×}zytljgu{xqahtrHaM@C>QN201)K%2 QaҢqϘ}|yùlhaYE`OBFGYW>;7>_;>?:6SF>4_aϏ|ǟ}xuly½Ȥ~plc_\igVQOKdB42,*A(&aṼ}zzz}pÏ|uumxƿĝtnwcheeR`KB86C<%'% I%:Ta͇~uƊwyozϧ}yszcg]ZHZE;9:JC.7,%L&! > T̅J{Č{wq~Ю|q}ke]YE[H<:5IH1*$#K* <Sã}vÊzup~δ}xsfm^ZI`S::7JA)*%!K-:T&˂~~{t7|wr϶y}xvyehaXHdJ;:2C?(-'!J( 7 Qa˂~|}~w~|rӸ~ǡzvtzhb\UCYC:71ED+&#!I%6P͍ByxӽzurlhVkVLIDWR=835X3/,(%B+'VСŸ@v~wevm^]TaaMLJGcHAA@>UA:8bx{z{w}|@|ow|ztκqwwxuqv[fhRF[X;51K>$#&C"2 Oaʅ}}|}|xqqyuϷ~rxpz_a[YK^K=@4E?0*&!Q/6" P?ˀ{{y~}¾ssoqѹytzcb]WF]J=<2G@(/("K)8%" Pa˂{{}}~}}pof|ѹnoqpyac]WFYF<72G?'()$E#7  Ra~z|{}}hhvϸzdfubc[VOaF:81B>('#*O&9# Qa~y~}}y{|r_odzжdmujw_ZVUFZG37.=;$$!!P)6NDyxŴzhWʮҷ{j~rxj_c[aWJ?40O5,* 8 MbѮ|h[·}ipojd^QcNCN=LNBCFJhKDDB>XRHCcaʆxuvnw{yzxjSZ弱˺{wYyl\Z\`DVC762A>$#!B! 8$$ Ra{ttyw}zvm\S㷭|ufU{Z^^XBXG973@<&%# F&%: Mztzyyxwr?zy}vped鷝wk[cV_]YEXI:@4A<&&$D) 6 Na{ryys}uswo|zuqhq詖tbRtNXXEYD=<0?<&)! F,!4$Nawrrtrp{tqu|pinooms~䡑|xqcN\ONXB\?55.B;((%"D&%2 Maxr}qsroutn_kvjahkht}⟋yumaSJMhP^O@7,:6#$4$H% !4 Maxw}vtut¯~xnddebsu~tebtc[^bncP?2,M24 Qaƅbt|ro_]kqޘtfZfB;S<378LRGGFE`G<>;7J.Sbʖzy|xnjjood]`~~|zzvqvi]vq{w}pjcdZ_a21RA42198#!?#&)"A634\ampznpoqqlrqxlgd`|}xzxtsqjtdVLsu_u~y~VPJJK;20<@$$ A 0 LaqqsmlsokusznljfqiptvssqoivfZRFyp[}דϩKC349?E%"D"2 LH=oj}mkkmsktmqonnk|jb~wxzyy{zqqnnkifse_[MR~jW܅ͱDŽ,13.<="! D"1 Ly6 O߇>mnslohiqjknvoplivnZa}hrtsuv~kljigffpb^\PVuڻs-+(<@%  @*7K? ̆auqyoofjjeqxq~}sfi‰djlnqzfhofeean`WVR`ո|),:6# >" 3 L!Ʌ%olxkb`iuwyrdYXep{syz}hdb_aq]VTP_%ڌVKBJCS{*Ŀ<0 Keg]wf_ZTQzjo{wfg_re]MIFf[WcgfbdcE>11\B@B?NvK5,#>. Keg_scduxd]bsQSVSna[NFGeTGHIPSWq^VTD;ye3>;JtM$8961:+Zߔw]24< ,L \NmbUZwOq=(QraRB<90F4%7qV깃sgM9 + J \gY$%@jyfXFQ9+.~p᳊q[EG%I ̷}K @dubP@0+iۖLwxjSc uB>a}fZ^8Vr ́ɍI Tsȹ , 4Zw T#1Uu{`/Li 63_Uu) $: fFRԎ 4 ̲eGرn &dq=t8mk@L7 7u}CLt ݦq> 2m뾈R 0czH .hΗ`/ Dy긆< Vڥf!Iԝj5 :učZ(Kܧv> 5qӛg7 .`}o    $  !&*+)/9),+'#   *46-"&4AMW]^dѢul^^YOD7( &6ET`ilsۼiaegcg{zljbWG8( !1ARalrzػxppuwyyyyyvrryrmcUC4# '7JZgpzӷztvy{||||||||||||{zvv}Ґpi]M:+ -?Q_iuuqsvwxxxxwwwvvwwwwwxxxyyyxvrsyvrqu|jaTB/!  "2CP[i׷ngfjkkkkjjjiihhhhhhhhhiijjkkkllllligmy|pkkkkjgfmxp\SE5$#1=HRtgXQQTUVVUTTTSRQQQPOOONNNOOOPQQRRSTTUVVVWWWVSRZhq_VSSTUUVVUURPT^sWH?4% !)177:<===<;;:99887655544333334456667899:;;;<==>???>:99;ETgjQ?8889::;;<<=>=<9583+"  !$%%%$$##"""!  !!!"##$$%%&&'''''()1B[lJ0" !!""###$$%%%%%"   7UiD(   4Ng?&5K|bB& .Ge}T?$% ?options? DESCRIPTION This class defines a widget for displaying the HDUs in the current FITS image. The user can select a FITS table or image extension to display by clicking on an entry the list or on one of the small images displayed in a table. ITK COMPONENTS buttons Button frame at bottom of window. image_table Frame (BLT table) used to display images in FITS extensions. table TableList(n) widget for displaying the list of HDUs. WIDGET OPTIONS -image Target RtdImage itcl class object. PUBLIC METHODS show_hdu_list {} Update the list of HDUs and the image displays, if needed. PROTECTED METHODS add_image_bindings {im hdu name} Add bindings to the given RtdImage itcl class object and set it to display the given HDU when clicked on. The image's extension name is also given. display_fits_table {name} Display the current FITS table. init {} This method is called after the options have been evaluated. make_buttons {} Add a row of buttons at bottom. make_image_table {} Make a subwindow for displaying miniature versions of image extensions. make_short_help {} Add a short help window. make_table {} Make the table component for displaying the HDU info. resize {im new_width new_height} This method is called when the image window is resized. The rtdImage widget and the new width and height are given. select_hdu {} Select an HDU to display. This makes it the current HDU. PROTECTED VARIABLES filename_ Name of image file. image_ Internal rtdimage object. imagetab_ Table displaying image extensions. table_ Table displaying the HDUs. COMMON CLASS VARIABLES astrocat_ C++ astrocat object use here to access catalog entries. SEE ALSO TopLevelWidget(n) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/skycat/man/SkySearch.man3000066400000000000000000000061141215713201500216640ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: SkySearch.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 27 Mar 98 Created NAME SkySearch - C++ class to extend the "astrocat" Tcl command PARENT CLASS TclAstroCat SYNOPSIS #include "SkySearch.h" class SkySearch : public TclAstroCat { ... public: SkySearch(Tcl_Interp* interp, const char* cmdname, const char* instname); static int astroCatCmd(ClientData, Tcl_Interp* interp, int argc, char* argv[]); virtual int imgplotCmd(int argc, char* argv[]); }; DESCRIPTION The SkySearch class extends the "astrocat" Tcl command (class TclAstroCat) with image plotting capabilities. The plot method was originally implemented as an Itcl method (see SkySearch(n)), but this turned out to be slow for large numbers of plot symbols. This class improves the plotting performace by making use of C++ symbol drawing methods defined in the Skycat class. This class adds a "plot" subcommand to the astrocat Tcl command. PUBLIC METHODS astroCatCmd(clientData, interp, argc, argv) This is the entry point from Tcl. This static method is called when the astrocat command is used. It creates a new Tcl command with the same name as its first argument, that can be used to access the astrocat and skysearch subcommands. the object can be deleted with the "delete" subcommand. imgplotCmd(argc, argv) This method implements the "plot" subcommand: usage: $instName imgplot $image ?$data? ?$equinox? ?$headings? This subcommand is used to plot catalog objects on the skycat image and was reimplemented here in C++ code to improve performance for large complicated catalogs. $image is the name of the image object ("rtdimage" object, implemented by the RtdImage C++ class and extended by the Skycat C++ class). If $data is specified, it should be a Tcl list of rows to be plotted, in the format returned by the query command. If $equinox is specified, it is the equinox of the ra and dec columns in the data (the first 3 columns are assumed to be id, ra and dec, unless otherwise defined in the catalog config entry or header). If $headings is given, it is used as a Tcl list of column headings. Otherwise the catalog headings are used, if there is a current catalog. Note: normally you will need to specify all the arguments, since the querries are done in the background (See AstroCat(n) (cat package) and Batch(n) (tclutil package)). The information for the previous query is lost when the background process exits. This might change if queries were done using threads or if the background/interrupt handling were done in the C++ code rather than in the Tcl code, as it is done now. SEE ALSO astrocat(n), AstroCat(n), SkyCat(n), SkySearch(n), RtdImage(3), TkImage(3), TclCommand(3), Batch(n) -------------------------------------------------------------------- skycat-3.1.2-starlink-1b/skycat/man/Skycat.man3000066400000000000000000000335531215713201500212350ustar00rootroot00000000000000# E.S.O. - VLT project # # "@(#) $Id: Skycat.man3,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 27 Mar 98 Created NAME Skycat - A C++ class that extends the rtdimage Tk image type PARENT CLASS RtdImage SYNOPSIS #include "Skycat.h" class Skycat : public RtdImage { ... public: Skycat(Tcl_Interp*, const char* instname, int argc, char** argv, Tk_ImageMaster master, const char* imageType, Tk_ConfigSpec* specs = (Tk_ConfigSpec*)NULL, RtdImageOptions* options = (RtdImageOptions*)NULL); virtual ~Skycat() {} virtual int call(const char* name, int len, int argc, char* argv[]); static int CreateImage(Tcl_Interp*, char *name, int argc, char **argv, Tk_ImageType*, Tk_ImageMaster, ClientData*); static Skycat* getInstance(char* name); int get_compass(double x, double y, const char* xy_units, double radius, const char* radius_units, double ratio, double angle, double& cx, double& cy, double& nx, double& ny, double& ex, double& ey); int rotate_point(double& x, double& y, double cx, double cy, double angle); int make_label(ostream& os, const char* label, double x, double y, const char* tags, const char* color, const char* font = "-*-courier-medium-r-*-*-*-120-*-*-*-*-*-*"); int draw_symbol(const char* shape, double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int draw_circle(double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int draw_square(double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int draw_plus(double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int draw_cross(double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int draw_triangle(double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int draw_diamond(double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int draw_ellipse(double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int draw_compass(double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int draw_line(double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int draw_arrow(double x, double y, const char* xy_units, double radius, const char* radius_units, const char* bg, const char* fg, const char* symbol_tags, double ratio = 1., double angle = 0., const char* label = NULL, const char* label_tags = NULL); int symbolCmd(int argc, char* argv[]); int hduCmd(int argc, char* argv[]); }; DESCRIPTION Class Skycat extends the RtdImage C++ class by adding methods for drawing symbols in an image based in world or image coordinates and by adding support for FITS tables and multiple FITS HDUs. Since the RtdImage class implements the rtdimage Tk image type, this class adds features to the rtdimage command as well. The symbol drawing methods defined here were originally implemented in Itcl and were later moved here to improve performance when plotting large numbers of symbols in an image. CONSTRUCTOR Skycat(interp, instname, argc, argv, master, imageType, specs, options) Create a new skycat extended rtdimage object with the given name and arguments. The optional arguments "specs" and "options" allow derived classes to add new configuration options. See RtdImage(3) for hints on how to add new subcommand and options. The imageType argument is normally "rtdimage", but could be set to a different name, if you do not want to redefine the rtdimage type, but add a new one instead. The "master" argument is a Tk struct that contains pointers to the image handling routines. METHODS call(name, len, argc, argv) This virtual method is defined at every level in the class hierarchy and is used to call a member function by specifying the name as a string. This is used to implement rtdimage subcommands by passing control from Tcl to C++. All of the methods that implement subcommands take the same arguments: argc and argv, the Tcl command line arguments. CreateImage(interp, name, argc, argv, type, master, clientData) This is the entry point from tcl to create a image. getInstance(name) Return a pointer to the Skycat class object for the given tcl rtdimage instance name, or NULL if the name is not an rtdimage. get_compass(x, y, xy_units, radius, radius_units, ratio, angle, cx, cy, nx, ny, ex, ey) Return the canvas coordinates of the 3 points: center, north and east, given the center point and radius in the given units, an optional rotation angle, and an x/y ellipticity ratio. If the image supports world coordinates, that is taken into account (the calculations are done in RA,DEC before converting to canvas coords). The conversion to canvas coords automatically takes the current zoom and rotate settings into account. The return arguments {cx cy nx ny ex ey} are for the 3 points center, north and east. rotate_point(x, y, cx, cy, angle) Rotate the point x,y around the center point cx,cy by the given angle in degrees. make_label(os, label, x, y, tags, color, font) Write a Tcl canvas command to the given stream to add a label to the image at the given canvas coordinates with the given label text, color and canvas tags. draw_symbol(shape, x, y, xy_units, radius, radius_units, bg, fg, symbol_tags, ratio, angle, label, label_tags) Draw a symbol on the image with the given shape at the given coordinates (in the given x,y units), with the given radius (in radius_units), bg and fg color, canvas tags list, x/y ratio and rotation angle. shape may be one of "circle", "square", "plus", "cross", "triangle", "diamond", "ellipse", "compass", "line", "arrow". x and y are the coordinates in "xy_units", which is one of the units accepted by the Rtd commands (canvas, image, screen, "wcs $equinox", "deg $equinox"). The radius value is interpreted in radius_units. bg and fg are X color names for the symbol (may be the same). symbol_tags should be a Tcl list of canvas tags for the symbol. ratio and angle are used to stretch/shrink and rotate the symbol. label is an optional text for a label to place near the symbol. label_tags should be a Tcl list of canvas tags for the label, or an empty or null string, if there is no label. Returns an error if the coordinates or part of the symbol are off the image. This method uses world coordinates, if available, for the rotation and orientation, for symbols that support it (i.e.: rotation is relative to WCS north). draw_square(x, y, xy_units, radius, radius_units, bg, fg, symbol_tags, ratio, angle, label, label_tags) draw_circle(...) draw_plus(...) draw_cross(...) draw_triangle(...) draw_diamond(...) draw_ellipse(...) draw_compass(...) draw_line(...) draw_arrow(...) These methods each draw one type of symbol. They are called by the draw_symbol method and have the same arguments (but no shape argument, of course). symbolCmd(argc, argv) This method implements a the Tcl symbol subcommand (a new rtdimage subcommand added in this subclass): Usage: $instName symbol $shape $x $y $xy_units $radius $radius_units \ $bg $fg $symbol_tags ?$ratio $angle $label $label_tags? Draw a symbol on the image with the given shape at the given coordinates (in the given x,y units), with the given radius (in radius_units), bg and fg color, canvas tags list, x/y ratio and rotation angle. shape may be one of "circle", "square", "plus", "cross", "triangle", "diamond", "ellipse", "compass", "line", "arrow". x and y are the coordinates in "xy_units", which is one of the units accepted by the Rtd commands (canvas, image, screen, "wcs $equinox", "deg $equinox"). The radius value is interpreted in radius_units. bg and fg are X color names for the symbol (may be the same). symbol_tags should be a Tcl list of canvas tags for the symbol. ratio and angle are optional and used to stretch/shrink and rotate the symbol. The default ratio is 1, default angle 0. label is an optional text for a label to place near the symbol. label_tags should be a Tcl list of canvas tags for the label, or an empty or null string, if there is no label. Returns an error if the coordinates or part of the symbol are off the image. Uses world coordinates, if available, for the rotation and orientation, for symbols that support it (i.e.: rotation is relative to WCS north). hduCmd(argc, argv) This method implements the "hdu" subcommand, to access different FITS HDUs (header data units). Each HDU may be of type "image", "binary" table or "ascii" table. Usage: hdu count or: hdu list or: hdu listheadings or: hdu type ?number? or: hdu headings ?$number? or: hdu get ?$number? ?$filename? ?$entry? or: hdu create $type $extname $headings $tform $data or: hdu delete $number or: hdu set $number or: hdu ?$number? If the "hdu count" subcommand is specified, it returns the number of HDUs in the current image. The "hdu type" subcommand returns the type of the current or given HDU as a string "ascii", "binary" or "image". If the "hdu list" subcommand is specified, it returns a Tcl list of FITS HDU information of the form: {{number type extname naxis naxis1 naxis2 naxis3 crpix1 crpix2} ...} Where: - number is the HDU number - type is the HDU type: one of "image", "binary table", "ascii table". - extname is the value of the EXTNAME keyword, if set - naxis, naxis1, naxis2, naxis3 match the FITS keyword values. The "hdu listheadings" subcommand returns a list of the column names returned by the "hdu list" subcommand. This can be used to set the title of a table listing of the HDUs in a FITS file. The "hdu headings" subcommand returns a list of the column names in the current or given FITS table. The "hdu get" subcommand with no arguments returns the contents of the current ASCII or binary table as a Tcl list (a list of rows, where each row is a list of column values). If the HDU number is given, the contents of the given HDU are returned. If a filename argument is given, the FITS table is written to the given file in the form of a local (tab separated) catalog. If optional "entry" argument is given, it specifies the catalog config entry as a list of {{keyword value} {keyword value} ...}, as defined in the catalog config file (~/.skycat/skycat.cfg). The entry is written to the header of the local catalog file and is used mainly to specify plot symbol information for the catalog. The "hdu create" command creates a new FITS table in the current image file. $type maye be "ascii" for an ASCII table or "binary" for a binary FITS table. The name of the table is given by extname. The table headings and data correspond to the catalog headings and data. The tform argument is a list of FITS storage formats, one for each column, of the form {16A 2D 12A ...} (similar to FORTRAN formats, see the FITS docs). The "hdu delete" command deletes the given HDU. The argument is the HDU number. The other HDUs in the file following the deleted one are moved to fill the gap. If the "hdu" subcommand is specified with no arguments, it returns the current HDU number. If a number argument is given, the current HDU is set to that number. The "hdu set" subcommand sets the current HDU to the given number. The keyword "set" is optional (see below). An optional numerical argument may be passed to the "hdu" subcommand, in which case the "current HDU" is set to the given number. SEE ALSO SkyCat(n), SkySearch(3), RtdImage(3), TkImage(3), FitsIO(3) -------------------------------------------------------------------- skycat-3.1.2-starlink-1b/skycat/man/skycat.man1000066400000000000000000000176221215713201500212720ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # $Id: skycat.man1,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is processed by the ESO/VLT docDoManPages command to # produce a man page in nroff, TeX and MIF formats. # See docDoManPages(1) for a description of the input format. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 5 Feb 96 Created # NAME skycat - A tool for displaying astronomical images and catalogs SYNOPSIS skycat ?filename? ?-option value ...? OPTIONS ?-file filename? Specify a FITS file to display. '-' means read the file from the standard input. The '-file' part is optional, so you can also simply specify a file name. Image compression and decompression is done automatically, based on the file name suffix: .gzfits or .gfits for GZIP compression, .hfits for H-compress, and .cfits for UNIX compression. -cat bool If bool is 1, include 'Data-Servers' menu in the menubar (This is the default). The 'Data-Servers' menu gives you access to the ESO Archive extensions for browsing astronomical catalogs, plotting objects in the image window and getting images over the network from the image servers, such as the Digitized Sky server. -rtd bool If bool is 1, include the Real-Time menu in the menubar (default is 0). The Real-Time menu gives you access to the VLT Real-Time Display features, such as camera control and rapid frames. To use these features, the rtdServer daemon must be running on the local host. A client application, linked with the Rtd image event library can then send images via shared memory to be displayed in rapid succession. -float_panel bool If the option value is 1, the skycat info panel is put in a separate popup window, leaving more space for the image window (The default is off). -panel_layout With this option you can change the order of the zoom and pan windows in the layout. The default layout is: zoom window on the left, info panel in the center and pan window right. If "-panel_layout saoimage" is specified, a layout similar to saoimage is used (info panel, pan window, zoom window). If "-panel_layout reverse" is specified, the order of the windows is the reverse of the default. -remote bool If "-remote 1" is specified and a skycat process is already running, the existing skycat process is sent a message and asked to open a new window and the new skycat process exits immediately. This has the advantage of sharing the image colormap and using fewer system resources, however it depends on being able to use the Tcl send mechanism. For security reasons, Tcl send will not work if you are using "xhost" based X security. You need to use X-auth security. See the "Tcl/Tk Tools" book from O'Reilly for more on this topic. -min_scale n -max_scale n Specify the min and max scale values for the Magnification menu. Negative values shrink the image, positive values zoom in closer. The default values are -10 and 20. -port portnum Specify a port number to use for the remote RTD socket interface. See the Rtd User's Guide for details on this socket based interface. By default, a port number is chosen automatically and written to the file ~/.rtd-remote. -disp_image_icon bool If bool is 1 (default), display a miniature version of the image in the tool's icon window. -default_cmap Specify the default colormap. This should be one of the names listed in the 'Colors' popup window (default is 'real'). -default_itt Specify the default intensity transfer table. This should be one of the names listed in the 'Colors' popup window (default is 'ramp'). -colorramp_height This option can be used to change the height of color bar (the widget at the bottom of the screen displaying the image colors). -with_colorramp bool If bool is true, display the color bar (default). -with_zoom_window bool If bool is true, display the zoom window (default). -with_pan_window bool If bool is true, display the pan window (default). -dozoom bool If bool is true, turn the zoom window on automatically (default). DESCRIPTION The ESO Skycat tool combines the image display capabilities of the RTD (Real-Time Display) with a set of classes for accessing astronomical catalogs locally and over the network using HTTP. The tool allows you to view FITS images from files or from the Digitized Sky Survey (DSS). MENU ITEMS: File menu Open... Open and display a (FITS) image file. Reopen... Reload the image display after the image has changed on disk. Save as... Save the current image to a file. Save region as... Save a section of the current image to a file. Print... Print the current image to a file or printer. Clear Clear the image display. New Window Display up a new main window. Close Close the main window and exit if there are no more windows. Exit Exit the application. View menu Colors... Display a window for manipulating the image colormap. Cut Levels... Display a window for manipulating the image cut levels. Cuts... Display a graph of pixel values along a line drawn interactively over the image. Pick Object... Select an object or star in the image and display statistics. Fits Header... Display the FITS header for the current image. Pixel Table... Display a table of pixel values surrounding the mouse cursor. Magnification Set the magnification factor of the image display. Hide Control Panel Toggle the visibility of the upper control panel Hide Popup Windows Toggle the visibility of the popup windows. Graphics menu Toolbox Display the line graphics toolbox. Mode => Select the drawing mode. Width => Set the line width for drawing. Arrow => Select the arrow mode for lines. ArrorShape => Select the arrow shape for lines. Fill => Select the fill color for drawing. Outline => Select the outline color for drawing. Stipple => Select the stipple pattern for filling objects. Font => Select the font to use for labels. Smooth => Set the smooth option for drawing polygons Clear => Delete graphic objects. Delete => Delete selected graphic objects. Hide Graphics Toggle the visibility of the image line graphics Data-Servers Catalogs => Select a catalog from the menu. Image Servers => Select an image server from the menu. Archives => Select an archive from the menu. Local Catalogs => Select a local catalog from the menu. Real-time menu (displayed when -rtd 1 is specified) Attach Camera Attach the real-time camera - start receiving images. Detach Camera Detach the real-time camera - stop receiving images. Set Camera... Set the real-time camera name. Rapid Frame Create a rapid frame by interactively drawing a rectangle on the image. Help menu About Skycat... Display a window with information about this Skycat version. Help... Display information about Skycat in netscape (if netscape is available). ENVIRONMENT VARIABLES $SKYCAT_CONFIG If set, this is used as the URL to access the skycat configuration file, which contains the list of available catalogs and how to query them. By default, the configuration file is also searched for in $HOME/.skycat/skycat.cfg, and if that is not found, in the ESO default URL: http://archive.eso.org/skycat/skycat2.0.cfg. $SKYCAT_PLUGIN If set, this variable should be a colon separated list of files or directories containing skycat plugins. A skycat plugin is a Tcl script that defines a Tcl proc to be called for each instance of the main window. The script is sourced before any windows are created and can also load shared libraries dynamically to add new features. See the Skycat User's Guide (ftp://ftp.archive.eso.org/pub/skycat/docs) for more information. FILES http://archive.eso.org/skycat/skycat2.0.cfg - default configuration file. SEE ALSO SkyCat(n), Skycat(3), rtd(1), RtdImage(3), AstroCat(n) ---------------------------------------------------------------------- skycat-3.1.2-starlink-1b/skycat/pkgIndex.tcl.in000066400000000000000000000002231215713201500213120ustar00rootroot00000000000000# Tcl package index file, version 1.0 package ifneeded Skycat @PACKAGE_VERSION@ [list load [file join [file dirname $dir] @PKG_LIB_FILE@] Skycat] skycat-3.1.2-starlink-1b/skycat/skycat-star.in000077500000000000000000000027301215713201500212350ustar00rootroot00000000000000#!/bin/sh # Start script for skycat # # "@(#) $Id$" # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 28 Jan 06 created # Determine skycat base dir, following any symbolic links, if needed. PRG="$0" while [ -h "$PRG" ]; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`/"$link" fi done DIR=`dirname "$PRG"`/.. SKYCAT_BASE=`(cd $DIR; pwd)` # If we're NOT ssh'd in if [ ! "${SSH_TTY}" ]; then # make sure X is running (on Mac OS X) if [ `uname` = "Darwin" ] ; then if [ "`ps -x | awk '{print $5}' | grep X11`" = "" ]; then for i in /Applications/Utilities $HOME/Desktop ; do if [ -e $i/X11.app ] ; then open $i/X11.app & break fi done fi fi # Make sure DISPLAY is set if [ x${DISPLAY} = x ]; then export DISPLAY=:0 fi fi # Make sure we can find the shared libs @LD_LIBRARY_PATH_VAR@="$SKYCAT_BASE/lib:@BLT_LIB_DIR@:${@LD_LIBRARY_PATH_VAR@}" export @LD_LIBRARY_PATH_VAR@ # and the Tcl packages TCLLIBPATH="$SKYCAT_BASE/lib" export TCLLIBPATH # Make sure we start the correct wish binary PATH=$SKYCAT_BASE/bin:$PATH export PATH test -d $HOME/.skycat || mkdir $HOME/.skycat echo "`date`: Starting skycat with: $0 ${1+"$@"}" > $HOME/.skycat/log exec wish8.5 $SKYCAT_BASE/lib/skycat@PACKAGE_VERSION@/main.tcl ${1+"$@"} | tee -a $HOME/.skycat/log 2>&1 skycat-3.1.2-starlink-1b/skycat/skycat.in000077500000000000000000000030141215713201500202620ustar00rootroot00000000000000#!/bin/sh # Start script for skycat # # "@(#) $Id: skycat.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 28 Jan 06 created # Determine skycat base dir, following any symbolic links, if needed. PRG="$0" while [ -h "$PRG" ]; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`/"$link" fi done DIR=`dirname "$PRG"`/.. SKYCAT_BASE=`(cd $DIR; pwd)` # If we're NOT ssh'd in if [ ! ${SSH_TTY} ]; then # make sure X is running (on Mac OS X) if [ `uname` = "Darwin" ] ; then if [ "`ps -x | awk '{print $5}' | grep X11`" = "" ]; then for i in /Applications/Utilities $HOME/Desktop ; do if [ -e $i/X11.app ] ; then open $i/X11.app & break fi done fi fi # Make sure DISPLAY is set if [ x${DISPLAY} = x ]; then export DISPLAY=:0 fi fi # Make sure we can find the shared libs @LD_LIBRARY_PATH_VAR@="$SKYCAT_BASE/lib:@BLT_LIB_DIR@:${@LD_LIBRARY_PATH_VAR@}" export @LD_LIBRARY_PATH_VAR@ # and the Tcl packages TCLLIBPATH="$SKYCAT_BASE/lib" export TCLLIBPATH # Make sure we start the correct wish binary PATH=$SKYCAT_BASE/bin:$PATH export PATH test -d $HOME/.skycat || mkdir $HOME/.skycat echo "`date`: Starting skycat with: $0 ${1+"$@"}" > $HOME/.skycat/log exec wish8.4 $SKYCAT_BASE/lib/skycat@PACKAGE_VERSION@/main.tcl ${1+"$@"} | tee -a $HOME/.skycat/log 2>&1 skycat-3.1.2-starlink-1b/skycat/skycatConfig.sh.in000066400000000000000000000032711215713201500220230ustar00rootroot00000000000000# E.S.O. - VLT project # $Id: skycatConfig.sh.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # skycatConfig.sh -- # # This shell script (for sh) is generated automatically by Skycat's # configure script. It will create shell variables for most of # the configuration options discovered by the configure script. # This script is intended to be included by the configure scripts # for Skycat extensions so that they don't have to figure this all # out for themselves. This file does not duplicate information # already provided by tclConfig.sh, so you may need to use that # file in addition to this one. # # The information in this file is specific to a single platform. # Skycat's version number. skycat_VERSION='@PACKAGE_VERSION@' # The name of the Skycat library: skycat_LIB_FILE=@skycat_LIB_FILE@ # String to pass to linker to pick up the Skycat library from its # build directory. skycat_BUILD_LIB_SPEC='@skycat_BUILD_LIB_SPEC@' # Skycat build directory. skycat_BUILD_DIR='@skycat_BUILD_DIR@' # String to pass to linker to pick up the Skycat library from its # installed directory. skycat_LIB_SPEC='@skycat_LIB_SPEC@' # Location of the top-level source directories from which Skycat # was built. This is the directory that contains generic, unix, etc. # If Skycat was compiled in a different place than the directory # containing the source files, this points to the location of the sources, # not the location where Skycat was compiled. skycat_SRC_DIR='@skycat_SRC_DIR@' # List of object files used to build the library (for merging packages). skycat_PKG_OBJECTS='@skycat_PKG_OBJECTS@' # List of header filesinstalled for this library (for merging packages). skycat_PKG_HEADERS='@skycat_PKG_HEADERS@' skycat-3.1.2-starlink-1b/skycat/skycat_version.tcl.in000066400000000000000000000001571215713201500226120ustar00rootroot00000000000000# This file is generated by configure: DO NOT EDIT BY HAND proc skycat_version {} { return @SKYCAT_VERSION@ } skycat-3.1.2-starlink-1b/tclconfig/000077500000000000000000000000001215713201500171055ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/tclconfig/ChangeLog000066400000000000000000000471721215713201500206720ustar00rootroot000000000000002005-12-05 Don Porter * tcl.m4 (TEA_PUBLIC_*_HEADERS): Better support for finding header files for uninstalled Tcl and Tk. 2005-12-02 Jeff Hobbs * tcl.m4: correctly bump TEA_VERSION var to 3.4 2005-12-01 Daniel Steffen * unix/tcl.m4 (Darwin): fixed error when MACOSX_DEPLOYMENT_TARGET unset 2005-11-29 Jeff Hobbs * tcl.m4: *** Bump to TEA version 3.4 *** Add Windows x64 build support. Remove TEA_PATH_NOSPACE and handle the problem with ""s where necessary - the macro relied on TCLSH_PROG which didn't work for cross-compiles. 2005-11-27 Daniel Steffen * tcl.m4 (Darwin): add 64bit support, add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to configure (flag can't be present twice, so can't be in both CFLAGS and LDFLAGS during configure), don't use -prebind when deploying on 10.4. (TEA_ENABLE_LANGINFO, TEA_TIME_HANDLER): add/fix caching. 2005-10-30 Daniel Steffen * tcl.m4: fixed two tests for TEA_WINDOWINGSYSTEM = "aqua" that should have been for `uname -s` = "Darwin" instead; added some missing quoting. (TEA_PROG_TCLSH, TEA_PROG_WISH): fix incorrect assumption that install location of tclConfig.sh/tkConfig.sh allows to determine the tclsh/wish install dir via ../bin. Indeed tcl/tk can be configured with arbitrary --libdir and --bindir (independent of prefix) and such a configuration is in fact standard with Darwin framework builds. At least now also check ${TCL_PREFIX}/bin resp. ${TK_PREFIX}/bin for presence of tclsh resp. wish (if tcl/tk have been configured with arbitrary --bindir, this will still not find them, for a general solution *Config.sh would need to contain the values of bindir/libdir/includedir passed to configure). 2005-10-07 Jeff Hobbs * tcl.m4: Fix Solaris 5.10 check and Solaris AMD64 64-bit builds. 2005-10-04 Jeff Hobbs * tcl.m4 (TEA_PRIVATE_TCL_HEADERS): add / to finish sed macro (TEA_ENABLE_THREADS): don't check for pthread_attr_setstacksize func 2005-09-13 Jeff Hobbs * tcl.m4: *** Update to TEA version 3.3 *** define TEA_WINDOWINGSYSTEM in TEA_LOAD_TKCONFIG. Make --enable-threads the default (users can --disable-threads). Improve AIX ${CC}_r fix to better check existing ${CC} value. Do the appropriate evals to not require the *TOP_DIR_NATIVE vars be set for extensions that use private headers. Make aqua check for Xlib compat headers the same as win32. 2005-07-26 Mo DeJong * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH, TEA_PROG_WISH, TEA_BUILD_WISH): Remove TEA_BUILD_TCLSH and TEA_BUILD_WISH because of complaints that it broke the build when only an installed version of Tcl was available at extension build time. The TEA_PROG_TCLSH and TEA_PROG_WISH macros will no longer search the path at all. The build tclsh or installed tclsh shell will now be found by TEA_PROG_TCLSH. 2005-07-24 Mo DeJong * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH, TEA_PROG_WISH, TEA_BUILD_WISH): Split confused search for tclsh on PATH and build and install locations into two macros. TEA_PROG_TCLSH and TEA_PROG_WISH search the system PATH for an installed tclsh or wish. The TEA_BUILD_TCLSH and TEA_BUILD_WISH macros determine the name of tclsh or wish in the Tcl or Tk build directory even if tclsh or wish has not yet been built. [Tcl bug 1160114] [Tcl patch 1244153] 2005-06-23 Daniel Steffen * tcl.m4 (TEA_PRIVATE_TK_HEADERS): add ${TK_SRC_DIR}/macosx to TK_INCLUDES when building against TkAqua. * tcl.m4 (TEA_PATH_X): fixed missing comma in AC_DEFINE * tcl.m4: changes to better support framework builds of Tcl and Tk out of the box: search framework install locations for *Config.sh, and if in presence of a framework build, use the framework's Headers and PrivateHeaders directories for public and private includes. [FR 947735] 2005-06-18 Daniel Steffen * tcl.m4 (Darwin): add -headerpad_max_install_names to LDFLAGS to ensure we can always relocate binaries with install_name_tool. 2005-06-04 Daniel Steffen * tcl.m4 (TEA_PATH_X): for TEA_WINDOWINGSYSTEM == aqua, check if xlib compat headers are available in tkheaders location, otherwise add xlib sourcedir to TK_XINCLUDES. 2005-04-25 Daniel Steffen * tcl.m4: added AC_DEFINE* descriptions (from core tcl.m4) to allow use with autoheader. (Darwin): added configure checks for recently added linker flags -single_module and -search_paths_first to allow building with older tools (and on Mac OS X 10.1), use -single_module in SHLIB_LD. (TEA_MISSING_POSIX_HEADERS): added caching of dirent.h check. (TEA_BUGGY_STRTOD): added caching (sync with core tcl.m4). 2005-03-24 Jeff Hobbs * tcl.m4 (TEA_TCL_64BIT_FLAGS): use Tcl header defaults for wide int type only on Windows when __int64 is detected as valid. 2005-03-24 Don Porter * README.txt: Update reference to "SC_* macros" to "TEA_* macros". * tcl.m4: Incorporated recent improvements in SC_PATH_TCLCONFIG and SC_PATH_TKCONFIG into TEA_PATH_TCLCONFIG and TEA_PATH_TKCONFIG. Corrected search path in TEA_PATH_CONFIG and added AC_SUBST($1_BIN_DIR) to TEA_LOAD_CONFIG so that packages that load the configuration of another package can know where they loaded it from. 2005-03-18 Jeff Hobbs * tcl.m4 (TEA_CONFIG_CFLAGS): correct 2005-03-17 change to have variant LD_SEARCH_FLAGS for gcc and cc builds. * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): correct x-compile check. 2005-03-17 Jeff Hobbs * tcl.m4: Correct gcc build and HP-UX-11. 2005-02-08 Jeff Hobbs * tcl.m4 (TEA_ADD_LIBS): don't touch lib args starting with -. (TEA_CONFIG_CFLAGS): only define _DLL for CE in shared build. (TEA_MAKE_LIB): set RANLIB* to : on Windows (it's not needed). 2005-02-01 Jeff Hobbs * tcl.m4: redo of 2005-01-27 changes to correctly handle paths with spaces. Win/CE and Win/64 builds now require a prebuilt tclsh to handle conversion to short pathnames. This is done in the new TEA_PATH_NOSPACE macro. For Win/CE|64, make CC just the compiler and move the necessary includes to CFLAGS. (TEA_CONFIG_CFLAGS): Add Solaris 64-bit gcc build support. (TEA_PROG_TCLSH, TEA_PROG_WISH): Allow TCLSH_PROG and WISH_PROG to be set in the env and prevent resetting. (TEA_ADD_LIBS): On Windows using GCC (mingw), convert foo.lib args to -lfoo, for use with mingw. *** POTENTIAL INCOMPATABILITY *** (TEA_CONFIG_CFLAGS): Fix AIX gcc builds to work out-of-box. Bumped TEA to 3.2. 2005-01-27 Jeff Hobbs * tcl.m4: remove cygpath calls to support msys. Update base CE build assumption to "420,ARMV4,ARM,Pocket PC 2003". Make STLIB_LD use $LINKBIN -lib. 2005-01-25 Daniel Steffen * tcl.m4 (Darwin): fixed bug with static build linking to dynamic library in /usr/lib etc instead of linking to static library earlier in search path. [Tcl Bug 956908] Removed obsolete references to Rhapsody. 2004-12-29 Jeff Hobbs * tcl.m4: Updates for VC7 compatibility, fixing CFLAGS and LDFLAGS options, using better default -O levels. [Bug 1092952, 1091967] 2004-12-29 Joe English * tcl.m4: Do not use ${DBGX} suffix when building shared libraries [patch #1081595, TIP #34] 2004-09-07 Jeff Hobbs * tcl.m4 (TEA_CONFIG_CFLAGS): support eVC4 Win/CE builds 2004-08-10 Jeff Hobbs * tcl.m4 (TEA_INIT, TEA_PREFIX): update handling of exec_prefix to work around subdir configures since autoconf only propagates the prefix (not exec_prefix). 2004-07-23 Daniel Steffen * tcl.m4 (TEA_CONFIG_CFLAGS): Darwin section: brought inline with Tcl 8.5 HEAD config, removed core specific & obsolete settings. 2004-07-22 Jeff Hobbs * tcl.m4 (TEA_PATH_X): check in TK_DEFS for MAC_OSX_TK to see if we are compiling on Aqua. Add TEA_WINDOWINGSYSTEM var that reflects 'tk windowingsystem' value. 2004-07-16 Jeff Hobbs * tcl.m4 (TEA_ENABLE_THREADS): force a threaded build when building against a threaded core. (CFLAGS_WARNING): Remove -Wconversion for gcc builds (TEA_CONFIG_CFLAGS): Reorder configure.in for better 64-bit build configuration, replacing EXTRA_CFLAGS with CFLAGS. [Bug #874058] Update to latest Tcl 8.5 head config settings. Call this TEA version 3.1. 2004-04-29 Jeff Hobbs * tcl.m4 (TEA_TCL_64BIT_FLAGS): replace AC_TRY_RUN test with AC_TRY_COMPILE for the long vs. long long check. (kenny) 2004-04-26 Jeff Hobbs * tcl.m4 (TEA_TCL_64BIT_FLAGS): update against core tcl.m4 to define TCL_WIDE_INT_IS_LONG if 'using long'. 2004-03-19 Jeff Hobbs * tcl.m4: correct Windows builds getting LDFLAGS info in MAKE_LIB 2004-02-11 Jeff Hobbs * tcl.m4: correct TCL_INCLUDES for private headers on Windows - it doesn't need the eval. 2004-02-10 Jeff Hobbs * tcl.m4: don't require TK_INCLUDES and TCL_INCLUDES to have the DIR_NATIVE vars defined when using private headers on unix. Allow $... to TEA_ADD_SOURCES for constructs like TEA_ADD_SOURCES([\$(WIN_OBJECTS)]), that allow the developer to place more in the Makefile.in. tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and CHECK on limits.h 2003-12-10 Jeff Hobbs * Makefile.in: added TEA_ADD_LIBS, TEA_ADD_INCLUDES and * configure: TEA_ADD_CFLAGS to configurable parameters with * configure.in: PKG_* equivs in the Makefile. This allows the * tclconfig/tcl.m4: user to worry less about actual magic VAR names. Corrected Makefile.in to note that TEA_ADD_TCL_SOURCES requires exact file names. 2003-12-09 Jeff Hobbs * tcl.m4: updated OpenBSD support based on [Patch #775246] (cassoff) 2003-12-05 Jeff Hobbs * configure: * configure.in: * Makefile.in (VPATH): readd $(srcdir) to front of VPATH as the first part of VPATH can get chopped off. Change .c.$(OBJEXT) rule to .c.@OBJEXT@ to support more makes. * tclconfig/tcl.m4: add TEA_ADD_STUB_SOURCES to support libstub generation and TEA_ADD_TCL_SOURCES to replace RUNTIME_SOURCES as the way the user specifies library files. 2003-12-03 Jeff Hobbs * configure: Update of TEA spec to (hopefully) simplify * configure.in: some aspects of TEA by making use of more * Makefile.in: AC 2.5x features. Use PACKAGE_NAME (instead * generic/tclsample.c: of PACKAGE) and PACKAGE_VERSION (instead of * tclconfig/tcl.m4: VERSION) arguments to AC_INIT as the TEA package name and version. Provide a version argument to TEA_INIT - starting with 3.0. Drop all use of interior shell substs that older makefiles didn't like. Use PKG_* naming convention instead. Move specification of source files and public headers into configure.in with TEA_ADD_SOURCES and TEA_ADD_HEADERS. These will be munged during ./configure into the right obj file names (no $(SOURCES:.c=.obj) needed). There is almost nothing that should be touched in Makefile.in now for the developer. May want to add a TEA_ADD_TCL_SOURCES for the RUNTIME_SOURCES that remains. Use SHLID_LD_FLAGS (instead of SHLID_LDFLAGS) as Tcl does. Only specify the user requested LDFLAGS/CFLAGS in the Makefile, don't mention the _OPTIMIZE/_DEBUG variants. 2003-10-15 Jeff Hobbs * tcl.m4: create a TEA_SETUP_COMPILER_CC the precedes the TEA_SETUP_COMPILER macro. They are split so the check for CC occurs before any use of CC. Also add AC_PROG_CPP to the compiler checks. 2003-10-06 Jeff Hobbs * tcl.m4: Updated for autoconf 2.5x prereq. Where TCL_WIDE_INT_TYPE would be __int64, defer to the code checks in tcl.h, which also handles TCL_LL_MODIFIER* properly. 2003-04-22 Jeff Hobbs * tcl.m4: correct default setting of ARCH for WinCE builds. Correct \ escaping for CE sed macros. 2003-04-10 Jeff Hobbs * tcl.m4: replace $(syscal) construct with older `syscall` for systems where sh != bash. 2003-04-09 Jeff Hobbs * tcl.m4 (TEA_WITH_CELIB): add --enable-wince and --with-celib options for Windows/CE compilation support. Requires the Microsoft eMbedded SDK and Keuchel's celib emulation layer. 2003-02-18 Jeff Hobbs * tcl.m4 (TEA_ENABLE_THREADS): Make sure -lpthread gets passed on the link line when checking for the pthread_attr_setstacksize symbol. (dejong) * tcl.m4 (TEA_SETUP_COMPILER): added default calls to TEA_TCL_EARLY_FLAGS, TEA_TCL_64BIT_FLAGS, TEA_MISSING_POSIX_HEADERS and TEA_BUGGY_STRTOD. 2003-02-14 Jeff Hobbs * tcl.m4: correct HP-UX ia64 --enable-64bit build flags 2003-01-29 Jeff Hobbs * tcl.m4: check $prefix/lib as well as $exec_prefix/lib when looking for tcl|tkConfig.sh, as this check is done before we would set exec_prefix when the user does not define it. 2003-01-21 Mo DeJong * tcl.m4 (TEA_CONFIG_CFLAGS): Fix build support for mingw, the previous implementation would use VC++ when compiling with mingw gcc. Don't pass -fPIC since gcc always compiles pic code under win32. Change some hard coded cases of gcc to ${CC}. 2002-10-15 Jeff Hobbs * tcl.m4: move the CFLAGS definition from TEA_ENABLE_SHARED to TEA_MAKE_LIB because setting too early confuses other AC_* macros. Correct the HP-11 SHLIB_LD_LIBS setting. * tcl.m4: add the CFLAGS definition into TEA_ENABLE_SHARED and make it pick up the env CFLAGS at configure time. 2002-10-09 Jeff Hobbs * tcl.m4: add --enable-symbols=mem option to enable TCL_MEM_DEBUG. Improved AIX 64-bit build support, allow it on AIX-4 as well. Enable 64-bit HP-11 compilation with gcc. Enable 64-bit IRIX64-6 cc build support. Correct FreeBSD thread library linkage. Add OSF1 static build support. Improve SunOS-5 shared build SHLIB_LD macro. 2002-07-20 Zoran Vasiljevic * tcl.m4: Added MINGW32 to list of systems checked for Windows build. Also, fixes some indentation issues with "--with-XXX" options. 2002-04-23 Jeff Hobbs * tcl.m4 (TEA_ENABLE_THREADS): added USE_THREAD_ALLOC define to use new threaded allocatory by default on Unix for Tcl 8.4. (TEA_CONFIG_CFLAGS): corrected LD_SEARCH_FLAGS for FreeBSD-3+. 2002-04-22 Jeff Hobbs * tcl.m4 (TEA_SETUP_COMPILER): removed call to AC_CYGWIN so that we can use autoconf 2.5x as well as 2.13. This prevents us from being able to warn against the use of cygwin gcc at configure time, but allows autoconf 2.5x, which is what is shipped with most newer systems. 2002-04-11 Jeff Hobbs * tcl.m4: Enabled COFF as well as CV style debug info with --enable-symbols to allow Dr. Watson users to see function info. More info on debugging levels can be obtained at: http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp 2002-04-03 Jeff Hobbs * tcl.m4: change all SC_* macros to TEA_*. The SC_ was for Scriptics, which is no more. TEA represents a better, independent prefix that won't need changing. Added preliminary mingw gcc support. [Patch #538772] Added TEA_PREFIX macro that handles defaulting the prefix and exec_prefix vars to those used by Tcl if none were specified. Added TEA_SETUP_COMPILER macro that encompasses the AC_PROG_CC check and several other basic AC_PROG checks needed for making executables. This greatly simplifies user's configure.in files. Collapsed AIX-5 defines into AIX-* with extra checks for doing the ELF stuff on AIX-5-ia64. Updated TEA_ENABLE_THREADS to take an optional arg to allow switching it on by default (for Thread) and add sanity checking to warn the user if configuring threads incompatibly. 2002-03-29 Jeff Hobbs * tcl.m4: made sure that SHLIB_LDFLAGS was set to LDFLAGS_DEFAULT. Removed --enable-64bit support for AIX-4 because it wasn't correct. Added -MT or -MD Windows linker switches to properly support symbols-enabled builds. 2002-03-28 Jeff Hobbs * tcl.m4: called AC_MSG_ERROR when SC_TEA_INIT wasn't called first instead of calling it as that inlines it each time in shell code. Changed Windows CFLAGS_OPTIMIZE to use -O2 instead of -Oti. Noted TCL_LIB_VERSIONS_OK=nodots for Windows builds. A few changes to support itcl (and perhaps others): Added support for making your own stub libraries to SC_MAKE_LIB. New SC_PATH_CONFIG and SC_LOAD_CONFIG that take a package name arg and find that ${pkg}Config.sh file. itk uses this for itcl. 2002-03-27 Jeff Hobbs * tcl.m4: made SC_LOAD_TKCONFIG recognize when working with a Tk build dir setup. Added EXTRA_CFLAGS and SHLIB_LD_LIBS substs to SC_CONFIG_CFLAGS. Added XLIBSW onto LIBS when it is defined. Remove TCL_LIBS from MAKE_LIB and correctly use SHLIB_LD_LIBS instead to not rely as much on tclConfig.sh cached info. Add TK_BIN_DIR to paths to find wish in SC_PROG_WISH. These move towards making TEA much more independent of *Config.sh. 2002-03-19 Jeff Hobbs * tcl.m4: corrected forgotten (UN)SHARED_LIB_SUFFIX and SHLIB_SUFFIX defines for Win. (SC_PATH_X): made this only do the check on unix platforms. 2002-03-12 Jeff Hobbs * README.txt: updated to reflect fewer files 2002-03-06 Jeff Hobbs * config.guess (removed): * config.sub (removed): removed unnecessary files * installFile.tcl (removed): * mkinstalldirs (removed): these aren't really necessary for making TEA work * tcl.m4 (SC_PUBLIC_TCL_HEADERS, SC_PUBLIC_TK_HEADERS): don't check /usr(/local)/include for includes on Windows when not using gcc 2002-03-05 Jeff Hobbs * tcl.m4: added warnings on Windows, removed RELPATH define and added TCL_LIBS to MAKE_LIB macro. This import represents 2.0.0, or a new start at attempting to make TEA much easier for C extension developers. **** moved from tclpro project to core tcl project, **** **** renamed to 'tclconfig' **** 2001-03-15 Karl Lehenbauer * installFile.tcl: Added updating of the modification time of the target file whether we overwrote it or decided that it hadn't changed. This was necessary for us to be able to determine whether or not a module install touched the file. 2001-03-08 Karl Lehenbauer * installFile.tcl: Added support for converting new-style (1.1+) Cygnus drive paths to Tcl-style. 2001-01-15 * tcl.m4: Added FreeBSD clause. 2001-01-03 * tcl.m4: Fixed typo in SC_LIB_SPEC where it is checking for exec-prefix. 2000-12-01 * tcl.m4: Concatenated most of the Ajuba acsite.m4 file so we don't need to modify the autoconf installation. * config.guess: * config.sub: * installFile.tcl: Added files from the itcl config subdirectory, which should go away. 2000-7-29 * Fixed the use of TCL_SRC_DIR and TK_SRC_DIR within TCL_PRIVATE_INCLUDES and TK_PRIVATE_INCLUDES to match their recent change from $(srcdir) to $(srcdir)/.. skycat-3.1.2-starlink-1b/tclconfig/README.txt000066400000000000000000000014541215713201500206070ustar00rootroot00000000000000These files comprise the basic building blocks for a Tcl Extension Architecture (TEA) extension. For more information on TEA see: http://www.tcl.tk/doc/tea/ This package is part of the Tcl project at SourceForge, and latest sources should be available there: http://tcl.sourceforge.net/ This package is a freely available open source package. You can do virtually anything you like with it, such as modifying it, redistributing it, and selling it either in whole or in part. CONTENTS ======== The following is a short description of the files you will find in the sample extension. README.txt This file install-sh Program used for copying binaries and script files to their install locations. tcl.m4 Collection of Tcl autoconf macros. Included by a package's aclocal.m4 to define TEA_* macros. skycat-3.1.2-starlink-1b/tclconfig/install-sh000077500000000000000000000042121215713201500211100ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 skycat-3.1.2-starlink-1b/tclconfig/tcl.m4000066400000000000000000003606731215713201500201500ustar00rootroot00000000000000# tcl.m4 -- # # This file provides a set of autoconf macros to help TEA-enable # a Tcl extension. # # Copyright (c) 1999-2000 Ajuba Solutions. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: tcl.m4,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ AC_PREREQ(2.50) # Possible values for key variables defined: # # TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') # TEA_PLATFORM - windows unix # #------------------------------------------------------------------------ # TEA_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN(TEA_PATH_TCLCONFIG, [ dnl Make sure we are initialized AC_REQUIRE([TEA_INIT]) # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true AC_ARG_WITH(tcl, [ --with-tcl directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval}) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d ${TCLTK_ROOT}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" AC_MSG_WARN("Cannot find Tcl configuration definitions") exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} AC_MSG_RESULT([found $TCL_BIN_DIR/tclConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_PATH_TKCONFIG -- # # Locate the tkConfig.sh file # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tk=... # # Defines the following vars: # TK_BIN_DIR Full path to the directory containing # the tkConfig.sh file #------------------------------------------------------------------------ AC_DEFUN(TEA_PATH_TKCONFIG, [ # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true AC_ARG_WITH(tk, [ --with-tk directory containing tk configuration (tkConfig.sh)], with_tkconfig=${withval}) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case ${with_tkconfig} in */tkConfig.sh ) if test -f ${with_tkconfig}; then AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d ${TCLTK_ROOT}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi ]) if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" AC_MSG_WARN("Cannot find Tk configuration definitions") exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} AC_MSG_RESULT([found $TK_BIN_DIR/tkConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Subst the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE # #------------------------------------------------------------------------ AC_DEFUN(TEA_LOAD_TCLCONFIG, [ AC_MSG_CHECKING([for existence of $TCL_BIN_DIR/tclConfig.sh]) if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . $TCL_BIN_DIR/tclConfig.sh else AC_MSG_RESULT([file not found]) fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" AC_SUBST(TCL_VERSION) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) AC_SUBST(TCL_LIBS) AC_SUBST(TCL_DEFS) AC_SUBST(TCL_EXTRA_CFLAGS) AC_SUBST(TCL_LD_FLAGS) AC_SUBST(TCL_SHLIB_LD_LIBS) #AC_SUBST(TCL_BUILD_LIB_SPEC) #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) ]) #------------------------------------------------------------------------ # TEA_LOAD_TKCONFIG -- # # Load the tkConfig.sh file # # Arguments: # # Requires the following vars to be set: # TK_BIN_DIR # # Results: # # Sets the following vars that should be in tkConfig.sh: # TK_BIN_DIR #------------------------------------------------------------------------ AC_DEFUN(TEA_LOAD_TKCONFIG, [ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) . $TK_BIN_DIR/tkConfig.sh else AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi # # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TK_BIN_DIR/Makefile ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} fi # Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi # # eval is required to do the TK_DBGX substitution # eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" AC_SUBST(TK_VERSION) AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_LIB_FILE) AC_SUBST(TK_LIB_FLAG) AC_SUBST(TK_LIB_SPEC) AC_SUBST(TK_STUB_LIB_FILE) AC_SUBST(TK_STUB_LIB_FLAG) AC_SUBST(TK_STUB_LIB_SPEC) AC_SUBST(TK_LIBS) AC_SUBST(TK_XINCLUDES) AC_SUBST(TK_SRC_DIR) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SHARED -- # # Allows the building of shared libraries # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-shared=yes|no # # Defines the following vars: # STATIC_BUILD Used for building import/export libraries # on Windows. # # Sets the following vars: # SHARED_BUILD Value of 1 or 0 #------------------------------------------------------------------------ AC_DEFUN(TEA_ENABLE_SHARED, [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, [ --enable-shared build and link with shared libraries [--enable-shared]], [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then AC_MSG_RESULT([shared]) SHARED_BUILD=1 else AC_MSG_RESULT([static]) SHARED_BUILD=0 AC_DEFINE(STATIC_BUILD, 1, [Is this a static build?]) fi AC_SUBST(SHARED_BUILD) ]) #------------------------------------------------------------------------ # TEA_ENABLE_THREADS -- # # Specify if thread support should be enabled. If "yes" is specified # as an arg (optional), threads are enabled by default, "no" means # threads are disabled. "yes" is the default. # # TCL_THREADS is checked so that if you are compiling an extension # against a threaded core, your extension must be compiled threaded # as well. # # Note that it is legal to have a thread enabled extension run in a # threaded or non-threaded Tcl core, but a non-threaded extension may # only run in a non-threaded Tcl core. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-threads # # Sets the following vars: # THREADS_LIBS Thread library(s) # # Defines the following vars: # TCL_THREADS # _REENTRANT # #------------------------------------------------------------------------ AC_DEFUN(TEA_ENABLE_THREADS, [ AC_ARG_ENABLE(threads, [ --enable-threads build with threads], [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants. AC_DEFINE(USE_THREAD_ALLOC, 1, [Do we want to use the threaded memory allocator?]) AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the # same library, as some systems hide it there until # pthread.h is defined. We could alternatively do an # AC_TRY_COMPILE with pthread.h, but that will work with # libpthread really doesn't exist, like AIX 4.2. # [Bug: 4359] AC_CHECK_LIB(pthread, __pthread_mutex_init, tcl_ok=yes, tcl_ok=no) fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else AC_CHECK_LIB(pthreads, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else AC_CHECK_LIB(c, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "no"; then AC_CHECK_LIB(c_r, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 AC_MSG_WARN("Don t know how to find pthread lib on your system - thread support disabled") fi fi fi fi dnl # Not needed in TEA dnl # Does the pthread-implementation provide dnl # 'pthread_attr_setstacksize' ? dnl dnl ac_saved_libs=$LIBS dnl LIBS="$LIBS $THREADS_LIBS" dnl AC_CHECK_FUNCS(pthread_attr_setstacksize) dnl LIBS=$ac_saved_libs fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output AC_MSG_CHECKING([for building with threads]) if test "${TCL_THREADS}" = "1"; then AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) #LIBS="$LIBS $THREADS_LIBS" AC_MSG_RESULT([yes (default)]) else AC_MSG_RESULT([no]) fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then AC_MSG_WARN([ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads.]) fi ;; *) if test "${TCL_THREADS}" = "1"; then AC_MSG_WARN([ --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core.]) fi ;; esac AC_SUBST(TCL_THREADS) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used # Memory (TCL_MEM_DEBUG) debugging can also be enabled. # # Arguments: # none # # Requires the following vars to be set: # CFLAGS_DEBUG # CFLAGS_OPTIMIZE # LDFLAGS_DEBUG # LDFLAGS_OPTIMIZE # # Results: # # Adds the following arguments to configure: # --enable-symbols # # Defines the following vars: # CFLAGS_DEFAULT Sets to CFLAGS_DEBUG if true # Sets to CFLAGS_OPTIMIZE if false # LDFLAGS_DEFAULT Sets to LDFLAGS_DEBUG if true # Sets to LDFLAGS_OPTIMIZE if false # DBGX Formerly used as debug library extension; # always blank now. # #------------------------------------------------------------------------ AC_DEFUN(TEA_ENABLE_SYMBOLS, [ dnl Make sure we are initialized AC_REQUIRE([TEA_CONFIG_CFLAGS]) DBGX="" AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" AC_MSG_RESULT([no]) else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then AC_MSG_RESULT([yes (standard debugging)]) fi fi if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi AC_SUBST(TCL_DBGX) AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then AC_MSG_RESULT([enabled symbols mem debugging]) else AC_MSG_RESULT([enabled $tcl_ok debugging]) fi fi ]) #------------------------------------------------------------------------ # TEA_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. # This is only relevant for Unix. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-langinfo=yes|no (default is yes) # # Defines the following vars: # HAVE_LANGINFO Triggers use of nl_langinfo if defined. # #------------------------------------------------------------------------ AC_DEFUN(TEA_ENABLE_LANGINFO, [ AC_ARG_ENABLE(langinfo, [ --enable-langinfo use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic], [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) fi AC_MSG_CHECKING([whether to use nl_langinfo]) if test "$langinfo_ok" = "yes"; then AC_CACHE_VAL(tcl_cv_langinfo_h, AC_TRY_COMPILE([#include ], [nl_langinfo(CODESET);], [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])) AC_MSG_RESULT($tcl_cv_langinfo_h) if test $tcl_cv_langinfo_h = yes; then AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) fi else AC_MSG_RESULT([$langinfo_ok]) fi ]) #-------------------------------------------------------------------- # TEA_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler # for building shared libraries and other such nonsense. # # Arguments: # none # # Results: # # Defines the following vars: # # DL_OBJS - Name of the object file that implements dynamic # loading for Tcl on this system. # DL_LIBS - Library file(s) to include in tclsh and other base # applications in order for the "load" command to work. # LDFLAGS - Flags to pass to the compiler when linking object # files into an executable application binary such # as tclsh. # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. # SHLIB_CFLAGS - Flags to pass to cc when compiling the components # of a shared library (may request position-independent # code, among other things). # SHLIB_LD - Base command to use for combining object files # into a shared library. # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when # creating shared libraries. This symbol typically # goes at the end of the "ld" commands that build # shared libraries. The value of the symbol is # "${LIBS}" if all of the dependent libraries should # be specified when creating a shared library. If # dependent libraries should not be specified (as on # SunOS 4.x, where they cause the link to fail, or in # general if Tcl and Tk aren't themselves shared # libraries), then this symbol has an empty string # as its value. # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable # extensions. An empty string means we don't know how # to use shared libraries on this platform. # TCL_LIB_FILE - Name of the file that contains the Tcl library, such # as libtcl7.8.so or libtcl7.8.a. # TCL_LIB_SUFFIX -Specifies everything that comes after the "libtcl" # in the shared library name, using the # ${PACKAGE_VERSION} variable to put the version in # the right place. This is used by platforms that # need non-standard library names. # Examples: ${PACKAGE_VERSION}.so.1.1 on NetBSD, # since it needs to have a version after the .so, and # ${PACKAGE_VERSION}.a on AIX, since the Tcl shared # library needs to have a .a extension whereas shared # objects for loadable extensions have a .so # extension. Defaults to # ${PACKAGE_VERSION}${SHLIB_SUFFIX}. # TCL_NEEDS_EXP_FILE - # 1 means that an export file is needed to link to a # shared library. # TCL_EXP_FILE - The name of the installed export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # TCL_BUILD_EXP_FILE - # The name of the built export / import file which # should be used to link to the Tcl shared library. # Empty if Tcl is unshared. # CFLAGS_DEBUG - # Flags used when running the compiler in debug mode # CFLAGS_OPTIMIZE - # Flags used when running the compiler in optimize mode # CFLAGS - We add CFLAGS to pass to the compiler # # Subst's the following vars: # DL_LIBS # CFLAGS_DEBUG # CFLAGS_OPTIMIZE # CFLAGS_WARNING # # STLIB_LD # SHLIB_LD # SHLIB_CFLAGS # LDFLAGS_DEBUG # LDFLAGS_OPTIMIZE #-------------------------------------------------------------------- AC_DEFUN(TEA_CONFIG_CFLAGS, [ dnl Make sure we are initialized AC_REQUIRE([TEA_INIT]) # Step 0: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is enabled]) AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)], [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT([$do64bit]) # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support], [do64bitVIS=$enableval], [do64bitVIS=no]) AC_MSG_RESULT([$do64bitVIS]) if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 0.c: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = "windows" ; then AC_MSG_CHECKING([if Windows/CE build is requested]) AC_ARG_ENABLE(wince,[ --enable-wince enable Win/CE support (where applicable)], [doWince=$enableval], [doWince=no]) AC_MSG_RESULT($doWince) fi # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. AC_MSG_CHECKING([system version (for dynamic loading)]) if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then AC_MSG_RESULT([unknown (can't find uname command)]) system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print $3}' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi if test "${TEA_PLATFORM}" = "windows" ; then system=windows fi AC_MSG_RESULT([$system]) fi fi # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. AC_CHECK_LIB(dl, dlopen, have_dl=yes, have_dl=no) # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case and CC_SEARCH_FLAGS becomes LD_SEARCH_FLAGS for us # (and we have no CC_SEARCH_FLAGS). do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g if test "$GCC" = "yes" ; then CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" else CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" dnl FIXME: Replace AC_CHECK_PROG with AC_CHECK_TOOL once cross compiling is fixed. dnl AC_CHECK_TOOL(AR, ar, :) AC_CHECK_PROG(AR, ar, ar) STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then AC_MSG_WARN([Could not find 64-bit $MACHINE SDK to enable 64bit mode]) AC_MSG_WARN([Ensure latest Platform SDK is installed]) do64bit="no" else AC_MSG_RESULT([ Using 64-bit $MACHINE mode]) do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then AC_MSG_ERROR([Windows/CE and 64-bit builds incompatible]) fi if test "$GCC" = "yes" ; then AC_MSG_ERROR([Windows/CE and GCC builds incompatible]) fi TEA_PATH_CELIB # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length([$]1)) { printf "CEVERSION=\"%s\"\n", [$]1; \ if ([$]1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length([$]2)) { printf "TARGETCPU=\"%s\"\n", toupper([$]2) }; \ if (length([$]3)) { printf "ARCH=\"%s\"\n", toupper([$]3) }; \ if (length([$]4)) { printf "PLATFORM=\"%s\"\n", [$]4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then AC_MSG_ERROR([could not find PocketPC SDK or target compiler to enable WinCE mode [$CEVERSION,$TARGETCPU,$ARCH,$PLATFORM]]) doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 TEA_ADD_LIBS([bufferoverflowU.lib]) elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower([$]0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do AC_DEFINE_UNQUOTED($i, 1, [WinCE def ]$i) done AC_DEFINE_UNQUOTED(_WIN32_WCE, $CEVERSION, [_WIN32_WCE version]) AC_DEFINE_UNQUOTED(UNDER_CE, $CEVERSION, [UNDER_CE version]) CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" AC_SUBST(CELIB_DIR) else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2" SHLIB_LD="$CXX -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac AC_MSG_RESULT([Using $CC for compiling with threads]) fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then #LIBOBJS="$LIBOBJS tclLoadAix.o" AC_LIBOBJ([tclLoadAix]) DL_LIBS="-lld" fi # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN("64bit mode not supported with GCC on $system") else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS="$LDFLAGS -q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi else if test "$GCC" = "yes" ; then SHLIB_LD="$CXX -shared" else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. AC_CHECK_LIB(bsd, gettimeofday, libbsd=yes, libbsd=no) if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" AC_DEFINE(USE_DELTA_FOR_TZ, 1, [Do we need a special AIX hack for timezones?]) fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CXX} -nostart" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="$CXX -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then SHLIB_LD="$CXX -shared -fPIC" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="${CXX} -shared -fPIC" SHLIB_LD_LIBS='${LIBS}' ;; *) AC_MSG_WARN("64bit mode not supported with GCC on $system") ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS="$LDFLAGS +DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi LD_LIBRARY_PATH_VAR="SHLIB_PATH" ;; IRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN([64bit mode not supported by gcc]) else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS="$LDFLAGS -64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" if test "$have_dl" = yes; then SHLIB_LD="${CXX} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' else AC_CHECK_HEADER(dld.h, [ SHLIB_LD="ld -shared" DL_OBJS="tclLoadDld.o" DL_LIBS="-ldld" LD_SEARCH_FLAGS=""]) fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x ; then CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" if test "$have_dl" = yes; then SHLIB_LD="${CXX} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" LD_SEARCH_FLAGS="" else AC_CHECK_HEADER(dld.h, [ SHLIB_LD="ld -shared" DL_OBJS="" DL_LIBS="-ldld" LD_SEARCH_FLAGS=""]) fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[[1-2]].*) # Not available on all versions: check for include file. AC_CHECK_HEADER(dlfcn.h, [ # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' AC_MSG_CHECKING([for ELF]) AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], AC_MSG_RESULT([yes]) SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so', AC_MSG_RESULT([no]) SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' ) ], [ SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' ]) # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) SHLIB_LD="${CXX} -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" AC_MSG_CHECKING(for ELF) AC_EGREP_CPP(yes, [ #ifdef __ELF__ yes #endif ], [AC_MSG_RESULT(yes) SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'], [AC_MSG_RESULT(no) SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0'] ) # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" if test $do64bit = yes; then do64bit_ok=yes CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" fi SHLIB_LD='${CXX} -dynamiclib ${CFLAGS} ${LDFLAGS}' AC_CACHE_CHECK([if ld accepts -single_module flag], tcl_cv_ld_single_module, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" AC_TRY_LINK(, [int i;], tcl_cv_ld_single_module=yes, tcl_cv_ld_single_module=no) LDFLAGS=$hold_ldflags]) if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: test -z "${MACOSX_DEPLOYMENT_TARGET}" || \ test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print [$]2}'`" -lt 4 && \ LDFLAGS="$LDFLAGS -prebind" LDFLAGS="$LDFLAGS -headerpad_max_install_names" AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" AC_TRY_LINK(, [int i;], tcl_cv_ld_search_paths_first=yes, tcl_cv_ld_search_paths_first=no) LDFLAGS=$hold_ldflags]) if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="$CXX -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h [Should OS/390 do the right thing with sockets?]) ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export $@:' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" # PWD: don't need this. #LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" LD_SEARCH_FLAGS="" ;; RISCos-*) SHLIB_CFLAGS="-G 0" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[[0-6]]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC" SHLIB_LD="$CXX -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else SHLIB_LD="$CXX -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' SHLIB_CFLAGS="-KPIC" fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then if test "`gcc -dumpversion` | awk -F. '{print $1}'" -lt "3" ; then AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" fi else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS="$LDFLAGS -xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS="$LDFLAGS -xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi elif test "$arch" = "amd64 i386" ; then if test "$GCC" = "yes" ; then AC_MSG_WARN([64bit mode not supported with GCC on $system]) else do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" fi else AC_MSG_WARN([64bit mode not supported for $arch]) fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC" SHLIB_LD="$CXX -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' if test "$do64bit" = "yes" ; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS},-R,$v9gcclibdir" fi else SHLIB_CFLAGS="-KPIC" SHLIB_LD="$CXX -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' if test "$GCC" != "yes" ; then CFLAGS="$CFLAGS -DHAVE_TZSET -std1" fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS AC_MSG_CHECKING(for ld accepts -Bexport flag) LDFLAGS="$LDFLAGS -Wl,-Bexport" AC_TRY_LINK(, [int i;], [found=yes], [LDFLAGS=$hold_ldflags found=no]) AC_MSG_RESULT([$found]) LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" != "no" -a "$do64bit_ok" = "no" ; then AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need # to determine which of several header files defines the a.out file # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we # support only a file format that is more or less version-7-compatible. # In particular, # - a.out files must begin with `struct exec'. # - the N_TXTOFF on the `struct exec' must compute the seek address # of the text segment # - The `struct exec' must contain a_magic, a_text, a_data, a_bss # and a_entry fields. # The following compilation should succeed if and only if either sys/exec.h # or a.out.h is usable for the purpose. # # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the # `struct exec' includes a second header that contains information that # duplicates the v7 fields that are needed. if test "x$DL_OBJS" = "xtclLoadAout.o" ; then AC_MSG_CHECKING([sys/exec.h]) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT([$tcl_ok]) if test $tcl_ok = usable; then AC_DEFINE(USE_SYS_EXEC_H, 1, [Should we use when doing dynamic loading?]) else AC_MSG_CHECKING([a.out.h]) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT([$tcl_ok]) if test $tcl_ok = usable; then AC_DEFINE(USE_A_OUT_H, 1, [Should we use when doing dynamic loading?]) else AC_MSG_CHECKING([sys/exec_aout.h]) AC_TRY_COMPILE([#include ],[ struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_midmag == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ], tcl_ok=usable, tcl_ok=unusable) AC_MSG_RESULT([$tcl_ok]) if test $tcl_ok = usable; then AC_DEFINE(USE_SYS_EXEC_AOUT_H, 1, [Should we use when doing dynamic loading?]) else DL_OBJS="" fi fi fi fi # Step 5: disable dynamic loading if requested via a command-line switch. AC_ARG_ENABLE(load, [ --disable-load disallow dynamic loading and "load" command], [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; RISCos-*) ;; SCO_SV-3.2*) ;; ULTRIX-4.*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi AC_SUBST(SHLIB_SUFFIX) AC_SUBST(DL_LIBS) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(SHLIB_LD_LIBS) AC_SUBST(LDFLAGS_DEBUG) AC_SUBST(LDFLAGS_OPTIMIZE) AC_SUBST(LD_LIBRARY_PATH_VAR) # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary TEA_TCL_EARLY_FLAGS TEA_TCL_64BIT_FLAGS ]) #-------------------------------------------------------------------- # TEA_SERIAL_PORT # # Determine which interface to use to talk to the serial port. # Note that #include lines must begin in leftmost column for # some compilers to recognize them as preprocessor directives, # and some build environments have stdin not pointing at a # pseudo-terminal (usually /dev/null instead.) # # Arguments: # none # # Results: # # Defines only one of the following vars: # HAVE_SYS_MODEM_H # USE_TERMIOS # USE_TERMIO # USE_SGTTY # #-------------------------------------------------------------------- AC_DEFUN(TEA_SERIAL_PORT, [ AC_CHECK_HEADERS(sys/modem.h) AC_MSG_CHECKING([termios vs. termio vs. sgtty]) AC_CACHE_VAL(tcl_cv_api_serial, [ AC_TRY_RUN([ #include int main() { struct termios t; if (tcgetattr(0, &t) == 0) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) fi if test $tcl_cv_api_serial = no ; then AC_TRY_RUN([ #include #include int main() { struct termios t; if (tcgetattr(0, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termios, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }], tcl_cv_api_serial=termio, tcl_cv_api_serial=no, tcl_cv_api_serial=no) fi if test $tcl_cv_api_serial = no; then AC_TRY_RUN([ #include #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }], tcl_cv_api_serial=sgtty, tcl_cv_api_serial=none, tcl_cv_api_serial=none) fi]) case $tcl_cv_api_serial in termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; esac AC_MSG_RESULT([$tcl_cv_api_serial]) ]) #-------------------------------------------------------------------- # TEA_MISSING_POSIX_HEADERS # # Supply substitutes for missing POSIX header files. Special # notes: # - stdlib.h doesn't define strtol, strtoul, or # strtod insome versions of SunOS # - some versions of string.h don't declare procedures such # as strstr # # Arguments: # none # # Results: # # Defines some of the following vars: # NO_DIRENT_H # NO_ERRNO_H # NO_VALUES_H # HAVE_LIMITS_H or NO_LIMITS_H # NO_STDLIB_H # NO_STRING_H # NO_SYS_WAIT_H # NO_DLFCN_H # HAVE_SYS_PARAM_H # # HAVE_STRING_H ? # # tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and # CHECK on limits.h #-------------------------------------------------------------------- AC_DEFUN(TEA_MISSING_POSIX_HEADERS, [ AC_MSG_CHECKING([dirent.h]) AC_CACHE_VAL(tcl_cv_dirent_h, AC_TRY_LINK([#include #include ], [ #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ], tcl_cv_dirent_h=yes, tcl_cv_dirent_h=no)) if test $tcl_cv_dirent_h = no; then AC_DEFINE(NO_DIRENT_H, 1, [Do we have ?]) fi AC_MSG_RESULT([$tcl_ok]) AC_CHECK_HEADER(errno.h, , [AC_DEFINE(NO_ERRNO_H, 1, [Do we have ?])]) AC_CHECK_HEADER(float.h, , [AC_DEFINE(NO_FLOAT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(values.h, , [AC_DEFINE(NO_VALUES_H, 1, [Do we have ?])]) AC_CHECK_HEADER(limits.h, [AC_DEFINE(HAVE_LIMITS_H, 1, [Do we have ?])], [AC_DEFINE(NO_LIMITS_H, 1, [Do we have ?])]) AC_CHECK_HEADER(stdlib.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strtol, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtoul, stdlib.h, , tcl_ok=0) AC_EGREP_HEADER(strtod, stdlib.h, , tcl_ok=0) if test $tcl_ok = 0; then AC_DEFINE(NO_STDLIB_H, 1, [Do we have ?]) fi AC_CHECK_HEADER(string.h, tcl_ok=1, tcl_ok=0) AC_EGREP_HEADER(strstr, string.h, , tcl_ok=0) AC_EGREP_HEADER(strerror, string.h, , tcl_ok=0) # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then AC_DEFINE(NO_STRING_H, 1, [Do we have ?]) fi AC_CHECK_HEADER(sys/wait.h, , [AC_DEFINE(NO_SYS_WAIT_H, 1, [Do we have ?])]) AC_CHECK_HEADER(dlfcn.h, , [AC_DEFINE(NO_DLFCN_H, 1, [Do we have ?])]) # OS/390 lacks sys/param.h (and doesn't need it, by chance). AC_HAVE_HEADERS(sys/param.h) ]) #-------------------------------------------------------------------- # TEA_PATH_X # # Locate the X11 header files and the X11 library archive. Try # the ac_path_x macro first, but if it doesn't find the X stuff # (e.g. because there's no xmkmf program) then check through # a list of possible directories. Under some conditions the # autoconf macro will return an include directory that contains # no include files, so double-check its result just to be safe. # # This should be called after TEA_CONFIG_CFLAGS as setting the # LIBS line can confuse some configure macro magic. # # Arguments: # none # # Results: # # Sets the following vars: # XINCLUDES # XLIBSW # LIBS (appends to) # TEA_WINDOWINGSYSTEM # #-------------------------------------------------------------------- AC_DEFUN(TEA_PATH_X, [ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then TEA_PATH_UNIX_X fi ]) AC_DEFUN(TEA_PATH_UNIX_X, [ AC_PATH_X not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then AC_TRY_CPP([#include ], , not_really_there="yes") else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then AC_MSG_CHECKING([for X11 header files]) XINCLUDES="# no special path needed" AC_TRY_CPP([#include ], , XINCLUDES="nope") if test "$XINCLUDES" = nope; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then AC_MSG_RESULT([$i]) XINCLUDES=" -I$i" break fi done fi else if test "$x_includes" != ""; then XINCLUDES=-I$x_includes else XINCLUDES="# no special path needed" fi fi if test "$XINCLUDES" = nope; then AC_MSG_RESULT([could not find any!]) XINCLUDES="# no include files found" fi if test "$no_x" = yes; then AC_MSG_CHECKING([for X11 libraries]) XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.dylib -o -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then AC_MSG_RESULT([$i]) XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) fi if test "$XLIBSW" = nope ; then AC_MSG_RESULT([could not find any! Using -lX11.]) XLIBSW=-lX11 fi if test x"${XLIBSW}" != x ; then PKG_LIBS="${PKG_LIBS} ${XLIBSW}" fi ]) #-------------------------------------------------------------------- # TEA_BLOCKING_STYLE # # The statements below check for systems where POSIX-style # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. # On these systems (mostly older ones), use the old BSD-style # FIONBIO approach instead. # # Arguments: # none # # Results: # # Defines some of the following vars: # HAVE_SYS_IOCTL_H # HAVE_SYS_FILIO_H # USE_FIONBIO # O_NONBLOCK # #-------------------------------------------------------------------- AC_DEFUN(TEA_BLOCKING_STYLE, [ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/filio.h) AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print $3}' /etc/.relid'` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi fi fi case $system in # There used to be code here to use FIONBIO under AIX. However, it # was reported that FIONBIO doesn't work under AIX 3.2.5. Since # using O_NONBLOCK seems fine under AIX 4.*, I removed the FIONBIO # code (JO, 5/31/97). OSF*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; SunOS-4*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; ULTRIX-4.*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; *) AC_MSG_RESULT([O_NONBLOCK]) ;; esac ]) #-------------------------------------------------------------------- # TEA_TIME_HANLDER # # Checks how the system deals with time.h, what time structures # are used on the system, and what fields the structures have. # # Arguments: # none # # Results: # # Defines some of the following vars: # USE_DELTA_FOR_TZ # HAVE_TM_GMTOFF # HAVE_TM_TZADJ # HAVE_TIMEZONE_VAR # #-------------------------------------------------------------------- AC_DEFUN(TEA_TIME_HANDLER, [ AC_CHECK_HEADERS(sys/time.h) AC_HEADER_TIME AC_STRUCT_TIMEZONE AC_CHECK_FUNCS(gmtime_r localtime_r) AC_MSG_CHECKING([tm_tzadj in struct tm]) AC_CACHE_VAL(tcl_cv_member_tm_tzadj, AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_tzadj;], tcl_cv_member_tm_tzadj=yes, tcl_cv_member_tm_tzadj=no)) AC_MSG_RESULT([$tcl_cv_member_tm_tzadj]) if test $tcl_cv_member_tm_tzadj = yes ; then AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) fi AC_MSG_CHECKING([tm_gmtoff in struct tm]) AC_CACHE_VAL(tcl_cv_member_tm_gmtoff, AC_TRY_COMPILE([#include ], [struct tm tm; tm.tm_gmtoff;], tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)) AC_MSG_RESULT([$tcl_cv_member_tm_gmtoff]) if test $tcl_cv_member_tm_gmtoff = yes ; then AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) fi # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # AC_MSG_CHECKING([long timezone variable]) AC_CACHE_VAL(tcl_cv_timezone_long, AC_TRY_COMPILE([#include ], [extern long timezone; timezone += 1; exit (0);], tcl_cv_timezone_long=yes, tcl_cv_timezone_long=no)) AC_MSG_RESULT([$tcl_cv_timezone_long]) if test $tcl_cv_timezone_long = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # AC_MSG_CHECKING([time_t timezone variable]) AC_CACHE_VAL(tcl_cv_timezone_time, AC_TRY_COMPILE([#include ], [extern time_t timezone; timezone += 1; exit (0);], tcl_cv_timezone_time=yes, tcl_cv_timezone_time=no)) AC_MSG_RESULT([$tcl_cv_timezone_time]) if test $tcl_cv_timezone_time = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) fi fi ]) #-------------------------------------------------------------------- # TEA_BUGGY_STRTOD # # Under Solaris 2.4, strtod returns the wrong value for the # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure # "fixstrtod" (provided by Tcl) that corrects the error. # Also, on Compaq's Tru64 Unix 5.0, # strtod(" ") returns 0.0 instead of a failure to convert. # # Arguments: # none # # Results: # # Might defines some of the following vars: # strtod (=fixstrtod) # #-------------------------------------------------------------------- AC_DEFUN(TEA_BUGGY_STRTOD, [ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) if test "$tcl_strtod" = 1; then AC_MSG_CHECKING([for Solaris2.4/Tru64 strtod bugs]) AC_CACHE_VAL(tcl_cv_strtod_buggy,[ AC_TRY_RUN([ extern double strtod(); int main() { char *string = "NaN", *spaceString = " "; char *term; double value; value = strtod(string, &term); if ((term != string) && (term[-1] == 0)) { exit(1); } value = strtod(spaceString, &term); if (term == (spaceString+1)) { exit(1); } exit(0); }], tcl_cv_strtod_buggy=1, tcl_cv_strtod_buggy=0, tcl_cv_strtod_buggy=0)]) if test "$tcl_cv_strtod_buggy" = 1; then AC_MSG_RESULT([ok]) else AC_MSG_RESULT([buggy]) #LIBOBJS="$LIBOBJS fixstrtod.o" AC_LIBOBJ([fixstrtod]) USE_COMPAT=1 AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) fi fi ]) #-------------------------------------------------------------------- # TEA_TCL_LINK_LIBS # # Search for the libraries needed to link the Tcl shell. # Things like the math library (-lm) and socket stuff (-lsocket vs. # -lnsl) are dealt with here. # # Arguments: # Requires the following vars to be set in the Makefile: # DL_LIBS # LIBS # MATH_LIBS # # Results: # # Subst's the following var: # TCL_LIBS # MATH_LIBS # # Might append to the following vars: # LIBS # # Might define the following vars: # HAVE_NET_ERRNO_H # #-------------------------------------------------------------------- AC_DEFUN(TEA_TCL_LINK_LIBS, [ #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"]) #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CHECK_HEADER(net/errno.h, [ AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])]) # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' AC_SUBST(TCL_LIBS) AC_SUBST(MATH_LIBS) ]) #-------------------------------------------------------------------- # TEA_TCL_EARLY_FLAGS # # Check for what flags are needed to be passed so the correct OS # features are available. # # Arguments: # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _LARGEFILE64_SOURCE # #-------------------------------------------------------------------- AC_DEFUN(TEA_TCL_EARLY_FLAG,[ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), AC_TRY_COMPILE([$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no, AC_TRY_COMPILE([[#define ]$1[ 1 ]$2], $3, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no))) if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then AC_DEFINE($1, 1, [Add the ]$1[ flag when building]) tcl_flags="$tcl_flags $1" fi ]) AC_DEFUN(TEA_TCL_EARLY_FLAGS,[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include ], [struct stat64 buf; int i = stat64("/", &buf);]) if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([${tcl_flags}]) fi ]) #-------------------------------------------------------------------- # TEA_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # TCL_WIDE_INT_TYPE # HAVE_STRUCT_DIRENT64 # HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # #-------------------------------------------------------------------- AC_DEFUN(TEA_TCL_64BIT_FLAGS, [ AC_MSG_CHECKING([for 64-bit integer type]) AC_CACHE_VAL(tcl_cv_type_64bit,[ tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 AC_TRY_COMPILE(,[__int64 value = (__int64) 0;], tcl_type_64bit=__int64, tcl_type_64bit="long long") # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... AC_TRY_COMPILE(,[switch (0) { case 1: case (sizeof(]${tcl_type_64bit}[)==sizeof(long)): ; }],tcl_cv_type_64bit=${tcl_type_64bit})]) if test "${tcl_cv_type_64bit}" = none ; then AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Are wide integers to be implemented with C 'long's?]) AC_MSG_RESULT([using long]) elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # We actually want to use the default tcl.h checks in this # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* AC_MSG_RESULT([using Tcl header defaults]) else AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, [What type should be used to define wide integers?]) AC_MSG_RESULT([${tcl_cv_type_64bit}]) # Now check for auxiliary declarations AC_MSG_CHECKING([for struct dirent64]) AC_CACHE_VAL(tcl_cv_struct_dirent64,[ AC_TRY_COMPILE([#include #include ],[struct dirent64 p;], tcl_cv_struct_dirent64=yes,tcl_cv_struct_dirent64=no)]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) fi AC_MSG_RESULT([${tcl_cv_struct_dirent64}]) AC_MSG_CHECKING([for struct stat64]) AC_CACHE_VAL(tcl_cv_struct_stat64,[ AC_TRY_COMPILE([#include ],[struct stat64 p; ], tcl_cv_struct_stat64=yes,tcl_cv_struct_stat64=no)]) if test "x${tcl_cv_struct_stat64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) fi AC_MSG_RESULT([${tcl_cv_struct_stat64}]) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_TRY_COMPILE([#include ],[off64_t offset; ], tcl_cv_type_off64_t=yes,tcl_cv_type_off64_t=no)]) if test "x${tcl_cv_type_off64_t}" = "xyes" ; then AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) fi AC_MSG_RESULT([${tcl_cv_type_off64_t}]) fi ]) ## ## Here ends the standard Tcl configuration bits and starts the ## TEA specific functions ## #------------------------------------------------------------------------ # TEA_INIT -- # # Init various Tcl Extension Architecture (TEA) variables. # This should be the first called TEA_* macro. # # Arguments: # none # # Results: # # Defines and substs the following vars: # CYGPATH # EXEEXT # Defines only: # TEA_INITED # TEA_PLATFORM (windows or unix) # # "cygpath" is used on windows to generate native path names for include # files. These variables should only be used with the compiler and linker # since they generate native path names. # # EXEEXT # Select the executable extension based on the host type. This # is a lightweight replacement for AC_EXEEXT that doesn't require # a compiler. #------------------------------------------------------------------------ AC_DEFUN(TEA_INIT, [ # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.4" AC_MSG_CHECKING([for correct TEA configuration]) if test x"${PACKAGE_NAME}" = x ; then AC_MSG_ERROR([ The PACKAGE_NAME variable must be defined by your TEA configure.in]) fi if test x"$1" = x ; then AC_MSG_ERROR([ TEA version not specified.]) elif test "$1" != "${TEA_VERSION}" ; then AC_MSG_RESULT([warning: requested TEA version "$1", have "${TEA_VERSION}"]) else AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) AC_CHECK_PROG(CYGPATH, cygpath, cygpath -w, echo) EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi AC_SUBST(EXEEXT) AC_SUBST(CYGPATH) # This package name must be replaced statically for AC_SUBST to work AC_SUBST(PKG_LIB_FILE) # Substitute STUB_LIB_FILE in case package creates a stub library too. AC_SUBST(PKG_STUB_LIB_FILE) # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... AC_SUBST(PKG_STUB_SOURCES) AC_SUBST(PKG_STUB_OBJECTS) AC_SUBST(PKG_TCL_SOURCES) AC_SUBST(PKG_HEADERS) AC_SUBST(PKG_INCLUDES) AC_SUBST(PKG_LIBS) AC_SUBST(PKG_CFLAGS) ]) #------------------------------------------------------------------------ # TEA_ADD_SOURCES -- # # Specify one or more source files. Users should check for # the right platform before adding to their list. # It is not important to specify the directory, as long as it is # in the generic, win or unix subdirectory of $(srcdir). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_SOURCES # PKG_OBJECTS #------------------------------------------------------------------------ AC_DEFUN(TEA_ADD_SOURCES, [ vars="$@" for i in $vars; do case $i in [\$]*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then AC_MSG_ERROR([could not find source file '$i']) fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done AC_SUBST(PKG_SOURCES) AC_SUBST(PKG_OBJECTS) ]) #------------------------------------------------------------------------ # TEA_ADD_STUB_SOURCES -- # # Specify one or more source files. Users should check for # the right platform before adding to their list. # It is not important to specify the directory, as long as it is # in the generic, win or unix subdirectory of $(srcdir). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_STUB_SOURCES # PKG_STUB_OBJECTS #------------------------------------------------------------------------ AC_DEFUN(TEA_ADD_STUB_SOURCES, [ vars="$@" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then AC_MSG_ERROR([could not find stub source file '$i']) fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done AC_SUBST(PKG_STUB_SOURCES) AC_SUBST(PKG_STUB_OBJECTS) ]) #------------------------------------------------------------------------ # TEA_ADD_TCL_SOURCES -- # # Specify one or more Tcl source files. These should be platform # independent runtime files. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_TCL_SOURCES #------------------------------------------------------------------------ AC_DEFUN(TEA_ADD_TCL_SOURCES, [ vars="$@" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done AC_SUBST(PKG_TCL_SOURCES) ]) #------------------------------------------------------------------------ # TEA_ADD_HEADERS -- # # Specify one or more source headers. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_HEADERS #------------------------------------------------------------------------ AC_DEFUN(TEA_ADD_HEADERS, [ vars="$@" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then AC_MSG_ERROR([could not find header file '${srcdir}/$i']) fi PKG_HEADERS="$PKG_HEADERS $i" done AC_SUBST(PKG_HEADERS) ]) #------------------------------------------------------------------------ # TEA_ADD_INCLUDES -- # # Specify one or more include dirs. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_INCLUDES #------------------------------------------------------------------------ AC_DEFUN(TEA_ADD_INCLUDES, [ vars="$@" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done AC_SUBST(PKG_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_ADD_LIBS -- # # Specify one or more libraries. Users should check for # the right platform before adding to their list. For Windows, # libraries provided in "foo.lib" format will be converted to # "-lfoo" when using GCC (mingw). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_LIBS #------------------------------------------------------------------------ AC_DEFUN(TEA_ADD_LIBS, [ vars="$@" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.lib[$]/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done AC_SUBST(PKG_LIBS) ]) #------------------------------------------------------------------------ # TEA_ADD_CFLAGS -- # # Specify one or more CFLAGS. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_CFLAGS #------------------------------------------------------------------------ AC_DEFUN(TEA_ADD_CFLAGS, [ PKG_CFLAGS="$PKG_CFLAGS $@" AC_SUBST(PKG_CFLAGS) ]) #------------------------------------------------------------------------ # TEA_PREFIX -- # # Handle the --prefix=... option by defaulting to what Tcl gave # # Arguments: # none # # Results: # # If --prefix or --exec-prefix was not specified, $prefix and # $exec_prefix will be set to the values given to Tcl when it was # configured. #------------------------------------------------------------------------ AC_DEFUN(TEA_PREFIX, [ if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) prefix=${TCL_PREFIX} else AC_MSG_NOTICE([--prefix defaulting to /usr/local]) prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then #if test x"${TCL_EXEC_PREFIX}" != x; then #AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) #exec_prefix=${TCL_EXEC_PREFIX} #else AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) exec_prefix=$prefix #fi fi ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER_CC -- # # Do compiler checks the way we want. This is just a replacement # for AC_PROG_CC in TEA configure.in files to make them cleaner. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN(TEA_SETUP_COMPILER_CC, [ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi AC_PROG_CC if test $ac_cv_prog_gcc = yes; then GCC=yes fi AC_PROG_CPP AC_PROG_CXX AC_PROG_INSTALL #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- AC_PROG_MAKE_SET #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- AC_PROG_RANLIB #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- AC_OBJEXT AC_EXEEXT ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER -- # # Do compiler checks that use the compiler. This must go after # TEA_SETUP_COMPILER_CC, which does the actual compiler check. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN(TEA_SETUP_COMPILER, [ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. AC_REQUIRE([TEA_SETUP_COMPILER_CC]) #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then AC_MSG_CHECKING([if the compiler understands -pipe]) OLDCC="$CC" CC="$CC -pipe" AC_TRY_COMPILE(,, AC_MSG_RESULT([yes]), CC="$OLDCC" AC_MSG_RESULT([no])) fi #-------------------------------------------------------------------- # Pick up flags from the environment (user). #-------------------------------------------------------------------- CC="${CC} $CFLAGS" CXX="${CXX} $CXXFLAGS $CFLAGS" #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- AC_C_BIGENDIAN if test "${TEA_PLATFORM}" = "unix" ; then TEA_TCL_LINK_LIBS TEA_MISSING_POSIX_HEADERS # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi ]) #------------------------------------------------------------------------ # TEA_MAKE_LIB -- # # Generate a line that can be used to build a shared/unshared library # in a platform independent manner. # # Arguments: # none # # Requires: # # Results: # # Defines the following vars: # CFLAGS - Done late here to note disturb other AC macros # MAKE_LIB - Command to execute to build the Tcl library; # differs depending on whether or not Tcl is being # compiled as a shared library. # MAKE_SHARED_LIB Makefile rule for building a shared library # MAKE_STATIC_LIB Makefile rule for building a static library # MAKE_STUB_LIB Makefile rule for building a stub library #------------------------------------------------------------------------ AC_DEFUN(TEA_MAKE_LIB, [ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \[$]@ \$(PKG_OBJECTS) \${LDFLAGS_DEFAULT} \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_SHARED_LIB) AC_SUBST(MAKE_STATIC_LIB) AC_SUBST(MAKE_STUB_LIB) AC_SUBST(RANLIB_STUB) ]) #------------------------------------------------------------------------ # TEA_LIB_SPEC -- # # Compute the name of an existing object library located in libdir # from the given base name and produce the appropriate linker flags. # # Arguments: # basename The base name of the library without version # numbers, extensions, or "lib" prefixes. # extra_dir Extra directory in which to search for the # library. This location is used first, then # $prefix/$exec-prefix, then some defaults. # # Requires: # TEA_INIT and TEA_PREFIX must be called first. # # Results: # # Defines the following vars: # ${basename}_LIB_NAME The computed library name. # ${basename}_LIB_SPEC The computed linker flags. #------------------------------------------------------------------------ AC_DEFUN(TEA_LIB_SPEC, [ AC_MSG_CHECKING([for $1 library]) # Look in exec-prefix for the library (defined by TEA_PREFIX). tea_lib_name_dir="${exec_prefix}/lib" # Or in a user-specified location. if test x"$2" != x ; then tea_extra_lib_dir=$2 else tea_extra_lib_dir=NONE fi for i in \ `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do if test -f "$i" ; then tea_lib_name_dir=`dirname $i` $1_LIB_NAME=`basename $i` $1_LIB_PATH_NAME=$i break fi done if test "${TEA_PLATFORM}" = "windows"; then $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" else # Strip off the leading "lib" and trailing ".a" or ".so" tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" fi if test "x${$1_LIB_NAME}" = x ; then AC_MSG_ERROR([not found]) else AC_MSG_RESULT([${$1_LIB_SPEC}]) fi ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TCL_HEADERS -- # # Locate the private Tcl include files # # Arguments: # # Requires: # TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has # already been called. # # Results: # # Substs the following vars: # TCL_TOP_DIR_NATIVE # TCL_GENERIC_DIR_NATIVE # TCL_UNIX_DIR_NATIVE # TCL_WIN_DIR_NATIVE # TCL_BMAP_DIR_NATIVE # TCL_TOOL_DIR_NATIVE # TCL_PLATFORM_DIR_NATIVE # TCL_BIN_DIR_NATIVE # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN(TEA_PRIVATE_TCL_HEADERS, [ AC_MSG_CHECKING([for Tcl private include files]) TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" TCL_UNIX_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" TCL_WIN_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" TCL_BMAP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/bitmaps\" TCL_TOOL_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/tools\" TCL_COMPAT_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/compat\" if test "${TEA_PLATFORM}" = "windows"; then TCL_PLATFORM_DIR_NATIVE=${TCL_WIN_DIR_NATIVE} else TCL_PLATFORM_DIR_NATIVE=${TCL_UNIX_DIR_NATIVE} fi # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -d "${TCL_BIN_DIR}/Headers" -a -d "${TCL_BIN_DIR}/PrivateHeaders"; then TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}"; else TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"; fi ;; esac fi AC_SUBST(TCL_TOP_DIR_NATIVE) AC_SUBST(TCL_GENERIC_DIR_NATIVE) AC_SUBST(TCL_UNIX_DIR_NATIVE) AC_SUBST(TCL_WIN_DIR_NATIVE) AC_SUBST(TCL_BMAP_DIR_NATIVE) AC_SUBST(TCL_TOOL_DIR_NATIVE) AC_SUBST(TCL_PLATFORM_DIR_NATIVE) AC_SUBST(TCL_INCLUDES) AC_MSG_RESULT([Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TCL_HEADERS -- # # Locate the installed public Tcl header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tclinclude switch to configure. # Result is cached. # # Substs the following vars: # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN(TEA_PUBLIC_TCL_HEADERS, [ AC_MSG_CHECKING([for Tcl public headers]) AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tclh, [ # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) fi else # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; *) list="" ;; esac # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "$TCL_BIN_DIR/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) else AC_MSG_RESULT([${ac_cv_c_tclh}]) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TCL_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TK_HEADERS -- # # Locate the private Tk include files # # Arguments: # # Requires: # TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has # already been called. # # Results: # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN(TEA_PRIVATE_TK_HEADERS, [ AC_MSG_CHECKING([for Tk private include files]) TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" TK_UNIX_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" TK_WIN_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" if test "${TEA_PLATFORM}" = "windows"; then TK_PLATFORM_DIR_NATIVE=${TK_WIN_DIR_NATIVE} else TK_PLATFORM_DIR_NATIVE=${TK_UNIX_DIR_NATIVE} fi # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I${TK_XLIB_DIR_NATIVE}" fi if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I${TK_SRC_DIR_NATIVE}/macosx" fi if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TK_DEFS} in *TK_FRAMEWORK*) if test -d "${TK_BIN_DIR}/Headers" -a -d "${TK_BIN_DIR}/PrivateHeaders"; then TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}"; fi ;; esac fi AC_SUBST(TK_TOP_DIR_NATIVE) AC_SUBST(TK_UNIX_DIR_NATIVE) AC_SUBST(TK_WIN_DIR_NATIVE) AC_SUBST(TK_GENERIC_DIR_NATIVE) AC_SUBST(TK_XLIB_DIR_NATIVE) AC_SUBST(TK_PLATFORM_DIR_NATIVE) AC_SUBST(TK_INCLUDES) AC_MSG_RESULT([Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TK_HEADERS -- # # Locate the installed public Tk header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tkinclude switch to configure. # Result is cached. # # Substs the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN(TEA_PUBLIC_TK_HEADERS, [ AC_MSG_CHECKING([for Tk public headers]) AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files.], with_tkinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tkh, [ # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) fi else # If Tk was built as a framework, attempt to use # the framework's Headers directory. case ${TK_DEFS} in *TK_FRAMEWORK*) list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" ;; *) list="" ;; esac # Look in the source dir only if Tk is not installed, # and in that situation, look there before installed locations. if test -f "$TK_BIN_DIR/Makefile" ; then list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tk's --prefix location, # relative to directory of tkConfig.sh, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) else AC_MSG_RESULT([${ac_cv_c_tkh}]) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_INCLUDES) if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then # On Windows and Aqua, we need the X compat headers AC_MSG_CHECKING([for X11 header files]) if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_XINCLUDES) fi AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) fi ]) #------------------------------------------------------------------------ # TEA_PROG_TCLSH # Determine the fully qualified path name of the tclsh executable # in the Tcl build directory or the tclsh installed in a bin # directory. This macro will correctly determine the name # of the tclsh executable even if tclsh has not yet been # built in the build directory. The tclsh found is always # associated with a tclConfig.sh file. This tclsh should be used # only for running extension test cases. It should never be # or generation of files (like pkgIndex.tcl) at build time. # # Arguments # none # # Results # Subst's the following values: # TCLSH_PROG #------------------------------------------------------------------------ AC_DEFUN(TEA_PROG_TCLSH, [ AC_MSG_CHECKING([for tclsh]) if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_PREFIX}/bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}" fi AC_MSG_RESULT(${TCLSH_PROG}) AC_SUBST(TCLSH_PROG) ]) #------------------------------------------------------------------------ # TEA_PROG_WISH # Determine the fully qualified path name of the wish executable # in the Tk build directory or the wish installed in a bin # directory. This macro will correctly determine the name # of the wish executable even if wish has not yet been # built in the build directory. The wish found is always # associated with a tkConfig.sh file. This wish should be used # only for running extension test cases. It should never be # or generation of files (like pkgIndex.tcl) at build time. # # Arguments # none # # Results # Subst's the following values: # WISH_PROG #------------------------------------------------------------------------ AC_DEFUN(TEA_PROG_WISH, [ AC_MSG_CHECKING([for wish]) if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="${TK_BIN_DIR}/wish" fi else # tkConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" fi list="`ls -d ${TK_PREFIX}/bin 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../bin 2>/dev/null`" for i in $list ; do if test -f "$i/${WISH_PROG}" ; then REAL_TK_BIN_DIR="`cd "$i"; pwd`" break fi done WISH_PROG="${REAL_TK_BIN_DIR}/${WISH_PROG}" fi AC_MSG_RESULT(${WISH_PROG}) AC_SUBST(WISH_PROG) ]) #------------------------------------------------------------------------ # TEA_PATH_CONFIG -- # # Locate the ${1}Config.sh file and perform a sanity check on # the ${1} compile flags. These are used by packages like # [incr Tk] that load *Config.sh files from more than Tcl and Tk. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-$1=... # # Defines the following vars: # $1_BIN_DIR Full path to the directory containing # the $1Config.sh file #------------------------------------------------------------------------ AC_DEFUN(TEA_PATH_CONFIG, [ # # Ok, lets find the $1 configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-$1 # if test x"${no_$1}" = x ; then # we reset no_$1 in case something fails here no_$1=true AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) AC_MSG_CHECKING([for $1 configuration]) AC_CACHE_VAL(ac_cv_c_$1config,[ # First check to see if --with-$1 was specified. if test x"${with_$1config}" != x ; then case ${with_$1config} in */$1Config.sh ) if test -f ${with_$1config}; then AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` fi;; esac if test -f "${with_$1config}/$1Config.sh" ; then ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` else AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) fi fi # then check for a private $1 installation if test x"${ac_cv_c_$1config}" = x ; then for i in \ ../$1 \ `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ../../$1 \ `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ../../../$1 \ `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ${srcdir}/../$1 \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi if test -f "$i/unix/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_$1config}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_$1config}" = x ; then $1_BIN_DIR="# no $1 configs found" AC_MSG_WARN("Cannot find $1 configuration definitions") exit 0 else no_$1= $1_BIN_DIR=${ac_cv_c_$1config} AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_CONFIG -- # # Load the $1Config.sh file # # Arguments: # # Requires the following vars to be set: # $1_BIN_DIR # # Results: # # Subst the following vars: # $1_SRC_DIR # $1_LIB_FILE # $1_LIB_SPEC # #------------------------------------------------------------------------ AC_DEFUN(TEA_LOAD_CONFIG, [ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) if test -f "${$1_BIN_DIR}/$1Config.sh" ; then AC_MSG_RESULT([loading]) . ${$1_BIN_DIR}/$1Config.sh else AC_MSG_RESULT([file not found]) fi # # If the $1_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable $1_LIB_SPEC will be set to the value # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC # instead of $1_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f ${$1_BIN_DIR}/Makefile ; then AC_MSG_WARN([Found Makefile - using build library specs for $1]) $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} fi AC_SUBST($1_VERSION) AC_SUBST($1_BIN_DIR) AC_SUBST($1_SRC_DIR) AC_SUBST($1_LIB_FILE) AC_SUBST($1_LIB_SPEC) AC_SUBST($1_STUB_LIB_FILE) AC_SUBST($1_STUB_LIB_SPEC) AC_SUBST($1_STUB_LIB_PATH) ]) #------------------------------------------------------------------------ # TEA_PATH_CELIB -- # # Locate Keuchel's celib emulation layer for targeting Win/CE # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-celib=... # # Defines the following vars: # CELIB_DIR Full path to the directory containing # the include and platform lib files #------------------------------------------------------------------------ AC_DEFUN(TEA_PATH_CELIB, [ # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true AC_ARG_WITH(celib,[ --with-celib=DIR use Windows/CE support library from DIR], with_celibconfig=${withval}) AC_MSG_CHECKING([for Windows/CE celib directory]) AC_CACHE_VAL(ac_cv_c_celibconfig,[ # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else AC_MSG_ERROR([${with_celibconfig} directory doesn't contain inc directory]) fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[[0-9]]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[[0-9]]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_celibconfig}" = x ; then AC_MSG_ERROR([Cannot find celib support library directory]) else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` AC_MSG_RESULT([found $CELIB_DIR]) fi fi ]) skycat-3.1.2-starlink-1b/tcltags000077500000000000000000000065121215713201500165300ustar00rootroot00000000000000#!/usr/local/itcl/bin/tclsh7.4 # @(#) tcltags.tcl 1.1 21 Sep 1994 (C) SNI AG; MR STO SI 134, MR OI 2 # # Make Emacs-style TAGS file for Tcl source. # Tom Tromey Mon Feb 15 1993 # $Id: tcltags,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # tcltags is not part of GNU Emacs, but is distributed under the same # terms (IE the GNU Public License). tcltags is really only useful # with GNU Emacs anyway. # GNU Emacs is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY. No author or distributor # accepts responsibility to anyone for the consequences of using it # or for whether it serves any particular purpose or works at all, # unless he says so in writing. Refer to the GNU Emacs General Public # License for full details. # Everyone is granted permission to copy, modify and redistribute # GNU Emacs, but only under the conditions described in the # GNU Emacs General Public License. A copy of this license is # supposed to have been given to you along with GNU Emacs so you # can know your rights and responsibilities. It should be in a # file named COPYING. Among other things, the copyright notice # and this notice must be preserved on all copies. # KNOWN BUGS: # * Should support updating existing tags files, ctags format, etc. # * Should integrate with etags program somehow. # Configuration stuff: set verbose 1 # # "rexp" is an array of regular expressions. Each must have exactly one # parenthesized subexpression, which should match the tag exactly. # The array indices are unimportant. The regexp as a whole should # match the line containing the tag, up to the tag but not past it. # # Bogus quoting gyrations because Tcl regexps interpret \t as # "t" and not TAB. set rexp(proc) "^proc\[\ \t\]+(\[^\ \t\]+)" set rexp(method) "^\[\ \t\]+method\[\ \t\]+(\[^\ \t\]+)" set rexp(itcl_class) "^itcl_class\[\ \t\]+(\[^\ \t\]+)" set rexp(class) "^class\[\ \t\]+(\[^\ \t\]+)" # Next two are for local Tcl procs, for example purposes only. # I can't give out defvar and defoption, sorry. # set rexp(defvar) "^defvar\[\ \t\]+(\[^\ \t\]+)" # set rexp(defoption) "^defoption\[\ \t\]+(\[^\ \t\]+)" # # Figure out tags for one file. # proc tagify_file {file TAGS} { global rexp verbose if $verbose then { puts stderr "Doing $file..." nonewline } set f [open $file r] set where 0 set lineNo 0 while {[gets $f line] >= 0} { foreach try [array names rexp] { if [regexp $rexp($try) $line match tag] then { if [info exists fileTags($tag)] then { puts stderr "\n\tDuplicate tag $tag, ignoring" } else { set fileTags($tag) $match append fileTags($tag) \177 append fileTags($tag) $lineNo,$where append fileTags($tag) \n } break } } incr where [string length $line] incr lineNo } close $f # Now sort list by tag, and create entry, but only if a tag was # found. set entry {} if [string length [info locals fileTags]] then { foreach tag [lsort [array names fileTags]] { append entry $fileTags($tag) } } # Write file part and then entry to TAGS file. puts $TAGS \014 puts $TAGS $file,[string length $entry] puts $TAGS $entry nonewline if $verbose then { puts stderr done } } # Open output file set TAGS [open TAGS w] # Munge every file listed on the command line. foreach file $argv { tagify_file $file $TAGS } close $TAGS skycat-3.1.2-starlink-1b/tclutil/000077500000000000000000000000001215713201500166155ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/tclutil/CHANGES000066400000000000000000000376771215713201500176340ustar00rootroot00000000000000CHANGES to Tclutil ----------------- This file contains a list of changes to the Tclutil software. The latest changes are at the top. --------------- 20/10/08 released tclutil-2.1.0 ------------------- * Added support for data types double and long long int. * Added support for tiled-image compressed files. --------------- 03.02.06 released tclutil-2.0 ------------------- * Major update: see top level CHANGES file. --------------- 04.04.05 released tclutil-1.2.8 ----------------- * workaround bug in tcl 8.4.3 (SourceForge Request ID 835020) * Updated configure.in for APR2004 (tcl8.4, itcl3.3) * Generally 'using namespace std' instead of specifying ::std * Made the menu toolbar a bit smaller (it's planned to add an icon toolbar underneath the menu toolbar. --------------- 20.01.03 released tclutil-1.2.5 ----------------- * Ported to gcc-3.2.1 and Tcl-8.4.1 --------------- 27.08.01 released tclutil-1.2.4 ----------------- * Merged in minor changes from Peter Biereichel (added some #include files). --------------- 18.05.01 released tclutil-1.2.3 ----------------- * Ported to tcl8.3.3 (still compatible with earlier versions). --------------- 09.11.00 released tclutil-1.2.3 ----------------- * Fixed a bug that occurred when attempting to memory map a file that was a relative path to a relative symbolic link. (For example: Mem("../x.fits"), where x.fits is a link to y.fits). The util/Mem class previously tried to resolve symbolic links, but didn't get it right in this one case. The new version does not try to resolve the links (commented out the call to fileRealname()). --------------- 02.03.00 released tclutil-1.2.2 ----------------- * Added an optional argument to TopLevelWidget::start to specify the valid options for an application. This was as a workaround to what may be a bug in Tcl or Itcl that caused the application to crash when an unknown argument was given. --------------- 14.12.99 released tclutil-1.2.1 ------------------ * Merged in changes made by Peter Biereichel (see below): * Mem.C: use _exit() in the signal handler to avoid that the message queue of a possible parent process (see Batch.tcl) is closed. * Mem.C: attach to shm with SHM_RDONLY when owner=0 --------------- 25.10.99 released tclutil-1.2 -------------------- * Merged in changes made by Peter Biereichel --------------- 09.09.99 released tclutil-1.1.5 ------------------------ * Updated for egcs/gcc-2.95 (This compiler version is stricter for C++ code and even fails the solaris X11 header files, unless told to ignore the errors...). Added check in configure.in for solaris and gcc-2.95*, to include the -fpermissive flag with g++. --------------- 21.06.99 released tclutil-1.1.4 ------------------------ * FileSelect.tcl: changed listbox bindings from <1> to to avoid conflict with default bindings. --------------- 01.04.99 released tclutil-1.1.3 ------------------------ * Replaced sys_errlist[] with strerror() in error.C to get around porting problems. * changed tclsh$vers to itclsh$vers in tix/src/Makefile.in, since tclsh was often not found. * Added workaround in configure.in to tcl8.0.5 configure script bug dealing with HP-UX machines and the TCL_SHLIB_LD variable defined in tclConfig.sh (was set wrong for HP). --------------- 22.03.99 released tclutil-1.1.2 ------------------------ * Replaced itclsh2.2 with itclsh@ITCL_VERSION@ in Makefile.in. * EntryForm.tcl: added scrollbars to make it easier to view many entries. * Changed "quit" method in TopLevelWidget to use "delete object $this" instead of "destroy $w_". * Removed lib -lieee from configure.in, since it caused problems with shared libraries later on in the gaia plugin. * error.C: removed "#include errno.h" to avoid problems with new linux versions. * configure.in: removed -lieee library from configure script, since it caused linking problems on glibc linux versions. * updated local copies of tcl headers for the local tix package for tcl8.0.5. * Merged in changes from Peter W. Draper (Starlink) to support 16 and 24 bit color. * Added routine Tk_CanvasWindowCoordsNoClip() in tkCanvasImagePs.c to work around Tk's limit on canvas coordinates to short range. Now the canvas coordinates do not have to be clipped to short range. * bltGraph.tcl: Added patch for blt2.4g from Peter Draper. --------------- 28.12.98 released tclutil-1.1.1 ------------------------ * Minor change in udialog.tcl to avoid multiple error message problems. * Added an optional argument to Mem::remap() to allow increasing the size of an mmapped file. * Fixed mistaken "//" comments in Blt_GraphElement.c. * Rebuild tclIndex file whenever configure is run, since Tcl8 version is not compatible with tcl7 version (see makelinks script). * tkCanvasPsImage.c: changed "unsigned int" to "int" to avoid sunpro cc warning. --------------- 16.11.98 released tclutil-1.1 ------------------------ * Ported to tcl8.0.3 (still compatible with tcl7.6): - Changed the syntax used for the namespace and scope commands in tcl8. - Itcl member procs in the "util" namespace now need to be called with "util::" prefix. For example: "util::TopLevelWidget::start ..." - Updated the BLT related code to work with both BLT2.1 and 2.4f. - Updated the configure scripts to handle Tcl8.0 and Tcl7.6. --------------- 30.8.98 released tclutil-1.0.17 ----------------------- * Added a "wait" command in Batch.tcl to reap background processes and avoid zombies. --------------- 5.8.98 released tclutil-1.0.16 ----------------------- * Added authorization support to class HTTP. The class now recognizes the "Authorization Required" message returned from an HTTP server and provides a method "authorize(username, passwd)" for clients to set user and password information. The information is optionally saved in a file (by default: ~/.http_auth), indexed by server host name and realm and with the username and password encoded. * Added new public methods to class HTTP: content_encoding(), www_auth_realm(), authorizationRequired(), authorize(), authFile(), userAgent(), and changed html_error() from a "static" to nonstatic member. * Added new Itcl dialog class: PasswdDialog, and new proc that uses it: passwd_dialog. * Added the X11 library directory to shared lib path in startup script * Changed DialogWidget itcl class to use a label in place of a message and truncate lines from long messages. * Fixed minor bug in TopLevelWidget that prevented the code from remembering the locations of top level widgets. Now, if you place a window somewhere, it comes up there the next time the window is created in that session. --------------- 07.07.98 released tclutil-1.0.15 ----------------------- * class HTTP: added suport for HTTP POST: new methods: HTTP::post(url, data) and HTTP::post(url, data, ostream). --------------- 26.6.98 released tclutil-1.0.14 ----------------------- * Added support for HTTP proxy servers (thanks to Peter Draper for implementing this). The proxy server, if available, is defined by the "http_proxy" environment variable. This should have the format: http_proxy = "http://wwwcache.some.domain:port/" A list of domains that do not require to be proxied (i.e. local machines etc.) is defined by the variable "http_noproxy". This should be a list of comma separated names, i.e.: http_noproxy = "local.domain,national.domain" If the given host is in one of these domains no proxy will be set up. * Mem.C: added checks for file permissions to avoid problems with mmap and read-only files (or files with no read permission). --------------- 19.6.98 released tclutil-1.0.13 ----------------------- * HTTP.C: fixed a minor bug that cut off last char of an HTTP error message * Added new file: tclutil/src/tkCanvasPsImage.c, which implements Tk canvas postscript printing for images. The default Tk canvas postscript command does not support printing images and the available patch could not handle large, zoomed in images. This version does not require a patch to Tk. The extension is based on the patch, with fixes provided by Peter Draper of Starlink, and is activated optionally by calling the C routine TkCanvasPsImage_Init(). --------------- 28.5.98 released tclutil-1.0.12 ----------------------- * Added support for HTTP redirect "Location: ..." to HTTP class * HTTP.C: check for HTTP header info in URL command output. If a URL is a command (not "file:/..." or "http:/...") its output may have an optional HTTP type header containing lines such as "Content-type: ...", "Content-length: ...", etc. (at most 5 lines). If these lines are found, they are noted and skipped over before accessing the data. * Minor bug fix in TclCommand.C, for case when interp->result is appended to itself. --------------- 13.5.98 released tclutil-1.0.11 ----------------------- - * FileSelect.tcl: added missing method (set_filter_type) * EntryForm.tcl: destroy window on "Enter" as well as "Cancel" (previously, "Cancel" destroyed the window, but "Enter" only closed it). --------------- 4.5.98 released tclutil-1.0.10 ------------------------- * CanvasDraw.tcl: Changed protection on "create_done" to public --------------- 28.4.98 released tclutil-1.0.9 ------------------------- * Minor addition to TopLevelWidget error handling (in start_err_, allow --help option to print "usage" message). --------------- 15.4.98 released tclutil-1.0.8 ------------------------- * itcldoc.tcl (automatic man page generation from Itcl classes) - Added code to extract information from Itcl classes about the Itk components and component options. - Added code to document "public" and "protected" methods and variables. * (doc, *.tcl): For documenting the "public interface": Updated comments on all Itk component declarations and added "public", "private" and "protected" keywords in the source to help identify the public interface, which is documented in man pages generated from the source by the itcldoc utility in this package. * Minor changes in configure script and top level makefile for shared libraries * Fixed a last minute problem with calling plugin procs (needed to use "uplevel #0" due to Itcl scoping/namespace hell...). ----------------- 31.03.98 released tclutil-1.0.7 ---------------------- * Updated man pages and documentation ----------------- 25.03.98 released tclutil-1.0.6 ---------------------- * Minor change in class ShellCommand (kill child process on error). * added "more_error" method to TclCommand, to append an error message. * TkImage constructor: changed options arg from reference to pointer for consistency with usage. * TopLevelWidget.tcl: Added support for a simple help window to TopLevelWidget, and added two new widgets: HelpWin and ScrolledText (contributed by Peter Draper, Starlink). * CanvasDraw.tcl: * Make use of "init" method in CanvasDraw constructor (easier for subclassing). * Added -clipping option to control clipping of graphics (default is the same as before). * TopLevelWidget.tcl: Added "-underline" option to add_menubutton, to allow proper keyboard traversal. * Tix library: commented out global bindings (grep for "bind all" in tix/library dir), since they interfere with Tk keyboard traversal in menus, etc. * TopLevelWidget: fixed bug in method "list_windows" so that it lists all top level windows (previously not all windows were listed). * TopLevelWidget: added "-number" option to keep track of cloned windows. This is a number that can be put in the window title to identify which main window a popup window belongs to. By default the number is set automatically set from the widget path name by looking for a name, such as "....", for example: .app1, .app2, ... * LabelEntryScale.tcl: added fixes from Peter Fraper, Starlink, to support vertical and horizontal layout and keybindings and improve performance. ----------------- 05.03.98 released tclutil-1.0.5 ------------------------- * fixed minor problems setting and restoring the mouse cursor * (CanvasDraw). * For backward compatibility with existing applications: The Tclutil package now contains the sources for the Tix widget set. Tix support can be included in an application by calling Tixsam_Init(interp) and linking -ltclutil (or the necessary object files from this package). This has no effect on packages that do not use Tix. * Implemented rotation for canvas graphics. Since Tk doesn't support this directly, it is done now in Tcl code. Polygons are now used in place of rectangles, to make it posible to rotate a rectangle. (The appearance and funtionality is the same). You still can't rotate ovals, but you can rotate a smooth rectangle, which is similar (see below). * Added a "Smooth" option in the graphics window (CanvasDraw), so you can make smooth (rounded) rectangles, polygons or polylines. * Changed the selection mechanism, so that the graphics window always displays the options for the currently selected object. * Plugins: The _PLUGIN environment variable may now contain a colon separated list of plugin files or directories containing plugin files. This way you can have multiple plugins for a class. For a top level class Foo, for example, the environment variable FOO_PLUGIN may contain a colon separated list of plugin files or directories containing plugin files. The default file name, if only a directory name is given, is then Foo_plugin.tcl, which defines the Tcl proc Foo_plugin. ----------------- 13.2.98 released tclutil-1.0.4 ------------------------- * Added 2 methods to TopLevelWidget: list_windows and hide_windows to add support for toggling the visibility of all popup windows other than the main one. ----------------- 9.2.98 released tclutil-1.0.3 ------------------------- * Added "const" to "cmdname" arg in constructor for TclCommandand TkImage classes. * Added (void*) cast to MAP_FAILED constant in class Mem_Map * Fixed minor bugs in bltGraph.tcl (used for zooming in a graph) * added check for "gethostname" prototype to configure script. ----------------- 3.2.98 released tclutil-1.0.2 ------------------------- * In class CanvasDraw, added support for selecting a region of objects, and moving a group of objects. Added region icon to drawing mode frame. * Added methods "append_result", "append_element", "reset_result" in class TclCommand. --------------- 26.01.98 released tclutil-1.0.1 ------------------------- * Added plugin support to the TopLevelWidget class, so all classes derived from it can have Tcl plugins (see docs). * Added a script tclutil/demos/itcldoc that extracts man pages from Itcl class sources automatically, with no special syntax needed in the comments. The script simply assumes that comments precede declarations. Since Itcl sources have a simple Tcl list format, it is fairly easy to parse them. The only requirement is that each class, method and other important declarations are preceded by a "block" comment (a group of lines starting with "#"). To run the script, cd to the dir containing the tcl source files (here tclutil/library) and type: "make doc". * Updated comments in Itcl sources for automatic generation of man pages. * Renamed some source files to have the same name as the class (TList.tcl ==> TableList.tcl, Dialog.tcl ==> DialogWidget.tcl, ...) --------------- released tclutil-1.0 ------------------------------------ * Created new package Tclutil by gathering "generic" Tcl and C++ code from various applications into a single generic Tcl package. The Tclutil package contains a collection of handy Itcl and C++ utility classes and also provides a shell script (TclutilConfig.sh), created by configure, that makes it easier to write configure scripts for other packages. This package assumes the development environment includes C++, Itcl, TclX, BLT and optionally other packages that can be linked in statically or dynamically as needed. ----------- Nov 21, 1997: begin change log for Tclutil ----------------- skycat-3.1.2-starlink-1b/tclutil/Makefile.in000077500000000000000000000371531215713201500206760ustar00rootroot00000000000000# Makefile.in -- # # This file is a Makefile for Sample TEA Extension. If it has the name # "Makefile.in" then it is a template for a Makefile; to generate the # actual Makefile, run "./configure", which is a configuration script # generated by the "autoconf" program (constructs like "@foo@" will get # replaced in the actual Makefile). # # Copyright (c) 1999 Scriptics Corporation. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # RCS: @(#) $Id: Makefile.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ #======================================================================== # Add additional lines to handle any additional AC_SUBST cases that # have been added in a customized configure script. #======================================================================== #SAMPLE_NEW_VAR = @SAMPLE_NEW_VAR@ TEST_APPS = tMem tHTTP #tShellCommand TEST_LIBS = @tclutil_LIB_SPEC@ @TCL_LIB_SPEC@ @TK_LIB_SPEC@ #======================================================================== # Nothing of the variables below this line should need to be changed. # Please check the TARGETS section below to make sure the make targets # are correct. #======================================================================== #======================================================================== # The names of the source files is defined in the configure script. # The object files are used for linking into the final library. # This will be used when a dist target is added to the Makefile. # It is not important to specify the directory, as long as it is the # $(srcdir) or in the generic, win or unix subdirectory. #======================================================================== PKG_SOURCES = @PKG_SOURCES@ PKG_OBJECTS = @PKG_OBJECTS@ PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ #======================================================================== # PKG_TCL_SOURCES identifies Tcl runtime files that are associated with # this package that need to be installed, if any. #======================================================================== PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ #======================================================================== # This is a list of public header files to be installed, if any. #======================================================================== PKG_HEADERS = @PKG_HEADERS@ #======================================================================== # "PKG_LIB_FILE" refers to the library (dynamic or static as per # configuration options) composed of the named objects. #======================================================================== PKG_LIB_FILE = @PKG_LIB_FILE@ PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ #PKG_BIN_FILE = tclutil.sh bin_BINARIES = $(PKG_BIN_FILE) lib_BINARIES = $(PKG_LIB_FILE) BINARIES = $(lib_BINARIES) $(bin_BINARIES) SHELL = @SHELL@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ libdir = @libdir@ datadir = @datadir@ mandir = @mandir@ includedir = @includedir@ DESTDIR = PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION) pkgdatadir = $(datadir)/$(PKG_DIR) pkglibdir = $(libdir)/$(PKG_DIR) pkgincludedir = $(includedir)/$(PACKAGE_NAME) top_builddir = . INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ CC = @CC@ CXX = @CXX@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ #CFLAGS_WARNING = @CFLAGS_WARNING@ CLEANFILES = @CLEANFILES@ $(TEST_APPS) *.result *.tmp *.o EXEEXT = @EXEEXT@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ MAKE_LIB = @MAKE_LIB@ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ OBJEXT = @OBJEXT@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @PKG_LIBS@ @SHLIB_LD_LIBS@ @SHLIB_LD_CXX_LIBS@ STLIB_LD = @STLIB_LD@ #TCL_DEFS = @TCL_DEFS@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_SRC_DIR = @TCL_SRC_DIR@ #TK_BIN_DIR = @TK_BIN_DIR@ #TK_SRC_DIR = @TK_SRC_DIR@ # Not used, but retained for reference of what libs Tcl required #TCL_LIBS = @TCL_LIBS@ #======================================================================== # TCLLIBPATH seeds the auto_path in Tcl's init.tcl so we can test our # package without installing. The other environment variables allow us # to test against an uninstalled Tcl. Add special env vars that you # require for testing here (like TCLX_LIBRARY). #======================================================================== EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR) #EXTRA_PATH = $(top_builddir):$(TCL_BIN_DIR):$(TK_BIN_DIR) TCLLIBPATH = $(top_builddir) TCLSH_ENV = TCL_LIBRARY=`@CYGPATH@ $(TCL_SRC_DIR)/library` \ @LD_LIBRARY_PATH_VAR@="$(EXTRA_PATH):$(@LD_LIBRARY_PATH_VAR@)" \ PATH="$(EXTRA_PATH):$(PATH)" \ TCLLIBPATH="$(TCLLIBPATH)" # TK_LIBRARY=`@CYGPATH@ $(TK_SRC_DIR)/library` TCLSH_PROG = @TCLSH_PROG@ TCLSH = $(TCLSH_ENV) $(TCLSH_PROG) WISH_PROG = @WISH_PROG@ WISH = $(TCLSH_ENV) $(WISH_PROG) SHARED_BUILD = @SHARED_BUILD@ #INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ INCLUDES = @PKG_INCLUDES@ @TCL_INCLUDES@ @TK_INCLUDES@ @TK_XINCLUDES@ PKG_CFLAGS = @PKG_CFLAGS@ # TCL_DEFS is not strictly need here, but if you remove it, then you # must make sure that configure.in checks for the necessary components # that your library may use. TCL_DEFS can actually be a problem if # you do not compile with a similar machine setup as the Tcl core was # compiled with. #DEFS = $(TCL_DEFS) @DEFS@ $(PKG_CFLAGS) DEFS = @DEFS@ $(PKG_CFLAGS) CONFIG_CLEAN_FILES = Makefile pkgIndex.tcl ${PACKAGE_NAME}Config.sh ${PACKAGE_NAME}.sh ${PACKAGE_NAME}_version.tcl CPPFLAGS = @CPPFLAGS@ LIBS = @PKG_LIBS@ @LIBS@ AR = @AR@ CFLAGS = @CFLAGS@ CXXFLAGS = @CXXFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) $(CXXFLAGS) #======================================================================== # Start of user-definable TARGETS section #======================================================================== #======================================================================== # TEA TARGETS. Please note that the "libraries:" target refers to platform # independent files, and the "binaries:" target inclues executable programs and # platform-dependent libraries. Modify these targets so that they install # the various pieces of your package. The make and install rules # for the BINARIES that you specified above have already been done. #======================================================================== all: binaries libraries doc tclIndex #======================================================================== # The binaries target builds executable programs, Windows .dll's, unix # shared/static libraries, and any other platform-dependent files. # The list of targets to build for "binaries:" is specified at the top # of the Makefile, in the "BINARIES" variable. #======================================================================== binaries: $(BINARIES) libraries: tclIndex: (cd $(srcdir)/library; $(TCLSH_PROG) mkIndex.tcl) #======================================================================== # Your doc target should differentiate from doc builds (by the developer) # and doc installs (see install-doc), which just install the docs on the # end user machine when building from source. #======================================================================== doc: # generate man pages for itcl classes gendoc: (cd $(srcdir)/library; $(TCLSH_PROG) itcldoc.tcl [A-Z]*.tcl) # remove generated man pages cleandoc: rm -f $(srcdir)/man/[A-Z]*.mann install: all install-binaries install-libraries install-doc install-binaries: binaries install-lib-binaries install-bin-binaries #======================================================================== # This rule installs platform-independent files, such as header files. # The list=...; for p in $$list handles the empty list case x-platform. #======================================================================== install-libraries: libraries @test -d $(DESTDIR)$(pkgincludedir) || mkdir -p $(DESTDIR)$(pkgincludedir) @echo "Installing header files in $(DESTDIR)$(pkgincludedir)" @list='$(PKG_HEADERS)'; for i in $$list; do \ echo "Installing $(srcdir)/$$i" ; \ $(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(pkgincludedir) ; \ done; #======================================================================== # Install documentation. Unix manpages should go in the $(mandir) # directory. #======================================================================== install-doc: #install-doc: doc # @mkdir -p $(DESTDIR)$(mandir)/mann # @echo "Installing documentation in $(DESTDIR)$(mandir)" # @list='$(srcdir)/doc/*.n'; for i in $$list; do \ # echo "Installing $$i"; \ # rm -f $(DESTDIR)$(mandir)/mann/`basename $$i`; \ # $(INSTALL_DATA) $$i $(DESTDIR)$(mandir)/mann ; \ # done shell: binaries libraries @$(TCLSH) $(SCRIPT) gdb: $(TCLSH_ENV) gdb $(TCLSH_PROG) $(SCRIPT) depend: #======================================================================== # $(PKG_LIB_FILE) should be listed as part of the BINARIES variable # mentioned above. That will ensure that this target is built when you # run "make binaries". # # The $(PKG_OBJECTS) objects are created and linked into the final # library. In most cases these object files will correspond to the # source files above. #======================================================================== $(PKG_LIB_FILE): $(PKG_OBJECTS) -rm -f $(PKG_LIB_FILE) ${MAKE_LIB} $(RANLIB) $(PKG_LIB_FILE) #$(PKG_STUB_LIB_FILE): $(PKG_STUB_OBJECTS) # -rm -f $(PKG_STUB_LIB_FILE) # ${MAKE_STUB_LIB} # $(RANLIB_STUB) $(PKG_STUB_LIB_FILE) #======================================================================== # We need to enumerate the list of .c to .o lines here. # # In the following lines, $(srcdir) refers to the toplevel directory # containing your extension. If your sources are in a subdirectory, # you will have to modify the paths to reflect this: # # sample.$(OBJEXT): $(srcdir)/generic/sample.c # $(COMPILE) -c `@CYGPATH@ $(srcdir)/generic/sample.c` -o $@ # # Setting the VPATH variable to a list of paths will cause the makefile # to look into these paths when resolving .c to .obj dependencies. # As necessary, add $(srcdir):$(srcdir)/compat:.... #======================================================================== VPATH = $(srcdir):$(srcdir)/generic .c.@OBJEXT@: $(COMPILE) -c `@CYGPATH@ $<` -o $@ .C.@OBJEXT@: $(CXXCOMPILE) -c `@CYGPATH@ $<` -o $@ #======================================================================== # End of user-definable section #======================================================================== #======================================================================== # Don't modify the file to clean here. Instead, set the "CLEANFILES" # variable in configure.in #======================================================================== clean: -test -z "$(BINARIES)" || rm -f $(BINARIES) -rm -f *.$(OBJEXT) core *.core -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean: clean -rm -f *.tab.c -rm -f $(CONFIG_CLEAN_FILES) -rm -rf config.cache config.log config.status autom4te.cache #======================================================================== # Install binary object libraries. On Windows this includes both .dll and # .lib files. Because the .lib files are not explicitly listed anywhere, # we need to deduce their existence from the .dll file of the same name. # Library files go into the lib directory. # In addition, this will generate the pkgIndex.tcl # file in the install location (assuming it can find a usable tclsh shell) # # You should not have to modify this target. #======================================================================== install-lib-binaries: binaries @test -d $(DESTDIR)$(pkglibdir) || mkdir -p $(DESTDIR)$(pkglibdir) @list='$(lib_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libdir)/$$p; \ stub=`echo $$p|sed -e "s/.*\(stub\).*/\1/"`; \ if test "x$$stub" = "xstub"; then \ echo " $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p"; \ $(RANLIB_STUB) $(DESTDIR)$(libdir)/$$p; \ else \ echo " $(RANLIB) $(DESTDIR)$(libdir)/$$p"; \ $(RANLIB) $(DESTDIR)$(libdir)/$$p; \ fi; \ ext=`echo $$p|sed -e "s/.*\.//"`; \ if test "x$$ext" = "xdll"; then \ lib=`basename $$p|sed -e 's/.[^.]*$$//'`.lib; \ if test -f $$lib; then \ echo " $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib"; \ $(INSTALL_DATA) $$lib $(DESTDIR)$(libdir)/$$lib; \ fi; \ fi; \ fi; \ done @echo " Install $(PACKAGE_NAME)Config.sh $(DESTDIR)$(libdir)" @$(INSTALL_DATA) $(PACKAGE_NAME)Config.sh $(DESTDIR)$(libdir); @list='$(PKG_TCL_SOURCES) library/tclIndex $(PACKAGE_NAME)_version.tcl'; \ for p in $$list; do \ if test -f $(srcdir)/$$p; then \ destp=`basename $$p`; \ echo " Install $$destp $(DESTDIR)$(pkglibdir)/$$destp"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkglibdir)/$$destp; \ fi; \ done @if test "x$(SHARED_BUILD)" = "x1"; then \ echo " Install pkgIndex.tcl $(DESTDIR)$(pkglibdir)"; \ $(INSTALL_DATA) pkgIndex.tcl $(DESTDIR)$(pkglibdir); \ fi # (cd $(DESTDIR)$(pkglibdir); $(TCLSH_PROG) mkIndex.tcl) #======================================================================== # Install binary executables (e.g. .exe files and dependent .dll files) # This is for files that must go in the bin directory (located next to # wish and tclsh), like dependent .dll files on Windows. # # You should not have to modify this target, except to define bin_BINARIES # above if necessary. #======================================================================== install-bin-binaries: binaries @test -d $(DESTDIR)$(bindir) || mkdir -p $(DESTDIR)$(bindir) @list='$(bin_BINARIES)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/$$p; \ fi; \ done .SUFFIXES: .c .$(OBJEXT) .C Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status uninstall-binaries: list='$(lib_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(PKG_TCL_SOURCES)'; for p in $$list; do \ p=`basename $$p`; \ rm -f $(DESTDIR)$(pkglibdir)/$$p; \ done list='$(bin_BINARIES)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/$$p; \ done .PHONY: all binaries clean depend distclean doc install libraries test # Tell versions (3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: #======================================================================== # Run C++ Test cases #======================================================================== test: binaries libraries $(TEST_APPS) $(TEST_APPS): FORCE $(CXXCOMPILE) -o $@ $(srcdir)/tests/$@.C $(TEST_LIBS) -@@LD_LIBRARY_PATH_VAR@=@exec_prefix@/lib; export @LD_LIBRARY_PATH_VAR@ ;\ $@ > $@.result 2>&1 ;\ if cmp $@.result $(srcdir)/tests/$@.ok ;\ then echo "$@: PASSED" ; \ else echo "*** $@: TEST FAILED: see $@.result" ; \ fi #======================================================================== # Run Tcl test cases #======================================================================== tcltest: binaries libraries (cd $(srcdir)/tests; sh all.tcl) FORCE: skycat-3.1.2-starlink-1b/tclutil/README000066400000000000000000000026521215713201500175020ustar00rootroot00000000000000 Tclutil, Generic Tcl/Tk and C++ Utilities and Classes ----------------------------------------------------- The Tclutil package was created by gathering generic Tcl, Itcl and C++ code from various applications into a single, general purpose, utility package, that can be loaded dynamically into a running Tcl application or linked in at compile time as a general purpose library. The package contains a collection of useful Itcl and C++ utility classes. It also provides a shell script (TclutilConfig.sh), which is created by the configure script and makes it easier to write configure scripts for other packages by providing configuration information, such as the locations and names of all the Tcl extensions and libraries. The development environment here includes C++, Itcl, TclX, BLT, Tkimg, and optionally other packages that can be linked in dynamically as needed. You can use this package by including the following line in a Tcl script: package require Tclutil For installation instructions, see the file INSTALL in the parent directory. See the CHANGES file in this directory for a list of recent changes. The following URLs may also be of interest: Skycat home page: http://archive.eso.org/skycat/ Sources and binaries: ftp://ftp.eso.org/pub/archive/skycat/README.html Postscript, PDF, and FrameMaker Documentation: ftp://ftp.eso.org/pub/archive/skycat/doc HTML Docs: http://archive.eso.org/skycat/docs/skycat-man.html skycat-3.1.2-starlink-1b/tclutil/VERSION000066400000000000000000000000161215713201500176620ustar00rootroot00000000000000tclutil-2.1.0 skycat-3.1.2-starlink-1b/tclutil/aclocal.m4000066400000000000000000000130401215713201500204530ustar00rootroot00000000000000builtin(include,../tclconfig/tcl.m4) AC_DEFUN(TCLUTIL_CONFIG, [ #------------------------------------------------------------------------ # TCLUTIL_PATH_BLT -- # # Locate the BLT library # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-blt=... # # Defines the following vars: # BLT_LIB_SPEC String to add to link the BLT lib (-L... -lBLT) # BLT_LIB_DIR Directory containing libBLT24.so #------------------------------------------------------------------------ AC_DEFUN(TCLUTIL_PATH_BLT, [ AC_MSG_CHECKING(for BLT library) AC_ARG_WITH(blt, [AC_HELP_STRING([--with-blt=DIR],[link with BLT library installed in DIR])], BLT_LIB_DIR=$withval) BLT_LIBNAME=libBLT25${SHLIB_SUFFIX} BLT_LIBFLAG="-lBLT25" if test -z "$BLT_LIB_DIR" ; then # If --with-blt=dir was not specified, try the Tcl lib dir and the exec-prefix/lib dir places="\ $TCL_BIN_DIR \ $TCL_BIN_DIR/blt2.4 \ $TCLTK_ROOT/lib \ $TCLTK_ROOT/lib/blt2.4 \ $exec_prefix/lib \ $exec_prefix/lib/blt2.4 \ $prefix/lib \ $prefix/lib/blt2.4 \ " for i in $places ; do if test -f $i/$BLT_LIBNAME then BLT_LIB_DIR=$i break fi done if test -z "$BLT_LIB_DIR" ; then echo AC_MSG_ERROR([could not find $BLT_LIBNAME: Please use the --with-blt=DIR option.]) fi else # Check if the BLT library is in the lib subdir of the given dir if test ! -f $BLT_LIB_DIR/$BLT_LIBNAME then if test ! -f $BLT_LIB_DIR/lib/$BLT_LIBNAME then echo AC_MSG_ERROR([could not find $BLT_LIBNAME in $BLT_LIB_DIR or in $BLT_LIB_DIR/lib: Please use the --with-blt=DIR option.]) else BLT_LIB_DIR=$BLT_LIB_DIR/lib fi fi fi BLT_LIB_SPEC="-L$BLT_LIB_DIR $BLT_LIBFLAG" AC_MSG_RESULT($BLT_LIB_DIR) AC_SUBST(BLT_LIB_DIR) AC_SUBST(BLT_LIB_SPEC) ]) # ----------------------------------------------------------------------- AC_DEFINE(USE_COMPAT_CONST, 1, [For compatibility between tcl8.4 and previous tcl releases]) # ----------------------------------------------------------------------- AC_MSG_CHECKING([sysv shared memory prototypes]) AC_EGREP_HEADER([int.*shmdt.*\(], [sys/shm.h], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); AC_DEFINE(NEED_SHM_PROTO, 1, [Check if we need (or can use) shared memory (sysv/shm) prototypes])]) # ----------------------------------------------------------------------- AC_MSG_CHECKING([gethostname prototype]) AC_EGREP_HEADER([int.*gethostname.*\(], [unistd.h], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); AC_DEFINE(NEED_GETHOSTNAME_PROTO, 1, [Check if we need a prototype for gethostname()])]) # ----------------------------------------------------------------------- AC_CHECK_SIZEOF(long, 4) # ------------------------------------------------------------------------- # there are some idiosyncrasies with semun defs (used in semxxx). Solaris # does not define it at all # ------------------------------------------------------------------------- AC_MSG_CHECKING("do we have union semun defined") AC_TRY_COMPILE( [#include #include #include #include ], [ union semun filler; ], [ AC_DEFINE(HAVE_UNION_SEMUN) AC_MSG_RESULT("yes") ], AC_MSG_RESULT("no") ) AC_DEFINE(HAVE_NET_SERVICES) # ----------------------------------------------------------------------- AC_MSG_CHECKING([mmap prototypes]) AC_EGREP_HEADER([int.*munmap.*\(], [sys/mman.h], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); AC_DEFINE(NEED_MMAP_PROTO, 1, [Check if we need (or can use) mmap prototypes])]) # ----------------------------------------------------------------------- AC_CHECK_HEADERS(sys/filio.h) AC_CHECK_HEADERS(sys/statvfs.h) # ----------------------------------------------------------------------- # Check if we need (or can use) the socklen_t type. # ----------------------------------------------------------------------- AC_CHECK_TYPES([socklen_t],,,[#include ]) #------------------------------------------------------------------------ #AC_LANG(C++) AC_MSG_CHECKING([fd_set]) AC_TRY_COMPILE([ #include #include ], [fd_set readFds; select(32, &readFds, 0, 0, 0);], test_ok=yes, test_ok=no) if test $test_ok = yes; then AC_DEFINE(HAVE_SELECT_FD_SET, 1, [See if the select system call uses fd_set arguments]) fi AC_MSG_RESULT($test_ok) #------------------------------------------------------------------------ # Check if we require additional libraries to support C++ shareable # libraries. system=`uname -s`-`uname -r` SHLIB_LD_CXX_LIBS="" export SHLIB_LD_CXX_LIBS case $system in SunOS-5*) SHLIB_LD_CXX_LIBS="-lCrun -lCstd" ;; OSF*) SHLIB_LD_CXX_LIBS="-lcxx -lcxxstd" ;; esac AC_SUBST(SHLIB_LD_CXX_LIBS) #------------------------------------------------------------------------- # The cxx C++ compiler under Tru64 UNIX needs the special # CXXFLAGS "-std gnu -D__USE_STD_IOSTREAM=1". These allow the standard # library streams headers to work and to generate templates that do # not require special handling throughout skycat directories (normally # template object files are created in various cxx_repository subdirectories, # this way the object files are kept embedded the usual object files, see # the cxx man page for details). #------------------------------------------------------------------------- export CXXFLAGS case $system in OSF*) case "x$CXX" in xcxx*) CXXFLAGS="$CXXFLAGS -g3 -std gnu -D__USE_STD_IOSTREAM=1" ;; esac ;; esac ]) # End of macro skycat-3.1.2-starlink-1b/tclutil/bitmaps/000077500000000000000000000000001215713201500202545ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/tclutil/bitmaps/README000066400000000000000000000002211215713201500211270ustar00rootroot00000000000000Be sure to re-run make if you add or modify a bitmap in this directory. This will create ../src/bitmaps.c which defines the bitmaps in C code. skycat-3.1.2-starlink-1b/tclutil/bitmaps/abc.xbm000066400000000000000000000004201215713201500215050ustar00rootroot00000000000000#define abc_width 16 #define abc_height 16 static char abc_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x49, 0x30, 0xc8, 0x49, 0x4e, 0x0a, 0x49, 0x4a, 0xde, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/anyselect.xbm000066400000000000000000000004421215713201500227530ustar00rootroot00000000000000#define anyselect_width 16 #define anyselect_height 16 static char anyselect_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x01, 0x63, 0x03, 0x14, 0x07, 0x08, 0x0f, 0x08, 0x1f, 0x08, 0x3f, 0x08, 0x7f, 0x08, 0xff, 0x08, 0x1b, 0x08, 0x31, 0x08, 0x30, 0x08, 0x60, 0x14, 0x60, 0x63, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/ar10_13_3.xbm000066400000000000000000000004421215713201500222540ustar00rootroot00000000000000#define ar10_13_3_width 16 #define ar10_13_3_height 16 static char ar10_13_3_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x07, 0xe0, 0x03, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xe0, 0x03, 0x00, 0x07, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/ar12_11_3.xbm000066400000000000000000000004421215713201500222540ustar00rootroot00000000000000#define ar12_11_3_width 16 #define ar12_11_3_height 16 static char ar12_11_3_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x07, 0xf0, 0x0f, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xf0, 0x0f, 0x80, 0x07, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/ar12_12_3.xbm000066400000000000000000000004421215713201500222550ustar00rootroot00000000000000#define ar12_12_3_width 16 #define ar12_12_3_height 16 static char ar12_12_3_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0f, 0xe0, 0x0f, 0xfc, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xe0, 0x0f, 0x00, 0x0f, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/ar6_6_4.xbm000066400000000000000000000004341215713201500221250ustar00rootroot00000000000000#define ar6_6_4_width 16 #define ar6_6_4_height 16 static char ar6_6_4_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x30, 0x00, 0x38, 0x00, 0x3c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x3c, 0x00, 0x38, 0x00, 0x30, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/ar8_10_3.xbm000066400000000000000000000004371215713201500222040ustar00rootroot00000000000000#define ar8_10_3_width 16 #define ar8_10_3_height 16 static char ar8_10_3_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x18, 0x00, 0x1c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x1c, 0x00, 0x18, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/ar8_12_9.xbm000066400000000000000000000004371215713201500222140ustar00rootroot00000000000000#define ar8_12_9_width 16 #define ar8_12_9_height 16 static char ar8_12_9_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x20, 0x00, 0x30, 0x00, 0x18, 0x00, 0x1c, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0x1c, 0x00, 0x18, 0x00, 0x30, 0x00, 0x20, 0x00, 0x40, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/ar8_8_6.xbm000066400000000000000000000004341215713201500221330ustar00rootroot00000000000000#define ar8_8_6_width 16 #define ar8_8_6_height 16 static char ar8_8_6_bits[] = { 0x80, 0x00, 0xc0, 0x00, 0xe0, 0x00, 0xf0, 0x00, 0xf8, 0x00, 0xfc, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xfc, 0x00, 0xf8, 0x00, 0xf0, 0x00, 0xe0, 0x00, 0xc0, 0x00, 0x80, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/arc.xbm000066400000000000000000000004201215713201500215250ustar00rootroot00000000000000#define arc_width 16 #define arc_height 16 static char arc_bits[] = { 0x1f, 0x00, 0xe1, 0x00, 0x01, 0x03, 0x01, 0x04, 0x01, 0x08, 0x01, 0x10, 0x01, 0x20, 0x01, 0x20, 0x01, 0x40, 0x01, 0x40, 0x01, 0x40, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xff, 0xff}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/arrowboth.xbm000066400000000000000000000011021215713201500227650ustar00rootroot00000000000000#define arrowboth_width 43 #define arrowboth_height 13 static char arrowboth_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x02, 0x40, 0x00, 0x03, 0x00, 0x00, 0x06, 0x60, 0x80, 0x03, 0x00, 0x00, 0x0e, 0x70, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0x80, 0x03, 0x00, 0x00, 0x0e, 0x70, 0x00, 0x03, 0x00, 0x00, 0x06, 0x60, 0x00, 0x02, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/arrowfirst.xbm000066400000000000000000000011051215713201500231630ustar00rootroot00000000000000#define arrowfirst_width 43 #define arrowfirst_height 13 static char arrowfirst_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40, 0x00, 0x03, 0x00, 0x00, 0x00, 0x60, 0x80, 0x03, 0x00, 0x00, 0x00, 0x70, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0x80, 0x03, 0x00, 0x00, 0x00, 0x70, 0x00, 0x03, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/arrowlast.xbm000066400000000000000000000011021215713201500227740ustar00rootroot00000000000000#define arrowlast_width 43 #define arrowlast_height 13 static char arrowlast_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x70, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x70, 0x00, 0x00, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/arrownone.xbm000066400000000000000000000011021215713201500227700ustar00rootroot00000000000000#define arrownone_width 43 #define arrownone_height 13 static char arrownone_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/b1.xbm000066400000000000000000000004151215713201500212660ustar00rootroot00000000000000#define b1_width 16 #define b1_height 16 static char b1_bits[] = { 0xf8, 0x1f, 0xfc, 0x3f, 0xcc, 0x36, 0xcc, 0x36, 0xcc, 0x36, 0xcc, 0x36, 0xcc, 0x36, 0xcc, 0x36, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x23, 0xfc, 0x3f, 0xf8, 0x1f}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/b2.xbm000066400000000000000000000004151215713201500212670ustar00rootroot00000000000000#define b2_width 16 #define b2_height 16 static char b2_bits[] = { 0xf8, 0x1f, 0xfc, 0x3f, 0x6c, 0x36, 0x6c, 0x36, 0x6c, 0x36, 0x6c, 0x36, 0x6c, 0x36, 0x6c, 0x36, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x23, 0xfc, 0x3f, 0xf8, 0x1f}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/b3.xbm000066400000000000000000000004151215713201500212700ustar00rootroot00000000000000#define b3_width 16 #define b3_height 16 static char b3_bits[] = { 0xf8, 0x1f, 0xfc, 0x3f, 0x6c, 0x33, 0x6c, 0x33, 0x6c, 0x33, 0x6c, 0x33, 0x6c, 0x33, 0x6c, 0x33, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x23, 0xfc, 0x3f, 0xf8, 0x1f}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/bitmaps.tcl000066400000000000000000000016501215713201500224210ustar00rootroot00000000000000#!../bin/rtdimage_wish # # E.S.O. - VLT project # # "@(#) $Id: bitmaps.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # script to generate C code declaring X bitmaps so that the (binary) application # doesn't have to be delivered with the bitmap files. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 21 Nov 95 Created puts { /* * E.S.O. - VLT project * "@(#) $Id: bitmaps.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Bitmap definitions for Tk * * This file was generated by ../bitmaps/bitmaps.tcl - DO NO EDIT */ #include #include } puts "void defineTclutilBitmaps(Tcl_Interp *interp) {" foreach file [glob *.xbm] { set name [file rootname $file] puts " #include \"$file\"" puts " Tk_DefineBitmap(interp, Tk_GetUid(\"$name\"), (char*)${name}_bits, ${name}_width, ${name}_height);\n" } puts "}" exit 0 skycat-3.1.2-starlink-1b/tclutil/bitmaps/circle.xbm000066400000000000000000000004311215713201500222230ustar00rootroot00000000000000#define circle_width 16 #define circle_height 16 static char circle_bits[] = { 0xe0, 0x07, 0x18, 0x18, 0x04, 0x20, 0x02, 0x40, 0x02, 0x40, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x02, 0x40, 0x02, 0x40, 0x04, 0x20, 0x18, 0x18, 0xe0, 0x07}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/decr.xbm000066400000000000000000000001431215713201500216770ustar00rootroot00000000000000#define decr_width 7 #define decr_height 4 static char decr_bits[] = { 0x7f, 0x3e, 0x1c, 0x08}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/dir.xbm000066400000000000000000000003541215713201500215440ustar00rootroot00000000000000#define dir_width 16 #define dir_height 13 static char dir_bits[] = { 0x00, 0x7e, 0x00, 0x81, 0xff, 0xff, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xff, 0xff}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/down.xbm000066400000000000000000000004231215713201500217320ustar00rootroot00000000000000#define down_width 16 #define down_height 16 static char down_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xf8, 0x1f, 0xf8, 0x1f, 0xf0, 0x0f, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/down_arrow.xbm000066400000000000000000000004451215713201500231500ustar00rootroot00000000000000#define down_arrow_width 16 #define down_arrow_height 16 static char down_arrow_bits[] = { 0x00, 0x00, 0x00, 0x00, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xf8, 0x1f, 0xf8, 0x1f, 0xf0, 0x0f, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/dragb1.xbm000066400000000000000000000007421215713201500221270ustar00rootroot00000000000000#define dragb1_width 28 #define dragb1_height 16 static char dragb1_bits[] = { 0x00, 0x80, 0xff, 0x01, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0x6c, 0x03, 0x00, 0xc0, 0x6c, 0x03, 0x00, 0xc0, 0x6c, 0x03, 0x00, 0xc0, 0x6c, 0x03, 0x40, 0xc0, 0x6c, 0x03, 0xc0, 0xc8, 0x6c, 0x03, 0xfe, 0xdd, 0xff, 0x03, 0xc0, 0xc8, 0xff, 0x03, 0x40, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0x3f, 0x02, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x80, 0xff, 0x01}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/dragb2.xbm000066400000000000000000000007421215713201500221300ustar00rootroot00000000000000#define dragb2_width 28 #define dragb2_height 16 static char dragb2_bits[] = { 0x00, 0x80, 0xff, 0x01, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0x66, 0x03, 0x00, 0xc0, 0x66, 0x03, 0x00, 0xc0, 0x66, 0x03, 0x00, 0xc0, 0x66, 0x03, 0x40, 0xc0, 0x66, 0x03, 0xc0, 0xc8, 0x66, 0x03, 0xfe, 0xdd, 0xff, 0x03, 0xc0, 0xc8, 0xff, 0x03, 0x40, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0x3f, 0x02, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x80, 0xff, 0x01}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/dragb3.xbm000066400000000000000000000007421215713201500221310ustar00rootroot00000000000000#define dragb3_width 28 #define dragb3_height 16 static char dragb3_bits[] = { 0x00, 0x80, 0xff, 0x01, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0x36, 0x03, 0x00, 0xc0, 0x36, 0x03, 0x00, 0xc0, 0x36, 0x03, 0x00, 0xc0, 0x36, 0x03, 0x40, 0xc0, 0x36, 0x03, 0xc0, 0xc8, 0x36, 0x03, 0xfe, 0xdd, 0xff, 0x03, 0xc0, 0xc8, 0xff, 0x03, 0x40, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0xff, 0x03, 0x00, 0xc0, 0x3f, 0x02, 0x00, 0xc0, 0xff, 0x03, 0x00, 0x80, 0xff, 0x01}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/file.xbm000066400000000000000000000004231215713201500217020ustar00rootroot00000000000000#define file_width 16 #define file_height 16 static char file_bits[] = { 0xfe, 0x07, 0x02, 0x0c, 0x02, 0x14, 0x02, 0x24, 0x1a, 0x7c, 0x02, 0x40, 0xfa, 0x43, 0x02, 0x40, 0xfa, 0x47, 0x02, 0x40, 0xfa, 0x4f, 0x02, 0x40, 0xfa, 0x43, 0x02, 0x40, 0x02, 0x40, 0xfe, 0x7f}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/files.xbm000066400000000000000000000004261215713201500220700ustar00rootroot00000000000000#define files_width 16 #define files_height 16 static char files_bits[] = { 0x80, 0x1f, 0x80, 0x20, 0xe0, 0x40, 0xa0, 0x40, 0xb8, 0x40, 0xa8, 0x40, 0xae, 0x40, 0xaa, 0x40, 0xaa, 0x7f, 0x2a, 0x10, 0xea, 0x1f, 0x0a, 0x04, 0xfa, 0x07, 0x02, 0x01, 0xfe, 0x01, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/flipx.xbm000066400000000000000000000004261215713201500221100ustar00rootroot00000000000000#define flipx_width 16 #define flipx_height 16 static char flipx_bits[] = { 0x00, 0x08, 0x00, 0x18, 0xfc, 0x3f, 0xfc, 0x7f, 0xfc, 0x3f, 0x00, 0x18, 0x00, 0x08, 0x80, 0x01, 0x80, 0x01, 0x10, 0x00, 0x18, 0x00, 0xfc, 0x3f, 0xfe, 0x3f, 0xfc, 0x3f, 0x18, 0x00, 0x10, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/flipy.xbm000066400000000000000000000004261215713201500221110ustar00rootroot00000000000000#define flipy_width 16 #define flipy_height 16 static char flipy_bits[] = { 0x00, 0x00, 0x08, 0x00, 0x1c, 0x38, 0x3e, 0x38, 0x7f, 0x38, 0x1c, 0x38, 0x1c, 0x38, 0x9c, 0x39, 0x9c, 0x39, 0x1c, 0x38, 0x1c, 0x38, 0x1c, 0xfe, 0x1c, 0x7c, 0x1c, 0x38, 0x00, 0x10, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/freehand.xbm000066400000000000000000000004371215713201500225440ustar00rootroot00000000000000#define freehand_width 16 #define freehand_height 16 static char freehand_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x20, 0x01, 0x10, 0x02, 0x10, 0x02, 0x10, 0x02, 0x11, 0x02, 0x22, 0x41, 0xcc, 0x20, 0xb0, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/incr.xbm000066400000000000000000000001431215713201500217150ustar00rootroot00000000000000#define incr_width 7 #define incr_height 4 static char incr_bits[] = { 0x08, 0x1c, 0x3e, 0x7f}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/information.xbm000066400000000000000000000004501215713201500233100ustar00rootroot00000000000000#define information_width 16 #define information_height 16 static char information_bits[] = { 0xff, 0xff, 0xff, 0xff, 0x03, 0xc0, 0x83, 0xc1, 0x83, 0xc1, 0x03, 0xc0, 0xc3, 0xc1, 0x83, 0xc1, 0x83, 0xc1, 0x83, 0xc1, 0x83, 0xc1, 0xc3, 0xc3, 0x03, 0xc0, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/label.xbm000066400000000000000000000004261215713201500220450ustar00rootroot00000000000000#define label_width 16 #define label_height 16 static char label_bits[] = { 0xff, 0xff, 0x01, 0x80, 0x01, 0x80, 0x81, 0x80, 0x81, 0x80, 0x41, 0x81, 0x41, 0x81, 0x21, 0x82, 0x21, 0x82, 0xe1, 0x83, 0x11, 0x84, 0x11, 0x84, 0x39, 0x8e, 0x01, 0x80, 0x01, 0x80, 0xff, 0xff}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/left.xbm000066400000000000000000000001651215713201500217200ustar00rootroot00000000000000#define left_width 4 #define left_height 7 static char left_bits[] = { 0x08, 0x0c, 0x0e, 0x0f, 0x0e, 0x0c, 0x08}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/left_arrow.xbm000066400000000000000000000004451215713201500231330ustar00rootroot00000000000000#define left_arrow_width 16 #define left_arrow_height 16 static char left_arrow_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0xe0, 0x00, 0xf0, 0x00, 0xf8, 0x3f, 0xfc, 0x3f, 0xfc, 0x3f, 0xf8, 0x3f, 0xf0, 0x00, 0xe0, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/line.xbm000066400000000000000000000004231215713201500217120ustar00rootroot00000000000000#define line_width 16 #define line_height 16 static char line_bits[] = { 0x01, 0x00, 0x03, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x00, 0x03, 0x00, 0x06, 0x00, 0x0c, 0x00, 0x18, 0x00, 0x30, 0x00, 0x60, 0x00, 0xc0}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/link.xbm000066400000000000000000000003571215713201500217260ustar00rootroot00000000000000#define link_width 16 #define link_height 13 static char link_bits[] = { 0x00, 0x7e, 0x00, 0x81, 0xff, 0xff, 0x01, 0x80, 0x01, 0x84, 0x01, 0x8c, 0xfd, 0x97, 0x55, 0xad, 0xfd, 0x97, 0x01, 0x8c, 0x01, 0x84, 0x01, 0x80, 0xff, 0xff}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/magnify.xbm000066400000000000000000000004341215713201500224170ustar00rootroot00000000000000#define magnify_width 16 #define magnify_height 16 static char magnify_bits[] = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x70, 0x00, 0x38, 0x00, 0x1c, 0x00, 0x0e, 0x00, 0x07, 0x80, 0x03, 0xc0, 0x01, 0xe0, 0x00, 0x70, 0x00, 0x38, 0x00, 0x1c, 0x00, 0x0e, 0x00, 0xff, 0xff, 0xff, 0xff}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/objselect.xbm000066400000000000000000000004421215713201500227360ustar00rootroot00000000000000#define objselect_width 16 #define objselect_height 16 static char objselect_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x1c, 0x00, 0x3c, 0x00, 0x7c, 0x00, 0xfc, 0x00, 0xfc, 0x01, 0xfc, 0x03, 0x6c, 0x00, 0xc4, 0x00, 0xc0, 0x00, 0x80, 0x01, 0x80, 0x01, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/oval.xbm000066400000000000000000000004231215713201500217240ustar00rootroot00000000000000#define oval_width 16 #define oval_height 16 static char oval_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x0c, 0x30, 0x02, 0x40, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x02, 0x40, 0x0c, 0x30, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat0.xbm000066400000000000000000000004231215713201500216270ustar00rootroot00000000000000#define pat0_width 16 #define pat0_height 16 static char pat0_bits[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat1.xbm000066400000000000000000000004231215713201500216300ustar00rootroot00000000000000#define pat1_width 16 #define pat1_height 16 static char pat1_bits[] = { 0xee, 0xee, 0xff, 0xff, 0xbb, 0xbb, 0xff, 0xff, 0xee, 0xee, 0xff, 0xff, 0xbb, 0xbb, 0xff, 0xff, 0xee, 0xee, 0xff, 0xff, 0xbb, 0xbb, 0xff, 0xff, 0xee, 0xee, 0xff, 0xff, 0xbb, 0xbb, 0xff, 0xff}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat10.xbm000066400000000000000000000004261215713201500217130ustar00rootroot00000000000000#define pat10_width 16 #define pat10_height 16 static char pat10_bits[] = { 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33, 0x33}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat11.xbm000066400000000000000000000004261215713201500217140ustar00rootroot00000000000000#define pat11_width 16 #define pat11_height 16 static char pat11_bits[] = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat12.xbm000066400000000000000000000004261215713201500217150ustar00rootroot00000000000000#define pat12_width 16 #define pat12_height 16 static char pat12_bits[] = { 0x81, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x18, 0x18, 0x24, 0x24, 0x42, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x42, 0x24, 0x24, 0x18, 0x18, 0x18, 0x18, 0x24, 0x24, 0x42, 0x42, 0x81, 0x81}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat13.xbm000066400000000000000000000004261215713201500217160ustar00rootroot00000000000000#define pat13_width 16 #define pat13_height 16 static char pat13_bits[] = { 0x02, 0x81, 0x81, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x81, 0x81, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x08, 0x08, 0x04, 0x04, 0x02, 0x02, 0x81, 0x81, 0x40}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat14.xbm000066400000000000000000000004261215713201500217170ustar00rootroot00000000000000#define pat14_width 16 #define pat14_height 16 static char pat14_bits[] = { 0x81, 0x40, 0x02, 0x81, 0x04, 0x02, 0x08, 0x04, 0x10, 0x08, 0x20, 0x10, 0x40, 0x20, 0x81, 0x40, 0x02, 0x81, 0x04, 0x02, 0x08, 0x04, 0x10, 0x08, 0x20, 0x10, 0x40, 0x20, 0x81, 0x40, 0x02, 0x81}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat15.xbm000066400000000000000000000004261215713201500217200ustar00rootroot00000000000000#define pat15_width 16 #define pat15_height 16 static char pat15_bits[] = { 0x00, 0x00, 0x04, 0x20, 0x0c, 0x20, 0x14, 0x20, 0x24, 0x20, 0x44, 0x20, 0x84, 0x20, 0x04, 0x21, 0x04, 0x22, 0x04, 0x24, 0x04, 0x28, 0x04, 0x30, 0x04, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat2.xbm000066400000000000000000000004231215713201500216310ustar00rootroot00000000000000#define pat2_width 16 #define pat2_height 16 static char pat2_bits[] = { 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb, 0xee, 0xee, 0xbb, 0xbb}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat3.xbm000066400000000000000000000004231215713201500216320ustar00rootroot00000000000000#define pat3_width 16 #define pat3_height 16 static char pat3_bits[] = { 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat4.xbm000066400000000000000000000004231215713201500216330ustar00rootroot00000000000000#define pat4_width 16 #define pat4_height 16 static char pat4_bits[] = { 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44, 0x11, 0x11, 0x44, 0x44}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat5.xbm000066400000000000000000000004231215713201500216340ustar00rootroot00000000000000#define pat5_width 16 #define pat5_height 16 static char pat5_bits[] = { 0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00, 0x11, 0x11, 0x00, 0x00, 0x44, 0x44, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat6.xbm000066400000000000000000000004231215713201500216350ustar00rootroot00000000000000#define pat6_width 16 #define pat6_height 16 static char pat6_bits[] = { 0x08, 0x82, 0x00, 0x00, 0x41, 0x10, 0x00, 0x00, 0x08, 0x82, 0x00, 0x00, 0x41, 0x10, 0x00, 0x00, 0x08, 0x82, 0x00, 0x00, 0x41, 0x10, 0x00, 0x00, 0x08, 0x82, 0x00, 0x00, 0x41, 0x10, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat7.xbm000066400000000000000000000004231215713201500216360ustar00rootroot00000000000000#define pat7_width 16 #define pat7_height 16 static char pat7_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat8.xbm000066400000000000000000000004231215713201500216370ustar00rootroot00000000000000#define pat8_width 16 #define pat8_height 16 static char pat8_bits[] = { 0x1e, 0x1e, 0x0f, 0x0f, 0x87, 0x87, 0xc3, 0xc3, 0xe1, 0xe1, 0xf0, 0xf0, 0x78, 0x78, 0x3c, 0x3c, 0x1e, 0x1e, 0x0f, 0x0f, 0x87, 0x87, 0xc3, 0xc3, 0xe1, 0xe1, 0xf0, 0xf0, 0x78, 0x78, 0x3c, 0x3c}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/pat9.xbm000066400000000000000000000004231215713201500216400ustar00rootroot00000000000000#define pat9_width 16 #define pat9_height 16 static char pat9_bits[] = { 0x78, 0x78, 0xf0, 0xf0, 0xe1, 0xe1, 0xc3, 0xc3, 0x87, 0x87, 0x0f, 0x0f, 0x1e, 0x1e, 0x3c, 0x3c, 0x78, 0x78, 0xf0, 0xf0, 0xe1, 0xe1, 0xc3, 0xc3, 0x87, 0x87, 0x0f, 0x0f, 0x1e, 0x1e, 0x3c, 0x3c}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/polygon.xbm000066400000000000000000000004341215713201500224540ustar00rootroot00000000000000#define polygon_width 16 #define polygon_height 16 static char polygon_bits[] = { 0x01, 0x00, 0x03, 0x00, 0x05, 0xc0, 0x09, 0xb0, 0x11, 0x8c, 0x21, 0x43, 0xc1, 0x40, 0x01, 0x20, 0x01, 0x20, 0x01, 0x10, 0x03, 0x10, 0x0c, 0x08, 0x30, 0x08, 0xc0, 0x04, 0x00, 0x07, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/polyline.xbm000066400000000000000000000004371215713201500226230ustar00rootroot00000000000000#define polyline_width 16 #define polyline_height 16 static char polyline_bits[] = { 0x00, 0x00, 0x01, 0xc0, 0x03, 0xb0, 0x05, 0x4c, 0x09, 0x43, 0xd1, 0x20, 0x21, 0x20, 0x01, 0x10, 0x01, 0x10, 0x01, 0x08, 0x01, 0x08, 0x01, 0x00, 0x06, 0x00, 0x18, 0x00, 0x60, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/rectangle.xbm000066400000000000000000000004421215713201500227300ustar00rootroot00000000000000#define rectangle_width 16 #define rectangle_height 16 static char rectangle_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/region.xbm000066400000000000000000000004311215713201500222450ustar00rootroot00000000000000#define region_width 16 #define region_height 16 static char region_bits[] = { 0xb7, 0xed, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0x00, 0x00, 0x01, 0x80, 0x01, 0x80, 0xb7, 0xed}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/right.xbm000066400000000000000000000001701215713201500220770ustar00rootroot00000000000000#define right_width 4 #define right_height 7 static char right_bits[] = { 0x01, 0x03, 0x07, 0x0f, 0x07, 0x03, 0x01}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/right_arrow.xbm000066400000000000000000000004501215713201500233120ustar00rootroot00000000000000#define right_arrow_width 16 #define right_arrow_height 16 static char right_arrow_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0f, 0xfc, 0x1f, 0xfc, 0x3f, 0xfc, 0x3f, 0xfc, 0x1f, 0x00, 0x0f, 0x00, 0x07, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/rotate.xbm000066400000000000000000000004311215713201500222600ustar00rootroot00000000000000#define rotate_width 16 #define rotate_height 16 static char rotate_bits[] = { 0xe1, 0x07, 0xfb, 0x1f, 0x3f, 0x3c, 0x0f, 0x70, 0x1f, 0x60, 0x3f, 0xe0, 0x7f, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0x07, 0xfc, 0x06, 0xf8, 0x0e, 0xf0, 0x3c, 0xfc, 0xf8, 0xdf, 0xe0, 0x87}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/shiftb1.xbm000066400000000000000000000007451215713201500223320ustar00rootroot00000000000000#define shiftb1_width 28 #define shiftb1_height 16 static char shiftb1_bits[] = { 0x00, 0x80, 0xff, 0x01, 0x00, 0xc0, 0xff, 0x03, 0x10, 0xc0, 0x6c, 0x03, 0x38, 0xc0, 0x6c, 0x03, 0x7c, 0xc0, 0x6c, 0x03, 0xfe, 0xc0, 0x6c, 0x03, 0x10, 0xc0, 0x6c, 0x03, 0x10, 0xc2, 0x6c, 0x03, 0x10, 0xc7, 0xff, 0x03, 0x10, 0xc2, 0xff, 0x03, 0x10, 0xc0, 0xff, 0x03, 0x10, 0xc0, 0xff, 0x03, 0x10, 0xc0, 0xff, 0x03, 0x10, 0xc0, 0x3f, 0x02, 0x10, 0xc0, 0xff, 0x03, 0x00, 0x80, 0xff, 0x01}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/shiftdragb1.xbm000066400000000000000000000007611215713201500231660ustar00rootroot00000000000000#define shiftdragb1_width 28 #define shiftdragb1_height 16 static char shiftdragb1_bits[] = { 0x00, 0x80, 0xff, 0x01, 0x40, 0xc0, 0xff, 0x03, 0xc0, 0xc0, 0x6c, 0x03, 0xfe, 0xc1, 0x6c, 0x03, 0xc0, 0xc0, 0x6c, 0x03, 0x40, 0xc0, 0x6c, 0x03, 0x00, 0xc8, 0x6c, 0x03, 0x20, 0xdc, 0x6c, 0x03, 0x70, 0xc8, 0xff, 0x03, 0xf8, 0xc0, 0xff, 0x03, 0x20, 0xc0, 0xff, 0x03, 0x20, 0xc0, 0xff, 0x03, 0x20, 0xc0, 0xff, 0x03, 0x20, 0xc0, 0x3f, 0x02, 0x20, 0xc0, 0xff, 0x03, 0x00, 0x80, 0xff, 0x01}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/shrink.xbm000066400000000000000000000004311215713201500222600ustar00rootroot00000000000000#define shrink_width 16 #define shrink_height 16 static char shrink_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x3f, 0xf0, 0x3f, 0x00, 0x1c, 0x00, 0x0e, 0x00, 0x07, 0x80, 0x03, 0xc0, 0x01, 0xe0, 0x00, 0xf0, 0x3f, 0xf0, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/smooth.xbm000066400000000000000000000004421215713201500222750ustar00rootroot00000000000000#define smooth_width 16 #define smooth_height 16 static unsigned char smooth_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x3f, 0x02, 0x40, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x02, 0x40, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/square.xbm000066400000000000000000000004311215713201500222620ustar00rootroot00000000000000#define square_width 16 #define square_height 16 static char square_bits[] = { 0xff, 0xff, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0xff, 0xff}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/text.xbm000066400000000000000000000004231215713201500217470ustar00rootroot00000000000000#define text_width 16 #define text_height 16 static char text_bits[] = { 0x80, 0x03, 0x80, 0x03, 0x80, 0x06, 0x40, 0x06, 0x40, 0x0c, 0x60, 0x0c, 0x20, 0x0c, 0x20, 0x18, 0x30, 0x18, 0xf0, 0x1f, 0x10, 0x30, 0x18, 0x30, 0x08, 0x30, 0x08, 0x60, 0x0c, 0x60, 0x3f, 0xf8}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/up.xbm000066400000000000000000000004151215713201500214100ustar00rootroot00000000000000#define up_width 16 #define up_height 16 static char up_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, 0x1f, 0xf8, 0x1f, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/up_arrow.xbm000066400000000000000000000004371215713201500226260ustar00rootroot00000000000000#define up_arrow_width 16 #define up_arrow_height 16 static char up_arrow_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f, 0xf8, 0x1f, 0xf8, 0x1f, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0xc0, 0x03, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/width1.xbm000066400000000000000000000012501215713201500221620ustar00rootroot00000000000000#define width1_width 43 #define width1_height 16 static char width1_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/width2.xbm000066400000000000000000000012501215713201500221630ustar00rootroot00000000000000#define width2_width 43 #define width2_height 16 static char width2_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/width3.xbm000066400000000000000000000012501215713201500221640ustar00rootroot00000000000000#define width3_width 43 #define width3_height 16 static char width3_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/bitmaps/width4.xbm000066400000000000000000000012501215713201500221650ustar00rootroot00000000000000#define width4_width 43 #define width4_height 16 static char width4_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0xc0, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; skycat-3.1.2-starlink-1b/tclutil/configure000077500000000000000000014063231215713201500205350ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Starlink Autoconf 2.59 for tclutil 2.1.0. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='tclutil' PACKAGE_TARNAME='tclutil' PACKAGE_VERSION='2.1.0' PACKAGE_STRING='tclutil 2.1.0' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CYGPATH EXEEXT PKG_LIB_FILE PKG_STUB_LIB_FILE PKG_STUB_SOURCES PKG_STUB_OBJECTS PKG_TCL_SOURCES PKG_HEADERS PKG_INCLUDES PKG_LIBS PKG_CFLAGS TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC TCL_LIBS TCL_DEFS TCL_EXTRA_CFLAGS TCL_LD_FLAGS TCL_SHLIB_LD_LIBS TK_VERSION TK_BIN_DIR TK_SRC_DIR TK_LIB_FILE TK_LIB_FLAG TK_LIB_SPEC TK_STUB_LIB_FILE TK_STUB_LIB_FLAG TK_STUB_LIB_SPEC TK_LIBS TK_XINCLUDES CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC OBJEXT CPP CXX CXXFLAGS ac_ct_CXX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB EGREP MATH_LIBS SHLIB_LD_CXX_LIBS PKG_SOURCES PKG_OBJECTS CLEANFILES TCL_INCLUDES TK_INCLUDES TCL_THREADS SHARED_BUILD AR CELIB_DIR LIBOBJS SHLIB_SUFFIX DL_LIBS CFLAGS_DEBUG CFLAGS_OPTIMIZE CFLAGS_WARNING STLIB_LD SHLIB_LD SHLIB_CFLAGS SHLIB_LD_LIBS LDFLAGS_DEBUG LDFLAGS_OPTIMIZE LD_LIBRARY_PATH_VAR BLT_LIB_DIR BLT_LIB_SPEC TCL_DBGX CFLAGS_DEFAULT LDFLAGS_DEFAULT MAKE_LIB MAKE_SHARED_LIB MAKE_STATIC_LIB MAKE_STUB_LIB RANLIB_STUB TCLSH_PROG WISH_PROG tclutil_LIB_FILE tclutil_BUILD_DIR tclutil_BUILD_LIB_SPEC tclutil_LIB_SPEC tclutil_PKG_OBJECTS tclutil_SRC_DIR LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP ac_env_CXX_set=${CXX+set} ac_env_CXX_value=$CXX ac_cv_env_CXX_set=${CXX+set} ac_cv_env_CXX_value=$CXX ac_env_CXXFLAGS_set=${CXXFLAGS+set} ac_env_CXXFLAGS_value=$CXXFLAGS ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} ac_cv_env_CXXFLAGS_value=$CXXFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures tclutil 2.1.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of tclutil 2.1.0:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-threads build with threads --enable-shared build and link with shared libraries --enable-shared --enable-64bit enable 64bit support (where applicable) --enable-64bit-vis enable 64bit Sparc VIS support --enable-wince enable Win/CE support (where applicable) --disable-load disallow dynamic loading and "load" command --enable-symbols build with debugging symbols --disable-symbols Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-tcl directory containing tcl configuration (tclConfig.sh) --with-tk directory containing tk configuration (tkConfig.sh) --with-tclinclude directory containing the public Tcl header files --with-tkinclude directory containing the public Tk header files. --with-x use the X Window System --with-celib=DIR use Windows/CE support library from DIR --with-blt=DIR link with BLT library installed in DIR Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF tclutil configure 2.1.0 generated by Starlink Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by tclutil $as_me 2.1.0, which was generated by Starlink Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- # TEA extensions pass this us the version of TEA they think they # are compatible with. TEA_VERSION="3.4" echo "$as_me:$LINENO: checking for correct TEA configuration" >&5 echo $ECHO_N "checking for correct TEA configuration... $ECHO_C" >&6 if test x"${PACKAGE_NAME}" = x ; then { { echo "$as_me:$LINENO: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&5 echo "$as_me: error: The PACKAGE_NAME variable must be defined by your TEA configure.in" >&2;} { (exit 1); exit 1; }; } fi if test x"3.4" = x ; then { { echo "$as_me:$LINENO: error: TEA version not specified." >&5 echo "$as_me: error: TEA version not specified." >&2;} { (exit 1); exit 1; }; } elif test "3.4" != "${TEA_VERSION}" ; then echo "$as_me:$LINENO: result: warning: requested TEA version \"3.4\", have \"${TEA_VERSION}\"" >&5 echo "${ECHO_T}warning: requested TEA version \"3.4\", have \"${TEA_VERSION}\"" >&6 else echo "$as_me:$LINENO: result: ok (TEA ${TEA_VERSION})" >&5 echo "${ECHO_T}ok (TEA ${TEA_VERSION})" >&6 fi case "`uname -s`" in *win32*|*WIN32*|*CYGWIN_NT*|*CYGWIN_9*|*CYGWIN_ME*|*MINGW32_*) # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CYGPATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CYGPATH"; then ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CYGPATH="cygpath -w" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_CYGPATH" && ac_cv_prog_CYGPATH="echo" fi fi CYGPATH=$ac_cv_prog_CYGPATH if test -n "$CYGPATH"; then echo "$as_me:$LINENO: result: $CYGPATH" >&5 echo "${ECHO_T}$CYGPATH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) CYGPATH=echo EXEEXT="" TEA_PLATFORM="unix" ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi # This package name must be replaced statically for AC_SUBST to work # Substitute STUB_LIB_FILE in case package creates a stub library too. # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true # Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then withval="$with_tcl" with_tclconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tcl configuration" >&5 echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 if test "${ac_cv_c_tclconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case ${with_tclconfig} in */tclConfig.sh ) if test -f ${with_tclconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself" >&2;} with_tclconfig=`echo ${with_tclconfig} | sed 's!/tclConfig\.sh$!!'` fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d ${TCLTK_ROOT}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i; pwd)` break fi done fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" { echo "$as_me:$LINENO: WARNING: \"Cannot find Tcl configuration definitions\"" >&5 echo "$as_me: WARNING: \"Cannot find Tcl configuration definitions\"" >&2;} exit 0 else no_tcl= TCL_BIN_DIR=${ac_cv_c_tclconfig} echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6 fi fi echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . $TCL_BIN_DIR/tclConfig.sh else echo "$as_me:$LINENO: result: file not found" >&5 echo "${ECHO_T}file not found" >&6 fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TCL_BIN_DIR/Makefile ; then TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} fi # # eval is required to do the TCL_DBGX substitution # eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" #AC_SUBST(TCL_BUILD_LIB_SPEC) #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC) #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true # Check whether --with-tk or --without-tk was given. if test "${with_tk+set}" = set; then withval="$with_tk" with_tkconfig=${withval} fi; echo "$as_me:$LINENO: checking for Tk configuration" >&5 echo $ECHO_N "checking for Tk configuration... $ECHO_C" >&6 if test "${ac_cv_c_tkconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case ${with_tkconfig} in */tkConfig.sh ) if test -f ${with_tkconfig}; then { echo "$as_me:$LINENO: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&5 echo "$as_me: WARNING: --with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself" >&2;} with_tkconfig=`echo ${with_tkconfig} | sed 's!/tkConfig\.sh$!!'` fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd ${with_tkconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&5 echo "$as_me: error: ${with_tkconfig} directory doesn't contain tkConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d ${TCLTK_ROOT}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i; pwd)` break fi done fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../tk[8-9].[0-9]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../tk[8-9].[0-9]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ../../../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[8-9].[0-9].[0-9]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[8-9].[0-9]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` break fi done fi fi if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" { echo "$as_me:$LINENO: WARNING: \"Cannot find Tk configuration definitions\"" >&5 echo "$as_me: WARNING: \"Cannot find Tk configuration definitions\"" >&2;} exit 0 else no_tk= TK_BIN_DIR=${ac_cv_c_tkconfig} echo "$as_me:$LINENO: result: found $TK_BIN_DIR/tkConfig.sh" >&5 echo "${ECHO_T}found $TK_BIN_DIR/tkConfig.sh" >&6 fi fi echo "$as_me:$LINENO: checking for existence of ${TK_BIN_DIR}/tkConfig.sh" >&5 echo $ECHO_N "checking for existence of ${TK_BIN_DIR}/tkConfig.sh... $ECHO_C" >&6 if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then echo "$as_me:$LINENO: result: loading" >&5 echo "${ECHO_T}loading" >&6 . $TK_BIN_DIR/tkConfig.sh else echo "$as_me:$LINENO: result: could not find ${TK_BIN_DIR}/tkConfig.sh" >&5 echo "${ECHO_T}could not find ${TK_BIN_DIR}/tkConfig.sh" >&6 fi # # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f $TK_BIN_DIR/Makefile ; then TK_LIB_SPEC=${TK_BUILD_LIB_SPEC} TK_STUB_LIB_SPEC=${TK_BUILD_STUB_LIB_SPEC} TK_STUB_LIB_PATH=${TK_BUILD_STUB_LIB_PATH} fi # Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) cat >>confdefs.h <<\_ACEOF #define MAC_OSX_TK 1 _ACEOF TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi # # eval is required to do the TK_DBGX substitution # eval "TK_LIB_FILE=\"${TK_LIB_FILE}\"" eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then { echo "$as_me:$LINENO: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&5 echo "$as_me: --prefix defaulting to TCL_PREFIX ${TCL_PREFIX}" >&6;} prefix=${TCL_PREFIX} else { echo "$as_me:$LINENO: --prefix defaulting to /usr/local" >&5 echo "$as_me: --prefix defaulting to /usr/local" >&6;} prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then #if test x"${TCL_EXEC_PREFIX}" != x; then #AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) #exec_prefix=${TCL_EXEC_PREFIX} #else { echo "$as_me:$LINENO: --exec-prefix defaulting to ${prefix}" >&5 echo "$as_me: --exec-prefix defaulting to ${prefix}" >&6;} exec_prefix=$prefix #fi fi #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. # If the user did not set CFLAGS, set it now to keep # the AC_PROG_CC macro from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_cv_c_compiler_gnu = yes; then GCC=yes fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:$LINENO: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cc ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then echo "$as_me:$LINENO: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CXX" && break done test -n "$ac_ct_CXX" || ac_ct_CXX="g++" CXX=$ac_ct_CXX fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cxx_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_cxx_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF all: @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:$LINENO: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | (grep -E '(a|b)') >/dev/null 2>&1 then ac_cv_prog_egrep='grep -E' else ac_cv_prog_egrep='egrep' fi fi echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then echo "$as_me:$LINENO: checking if the compiler understands -pipe" >&5 echo $ECHO_N "checking if the compiler understands -pipe... $ECHO_C" >&6 OLDCC="$CC" CC="$CC -pipe" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CC="$OLDCC" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi #-------------------------------------------------------------------- # Pick up flags from the environment (user). #-------------------------------------------------------------------- CC="${CC} $CFLAGS" CXX="${CXX} $CXXFLAGS $CFLAGS" #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac if test "${TEA_PLATFORM}" = "unix" ; then #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. # Also, Linux requires the "ieee" library for math to work # right (and it must appear before "-lm"). #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for sin" >&5 echo $ECHO_N "checking for sin... $ECHO_C" >&6 if test "${ac_cv_func_sin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define sin to an innocuous variant, in case declares sin. For example, HP-UX 11i declares gettimeofday. */ #define sin innocuous_sin /* System header to define __stub macros and hopefully few prototypes, which can conflict with char sin (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef sin /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char sin (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_sin) || defined (__stub___sin) choke me #else char (*f) () = sin; #endif #ifdef __cplusplus } #endif int main () { return f != sin; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_sin=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_sin=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_sin" >&5 echo "${ECHO_T}$ac_cv_func_sin" >&6 if test $ac_cv_func_sin = yes; then MATH_LIBS="" else MATH_LIBS="-lm" fi echo "$as_me:$LINENO: checking for main in -lieee" >&5 echo $ECHO_N "checking for main in -lieee... $ECHO_C" >&6 if test "${ac_cv_lib_ieee_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lieee $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_ieee_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ieee_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_ieee_main" >&5 echo "${ECHO_T}$ac_cv_lib_ieee_main" >&6 if test $ac_cv_lib_ieee_main = yes; then MATH_LIBS="-lieee $MATH_LIBS" fi #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for main in -linet" >&5 echo $ECHO_N "checking for main in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { main (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_main=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_inet_main=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_inet_main" >&5 echo "${ECHO_T}$ac_cv_lib_inet_main" >&6 if test $ac_cv_lib_inet_main = yes; then LIBS="$LIBS -linet" fi if test "${ac_cv_header_net_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking net/errno.h usability" >&5 echo $ECHO_N "checking net/errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking net/errno.h presence" >&5 echo $ECHO_N "checking net/errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: net/errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: net/errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: net/errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: net/errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: net/errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: net/errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: net/errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: net/errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: net/errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for net/errno.h" >&5 echo $ECHO_N "checking for net/errno.h... $ECHO_C" >&6 if test "${ac_cv_header_net_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_net_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_net_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_net_errno_h" >&6 fi if test $ac_cv_header_net_errno_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_NET_ERRNO_H 1 _ACEOF fi #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 echo "$as_me:$LINENO: checking for connect" >&5 echo $ECHO_N "checking for connect... $ECHO_C" >&6 if test "${ac_cv_func_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_connect) || defined (__stub___connect) choke me #else char (*f) () = connect; #endif #ifdef __cplusplus } #endif int main () { return f != connect; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 echo "${ECHO_T}$ac_cv_func_connect" >&6 if test $ac_cv_func_connect = yes; then tcl_checkSocket=0 else tcl_checkSocket=1 fi if test "$tcl_checkSocket" = 1; then echo "$as_me:$LINENO: checking for setsockopt" >&5 echo $ECHO_N "checking for setsockopt... $ECHO_C" >&6 if test "${ac_cv_func_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define setsockopt to an innocuous variant, in case declares setsockopt. For example, HP-UX 11i declares gettimeofday. */ #define setsockopt innocuous_setsockopt /* System header to define __stub macros and hopefully few prototypes, which can conflict with char setsockopt (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef setsockopt /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_setsockopt) || defined (__stub___setsockopt) choke me #else char (*f) () = setsockopt; #endif #ifdef __cplusplus } #endif int main () { return f != setsockopt; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_setsockopt" >&5 echo "${ECHO_T}$ac_cv_func_setsockopt" >&6 if test $ac_cv_func_setsockopt = yes; then : else echo "$as_me:$LINENO: checking for setsockopt in -lsocket" >&5 echo $ECHO_N "checking for setsockopt in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_setsockopt+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char setsockopt (); int main () { setsockopt (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_setsockopt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_setsockopt=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_setsockopt" >&5 echo "${ECHO_T}$ac_cv_lib_socket_setsockopt" >&6 if test $ac_cv_lib_socket_setsockopt = yes; then LIBS="$LIBS -lsocket" else tcl_checkBoth=1 fi fi fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo "$as_me:$LINENO: checking for accept" >&5 echo $ECHO_N "checking for accept... $ECHO_C" >&6 if test "${ac_cv_func_accept+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define accept to an innocuous variant, in case declares accept. For example, HP-UX 11i declares gettimeofday. */ #define accept innocuous_accept /* System header to define __stub macros and hopefully few prototypes, which can conflict with char accept (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef accept /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char accept (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_accept) || defined (__stub___accept) choke me #else char (*f) () = accept; #endif #ifdef __cplusplus } #endif int main () { return f != accept; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_accept=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_accept=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_accept" >&5 echo "${ECHO_T}$ac_cv_func_accept" >&6 if test $ac_cv_func_accept = yes; then tcl_checkNsl=0 else LIBS=$tk_oldLibs fi fi echo "$as_me:$LINENO: checking for gethostbyname" >&5 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 if test "${ac_cv_func_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" { #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) choke me #else char (*f) () = gethostbyname; #endif #ifdef __cplusplus } #endif int main () { return f != gethostbyname; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 if test $ac_cv_func_gethostbyname = yes; then : else echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gethostbyname (); int main () { gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_gethostbyname=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 if test $ac_cv_lib_nsl_gethostbyname = yes; then LIBS="$LIBS -lnsl" fi fi # Don't perform the eval of the libraries here because DL_LIBS # won't be set until we call TEA_CONFIG_CFLAGS TCL_LIBS='${DL_LIBS} ${LIBS} ${MATH_LIBS}' echo "$as_me:$LINENO: checking dirent.h" >&5 echo $ECHO_N "checking dirent.h... $ECHO_C" >&6 if test "${tcl_cv_dirent_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #ifndef _POSIX_SOURCE # ifdef __Lynx__ /* * Generate compilation error to make the test fail: Lynx headers * are only valid if really in the POSIX environment. */ missing_procedure(); # endif #endif DIR *d; struct dirent *entryPtr; char *p; d = opendir("foobar"); entryPtr = readdir(d); p = entryPtr->d_name; closedir(d); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_dirent_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_dirent_h=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi if test $tcl_cv_dirent_h = no; then cat >>confdefs.h <<\_ACEOF #define NO_DIRENT_H 1 _ACEOF fi echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking errno.h usability" >&5 echo $ECHO_N "checking errno.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking errno.h presence" >&5 echo $ECHO_N "checking errno.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: errno.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: errno.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: errno.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: errno.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: errno.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: errno.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: errno.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: errno.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: errno.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for errno.h" >&5 echo $ECHO_N "checking for errno.h... $ECHO_C" >&6 if test "${ac_cv_header_errno_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_errno_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_errno_h" >&5 echo "${ECHO_T}$ac_cv_header_errno_h" >&6 fi if test $ac_cv_header_errno_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_ERRNO_H 1 _ACEOF fi if test "${ac_cv_header_float_h+set}" = set; then echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking float.h usability" >&5 echo $ECHO_N "checking float.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking float.h presence" >&5 echo $ECHO_N "checking float.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: float.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: float.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: float.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: float.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: float.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: float.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: float.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: float.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: float.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for float.h" >&5 echo $ECHO_N "checking for float.h... $ECHO_C" >&6 if test "${ac_cv_header_float_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_float_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_float_h" >&5 echo "${ECHO_T}$ac_cv_header_float_h" >&6 fi if test $ac_cv_header_float_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_FLOAT_H 1 _ACEOF fi if test "${ac_cv_header_values_h+set}" = set; then echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking values.h usability" >&5 echo $ECHO_N "checking values.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking values.h presence" >&5 echo $ECHO_N "checking values.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: values.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: values.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: values.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: values.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: values.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: values.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: values.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: values.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: values.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for values.h" >&5 echo $ECHO_N "checking for values.h... $ECHO_C" >&6 if test "${ac_cv_header_values_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_values_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_values_h" >&5 echo "${ECHO_T}$ac_cv_header_values_h" >&6 fi if test $ac_cv_header_values_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_VALUES_H 1 _ACEOF fi if test "${ac_cv_header_limits_h+set}" = set; then echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking limits.h usability" >&5 echo $ECHO_N "checking limits.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking limits.h presence" >&5 echo $ECHO_N "checking limits.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: limits.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: limits.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: limits.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: limits.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: limits.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: limits.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: limits.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: limits.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: limits.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for limits.h" >&5 echo $ECHO_N "checking for limits.h... $ECHO_C" >&6 if test "${ac_cv_header_limits_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_limits_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_limits_h" >&5 echo "${ECHO_T}$ac_cv_header_limits_h" >&6 fi if test $ac_cv_header_limits_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_LIMITS_H 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define NO_LIMITS_H 1 _ACEOF fi if test "${ac_cv_header_stdlib_h+set}" = set; then echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking stdlib.h usability" >&5 echo $ECHO_N "checking stdlib.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking stdlib.h presence" >&5 echo $ECHO_N "checking stdlib.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: stdlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: stdlib.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: stdlib.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: stdlib.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: stdlib.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: stdlib.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: stdlib.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: stdlib.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: stdlib.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for stdlib.h" >&5 echo $ECHO_N "checking for stdlib.h... $ECHO_C" >&6 if test "${ac_cv_header_stdlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_stdlib_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_stdlib_h" >&5 echo "${ECHO_T}$ac_cv_header_stdlib_h" >&6 fi if test $ac_cv_header_stdlib_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtol" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtoul" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strtod" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STDLIB_H 1 _ACEOF fi if test "${ac_cv_header_string_h+set}" = set; then echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking string.h usability" >&5 echo $ECHO_N "checking string.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking string.h presence" >&5 echo $ECHO_N "checking string.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: string.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: string.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: string.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: string.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: string.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: string.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: string.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: string.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: string.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for string.h" >&5 echo $ECHO_N "checking for string.h... $ECHO_C" >&6 if test "${ac_cv_header_string_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_string_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_string_h" >&5 echo "${ECHO_T}$ac_cv_header_string_h" >&6 fi if test $ac_cv_header_string_h = yes; then tcl_ok=1 else tcl_ok=0 fi cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strstr" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "strerror" >/dev/null 2>&1; then : else tcl_ok=0 fi rm -f conftest* # See also memmove check below for a place where NO_STRING_H can be # set and why. if test $tcl_ok = 0; then cat >>confdefs.h <<\_ACEOF #define NO_STRING_H 1 _ACEOF fi if test "${ac_cv_header_sys_wait_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/wait.h usability" >&5 echo $ECHO_N "checking sys/wait.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking sys/wait.h presence" >&5 echo $ECHO_N "checking sys/wait.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/wait.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/wait.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/wait.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/wait.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/wait.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/wait.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/wait.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/wait.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for sys/wait.h" >&5 echo $ECHO_N "checking for sys/wait.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_wait_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 fi if test $ac_cv_header_sys_wait_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_SYS_WAIT_H 1 _ACEOF fi if test "${ac_cv_header_dlfcn_h+set}" = set; then echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 fi if test $ac_cv_header_dlfcn_h = yes; then : else cat >>confdefs.h <<\_ACEOF #define NO_DLFCN_H 1 _ACEOF fi # OS/390 lacks sys/param.h (and doesn't need it, by chance). for ac_header in sys/param.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Let the user call this, because if it triggers, they will # need a compat/strtod.c that is correct. Users can also # use Tcl_GetDouble(FromObj) instead. #TEA_BUGGY_STRTOD fi #----------------------------------------------------------------------- # Do application specific checks (see aclocal.m4), after compiler setup. #----------------------------------------------------------------------- #------------------------------------------------------------------------ # TCLUTIL_PATH_BLT -- # # Locate the BLT library # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-blt=... # # Defines the following vars: # BLT_LIB_SPEC String to add to link the BLT lib (-L... -lBLT) # BLT_LIB_DIR Directory containing libBLT24.so #------------------------------------------------------------------------ # ----------------------------------------------------------------------- cat >>confdefs.h <<\_ACEOF #define USE_COMPAT_CONST 1 _ACEOF # ----------------------------------------------------------------------- echo "$as_me:$LINENO: checking sysv shared memory prototypes" >&5 echo $ECHO_N "checking sysv shared memory prototypes... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "int.*shmdt.*\(" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; cat >>confdefs.h <<\_ACEOF #define NEED_SHM_PROTO 1 _ACEOF fi rm -f conftest* # ----------------------------------------------------------------------- echo "$as_me:$LINENO: checking gethostname prototype" >&5 echo $ECHO_N "checking gethostname prototype... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "int.*gethostname.*\(" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; cat >>confdefs.h <<\_ACEOF #define NEED_GETHOSTNAME_PROTO 1 _ACEOF fi rm -f conftest* # ----------------------------------------------------------------------- echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6 if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((long *) 0) return 0; if (sizeof (long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6 echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6 if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (long)); } unsigned long ulongval () { return (long) (sizeof (long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (long))) < 0) { long i = longval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_long=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF # ------------------------------------------------------------------------- # there are some idiosyncrasies with semun defs (used in semxxx). Solaris # does not define it at all # ------------------------------------------------------------------------- echo "$as_me:$LINENO: checking \"do we have union semun defined\"" >&5 echo $ECHO_N "checking \"do we have union semun defined\"... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { union semun filler; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNION_SEMUN 1 _ACEOF echo "$as_me:$LINENO: result: \"yes\"" >&5 echo "${ECHO_T}\"yes\"" >&6 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: \"no\"" >&5 echo "${ECHO_T}\"no\"" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >>confdefs.h <<\_ACEOF #define HAVE_NET_SERVICES 1 _ACEOF # ----------------------------------------------------------------------- echo "$as_me:$LINENO: checking mmap prototypes" >&5 echo $ECHO_N "checking mmap prototypes... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "int.*munmap.*\(" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; cat >>confdefs.h <<\_ACEOF #define NEED_MMAP_PROTO 1 _ACEOF fi rm -f conftest* # ----------------------------------------------------------------------- for ac_header in sys/filio.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/statvfs.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking $ac_header usability" >&5 echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking $ac_header presence" >&5 echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # ----------------------------------------------------------------------- # Check if we need (or can use) the socklen_t type. # ----------------------------------------------------------------------- echo "$as_me:$LINENO: checking for socklen_t" >&5 echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6 if test "${ac_cv_type_socklen_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { if ((socklen_t *) 0) return 0; if (sizeof (socklen_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_socklen_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_socklen_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 echo "${ECHO_T}$ac_cv_type_socklen_t" >&6 if test $ac_cv_type_socklen_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_SOCKLEN_T 1 _ACEOF fi #------------------------------------------------------------------------ #AC_LANG(C++) echo "$as_me:$LINENO: checking fd_set" >&5 echo $ECHO_N "checking fd_set... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { fd_set readFds; select(32, &readFds, 0, 0, 0); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then test_ok=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 test_ok=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $test_ok = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SELECT_FD_SET 1 _ACEOF fi echo "$as_me:$LINENO: result: $test_ok" >&5 echo "${ECHO_T}$test_ok" >&6 #------------------------------------------------------------------------ # Check if we require additional libraries to support C++ shareable # libraries. system=`uname -s`-`uname -r` SHLIB_LD_CXX_LIBS="" export SHLIB_LD_CXX_LIBS case $system in SunOS-5*) SHLIB_LD_CXX_LIBS="-lCrun -lCstd" ;; OSF*) SHLIB_LD_CXX_LIBS="-lcxx -lcxxstd" ;; esac #------------------------------------------------------------------------- # The cxx C++ compiler under Tru64 UNIX needs the special # CXXFLAGS "-std gnu -D__USE_STD_IOSTREAM=1". These allow the standard # library streams headers to work and to generate templates that do # not require special handling throughout skycat directories (normally # template object files are created in various cxx_repository subdirectories, # this way the object files are kept embedded the usual object files, see # the cxx man page for details). #------------------------------------------------------------------------- export CXXFLAGS case $system in OSF*) case "x$CXX" in xcxx*) CXXFLAGS="$CXXFLAGS -g3 -std gnu -D__USE_STD_IOSTREAM=1" ;; esac ;; esac #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- csources=`cd $srcdir; echo generic/*.[Cc]` cheaders=`cd $srcdir; echo generic/*.h` cincludes="-I. -I$srcdir/bitmaps -I$srcdir/generic" tclsources=`cd $srcdir; echo library/*.tcl` vars="${csources}" for i in $vars; do case $i in \$*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find source file '$i'" >&5 echo "$as_me: error: could not find source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done vars="${cheaders}" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find header file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find header file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_HEADERS="$PKG_HEADERS $i" done vars="$cincludes" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done PKG_CFLAGS="$PKG_CFLAGS " vars="" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ ; then { { echo "$as_me:$LINENO: error: could not find stub source file '$i'" >&5 echo "$as_me: error: could not find stub source file '$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[^.]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[^.]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done vars="${tclsources}" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then { { echo "$as_me:$LINENO: error: could not find tcl source file '${srcdir}/$i'" >&5 echo "$as_me: error: could not find tcl source file '${srcdir}/$i'" >&2;} { (exit 1); exit 1; }; } fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then cat >>confdefs.h <<\_ACEOF #define BUILD_tclutil 1 _ACEOF CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for Tcl public headers" >&5 echo $ECHO_N "checking for Tcl public headers... $ECHO_C" >&6 # Check whether --with-tclinclude or --without-tclinclude was given. if test "${with_tclinclude+set}" = set; then withval="$with_tclinclude" with_tclinclude=${withval} fi; if test "${ac_cv_c_tclh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else { { echo "$as_me:$LINENO: error: ${with_tclinclude} directory does not contain tcl.h" >&5 echo "$as_me: error: ${with_tclinclude} directory does not contain tcl.h" >&2;} { (exit 1); exit 1; }; } fi else # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; *) list="" ;; esac # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "$TCL_BIN_DIR/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then { { echo "$as_me:$LINENO: error: tcl.h not found. Please specify its location with --with-tclinclude" >&5 echo "$as_me: error: tcl.h not found. Please specify its location with --with-tclinclude" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ${ac_cv_c_tclh}" >&5 echo "${ECHO_T}${ac_cv_c_tclh}" >&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" #TEA_PRIVATE_TCL_HEADERS echo "$as_me:$LINENO: checking for Tk public headers" >&5 echo $ECHO_N "checking for Tk public headers... $ECHO_C" >&6 # Check whether --with-tkinclude or --without-tkinclude was given. if test "${with_tkinclude+set}" = set; then withval="$with_tkinclude" with_tkinclude=${withval} fi; if test "${ac_cv_c_tkh+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else { { echo "$as_me:$LINENO: error: ${with_tkinclude} directory does not contain tk.h" >&5 echo "$as_me: error: ${with_tkinclude} directory does not contain tk.h" >&2;} { (exit 1); exit 1; }; } fi else # If Tk was built as a framework, attempt to use # the framework's Headers directory. case ${TK_DEFS} in *TK_FRAMEWORK*) list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" ;; *) list="" ;; esac # Look in the source dir only if Tk is not installed, # and in that situation, look there before installed locations. if test -f "$TK_BIN_DIR/Makefile" ; then list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tk's --prefix location, # relative to directory of tkConfig.sh, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi fi # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then { { echo "$as_me:$LINENO: error: tk.h not found. Please specify its location with --with-tkinclude" >&5 echo "$as_me: error: tk.h not found. Please specify its location with --with-tkinclude" >&2;} { (exit 1); exit 1; }; } else echo "$as_me:$LINENO: result: ${ac_cv_c_tkh}" >&5 echo "${ECHO_T}${ac_cv_c_tkh}" >&6 fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" if test "${TEA_WINDOWINGSYSTEM}" = "win32" \ -o "${TEA_WINDOWINGSYSTEM}" = "aqua"; then # On Windows and Aqua, we need the X compat headers echo "$as_me:$LINENO: checking for X11 header files" >&5 echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" fi echo "$as_me:$LINENO: result: ${INCLUDE_DIR_NATIVE}" >&5 echo "${ECHO_T}${INCLUDE_DIR_NATIVE}" >&6 fi #TEA_PRIVATE_TK_HEADERS if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then withval="$with_x" fi; # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then # Both variables are already set. have_x=yes else if test "${ac_cv_have_x+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -fr conftest.dir if mkdir conftest.dir; then cd conftest.dir # Make sure to not put "make" in the Imakefile rules, since we grep it out. cat >Imakefile <<'_ACEOF' acfindx: @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' _ACEOF if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && test -f $ac_im_libdir/libX11.$ac_extension; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /lib) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -fr conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Intrinsic.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then # We can compile using X headers with no special include directory. ac_x_includes= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Intrinsic.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XtMalloc (0) ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r $ac_dir/libXt.$ac_extension; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then # Didn't find X anywhere. Cache the known absence of X. ac_cv_have_x="have_x=no" else # Record where we found X for the cache. ac_cv_have_x="have_x=yes \ ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" fi fi fi eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then echo "$as_me:$LINENO: result: $have_x" >&5 echo "${ECHO_T}$have_x" >&6 no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 fi not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 not_really_there="yes" fi rm -f conftest.err conftest.$ac_ext else if test ! -r $x_includes/X11/Intrinsic.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then echo "$as_me:$LINENO: checking for X11 header files" >&5 echo $ECHO_N "checking for X11 header files... $ECHO_C" >&6 XINCLUDES="# no special path needed" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 XINCLUDES="nope" fi rm -f conftest.err conftest.$ac_ext if test "$XINCLUDES" = nope; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Intrinsic.h; then echo "$as_me:$LINENO: result: $i" >&5 echo "${ECHO_T}$i" >&6 XINCLUDES=" -I$i" break fi done fi else if test "$x_includes" != ""; then XINCLUDES=-I$x_includes else XINCLUDES="# no special path needed" fi fi if test "$XINCLUDES" = nope; then echo "$as_me:$LINENO: result: could not find any!" >&5 echo "${ECHO_T}could not find any!" >&6 XINCLUDES="# no include files found" fi if test "$no_x" = yes; then echo "$as_me:$LINENO: checking for X11 libraries" >&5 echo $ECHO_N "checking for X11 libraries... $ECHO_C" >&6 XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.dylib -o -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl; then echo "$as_me:$LINENO: result: $i" >&5 echo "${ECHO_T}$i" >&6 XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then echo "$as_me:$LINENO: checking for XCreateWindow in -lXwindow" >&5 echo $ECHO_N "checking for XCreateWindow in -lXwindow... $ECHO_C" >&6 if test "${ac_cv_lib_Xwindow_XCreateWindow+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXwindow $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char XCreateWindow (); int main () { XCreateWindow (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_Xwindow_XCreateWindow=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xwindow_XCreateWindow=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_Xwindow_XCreateWindow" >&5 echo "${ECHO_T}$ac_cv_lib_Xwindow_XCreateWindow" >&6 if test $ac_cv_lib_Xwindow_XCreateWindow = yes; then XLIBSW=-lXwindow fi fi if test "$XLIBSW" = nope ; then echo "$as_me:$LINENO: result: could not find any! Using -lX11." >&5 echo "${ECHO_T}could not find any! Using -lX11." >&6 XLIBSW=-lX11 fi if test x"${XLIBSW}" != x ; then PKG_LIBS="${PKG_LIBS} ${XLIBSW}" fi fi #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants. cat >>confdefs.h <<\_ACEOF #define USE_THREAD_ALLOC 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _THREAD_SAFE 1 _ACEOF echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread_pthread_mutex_init" >&6 if test $ac_cv_lib_pthread_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the # same library, as some systems hide it there until # pthread.h is defined. We could alternatively do an # AC_TRY_COMPILE with pthread.h, but that will work with # libpthread really doesn't exist, like AIX 4.2. # [Bug: 4359] echo "$as_me:$LINENO: checking for __pthread_mutex_init in -lpthread" >&5 echo $ECHO_N "checking for __pthread_mutex_init in -lpthread... $ECHO_C" >&6 if test "${ac_cv_lib_pthread___pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char __pthread_mutex_init (); int main () { __pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthread___pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread___pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthread___pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthread___pthread_mutex_init" >&6 if test $ac_cv_lib_pthread___pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lpthreads" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lpthreads... $ECHO_C" >&6 if test "${ac_cv_lib_pthreads_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthreads $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_pthreads_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthreads_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_pthreads_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_pthreads_pthread_mutex_init" >&6 if test $ac_cv_lib_pthreads_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc... $ECHO_C" >&6 if test "${ac_cv_lib_c_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_pthread_mutex_init" >&6 if test $ac_cv_lib_c_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "no"; then echo "$as_me:$LINENO: checking for pthread_mutex_init in -lc_r" >&5 echo $ECHO_N "checking for pthread_mutex_init in -lc_r... $ECHO_C" >&6 if test "${ac_cv_lib_c_r_pthread_mutex_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lc_r $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char pthread_mutex_init (); int main () { pthread_mutex_init (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_c_r_pthread_mutex_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_c_r_pthread_mutex_init=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_mutex_init" >&5 echo "${ECHO_T}$ac_cv_lib_c_r_pthread_mutex_init" >&6 if test $ac_cv_lib_c_r_pthread_mutex_init = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 { echo "$as_me:$LINENO: WARNING: \"Don t know how to find pthread lib on your system - thread support disabled\"" >&5 echo "$as_me: WARNING: \"Don t know how to find pthread lib on your system - thread support disabled\"" >&2;} fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output echo "$as_me:$LINENO: checking for building with threads" >&5 echo $ECHO_N "checking for building with threads... $ECHO_C" >&6 if test "${TCL_THREADS}" = "1"; then cat >>confdefs.h <<\_ACEOF #define TCL_THREADS 1 _ACEOF #LIBS="$LIBS $THREADS_LIBS" echo "$as_me:$LINENO: result: yes (default)" >&5 echo "${ECHO_T}yes (default)" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then { echo "$as_me:$LINENO: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&5 echo "$as_me: WARNING: Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads." >&2;} fi ;; *) if test "${TCL_THREADS}" = "1"; then { echo "$as_me:$LINENO: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&5 echo "$as_me: WARNING: --enable-threads requested, but building against a Tcl that is NOT thread-enabled. This is an OK configuration that will also run in a thread-enabled core." >&2;} fi ;; esac #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking how to build libraries" >&5 echo $ECHO_N "checking how to build libraries... $ECHO_C" >&6 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi; if test "${enable_shared+set}" = set; then enableval="$enable_shared" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" ; then echo "$as_me:$LINENO: result: shared" >&5 echo "${ECHO_T}shared" >&6 SHARED_BUILD=1 else echo "$as_me:$LINENO: result: static" >&5 echo "${ECHO_T}static" >&6 SHARED_BUILD=0 cat >>confdefs.h <<\_ACEOF #define STATIC_BUILD 1 _ACEOF fi #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- # Step 0: Enable 64 bit support? echo "$as_me:$LINENO: checking if 64bit support is enabled" >&5 echo $ECHO_N "checking if 64bit support is enabled... $ECHO_C" >&6 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" do64bit=$enableval else do64bit=no fi; echo "$as_me:$LINENO: result: $do64bit" >&5 echo "${ECHO_T}$do64bit" >&6 # Step 0.b: Enable Solaris 64 bit VIS support? echo "$as_me:$LINENO: checking if 64bit Sparc VIS support is requested" >&5 echo $ECHO_N "checking if 64bit Sparc VIS support is requested... $ECHO_C" >&6 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" do64bitVIS=$enableval else do64bitVIS=no fi; echo "$as_me:$LINENO: result: $do64bitVIS" >&5 echo "${ECHO_T}$do64bitVIS" >&6 if test "$do64bitVIS" = "yes"; then # Force 64bit on with VIS do64bit=yes fi # Step 0.c: Cross-compiling options for Windows/CE builds? if test "${TEA_PLATFORM}" = "windows" ; then echo "$as_me:$LINENO: checking if Windows/CE build is requested" >&5 echo $ECHO_N "checking if Windows/CE build is requested... $ECHO_C" >&6 # Check whether --enable-wince or --disable-wince was given. if test "${enable_wince+set}" = set; then enableval="$enable_wince" doWince=$enableval else doWince=no fi; echo "$as_me:$LINENO: result: $doWince" >&5 echo "${ECHO_T}$doWince" >&6 fi # Step 1: set the variable "system" to hold the name and version number # for the system. This can usually be done via the "uname" command, but # there are a few systems, like Next, where this doesn't work. echo "$as_me:$LINENO: checking system version (for dynamic loading)" >&5 echo $ECHO_N "checking system version (for dynamic loading)... $ECHO_C" >&6 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else system=`uname -s`-`uname -r` if test "$?" -ne 0 ; then echo "$as_me:$LINENO: result: unknown (can't find uname command)" >&5 echo "${ECHO_T}unknown (can't find uname command)" >&6 system=unknown else # Special check for weird MP-RAS system (uname returns weird # results, and the version is kept in special file). if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then system=MP-RAS-`awk '{print }' /etc/.relid` fi if test "`uname -s`" = "AIX" ; then system=AIX-`uname -v`.`uname -r` fi if test "${TEA_PLATFORM}" = "windows" ; then system=windows fi echo "$as_me:$LINENO: result: $system" >&5 echo "${ECHO_T}$system" >&6 fi fi # Step 2: check for existence of -ldl library. This is needed because # Linux can use either -ldl or -ldld for dynamic loading. echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dlopen (); int main () { dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 if test $ac_cv_lib_dl_dlopen = yes; then have_dl=yes else have_dl=no fi # Step 3: set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case and CC_SEARCH_FLAGS becomes LD_SEARCH_FLAGS for us # (and we have no CC_SEARCH_FLAGS). do64bit_ok=no LDFLAGS_ORIG="$LDFLAGS" TCL_EXPORT_FILE_SUFFIX="" UNSHARED_LIB_SUFFIX="" TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g if test "$GCC" = "yes" ; then CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall -Wno-implicit-int" else CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" fi TCL_NEEDS_EXP_FILE=0 TCL_BUILD_EXP_FILE="" TCL_EXP_FILE="" # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:$LINENO: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" case $system in windows) # This is a 2-stage check to make sure we have the 64-bit SDK # We have to know where the SDK is installed. # This magic is based on MS Platform SDK for Win2003 SP1 - hobbs # MACHINE is IX86 for LINK, but this is used by the manifest, # which requires x86|amd64|ia64. MACHINE="X86" if test "$do64bit" != "no" ; then if test "x${MSSDK}x" = "xx" ; then MSSDK="C:/Progra~1/Microsoft Platform SDK" fi MSSDK=`echo "$MSSDK" | sed -e 's!\\\!/!g'` PATH64="" case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build PATH64="${MSSDK}/Bin/Win64/x86/AMD64" ;; ia64) MACHINE="IA64" PATH64="${MSSDK}/Bin/Win64" ;; esac if test ! -d "${PATH64}" ; then { echo "$as_me:$LINENO: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&5 echo "$as_me: WARNING: Could not find 64-bit $MACHINE SDK to enable 64bit mode" >&2;} { echo "$as_me:$LINENO: WARNING: Ensure latest Platform SDK is installed" >&5 echo "$as_me: WARNING: Ensure latest Platform SDK is installed" >&2;} do64bit="no" else echo "$as_me:$LINENO: result: Using 64-bit $MACHINE mode" >&5 echo "${ECHO_T} Using 64-bit $MACHINE mode" >&6 do64bit_ok="yes" fi fi if test "$doWince" != "no" ; then if test "$do64bit" != "no" ; then { { echo "$as_me:$LINENO: error: Windows/CE and 64-bit builds incompatible" >&5 echo "$as_me: error: Windows/CE and 64-bit builds incompatible" >&2;} { (exit 1); exit 1; }; } fi if test "$GCC" = "yes" ; then { { echo "$as_me:$LINENO: error: Windows/CE and GCC builds incompatible" >&5 echo "$as_me: error: Windows/CE and GCC builds incompatible" >&2;} { (exit 1); exit 1; }; } fi # First, look for one uninstalled. # the alternative search directory is invoked by --with-celib if test x"${no_celib}" = x ; then # we reset no_celib in case something fails here no_celib=true # Check whether --with-celib or --without-celib was given. if test "${with_celib+set}" = set; then withval="$with_celib" with_celibconfig=${withval} fi; echo "$as_me:$LINENO: checking for Windows/CE celib directory" >&5 echo $ECHO_N "checking for Windows/CE celib directory... $ECHO_C" >&6 if test "${ac_cv_c_celibconfig+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-celibconfig was specified. if test x"${with_celibconfig}" != x ; then if test -d "${with_celibconfig}/inc" ; then ac_cv_c_celibconfig=`(cd ${with_celibconfig}; pwd)` else { { echo "$as_me:$LINENO: error: ${with_celibconfig} directory doesn't contain inc directory" >&5 echo "$as_me: error: ${with_celibconfig} directory doesn't contain inc directory" >&2;} { (exit 1); exit 1; }; } fi fi # then check for a celib library if test x"${ac_cv_c_celibconfig}" = x ; then for i in \ ../celib-palm-3.0 \ ../celib \ ../../celib-palm-3.0 \ ../../celib \ `ls -dr ../celib-*3.[0-9]* 2>/dev/null` \ ${srcdir}/../celib-palm-3.0 \ ${srcdir}/../celib \ `ls -dr ${srcdir}/../celib-*3.[0-9]* 2>/dev/null` \ ; do if test -d "$i/inc" ; then ac_cv_c_celibconfig=`(cd $i; pwd)` break fi done fi fi if test x"${ac_cv_c_celibconfig}" = x ; then { { echo "$as_me:$LINENO: error: Cannot find celib support library directory" >&5 echo "$as_me: error: Cannot find celib support library directory" >&2;} { (exit 1); exit 1; }; } else no_celib= CELIB_DIR=${ac_cv_c_celibconfig} CELIB_DIR=`echo "$CELIB_DIR" | sed -e 's!\\\!/!g'` echo "$as_me:$LINENO: result: found $CELIB_DIR" >&5 echo "${ECHO_T}found $CELIB_DIR" >&6 fi fi # Set defaults for common evc4/PPC2003 setup # Currently Tcl requires 300+, possibly 420+ for sockets CEVERSION=420; # could be 211 300 301 400 420 ... TARGETCPU=ARMV4; # could be ARMV4 ARM MIPS SH3 X86 ... ARCH=ARM; # could be ARM MIPS X86EM ... PLATFORM="Pocket PC 2003"; # or "Pocket PC 2002" if test "$doWince" != "yes"; then # If !yes then the user specified something # Reset ARCH to allow user to skip specifying it ARCH= eval `echo $doWince | awk -F, '{ \ if (length($1)) { printf "CEVERSION=\"%s\"\n", $1; \ if ($1 < 400) { printf "PLATFORM=\"Pocket PC 2002\"\n" } }; \ if (length($2)) { printf "TARGETCPU=\"%s\"\n", toupper($2) }; \ if (length($3)) { printf "ARCH=\"%s\"\n", toupper($3) }; \ if (length($4)) { printf "PLATFORM=\"%s\"\n", $4 }; \ }'` if test "x${ARCH}" = "x" ; then ARCH=$TARGETCPU; fi fi OSVERSION=WCE$CEVERSION; if test "x${WCEROOT}" = "x" ; then WCEROOT="C:/Program Files/Microsoft eMbedded C++ 4.0" if test ! -d "${WCEROOT}" ; then WCEROOT="C:/Program Files/Microsoft eMbedded Tools" fi fi if test "x${SDKROOT}" = "x" ; then SDKROOT="C:/Program Files/Windows CE Tools" if test ! -d "${SDKROOT}" ; then SDKROOT="C:/Windows CE Tools" fi fi WCEROOT=`echo "$WCEROOT" | sed -e 's!\\\!/!g'` SDKROOT=`echo "$SDKROOT" | sed -e 's!\\\!/!g'` if test ! -d "${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" \ -o ! -d "${WCEROOT}/EVC/${OSVERSION}/bin"; then { { echo "$as_me:$LINENO: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&5 echo "$as_me: error: could not find PocketPC SDK or target compiler to enable WinCE mode $CEVERSION,$TARGETCPU,$ARCH,$PLATFORM" >&2;} { (exit 1); exit 1; }; } doWince="no" else # We could PATH_NOSPACE these, but that's not important, # as long as we quote them when used. CEINCLUDE="${SDKROOT}/${OSVERSION}/${PLATFORM}/include" if test -d "${CEINCLUDE}/${TARGETCPU}" ; then CEINCLUDE="${CEINCLUDE}/${TARGETCPU}" fi CELIBPATH="${SDKROOT}/${OSVERSION}/${PLATFORM}/Lib/${TARGETCPU}" fi fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi if test "$do64bit" != "no" ; then # All this magic is necessary for the Win64 SDK RC1 - hobbs CC="\"${PATH64}/cl.exe\"" CFLAGS="${CFLAGS} -I\"${MSSDK}/Include\" -I\"${MSSDK}/Include/crt\" -I\"${MSSDK}/Include/crt/sys\"" RC="\"${MSSDK}/bin/rc.exe\"" lflags="-nologo -MACHINE:${MACHINE} -LIBPATH:\"${MSSDK}/Lib/${MACHINE}\"" LINKBIN="\"${PATH64}/link.exe\"" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 vars="bufferoverflowU.lib" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done elif test "$doWince" != "no" ; then CEBINROOT="${WCEROOT}/EVC/${OSVERSION}/bin" if test "${TARGETCPU}" = "X86"; then CC="\"${CEBINROOT}/cl.exe\"" else CC="\"${CEBINROOT}/cl${ARCH}.exe\"" fi CFLAGS="$CFLAGS -I\"${CELIB_DIR}/inc\" -I\"${CEINCLUDE}\"" RC="\"${WCEROOT}/Common/EVC/bin/rc.exe\"" arch=`echo ${ARCH} | awk '{print tolower($0)}'` defs="${ARCH} _${ARCH}_ ${arch} PALM_SIZE _MT _WINDOWS" if test "${SHARED_BUILD}" = "1" ; then # Static CE builds require static celib as well defs="${defs} _DLL" fi for i in $defs ; do cat >>confdefs.h <<_ACEOF #define $i 1 _ACEOF done cat >>confdefs.h <<_ACEOF #define _WIN32_WCE $CEVERSION _ACEOF cat >>confdefs.h <<_ACEOF #define UNDER_CE $CEVERSION _ACEOF CFLAGS_DEBUG="-nologo -Zi -Od" CFLAGS_OPTIMIZE="-nologo -Ox" lversion=`echo ${CEVERSION} | sed -e 's/\(.\)\(..\)/\1\.\2/'` lflags="-MACHINE:${ARCH} -LIBPATH:\"${CELIBPATH}\" -subsystem:windowsce,${lversion} -nologo" LINKBIN="\"${CEBINROOT}/link.exe\"" else RC="rc" lflags="-nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode RC="windres" CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2" SHLIB_LD="$CXX -shared" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # This essentially turns it all on. LDFLAGS_DEBUG="-debug:full -debugtype:both -warn:2" LDFLAGS_OPTIMIZE="-release" if test "$doWince" != "no" ; then LDFLAGS_CONSOLE="-link ${lflags}" LDFLAGS_WINDOW=${LDFLAGS_CONSOLE} else LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots # Bogus to avoid getting this turned off DL_OBJS="tclLoadNone.obj" ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r) # ok ... ;; *) CC=${CC}_r ;; esac echo "$as_me:$LINENO: result: Using $CC for compiling with threads" >&5 echo "${ECHO_T}Using $CC for compiling with threads" >&6 fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadDl.o" LD_LIBRARY_PATH_VAR="LIBPATH" # AIX v<=4.1 has some different flags than 4.2+ if test "$system" = "AIX-4.1" -o "`uname -v`" -lt "4" ; then #LIBOBJS="$LIBOBJS tclLoadAix.o" case $LIBOBJS in "tclLoadAix.$ac_objext" | \ *" tclLoadAix.$ac_objext" | \ "tclLoadAix.$ac_objext "* | \ *" tclLoadAix.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS tclLoadAix.$ac_objext" ;; esac DL_LIBS="-lld" fi # Check to enable 64-bit flags for compiler/linker on AIX 4+ if test "$do64bit" = "yes" -a "`uname -v`" -gt "3" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: \"64bit mode not supported with GCC on $system\"" >&5 echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS="$LDFLAGS -q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" fi fi if test "`uname -m`" = "ia64" ; then # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" # AIX-5 has dl* in libc.so DL_LIBS="" if test "$GCC" = "yes" ; then LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else LD_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' fi else if test "$GCC" = "yes" ; then SHLIB_LD="$CXX -shared" else SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" fi SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix ${SHLIB_LD} ${SHLIB_LD_FLAGS}" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' TCL_NEEDS_EXP_FILE=1 TCL_EXPORT_FILE_SUFFIX='${PACKAGE_VERSION}.exp' fi # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to # insure proper sequencing, is to add it to the tail of MATH_LIBS. # This library also supplies gettimeofday. # # AIX does not have a timezone field in struct tm. When the AIX # bsd library is used, the timezone global and the gettimeofday # methods are to be avoided for timezone deduction instead, we # deduce the timezone by comparing the localtime result on a # known GMT value. echo "$as_me:$LINENO: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char gettimeofday (); int main () { gettimeofday (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gettimeofday=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then libbsd=yes else libbsd=no fi if test $libbsd = yes; then MATH_LIBS="$MATH_LIBS -lbsd" cat >>confdefs.h <<\_ACEOF #define USE_DELTA_FOR_TZ 1 _ACEOF fi ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD="${CXX} -nostart" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD="$CXX -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -export-dynamic" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; HP-UX-*.11.*) # Use updated header definitions where possible cat >>confdefs.h <<\_ACEOF #define _XOPEN_SOURCE_EXTENDED 1 _ACEOF SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" LD_SEARCH_FLAGS='+s +b ${LIB_RUNTIME_DIR}:.' LD_LIBRARY_PATH_VAR="SHLIB_PATH" fi if test "$GCC" = "yes" ; then SHLIB_LD="$CXX -shared -fPIC" SHLIB_LD_LIBS='${LIBS}' LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi # Users may want PA-RISC 1.1/2.0 portable code - needs HP cc #CFLAGS="$CFLAGS +DAportable" # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then hpux_arch=`${CC} -dumpmachine` case $hpux_arch in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD="${CXX} -shared -fPIC" SHLIB_LD_LIBS='${LIBS}' ;; *) { echo "$as_me:$LINENO: WARNING: \"64bit mode not supported with GCC on $system\"" >&5 echo "$as_me: WARNING: \"64bit mode not supported with GCC on $system\"" >&2;} ;; esac else do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS="$LDFLAGS +DD64" fi fi ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char shl_load (); int main () { shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 if test $ac_cv_lib_dld_shl_load = yes; then tcl_ok=yes else tcl_ok=no fi if test "$tcl_ok" = yes; then SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" DL_OBJS="tclLoadShl.o" DL_LIBS="-ldld" LDFLAGS="$LDFLAGS -Wl,-E" LD_SEARCH_FLAGS='-Wl,+s,+b,${LIB_RUNTIME_DIR}:.' fi LD_LIBRARY_PATH_VAR="SHLIB_PATH" ;; IRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' ;; IRIX-6.*|IRIX64-6.5*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" else case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" fi ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported by gcc" >&5 echo "$as_me: WARNING: 64bit mode not supported by gcc" >&2;} else do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS="$LDFLAGS -64" fi fi ;; Linux*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE="-O2" # egcs-2.91.66 on Redhat Linux 6.0 generates lots of warnings # when you inline the string and math operations. Turn this off to # get rid of the warnings. #CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES" if test "$have_dl" = yes; then SHLIB_LD="${CXX} -shared" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' else if test "${ac_cv_header_dld_h+set}" = set; then echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dld.h usability" >&5 echo $ECHO_N "checking dld.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dld.h presence" >&5 echo $ECHO_N "checking dld.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dld.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dld.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dld.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dld.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dld.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dld_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 fi if test $ac_cv_header_dld_h = yes; then SHLIB_LD="ld -shared" DL_OBJS="tclLoadDld.o" DL_LIBS="-ldld" LD_SEARCH_FLAGS="" fi fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi # The combo of gcc + glibc has a bug related # to inlining of functions like strtod(). The # -fno-builtin flag should address this problem # but it does not work. The -fno-inline flag # is kind of overkill but it works. # Disable inlining only when one of the # files in compat/*.c is being linked in. if test x"${USE_COMPAT}" != x ; then CFLAGS="$CFLAGS -fno-inline" fi ;; GNU*) SHLIB_CFLAGS="-fPIC" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" if test "$have_dl" = yes; then SHLIB_LD="${CXX} -shared" DL_OBJS="" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,--export-dynamic" LD_SEARCH_FLAGS="" else if test "${ac_cv_header_dld_h+set}" = set; then echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dld.h usability" >&5 echo $ECHO_N "checking dld.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dld.h presence" >&5 echo $ECHO_N "checking dld.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dld.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dld.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dld.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dld.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dld.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dld.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dld.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dld.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dld.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dld.h" >&5 echo $ECHO_N "checking for dld.h... $ECHO_C" >&6 if test "${ac_cv_header_dld_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dld_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dld_h" >&5 echo "${ECHO_T}$ac_cv_header_dld_h" >&6 fi if test $ac_cv_header_dld_h = yes; then SHLIB_LD="ld -shared" DL_OBJS="" DL_LIBS="-ldld" LD_SEARCH_FLAGS="" fi fi if test "`uname -m`" = "alpha" ; then CFLAGS="$CFLAGS -mieee" fi ;; MP-RAS-02*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; MP-RAS-*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LDFLAGS="$LDFLAGS -Wl,-Bexport" LD_SEARCH_FLAGS="" ;; NetBSD-*|FreeBSD-[1-2].*) # Not available on all versions: check for include file. if test "${ac_cv_header_dlfcn_h+set}" = set; then echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking dlfcn.h usability" >&5 echo $ECHO_N "checking dlfcn.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? echo "$as_me:$LINENO: checking dlfcn.h presence" >&5 echo $ECHO_N "checking dlfcn.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: dlfcn.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: dlfcn.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: dlfcn.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: dlfcn.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: dlfcn.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: dlfcn.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: dlfcn.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: dlfcn.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ---------------------------------- ## ## Report this to the tclutil lists. ## ## ---------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac echo "$as_me:$LINENO: checking for dlfcn.h" >&5 echo $ECHO_N "checking for dlfcn.h... $ECHO_C" >&6 if test "${ac_cv_header_dlfcn_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_dlfcn_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_dlfcn_h" >&5 echo "${ECHO_T}$ac_cv_header_dlfcn_h" >&6 fi if test $ac_cv_header_dlfcn_h = yes; then # NetBSD/SPARC needs -fPIC, -fpic will not do. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi rm -f conftest* else SHLIB_CFLAGS="" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' fi # FreeBSD doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; OpenBSD-*) SHLIB_LD="${CXX} -shared" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" echo "$as_me:$LINENO: checking for ELF" >&5 echo $ECHO_N "checking for ELF... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __ELF__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' fi rm -f conftest* # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; FreeBSD-*) # FreeBSD 3.* and greater have ELF. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LDFLAGS="$LDFLAGS -export-dynamic" LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' if test "${TCL_THREADS}" = "1" ; then # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" fi case $system in FreeBSD-3.*) # FreeBSD-3 doesn't handle version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so' TCL_LIB_VERSIONS_OK=nodots ;; esac ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" if test $do64bit = yes; then do64bit_ok=yes CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" fi SHLIB_LD='${CXX} -dynamiclib ${CFLAGS} ${LDFLAGS}' echo "$as_me:$LINENO: checking if ld accepts -single_module flag" >&5 echo $ECHO_N "checking if ld accepts -single_module flag... $ECHO_C" >&6 if test "${tcl_cv_ld_single_module+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -dynamiclib -Wl,-single_module" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_single_module=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_single_module=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_single_module" >&5 echo "${ECHO_T}$tcl_cv_ld_single_module" >&6 if test $tcl_cv_ld_single_module = yes; then SHLIB_LD="${SHLIB_LD} -Wl,-single_module" fi SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".dylib" DL_OBJS="tclLoadDyld.o" DL_LIBS="" # Don't use -prebind when building for Mac OS X 10.4 or later only: test -z "${MACOSX_DEPLOYMENT_TARGET}" || \ test "`echo "${MACOSX_DEPLOYMENT_TARGET}" | awk -F. '{print $2}'`" -lt 4 && \ LDFLAGS="$LDFLAGS -prebind" LDFLAGS="$LDFLAGS -headerpad_max_install_names" echo "$as_me:$LINENO: checking if ld accepts -search_paths_first flag" >&5 echo $ECHO_N "checking if ld accepts -search_paths_first flag... $ECHO_C" >&6 if test "${tcl_cv_ld_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_ld_search_paths_first=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_ld_search_paths_first=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$hold_ldflags fi echo "$as_me:$LINENO: result: $tcl_cv_ld_search_paths_first" >&5 echo "${ECHO_T}$tcl_cv_ld_search_paths_first" >&6 if test $tcl_cv_ld_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" ;; NEXTSTEP-*) SHLIB_CFLAGS="" SHLIB_LD="$CXX -nostdlib -r" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadNext.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy cat >>confdefs.h <<\_ACEOF #define _OE_SOCKETS 1 _ACEOF ;; OSF1-1.0|OSF1-1.1|OSF1-1.2) # OSF/1 1.[012] from OSF, and derivatives, including Paragon OSF/1 SHLIB_CFLAGS="" # Hack: make package name same as library name SHLIB_LD='ld -R -export :' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadOSF.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OSF1-1.*) # OSF/1 1.3 from OSF using ELF, and derivatives, including AD2 SHLIB_CFLAGS="-fPIC" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD="ld -shared" else SHLIB_LD="ld -non_shared" fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" if test "$SHARED_BUILD" = "1" ; then SHLIB_LD='ld -shared -expect_unresolved "*"' else SHLIB_LD='ld -non_shared -expect_unresolved "*"' fi SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' if test "$GCC" = "yes" ; then CFLAGS="$CFLAGS -mieee" else CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` if test "$GCC" = "yes" ; then LIBS="$LIBS -lpthread -lmach -lexc" else CFLAGS="$CFLAGS -pthread" # PWD: don't need this. #LDFLAGS="$LDFLAGS -pthread" fi fi ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" # dlopen is in -lc on QNX DL_LIBS="" LD_SEARCH_FLAGS="" ;; RISCos-*) SHLIB_CFLAGS="-G 0" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".a" DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' ;; SCO_SV-3.2*) # Note, dlopen is available only on SCO 3.2.5 and greater. However, # this test works, since "uname -s" was non-standard in 3.2.4 and # below. if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" else SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" fi SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="" LD_SEARCH_FLAGS="" ;; SINIX*5.4*) SHLIB_CFLAGS="-K PIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS="" ;; SunOS-4*) SHLIB_CFLAGS="-PIC" SHLIB_LD="ld" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' # SunOS can't handle version numbers with dots in them in library # specs, like -ltcl7.5, so use -ltcl75 instead. Also, it # requires an extra version number at the end of .so file names. # So, the library has to have a name like libtcl75.so.1.0 SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so.1.0' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; SunOS-5.[0-6]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC" SHLIB_LD="$CXX -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' else SHLIB_LD="$CXX -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' SHLIB_CFLAGS="-KPIC" fi ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. cat >>confdefs.h <<\_ACEOF #define _REENTRANT 1 _ACEOF cat >>confdefs.h <<\_ACEOF #define _POSIX_PTHREAD_SEMANTICS 1 _ACEOF # Check to enable 64-bit flags for compiler/linker if test "$do64bit" = "yes" ; then arch=`isainfo` if test "$arch" = "sparcv9 sparc" ; then if test "$GCC" = "yes" ; then if test "`gcc -dumpversion` | awk -F. '{print }'" -lt "3" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC < 3.2 on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" fi else do64bit_ok=yes if test "$do64bitVIS" = "yes" ; then CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS="$LDFLAGS -xarch=v9a" else CFLAGS="$CFLAGS -xarch=v9" LDFLAGS="$LDFLAGS -xarch=v9" fi # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" fi elif test "$arch" = "amd64 i386" ; then if test "$GCC" = "yes" ; then { echo "$as_me:$LINENO: WARNING: 64bit mode not supported with GCC on $system" >&5 echo "$as_me: WARNING: 64bit mode not supported with GCC on $system" >&2;} else do64bit_ok=yes CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64" fi else { echo "$as_me:$LINENO: WARNING: 64bit mode not supported for $arch" >&5 echo "$as_me: WARNING: 64bit mode not supported for $arch" >&2;} fi fi # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" if test "$GCC" = "yes" ; then SHLIB_CFLAGS="-fPIC" SHLIB_LD="$CXX -shared" LD_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' if test "$do64bit" = "yes" ; then # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #LD_SEARCH_FLAGS="${LD_SEARCH_FLAGS},-R,$v9gcclibdir" fi else SHLIB_CFLAGS="-KPIC" SHLIB_LD="$CXX -G -z text" LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' fi ;; ULTRIX-4.*) SHLIB_CFLAGS="-G 0" SHLIB_SUFFIX=".a" SHLIB_LD="echo tclLdAout $CC \{$SHLIB_CFLAGS\} | `pwd`/tclsh -r -G 0" SHLIB_LD_LIBS='${LIBS}' DL_OBJS="tclLoadAout.o" DL_LIBS="" LDFLAGS="$LDFLAGS -Wl,-D,08000000" LD_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' if test "$GCC" != "yes" ; then CFLAGS="$CFLAGS -DHAVE_TZSET -std1" fi ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD="$CXX -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" DL_LIBS="-ldl" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. hold_ldflags=$LDFLAGS echo "$as_me:$LINENO: checking for ld accepts -Bexport flag" >&5 echo $ECHO_N "checking for ld accepts -Bexport flag... $ECHO_C" >&6 LDFLAGS="$LDFLAGS -Wl,-Bexport" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then found=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LDFLAGS=$hold_ldflags found=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext echo "$as_me:$LINENO: result: $found" >&5 echo "${ECHO_T}$found" >&6 LD_SEARCH_FLAGS="" ;; esac if test "$do64bit" != "no" -a "$do64bit_ok" = "no" ; then { echo "$as_me:$LINENO: WARNING: 64bit support being disabled -- don't know magic for this platform" >&5 echo "$as_me: WARNING: 64bit support being disabled -- don't know magic for this platform" >&2;} fi # Step 4: If pseudo-static linking is in use (see K. B. Kenny, "Dynamic # Loading for Tcl -- What Became of It?". Proc. 2nd Tcl/Tk Workshop, # New Orleans, LA, Computerized Processes Unlimited, 1994), then we need # to determine which of several header files defines the a.out file # format (a.out.h, sys/exec.h, or sys/exec_aout.h). At present, we # support only a file format that is more or less version-7-compatible. # In particular, # - a.out files must begin with `struct exec'. # - the N_TXTOFF on the `struct exec' must compute the seek address # of the text segment # - The `struct exec' must contain a_magic, a_text, a_data, a_bss # and a_entry fields. # The following compilation should succeed if and only if either sys/exec.h # or a.out.h is usable for the purpose. # # Note that the modified COFF format used on MIPS Ultrix 4.x is usable; the # `struct exec' includes a second header that contains information that # duplicates the v7 fields that are needed. if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo "$as_me:$LINENO: checking sys/exec.h" >&5 echo $ECHO_N "checking sys/exec.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_SYS_EXEC_H 1 _ACEOF else echo "$as_me:$LINENO: checking a.out.h" >&5 echo $ECHO_N "checking a.out.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_magic == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_A_OUT_H 1 _ACEOF else echo "$as_me:$LINENO: checking sys/exec_aout.h" >&5 echo $ECHO_N "checking sys/exec_aout.h... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct exec foo; unsigned long seek; int flag; #if defined(__mips) || defined(mips) seek = N_TXTOFF (foo.ex_f, foo.ex_o); #else seek = N_TXTOFF (foo); #endif flag = (foo.a_midmag == OMAGIC); return foo.a_text + foo.a_data + foo.a_bss + foo.a_entry; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_ok=usable else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_ok=unusable fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: result: $tcl_ok" >&5 echo "${ECHO_T}$tcl_ok" >&6 if test $tcl_ok = usable; then cat >>confdefs.h <<\_ACEOF #define USE_SYS_EXEC_AOUT_H 1 _ACEOF else DL_OBJS="" fi fi fi fi # Step 5: disable dynamic loading if requested via a command-line switch. # Check whether --enable-load or --disable-load was given. if test "${enable_load+set}" = set; then enableval="$enable_load" tcl_ok=$enableval else tcl_ok=yes fi; if test "$tcl_ok" = "no"; then DL_OBJS="" fi if test "x$DL_OBJS" != "x" ; then BUILD_DLTEST="\$(DLTEST_TARGETS)" else echo "Can't figure out how to do dynamic loading or shared libraries" echo "on this system." SHLIB_CFLAGS="" SHLIB_LD="" SHLIB_SUFFIX="" DL_OBJS="tclLoadNone.o" DL_LIBS="" LDFLAGS="$LDFLAGS_ORIG" LD_SEARCH_FLAGS="" BUILD_DLTEST="" fi # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. if test "$DL_OBJS" != "tclLoadNone.o" ; then if test "$GCC" = "yes" ; then case $system in AIX-*) ;; BSD/OS*) ;; IRIX*) ;; NetBSD-*|FreeBSD-*) ;; Darwin-*) ;; RISCos-*) ;; SCO_SV-3.2*) ;; ULTRIX-4.*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac fi fi if test "$SHARED_LIB_SUFFIX" = "" ; then SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}' fi if test "$UNSHARED_LIB_SUFFIX" = "" ; then UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a' fi # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary echo "$as_me:$LINENO: checking for required early compiler flags" >&5 echo $ECHO_N "checking for required early compiler flags... $ECHO_C" >&6 tcl_flags="" if test "${tcl_cv_flag__isoc99_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _ISOC99_SOURCE 1 #include int main () { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__isoc99_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__isoc99_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__isoc99_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _ISOC99_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _ISOC99_SOURCE" fi if test "${tcl_cv_flag__largefile64_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=no else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _LARGEFILE64_SOURCE 1 #include int main () { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_flag__largefile64_source=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_flag__largefile64_source=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_flag__largefile64_source}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define _LARGEFILE64_SOURCE 1 _ACEOF tcl_flags="$tcl_flags _LARGEFILE64_SOURCE" fi if test "x${tcl_flags}" = "x" ; then echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6 else echo "$as_me:$LINENO: result: ${tcl_flags}" >&5 echo "${ECHO_T}${tcl_flags}" >&6 fi echo "$as_me:$LINENO: checking for 64-bit integer type" >&5 echo $ECHO_N "checking for 64-bit integer type... $ECHO_C" >&6 if test "${tcl_cv_type_64bit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { __int64 value = (__int64) 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_type_64bit=__int64 else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_type_64bit="long long" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # See if we should use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; } ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_64bit=${tcl_type_64bit} else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "${tcl_cv_type_64bit}" = none ; then cat >>confdefs.h <<\_ACEOF #define TCL_WIDE_INT_IS_LONG 1 _ACEOF echo "$as_me:$LINENO: result: using long" >&5 echo "${ECHO_T}using long" >&6 elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # We actually want to use the default tcl.h checks in this # case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* echo "$as_me:$LINENO: result: using Tcl header defaults" >&5 echo "${ECHO_T}using Tcl header defaults" >&6 else cat >>confdefs.h <<_ACEOF #define TCL_WIDE_INT_TYPE ${tcl_cv_type_64bit} _ACEOF echo "$as_me:$LINENO: result: ${tcl_cv_type_64bit}" >&5 echo "${ECHO_T}${tcl_cv_type_64bit}" >&6 # Now check for auxiliary declarations echo "$as_me:$LINENO: checking for struct dirent64" >&5 echo $ECHO_N "checking for struct dirent64... $ECHO_C" >&6 if test "${tcl_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { struct dirent64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_dirent64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_dirent64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_DIRENT64 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_struct_dirent64}" >&5 echo "${ECHO_T}${tcl_cv_struct_dirent64}" >&6 echo "$as_me:$LINENO: checking for struct stat64" >&5 echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6 if test "${tcl_cv_struct_stat64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { struct stat64 p; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_struct_stat64=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_struct_stat64=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_struct_stat64}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_STRUCT_STAT64 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_struct_stat64}" >&5 echo "${ECHO_T}${tcl_cv_struct_stat64}" >&6 echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 if test "${tcl_cv_type_off64_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { off64_t offset; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then tcl_cv_type_off64_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 tcl_cv_type_off64_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi if test "x${tcl_cv_type_off64_t}" = "xyes" ; then cat >>confdefs.h <<\_ACEOF #define HAVE_TYPE_OFF64_T 1 _ACEOF fi echo "$as_me:$LINENO: result: ${tcl_cv_type_off64_t}" >&5 echo "${ECHO_T}${tcl_cv_type_off64_t}" >&6 fi #----------------------------------------------------------------------- # Find -lBLT library (needs variable set indirectly by TEA_CONFIG_CFLAGS: SHLIB_SUFFIX) echo "$as_me:$LINENO: checking for BLT library" >&5 echo $ECHO_N "checking for BLT library... $ECHO_C" >&6 # Check whether --with-blt or --without-blt was given. if test "${with_blt+set}" = set; then withval="$with_blt" BLT_LIB_DIR=$withval fi; BLT_LIBNAME=libBLT25${SHLIB_SUFFIX} BLT_LIBFLAG="-lBLT25" if test -z "$BLT_LIB_DIR" ; then # If --with-blt=dir was not specified, try the Tcl lib dir and the exec-prefix/lib dir places="\ $TCL_BIN_DIR \ $TCL_BIN_DIR/blt2.4 \ $TCLTK_ROOT/lib \ $TCLTK_ROOT/lib/blt2.4 \ $exec_prefix/lib \ $exec_prefix/lib/blt2.4 \ $prefix/lib \ $prefix/lib/blt2.4 \ " for i in $places ; do if test -f $i/$BLT_LIBNAME then BLT_LIB_DIR=$i break fi done if test -z "$BLT_LIB_DIR" ; then echo { { echo "$as_me:$LINENO: error: could not find $BLT_LIBNAME: Please use the --with-blt=DIR option." >&5 echo "$as_me: error: could not find $BLT_LIBNAME: Please use the --with-blt=DIR option." >&2;} { (exit 1); exit 1; }; } fi else # Check if the BLT library is in the lib subdir of the given dir if test ! -f $BLT_LIB_DIR/$BLT_LIBNAME then if test ! -f $BLT_LIB_DIR/lib/$BLT_LIBNAME then echo { { echo "$as_me:$LINENO: error: could not find $BLT_LIBNAME in $BLT_LIB_DIR or in $BLT_LIB_DIR/lib: Please use the --with-blt=DIR option." >&5 echo "$as_me: error: could not find $BLT_LIBNAME in $BLT_LIB_DIR or in $BLT_LIB_DIR/lib: Please use the --with-blt=DIR option." >&2;} { (exit 1); exit 1; }; } else BLT_LIB_DIR=$BLT_LIB_DIR/lib fi fi fi BLT_LIB_SPEC="-L$BLT_LIB_DIR $BLT_LIBFLAG" echo "$as_me:$LINENO: result: $BLT_LIB_DIR" >&5 echo "${ECHO_T}$BLT_LIB_DIR" >&6 vars="${BLT_LIB_SPEC}" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([^-].*\)\.lib$/-l\1/i'` fi PKG_LIBS="$PKG_LIBS $i" done #----------------------------------------------------------------------- #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- DBGX="" echo "$as_me:$LINENO: checking for build with symbols" >&5 echo $ECHO_N "checking for build with symbols... $ECHO_C" >&6 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" tcl_ok=$enableval else tcl_ok=no fi; if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE}" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then echo "$as_me:$LINENO: result: yes (standard debugging)" >&5 echo "${ECHO_T}yes (standard debugging)" >&6 fi fi if test "${TEA_PLATFORM}" != "windows" ; then LDFLAGS_DEFAULT="${LDFLAGS}" fi if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then cat >>confdefs.h <<\_ACEOF #define TCL_MEM_DEBUG 1 _ACEOF fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then echo "$as_me:$LINENO: result: enabled symbols mem debugging" >&5 echo "${ECHO_T}enabled symbols mem debugging" >&6 else echo "$as_me:$LINENO: result: enabled $tcl_ok debugging" >&5 echo "${ECHO_T}enabled $tcl_ok debugging" >&6 fi fi #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- # allan: can't use stubs, due to BLT dependency #AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${SHLIB_LD_LIBS} \${LDFLAGS_DEFAULT} -out:\$@ \$(PKG_OBJECTS)" MAKE_STUB_LIB="\${STLIB_LD} -out:\$@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \$@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} -o \$@ \$(PKG_OBJECTS) \${LDFLAGS_DEFAULT} \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \$@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_LIB_FILE}`\"" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_LIB_FILE}`\"" fi eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else eval eval "PKG_LIB_FILE=${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "PKG_STUB_LIB_FILE=${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_LIB_SPEC}" fi eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE=lib${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build there own stubs libraries eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- echo "$as_me:$LINENO: checking for tclsh" >&5 echo $ECHO_N "checking for tclsh... $ECHO_C" >&6 if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${TCL_DBGX}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}${TCL_DBGX}" fi list="`ls -d ${TCL_PREFIX}/bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}/${TCLSH_PROG}" fi echo "$as_me:$LINENO: result: ${TCLSH_PROG}" >&5 echo "${ECHO_T}${TCLSH_PROG}" >&6 echo "$as_me:$LINENO: checking for wish" >&5 echo $ECHO_N "checking for wish... $ECHO_C" >&6 if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="${TK_BIN_DIR}/wish" fi else # tkConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${TK_DBGX}${EXEEXT}" else WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}${TK_DBGX}" fi list="`ls -d ${TK_PREFIX}/bin 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../bin 2>/dev/null`" for i in $list ; do if test -f "$i/${WISH_PROG}" ; then REAL_TK_BIN_DIR="`cd "$i"; pwd`" break fi done WISH_PROG="${REAL_TK_BIN_DIR}/${WISH_PROG}" fi echo "$as_me:$LINENO: result: ${WISH_PROG}" >&5 echo "${ECHO_T}${WISH_PROG}" >&6 #-------------------------------------------------------------------- # These are for tclutilConfig.sh #-------------------------------------------------------------------- tclutil_LIB_FILE=${PKG_LIB_FILE} eval pkglibdir="${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval tclutil_LIB_FLAG="-ltclutil${PACKAGE_VERSION}" else eval tclutil_LIB_FLAG="-ltclutil`echo ${PACKAGE_VERSION} | tr -d .`" fi tclutil_BUILD_DIR="`pwd`" tclutil_BUILD_LIB_SPEC="-L`pwd` ${tclutil_LIB_FLAG}" tclutil_LIB_SPEC="-L${pkglibdir} ${tclutil_LIB_FLAG}" for i in ${PKG_OBJECTS} ; do tclutil_PKG_OBJECTS="$tclutil_PKG_OBJECTS ../tclutil/$i" done # tclutil_SRC_DIR must be a fully qualified path eval tclutil_SRC_DIR="$srcdir" tclutil_SRC_DIR=`cd "${tclutil_SRC_DIR}"; pwd` #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- ac_config_files="$ac_config_files Makefile pkgIndex.tcl tclutilConfig.sh tclutil.sh tclutil_version.tcl" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by tclutil $as_me 2.1.0, which was generated by Starlink Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ tclutil config.status 2.1.0 configured by $0, generated by Starlink Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "pkgIndex.tcl" ) CONFIG_FILES="$CONFIG_FILES pkgIndex.tcl" ;; "tclutilConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tclutilConfig.sh" ;; "tclutil.sh" ) CONFIG_FILES="$CONFIG_FILES tclutil.sh" ;; "tclutil_version.tcl" ) CONFIG_FILES="$CONFIG_FILES tclutil_version.tcl" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@CYGPATH@,$CYGPATH,;t t s,@EXEEXT@,$EXEEXT,;t t s,@PKG_LIB_FILE@,$PKG_LIB_FILE,;t t s,@PKG_STUB_LIB_FILE@,$PKG_STUB_LIB_FILE,;t t s,@PKG_STUB_SOURCES@,$PKG_STUB_SOURCES,;t t s,@PKG_STUB_OBJECTS@,$PKG_STUB_OBJECTS,;t t s,@PKG_TCL_SOURCES@,$PKG_TCL_SOURCES,;t t s,@PKG_HEADERS@,$PKG_HEADERS,;t t s,@PKG_INCLUDES@,$PKG_INCLUDES,;t t s,@PKG_LIBS@,$PKG_LIBS,;t t s,@PKG_CFLAGS@,$PKG_CFLAGS,;t t s,@TCL_VERSION@,$TCL_VERSION,;t t s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t s,@TCL_LIBS@,$TCL_LIBS,;t t s,@TCL_DEFS@,$TCL_DEFS,;t t s,@TCL_EXTRA_CFLAGS@,$TCL_EXTRA_CFLAGS,;t t s,@TCL_LD_FLAGS@,$TCL_LD_FLAGS,;t t s,@TCL_SHLIB_LD_LIBS@,$TCL_SHLIB_LD_LIBS,;t t s,@TK_VERSION@,$TK_VERSION,;t t s,@TK_BIN_DIR@,$TK_BIN_DIR,;t t s,@TK_SRC_DIR@,$TK_SRC_DIR,;t t s,@TK_LIB_FILE@,$TK_LIB_FILE,;t t s,@TK_LIB_FLAG@,$TK_LIB_FLAG,;t t s,@TK_LIB_SPEC@,$TK_LIB_SPEC,;t t s,@TK_STUB_LIB_FILE@,$TK_STUB_LIB_FILE,;t t s,@TK_STUB_LIB_FLAG@,$TK_STUB_LIB_FLAG,;t t s,@TK_STUB_LIB_SPEC@,$TK_STUB_LIB_SPEC,;t t s,@TK_LIBS@,$TK_LIBS,;t t s,@TK_XINCLUDES@,$TK_XINCLUDES,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@OBJEXT@,$OBJEXT,;t t s,@CPP@,$CPP,;t t s,@CXX@,$CXX,;t t s,@CXXFLAGS@,$CXXFLAGS,;t t s,@ac_ct_CXX@,$ac_ct_CXX,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@SET_MAKE@,$SET_MAKE,;t t s,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@EGREP@,$EGREP,;t t s,@MATH_LIBS@,$MATH_LIBS,;t t s,@SHLIB_LD_CXX_LIBS@,$SHLIB_LD_CXX_LIBS,;t t s,@PKG_SOURCES@,$PKG_SOURCES,;t t s,@PKG_OBJECTS@,$PKG_OBJECTS,;t t s,@CLEANFILES@,$CLEANFILES,;t t s,@TCL_INCLUDES@,$TCL_INCLUDES,;t t s,@TK_INCLUDES@,$TK_INCLUDES,;t t s,@TCL_THREADS@,$TCL_THREADS,;t t s,@SHARED_BUILD@,$SHARED_BUILD,;t t s,@AR@,$AR,;t t s,@CELIB_DIR@,$CELIB_DIR,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@SHLIB_SUFFIX@,$SHLIB_SUFFIX,;t t s,@DL_LIBS@,$DL_LIBS,;t t s,@CFLAGS_DEBUG@,$CFLAGS_DEBUG,;t t s,@CFLAGS_OPTIMIZE@,$CFLAGS_OPTIMIZE,;t t s,@CFLAGS_WARNING@,$CFLAGS_WARNING,;t t s,@STLIB_LD@,$STLIB_LD,;t t s,@SHLIB_LD@,$SHLIB_LD,;t t s,@SHLIB_CFLAGS@,$SHLIB_CFLAGS,;t t s,@SHLIB_LD_LIBS@,$SHLIB_LD_LIBS,;t t s,@LDFLAGS_DEBUG@,$LDFLAGS_DEBUG,;t t s,@LDFLAGS_OPTIMIZE@,$LDFLAGS_OPTIMIZE,;t t s,@LD_LIBRARY_PATH_VAR@,$LD_LIBRARY_PATH_VAR,;t t s,@BLT_LIB_DIR@,$BLT_LIB_DIR,;t t s,@BLT_LIB_SPEC@,$BLT_LIB_SPEC,;t t s,@TCL_DBGX@,$TCL_DBGX,;t t s,@CFLAGS_DEFAULT@,$CFLAGS_DEFAULT,;t t s,@LDFLAGS_DEFAULT@,$LDFLAGS_DEFAULT,;t t s,@MAKE_LIB@,$MAKE_LIB,;t t s,@MAKE_SHARED_LIB@,$MAKE_SHARED_LIB,;t t s,@MAKE_STATIC_LIB@,$MAKE_STATIC_LIB,;t t s,@MAKE_STUB_LIB@,$MAKE_STUB_LIB,;t t s,@RANLIB_STUB@,$RANLIB_STUB,;t t s,@TCLSH_PROG@,$TCLSH_PROG,;t t s,@WISH_PROG@,$WISH_PROG,;t t s,@tclutil_LIB_FILE@,$tclutil_LIB_FILE,;t t s,@tclutil_BUILD_DIR@,$tclutil_BUILD_DIR,;t t s,@tclutil_BUILD_LIB_SPEC@,$tclutil_BUILD_LIB_SPEC,;t t s,@tclutil_LIB_SPEC@,$tclutil_LIB_SPEC,;t t s,@tclutil_PKG_OBJECTS@,$tclutil_PKG_OBJECTS,;t t s,@tclutil_SRC_DIR@,$tclutil_SRC_DIR,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi chmod ugo+x tclutil.sh skycat-3.1.2-starlink-1b/tclutil/configure.in000066400000000000000000000225501215713201500211320ustar00rootroot00000000000000# E.S.O. - VLT project # $Id: configure.in,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # This file is used with GNU autoconf to generate a configure script # # usage: % autoconf # only if configure.in changed # % configure # % make # % make install # # who when what # -------------- -------- --------------------------------------------- # Allan Brighton 15/12/05 Rewrote using TCL TEA standard # ----------------------------------------------------------------------- #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- AC_INIT([tclutil], [2.1.0]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- TEA_INIT([3.4]) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- TEA_PATH_TKCONFIG TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER #----------------------------------------------------------------------- # Do application specific checks (see aclocal.m4), after compiler setup. #----------------------------------------------------------------------- TCLUTIL_CONFIG #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- changequote(<<, >>) csources=`cd $srcdir; echo generic/*.[Cc]` changequote([, ]) cheaders=`cd $srcdir; echo generic/*.h` cincludes="-I. -I$srcdir/bitmaps -I$srcdir/generic" tclsources=`cd $srcdir; echo library/*.tcl` TEA_ADD_SOURCES([${csources}]) TEA_ADD_HEADERS([${cheaders}]) TEA_ADD_INCLUDES([$cincludes]) dnl TEA_ADD_LIBS([${BLT_LIB_SPEC}]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([]) TEA_ADD_TCL_SOURCES([${tclsources}]) #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- if test "${TEA_PLATFORM}" = "windows" ; then AC_DEFINE(BUILD_tclutil, 1, [Build windows export dll]) CLEANFILES="*.lib *.dll *.exp *.ilk *.pdb vc*.pch" #TEA_ADD_SOURCES([win/winFile.c]) #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="" #TEA_ADD_SOURCES([unix/unixFile.c]) #TEA_ADD_LIBS([-lsuperfly]) fi AC_SUBST(CLEANFILES) #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- TEA_PUBLIC_TCL_HEADERS #TEA_PRIVATE_TCL_HEADERS TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS #----------------------------------------------------------------------- # Find -lBLT library (needs variable set indirectly by TEA_CONFIG_CFLAGS: SHLIB_SUFFIX) TCLUTIL_PATH_BLT TEA_ADD_LIBS([${BLT_LIB_SPEC}]) #----------------------------------------------------------------------- #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- # allan: can't use stubs, due to BLT dependency #AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) #AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- TEA_MAKE_LIB #-------------------------------------------------------------------- # Determine the name of the tclsh and/or wish executables in the # Tcl and Tk build directories or the location they were installed # into. These paths are used to support running test cases only, # the Makefile should not be making use of these paths to generate # a pkgIndex.tcl file or anything else at extension build time. #-------------------------------------------------------------------- TEA_PROG_TCLSH TEA_PROG_WISH #-------------------------------------------------------------------- # These are for tclutilConfig.sh #-------------------------------------------------------------------- tclutil_LIB_FILE=${PKG_LIB_FILE} eval pkglibdir="${libdir}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval tclutil_LIB_FLAG="-ltclutil${PACKAGE_VERSION}" else eval tclutil_LIB_FLAG="-ltclutil`echo ${PACKAGE_VERSION} | tr -d .`" fi tclutil_BUILD_DIR="`pwd`" tclutil_BUILD_LIB_SPEC="-L`pwd` ${tclutil_LIB_FLAG}" tclutil_LIB_SPEC="-L${pkglibdir} ${tclutil_LIB_FLAG}" for i in ${PKG_OBJECTS} ; do tclutil_PKG_OBJECTS="$tclutil_PKG_OBJECTS ../tclutil/$i" done AC_SUBST(tclutil_LIB_FILE) AC_SUBST(tclutil_BUILD_DIR) AC_SUBST(tclutil_BUILD_LIB_SPEC) AC_SUBST(tclutil_LIB_SPEC) AC_SUBST(tclutil_PKG_OBJECTS) # tclutil_SRC_DIR must be a fully qualified path eval tclutil_SRC_DIR="$srcdir" tclutil_SRC_DIR=`cd "${tclutil_SRC_DIR}"; pwd` AC_SUBST(tclutil_SRC_DIR) #-------------------------------------------------------------------- # Finally, substitute all of the various values into the Makefile. # You may alternatively have a special pkgIndex.tcl.in or other files # which require substituting th AC variables in. Include these here. #-------------------------------------------------------------------- AC_OUTPUT([Makefile pkgIndex.tcl tclutilConfig.sh tclutil.sh tclutil_version.tcl]) chmod ugo+x tclutil.sh skycat-3.1.2-starlink-1b/tclutil/generic/000077500000000000000000000000001215713201500202315ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/tclutil/generic/Blt_GraphElement.c000066400000000000000000000055501215713201500235560ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * * Blt_GraphElement.c - replacement for the cancelled blt convenience function * * who when what * -------------- -------- ---------------------------------------- * PBi 21/02/97 Created */ #include "tcl.h" /* * Hack: Rather than have to worry about finding out where blt.h is, * just include the required definitions here (I don't expect this * package to change much anymore). -- Allan: 03.01.06 */ #if 0 #include "blt.h" #else typedef struct { double *valueArr; /* Array of values (possibly malloc-ed) */ int numValues; /* Number of values in the array */ int arraySize; /* Size of the allocated space */ double min, max; /* Minimum and maximum values in the vector */ int dirty; /* Indicates if the vector has been updated */ int reserved; /* Reserved for future use */ } Blt_Vector; int Blt_GetVector _ANSI_ARGS_((Tcl_Interp *interp, char *vecName, Blt_Vector **vecPtrPtr)); int Blt_ResetVector _ANSI_ARGS_((Blt_Vector *vecPtr, double *dataArr, int nValues, int arraySize, Tcl_FreeProc *freeProc)); #endif /* Replacement for the cancelled blt convenience function */ int Blt_GraphElement( Tcl_Interp *interp, /* Interpreter of the graph widget */ char *pathName, /* Path name of the graph widget */ char *elemName, /* Name of the element to reset */ int numValues, /* Number of values in array */ double *valueArr, /* Array of x,y coordinate pairs */ char *xVecName, /* Name of x array */ char *yVecName) /* Name of y array */ { register int i; int num = numValues/2; int nbytes = sizeof(double) * num; /* Note: Blt_Vector::arraySize is the number of bytes bytes! */ Blt_Vector *xVecPtr, *yVecPtr; double *xArray, *yArray; if (Blt_GetVector(interp, xVecName, &xVecPtr) != 0 || Blt_GetVector(interp, yVecName, &yVecPtr) != 0) return TCL_ERROR; /* Allocate space for the new vectors, if needed */ if (xVecPtr->arraySize < nbytes) { xArray = (double *)Tcl_Alloc(nbytes); yArray = (double *)Tcl_Alloc(nbytes); if (xArray == NULL || yArray == NULL) { fprintf(stderr, "malloc: out of memory\n"); return TCL_ERROR; } } else { /* reuse existing arrays */ xArray = xVecPtr->valueArr; yArray = yVecPtr->valueArr; nbytes = xVecPtr->arraySize; } /* Write the data points into the vectors */ for (i = 0; i < num; i++) { xArray[i] = *valueArr++; yArray[i] = *valueArr++; } if ((Blt_ResetVector(xVecPtr, xArray, num, nbytes, TCL_DYNAMIC) != TCL_OK) || (Blt_ResetVector(yVecPtr, yArray, num, nbytes, TCL_DYNAMIC) != TCL_OK)) { return TCL_ERROR; } return TCL_OK; } skycat-3.1.2-starlink-1b/tclutil/generic/ErrorHandler.C000066400000000000000000000033131215713201500227240ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: ErrorHandler.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ErrorHandler.C - class definitions for catching X errors in Tk * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ static const char* const rcsId="@(#) $Id: ErrorHandler.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include "error.h" #include "ErrorHandler.h" using namespace std; /* * install an X error handler */ int ErrorHandler::install() { xErrorFlag_ = 0; errHandle_ = Tk_CreateErrorHandler(display_, -1, -1, -1, errorProc, (ClientData)this); return 0; } /* * de-install the X error handler */ int ErrorHandler::remove() { if (errHandle_) { Tk_DeleteErrorHandler(errHandle_); errHandle_ = NULL; } return 0; } /* * this static method is called for X protocal errors */ int ErrorHandler::errorProc(ClientData clientData, XErrorEvent *errEventPtr) { ErrorHandler* thisPtr = (ErrorHandler*)clientData; return thisPtr->error(errEventPtr); } /* * this virtual method is called to handle X protocal errors. * It should not do anything directly with X, but should only * note the error for later. */ int ErrorHandler::error(XErrorEvent *errEventPtr) { xErrorFlag_++; if (verbose_) { char msg[80]; XGetErrorText(display_, errEventPtr->error_code, msg, sizeof(msg)); cout << "X Error: " << msg << endl; ::error("X Error: ", msg); } return TCL_OK; } skycat-3.1.2-starlink-1b/tclutil/generic/ErrorHandler.h000066400000000000000000000040021215713201500227650ustar00rootroot00000000000000// -*-c++-*- #ifndef _ErrorHandler_H_ #define _ErrorHandler_H_ /* * E.S.O. - VLT project * "@(#) $Id: ErrorHandler.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ErrorHandler.h - class for managing Tk Error Handler for catching * X errors * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created */ #include /* * This class is used to install and remove Tk X error handlers * in order to catch X errors and deal with them. * * Usage:ErrorHandler errorHandler(display, verbose_flag); * ... (something that might produce X errors) * if (errorHandler.errors()) {// errors occurred ... } */ class ErrorHandler { protected: Display* display_; // X Display pointer Tk_ErrorHandler errHandle_; // error handler handle returned from Tk int xErrorFlag_; // flag: true if an X protocol error occurred // and an error handler is installed int verbose_; // flag: if true, print diagnostic messages // -- member functions -- // called for X protocal errors when errorHandler is installed virtual int error(XErrorEvent*); public: // constructor ErrorHandler(Display* display, int verbose = 1) : display_(display), errHandle_(NULL), xErrorFlag_(0), verbose_(verbose) {install();} // destructor // the call to XSync flushes any pending errors virtual ~ErrorHandler() {XSync(display_, False); remove();} // static version of error handler, called from Tk static int errorProc(ClientData clientData, XErrorEvent *errEventPtr); // install/remove an X error handler int install(); int remove(); // return 1 if errors occurred // the call to XSync is necessary to avoid delays due to X buffering int errors() {XSync(display_, False); return xErrorFlag_;} // reset the error flag int reset() {xErrorFlag_ = 0; return 0;} }; #endif /* _ErrorHandler_H_ */ skycat-3.1.2-starlink-1b/tclutil/generic/HTTP.C000066400000000000000000000743571215713201500211340ustar00rootroot00000000000000 /* * E.S.O. - VLT project/ESO Archive * $Id: HTTP.C,v 1.2 2010/07/21 19:42:46 cguirao Exp $ * * HTTP.C - method definitions for class HTTP * (based on code from DSS:HTTP.c by Miguell Albrecht) * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created * Peter W. Draper 16 Jun 98 Added support for web proxy servers. * 06 Aug 01 Added "Host:" header for interception * proxy support. * 21 Jan 03 Changed to work with UNIX permissions * after gcc3 looses a non-standard * ofstream constructor. * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. * Peter W. Draper 06 Apr 09 Increase size of host buffers to 64 from 32. */ static const char* const rcsId="@(#) $Id: HTTP.C,v 1.2 2010/07/21 19:42:46 cguirao Exp $"; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "error.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "util.h" #include "base64.h" #include "HTTP.h" using namespace std; #ifdef NEED_SOCKET_PROTO // some protos missing in SunOS /* extern "C" { int socket(int, int, int); int connect(int, const void*, int); int strncasecmp(char*, char*, int); } */ #endif /* NEED_SOCKET_PROTO */ // this flag is made static to make it easy to turn on and off. // If true, allow a URL to be a command to exec int HTTP::allowUrlExec_ = 0; // HTTP authorization info, set with authorize(user, passwd, ...) char* HTTP::auth_info_ = NULL; // base64 encoded "username:passwd" // Using "User-Agent: SkyCat/1.0" is historical - this source used to be // part of skycat. Changing this might cause problems with existing catalog // or image servers (HST previews, in particular). char* HTTP::user_agent_ = NULL; const char* default_user_agent_ = "SkyCat/1.0"; // This sets the default name for the file used to store authorization info // (host, realm, encoded(user:passwd)) used to access restricted HTTP sites. // The information is stored in this file after an HTTP GET returns an // "Authorization Required" result and the user supplies the username and // password. The "~" will be replaced with getenv(HOME). char* HTTP::auth_file_ = NULL; const char* default_auth_file_ = "~/.http_auth"; /* * constructor - open a connection to the httpd server on the * given host/port */ HTTP::HTTP() : status_(0), port_(-1), proxyport_(-1), fd_(-1), feedback_(NULL), content_type_(NULL), content_encoding_(NULL), content_length_(0), location_(NULL), www_auth_realm_(NULL), resultBuf_(NULL), resultGC_(NULL), resultPtr_(NULL) { strcpy(hostname_, "localhost"); proxyname_[0] = '\0'; } /* * destructor - close the connection */ HTTP::~HTTP() { if (fd_ >= 0) close(fd_); if (resultGC_) { free( resultGC_ ); resultGC_ = NULL; } reset(); } /* * take an error message in HTML format from the given stream and pass it * on to error(), stripped of HTML syntax (<...>) */ int HTTP::html_error(istream& is) { char buf[1024*2]; is.read(buf, sizeof(buf)); int n = is.gcount(); if (n > 0) { buf[n-1] = '\0'; return html_error(buf); } return 0; } /* * Take an error message in HTML format and pass it on to error(), * stripped of HTML syntax (<...>). */ int HTTP::html_error(char* s) { // other HTML error message, filter out HTML syntax char* p = s; char* q = s; while (*p) { if (*p == '<') { while (*p && *p != '>') p++; } else if (*p == '>') { p++; } else if (*p == '\r') { p++; } else *q++ = *p++; } *q = '\0'; return error("HTTP error: ", s); } /* * set the file ptr to use for feedback during http transfers */ void HTTP::feedback(FILE* f) { feedback_ = f; } /* * open the connection to the given host and port and set the member * variable fd_ to the open socket descriptor. * * Returns 0 on success, 1 for error. */ int HTTP::open(const char* hostname, int port) { // close previous connection if (fd_ >= 0) close(fd_); // see if its the same host/port as last time... if (port != port_ || strcmp(hostname, hostname_) != 0) { strncpy(hostname_, hostname, sizeof(hostname_)-1); port_ = port; // reset authorization info for new server if (auth_info_) { free(auth_info_); auth_info_ = NULL; } if (feedback_) { fprintf(feedback_, "opening connection to %s:%d...\n", hostname, port); fflush(feedback_); } // Fill in the structure "servAddr_" with the address of the // server that we want to connect with. memset((char *)&servAddr_, '\0', sizeof(servAddr_)); // get host entry from hostname or IP address if (isdigit(hostname_[0])) { servAddr_.sin_addr.s_addr = inet_addr(hostname_); if ((int)servAddr_.sin_addr.s_addr == -1) return sys_error("malformed IP address: ", hostname); } else { hostent *host = gethostbyname(hostname); if (!host) return error("Can't find host IP address for: ", hostname); if (feedback_) { fprintf(feedback_, "connecting to %s:%d...\n", host->h_name, port); fflush(feedback_); } memcpy(&servAddr_.sin_addr, host->h_addr_list[0], host->h_length); } servAddr_.sin_family = AF_INET; servAddr_.sin_port = htons(port); } // Open a TCP socket (an Internet stream socket). if ((fd_ = socket(AF_INET, SOCK_STREAM, 0)) < 0) return sys_error("Can't open stream socket"); // Connect to the server. if (connect(fd_, (sockaddr *)&servAddr_, sizeof(servAddr_)) < 0) return sys_error("Can't connect to HTTP server ", hostname_); return 0; } /* * replace blanks or tabs in url with %20 and write the output in * new_url[size] */ static void replace_blanks(const char* url, char* new_url, int size) { int i = 0; for (const char* p = url; *p && i < size; p++, i++) { if (isspace(*p)) { strcpy(new_url, "%20"); new_url += 3; } else { *new_url++ = *p; } } *new_url = '\0'; } /* * Open the given local file and return the status. * Sets fd_ to the file desc. */ int HTTP::openFile(const char* filename) { if (fd_ >= 0) close(fd_); fd_ = ::open(filename, O_RDONLY); if (fd_ < 0) return sys_error("can't open file: ", filename); return 0; } /* * Run the given command and set fd_ to be positioned at the beginning of * the output. Return the status of the command (0 if ok). * * We run the command and put the output in a temp file, then open the * temp file so we can read it in the same way as the other URLS. We * could read it from a pipe, but that makes error handling more * complicated (system() returns the exit status of the command). */ int HTTP::openCommand(const char* command) { char cmd[2048]; char tmpfile[80]; strcpy(tmpfile, "/tmp/httpXXXXXX"); mkstemp(tmpfile); sprintf(cmd, "%s > %s", command, tmpfile); if (system(cmd) != 0) { error("error executing command: ", command); unlink(tmpfile); return 1; } // The command may or may not output an HTTP type header, // so we just peek at the first few lines to see if there // is one there and save the values. The return value is // the number of lines in the header, or 0 if there was // none. int nHeaderLines = checkCommandOutput(tmpfile); // open the file descriptor as for the HTTP GET socket... int status = openFile(tmpfile); unlink(tmpfile); // remove on close // skip over header lines, if any char buf[80]; for(int i = 0; i < nHeaderLines; i++) { readline(buf, sizeof(buf)); } return status; } /* * Scan the first few lines of the given file for HTTP header * info: Content-type, etc., and set the corresponding member * vars. * The return value is the number of lines in the header, * or 0 if there was none. * Note that we are not sure in this case whether the file contains * any header lines or not. */ int HTTP::checkCommandOutput(const char* filename) { ifstream is(filename); if (! is) return 0; char buf[80]; int nHeaderLines = 0; for(int i = 0; i < 5; i++) { if (is.getline(buf, sizeof(buf))) { if (strlen(buf) <= 2) { if (nHeaderLines > 0) nHeaderLines++; break; } if (strncasecmp(buf, "Content-Length:", 15) == 0) { nHeaderLines++; if (sscanf(buf+15, "%d", &content_length_) == 1) { if (feedback_) { fprintf(feedback_, "total length: %d bytes\n", content_length_); fflush(feedback_); } } } else if (strncasecmp(buf, "Content-type:", 13) == 0) { nHeaderLines++; // save the content-type for later reference content_type_ = strdup(stripWhiteSpace(buf+13)); } else if (strncasecmp(buf, "Content-Encoding:", 17) == 0) { nHeaderLines++; // save the content-type for later reference content_encoding_ = strdup(stripWhiteSpace(buf+17)); } else if (nHeaderLines == 0) { // ignore unknown header lines only if we have a header... break; } } } return nHeaderLines; } /* * Scan the given HTTP header line for any keywords that we are interested * in and save the values in member variables. */ void HTTP::scanHeaderLine(char* buf) { if (strncasecmp(buf, "Content-Length:", 15) == 0) { if (sscanf(buf+15, "%d", &content_length_) == 1) { if (feedback_) { fprintf(feedback_, "total length: %d bytes\n", content_length_); fflush(feedback_); } } } else if (strncasecmp(buf, "Content-type:", 13) == 0) { // save the content-type for later reference content_type_ = strdup(stripWhiteSpace(buf+13)); } else if (strncasecmp(buf, "Content-Encoding:", 17) == 0) { // save the content-type for later reference content_encoding_ = strdup(stripWhiteSpace(buf+17)); } else if (strncasecmp(buf, "Location:", 9) == 0) { // Redirect to a new URL location location_ = strdup(stripWhiteSpace(buf+9)); } else if (strncasecmp(buf, "WWW-Authenticate: Basic realm=\"", 31) == 0) { // Save the "realm" value (passwd domain) for later reference. // This also is an indication to the caller that a passwd is required. www_auth_realm_ = strdup(stripWhiteSpace(buf+31)); int n = strlen(www_auth_realm_)-1; if (n > 0) www_auth_realm_[n] = '\0'; // remove closing quote } } /* * reset any previous member values before a GET or POST */ void HTTP::reset() { if (content_type_) { free(content_type_); content_type_ = NULL; } if (content_encoding_) { free(content_encoding_); content_encoding_ = NULL; } if (www_auth_realm_) { free(www_auth_realm_); www_auth_realm_ = NULL; } if (location_) { free(location_); location_ = NULL; } content_length_ = 0; } /* * Set the username and password to use for authorization and, if realm * and server are given, save an entry in the auth_file for later * reference. * * This is normally called after an HTTP GET returned "401 Authorization * Required" and the user interface asked the user to type in a username * and password, but could also be called at other times, if the * necessary information is available. * * The server name can be obtained via the hostname() method after * calling get(). The realm string is returned by the method * www_auth_realm() after a get(). These values are also included in the * error message generated when the "401 Authorization Required" HTTP * result is received. */ void HTTP::authorize(const char* username, const char* passwd, const char* realm, const char* server) { // encode the username and passwd if (auth_info_) { free(auth_info_); auth_info_ = NULL; } char auth_info[1024]; sprintf(auth_info, "%s:%s", username, passwd); auth_info_ = encode_base64(auth_info); // encoded result is allocated // if realm and server are specified, save an entry to the auth_file_ if (realm && server) addAuthFileEntry(server, realm); } /* * Set the name of the file to use to store and look for HTTP * authorization info. '~' is translated into $HOME in the pathname. */ void HTTP::authFile(const char* s) { if (auth_file_) { free(auth_file_); auth_file_ = NULL; } // replace '~' in auth_file_ if needed char filename[1024]; if (s[0] == '~') { char* home = getenv("HOME"); if (home) strcpy(filename, home); strcat(filename, s+1); auth_file_ = strdup(filename); } else auth_file_ = strdup(s); } /* * Set the value of the HTTP User-Agent to use with requests */ void HTTP::userAgent(const char* s) { if (user_agent_) free(user_agent_); user_agent_ = strdup(s); } /* * Add an entry to the auth_file_ for the given server and realm and the * the current value of auth_info_. The file has the format: * * server:realm:auth_info * * Where: server is the HTTP server hostname * realm is a string returned from the server (in the auth request) * auth_info is the base64 encoded "username:passwd" */ int HTTP::addAuthFileEntry(const char* server, const char* realm) { if (!auth_file_) authFile(default_auth_file_); ifstream is(auth_file_); ostringstream os; char newentry[1024]; sprintf(newentry, "%s:%s:%s", server, realm, auth_info_); char buf[1024]; int n = strlen(server) + strlen(realm) + 1; while(is.getline(buf, sizeof(buf))) { if (strncmp(buf, newentry, n) != 0) os << buf << endl; } is.close(); os << newentry << endl; // create the auth file with -rw------- perms //ofstream f(auth_file_, ios::out, 0600); ofstream f(auth_file_, ios::out); chmod(auth_file_, 0600); if (f) f << os.str(); f.close(); return 0; } /* * Search the auth_file_, if it exists, for an entry with the given server * and realm and set auth_info_ to the value found there. * Returns 0 if found, otherwise 1. */ int HTTP::findAuthFileEntry(const char* server, const char* realm) { if (!auth_file_) authFile(default_auth_file_); ifstream is(auth_file_); char entry[1024]; sprintf(entry, "%s:%s:", server, realm); int n = strlen(entry); char buf[1024]; while(is.getline(buf, sizeof(buf))) { if (strncmp(buf, entry, n) == 0) { char* new_auth_info = buf+n; if (auth_info_) { // if we find the same user/passwd information twice, it // probably means that the server rejected it and asked // for the password again. We have to return an error to // avoid an endless loop... if (strcmp(auth_info_, new_auth_info) == 0) return 1; free(auth_info_); } auth_info_ = strdup(new_auth_info); return 0; // found } } return 1; // not found } /* * This method is called when we receive a HTTP server request for * authorization (401). If we know the username and password, retry the * request with the encoded authorization info, otherwise, return a * special error message: "Authorization Required for at " * so that the user interface can pop up a password dialog and then * eventually call HTTP::authorize() with the username and password. */ int HTTP::getAuthorization(const char* url) { if (findAuthFileEntry(hostname_, www_auth_realm_) == 0) // found return get(url); return fmt_error("Authorization Required for %s at %s", www_auth_realm_, hostname_); } /* * Get the value of the given URL and position the read fd after the * http header. * * This method accepts 3 types of URL: * * - http://host/path - URL: do an HTTP get * * - file:/path - get the file * * - /path - command: exec the command and read the stdout * (must be turned on explicitly with HTTP::allowUrlExec(int)) * * Note that for http we have to open the connection once for each GET, * since HTTP automatically closes the connection after each GET. * * If an error occurs, 1 is returned, otherwise 0. Use readline() to * fetch the results. */ int HTTP::get(const char* url) { // reset any previous values reset(); // look for local file URL: "file:/..." if (strncmp(url, "file:", 5) == 0) { char filename[1024]; if (sscanf(url, "file:%1023s", filename) == 1) { if (openFile(filename) != 0) return 1; return 0; } return error("can't parse URL: %s", url); } // If its not a HTTP URL, it should be a local command to exec if (strncmp(url, "http:", 5) != 0) { if (allowUrlExec_) { return openCommand(url); } return error("invalid HTTP URL: ", url); } // look for URL: "http://host:port/args" or "http://host/args" char host[64]; // http host name int port = 80; // http server port on host char args[1024]; // part of URL after host:port char req[2048]; // request sent to http // replace blanks or tabs in request with %20 char new_url[1024]; replace_blanks(url, new_url, sizeof(new_url)); if (feedback_) { fprintf(feedback_, "url: %s\n", new_url); // mainly for debugging info fflush(feedback_); } if (sscanf(new_url, "http://%63[^:/]:%d%1000s", host, &port, args) != 3 && sscanf(new_url, "http://%63[^/]%1000s", host, args) != 2) { return error("bad URL format: ", new_url); } // open a connection to the http server on the given host/port, // make this the proxy server if necessary. Note we check the // proxy everytime so that it can be reconfigured on the fly (by // setting the http_proxy environment variable). This call also // checks if the host is in a domain that we do not want to proxy. checkProxy( host ); if ( proxyport_ == -1 ) { if (open(host, port) != 0) return 1; // error } else { if (open(proxyname_, proxyport_) != 0) return 1; // error // Request to proxy needs the fully qualified URL. strncpy( args, new_url, 1024 ); // The apparent hostname and port are now wrong. Change these // to values that make sense in the feedback messages. strncpy( hostname_, host, 64 ); port_ = port; } if (feedback_) { fprintf(feedback_, "sending request to %s...\n", hostname_); fflush(feedback_); } // generate the request ostringstream os; os << "GET " << args << " HTTP/1.0" << endl; // PWD: add the Host: header, this is required by some // interception proxy servers (these are transparent servers that // sniff port 80 traffic and don't require any client // configuration, this is a HTTP/1.1 standard header that does no // harm for 1.0). os << "Host: " << hostname_ << endl; // add the user-agent if (! user_agent_) userAgent(default_user_agent_); os << "User-Agent: " << user_agent_ << endl; // If we have authorization info (encoded username:passwd), include it // in the request if (auth_info_ != NULL) os << "Authorization: Basic " << auth_info_ << endl; // add newline after request and null terminate os << endl; strncpy(req, os.str().c_str(), sizeof(req)); // send the request int n = strlen(req); if (writen(req, n) != n) { char buf[255]; sprintf(buf, "could not contact http server on %s:%d\n", hostname_, port_); if (feedback_) { fprintf(feedback_, "%s", buf); fflush(feedback_); } close(fd_); fd_ = -1; return sys_error(buf);; } if (feedback_) { fprintf(feedback_, "waiting for result from %s...\n", hostname_); fflush(feedback_); } // Read the result and position after the HTTP header, which ends with a blank line char buf[1024]; while (readline(buf, sizeof(buf)) > 2) { scanHeaderLine(buf); } if (location_) { // Redirect to a new URL location char* newurl = location_; location_ = NULL; // don't want to overwrite url in reset() int status = get(newurl); free(newurl); return status; } if (authorizationRequired()) { // Server requested a username and password return getAuthorization(url); } return 0; } /* * do an HTTP get on the given URL and return a pointer to the result * of NULL if an error occurred. * * nlines is set to the number of lines in the result (not counting the * http header) or -1 for errors. * * If freeFlag is true, the return buffer is only valid until the next * call to this method or when this object is deleted, at which time the * memory for it is freed. */ char* HTTP::get(const char* url, int& nlines, int freeFlag) { if (resultGC_) { free( resultGC_ ); resultGC_ = resultBuf_ = resultPtr_ = NULL; } if (get(url) != 0) { nlines = -1; return NULL; // error } // read the data into a buffer ostringstream os; char buf[8*1024]; nlines = 0; int n; if (feedback_) { int tot = 0; while ((n = read(fd_, buf, sizeof(buf))) > 0) { fprintf(feedback_, "read %d bytes from %s\n", tot += n, hostname_); fflush(feedback_); os.write(buf, n); } } else { while ((n = read(fd_, buf, sizeof(buf))) > 0) { os.write(buf, n); } } resultPtr_ = resultBuf_ = strdup(os.str().c_str()); // count the lines // and remove "end of data" marker char* p = resultBuf_; char* q = p; int errs = 0; for (p = resultBuf_; *p; p++) { if (*p == '\n') { if (strncmp(q, "[EOD]", 5) == 0) { *q = '\0'; break; } if (strncmp(q, "***", 3) == 0) { *p = '\0'; error(q); if (feedback_) { fprintf(feedback_, "%s\n", q); fflush(feedback_); } errs++; break; } nlines++; q = p+1; } } close(fd_); fd_ = -1; if (freeFlag) resultGC_ = resultBuf_; if (errs) { nlines = -1; return NULL; } if (feedback_) { fprintf(feedback_, "done: read %d lines from %s\n", nlines, hostname_); fflush(feedback_); } return resultBuf_; } /* * do an HTTP GET on the given URL and write the results to the * given stream. * * Returns 0 if successful, otherwise 1 */ int HTTP::get(const char* url, ostream& os) { if (get(url) != 0) { return 1; // error } return copy(os); } /* * Do an HTTP POST using the given URL and data and position the read fd * after the http header of the result. * * This method accepts only standard http://... type URLs. * * If an error occurs, 1 is returned, otherwise 0. Use readline() to * fetch the results. * * Note: authorization is not implemented for POST yet, but could be added * easily. I'm not sure if we need it yet... */ int HTTP::post(const char* url, const char* data) { // reset any previous values reset(); // For now, only support http://... URLs if (strncmp(url, "http:", 5) != 0) { return error("Invalid URL for HTTP POST method"); } // look for URL: "http://host:port/args" or "http://host/args" char host[64]; // http host name int port = 80; // http server port on host char args[1024]; // part of URL after host:port char req[1024]; // request sent to http if (sscanf(url, "http://%63[^:/]:%d%1000s", host, &port, args) != 3 && sscanf(url, "http://%63[^/]%1000s", host, args) != 2) { return error("bad URL format: ", url); } // open a connection to the http server on the given host/port, // make this the proxy server if necessary. Note we check the // proxy everytime so that it can be reconfigured on the fly (by // setting the http_proxy environment variable). This call also // checks if the host is in a domain that we do not want to proxy. checkProxy(host); if (proxyport_ == -1) { if (open(host, port) != 0) return 1; // error } else { if (open(proxyname_, proxyport_) != 0) return 1; // error // Request to proxy needs the fully qualified URL. strncpy(args, url, 1024); // The apparent hostname and port are now wrong. Change these // to values that make sense in the feedback messages. strncpy(hostname_, host, 64); port_ = port; } if (feedback_) { fprintf(feedback_, "sending request to %s...\n", hostname_); fflush(feedback_); } // generate the HTTP POST command sprintf(req, "POST %s HTTP/1.0\nContent-type: text/plain\nContent-length: %d\n\n%s", args, (int) strlen(data), data); int n = strlen(req); if (writen(req, n) != n) { char buf[255]; sprintf(buf, "could not contact http server on %s:%d\n", hostname_, port_); if (feedback_) { fprintf(feedback_, "%s", buf); fflush(feedback_); } close(fd_); fd_ = -1; return sys_error(buf);; } if (feedback_) { fprintf(feedback_, "waiting for result from %s...\n", hostname_); fflush(feedback_); } // skip the HTTP header: ends with a blank line char buf[1024]; while (readline(buf, sizeof(buf)) > 2) { scanHeaderLine(buf); } if (location_) { // Redirect to a new URL location char* newurl = location_; location_ = NULL; // don't want to overwrite url in reset() int status = post(newurl, data); free(newurl); return status; } return 0; } /* * do an HTTP POST using the given URL and data and write the * results to the given stream. * * Returns 0 if successful, otherwise 1 */ int HTTP::post(const char* url, const char* data, ostream& os) { if (post(url, data) != 0) { return 1; // error } return copy(os); } /* * copy the results of a previous get(url) to the given stream. * * Assumes that the connection is open and the header has been read, * i.e., get(url) was called. * * Returns 0 if successful, otherwise 1 */ int HTTP::copy(ostream& os) { char buf[8*1024]; int n; if (feedback_) { int tot = 0; while((n = read(fd_, buf, sizeof(buf))) > 0) { os.write(buf, n); fprintf(feedback_, "read %d bytes from %s\n", tot += n, hostname_); fflush(feedback_); } } else { while((n = read(fd_, buf, sizeof(buf))) > 0) { os.write(buf, n); } } return 0; } /* * Return a pointer to the next line in the results of the previous call * to get(url, nlines). A null char is inserted in place of the newline * so that the line can be treated as a single string. * * A NULL is returned when there are no more lines in the results. */ char* HTTP::getNext() { if (resultPtr_) { char* q = resultPtr_; char* p = strchr(q, '\n'); if (p) { *p++ = '\0'; resultPtr_ = p; return q; } } return NULL; } /* * Read the line one byte at a time, looking for the newline. We store * the newline in the buffer, then follow it with a null (the same as * fgets(3)). Not very efficient but usefull for sockets. * * Returns the number of characters up to, but not including, the null * (the same as strlen(3)) or < 0 upon errors. * * Taken from Stevens (readline()), "Unix Network Programming" */ int HTTP::readline(char* ptr, int maxlen) { int n, rc; char c; for (n = 1; n < maxlen; n++) { if ( (rc = read(fd_, &c, 1)) == 1) { *ptr++ = c; if (c == '\n') break; } else if (rc == 0) { if (n == 1) return(0); // EOF, no data read else break; // EOF, some data was read } else return(-1); // error } *ptr = 0; return(n); } /* * Write "n" bytes to a descriptor. Use in place of write() when fd is a * stream socket. * * Returns the number of characters written or <0 upon error. * * Taken from Stevens, "Unix Network Programming". */ int HTTP::writen(char* ptr, int nbytes) { int nleft, nwritten; nleft = nbytes; while (nleft > 0) { nwritten = write(fd_, ptr, nleft); if (nwritten <= 0) return(nwritten); // error nleft -= nwritten; ptr += nwritten; } return(nbytes - nleft); } /* * Check if a proxy server is available and required to access the * given host machine. * * The proxy server, if available, is defined by the "http_proxy" * environment variable. This should have the format: * * http_proxy = "http://wwwcache.some.domain:port/" * * A list of domains that do not require to be proxied (i.e. local * machines etc.) is defined by the variable "http_noproxy". This * should be a list of comma separated names, i.e.: * * http_noproxy = "local.domain,national.domain" * * If the given host is in one of these domains no proxy will be set * up otherwise the member variables "proxyname_" and "proxyport_" * will be defined (specifically proxyport_ will be set to -1 for no * proxy). * */ void HTTP::checkProxy( const char *host ) { // Check if a proxy is available. proxyport_ = -1; char *proxy = getenv( "http_proxy" ); if ( proxy != NULL ) { // Parse the string into a hostname and port number. This // should be in the form : // "http://host:port/" or "http://host/" if ( sscanf( proxy, "http://%63[^:/]:%d", proxyname_, &proxyport_ ) == 2 || sscanf( proxy, "http://%63[^/]", proxyname_ ) == 1 ) { // Succeeded. Make sure port is valid. if ( proxyport_ == -1 ) { proxyport_ = 80; } // Now see if we really need to use this for the given // host. Note need a copy of variable as strtok modifies it. char *ptr = getenv( "http_noproxy" ); if ( ptr != NULL ) { const char *hostdomain = strchr(host, '.'); if (hostdomain != NULL) { hostdomain++; // make a copy of the http_noproxy string for strtok char buf[1024]; strncpy(buf, ptr, sizeof(buf)-1); ptr = NULL; char* noproxy = buf; while ((ptr = strtok(noproxy, ", ")) != NULL) { noproxy = NULL; if (strcmp(hostdomain, ptr) == 0) { proxyname_[0] = '\0'; proxyport_ = -1; break; } } } } } else { // Scan failed to find valid proxy type address. proxyname_[0] = '\0'; proxyport_ = -1; } } else { // No http_proxy variable. So nothing to do. proxyname_[0] = '\0'; proxyport_ = -1; } // Feedback for proxy if found/needed. if (feedback_) { if ( proxyport_ != -1 ) { fprintf(feedback_, "using proxy server %s:%d\n", proxyname_, proxyport_); fflush(feedback_); } } } skycat-3.1.2-starlink-1b/tclutil/generic/HTTP.h000066400000000000000000000162071215713201500211670ustar00rootroot00000000000000// -*-c++-*- #ifndef _HTTP_h_ #define _HTTP_h_ /* * E.S.O. - VLT project * $Id: HTTP.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * HTTP.h - utility class for communicating with the HTTP daemon * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 26 Sep 95 Created * Peter W. Draper 16 Jun 98 Added support for proxy servers * pbiereic 17/02/03 Added 'using namespace std'. * Peter W. Draper 06 Apr 09 Increase size of host buffers to 64 from 32. */ using namespace std; #include #include #include #include #include #include #include #include /* * Class HTTP * */ class HTTP { private: int status_; // status after constructor sockaddr_in servAddr_; // server address char hostname_[64]; // http server hostname char proxyname_[64]; // http proxy server hostname int port_; // port number for http server int proxyport_; // port number for http proxy server int fd_; // file desc from last call to get(url) FILE* feedback_; // optional file ptr for feedback info char* content_type_; // "Content-type" field read from HTTP server or NULL char* content_encoding_; // "Content-Encoding" field read from HTTP server or NULL int content_length_; // "Content-length" field read from HTTP server or NULL char* location_; // URL for redirect (Location keyword in HTTP header) char* www_auth_realm_; // "WWW-Authenticate:" value of string after "Basic realm=" // pointers for stepping through http results char* resultBuf_; // pointer to result buffer char* resultGC_; // if not null, pointer to resultBuf_ to be freed char* resultPtr_; // pointer to current line in resultBuf_ static int allowUrlExec_; // flag: if true, allow a URL to be a command to exec. // (default: false) // authorization info, set with authorize(user, passwd, ...) static char* auth_info_; // base64 encoded "username:passwd" info, if needed // these variables have default values that should not normally need to be // changed static char* user_agent_; // value of User-Agent string to send with requests static char* auth_file_; // filename for saving HTTP authorization info private: // I/O utility int writen(char* ptr, int nbytes); // open a socket to the http server on host/port int open(const char* hostname, int port = 80); // Open the given local file and return the status. int openFile(const char* filename); // run command and position fd_ at start of output int openCommand(const char* command); // Scan the first few lines of the given file for HTTP header int checkCommandOutput(const char* filename); // check proxy server configuration void checkProxy( const char *host ); // reset any previous member values before a GET or POST void reset(); // Scan the given HTTP header line for any keywords that we are interested in void scanHeaderLine(char* buf); // Add an entry to the auth_file_ for the given server and realm and // current value of auth_info_ static int addAuthFileEntry(const char* server, const char* realm); // Search the auth_file_, if it exists, for an entry with the given server // and realm and set auth_info_ to the value found there. static int findAuthFileEntry(const char* server, const char* realm); // redo the GET on the URL with username/passwd, if known, or return special // error message so that user interface can do it. int getAuthorization(const char* url); // copy constructor - not defined HTTP(const HTTP&); public: // constructor HTTP(); // destructor ~HTTP(); // return status after constructor int status() const {return status_;} // do an HTTP GET with the given URL and position the read fd after // the result HTTP header. Returns 0 if OK. Use readNext() to read // the result lines. int get(const char* url); // do an HTTP get on the given URL and return the result as a buffer. // nlines is set to the number of result lines (use getNext() to // fetch the result lines from the buffer) char* get(const char* url, int& nlines, int freeFlag = 1); // do an HTTP get on the given URL and write the results to the // given stream int get(const char* url, ostream&); // do an HTTP POST using the given URL and data and position the read // fd after the result HTTP header. int post(const char* url, const char* data); // do an HTTP post using the given URL and data and write the results // to the given stream int post(const char* url, const char* data, ostream&); // copy the results of a previous get(url) to the given stream int copy(ostream& os); // read a line of the results after a call to get(url, nlines) int readline(char* ptr, int maxlen); // return the next result line after a call to get(url) // or NULL if there are no more lines. char* getNext(); // return a pointer to the result buffer from http const char* result() {return resultBuf_;} // set/get the file ptr to use for feedback during http transfers void feedback(FILE* f); FILE* feedback() const {return feedback_;} // return the hostname of the http server const char* hostname() const {return hostname_;} // return file desc from last call to get(url) int fd() const {return fd_;} // return http header values from last GET char* content_type() const {return content_type_;} char* content_encoding() const {return content_encoding_;} int content_length() const {return content_length_;} // if we see: WWW-Authenticate: Basic realm="somedomain" // in the HTTP header, we assume a username and password are required // and www_auth_realm_ is set to the "somedomain" value. const char* www_auth_realm() const {return www_auth_realm_;} // return true if a username/passwd is needed for the previous GET int authorizationRequired() {return www_auth_realm_ != NULL;} // set the username and password to use for authorization, // and, if realm and server are given, save an entry in the auth_file static void authorize(const char* user, const char* passwd, const char* realm = NULL, const char* server = NULL); // take an error message in HTML format and pass it // on to error(), stripped of HTML syntax (<...>) int html_error(istream& is); int html_error(char* s); // get/set flag value to allow URL to be a local command static int allowUrlExec() {return allowUrlExec_;} static void allowUrlExec(int i) {allowUrlExec_ = i;} // get/set the value of the HTTP User-Agent to use with requests static const char* userAgent() {return user_agent_;} static void userAgent(const char* s); // get/set the value of the file used to remember authorization info static const char* authFile() {return auth_file_;} static void authFile(const char* s); }; #endif /* _HTTP_h_ */ skycat-3.1.2-starlink-1b/tclutil/generic/Mem.C000066400000000000000000000427231215713201500210630ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: Mem.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Mem.C - method definitions for class Mem, for managing memory * areas with or without shared memory. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 07/03/96 Created * D.Hopkinson 21/01/97 Added constructor to use when multi-buffering shared memory. * pbiereic 22/10/99 Attach to shm with SHM_RDONLY when owner=0 * pbiereic 10/11/99 Use _exit() in signal handler, so that the * Peter W. Draper 23/01/00 Added constructor to accept "malloc'd" * memory. This is may or may not be "owned" * (I added this to accept memory mapped * from the NDF library, so as to avoid the * need for a memory copy). * message queue of a possible parent process is not closed * pbiereic 17/02/03 Added 'using namespace std'. * Peter W. Draper 03/09/04 New addr arguments for Mem and Mem_Rep * constructors. * 04/04/06 Added "refcnt" member so that owner can control * when to release memory. */ static const char* const rcsId="@(#) $Id: Mem.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include #include #include #include #include "error.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "util.h" #include "Mem.h" #include "Mem_Map.h" using namespace std; /* * NOTE: on Solaris2.5, the default limit is 8 shared memory areas per process: * this can be changed by editing /etc/system and adding the following line: * * set shmsys:shminfo_shmseg=200 */ // Some in-file data static int const MEM_MMAP_DEFAULT_FLAGS = O_RDONLY; static int const MEM_MMAP_DEFAULT_PROT = PROT_READ; static int const MEM_MMAP_DEFAULT_SHARING = MAP_SHARED; #ifdef NEED_SHM_PROTO // missing prototypes (on SunOS at least) extern "C" { // should be in sys/shm.h void *shmat(int shmid, const void* shmaddr, int shmflg); int shmdt(const void* shmaddr); int shmget(key_t, size_t, int); int shmctl(int shmid, int cmd, shmid_ds *buf); } #endif // The following is used to keep track of shared memory Mem objects. // On some systems (hp), a shmat will fail if the shared memory // is alread attached (also: mmap fails if the file is already mapped). // That is why we need the following. It is also handy for cleaning up when // a program is killed. enum {MAX_SHM_ = 255}; // max number of shared memory Mem objects allowed static MemRep* shmObjs_[MAX_SHM_]; // array of existing shared memory Mem objects static int shmCount_ = 0; // count of objects in above array /* * default constructor */ MemRep::MemRep() : size(0), owner(0), refcnt(1), ptr(NULL), newmem(0), shmId(-1), shmNum(0), semId(-1), options(0), status(0), verbose(0), m_map(NULL), linkName(NULL) { } /* * constructor - attach to existing sysV shared memory with given id */ MemRep::MemRep(size_t sz, int own, int id, int verb) : size(sz), owner(own), refcnt(1), ptr(NULL), newmem(0), shmId(id), shmNum(0), semId(-1), options(0), status(0), verbose(verb), m_map(NULL), linkName(NULL) { if (shmCount_ >= MAX_SHM_) { status = error("too many shared memory segments"); return; } // check the size shmid_ds shmInfo; if (shmctl(shmId, IPC_STAT, &shmInfo) != 0) { status = sys_error("bad shared memory Id specified"); return; } if (shmInfo.shm_segsz < size) { status = error("specified shared memory area is too small"); return; } // attach new shared memory segment if (owner) ptr = shmat(shmId, NULL, 0); else ptr = shmat(shmId, NULL, SHM_RDONLY); if (ptr == NULL || ptr == (void *)-1) { ptr = NULL; shmId = -1; status = sys_error("Invalid shared memory id specified"); return; } #ifdef DEBUG if (verbose) log_message("attach to new shared memory with Id: %d", shmId); #endif // enter new object table for later reference shmObjs_[shmCount_++] = this; } /* * constructor - create a new MemRep object with the given size. If * "useShm" is non-zero, shared memory is allocated, otherwise "operator * new" is used. */ MemRep::MemRep(size_t sz, int useShm, int verb) : size(sz), owner(1), refcnt(1), ptr(NULL), newmem(0), shmId(-1), shmNum(0), semId(-1), options(0), status(0), verbose(verb), m_map(NULL), linkName(NULL) { if (size <= 0) return; // null shared mem if (! useShm) { ptr = new char[size]; newmem = 1; if (!ptr) status = error("out of memory"); return; } if (shmCount_ >= MAX_SHM_) { status = error("too many shared memory segments"); return; } shmId = shmget(IPC_PRIVATE, size, 0666); ptr = (void *)shmat(shmId, NULL, 0); if (ptr == NULL || ptr == (void *)-1) { ptr = NULL; status = sys_error("error creating shared memory"); return; } #ifdef DEBUG if (verbose) log_message("Shared Memory area created, Id: %d, size: %d", shmId, size); #endif // enter new object in table for later reference shmObjs_[shmCount_++] = this; } /* * constructor - accept pointer to malloc'd memory. * * If owner is non-zero the memory is freed when this object is * deleted. */ MemRep::MemRep(void *inptr, size_t sz, int own) : size(sz), owner(own), refcnt(1), ptr(inptr), newmem(0), shmId(-1), shmNum(0), semId(-1), options(0), status(0), verbose(0), m_map(NULL), linkName(NULL) { } /* * constructor - mmap the given file using the given options and flags. * * If owner is non-zero, the file is deleted when this object is deleted. */ MemRep::MemRep(const char *filename, int flags, int prot, int share, size_t nbytes, int own, int verb, void *addr) : size(0), owner(own), refcnt(1), ptr(NULL), newmem(0), shmId(-1), shmNum(0), semId(-1), options(0), status(0), verbose(verb), m_map(NULL), linkName(NULL) { if (! filename) { status = error("no file name specified for mmap"); return; } if ((flags & O_CREAT) == 0) { // using existing file, not creating a new one? // can't map a file that doesn't exist if (access(filename, F_OK) != 0) { status = error("file does not exist: ", filename); return; } // can't map a file without read permission if (access(filename, R_OK) != 0) { status = error("file has no read permission: ", filename); return; } // check the file permissions and the mmap flags, since on solaris at least, // mmap(read-write) seems to succede, even if file is read-only if ((flags & O_RDWR) && access(filename, W_OK) != 0) { status = error("can't mmap read-only file for writing: ", filename); return; } } // get the name of the real file (if a link) //char realname[1024]; //const char* fname = fileRealname(filename, realname, sizeof(realname)); //if (fname == realname) //linkName = strdup(filename); // remember the name of the link const char* fname = filename; // allan: 9.11.00: had problems with relative links // map the file m_map = new Mem_Map(fname, nbytes, // length flags, // Read/Write, etc. MMAP_DEFAULT_PERMS, // mode prot, // protection, share, // share map on write addr); // address to map file at if (!m_map || m_map->status() != 0) { // status = error("mapping of file failed"); status = 1; return; } size = m_map->size(); ptr = m_map->addr(); // enter new object table for later reference shmObjs_[shmCount_++] = this; } /* * internal destructor - Detach and/or delete shared memory, if needed. */ MemRep::~MemRep() { if (shmId >= 0 || m_map) { // remove this obejct from the table, and shift others left // (there won't normally be very many entries in the table...) for (int i = 0; i < shmCount_; i++) { if (shmObjs_[i] == this) { shmCount_--; while (i < shmCount_) { shmObjs_[i] = shmObjs_[i+1]; i++; } shmObjs_[shmCount_] = NULL; break; } } } // If there is a semaphore associated with this shared memory, set // it to zero . if (shmId >= 0) { // if we are responsible for deleting this memory, do it now if (owner) { struct sembuf semDec[1] = { 0, 0, IPC_NOWAIT }; // Perform the reset #ifdef HAVE_UNION_SEMUN union semun s; // allan: 11.9.97 - type needed for linux s.val = 0; #else void* s = NULL; #endif semDec[0].sem_num = (unsigned short)shmNum; semDec[0].sem_op = (short)(0 - semctl(semId, shmNum, GETVAL, s)); semop(semId, &semDec[0], 1); #ifdef DEBUG if (verbose) log_message("removing (IPC_RMID) shared memory area: %d", shmId); #endif shmctl(shmId, IPC_RMID, NULL); } // detach and delete, since there are no more references if (ptr) { #ifdef DEBUG if (verbose) log_message("detaching shared memory area: %d", shmId); #endif shmdt((char*)ptr); } } else if (m_map != 0) { // mmap file if (owner && m_map->filename()) unlink(m_map->filename()); // if we are the owner, rm the file now if(m_map) delete m_map; } else if (ptr) { // must be using plain memory if (newmem && owner) { delete[] (char *)ptr; } else if (owner) { free( ptr ); } } ptr = NULL; newmem = 0; m_map = NULL; shmId = -1; size = 0; status = -1; if (linkName) { free(linkName); linkName = NULL; } } /* * return name of mmap file or NULL if mmap not being used. * If flag is 1 and the original file was a link, return the link name, * otherwise return the real name. */ const char* MemRep::filename(int flag) const { if (m_map) { if (flag && linkName) return linkName; return m_map->filename(); } return NULL; } /* * Temporarily unmap the shared memory. This is needed if you want to save lots * of these objects without running out of shared memory resources. * (Note: only for use with read-only mmapped memory.) */ void MemRep::unmap() { if (refcnt > 1) return; // can't unmap, more than one ref if (m_map) { m_map->close(); ptr = NULL; } // not impl for sysV shared mem } /* * remap the shared memory after a call to unmap() * (may be used to unmap and remap with different options, see MemFileOptions) * If the optional newsize arg is given and is not 0, it indicates a new * file size. This can be used to extend the file size. */ int MemRep::remap(int opts, size_t newsize) { if (!m_map || !m_map->filename()) return error("can't remap memory, not mapped"); int flags = 0; int prot = 0; int sharing = 0; if (opts == Mem::FILE_DEFAULTS) { flags = MEM_MMAP_DEFAULT_FLAGS; prot = MEM_MMAP_DEFAULT_PROT; sharing = MEM_MMAP_DEFAULT_SHARING; } else { // There are client specified options flags |= (opts & Mem::FILE_RDWR ) ? O_RDWR : O_RDONLY; prot = (opts & Mem::FILE_RDWR) ? PROT_RDWR : PROT_READ; sharing = (opts & Mem::FILE_PRIVATE) ? MAP_PRIVATE: MAP_SHARED; } // first unmap (very important...) m_map->close(); // now remap if (m_map->map(m_map->filename(), newsize, flags, MMAP_DEFAULT_PERMS, prot, sharing, NULL, 0) < 0) { return sys_error("mmap failed for file: ", m_map->filename()); } size = m_map->size(); ptr = m_map->addr(); options = opts; // not impl for sysV shared mem return 0; } /* * search for an existing MemRep object for the given shmId and return it * or NULL if not found */ static MemRep* findMemRep(int shmId) { if (shmId >= 0) { for (int i = 0; i < shmCount_; i++) if (shmObjs_[i]->shmId == shmId) return shmObjs_[i]; } return NULL; } /* * search for an existing MemRep object for the given filename and return it * or NULL if not found */ static MemRep* findMemRep(const char* filename) { MemRep* rep; if (filename) { // get the name of the real file //char realname[1024]; //const char* pfile = fileRealname(filename, realname, sizeof(realname)); const char* pfile = filename; // allan: 9.11.00: had problems with relative links for (int i = 0; i < shmCount_; i++) { if (shmObjs_[i]->m_map && strcmp(shmObjs_[i]->m_map->filename(), pfile) == 0) { rep = shmObjs_[i]; // Note: memory may have been temporarily unmapped (see unmap()) // If so, remap it here. if (rep->ptr == NULL && rep->remap() != 0) return NULL; return rep; } } } return NULL; // not found } // --------------------- Below is Mem - Above MemRep ------------------------- /* * constructor - attach (if needed) to existing shm area */ Mem::Mem(size_t size, int shmId, int owner, int verbose) : offset_(0), length_(0) { // see if we have this Id already if (rep_ = findMemRep(shmId)) { rep_->refcnt++; return; } // make a new one rep_ = new MemRep(size, owner, shmId, verbose); } /* * Constructor to use when multi-buffering shared memory. The fifth argument * is the number of the buffer in the sequence of use of shared memory * buffers. This is only required to lock the memory when using semaphores. * The final argument is the ID of the semaphore used to lock this * particular area of shared memory. */ Mem::Mem(size_t size, int shmId, int owner, int verbose, int shmNum, int semId) : offset_(0), length_(0) { // see if we have this Id already if (rep_ = findMemRep(shmId)) { rep_->refcnt++; return; } // make a new one rep_ = new MemRep(size, owner, shmId, verbose); rep_->shmNum = shmNum; rep_->semId = semId; } /* * constructor - use Mem_Map to open file and get pointer */ Mem::Mem(const char *filename, int verbose) : offset_(0), length_(0) { // see if we have mapped this file already if (rep_ = findMemRep(filename)) { rep_->refcnt++; return; } rep_ = new MemRep(filename, MEM_MMAP_DEFAULT_FLAGS, MEM_MMAP_DEFAULT_PROT, MEM_MMAP_DEFAULT_SHARING, 0, 0, verbose); } /* * Constructor uses mmap to map a file and adds file options */ Mem::Mem(const char *filename, int options, int verbose, void *addr) : offset_(0), length_(0) { int flags = 0; int prot = 0; int sharing = 0; if (options == FILE_DEFAULTS) { flags = MEM_MMAP_DEFAULT_FLAGS; prot = MEM_MMAP_DEFAULT_PROT; sharing = MEM_MMAP_DEFAULT_SHARING; } else { // There are client specified options flags |= (options & FILE_RDWR ) ? O_RDWR : O_RDONLY; prot = (options & FILE_RDWR) ? PROT_RDWR : PROT_READ; sharing = (options & FILE_PRIVATE) ? MAP_PRIVATE: MAP_SHARED; } // see if we have mapped this file already if (rep_ = findMemRep(filename)) { rep_->refcnt++; return; } rep_ = new MemRep(filename, flags, prot, sharing, 0, 0, verbose, addr); rep_->options = options; } /* * Constructor: create a file of the given size and use mmap to map the * file read/write (Note: we have to use O_RDWR for mmap). * * If owner if non-zero, the file is deleted when there are no more * references. */ Mem::Mem(size_t size, const char *filename, int owner, int verbose) : offset_(0), length_(0) { // see if we have mapped this file already if (rep_ = findMemRep(filename)) { rep_->refcnt++; fmt_error("warning: file %s already exists and is already mmapped!", filename); return; } unlink(filename); // remove any existing file by this name... (is this needed?) rep_ = new MemRep(filename, O_RDWR|O_CREAT, PROT_RDWR, MAP_SHARED, size, owner, verbose); } /* * Constructor: accept a pointer to memory, do not modify this * reference (assume user looks after it). */ Mem::Mem(void *ptr, size_t size, int owner) : offset_(0), length_(0) { rep_ = new MemRep(ptr, size, owner); } /* * destructor, detach and/or delete memory if needed */ Mem::~Mem() { if (rep_ && --rep_->refcnt <= 0) delete rep_; } /* * assignment operator */ Mem& Mem::operator=(const Mem& m) { if (m.rep_) m.rep_->refcnt++; // protect against "shm = shm" if (rep_ && --rep_->refcnt <= 0) delete rep_; offset_ = m.offset_; length_ = m.length_; rep_ = m.rep_; return *this; } /* * return the current reference count. */ int Mem::refcnt() { if ( rep_ ) { return rep_->refcnt; } return 0; } /* * force the memory to be shared (1) or not shared (0) */ int Mem::shared(int share) { if (share == shared()) return 0; Mem m(length(), share, verbose()); if (m.status() != 0) return m.status(); memcpy(m.ptr(), ptr(), length()); *this = m; return 0; } /* * remove all "owned" shared memory areas (should be called before exit) */ void Mem::cleanup() { for (int i = 0; i < shmCount_; i++) { if (shmObjs_[i]->owner && shmObjs_[i]->status == 0) { if (shmObjs_[i]->m_map && shmObjs_[i]->m_map->filename()) unlink(shmObjs_[i]->m_map->filename()); else if (shmObjs_[i]->shmId > -1) shmctl(shmObjs_[i]->shmId, IPC_RMID, NULL); shmObjs_[i]->owner = 0; } } } /* * external version, for use as a signal handler */ void Mem_cleanup(int) { Mem::cleanup(); _exit(0); } skycat-3.1.2-starlink-1b/tclutil/generic/Mem.h000066400000000000000000000173431215713201500211300ustar00rootroot00000000000000// -*-c++-*- #ifndef _Mem_h_ #define _Mem_h_ /* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: Mem.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Mem.h - declarations for class Mem, a class for managing memory areas, * which may or may not be shared memory. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 07 Mar 96 Created * 03 Dec 96 added filename() method to return mmap filename * or NULL if mmap is not being used. * D.Hopkinson 21/01/97 Added constructor to use when * multi-buffering shared memory. * Peter W. Draper 23/01/00 Added constructor and methods for * accepting a piece of malloc'd memory. * 03/09/04 Added addr parameter to Mem and Mem_Rep * constructors. Starlink fortran 64 bit * interoperability requires that addresses may be * changed. * 04/04/06 Added "refcnt" member so that owner can control * when to release memory. * 05/12/07 Change length function to return off_t instead * of int. */ #include #include class Mem_Map; // internal struct used for reference counting struct MemRep { size_t size; // size in bytes int owner; // true if we should delete the shm when no longer needed int refcnt; // count of the number of reference to this memory area void* ptr; // pointer to memory area int newmem; // memory allocated using "new" int shmId; // shared memory id, or 0 if not shared int shmNum; // shm buffer number, if multi-buffering int semId; // Semaphore ID for locking shm int options; // mmap options for read/write access int status; // status after constructor int verbose; // if true, print diagnostic messages Mem_Map *m_map; // Used when mapping a file char* linkName; // If a file name specified for mmap was a link, it is // replaced with the real name and the name of the link // is recorded here. // default constructor: empty memory MemRep(); // attach to sysV shared memory MemRep(size_t size, int owner, int shmId, int verbose); // create memory (sysV shared, if useShm is 1) with given size MemRep(size_t size, int useShm, int verbose); // mmap the given file, create/extend if nbytes > 0 MemRep(const char *filename, int flags, int prot, int share, size_t nbytes, int owner, int verbose, void *addr = NULL); // accept pointer to malloc'd memory. MemRep(void *inptr, size_t size, int owner); // destructor ~MemRep(); // return name of mmap file or NULL if mmap not being used const char* filename(int flag = 0) const; // temporarily unmap the shared memory void unmap(); // remap the shared memory after a call to unmap(), optionally specifying // new mapping options and a new file size. int remap(int options = 0, size_t newsize = 0); }; /* * This class uses reference counting to help manage memory areas. The * class keeps track of who owns the (shared) memory, who is responsible * for deleting it when no longer needed and how many references there * are to the memory area. When there are no more references, we * can safely detach a shared memory area and if we are the "owner", * delete it. */ class Mem { private: MemRep* rep_; // internal representation, reference counting long offset_; // optional offset in memory area long length_; // optional different length of memory area used public: // default constructor Mem() : rep_(new MemRep), offset_(0), length_(0) { } // constructor: attach (if needed) to existing shared memory area Mem(size_t size, int shmId, int owner, int verbose); // constructor: create new memory area, shared if useShm is true Mem(size_t size, int useShm, int verbose = 0) : rep_(new MemRep(size, useShm, verbose)), offset_(0), length_(0) { } // mmap options enum MemFileOptions { FILE_DEFAULTS = 0, // File RDONLY, MAP_SHARED FILE_RDWR = 1, // Make mapped file writable FILE_PRIVATE = 2, // Make written segments private FILE_FIXED = 4 // Fixed address, not in use }; // Constructor uses mmap to map a file Mem(const char *filename, int verbose = 0); // Constructor uses mmap to map a file and adds file options // PWD: Use the addr argument if you need to suggest an address to map // the file. Starlink Fortran interoperability sometimes needs this. Mem(const char *filename, int options, int verbose, void *addr = NULL); // Constructor: creates a file of the given size and uses mmap // to map the file read/write. Mem(size_t size, const char *filename, int owner, int verbose = 0 ); // Constructor to use when multi-buffering shared memory. Mem(size_t size, int shmId, int owner, int verbose, int shmNum, int semId); // Accept pointer to malloc'd memory Mem(void *ptr, size_t size, int owner); // copy constructor, just copy ptr and increment ref count Mem(const Mem& m) : rep_(m.rep_), offset_(m.offset_), length_(m.length_) { rep_->refcnt++; } // destructor, detach and/or delete memory if needed ~Mem(); // assignment Mem& operator=(const Mem&); int operator==(const Mem& m) const { return m.rep_ == rep_ && m.offset_ == offset_ && m.length_ == length_; } int operator!=(const Mem& m) const { return m.rep_ != rep_ || m.offset_ != offset_ || m.length_ != length_; } // reference counts of memory int refcnt(); // return true if the memory is shared int shared() const {return shmId() >= 0;} // force the memory to be shared (1) or not shared (0) int shared(int share); // temporarily unmap the shared memory void unmap() {rep_->unmap();} // remap the shared memory after a call to unmap(), optionally specifying // new mapping options and a new file size int remap(int options = 0, size_t newsize = 0) { return rep_->remap(options, newsize); } // remove all "owned" shared memory areas (should be called before exit) static void cleanup(); // return the working length of the memory off_t length() const {return off_t(length_ ? length_ : (rep_->size - offset_));} // set optional length void length(long newLength) {length_ = newLength;} // member access size_t size() const {return rep_->size;} void* ptr() const {return rep_->ptr ? ((void *)((char *)rep_->ptr + offset_)) : NULL;} int shmId() const {return rep_->shmId;} int shmNum() const {return rep_->shmNum;} int semId() const {return rep_->semId;} int options() const {return rep_->options;} int status() const {return rep_->status;} int verbose() const {return rep_->verbose;} Mem_Map* m_map() const {return rep_->m_map;} // return a pointer to the internal representation // (This should only be used, if needed, in special cases) const MemRep* rep() const {return rep_;} // set/get the owner flag: if non-zero, memory will be deleted when there // are no more references void owner(int b) {rep_->owner = b;} int owner() {return rep_->owner;} // return name of mmap file or NULL if mmap not being used const char* filename(int flag = 0) const {return rep_->filename(flag);} // set/get offset void offset(long newOffset) {offset_ = newOffset;} long offset() const {return offset_;} }; /* cleanup shared mem and exit: for use as a signal handler */ void Mem_cleanup(int); #endif /* _Mem_h_ */ skycat-3.1.2-starlink-1b/tclutil/generic/Mem_Map.C000066400000000000000000000162411215713201500216540ustar00rootroot00000000000000 /* * E.S.O. - VLT project/ESO Archive * $Id: Mem_Map.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * Mem_Map.C - method definitions for class Mem_Map * Author: Doug Schmidt - ripped from ACE_wrappers by K. Gillies. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 3 Aug 96 Created, added call to "sys_error()", set status_ * Peter W. Draper 23 Jan 97 Added cast to MAP_FAILED comparison (OSF/1). * 23 Oct 00 Expanded error messages to be a little * more informative to an end user. */ static const char* const rcsId="@(#) $Id: Mem_Map.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include "error.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "Mem_Map.h" #include #ifdef HAVE_SYS_STATVFS_H #include #endif //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- void Mem_Map::dump (void) const { } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // This function rounds the request to a multiple of the page size. size_t round_to_pagesize (off_t len) { return (len + (MMAP_PAGE_SIZE - 1)) & ~(MMAP_PAGE_SIZE - 1); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- int Mem_Map::close (void) { if (this->base_addr_ != (void*)MAP_FAILED) // allan: 30.7.97 added check this->unmap(); if (this->close_handle_) { return ::close(this->handle_); } return 0; } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- Mem_Map::~Mem_Map (void) { this->close(); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // This function does the dirty work of actually calling mmap // to map the file into memory. int Mem_Map::map_it(int handle, size_t len_request, int prot, int share, void *addr, off_t pos) { this->base_addr_ = addr; this->handle_ = handle; // Inquire file to access and get length in bytes. struct stat sb; int status = ::fstat(this->handle_, &sb); if (status == -1) { sys_error("get file status (fstat) failed for: ", filename_); // allan: added error report return -1; } // Set initial length to all of file. off_t file_len = sb.st_size; this->length_ = file_len; // If file is zero sized or too small. if ((this->length_ == 0 && len_request > 0) || (this->length_ < len_request)) { // Length is that requested. this->length_ = len_request; #ifdef HAVE_SYS_STATVFS_H // allan: make sure there is enough space on the filesystem struct statvfs vfs; if (fstatvfs(handle, &vfs) != 0) { sys_error("get file system information (fstatvfs) failed for: ", filename_); return -1; } if (vfs.f_frsize > 0) { // NOTE: must calculate in blocks to avoid 32bit overflow unsigned long need = (len_request - file_len + vfs.f_frsize)/vfs.f_frsize; unsigned long have = vfs.f_bavail; if (have < need) { error("DISK FULL: cannot create a sufficiently large map file: ", filename_); return -1; } } #endif // Extend the backing store. if (::lseek (this->handle_, len_request > 0 ? len_request - 1 : 0, SEEK_SET) == -1 || ::write (this->handle_, "", 1) != 1 || ::lseek (this->handle_, 0, SEEK_SET) == -1) { sys_error("write or seek failed for: ", filename_); // allan: added error report return -1; } } if (this->length_ <= 0) { error("cannot map zero length file: ", filename_); return -1; } this->base_addr_ = ::mmap ((caddr_t)this->base_addr_, this->length_, prot, share, this->handle_, off_t (round_to_pagesize (pos))); if (this->base_addr_ == (void*)MAP_FAILED) { // allan: added error report sys_error("failed to map file (insufficient VM?): ", filename_); return -1; } return 0; } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- int Mem_Map::open(const char file_name[], int flags, int mode) { ::strncpy (this->filename_, file_name, MAXPATHLEN); this->handle_ = ::open(file_name, flags, mode); if (this->handle_ == MMAP_INVALID_HANDLE) { sys_error("open failed for: ", filename_); // allan: added error report return -1; } else { this->close_handle_ = 1; return 0; } } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- int Mem_Map::map(const char file_name[], size_t len, int flags, int mode, int prot, int share, void *addr, off_t pos) { if (this->open(file_name, flags, mode) == -1) { return -1; } return this->map_it(this->handle(), len, prot, share, addr, pos); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- Mem_Map::Mem_Map(void) : length_ (0), base_addr_ (0), handle_ (MMAP_INVALID_HANDLE), close_handle_ (0), status_ (0) { ::memset (this->filename_, 0, sizeof this->filename_); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Map a file specified by FILE_NAME. Mem_Map::Mem_Map (const char file_name[], size_t len, int flags, int mode, int prot, int share, void *addr, off_t pos) : base_addr_ (0), close_handle_ (0), status_ (0) { if (this->map (file_name, len, flags, mode, prot, share, addr, pos) < 0) { status_ = 1; } } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Map a file from an open file descriptor HANDLE. This function will // lookup the length of the file if it is not given. Mem_Map::Mem_Map (int handle, size_t len, int prot, int share, void *addr, off_t pos) : close_handle_ (0), status_ (0) { memset (this->filename_, 0, sizeof this->filename_); if (this->map (handle, len, prot, share, addr, pos) < 0) status_ = 1; } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Close down and remove the file from the file system. int Mem_Map::remove (void) { ::ftruncate(this->handle_, 0); this->close(); if (this->filename_[0] != '\0') { return ::unlink (this->filename_); } // Else return 0; } skycat-3.1.2-starlink-1b/tclutil/generic/Mem_Map.h000066400000000000000000000251541215713201500217240ustar00rootroot00000000000000// -*-c++-*- #ifndef MEM_MAP_H #define MEM_MAP_H /* * E.S.O. - VLT project * $Id: Mem_Map.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * Mem_Map.h - utility class wrapper for mmap(2), Author: Doug Schmidt * (ripped from ACE C++ library for use in OCS by K. Gillies, * "...Doug says it's okay...." * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 02 Aug 96 Created, added status() method, removed TRACE * 06 Aug 96 Changed ssize_t to int, since it is not defined on sunos * define MAP_FAILED to (void*)-1, not def on HP,sunos * 03 Dec 96 Added filename() method to return filename mapped. * Reformatted .h file and put comments above declarations * for readability. * Peter W. Draper 27 Sep 05 All lengths are now size_t, which usually means * an unsigned long, consequently all use of * -1 as a special length has been changed to 0. */ #include #include // the wrapper is needed on some HPs extern "C" { #include } #include /* allan: 6.8.96: add defs missing on HP and/or sunos */ #ifndef MAP_FAILED #define MAP_FAILED NULL #endif #ifndef MS_SYNC #define MS_SYNC 0 #endif /* #ifdef NEED_MMAP_PROTO extern "C" { extern caddr_t mmap(caddr_t, size_t, int, int, int, off_t); extern int munmap(caddr_t, size_t); } #endif */ // MMAP additional flags #define PROT_RDWR (PROT_READ|PROT_WRITE) // Default file permissions. #define MMAP_DEFAULT_PERMS 0666 #define MMAP_INVALID_HANDLE 0 // Default size of mapped page on SunOS, HP and Solaris. #define MMAP_PAGE_SIZE 4096 // External used to round request. size_t round_to_pagesize (off_t len); // C++ interface to the mmap(2) UNIX system call. class Mem_Map { public: // Default constructor. Mem_Map (void); // Map a file from an open file descriptor . This function // will lookup the length of the file if it is not given. Mem_Map (int handle, size_t length = 0, int prot = PROT_READ, int share = MAP_SHARED, void *addr = 0, off_t pos = 0); // Map a file specified by . Mem_Map (const char file_name[], size_t len = 0, int flags = O_RDWR, int mode = MMAP_DEFAULT_PERMS, int prot = PROT_READ, int share = MAP_SHARED, void *addr = 0, off_t pos = 0); // Map a file from an open file descriptor . This function // will lookup the length of the file if it is not given. int map (int handle, size_t length = 0, int prot = PROT_READ, int share = MAP_SHARED, void *addr = 0, off_t pos = 0); // Remap the file associated with . int map (size_t length = 0, int prot = PROT_READ, int share = MAP_SHARED, void *addr = 0, off_t pos = 0); // Map a file specified by . int map (const char file_name[], size_t len = 0, int flags = O_RDWR, int mode = MMAP_DEFAULT_PERMS, int prot = PROT_READ, int share = MAP_SHARED, void *addr = 0, off_t pos = 0); // Destructor. ~Mem_Map (void); const char* filename() {return filename_;} // Open the file without mapping it. int open (const char file_name[], int flags = O_RDWR, int mode = MMAP_DEFAULT_PERMS); // Close down the if necessary. int close (void); // This operator passes back the starting address of the mapped file. int operator () (void *&addr); // Return the base address. void *addr (void) const; // This function returns the number of bytes currently mapped in the // file. size_t size (void) const; // Unmap the region starting at . int unmap (size_t len = 0); // Unmap the region starting at . int unmap (void *addr, size_t len); // Sync bytes of the memory region to the backing store // starting at . If == 0 then sync the whole // region. int sync (size_t len = 0, int flags = MS_SYNC); // Sync bytes of the memory region to the backing store // starting at . int sync (void *addr, size_t len, int flags = MS_SYNC); // Change the protection of the pages of the mapped region to // starting at up to bytes. If == 0 then // change protection of all pages in the mapped region. int protect (size_t len = 0, int prot = PROT_READ); // Change the protection of the pages of the mapped region to // starting at up to bytes. int protect (void *addr, size_t len, int prot = PROT_READ); // Close down and remove the file from the file system. int remove (void); #if 0 // Hook into the underlying VM system. int advise (int behavior, size_t len = 0); #endif // Return the underlying . int handle (void) const; // Dump the state of an object. void dump (void) const; // Return the status after the constructor int status() {return status_;} private: // Base address of the memory-mapped file. void *base_addr_; // Name of the file that is mapped. char filename_[MAXPATHLEN + 1]; // Length of the mapping. size_t length_; // HANDLE for the open file. int handle_; // status after constructor (allan) int status_; // Keeps track of whether we need to close the handle. This is set // if we opened the file. int close_handle_; // This method does the dirty work of actually calling ::mmap to map // the file into memory. int map_it (int handle, size_t len = 0, int prot = PROT_READ, int share = MAP_SHARED, void *addr = 0, off_t pos = 0); Mem_Map (const Mem_Map &) {} void operator = (const Mem_Map &) {} }; // inlines //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- inline int Mem_Map::handle (void) const { return this->handle_; } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- inline int Mem_Map::map (int handle, size_t len, int prot, int share, void *addr, off_t pos) { return this->map_it (handle, len, prot, share, addr, pos); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Remap the file associated with handle_>. inline int Mem_Map::map (size_t len, int prot, int share, void *addr, off_t pos) { return this->map_it (this->handle(), len, prot, share, addr, pos); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // This operator passes back the starting address of the mapped file. inline int Mem_Map::operator () (void *&addr) { if (this->base_addr_ == (void*)MAP_FAILED) { /* allan: not defined on HP */ return -1; } else { addr = this->base_addr_; return 0; } } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Return the base address. inline void * Mem_Map::addr (void) const { return this->base_addr_; } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // This function returns the number of bytes currently mapped in the // file. inline size_t Mem_Map::size (void) const { return this->length_; } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Unmap the region starting at base_addr_>. inline int Mem_Map::unmap (size_t len) { return ::munmap ((caddr_t)this->base_addr_, len == 0 ? this->length_ : len); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Unmap the region starting at . inline int Mem_Map::unmap (void *addr, size_t len) { return ::munmap ((caddr_t)addr, len == 0 ? this->length_ : len); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Sync bytes of the memory region to the backing store starting // at base_addr_>. If == 0 then sync the whole mapped // region. inline int Mem_Map::sync (size_t len, int flags) { return ::msync ((caddr_t)this->base_addr_, len == 0 ? this->length_ : len, flags); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Sync bytes of the memory region to the backing store starting // at . inline int Mem_Map::sync (void *addr, size_t len, int flags) { return ::msync((caddr_t)addr, len, flags); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Change the protection of the pages of the mapped region to // starting at base_addr_> up to bytes. If == 0 // then change protection of all pages in the mapped region. inline int Mem_Map::protect (size_t len, int prot) { if (len == 0) { len = this->length_; } return ::mprotect((caddr_t)this->base_addr_, len, prot); } //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Change the protection of the pages of the mapped region to // starting at up to bytes. inline int Mem_Map::protect(void *addr, size_t len, int prot) { return ::mprotect((caddr_t)addr, len, prot); } #if 0 //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Hook into the underlying VM system. inline int Mem_Map::advise (int behavior, size_t len) { if (len == 0) { len = this->length_; } return ::madvise ((caddr_t)this->base_addr_, len, behavior); } #endif #endif /* ACE_MEM_MAP_H */ skycat-3.1.2-starlink-1b/tclutil/generic/ShellCommand.C000066400000000000000000000054011215713201500227030ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: ShellCommand.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ShellCommand.C - methods for class ShellCommand, util class for * running a shell command and getting the output. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 12 Jun 96 Created * pbiereic 17/02/03 Added 'using namespace std'. */ static const char* const rcsId="@(#) $Id: ShellCommand.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include #include #include #include #include #include #include "error.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "ShellCommand.h" using namespace std; /* * local util to read a file desc into memory and return an * allocated buffer for it. */ static char* read_pipe(int fd) { struct stat stat_buf; if (fstat(fd, &stat_buf) != 0) { sys_error("stat"); return NULL; } char* buf = new char[stat_buf.st_size+1]; buf[0] = '\0'; if (read(fd, buf, stat_buf.st_size) != stat_buf.st_size) { sys_error("read failed"); return NULL; } buf[stat_buf.st_size] = '\0'; return buf; } /* * constructor: runs the command and saves the results */ ShellCommand::ShellCommand(const char* cmd) : status_(0), stdOut_(NULL), stdErr_(NULL) { pid_t pid; int stdout_fds[2], stderr_fds[2]; // stdout and stderr pipes if (pipe(stdout_fds) || pipe(stderr_fds)) { status_ = sys_error("coudn't create pipe"); } pid = fork (); if (pid < 0) { status_ = sys_error("could not fork process"); return; } if (pid == 0) { // child process. dup2(stdout_fds[1], 1); dup2(stderr_fds[1], 2); close(stdout_fds[0]); close(stderr_fds[0]); execl ("/bin/sh", "sh", "-c", cmd, NULL); _exit (256); } // parent process. if (waitpid (pid, &status_, 0) == -1) { status_ = sys_error("error waiting for process"); kill(pid, SIGTERM); // allan: 6.3.98: by request kill(pid, SIGKILL); // in case first kill didn't work return; } int status = status_; // workaround for bug in egcs-1.0.3? status_ = WEXITSTATUS(status); stdOut_ = read_pipe(stdout_fds[0]); stdErr_ = read_pipe(stderr_fds[0]); close(stdout_fds[0]); close(stderr_fds[0]); close(stdout_fds[1]); close(stderr_fds[1]); if (status_ != 0 && stdErr_) { error(stdErr_); } } /* * destructor - free the command results */ ShellCommand::~ShellCommand() { if (stdOut_) delete stdOut_; if (stdErr_) delete stdErr_; } skycat-3.1.2-starlink-1b/tclutil/generic/ShellCommand.h000066400000000000000000000017741215713201500227610ustar00rootroot00000000000000// -*-c++-*- #ifndef _ShellCommand_h_ #define _ShellCommand_h_ /* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: ShellCommand.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * ShellCommand.h - class to exec a shell command and save the status, * stdout and stderr * * who when what * -------------- --------- ---------------------------------------- * Allan Brighton 12 Jun 96 Created */ class ShellCommand { private: int status_; // command exit status char* stdOut_; // command output char* stdErr_; // error output public: // constructor: runs the command and saves the results. ShellCommand(const char* cmd); // destructor ~ShellCommand(); int status() {return status_;} // return ptr to the stdout or stderr of the command // Note: these will be deleted automatically with this object const char* stdOut() {return stdOut_;} const char* stdErr() {return stdErr_;} }; #endif /* _ShellCommand_h_ */ skycat-3.1.2-starlink-1b/tclutil/generic/TclCommand.C000066400000000000000000000174521215713201500223670ustar00rootroot00000000000000/* * TclCommand.C - base class definitions for tcl command classes * "@(#) $Id: TclCommand.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. * */ static const char* const rcsId="@(#) $Id: TclCommand.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "error.h" #include "TclCommand.h" using namespace std; // static member: used to generate unique names int TclCommand::seq_ = 0; // static member: interp used for error reporting Tcl_Interp* TclCommand::maininterp_ = NULL; /* * Constructor - install the named tcl command in the interpreter * and initialize a hash table of tcl subcommands for this command. */ TclCommand::TclCommand(Tcl_Interp* interp, const char* cmdname, const char* instname) : interp_(interp), status_(TCL_OK) { // set the error routine to use for error reporting (see error.C) maininterp_ = interp; set_error_handler(tcl_error); // save the command name cmdname_ = strdup(cmdname); // generate a name if necessary if (strcmp(instname, "#auto") == 0) { instname_ = new char[strlen(cmdname_)+16]; sprintf(instname_, "%s%d", cmdname_, seq_++); } else { instname_ = new char[strlen(instname)+1]; strcpy(instname_, instname); } // create the basic tcl command and return its name Tcl_CreateCommand(interp, instname_, (Tcl_CmdProc*)TclCommand::tclCmdProc, (ClientData)this, TclCommand::tclDeleteProc); // The result of the comamnd is its name // Note: if you access the tcl interpreter in a subclass constructor, // you will have to reset the result again before returning. Tcl_SetResult(interp, instname_, TCL_STATIC); } /* * Dxestructor - called when tcl command is deleted */ TclCommand::~TclCommand() { free((char*)cmdname_); delete[] instname_; instname_ = NULL; } /* * check the arg count for a subcommand and return an error in * Tcl if it is out of range */ int TclCommand::check_args(const char* name, int argc, int min_args, int max_args) { if (argc >= min_args && argc <= max_args) return TCL_OK; Tcl_AppendResult(interp_, "wrong number of args, should be \"", instname_, " ", name, " ?args?\"", NULL); return TCL_ERROR; } /* * Call the given method in this class with the given arguments * (in this case there is only one method defined: "delete" */ int TclCommand::call(const char* name, int len, int argc, char* argv[]) { if (strncmp(name, "delete", len) == 0) { return deleteCmd(argc, argv); } Tcl_AppendResult(interp_, "unknown ", cmdname_, " subcommand: \"", name, "\"", NULL); return TCL_ERROR; } /* * This method is called for operations on the tcl objects created above * - just call a member function to be defined in the subclass */ int TclCommand::tclCmdProc(ClientData thisPtr, Tcl_Interp* interp, int argc, char* argv[]) { // saved this ptr for command TclCommand* tclcmd = (TclCommand*)thisPtr; // must be at least "cmd subcmd" if (argc >= 2) { Tcl_ResetResult(tclcmd->interp_); int len = strlen(argv[1]); if (len) return tclcmd->call(argv[1], len, argc-2, argv+2); } // error: arg count wrong Tcl_AppendResult(interp, "wrong number of args, should be \"", argv[0], " command ?args?\"", NULL); return TCL_ERROR; } /* * This static method is called by Tk when a tcl object is deleted. * Delete the C++ object passed as client data. */ void TclCommand::tclDeleteProc(ClientData thisPtr) { // pointer to current object TclCommand* tclcmd = (TclCommand*)thisPtr; delete tclcmd; } /* * delete subcommand - Remove the Tcl command from the interpreter * (the C++ object is deleted when the tclDeleteProc is called) */ int TclCommand::deleteCmd(int, char**) { return Tcl_DeleteCommand(interp_, instname_); } /* * return an integer value in tcl */ int TclCommand::set_result(int i) { char buf[32]; sprintf(buf, "%d", i); Tcl_SetResult(interp_, buf, TCL_VOLATILE); return TCL_OK; } /* * return 2 integer values in tcl */ int TclCommand::set_result(int i, int j) { char buf[64]; sprintf(buf, "%d %d", i, j); Tcl_SetResult(interp_, buf, TCL_VOLATILE); return TCL_OK; } /* * return 2 double values in tcl */ int TclCommand::set_result(double i, double j) { // PWD: use Tcl_PrintDouble to get tcl_precision encoded doubles. char buf[TCL_DOUBLE_SPACE + 1]; Tcl_ResetResult(interp_); Tcl_PrintDouble(interp_, i, buf ); Tcl_AppendResult(interp_, buf, (char *)NULL); buf[0] = ' '; Tcl_PrintDouble(interp_, j, buf + 1 ); Tcl_AppendResult(interp_, buf, (char *)NULL); return TCL_OK; } /* * return a double value in tcl */ int TclCommand::set_result(double d) { // PWD: use Tcl_PrintDouble to get tcl_precision encoded doubles. char buf[TCL_DOUBLE_SPACE]; Tcl_PrintDouble(interp_, d, buf ); Tcl_SetResult(interp_, buf, TCL_VOLATILE); return TCL_OK; } /* * return a string value in tcl */ int TclCommand::set_result(const char* s) { Tcl_SetResult(interp_, (char*)s, TCL_VOLATILE); return TCL_OK; } /* * Reset the Tcl result to empty */ int TclCommand::reset_result() { Tcl_ResetResult(interp_); return TCL_OK; } /* * append a string value to the tcl result */ int TclCommand::append_result(const char* s) { Tcl_AppendResult(interp_, (char*)s, NULL); return TCL_OK; } /* * append an integer value to the tcl result list */ int TclCommand::append_element(int i) { char buf[32]; sprintf(buf, "%d", i); Tcl_AppendElement(interp_, buf); return TCL_OK; } /* * append 2 integer values to the tcl result list */ int TclCommand::append_element(int i, int j) { char buf[64]; sprintf(buf, "%d %d", i, j); Tcl_AppendElement(interp_, buf); return TCL_OK; } /* * append 2 double values to the tcl result list */ int TclCommand::append_element(double i, double j) { // PWD: use Tcl_PrintDouble to get tcl_precision encoded doubles. char buf[TCL_DOUBLE_SPACE + 1]; Tcl_PrintDouble(interp_, i, buf ); Tcl_AppendElement(interp_, buf); buf[0] = ' '; Tcl_PrintDouble(interp_, j, buf + 1 ); Tcl_AppendElement(interp_, buf); return TCL_OK; } /* * append a double value to the tcl result list */ int TclCommand::append_element(double d) { // PWD: use Tcl_PrintDouble to get tcl_precision encoded doubles. char buf[TCL_DOUBLE_SPACE + 1]; Tcl_PrintDouble(interp_, d, buf ); Tcl_AppendElement(interp_, buf); return TCL_OK; } /* * append a string value to the tcl result list */ int TclCommand::append_element(const char* s) { Tcl_AppendElement(interp_, (char*)s); return TCL_OK; } /* * report an error messageto the tcl result list */ int TclCommand::error(const char* msg1, const char* msg2) { // msg1 or msg2 might be the same as interp_->result... ostringstream os; os << msg1 << msg2; Tcl_ResetResult(interp_); Tcl_SetResult(interp_, (char*)os.str().c_str(), TCL_VOLATILE); return TCL_ERROR; } /* * report an error message, keeping existing messages. */ int TclCommand::more_error(const char* msg1, const char* msg2) { // msg1 or msg2 might be the same as interp_->result... ostringstream os; os << msg1 << msg2; Tcl_AppendResult(interp_, os.str().c_str(), (char *)NULL); return TCL_ERROR; } /* * static error message reporter, called from error.C to report error */ void TclCommand::tcl_error(const char* msg) { Tcl_ResetResult(maininterp_); Tcl_SetResult(maininterp_, (char*)msg, TCL_VOLATILE); } skycat-3.1.2-starlink-1b/tclutil/generic/TclCommand.h000066400000000000000000000060711215713201500224270ustar00rootroot00000000000000// -*-c++-*- #ifndef _TclCommand_H_ #define _TclCommand_H_ /* * TclCommand.h - base class for tcl commands implemented in C++. * * This base class assumes that each derived class has a virtual "call" * member function that will call a method by name to implement a Tcl * subcommand. The search for a member function starts at the bottom * and ends at the top of the class hierarchy - in this class. * * The tcl command is assumed to have an [incr Tcl] like syntax: * * cmdName instName ?args? * or: cmdName #auto ?args? * and then: instName subCmd ?args? * * See the man page for a complete description. * ----------------------------------------------------------------------------- * "@(#) $Id: TclCommand.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" */ #include /* * This is the base class for classes defining tcl commands from * C++ classes */ class TclCommand { protected: // tcl interpreter Tcl_Interp* interp_; static Tcl_Interp* maininterp_; // status after constructor int status_; // class of tcl command (same as prefix for instname_) const char* cmdname_; // name of tcl command created for this object char* instname_; // used to generate unique tcl command name if name is specified as '#auto' static int seq_; protected: // tcl command proc, called by tcl, calls the correct member function static int tclCmdProc(ClientData, Tcl_Interp* interp, int argc, char* argv[]); // tcl delete proc, called when tcl object is deleted static void tclDeleteProc(ClientData); // check the arg count for a subcommand int check_args(const char* name, int argc, int min_args, int max_args); // call a member function by name virtual int call(const char* name, int len, int argc, char* argv[]); // return a value (or a pair of values) in tcl int set_result(int); int set_result(int, int); int set_result(double); int set_result(double, double); int set_result(const char*); // append a string to the tcl result int append_result(const char*); // append a value (or a pair of values) to the tcl result list int append_element(int); int append_element(int, int); int append_element(double); int append_element(double, double); int append_element(const char*); // Reset the Tcl result to empty int reset_result(); // evaluate Tcl code int eval(const char* cmd) {return Tcl_Eval(interp_, (char*)cmd);} // report an error in tcl int error(const char* msg1, const char* msg2=""); int more_error(const char* msg1, const char* msg2=""); static void tcl_error(const char* msg); public: // constructor TclCommand(Tcl_Interp*, const char* cmdname, const char* instname); // destructor virtual ~TclCommand(); // tcl delete sub command (always the same) virtual int deleteCmd(int argc, char** argv); // member access Tcl_Interp* interp() {return interp_;} int status() const { return status_; } char* instname() {return instname_;} }; #endif /* _TclCommand_H_ */ skycat-3.1.2-starlink-1b/tclutil/generic/Tclutil.C000066400000000000000000000055721215713201500217660ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: Tclutil.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Tclutil.C - Initialize Tclutil package * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 21 Nov 97 Created * pbiereic 26/08/99 Changed Tclutil_Init() * pbiereic 17/02/03 Added 'using namespace std'. * Allan Brighton 28/12/05 Replaced init script */ static const char* const rcsId="@(#) $Id: Tclutil.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "tcl.h" #include "tk.h" #include "error.h" // Since we have to link the BLT library anyway (because we're using the BLT C interface) // call the init routine directly extern "C" int Blt_Init(Tcl_Interp *interp); // generated code for bitmaps used in tcl scripts void defineTclutilBitmaps(Tcl_Interp*); // Tcl procedure to search for an init for Tclutil startup file. static char initScript[] = "if {[info proc ::util::Init]==\"\"} {\n\ namespace eval ::util {}\n\ proc ::util::Init {} {\n" #ifdef MAC_TCL " source -rsrc TclutilInit.tcl\n" #else " global tclutil_library\n\ tcl_findLibrary tclutil " PACKAGE_VERSION " " PACKAGE_VERSION " TclutilInit.tcl TCLUTIL_LIBRARY tclutil_library\n" #endif " }\n\ }\n\ ::util::Init"; // dummy Tcl command implementation static int tclutil_cmd(ClientData, Tcl_Interp* interp, int argc, char** argv) { return TCL_OK; } /* * A call to this function is made from the tkAppInit file at startup * to initialize this package */ extern "C" int Tclutil_Init(Tcl_Interp* interp) { char buf[1024]; static int initialized = 0; if (initialized++) return TCL_OK; // initialize the required BLT package if (Blt_Init(interp) == TCL_ERROR) { return TCL_ERROR; } // set up Tcl package if (Tcl_PkgProvide(interp, "Tclutil", PACKAGE_VERSION) != TCL_OK) { return TCL_ERROR; } // define bitmaps used by Tcl library defineTclutilBitmaps(interp); // add a dummy tcl command (this command doesn't do anything currently) Tcl_CreateCommand(interp, "tclutil", (Tcl_CmdProc*)tclutil_cmd, NULL, NULL); // Set the global Tcl variable tclutil_version Tcl_SetVar(interp, "tclutil_version", PACKAGE_VERSION, TCL_GLOBAL_ONLY); // Hack to work around problem in older tcl-8.4.x versions: see ./tcl_findLibrary.h #if ((TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 4 && TCL_RELEASE_SERIAL < 11) || TCL_MAJOR_VERSION < 8 || TCL_MINOR_VERSION < 4) #include "tcl_findLibrary.h" if (Tcl_Eval(interp, tcl_findLibrary) != TCL_OK) return TCL_ERROR; #endif return Tcl_Eval(interp, initScript); } skycat-3.1.2-starlink-1b/tclutil/generic/TkImage.C000066400000000000000000000240011215713201500216530ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: TkImage.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * TkImage.C - base class definitions for Tk images implemented in C++ * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 13/10/97 Added makeGC call to constructor. * Allan Brighton 10/03/98 Pass config options to constructor as pointer * instead of reference. * Peter W. Draper 12/06/98 Removed explicit depth and visual, these * are now left at window defaults. * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ static const char* const rcsId="@(#) $Id: TkImage.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" #include "error.h" #include "ErrorHandler.h" #include "TkImage.h" /* * Constructor - create the image and install the tcl command of the * same name. * * interp - is the Tk interpreter * * cmdname - is the name of the tcl command that created this image * * instname - is the name of this image (and tcl command) * * specs - is a pointer to the image's config struct, which defines * the config options for the image * * options - is a derived struct that holds the values defined in specs. * * master - is passed from the Tk imaging routines * * pclass - if specified, makes sure that the image window has the given * Tk class */ TkImage::TkImage(Tcl_Interp* interp, const char* cmdname, const char* instname, Tk_ConfigSpec* specs, TkImageOptions* options, Tk_ImageMaster master, char* pclass) : TclCommand(interp, cmdname, instname), optionsPtr_(options), configSpecsPtr_(specs), master_(master), tkwin_(Tk_MainWindow(interp)), display_(Tk_Display(tkwin_)), visual_(Tk_Visual(tkwin_)), screen_(Tk_Screen(tkwin_)), gc_(None), pm_(None), width_(1), height_(1), pixw_(1), pixh_(1), depth_(Tk_Depth(tkwin_)), refCount_(0), pclass_(pclass), initialized_(0), update_pending_(0) { // Allan: Modification by P.W. Draper (advised by Dave Terrett). makeGC(); } /* * Dxestructor - called when tcl command is deleted */ TkImage::~TkImage() { if (gc_ != None) { Tk_FreeGC(display_, gc_); } if (pm_ != None) { XFreePixmap (display_, pm_); } Tk_FreeOptions(configSpecsPtr_, (char *) optionsPtr_, display_, 0); } /* * create the X graphics context for copying the image to the screen */ void TkImage::makeGC() { XColor* white = Tk_GetColor(interp_, tkwin_, "white"); XColor* black = Tk_GetColor(interp_, tkwin_, "black"); XGCValues gcValues; gcValues.foreground = (white != NULL)? white->pixel: WhitePixelOfScreen(screen_); gcValues.background = (black != NULL)? black->pixel: BlackPixelOfScreen(screen_); gcValues.graphics_exposures = False; gc_ = Tk_GetGC(tkwin_, GCForeground|GCBackground|GCGraphicsExposures, &gcValues); } /* * set the image dimensions to the given width and height and * if use_pixmap is 1, create or update a pixmap to have the same * dimensions */ int TkImage::setImageSize(int width, int height, int use_pixmap, int pixw, int pixh) { width_ = width; height_ = height; if (use_pixmap) { if (pm_ == None || pixw_ != pixw || pixh_ != pixh) { // delete previous pixmap if (pm_ != None) { XFreePixmap(display_, pm_); pm_ = None; } // catch errors when image is too large ErrorHandler errorHandler(display_); pm_ = XCreatePixmap(display_, RootWindowOfScreen(screen_), pixw_ = pixw, pixh_ = pixh, depth_); // check for errors if (pm_ == None || errorHandler.errors()) { if (pm_ != None) { XFreePixmap(display_, pm_); pm_ = None; } error("Can't create pixmap large enough to hold image"); Tk_BackgroundError(interp_); return TCL_ERROR; } } } else { if (pm_ != None) { XFreePixmap(display_, pm_); pm_ = None; } } return TCL_OK; } /* * This static method is called by the Tk image handling routines * for each use of the image in a widget. */ ClientData TkImage::GetImage(Tk_Window tkwin, ClientData clientData) { TkImage* thisPtr = (TkImage*)clientData; return (ClientData)thisPtr->getImage(tkwin); } /* * This virtual method is called indirectly by the Tk image handling routines * for each use of the image in a widget. */ TkImage* TkImage::getImage(Tk_Window tkwin) { // only allow one instance (use views instead of instances, since // all instances must be the same size, which is not what we need here) if (refCount_) { error("Only one instance of this image type is allowed"); Tk_BackgroundError(interp_); return NULL; } // if pclass was specified, check that the parent window has that class if (pclass_ != NULL) { if (strcmp(Tk_Class(tkwin), pclass_) != 0) { error("This image type should only be used in a ", pclass_); Tk_BackgroundError(interp_); return NULL; } } refCount_++; // Make a new instance of the image. tkwin_ = tkwin; display_ = Tk_Display(tkwin_); // PWD: leave these at defaults. // visual_ = Tk_Visual(tkwin_); // depth_ = 8; // make the graphics context now that we have the window Tk_MakeWindowExist(tkwin_); // allan: 14.2.96: fix problem reported by // David Terret, when window is not mapped yet makeGC(); Tk_ImageChanged(master_, 0, 0, 0, 0, width_, height_); return this; } /* * This static method is invoked by the Tk image handling routines * to draw a the image. */ void TkImage::DisplayImage( ClientData clientData, // pointer to class instance Display *display, // Display on which to draw image. Drawable drawable, // Pixmap or window in which to draw image. int imageX, int imageY, // Upper-left corner of region within image to draw. int width, int height, // Dimensions of region within image to draw. int drawableX, int drawableY) // Coordinates within drawable that { TkImage* thisPtr = (TkImage*)clientData; thisPtr->displayImage(drawable, imageX, imageY, width, height, drawableX, drawableY); } /* * This static method is called by the Tk image handling routines * when a widget ceases to use a particular instance of an image. * We don't actually get rid of the instance until later because we * may be about to get this instance again. */ void TkImage::FreeImage(ClientData clientData, Display *display) { // TkImage* thisPtr = (TkImage*)clientData; // XXX add a do-when-idle call to delete "thisPtr" ? } /* * This method should be called when the image has changed and should be * redrawn eventually */ void TkImage::imageChanged() { Tk_ImageChanged(master_, 0, 0, width_, height_, width_, height_); update_pending_++; } /* * This static method is invoked by Tk_EventuallyFree to clean up * the internal structure of the image at a safe time */ void TkImage::DeleteImage(ClientData clientData) { TkImage *thisPtr = (TkImage *)clientData; // deleting the tcl command will result in the virtual // destructors being called, which should do the cleanup Tcl_DeleteCommand(thisPtr->interp_, thisPtr->instname_); } /* * This procedure needs to be called from the derived class constructor * to complete the image initialization. This can't be done in the * constructor here since the options_ struct wouldn't be initialized yet. */ int TkImage::initImage(int argc, char* argv[]) { // handle the config options if ((status_ = configureImage(argc, argv, 0)) != TCL_OK) { // XXX add some clean up code here ... return TCL_ERROR; } // return the name of the image as a tcl result Tcl_SetResult(interp_, instname_, TCL_STATIC); initialized_ = 1; return TCL_OK; } /* * utility method: equivalent of Tk "update idletasks" command, * process all pending display events. */ void TkImage::updateIdleTasks() { while (1) { while (Tk_DoOneEvent(TK_IDLE_EVENTS) != 0) { /* Empty loop body */ } XSync(display_, False); if (Tk_DoOneEvent(TK_IDLE_EVENTS) == 0) { break; } } } /* * This procedure is called to process an argv/argc list, plus * the Tk option database, in order to configure (or reconfigure) * a image. */ int TkImage::configureImage(int argc, char* argv[], int flags) { if (Tk_ConfigureWidget(interp_, tkwin_, configSpecsPtr_, argc, argv, (char*)optionsPtr_, flags) != TCL_OK) { return TCL_ERROR; } return TCL_OK; } /* * this is called for the configure image command */ int TkImage::configureCmd(int argc, char* argv[]) { if (argc == 0) { return Tk_ConfigureInfo(interp_, tkwin_, configSpecsPtr_, (char*)optionsPtr_, NULL, 0); } else if (argc == 1) { return Tk_ConfigureInfo(interp_, tkwin_, configSpecsPtr_, (char*)optionsPtr_, argv[0], 0); } else { return configureImage(argc, argv, TK_CONFIG_ARGV_ONLY); } } /* * this is called for the tcget image command */ int TkImage::cgetCmd(int argc, char* argv[]) { if (argc != 1) { return error("wrong # args: should be: \"$image cget option\""); } return Tk_ConfigureValue(interp_, tkwin_, configSpecsPtr_, (char*)optionsPtr_, argv[0], TK_CONFIG_ARGV_ONLY); } /* * Call the given method in this class with the given arguments */ int TkImage::call(const char* name, int len, int argc, char* argv[]) { if (strncmp(name, "configure", len) == 0) { return configureCmd(argc, argv); } else if (strncmp(name, "cget", len) == 0) { return cgetCmd(argc, argv); } return TclCommand::call(name, len, argc, argv); } /* * delete subcommand - * (should probably redefine to use "image delete $image") */ int TkImage::deleteCmd(int, char**) { return error("use \"image delete $image\" to delete the image."); } skycat-3.1.2-starlink-1b/tclutil/generic/TkImage.h000066400000000000000000000106111215713201500217220ustar00rootroot00000000000000// -*-c++-*- #ifndef _TkImage_H_ #define _TkImage_H_ /* * E.S.O. - VLT project * "@(#) $Id: TkImage.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * TkImage.h - base class for Tk images implemented in C++. * * This class adds some features to the TclCommand class for * implementing Tk image types. * * See the man page for a complete description. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * 10/03/98 Pass config options to constructor as pointer * instead of reference. */ #include #include "TclCommand.h" /* * This class or a class derived from it is used to hold the values * modified by the configure image command */ class TkImageOptions { public: }; /* * This is the base class for classes defining tk images from * C++ classes. * In this class, only one instance of an image may be displayed, * in a window, however multiple views of the image with varying * sizes may be displayed (I didn't see any need for exact copies * of the same image in the same size...) */ class TkImage : public TclCommand { protected: Tk_ImageMaster master_; // passed from the Tk imaging routines TkImageOptions* optionsPtr_; // ptr to class or struct holding option values Tk_ConfigSpec* configSpecsPtr_; // ptr to configSpecs array for Tk options int refCount_; // Number of instances that share this // image (may only be one here). Tk_Window tkwin_; // Window in which the image will be displayed. Display *display_; // X token for the window's display Visual *visual_; // X visual for window Screen *screen_; // X screen for window GC gc_; // Graphics context for copying to screen Pixmap pm_; // Pixmap for storing the image int width_; // total width of image int height_; // total height of image int pixw_; // width of X pixmap, if used int pixh_; // height of X pixmap, if used int depth_; // depth of screen char* pclass_; // if specified, restrict images to only be displayed // in widgets of that class int update_pending_; // flag: true if image needs to be updated int initialized_; // flag: true after image has been initialized // (configured, after constructor is done) // -- member functions -- // do first time image configuration virtual int initImage(int argc, char* argv[]); // configure the image with cmd line options. virtual int configureImage(int argc, char* argv[], int flags = 0); // these are called indirectly by the Tk imaging routines virtual TkImage* getImage(Tk_Window); virtual void displayImage(Drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY) = 0; // update the image display eventually virtual void imageChanged(); // make the X graphics context void makeGC(); // set the image size and create/update a pixmap, if use_pixmap is 1 int setImageSize(int width, int height, int use_pixmap, int pixw, int pixh); // utility method: equivalent of Tk "update idletasks" command void updateIdleTasks(); // call a member function by name virtual int call(const char* name, int len, int argc, char* argv[]); public: // constructor TkImage(Tcl_Interp* interp, const char* cmdname, const char* instname, Tk_ConfigSpec* specs, TkImageOptions* options, Tk_ImageMaster master, char* pclass = NULL); // destructor virtual ~TkImage(); // the following static methods are called by the Tk image handling routines static ClientData GetImage(Tk_Window, ClientData); static void DisplayImage(ClientData, Display*, Drawable, int imageX, int imageY, int width, int height, int drawableX, int drawableY); static void FreeImage(ClientData, Display*); static void DeleteImage(ClientData); // implement the configure Tk command virtual int configureCmd(int argc, char* argv[]); // called for the cget image command virtual int cgetCmd(int argc, char* argv[]); // delete tcl subcommand // (should probably redefine to use "image delete $image") virtual int deleteCmd(int argc, char* argv[]); // set options pointer void setOptionsPtr(char * ptr) {optionsPtr_ = (TkImageOptions *)ptr;} }; #endif /* _TkImage_H_ */ skycat-3.1.2-starlink-1b/tclutil/generic/TkWidget.C000066400000000000000000000152131215713201500220610ustar00rootroot00000000000000/* * TkWidget.C - base class definitions for Tk widgets implemented in C++ * * "@(#) $Id: TkWidget.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * See the man page for a complete description. * * * who when what * -------------- -------- ---------------------------------------- * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ static const char* const rcsId="@(#) $Id: TkWidget.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; using namespace std; #include #include #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "TkWidget.h" /* * Constructor - create the widget and install the tcl command of the * same name. * * pclass - if non null, is the expected class of the parent widget * (Canvas, Frame, ...) * * specs - is a pointer to the widget's config struct, which defines * the config options for the widget * * options - is a derived struct that holds the values defined in specs. * * argc, argv - are passed from the widget command (argv[0] is the widget command) */ TkWidget::TkWidget(Tcl_Interp* interp, const char* pclass, Tk_ConfigSpec* specs, TkWidgetOptions& options, int /* argc */, char* argv[]) : TclCommand(interp, argv[0], argv[1]), tkwin_(NULL), pname_(strdup(instname_)), wclass_(strdup(cmdname_)), configSpecsPtr_(specs), optionsPtr_(&options), redraw_pending_(0) { // if pclass was specified, check that the parent window has that class if (pclass != NULL) { // get the name of the parent window from the widgets's path char* p = strrchr(pname_, '.'); if (p != NULL) *p = '\0'; if (p == NULL || strcmp(Tk_Class(Tk_NameToWindow(interp, pname_, Tk_MainWindow(interp))), pclass) != 0) { status_ = TCL_ERROR; Tcl_ResetResult(interp_); Tcl_AppendResult(interp, "bad path name for ", cmdname_, ": \"", instname_, "\" parent of ", cmdname_, " should be a ", pclass, " widget", 0); return; } } // create the widget window tkwin_ = Tk_CreateWindowFromPath(interp, Tk_MainWindow(interp), instname_, NULL); if (tkwin_ == NULL) { status_ = TCL_ERROR; return; } display_ = Tk_Display(tkwin_); // set the class to the widget type with the first letter capitalized *wclass_ = toupper(*wclass_); Tk_SetClass(tkwin_, wclass_); // add event handler to catch destroy event Tk_CreateEventHandler(tkwin_, StructureNotifyMask, structureNotify, (ClientData)this); } /* * Dxestructor - called when tcl command is deleted */ TkWidget::~TkWidget() { free(pname_); free(wclass_); /* free config options */ Tk_FreeOptions(configSpecsPtr_, (char *) optionsPtr_, display_, 0); } /* * This static method is called for StructureNotify events in the widget */ void TkWidget::structureNotify(ClientData clientData, XEvent *eventPtr) { TkWidget* thisPtr = (TkWidget*)clientData; if (eventPtr->type == DestroyNotify) thisPtr->destroyNotify(eventPtr); else if (eventPtr->type == ConfigureNotify) thisPtr->configureNotify(eventPtr); } /* * method called for DestroyNotify events in the widget */ void TkWidget::destroyNotify(XEvent *eventPtr) { Tk_CancelIdleCall(redrawWidget, (ClientData)this); tkwin_ = NULL; Tk_EventuallyFree((ClientData) this, destroyProc); } /* * method called for ConfigureNotify events in the widget * (when the window is resized) */ void TkWidget::configureNotify(XEvent *eventPtr) { } /* * This static method is invoked by Tk_EventuallyFree to clean up * the internal structure of the widget at a safe time */ void TkWidget::destroyProc(char *clientData) { TkWidget *thisPtr = (TkWidget *)clientData; // deleting the tcl command will result in the virtual // destructors being called, which should do the cleanup Tcl_DeleteCommand(thisPtr->interp_, thisPtr->instname_); } /* * This procedure needs to be called from the derived class constructor * to complete the widget initialization. This can't be done in the * constructor here since the options_ struct wouldn't be initialized yet. */ int TkWidget::initWidget(int argc, char* argv[]) { // handle the config options if ((status_ = configureWidget(argc-2, argv+2, 0)) != TCL_OK) { Tk_DestroyWindow(tkwin_); tkwin_ = NULL; return TCL_ERROR; } // return the name of the widget as a tcl result Tcl_SetResult(interp_, instname_, TCL_STATIC); return TCL_OK; } /* * This procedure is called to process an argv/argc list, plus * the Tk option database, in order to configure (or reconfigure) * a widget. */ int TkWidget::configureWidget(int argc, char* argv[], int flags) { if (Tk_ConfigureWidget(interp_, tkwin_, configSpecsPtr_, argc, argv, (char*)optionsPtr_, flags) != TCL_OK) { return TCL_ERROR; } return TCL_OK; } /* * this is called for the configure widget command */ int TkWidget::configureCmd(int argc, char* argv[]) { if (argc == 0) { return Tk_ConfigureInfo(interp_, tkwin_, configSpecsPtr_, (char*)optionsPtr_, NULL, 0); } else if (argc == 1) { return Tk_ConfigureInfo(interp_, tkwin_, configSpecsPtr_, (char*)optionsPtr_, argv[0], 0); } else { eventually_redraw(); return configureWidget(argc, argv, TK_CONFIG_ARGV_ONLY); } } /* * If not already scheduled, schedule the widget to be redrawn */ int TkWidget::eventually_redraw() { if (!redraw_pending_) { Tk_DoWhenIdle(redrawWidget, (ClientData) this); redraw_pending_ = 1; } return TCL_OK; } /* * Redraw the widget by calling the virtual redraw_ method * which may be defined in a derived class. */ void TkWidget::redrawWidget(ClientData clientData) { TkWidget* thisPtr = (TkWidget*)clientData; thisPtr->redraw(); thisPtr->redraw_pending_ = 0; } /* * this method may be redefined in a derived class to redraw * the widget. */ void TkWidget::redraw() { } /* * this is called for the tcget widget command */ int TkWidget::cgetCmd(int argc, char* argv[]) { if (argc != 1) return error("wrong # args: should be: \"$widget cget option\""); return Tk_ConfigureValue(interp_, tkwin_, configSpecsPtr_, (char*)optionsPtr_, argv[0], TK_CONFIG_ARGV_ONLY); } /* * Call the given method in this class with the given arguments * (In this case there is only one command defined: "configure" */ int TkWidget::call(const char* name, int len, int argc, char* argv[]) { if (strncmp(name, "configure", len) == 0) { return configureCmd(argc, argv); } else if (strncmp(name, "cget", len) == 0) { return cgetCmd(argc, argv); } return TclCommand::call(name, len, argc, argv); } skycat-3.1.2-starlink-1b/tclutil/generic/TkWidget.h000066400000000000000000000055461215713201500221360ustar00rootroot00000000000000// -*-c++-*- #ifndef _TkWidget_H_ #define _TkWidget_H_ /* * TkWidget.h - base class for Tk widgets implemented in C++. * * This class adds some features to the TclCommand class for * implementing Tk widgets. * * See the man page for a complete description. * * ----------------------------------------------------------------------------- * "@(#) $Id: TkWidget.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" */ #include #include "TclCommand.h" /* * A struct derived from this one is used to hold the values * modified by the configure widget command */ class TkWidgetOptions {}; /* * This is the base class for classes defining tk widgets from * C++ classes */ class TkWidget : public TclCommand { protected: Tk_Window tkwin_; // widget's Tk window Display *display_; // X token for the window's display char* pname_; // name of parent window char* wclass_; // this widget's class Tk_ConfigSpec* configSpecsPtr_; // ptr to widget's config struct TkWidgetOptions* optionsPtr_; // ptr to struct holding option values int redraw_pending_; // flag: true if widget needs to be redrawn // do first time widget configuration virtual int initWidget(int argc, char* argv[]); // configure the widget with cmd line options. virtual int configureWidget(int argc, char* argv[], int flags = 0); // If not already scheduled, schedule the widget to be redrawn virtual int eventually_redraw(); // this method may be redefined in a derived class to redraw // the widget. virtual void redraw(); // called for DestroyNotify events in the widget virtual void destroyNotify(XEvent *eventPtr); // called for ConfigureNotify events (resize) virtual void configureNotify(XEvent *eventPtr); public: // constructor: pclass is the expected parent window class type, // the specs and options args are used to process the command line // args and for the configure widget command. TkWidget(Tcl_Interp*, const char* pclass, Tk_ConfigSpec* specs, TkWidgetOptions& options, int argc, char* argv[]); // destructor virtual ~TkWidget(); // call a member function by name virtual int call(const char* name, int len, int argc, char* argv[]); virtual int configureCmd(int argc, char* argv[]); // called for the cget widget command virtual int cgetCmd(int argc, char* argv[]); // Redraw the widget by calling the virtual redraw_ method // which may be defined in a derived class. static void redrawWidget(ClientData); // called for StructureNotify events in the widget static void structureNotify(ClientData clientData, XEvent *eventPtr); // invoked by Tk_EventuallyFree to clean up widget static void destroyProc(char *clientData); }; #endif /* _TkWidget_H_ */ skycat-3.1.2-starlink-1b/tclutil/generic/base64.C000066400000000000000000000067351215713201500214340ustar00rootroot00000000000000 /* * E.S.O. - VLT project/ESO Archive * $Id: base64.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * base64.C - utility routines for base64 encoding and decoding * (needed for some HTTP protocols, such as password * encoding). * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton Jul 15 Created, based on modified versions of * mozilla routines in libi18n/mime2fun.c * See http://www.mozilla.org/NPL/. */ static const char* const rcsId="@(#) $Id: base64.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include "base64.h" static char basis_64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; static int encode_base64_ (const char *in, char *out) { unsigned char c1, c2, c3; c1 = in[0]; c2 = in[1]; c3 = in[2]; *out++ = basis_64[c1>>2]; *out++ = basis_64[((c1 & 0x3)<< 4) | ((c2 & 0xF0) >> 4)]; *out++ = basis_64[((c2 & 0xF) << 2) | ((c3 & 0xC0) >>6)]; *out++ = basis_64[c3 & 0x3F]; return 1; } char *encode_base64(char *input) { char *output = 0; char *pSrc, *pDest ; int i ; size_t size = strlen(input); output = (char *)malloc(size * 4 / 3 + 4); if (output == NULL) return NULL; pSrc = input; pDest = output ; for (i = size; i >= 3; i -= 3) { if (encode_base64_(pSrc, pDest) == 0) { /* error */ pSrc += 3; pDest += 3; } else { pSrc += 3; pDest += 4; } } /* in case (i % 3 ) == 1 or 2 */ if(i > 0) { char in[3]; int j; in[0] = in[1] = in[2] ='\0'; for(j=0;j= 'A' && in[j] <= 'Z') c = in[j] - 'A'; else if (in[j] >= 'a' && in[j] <= 'z') c = in[j] - ('a' - 26); else if (in[j] >= '0' && in[j] <= '9') c = in[j] - ('0' - 52); else if (in[j] == '+') c = 62; else if (in[j] == '/') c = 63; else if (in[j] == '=') c = 0; else { /* abort (); */ strcpy(out, in); /* I hate abort */ return 0; } num = (num << 6) | c; } *out++ = (unsigned char) (num >> 16); *out++ = (unsigned char) ((num >> 8) & 0xFF); *out++ = (unsigned char) (num & 0xFF); return 1; } char *decode_base64(char *input) { char *output = strdup(input);; char *pSrc = input, *pDest = output; int i ; for (i = strlen(input); i > 3; i -= 4) { if (decode_base64_(pSrc, pDest) == 0) { pSrc += 4; pDest += 4; } else { pSrc += 4; pDest += 3; } } *pDest = '\0'; return output; } #if TEST_BASE64 /* for testing */ main() { char* input = "Aladdin:open sesame"; char* base64 = "QWxhZGRpbjpvcGVuIHNlc2FtZQ=="; char* s = encode_base64(input); char* output = decode_base64(s); printf("base64 encoded value of %s is %s (should be %s)\n", input, s, base64); printf("decoded value of input %s is %s\n", s, output); printf("decoded value of target %s is %s\n", base64, decode_base64(base64)); if (strcmp(input, output) == 0) printf("TEST PASSED\n"); else printf("TEST FAILED\n"); exit(0); } #endif skycat-3.1.2-starlink-1b/tclutil/generic/base64.h000066400000000000000000000006401215713201500214660ustar00rootroot00000000000000 /* * E.S.O. - VLT project/ESO Archive * $Id: base64.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * base64.h - declarations for base64 encoding and decoding * utility routines. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton Jul 15 Created */ char *encode_base64(char *input); char *decode_base64(char *input); skycat-3.1.2-starlink-1b/tclutil/generic/define.h000066400000000000000000000063341215713201500216420ustar00rootroot00000000000000// -*-c++-*- #ifndef _define_h_ #define _define_h_ /* * * E.S.O. - VLT project * * $Id: define.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ * * define.h - common definitions * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * pbiereic 17/02/03 Added defines for byte swap and SOCKLEN_T * Peter W. Draper 16/12/05 Redo SOCKLEN_T logic. Only set when socklen_t * is not defined. Use a typedef. * pbiereic 12/08/07 added support for data types double and long long int */ #include #include #ifdef HAVE_CONFIG_H #include "config.h" #endif // Byte swap defines. On little Endian machines we use the network-to-host // routines since they are faster (implemented in assembler code). #ifdef WORDS_BIGENDIAN # define BIGENDIAN 1 // from /usr/include/bits/byteswap.h: # define SWAP16(x) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)) # define SWAP32(x) ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24)) #else # define BIGENDIAN 0 # define SWAP16(x) (ntohs((unsigned short)x)) # define SWAP32(x) (ntohl((unsigned int)x)) #endif /* ifdef WORDS_BIGENDIAN */ #define SWAP64(x) ( \ (((x) & 0xff00000000000000ull) >> 56) \ | (((x) & 0x00ff000000000000ull) >> 40) \ | (((x) & 0x0000ff0000000000ull) >> 24) \ | (((x) & 0x000000ff00000000ull) >> 8) \ | (((x) & 0x00000000ff000000ull) << 8) \ | (((x) & 0x0000000000ff0000ull) << 24) \ | (((x) & 0x000000000000ff00ull) << 40) \ | (((x) & 0x00000000000000ffull) << 56)) // Float data: Prevent auto conversions. // No speed hits if this is compiled with gcc -O. inline float SWAP_FLOAT(float x) { union {float f; unsigned int i;} u; u.f = x; u.i = SWAP32(u.i); return u.f; } inline double SWAP_DOUBLE(double x) { union {double d; unsigned long long l;} u; u.d = x; u.l = SWAP64(u.l); return u.d; } /* Make sure we always have a socklen_t type */ #if ! HAVE_SOCKLEN_T # if defined(linux) typedef unsigned int socklen_t; # elif defined(_XPG4_2) typedef size_t socklen_t; # else typedef int socklen_t; # endif #endif // min/max inline int min(int x, int y) {return xy ? x : y;} inline double min(double x, double y) {return xy ? x : y;} // swap values inline void swap(int& x, int& y) {int tmp = x; x = y; y = tmp;} inline void swap(double& x, double& y) {double tmp = x; x = y; y = tmp;} // inline int roundup(int nbytes, int pad) {return ((nbytes + (pad - 1)) / pad) * pad;} /* * time a function call * usage: TIMECALL("name", function(args,...)); */ #ifndef DEBUG #define TIMECALL(name,func) func #else #include #include #include extern "C" int ftime(timeb *tp); #define TIMECALL(name,func) {\ timeb tp1,tp2; \ ftime(&tp1); \ func; \ ftime(&tp2); \ fprintf(stderr, "time %s: %d\n", name, (tp2.time-tp1.time)*1000+(tp2.millitm-tp1.millitm)); \ } #endif #endif /* _define_h_ */ skycat-3.1.2-starlink-1b/tclutil/generic/error.C000066400000000000000000000121311215713201500214640ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: error.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * error.C - error reporting routines * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created * Peter W. Draper 08/05/98 ifdef'd errno.h include for * linux. Something horrible happens here * under RH5 and glibc. * 08/12/98 Changed for egcs compiler * 21/01/03 Changed for gcc3, now only uses syserror * rather than errno and sys_errlist. * 30/04/03 Removed ifdef for errno.h. Needed back * for RH7.3. * Allan Brighton 01/04/99 Replaced sys_errlist[] with strerror() * to get around porting problems * 20/01/03 Updated for gcc-3.2.1 * pbiereic 17/02/03 Added 'using namespace std'. Removed ::std specs. */ static const char* const rcsId="@(#) $Id: error.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include #include #include "error.h" using namespace std; // static variable holding text of last error messages static char errmsg_[5*1024]; // error code (see defines in for values) static int errno_ = 0; // optional error handler, to be called with error messages static void (*errhandler_)(const char*) = NULL; // optional message handler, to be called with log messages static void (*msghandler_)(const char*) = NULL; /* * global error reporting routine */ int error(const char* msg1, const char* msg2, int code) { ostringstream os; os << msg1 << msg2; if (errhandler_) (*errhandler_)(os.str().c_str()); else print_error(os.str().c_str()); #ifdef XXXDEBUG cerr << "debug: " << os.str().c_str() << endl; #endif errno_ = code; strncpy(errmsg_, os.str().c_str(), sizeof(errmsg_)-1); return ERROR; } /* * report the error, including system error code */ int sys_error(const char* msg1, const char* msg2) { char* s = strerror(errno); if (s == NULL || errno < 0 ) { return error(msg1, msg2); } ostringstream os; os << msg1 << msg2 << ": " << s; if (errhandler_) (*errhandler_)(os.str().c_str()); else print_error(os.str().c_str()); #ifdef XXXDEBUG cerr << "debug: " << os.str().c_str() << endl; #endif errno_ = errno; strncpy(errmsg_, os.str().c_str(), sizeof(errmsg_)-1); return ERROR; } /* * This routine has an interface like printf and reports an error in the * same way as error() above. */ int fmt_error(const char* fmt, ...) { char buf[1024]; va_list ap; va_start(ap, fmt); vsprintf(buf, fmt, ap); va_end(ap); return error(buf); } /* * This routine has an interface like printf and reports a system error * in the same way as sys_error() above. */ int fmt_sys_error(const char* fmt, ...) { char buf[1024]; va_list ap; va_start(ap, fmt); vsprintf(buf, fmt, ap); va_end(ap); return sys_error(buf); } /* * return the text of the previous error message */ char* last_error() { return errmsg_; } /* * return the error code for the previous error */ int last_error_code() { return errno_; } /* * reset the last_error buf to empty */ void clear_error() { errmsg_[0] = '\0'; } /* * set a routine to be called with the text of error messages * when they occur. The argument is a pointer to an error * handler: * * void errhandler(const char* msg); * * The return value is a pointer to the previous error handler, or NULL, * if none was defined. */ void (*set_error_handler(void (*errhandler)(const char*)))(const char*) { void (*old_handler)(const char*) = errhandler_; errhandler_ = errhandler; return old_handler; } /* * print the given message on stderr (may be used as an error * handler) */ void print_error(const char* msg) { fprintf(stderr, "%s\n", msg); fflush(stderr); } /* ---- The routines below are for log messages that are not errors --- */ /* * This routine logs a message and has an interface like printf. */ void log_message(const char* fmt, ...) { char buf[1024]; va_list ap; va_start(ap, fmt); vsprintf(buf, fmt, ap); va_end(ap); if (msghandler_) (*msghandler_)(buf); else print_log_message(buf); } /* * set a routine to be called with the text of log messages * when they are made. The argument is a pointer to a log message * handler: * * void msghandler(const char* msg); * * The return value is a pointer to the previous message handler, or NULL, * if none was defined. */ void (*set_log_message_handler(void (*msghandler)(const char*)))(const char*) { void (*old_handler)(const char*) = msghandler_; msghandler_ = msghandler; return old_handler; } /* * print the given message on stdout (may be used as a message * handler) */ void print_log_message(const char* msg) { printf("%s\n", msg); fflush(stdout); } skycat-3.1.2-starlink-1b/tclutil/generic/error.h000066400000000000000000000031111215713201500215270ustar00rootroot00000000000000#ifndef _error_h_ #define _error_h_ /* * E.S.O. - VLT project * "@(#) $Id: error.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * error.h - declarations for global error reporting * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 05/10/95 Created */ /* error status */ #undef OK #undef ERROR enum {OK, ERROR}; /* report the error */ int error(const char* msg1, const char* msg2="", int code = 0); /* report the error with the system error code, like perror */ int sys_error(const char* msg1, const char* msg2=""); /* report error with a printf style interface */ int fmt_error(const char* fmt, ...); /* report a system error with a printf style interface */ int fmt_sys_error(const char* fmt, ...); /* return the text of the previous error message */ char* last_error(); /* return the error code for the previous error */ int last_error_code(); /* reset the last_error buf to empty */ void clear_error(); /* set a routine to be called when errors occur and return ptr to previous handler */ void (*set_error_handler(void (*error_handler)(const char*)))(const char*); /* simple error handler: print the message */ void print_error(const char* msg); /* print a message (like printf) */ void log_message(const char* fmt, ...); /* set a routine to be called for log messages and return ptr to previous handler */ void (*set_log_message_handler(void (*message_handler)(const char*)))(const char*); /* simple message handler: print the message */ void print_log_message(const char* msg); #endif /* _error_h_ */ skycat-3.1.2-starlink-1b/tclutil/generic/tcl_findLibrary.h000066400000000000000000000055621215713201500235210ustar00rootroot00000000000000/* * E.S.O. - VLT project * "@(#) $Id: tcl_findLibrary.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Replacement for Tcl's tcl_findLibrary script (This version is taken * from tcl-8.4.11/auto.tcl). * In earlier Tcl versions, this script did not look in the auto_path * for extensions. * * who when what * -------------- -------- ---------------------------------------- * Allan Brighton 11/01/06 created */ static const char* const rcsId="@(#) $Id: tcl_findLibrary.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; char* tcl_findLibrary = "proc tcl_findLibrary {basename version patch initScript enVarName varName} {\n" " upvar #0 $varName the_library\n" " global env errorInfo\n" " set dirs {}\n" " set errors {}\n" " set variableSet [info exists the_library]\n" " if {$variableSet && $the_library != \"\"} {\n" " lappend dirs $the_library\n" " } else {\n" " if {[info exists env($enVarName)]} {\n" " lappend dirs $env($enVarName)\n" " }\n" " foreach d $::auto_path {\n" " lappend dirs [file join $d $basename$version]\n" " if {$::tcl_platform(platform) == \"unix\"\n" " && $::tcl_platform(os) ==\"Darwin\"} {\n" " lappend dirs [file join $d $basename$version Resources Scripts]\n" " }\n" " }\n" " set parentDir [file dirname [file dirname [info nameofexecutable]]]\n" " set grandParentDir [file dirname $parentDir]\n" " lappend dirs [file join $parentDir lib $basename$version]\n" " lappend dirs [file join $grandParentDir lib $basename$version]\n" " lappend dirs [file join $parentDir library]\n" " if {1} {\n" " lappend dirs [file join $grandParentDir library]\n" " lappend dirs [file join $grandParentDir $basename$patch library]\n" " lappend dirs [file join [file dirname $grandParentDir] \\n" " $basename$patch library]\n" " }\n" " }\n" " array set seen {}\n" " foreach i $dirs {\n" " if {1 || [interp issafe]} {\n" " set norm $i\n" " } else {\n" " set norm [file normalize $i]\n" " }\n" " if {[info exists seen($norm)]} { continue }\n" " set seen($norm) \"\"\n" " lappend uniqdirs $i\n" " }\n" " set dirs $uniqdirs\n" " foreach i $dirs {\n" " set the_library $i\n" " set file [file join $i $initScript]\n" " if {[interp issafe] || [file exists $file]} {\n" " if {![catch {uplevel #0 [list source $file]} msg]} {\n" " return\n" " } else {\n" " append errors \"$file: $msg\n$errorInfo\n\"\n" " }\n" " }\n" " }\n" " if {!$variableSet} {\n" " unset the_library\n" " }\n" " set msg \"Can't find a usable $initScript in the following directories: \n\"\n" " append msg \" $dirs\n\n\"\n" " append msg \"$errors\n\n\"\n" " append msg \"This probably means that $basename wasn't installed properly.\n\"\n" " error $msg\n" "}\n"; skycat-3.1.2-starlink-1b/tclutil/generic/tclutil_bitmaps.C000066400000000000000000000227731215713201500235470ustar00rootroot00000000000000 /* * E.S.O. - VLT project * "@(#) $Id: tclutil_bitmaps.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * Bitmap definitions for Tk * * This file was generated by ../bitmaps/bitmaps.tcl - DO NO EDIT */ #include #include void defineTclutilBitmaps(Tcl_Interp *interp) { #include "ar6_6_4.xbm" Tk_DefineBitmap(interp, Tk_GetUid("ar6_6_4"), (char*)ar6_6_4_bits, ar6_6_4_width, ar6_6_4_height); #include "arrowboth.xbm" Tk_DefineBitmap(interp, Tk_GetUid("arrowboth"), (char*)arrowboth_bits, arrowboth_width, arrowboth_height); #include "files.xbm" Tk_DefineBitmap(interp, Tk_GetUid("files"), (char*)files_bits, files_width, files_height); #include "width1.xbm" Tk_DefineBitmap(interp, Tk_GetUid("width1"), (char*)width1_bits, width1_width, width1_height); #include "width2.xbm" Tk_DefineBitmap(interp, Tk_GetUid("width2"), (char*)width2_bits, width2_width, width2_height); #include "width3.xbm" Tk_DefineBitmap(interp, Tk_GetUid("width3"), (char*)width3_bits, width3_width, width3_height); #include "width4.xbm" Tk_DefineBitmap(interp, Tk_GetUid("width4"), (char*)width4_bits, width4_width, width4_height); #include "arrownone.xbm" Tk_DefineBitmap(interp, Tk_GetUid("arrownone"), (char*)arrownone_bits, arrownone_width, arrownone_height); #include "circle.xbm" Tk_DefineBitmap(interp, Tk_GetUid("circle"), (char*)circle_bits, circle_width, circle_height); #include "dir.xbm" Tk_DefineBitmap(interp, Tk_GetUid("dir"), (char*)dir_bits, dir_width, dir_height); #include "shiftb1.xbm" Tk_DefineBitmap(interp, Tk_GetUid("shiftb1"), (char*)shiftb1_bits, shiftb1_width, shiftb1_height); #include "down.xbm" Tk_DefineBitmap(interp, Tk_GetUid("down"), (char*)down_bits, down_width, down_height); #include "label.xbm" Tk_DefineBitmap(interp, Tk_GetUid("label"), (char*)label_bits, label_width, label_height); #include "polygon.xbm" Tk_DefineBitmap(interp, Tk_GetUid("polygon"), (char*)polygon_bits, polygon_width, polygon_height); #include "ar10_13_3.xbm" Tk_DefineBitmap(interp, Tk_GetUid("ar10_13_3"), (char*)ar10_13_3_bits, ar10_13_3_width, ar10_13_3_height); #include "right.xbm" Tk_DefineBitmap(interp, Tk_GetUid("right"), (char*)right_bits, right_width, right_height); #include "ar8_10_3.xbm" Tk_DefineBitmap(interp, Tk_GetUid("ar8_10_3"), (char*)ar8_10_3_bits, ar8_10_3_width, ar8_10_3_height); #include "left.xbm" Tk_DefineBitmap(interp, Tk_GetUid("left"), (char*)left_bits, left_width, left_height); #include "pat0.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat0"), (char*)pat0_bits, pat0_width, pat0_height); #include "pat1.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat1"), (char*)pat1_bits, pat1_width, pat1_height); #include "pat2.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat2"), (char*)pat2_bits, pat2_width, pat2_height); #include "pat3.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat3"), (char*)pat3_bits, pat3_width, pat3_height); #include "pat4.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat4"), (char*)pat4_bits, pat4_width, pat4_height); #include "pat5.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat5"), (char*)pat5_bits, pat5_width, pat5_height); #include "pat6.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat6"), (char*)pat6_bits, pat6_width, pat6_height); #include "pat7.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat7"), (char*)pat7_bits, pat7_width, pat7_height); #include "pat8.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat8"), (char*)pat8_bits, pat8_width, pat8_height); #include "pat9.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat9"), (char*)pat9_bits, pat9_width, pat9_height); #include "rotate.xbm" Tk_DefineBitmap(interp, Tk_GetUid("rotate"), (char*)rotate_bits, rotate_width, rotate_height); #include "anyselect.xbm" Tk_DefineBitmap(interp, Tk_GetUid("anyselect"), (char*)anyselect_bits, anyselect_width, anyselect_height); #include "freehand.xbm" Tk_DefineBitmap(interp, Tk_GetUid("freehand"), (char*)freehand_bits, freehand_width, freehand_height); #include "magnify.xbm" Tk_DefineBitmap(interp, Tk_GetUid("magnify"), (char*)magnify_bits, magnify_width, magnify_height); #include "file.xbm" Tk_DefineBitmap(interp, Tk_GetUid("file"), (char*)file_bits, file_width, file_height); #include "b1.xbm" Tk_DefineBitmap(interp, Tk_GetUid("b1"), (char*)b1_bits, b1_width, b1_height); #include "b2.xbm" Tk_DefineBitmap(interp, Tk_GetUid("b2"), (char*)b2_bits, b2_width, b2_height); #include "b3.xbm" Tk_DefineBitmap(interp, Tk_GetUid("b3"), (char*)b3_bits, b3_width, b3_height); #include "square.xbm" Tk_DefineBitmap(interp, Tk_GetUid("square"), (char*)square_bits, square_width, square_height); #include "smooth.xbm" Tk_DefineBitmap(interp, Tk_GetUid("smooth"), (char*)smooth_bits, smooth_width, smooth_height); #include "text.xbm" Tk_DefineBitmap(interp, Tk_GetUid("text"), (char*)text_bits, text_width, text_height); #include "ar8_8_6.xbm" Tk_DefineBitmap(interp, Tk_GetUid("ar8_8_6"), (char*)ar8_8_6_bits, ar8_8_6_width, ar8_8_6_height); #include "pat10.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat10"), (char*)pat10_bits, pat10_width, pat10_height); #include "pat11.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat11"), (char*)pat11_bits, pat11_width, pat11_height); #include "pat12.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat12"), (char*)pat12_bits, pat12_width, pat12_height); #include "pat13.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat13"), (char*)pat13_bits, pat13_width, pat13_height); #include "pat14.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat14"), (char*)pat14_bits, pat14_width, pat14_height); #include "pat15.xbm" Tk_DefineBitmap(interp, Tk_GetUid("pat15"), (char*)pat15_bits, pat15_width, pat15_height); #include "abc.xbm" Tk_DefineBitmap(interp, Tk_GetUid("abc"), (char*)abc_bits, abc_width, abc_height); #include "decr.xbm" Tk_DefineBitmap(interp, Tk_GetUid("decr"), (char*)decr_bits, decr_width, decr_height); #include "ar12_11_3.xbm" Tk_DefineBitmap(interp, Tk_GetUid("ar12_11_3"), (char*)ar12_11_3_bits, ar12_11_3_width, ar12_11_3_height); #include "shrink.xbm" Tk_DefineBitmap(interp, Tk_GetUid("shrink"), (char*)shrink_bits, shrink_width, shrink_height); #include "oval.xbm" Tk_DefineBitmap(interp, Tk_GetUid("oval"), (char*)oval_bits, oval_width, oval_height); #include "objselect.xbm" Tk_DefineBitmap(interp, Tk_GetUid("objselect"), (char*)objselect_bits, objselect_width, objselect_height); #include "flipx.xbm" Tk_DefineBitmap(interp, Tk_GetUid("flipx"), (char*)flipx_bits, flipx_width, flipx_height); #include "flipy.xbm" Tk_DefineBitmap(interp, Tk_GetUid("flipy"), (char*)flipy_bits, flipy_width, flipy_height); #include "ar8_12_9.xbm" Tk_DefineBitmap(interp, Tk_GetUid("ar8_12_9"), (char*)ar8_12_9_bits, ar8_12_9_width, ar8_12_9_height); #include "polyline.xbm" Tk_DefineBitmap(interp, Tk_GetUid("polyline"), (char*)polyline_bits, polyline_width, polyline_height); #include "ar12_12_3.xbm" Tk_DefineBitmap(interp, Tk_GetUid("ar12_12_3"), (char*)ar12_12_3_bits, ar12_12_3_width, ar12_12_3_height); #include "down_arrow.xbm" Tk_DefineBitmap(interp, Tk_GetUid("down_arrow"), (char*)down_arrow_bits, down_arrow_width, down_arrow_height); #include "shiftdragb1.xbm" Tk_DefineBitmap(interp, Tk_GetUid("shiftdragb1"), (char*)shiftdragb1_bits, shiftdragb1_width, shiftdragb1_height); #include "up.xbm" Tk_DefineBitmap(interp, Tk_GetUid("up"), (char*)up_bits, up_width, up_height); #include "dragb1.xbm" Tk_DefineBitmap(interp, Tk_GetUid("dragb1"), (char*)dragb1_bits, dragb1_width, dragb1_height); #include "dragb2.xbm" Tk_DefineBitmap(interp, Tk_GetUid("dragb2"), (char*)dragb2_bits, dragb2_width, dragb2_height); #include "dragb3.xbm" Tk_DefineBitmap(interp, Tk_GetUid("dragb3"), (char*)dragb3_bits, dragb3_width, dragb3_height); #include "arrowfirst.xbm" Tk_DefineBitmap(interp, Tk_GetUid("arrowfirst"), (char*)arrowfirst_bits, arrowfirst_width, arrowfirst_height); #include "up_arrow.xbm" Tk_DefineBitmap(interp, Tk_GetUid("up_arrow"), (char*)up_arrow_bits, up_arrow_width, up_arrow_height); #include "arc.xbm" Tk_DefineBitmap(interp, Tk_GetUid("arc"), (char*)arc_bits, arc_width, arc_height); #include "incr.xbm" Tk_DefineBitmap(interp, Tk_GetUid("incr"), (char*)incr_bits, incr_width, incr_height); #include "region.xbm" Tk_DefineBitmap(interp, Tk_GetUid("region"), (char*)region_bits, region_width, region_height); #include "rectangle.xbm" Tk_DefineBitmap(interp, Tk_GetUid("rectangle"), (char*)rectangle_bits, rectangle_width, rectangle_height); #include "arrowlast.xbm" Tk_DefineBitmap(interp, Tk_GetUid("arrowlast"), (char*)arrowlast_bits, arrowlast_width, arrowlast_height); #include "left_arrow.xbm" Tk_DefineBitmap(interp, Tk_GetUid("left_arrow"), (char*)left_arrow_bits, left_arrow_width, left_arrow_height); #include "line.xbm" Tk_DefineBitmap(interp, Tk_GetUid("line"), (char*)line_bits, line_width, line_height); #include "right_arrow.xbm" Tk_DefineBitmap(interp, Tk_GetUid("right_arrow"), (char*)right_arrow_bits, right_arrow_width, right_arrow_height); #include "link.xbm" Tk_DefineBitmap(interp, Tk_GetUid("link"), (char*)link_bits, link_width, link_height); #include "information.xbm" Tk_DefineBitmap(interp, Tk_GetUid("information"), (char*)information_bits, information_width, information_height); } skycat-3.1.2-starlink-1b/tclutil/generic/util.C000066400000000000000000000203031215713201500213100ustar00rootroot00000000000000/* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: util.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * util.C - utility routines * * who when what * -------------- --------- ---------------------------------------- * Allan Brighton 06.Jul.96 Created * Peter W. Draper 24.Nov.97 Fixed up suffix to return characters * after first '.' after last '/' or from * the beginning of string if no '/' * available, rather than just last '.'. * pbiereic 17/02/03 Added 'using namespace std'. */ static const char* const rcsId="@(#) $Id: util.C,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"; #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "error.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "define.h" using namespace std; /* * util: make a copy of the given string array in a single buffer */ char** copyArray(int len, char** ar) { int i, n = len * sizeof(char*), m = n; char* p; for (i = 0; i < len; i++) n += strlen(ar[i])+1; char** ret = new char*[(n/sizeof(char*))+1]; p = ((char*)ret) + m; for (i = 0; i < len; i++) { ret[i] = p; strcpy(p, ar[i]); p += strlen(ar[i])+1; } return ret; } /* * strip white space from string by returning offset * in string and setting trailing white space to '\0' */ char* stripWhiteSpace(char* p) { while(isspace(*p)) p++; char* q = p + strlen(p) - 1; while (isspace(*q)) *q-- = '\0'; return p; } /* * return the suffix of the filename, /xx/xx/xx.xxx or xx.xxx. */ const char* fileSuffix(const char* name) { char *c = (char *) name; c = strrchr( c, '/' ); if ( !c ) { c = (char *) name; c--; } c = strchr( ++c, '.' ); if ( c ) { return c + 1; } else { return ""; } } /* * return the basename of the file (part following last "/", if any) */ const char* fileBasename(const char* name) { const char* p = strrchr(name, '/'); if (p) return p+1; return name; } /* * return the size of the file in bytes or -1 on error */ size_t fileSize(const char* filename) { struct stat buf; if (stat(filename, &buf) != 0) return -sys_error("can't stat ", filename); return buf.st_size; } /* * Get the real name of the given file, which may be the name of a * symbolic link. If the file exists, the resolved name is written to the * given buffer and returned, otherwise a pointer to the original * filename is returned. No error message is generated here. */ const char* fileRealname(const char* filename, char* buf, size_t buflen) { // NOTE: readlink() does NOT null terminate filename !!! int n = readlink(filename, buf, buflen); if (n == -1) return filename; buf[n] = '\0'; // null terminate filename return buf; } /* * If filename is not an absolute path (starting with '/'), write * an absolute path for it to "path". "flag" is set to 1 if path * was written to. */ int fileAbsPath(const char* filename, char* path, int pathlen, int& flag) { // make sure we use an absolute path flag = 0; if (filename[0] != '/') { if (getcwd(path, pathlen) == NULL) return sys_error("getcwd"); strcat(path, "/"); strcat(path, filename); flag = 1; } return 0; } /* * Read "n" bytes from a file descriptor. * Use in place of read() when fd is a stream socket. */ ssize_t readUnbufferedBytes(int fd, char* ptr, size_t nbytes) { ssize_t nleft, nread; nleft = nbytes; while (nleft > 0) { nread = read(fd, ptr, nleft); if (nread < 0 && errno != EINTR && errno != EAGAIN) return(nread); /* error, return < 0 */ else if (nread == 0) break; /* EOF */ nleft -= nread; ptr += nread; } return(nbytes - nleft); /* return >= 0 */ } /* * Read the line one byte at a time, looking for the newline. We store * the newline in the buffer, then follow it with a null (the same as * fgets(3)). Not very efficient but usefull for sockets. * * Returns the number of characters up to, but not including, the null * (the same as strlen(3)) or < 0 upon errors. * * Taken from Stevens (readline()), "Unix Network Programming" */ int readUnbufferedLine(int fd, char* ptr, int maxlen) { int n; ssize_t rc; char c; for (n = 1; n < maxlen; n++) { if ( (rc = read(fd, &c, 1)) == 1) { *ptr++ = c; if (c == '\n') break; } else if (rc == 0) { if (n == 1) return(0); // EOF, no data read else break; // EOF, some data was read } else if (errno != EINTR && errno != EAGAIN) return(-1); // error } *ptr = 0; return(n); } /* * Write "n" bytes to a descriptor. Use in place of write() when fd is a * stream socket. * * Returns the number of characters written or <0 upon error. * * Taken from Stevens, "Unix Network Programming". */ ssize_t writeUnbufferedBytes(int fd, char* ptr, size_t nbytes) { ssize_t nleft, nwritten; nleft = nbytes; while (nleft > 0) { nwritten = write(fd, ptr, nleft); if (nwritten < 0 && errno != EINTR && errno != EAGAIN) return(nwritten); // error else if (nwritten == 0) break; nleft -= nwritten; ptr += nwritten; } return(nbytes - nleft); } /* * write the given buffer to the given fd followed by a newline */ ssize_t writeUnbufferedLine(int fd, char* ptr) { return writeUnbufferedBytes(fd, ptr, strlen(ptr)) + writeUnbufferedBytes(fd, (char *)"\n", 1); } /* * Open a socket connection on port on this same host. * *socket on connection is returned or set to -1 on failure * The return value is the status (0 is OK). */ int localSockConnect(int& sock, int port) { hostent *hp; // pointer to host info sockaddr_in addr; // for peer socket address sock = -1; // initial value // get local hostname struct utsname unameInfo; if (uname(&unameInfo) < 0) return sys_error("uname failed on localhost?"); /* clear out address */ memset ((char *)&addr, 0, sizeof(struct sockaddr_in)); /* Set up the peer address to which we will connect. */ addr.sin_family = AF_INET; /* Get the host information for the local host */ hp = gethostbyname(unameInfo.nodename); if (hp == NULL) return sys_error("failed gethostbyname on localhost?"); addr.sin_addr.s_addr = ((struct in_addr *)(hp->h_addr))->s_addr; addr.sin_port = htons(port); /* Create the socket */ sock = socket(AF_INET, SOCK_STREAM, 0); if (sock == -1) return sys_error("failed socket on localhost?"); /* Try to connect to the port */ if (connect(sock, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1) { fmt_sys_error("connect failed on port %d", port); close(sock); // free the socket fd sock = -1; return 1; } return 0; } /* * Start listening for a socket connection on the given port, * or choose a port if port is 0. * The value of sock is set to the socket fd, or -1 on error. * The value of port is set to the port used (may be different if 0). * The return value is the status (0 is OK). */ int localSockListen(int& sock, int& port) { // clear out address structures sockaddr_in addr; // for local socket address size_t addrSize = sizeof(addr); memset((char *)&addr, '\0', addrSize); addr.sin_family = AF_INET; addr.sin_addr.s_addr = INADDR_ANY; addr.sin_port = port; // Create the listen socket. sock = socket(AF_INET, SOCK_STREAM, 0); if (sock == -1) return sys_error("socket"); // Bind the listen address to the socket. if (bind(sock, (struct sockaddr *)&addr, addrSize) == -1) return sys_error("bind"); // note the port number (in case it was 0 and is generated) port = addr.sin_port; // Initiate the listen on the socket so remote users // can connect. The listen backlog is set to 5. 20 // is the currently supported maximum. if (listen(sock, 5) == -1) return sys_error("listen"); return 0; } skycat-3.1.2-starlink-1b/tclutil/generic/util.h000066400000000000000000000036131215713201500213620ustar00rootroot00000000000000// -*-c++-*- #ifndef _util_h_ #define _util_h_ /* * E.S.O. - VLT project / ESO Archive * * "@(#) $Id: util.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" * * util.h - utility routines * * who when what * -------------- --------- ---------------------------------------- * Allan Brighton 06.Jul.96 Created */ // util: make a copy of the given string array in a single buffer char** copyArray(int len, char** ar); // strip white space from string by returning offset // in string and setting trailing white space to '\0' char* stripWhiteSpace(char* p); // return the suffix of the string (part following ".", if any) const char* fileSuffix(const char* p); // return the basename of the file (part following last "/", if any) const char* fileBasename(const char* p); // get the real name of a file, which may be a link const char* fileRealname(const char* filename, char* buf, size_t buflen); // return the size of the file in bytes or -1 on error int fileSize(const char* filename); // If filename is not an absolute path (starting with '/'), write // an absolute path for it to "path". Sets flag to 1 if path was changed. int fileAbsPath(const char* filename, char* path, int pathlen, int& flag); // Read the line one byte at a time (for sockets and pipes, stdin, ...) int readUnbufferedLine(int fd, char* ptr, int maxlen); // Read "n" bytes from a file descriptor. int readUnbufferedBytes(int fd, char* ptr, int nbytes); // write the given buffer to the given fd followed by a newline int writeUnbufferedLine(int fd, char* ptr); // Write "n" bytes to a descriptor fd (for sockets and pipes, stdin,...) int writeUnbufferedBytes(int fd, char* ptr, int nbytes); // Open a socket connection on port on this same host. int localSockConnect(int& sock, int port); // start listening on the given port (or choose port, if 0) int localSockListen(int& sock, int& port); #endif /* _util_h_ */ skycat-3.1.2-starlink-1b/tclutil/install.sh000077500000000000000000000042121215713201500206210ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # This comes from X11R5; it is not part of GNU. # # $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" instcmd="$mvprog" chmodcmd="" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; *) if [ x"$src" = x ] then src=$1 else dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` fi # Make a temp file name in the proper directory. dstdir=`dirname $dst` dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp # and set any options; do chmod last to preserve setuid bits if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi # Now rename the file to the real destination. $doit $rmcmd $dst $doit $mvcmd $dsttmp $dst exit 0 skycat-3.1.2-starlink-1b/tclutil/library/000077500000000000000000000000001215713201500202615ustar00rootroot00000000000000skycat-3.1.2-starlink-1b/tclutil/library/Batch.tcl000066400000000000000000000117401215713201500220110ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # @(#) $Id: Batch.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $ # # Batch.tcl - Class to evaluate Tcl commands in a separate process. # # usage: Batch $w_.batch -command $command # $w_.batch bg_eval $cmd # # where: $command is evaluated with 2 args: $cmd's status and the result # (or a filename containing the result, see the options...) # # See man page for a complete description. # # Copyright: # Copyright (C) 2000-2005 Central Laboratory of the Research Councils. # Copyright (C) 2006 Particle Physics & Astronomy Research Council. # All Rights Reserved. # # Licence: # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place,Suite 330, Boston, MA # 02111-1307, USA # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 20 Dec 95 created # P.W.Draper 10 Feb 98 Changed to use kill SIGKILL to make forked # process exit without executing any exit # handlers. This was causing problems with # Starlink infrastructure s/w (HDS). # 02 Mar 99 Merged skycat 2.3.2 changes itk::usual Batch {} # This class is used to evaluate a set of Tcl commands in a separate # process, so that it can be interrupted. No exec is done, so the # process is just a copy of the current one and has a copy of the # memory and open files. itcl::class util::Batch { # dummy inherit, just to catch Destroy event for clean up... inherit util::FrameWidget # constructor constructor {args} { eval itk_initialize $args if {"$itk_option(-tmpfile)" == ""} { set itk_option(-tmpfile) /tmp/batch[pid].[incr count_] } } # destructor destructor { interrupt } # evaluate the given tcl commands in the background, so that they # can be interrupted. The option $command is evaluated # when the results when done. public method bg_eval {cmd} { if {$itk_option(-debug)} { fg_eval $cmd return } flush stdout flush stderr pipe rfd wfd set pid [fork] if {$pid == 0} { # child set status [catch $cmd result] set fd [open $itk_option(-tmpfile) w] puts -nonewline $fd $result # Flush all pending output and kill the process using a # signal that avoids any exit handlers (otherwise these # are executed in the parent process, this process should # use _exit form to exit, obviously it doesn't). flush $fd close $fd puts $wfd $status flush $wfd close $wfd # The kill command is in Tclx and BLT, only BLT puts # it into a namespace we can use. blt::kill [pid] SIGKILL } else { set bg_pid_ $pid fileevent $rfd readable [code $this read_pipe $rfd $wfd] } } # evaluate the given command in the foreground (useful for debugging) # The option $command is evaluated when the results when done. public method fg_eval {cmd} { set status [catch $cmd result] eval $itk_option(-command) $status [list $result] } # read the pipe from the child process protected method read_pipe {rfd wfd} { set status [read $rfd 1] close $rfd close $wfd if {[file exists $itk_option(-tmpfile)]} { set fd [open $itk_option(-tmpfile)] set info [read $fd] close $fd file delete $itk_option(-tmpfile) } else { # may have been interrupted - ignore return } eval $itk_option(-command) $status [list $info] catch {wait -nohang $bg_pid_} } # interrupt the current search public method interrupt {} { catch {exec kill $bg_pid_} catch {file delete $itk_option(-tmpfile)} catch {wait -nohang $bg_pid_} } # -- options -- # command to evaluate when process is done. Called with 2 args: # status and result (or error message) itk_option define -command command Command {} # temp file for results itk_option define -tmpfile tmpfile Tmpfile {} # flag: if true run commands in the foreground for better debugging itk_option define -debug debug Debug 0 # -- protected members -- # process id of background process protected variable bg_pid_ # -- common variables (shared by all instances) -- # count used for filename generation common count_ 0 } skycat-3.1.2-starlink-1b/tclutil/library/ButtonFrame.tcl000066400000000000000000000041201215713201500232100ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: ButtonFrame.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # ButtonFrame.tcl - Widget displaying a frame with some standard buttons. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual ButtonFrame {} # This class is an itcl widget for displaying a frame with the standard # buttons like "OK Cancel", with options for configuring other labels and # actions itcl::class util::ButtonFrame { inherit util::FrameWidget # create a ButtonFrame constructor {args} { itk_option add hull.borderwidth hull.relief eval itk_initialize $args } # add a button to the row or configure an existing button public method buttonconfig {label args} { if {[info exists but_($label)]} { eval "[list $but_($label) config -text $label] $args" } else { pack \ [set but_($label) [eval "[list button $w_.but$seq_ -text $label] $args"]] \ -side left -fill none -expand 1 -padx 3m -pady 2m incr seq_ } } # add a button public method append {label cmd} { buttonconfig $label -text $label -command $cmd } # -- options -- # labels and commands for the standard buttons itk_option define -ok_label ok_label Ok_label {OK} { buttonconfig $itk_option(-ok_label) -text $itk_option(-ok_label) } itk_option define -ok_cmd ok_cmd Ok_cmd {} { buttonconfig $itk_option(-ok_label) -command $itk_option(-ok_cmd) } itk_option define -cancel_label cancel_label Cancel_label {Cancel} { buttonconfig $itk_option(-cancel_label) -text $itk_option(-cancel_label) } itk_option define -cancel_cmd cancel_cmd Cancel_cmd {} { if {"$itk_option(-cancel_cmd)" == ""} { config -cancel_cmd "destroy [winfo toplevel $w_]" } else { buttonconfig $itk_option(-cancel_label) -command $itk_option(-cancel_cmd) } } # -- protected variable vars -- # counter for button names protected variable seq_ {0} # array mapping label name to button name protected variable but_ } skycat-3.1.2-starlink-1b/tclutil/library/CanvasDraw.tcl000066400000000000000000001621601215713201500230240ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: CanvasDraw.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # CanvasDraw.tcl - Add interactive drawing capabilities to a Tk canvas. # # usage: CanvasDraw .draw -canvas $canvas ?options...? # # See the man page CanvasDraw(n) for a complete description. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 95 Created # 23 Jun 96 constrain (clip) interactive drawing with -bbox option # 20 Mar 98 Use init method (easier to subclass) # Added -clipping option to control clipping of graphics # (default is the same as before). itk::usual CanvasDraw {} # CanvasDraw is an [incrTcl] widget class that an application # can use to add interactive drawing capabilities to any Tk # canvas. Since it is a subclass of TopLevelWidget, it creates # its own toplevel window containing a drawing mode selection # section and an option section for setting colors, fonts, line # thickness, arrow types, etc. The window can be hidden on # startup by specifying the "-withdraw 1" option inherited from # TopLevelWidget. itcl::class util::CanvasDraw { inherit util::TopLevelWidget # create an instance of this class constructor {args} { eval itk_initialize $args } # This method is called after the constructor have completed. protected method init {} { if {!$itk_option(-withtoolbox)} { return } wm title $w_ "Line Graphics ($itk_option(-number))" wm iconname $w_ Graphics # make the toolbox make_drawmode_frame make_options_frame # create the canvas item menu make_object_menu $canvas_ config -cursor [set prev_cursor_ $itk_option(-defaultcursor)] # add button frame and buttons # Button frame at bottom of window itk_component add bot { frame $w_.bot -borderwidth 2 -relief groove } pack $itk_component(bot) -side bottom -fill x # Close button itk_component add close { button $itk_component(bot).close -text Close \ -command "wm withdraw $w_" } # Clear button itk_component add clear { button $itk_component(bot).clear -text Clear \ -command [code $this clear] } # Delete button itk_component add delete { button $itk_component(bot).delete -text Delete \ -command [code $this delete_selected_objects] } pack $itk_component(close) $itk_component(clear) $itk_component(delete) \ -side left -padx 2m -pady 2m -expand 1 add_short_help $itk_component(close) "Close this window" add_short_help $itk_component(clear) "Clear all line graphics" add_short_help $itk_component(delete) "Delete selected line graphic objects" # short help for selection grips if {$itk_option(-withrotate)} { set msg "Selection grips: {bitmap dragb1} = resize object, \ Control {bitmap dragb3} = rotate object " } else { set msg "Selection grips: {bitmap dragb1} = resize object" } $canvas_ bind grip "+[code $short_help_win_ short_help $msg]" $canvas_ bind grip "+[code $short_help_win_ short_help {} ]" } # destructor: clean up destructor { catch {clear} catch {destroy $object_menu_} } # create the canvas item menu. protected method make_object_menu {} { # create menu in global namespace to avoid problems with tk menu utils set cmd [list menu $canvas_.objmenu -tearoff 0] set m [set object_menu_ [uplevel "#0" $cmd]] $m add command -label "Delete Selected Items" \ -command [code $this delete_selected_objects] } # post the object menu at the mouse cursor position. # If an item is selected, post the menu with the items enabled. protected method post_object_menu {x y} { # disable items if no selection... if {! [lempty [selected_items]]} { tk_popup $object_menu_ $x $y } } # delete the selected canvas items public method delete_selected_objects {} { foreach id [selected_items] { delete_object $id } } # delete the given canvas item public method delete_object {id} { deselect_object $id $canvas_ delete $id if {[info exists notify_($id)]} { set cmd $notify_($id) unset notify_($id) eval "$cmd delete" } if {[info exists notify_update_($id)]} { unset notify_update_($id) } } # delete all canvas items public method clear {} { deselect_objects $canvas_ delete $w_.objects $canvas_ delete objects } # create the menu items in the given menu public method add_menuitems {m} { # save menu name for enable/disable set menu_ $m # add the menus foreach i {Mode Width Arrow ArrowShape Fill Outline Stipple Font Smooth} { $m add cascade -label $i -menu [menu $m.[string tolower $i]] } # drawing mode menu foreach i $drawing_modes_ { $m.mode add radiobutton \ -variable $w_.mode -value $i \ -bitmap $i \ -command [code $this set_drawing_mode $i] } after idle [code $this set_drawing_mode anyselect] # line width menu foreach i {1 2 3 4} { $m.width add radiobutton \ -variable $w_.width \ -value $i \ -bitmap width$i \ -command [code $this set_linewidth $i] } # arrow menu foreach i {none first both last} { $m.arrow add radiobutton \ -variable $w_.arrow \ -bitmap arrow$i \ -value $i \ -command [code $this set_arrowtype $i] } # arrow shape menu (bitmap names corr. to arrow shape lists) foreach i $arrowshapes_ { $m.arrowshape add radiobutton \ -variable $w_.arrowshape \ -value $i \ -bitmap ar[join $i _] \ -command [list $this set_arrowshape $i] } # fill menu $m.fill add radiobutton \ -variable $w_.fill -value "" \ -label None \ -command [code $this set_fillcolor {} ] foreach i $itk_option(-colors) { $m.fill add radiobutton \ -variable $w_.fill -value $i \ -command [code $this set_fillcolor $i] \ -background $i } # outline menu foreach i $itk_option(-colors) { $m.outline add radiobutton \ -variable $w_.outline -value $i \ -command [code $this set_outlinecolor $i] \ -background $i } $m.outline add radiobutton \ -variable $w_.outline -value "" \ -label None \ -command [code $this set_outlinecolor {} ] # Stipple menu for {set i 0} {$i < 16} {incr i} { set bitmap pat$i $m.stipple add radiobutton \ -variable $w_.stipple -value pat$i \ -bitmap $bitmap \ -command [code $this set_stipplepattern $i] } # Font menu foreach i $itk_option(-fonts) { if {[catch { $m.font add radiobutton \ -variable $w_.font -value $i \ -label {abc} \ -command [code $this set_textfont $i] \ -font $i } msg]} { puts "warning: $msg" } } # Smooth menu set bool 0 foreach i {rectangle smooth} { $m.smooth add radiobutton \ -bitmap $i \ -value $bool \ -variable $w_.smooth \ -command [code $this set_smooth $bool] incr bool } set $w_.smooth 0 # add items for deleting objects $m add separator $m add command -label "Clear" -command [code $this clear] $m add command -label "Delete" -command [code $this delete_selected_objects] # add short help texts for menu items set w $short_help_win_ $w add_menu_short_help $m Mode {Select the drawing mode} $w add_menu_short_help $m Width {Set the line width for drawing} $w add_menu_short_help $m Arrow {Select the arrow mode for lines} $w add_menu_short_help $m ArrowShape {Select the arrow shape for lines} $w add_menu_short_help $m Fill {Select the fill color for drawing} $w add_menu_short_help $m Outline {Select the outline color for drawing} $w add_menu_short_help $m Stipple {Select the stipple pattern for filling objects} $w add_menu_short_help $m Font {Select the font to use for labels} $w add_menu_short_help $m Clear {Delete graphic objects} $w add_menu_short_help $m Delete {Delete selected graphic objects} $w add_menu_short_help $m Smooth {Set the smooth option for drawing polygons} } # enable or disable the drawing items in the menu # (enable is state is "normal", disable if "disabled". public method set_menu_state {state} { if {"$menu_" != ""} { for {set i 0} {$i < 16} {incr i} { catch {$menu_ entryconfigure $i -state $state} } } } # create the frame for selecting draw types (line, oval, ...) # in the given frame protected method make_drawmode_frame {} { # Frame containing drawing mode buttons. itk_component add drawmodes { frame $w_.drawmodes -borderwidth 6 } pack $itk_component(drawmodes) -side top -fill both set row 0 set col 0 set maxcol 3 foreach drawing_mode $drawing_modes_ { # Drawing mode buttons # (anyselect, region, line, rectangle, oval, polyline, polygon, text) itk_component add $drawing_mode { set b [button $itk_component(drawmodes).$drawing_mode \ -bitmap $drawing_mode \ -borderwidth 3 \ -command [code $this set_drawing_mode $drawing_mode]] } add_short_help $b "set the drawing mode to $drawing_mode" blt::blttable $itk_component(drawmodes) $b $row,$col \ -fill x -ipadx 1m -ipady 1m if {$col < $maxcol} { incr col } else { set col 0 incr row } } set_drawing_mode anyselect } # create the draw options frame (line width, color, etc...) protected method make_options_frame {} { global ::$w_.width ::$w_.arrow ::$w_.arrowshape ::$w_.fill ::$w_.outline \ ::$w_.stipple ::$w_.font ::$w_.smooth # Frame containing option menubuttons for graphic items itk_component add options { set f [frame $w_.options -borderwidth 6] } pack $itk_component(options) -side top -fill both foreach i {Width Arrow ArrowShape Fill Outline Stipple Font Smooth} { set menu [string tolower $i] # LabelMenu(n) items for changing options on graphic objects. # (Width Arrow ArrowShape Fill Outline Stipple Font Smooth) itk_component add $menu { util::LabelMenu $f.$menu \ -text "$i:" \ -relief raised \ -variable $w_.$menu \ -labelwidth 15 } pack $itk_component($menu) -side top -fill both -expand 1 -ipadx 1m -ipady 1m } # line width menu foreach i {1 2 3 4} { $f.width add \ -bitmap width$i \ -value $i \ -command [code $this set_linewidth $i] } set $w_.width 1 add_short_help $f.width "set the line width for drawing" # arrow menu foreach i {none first both last} { $f.arrow add \ -bitmap arrow$i \ -value $i \ -command [code $this set_arrowtype $i] } set $w_.arrow none add_short_help $f.arrow "set the arrow type for drawing lines" # arrow shape menu foreach i $arrowshapes_ { $f.arrowshape add \ -bitmap ar[join $i _] \ -value $i \ -command [list $this set_arrowshape $i] } set $w_.arrowshape [lindex $arrowshapes_ 0] add_short_help $f.arrowshape \ "set the arrow shape for drawing (must also select type above)" # fill menu $f.fill add \ -label None \ -command [code $this set_fillcolor {} ] \ -background [. cget -background] foreach i $itk_option(-colors) { $f.fill add \ -command [code $this set_fillcolor $i] \ -label { } \ -value $i \ -background $i } set $w_.fill None add_short_help $f.fill "set the fill color for drawing" # outline menu foreach i $itk_option(-colors) { $f.outline add \ -command [code $this set_outlinecolor $i] \ -label { } \ -value $i \ -background $i } $f.outline add \ -label None \ -command [code $this set_outlinecolor {} ] \ -background [. cget -background] set $w_.outline white add_short_help $f.outline "set the outline color for drawing" # Stipple menu for {set i 0} {$i < 16} {incr i} { set bitmap pat$i $f.stipple add \ -bitmap $bitmap \ -command [code $this set_stipplepattern $i] } set $w_.stipple pat0 add_short_help $f.stipple "set the stipple pattern for drawing" # Font menu foreach i $itk_option(-fonts) { if {[catch { $f.font add \ -label {abc} \ -value $i \ -command [code $this set_textfont $i] \ -font $i } msg]} { puts "warning: $msg" } } set $w_.font abc add_short_help $f.font "set the font used for text items" # Smooth menu set bool 0 foreach i {rectangle smooth} { $f.smooth add \ -bitmap $i \ -value $bool \ -command [code $this set_smooth $bool] incr bool } set $w_.smooth 0 add_short_help $f.smooth "set the smooth option for drawing" } # update the display to show the options for the given canvas item protected method update_display_from_object {id} { global ::$w_.width ::$w_.arrow ::$w_.arrowshape ::$w_.fill ::$w_.outline \ ::$w_.stipple ::$w_.font ::$w_.smooth foreach i [$canvas_ itemconfig $id] { lassign $i opt {} {} {} value set var "$w_.[string range $opt 1 end]" set $var $value } } # apply the given option to the selected canvas items public method config_selected {option value} { foreach i [selected_items] { if {[info exists option_map_($i,$option)]} { set option $option_map_($i,$option) } catch {$canvas_ itemconfig $i $option $value} } } # set the line width default and for any selected objects public method set_linewidth {w} { global ::$w_.width set $w_.width $w config -linewidth $w config_selected -width $w } # set the arrow type default and for any selected objects public method set_arrowtype {t} { global ::$w_.arrow config -arrowtype $t set $w_.arrow $t config_selected -arrow $t } # set the arrow shape default and for any selected objects public method set_arrowshape {list} { global ::$w_.arrowshape config -arrowshape $list set $w_.arrowshape $list config_selected -arrowshape $list } # set the fill color default and for any selected objects # note: if the stipple is invisible (see through), make it solid to # make sure fill is visible public method set_fillcolor {c} { global ::$w_.fill if {$stipple_index_ == 8} { set_stipplepattern 0 } elseif {"$c" == ""} { set_stipplepattern 8 } config -fillcolor [set $w_.fill $c] config_selected -fill $c } # set the outline color default and for any selected objects public method set_outlinecolor {c} { global ::$w_.outline config -outlinecolor [set $w_.outline $c] config_selected -outline $c } # set the stipple pattern default and for any selected objects # index is the pattern number (corresponding to pat$index.xbm) public method set_stipplepattern {index} { global ::$w_.stipple config -stipplepattern [set $w_.stipple pat$index] set stipple_index_ $index # make sure newly created lines are visible (pat8 is invisible) if {$index == 8} { config -linestipple pat0 } else { config -linestipple $itk_option(-stipplepattern) } config_selected -stipple $itk_option(-stipplepattern) } # set the text font default and for any selected objects public method set_textfont {f} { global ::$w_.font config -textfont $f set $w_.font $f config_selected -font $f } # set the smooth option for drawing public method set_smooth {bool} { global ::$w_.smooth config -smooth $bool set $w_.smooth $bool config_selected -smooth $bool } # set the type of object to draw (line, oval, ...) # If create_cmd is specified, it is called with the coordinates # of the new object when its creation is completed public method set_drawing_mode {type {create_cmd ""}} { if {"$type" == "region" && $drawing_} { # already drawing... return } # reset selection foreach i $drawing_modes_ { $itk_component($i) config -relief raised } if {[info exists itk_component($type)]} { $itk_component($type) config -relief sunken } # from menu's -variable option global ::$w_.mode set drawing_mode_ [set $w_.mode $type] set create_cmd_ $create_cmd set drawing_ [expr {"$type" != "objselect" && "$type" != "anyselect"} ] if {$drawing_} { deselect_objects $canvas_ config -cursor $itk_option(-drawcursor) } else { reset_cursor } # reset canvas bindings based on drawing_mode bind $canvas_ {} switch -exact $drawing_mode_ { anyselect - objselect { bind $canvas_ <1> [code $this check_deselect] bind $canvas_ {} bind $canvas_ {} bind $canvas_ {} bind $canvas_ {} } region { $canvas_ config -cursor $itk_option(-regioncursor) bind $canvas_ <1> \ [code eval $this create_object $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this check_done $canvasX_ $canvasY_ update_region] bind $canvas_ \ [code eval $this update_region $canvasX_ $canvasY_ 0] bind $canvas_ \ [code eval $this update_region $canvasX_ $canvasY_ 1] bind $canvas_ \ [code eval $this create_done $canvasX_ $canvasY_] } line { bind $canvas_ <1> \ [code eval $this create_object $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this check_done $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this update_line $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this update_line $canvasX_ $canvasY_ 1] bind $canvas_ \ [code eval $this create_done $canvasX_ $canvasY_] } oval - arc { bind $canvas_ <1> \ [code eval $this create_object $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this check_done $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this update_object $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this update_object $canvasX_ $canvasY_ 1] bind $canvas_ \ [code eval $this create_done $canvasX_ $canvasY_] } rectangle { bind $canvas_ <1> \ [code eval $this create_object $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this check_done $canvasX_ $canvasY_ update_rectangle] bind $canvas_ \ [code eval $this update_rectangle $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this update_rectangle $canvasX_ $canvasY_ 1] bind $canvas_ \ [code eval $this create_done $canvasX_ $canvasY_] } polyline - polygon { bind $canvas_ <1> \ [code eval $this create_object $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this add_poly_point $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this update_poly_object $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this update_poly_object $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this create_done $canvasX_ $canvasY_] } freehand { bind $canvas_ <1> \ [code eval $this create_object $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this check_done $canvasX_ $canvasY_ update_freehand] bind $canvas_ \ [code eval $this update_freehand $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this update_freehand $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this create_done $canvasX_ $canvasY_] } text - label { $canvas_ config -cursor $itk_option(-textcursor) bind $canvas_ <1> \ [code eval $this create_object $canvasX_ $canvasY_] bind $canvas_ \ [code eval $this create_text_done $canvasX_ $canvasY_] bind $canvas_ {} bind $canvas_ {} bind $canvas_ {} } } } # clip the given point to keep it over the drawing area public method clip {px py} { if {$itk_option(-clipping)} { upvar $px x upvar $py y if {$x < $x0_} { set x $x0_ } elseif {$x > $x1_} { set x $x1_ } if {$y < $y0_} { set y $y0_ } elseif {$y > $y1_} { set y $y1_ } } } # mark (remember) the current position protected method mark {x y} { clip x y set startx_ $x set starty_ $y set xoffset_ 0 set yoffset_ 0 } # set up the canvas object bindings. target_id defaults to id. # If target_id is specified, it will receive the events instead of id. public method add_object_bindings {id {target_id ""}} { if {"$target_id" == ""} { set target_id $id } # mark pos $canvas_ bind $id <1> "+[code eval $this mark $canvasX_ $canvasY_]" $canvas_ bind $id "+[code eval $this mark $canvasX_ $canvasY_]" $canvas_ bind $id "+[code eval $this mark $canvasX_ $canvasY_]" # select $canvas_ bind $id \ "+[code eval $this select_only_object $target_id $canvasX_ $canvasY_]" $canvas_ bind $id \ "+[code eval $this toggle_select_object $target_id $canvasX_ $canvasY_]" $canvas_ bind $id \ "+[code eval $this toggle_select_object $target_id $canvasX_ $canvasY_]" # move $canvas_ bind $id \ "+[code eval $this move_object $target_id $canvasX_ $canvasY_]" $canvas_ bind $id \ "+[code eval $this move_object $target_id $canvasX_ $canvasY_]" $canvas_ bind $id \ "+[code eval $this move_object $target_id $canvasX_ $canvasY_]" $canvas_ bind $id "+[code $this end_move $target_id]" $canvas_ bind $id "+[code $this end_move $target_id]" $canvas_ bind $id "+[code $this end_move $target_id]" # cursor $canvas_ bind $id "+[code $this set_cursor tcross]" $canvas_ bind $id "+[code $this reset_cursor]" # menu if {$itk_option(-show_object_menu)} { $canvas_ bind $id <3> "+[code $this post_object_menu %X %Y]" } } # Finish creation of the current object and call the "create" command, if one # was specified, otherwise, for region items, call the region command, if # defined. public method create_done {x y} { set resizing_ 0 reset_cursor add_object_bindings $obj_id_ if {"$create_cmd_" != ""} { eval "$create_cmd_ $obj_id_ [$canvas_ bbox $obj_id_]" set create_cmd_ "" } elseif {"$drawing_mode_" == "region"} { set_drawing_mode anyselect eval select_region [$canvas_ bbox $obj_id_] delete_object $obj_id_ return } set_drawing_mode anyselect select_object $obj_id_ update_display_from_object $obj_id_ mark $x $y } # Finish creation of the current text object protected method create_text_done {x y} { set_drawing_mode anyselect reset_cursor add_object_bindings $obj_id_ } # check if object creation is done: if the button has moved # since it was pressed, we are done, otherwise dragging continues # without the button pressed. # # update_method is the method to call to update the object, if needed protected method check_done {x y {update_method "update_object"}} { clip x y if {$x == $startx_ && $y == $starty_} { bind $canvas_ [code eval $this $update_method $canvasX_ $canvasY_] bind $canvas_ <1> [code eval $this create_done $canvasX_ $canvasY_] } else { create_done $x $y } } # This method is called when a region object has been created to select # a region of the canvas. # All objects in the region are selected and if a region command option # was specified, the command is evaluated with the bounding box of the region. public method select_region {x0 y0 x1 y1} { foreach id [$canvas_ find enclosed $x0 $y0 $x1 $y1] { # make sure its is one of our objects if {[item_has_tag $id $w_.objects]} { select_object $id } } if {"$itk_option(-regioncommand)" != ""} { eval "$itk_option(-regioncommand) $x0 $y0 $x1 $y1" } } # add a point to the curent polygon/polyline protected method add_poly_point {x y} { clip x y lappend obj_coords_ $x $y update_poly_object $x $y bind $canvas_ <1> {} bind $canvas_ [code eval $this update_poly_object $canvasX_ $canvasY_] } # If the mouse is not over an object, deselect all objects public method check_deselect {} { if {[llength [$canvas_ gettags current]] == 0} { deselect_objects } } # if the object is selected, deselect it, otherwise select it protected method toggle_select_object {id x y} { # only if not moving mouse... if {$startx_ == $x && $starty_ == $y} { if {[item_is_selected $id]} { deselect_object $id } else { select_object $id mark $x $y } } } # select only the given object public method select_only_object {id x y} { # only if not moving mouse... if {$startx_ == $x && $starty_ == $y} { deselect_objects select_object $id 1 update_display_from_object $id } if {$drawing_} { return } mark $x $y } # select the given object by drawing 8 little grips on it, or for text objects, # if any==1 and the selection type is "anyselect", select the text in the object. # The grips have the tag "grip" and the object gets the tag "$w_.selected" public method select_object {id {any 0}} { if {$drawing_} { return } # decide whether to select object or only text set type [$canvas_ type $id] if {$any && "$type" == "text" && "$drawing_mode_" == "anyselect"} { $canvas_ focus $id $canvas_ icursor $id end } elseif {$itk_option(-show_selection_grips)} { draw_selection_grips $id $type } $canvas_ addtag $w_.selected withtag $id } # Draw the selection grips for a simple line. # Lines get one grip at each end. protected method draw_line_selection_grips {id} { foreach side {e w} { set sel_id [$canvas_ create rectangle 0 0 \ $itk_option(-gripwidth) $itk_option(-gripwidth) \ -tags [list grip grip.$id grip.$id.$side] \ -fill $itk_option(-gripfill) -outline $itk_option(-gripoutline)] $canvas_ bind $sel_id \ [list $canvas_ config -cursor $itk_option(-linecursor)] $canvas_ bind $sel_id [code $this reset_cursor] $canvas_ bind $sel_id <1> \ [code eval $this mark $canvasX_ $canvasY_] $canvas_ bind $sel_id \ [code eval $this mark $canvasX_ $canvasY_] $canvas_ bind $sel_id \ [code $this end_resize_line $id] $canvas_ bind $sel_id \ [code $this end_resize_line $id] $canvas_ bind $sel_id \ [code eval $this resize_line $id $canvasX_ $canvasY_ $side 0] $canvas_ bind $sel_id \ [code eval $this resize_line $id $canvasX_ $canvasY_ $side 1] if {$itk_option(-withrotate)} { $canvas_ bind $sel_id \ [list $canvas_ config -cursor $rotate_cursor_] $canvas_ bind $sel_id \ [code eval $this start_rotate $id $canvasX_ $canvasY_] $canvas_ bind $sel_id \ [code eval $this update_rotate $id $canvasX_ $canvasY_] $canvas_ bind $sel_id \ [code $this end_rotate $id] } } adjust_line_selection $id } # set the cursor for the canvas window and save the previous cursor # for later restoration public method set_cursor {cursor} { if {! $resizing_} { set prev_cursor_ [$canvas_ cget -cursor] $canvas_ config -cursor $cursor } } # set the cursor for the canvas window back to the previous one, unless # we are in the middle of a resize operation public method reset_cursor {} { if {! $resizing_} { $canvas_ config -cursor $prev_cursor_ set prev_cursor_ $itk_option(-defaultcursor) } } # Draw the object selection grips (small boxes similar to those # used by FrameMaker and used to move and resize the object). # Lines (see above) get one at each end, # other objects (here) get one at each corner and side of the object's # bounding box. If type is "polygon" or "line", rotation bindings are # also enabled (with ). protected method draw_selection_grips {id {type ""}} { # make sure we are using the canvas id set id [lindex [$canvas_ find withtag $id] 0] if {"$type" == "line" && [llength [$canvas_ coords $id]] == 4} { draw_line_selection_grips $id return } foreach side {n e s w ne nw se sw} { set sel_id [$canvas_ create rectangle 0 0 \ $itk_option(-gripwidth) $itk_option(-gripwidth) \ -tags [list grip grip.$id grip.$id.$side] \ -fill $itk_option(-gripfill) -outline $itk_option(-gripoutline)] $canvas_ bind $sel_id \ [list $canvas_ config \ -cursor "$cursors_($side) white black" ] $canvas_ bind $sel_id [code $this reset_cursor] $canvas_ bind $sel_id <1> \ [code eval $this start_resize $id $canvasX_ $canvasY_ $side] $canvas_ bind $sel_id \ [code eval $this start_resize $id $canvasX_ $canvasY_ $side] $canvas_ bind $sel_id \ [code $this end_resize $id] $canvas_ bind $sel_id \ [code $this end_resize $id] $canvas_ bind $sel_id \ [code eval $this update_resize $id $canvasX_ $canvasY_ $side 0] $canvas_ bind $sel_id \ [code eval $this update_resize $id $canvasX_ $canvasY_ $side 1] # Add support for rotation for polygons and lines. # Tk doesn't support it directly, but we can do it manually for # polygons and (poly)lines. We don't want to allow rotation for # "region" items, for now. Note that we could do the selection # a lot better if the rotation angle was a Tk canvas item option # (i.e.: the coords would stay the same, and the angle would change). if {$itk_option(-withrotate) \ && ("$type" == "polygon" || "$type" == "line") \ && ![info exists regions_($id)]} { $canvas_ bind $sel_id \ [list $canvas_ config -cursor $rotate_cursor_] $canvas_ bind $sel_id \ [code eval $this start_rotate $id $canvasX_ $canvasY_] $canvas_ bind $sel_id \ [code eval $this update_rotate $id $canvasX_ $canvasY_] $canvas_ bind $sel_id \ [code $this end_rotate $id] } } adjust_object_selection $id } # deselect the given object public method deselect_object {id} { $canvas_ delete grip.$id $canvas_ dtag $id $w_.selected $canvas_ focus {} } # deselect all canvas objects public method deselect_objects {} { $canvas_ delete grip $canvas_ dtag all $w_.selected $canvas_ focus {} } # adjust the selection handles for the given object to fit the new size/pos. public method adjust_object_selection {id} { if {"[$canvas_ type $id]" == "line" && [llength [$canvas_ coords $id]] == 4} { adjust_line_selection $id return } lassign [$canvas_ bbox $id] x0 y0 x1 y1 if {"$x0" == ""} { deselect_object $id return } set xm [expr {$x0+($x1-$x0)/2}] set ym [expr {$y0+($y1-$y0)/2}] set w [expr {$itk_option(-gripwidth)/2}] foreach i [list \ "nw $x0 $y0" \ "n $xm $y0" \ "ne $x1 $y0" \ "e $x1 $ym" \ "se $x1 $y1" \ "s $xm $y1" \ "sw $x0 $y1" \ "w $x0 $ym" ] { lassign $i side x y $canvas_ coords grip.$id.$side \ [expr {$x-$w}] [expr {$y-$w}] \ [expr {$x+$w}] [expr {$y+$w}] } } # adjust the selection handles for the given simple line public method adjust_line_selection {id} { lassign [$canvas_ coords $id] x0 y0 x1 y1 set xm [expr {$x0+($x1-$x0)/2}] set ym [expr {$y0+($y1-$y0)/2}] set w [expr {$itk_option(-gripwidth)/2}] foreach i [list \ "e $x0 $y0" \ "w $x1 $y1" ] { lassign $i side x y $canvas_ coords grip.$id.$side \ [expr {$x-$w}] [expr {$y-$w}] \ [expr {$x+$w}] [expr {$y+$w}] } } # resize the given line protected method resize_line {id x y side constrain} { clip x y set resizing_ 1 lassign [$canvas_ coords $id] x0 y0 x1 y1 if {$constrain} { if {abs($x1-$x0) abs($starty_-$y)} { set x [expr {$startx_+($y-$starty_)}] } else { set y [expr {$starty_+($x-$startx_)}] } } if {$dragx_} { set d [expr {$endx_-$startx_}] if {$d != 0} { set dx [expr {($x-$startx_)/$d}] } } if {$dragy_} { set d [expr {$endy_-$starty_}] if {$d != 0} { set dy [expr {($y-$starty_)/$d}] } } if {$dx < 0 || $dy < 0} { return } if {$dx != 0 && $dy != 0} { $canvas_ scale $id $startx_ $starty_ $dx $dy } # move back to exact position (bbox only returns integer coords) # set exact end position to avoid cummulative errors set pos [$canvas_ bbox $id] if {$posx_ == -1} { set dx 0 set endx_ $x } else { set dx [expr {$startx_ - [lindex $pos $posx_]}] set endx_ [lindex $pos $posx2_] } if {$posy_ == -1} { set dy 0 set endy_ $y } else { set dy [expr {$starty_ - [lindex $pos $posy_]}] set endy_ [lindex $pos $posy2_] } $canvas_ move $id $dx $dy if {[info exists notify_update_($id)]} { eval "$notify_update_($id) resize" } } # create a new object in the canvas public method create_object {x y} { mark $x $y set obj_coords_ "$x $y" set obj_id_ [create_$drawing_mode_ $x $y] if {"$drawing_mode_" != "region"} { $canvas_ addtag objects withtag $obj_id_ $canvas_ addtag $w_.objects withtag $obj_id_ } set resizing_ 1 } # return 1 if the given item has the given tag public method item_has_tag {item tag} { return [expr {[lsearch -exact [$canvas_ gettags $item] $tag] != -1}] } # return 1 if the given item is currently selected public method item_is_selected {item} { return [item_has_tag $item $w_.selected] } # return a list of all of the currently selected items public method selected_items {} { return [$canvas_ find withtag $w_.selected] } # move the given object protected method move_object {id x y} { if {$drawing_} { return } if {![item_is_selected $id]} { deselect_objects select_object $id mark $x $y } set dx [expr {$x-($startx_+$xoffset_)}] set dy [expr {$y-($starty_+$yoffset_)}] set xoffset_ [expr {$x-$startx_}] set yoffset_ [expr {$y-$starty_}] if {$itk_option(-clipping)} { # don't allow a move outside of drawing area lassign [$canvas_ bbox $w_.selected] x0 y0 x1 y1 set dx0 [expr {$x0_-$x0}] set dy0 [expr {$y0_-$y0}] set dx1 [expr {$x1_-$x1}] set dy1 [expr {$y1_-$y1}] if {$dx < $dx0} { set dx $dx0 } elseif {$dx > $dx1} { set dx $dx1 } if {$dy < $dy0} { set dy $dy0 } elseif {$dy > $dy1} { set dy $dy1 } } if {$dx || $dy} { foreach i "$w_.selected grip" { $canvas_ move $i $dx $dy } foreach i [selected_items] { set moved_($i) 1 if {[info exists notify_update_($i)]} { eval "$notify_update_($i) move" } } update idletasks } } # this method is called when a move operation is done protected method end_move {id} { foreach i [selected_items] { if {[info exists moved_($i)]} { if {[info exists notify_($i)]} { eval "$notify_($i) move" } unset moved_($i) } } } # create and return a new rectangle object (actually create a # polygon object in the shape of a rectangle, since it is more # flexible and can be rotated). protected method create_rectangle {x y} { clip x y if {$itk_option(-withrotate)} { return [$canvas_ create polygon $x $y $x $y $x $y $x $y \ -width $itk_option(-linewidth) \ -fill $itk_option(-fillcolor) \ -outline $itk_option(-outlinecolor) \ -smooth $itk_option(-smooth) \ -stipple $itk_option(-stipplepattern)] } else { return [$canvas_ create rect $x $y $x $y \ -width $itk_option(-linewidth) \ -fill $itk_option(-fillcolor) \ -outline $itk_option(-outlinecolor) \ -stipple $itk_option(-stipplepattern)] } } # create and return a new region (dashed rectangle marking a region # of the canvas) protected method create_region {x y} { clip x y set id [$canvas_ create line $x $y $x $y $x $y $x $y \ -width 2 \ -fill $itk_option(-outlinecolor) \ -stipple pat8] set regions_($id) 1 return $id } # create and return a new oval object protected method create_oval {x y} { clip x y return [$canvas_ create oval $x $y $x $y \ -width $itk_option(-linewidth) \ -fill $itk_option(-fillcolor) \ -outline $itk_option(-outlinecolor) \ -stipple $itk_option(-stipplepattern)] } # create and return a new arc object protected method create_arc {x y} { clip x y return [$canvas_ create arc $x $y $x $y \ -width $itk_option(-linewidth) \ -fill $itk_option(-fillcolor) \ -outline $itk_option(-outlinecolor) \ -stipple $itk_option(-stipplepattern)] } # return a color for a line that will be visible protected method get_line_color {} { if {"$itk_option(-fillcolor)" == ""} { return $itk_option(-outlinecolor) } else { return $itk_option(-fillcolor) } } # create and return a new line object protected method create_line {x y} { clip x y return [$canvas_ create line $x $y $x $y \ -width $itk_option(-linewidth) \ -fill [get_line_color] \ -stipple $itk_option(-linestipple) \ -arrow $itk_option(-arrowtype) \ -smooth $itk_option(-smooth) \ -arrowshape $itk_option(-arrowshape)] } # create and return a new freehand object protected method create_freehand {x y} { clip x y return [$canvas_ create line $x $y $x $y \ -width $itk_option(-linewidth) \ -fill [get_line_color] \ -arrow $itk_option(-arrowtype) \ -stipple $itk_option(-linestipple) \ -arrowshape $itk_option(-arrowshape)] } # create and return a new polyline object protected method create_polyline {x y} { clip x y return [create_line $x $y] } # create and return a new polygon object protected method create_polygon {x y} { clip x y set obj_coords_ "$x $y $x $y $x $y" return [$canvas_ create polygon $x $y $x $y $x $y \ -fill $itk_option(-fillcolor) \ -outline $itk_option(-outlinecolor) \ -width $itk_option(-linewidth) \ -smooth $itk_option(-smooth) \ -stipple $itk_option(-stipplepattern)] } # create and return a new text object protected method create_text {x y} { clip x y set id [$canvas_ create text $x $y \ -fill [get_line_color] \ -font $itk_option(-textfont) \ -anchor w \ -stipple $itk_option(-linestipple)] # set up text bindings ct_add_bindings $canvas_ $id focus $canvas_ $canvas_ focus $id $canvas_ icursor $id 0 $canvas_ addtag $w_.selected withtag $id return $id } # create and return a new label (entry) object protected method create_label {x y} { clip x y set entry [entry $canvas_.lab[incr tag_count_] \ -font $itk_option(-textfont) \ -borderwidth 0 -relief flat \ -width 0] set id [$canvas_ create window $x $y \ -window $entry \ -anchor w] focus $entry bind $entry "+focus $canvas_; $this select_only_object $id $canvasX_ $canvasY_" bind $entry <1> "+focus $entry" $canvas_ addtag $w_.selected withtag $id return $id } # resize the rectangle for a label to fit the text protected method resize_label {text rect tag} { eval "$canvas_ coords $rect [$canvas_ bbox $text]" } # update the current object in the canvas with the new x, y end points protected method update_object {x y {constrain 0}} { clip x y if {$constrain} { if {abs($startx_-$x)>abs($starty_-$y)} { set x [expr {$startx_+($y-$starty_)}] } else { set y [expr {$starty_+($x-$startx_)}] } } $canvas_ coords $obj_id_ $startx_ $starty_ $x $y } # update the current line object in the canvas with the new x, y end points protected method update_line {x y {constrain 0}} { clip x y if {$constrain} { if {abs($startx_-$x)abs($starty_-$y)} { set x [expr {$startx_+($y-$starty_)}] } else { set y [expr {$starty_+($x-$startx_)}] } } if {$itk_option(-withrotate)} { $canvas_ coords $obj_id_ $startx_ $starty_ $x $starty_ $x $y $startx_ $y } else { $canvas_ coords $obj_id_ $startx_ $starty_ $x $y } } # update the current region object (dashed rectangle used for marking # a region on the canvas) protected method update_region {x y {constrain 0}} { clip x y if {$constrain} { if {abs($startx_-$x)>abs($starty_-$y)} { set x [expr {$startx_+($y-$starty_)}] } else { set y [expr {$starty_+($x-$startx_)}] } } $canvas_ coords $obj_id_ \ $startx_ $starty_ \ $x $starty_ \ $x $y \ $startx_ $y \ $startx_ $starty_ } # update the current freehand object in the canvas with the new x, y end points protected method update_freehand {x y} { clip x y lappend obj_coords_ $x $y eval $canvas_ coords $obj_id_ $obj_coords_ $x $y } # arrange to have cmd evaluated whenever the given object is moved # or resized. id is the canvas id of the object, If update_flag # is 1, $cmd is also evaluated while the item is being moved or # resized, otherwise only when the operation is done. public method add_notify_cmd {id cmd {update_flag 0}} { set notify_($id) $cmd if {$update_flag} { set notify_update_($id) $cmd } } # remove the notify command for the given canvas id public method remove_notify_cmd {id} { if {[info exists notify_($id)]} { unset notify_($id) } if {[info exists notify_update_($id)]} { unset notify_update_($id) } } # Exchange the X and Y coords for the given item (not really rotate...) public method rotate {item} { set ids [$canvas_ find withtag $item] foreach id $ids { catch { set coords [$canvas_ coords $id] set n [llength $coords] set ncoords {} for {set i 0} {$i < $n} {incr i 2} { lappend ncoords [lindex $coords [expr {$i+1}]] [lindex $coords $i] } eval $canvas_ coords $id $ncoords } } } # flip the named item(s) on the X axis by subtracting the x # coordinates from $maxx public method flipx {item maxx} { set ids [$canvas_ find withtag $item] foreach id $ids { catch { set coords [$canvas_ coords $id] set n [llength $coords] set ncoords {} for {set i 0} {$i < $n} {incr i 2} { lappend ncoords [expr {$maxx-[lindex $coords $i]}] \ [lindex $coords [expr {$i+1}]] } eval $canvas_ coords $id $ncoords } } } # flip the named item(s) on the Y axis by subtracting the y # coordinates from $maxy public method flipy {item maxy} { set ids [$canvas_ find withtag $item] foreach id $ids { catch { set coords [$canvas_ coords $id] set n [llength $coords] set ncoords {} for {set i 0} {$i < $n} {incr i 2} { lappend ncoords [lindex $coords $i] [expr {$maxy-[lindex $coords [expr {$i+1}]]}] } eval $canvas_ coords $id $ncoords } } } # start rotating the selected object protected method start_rotate {id x y} { mark $x $y set rotate_angle_ "" # get center of object lassign [$canvas_ bbox $w_.selected] x0 y0 x1 y1 set rotate_cx_ [expr {($x1+$x0)/2.}] set rotate_cy_ [expr {($y1+$y0)/2.}] } # rotate the given point about the given center point by the given angle # (in radians) and return a list {x y} as the result. public method rotate_point {x y cx cy angle} { set x [expr {$x-$cx}] set y [expr {$y-$cy}] set tmp $x set cosa [expr {cos($angle)}] set sina [expr {sin($angle)}] set x [expr {$x*$cosa+$y*$sina+$cx}] set y [expr {-$tmp*$sina+$y*$cosa+$cy}] return "$x $y" } # update the rotating of the selected object protected method update_rotate {id x y} { clip x y set dx [expr {$rotate_cx_-double($x+0.5)}] set dy [expr {$rotate_cy_-double($y+0.5)}] set a [expr {atan2($dx,$dy)}] if {"$rotate_angle_" == ""} { set rotate_angle_ $a return } set angle [expr {$a-$rotate_angle_}] set rotate_angle_ $a set coords [$canvas_ coords $id] set cmd [list $canvas_ coords $id] set n [llength $coords] for {set i 0} {$i<$n} {incr i 2} { set x [lindex $coords $i] set y [lindex $coords [expr {$i+1}]] append cmd " [rotate_point $x $y $rotate_cx_ $rotate_cy_ $angle]" } eval $cmd } # stop rotating the selected object protected method end_rotate {id} { if {[info exists notify_($id)]} { eval "$notify_($id) rotate" } adjust_object_selection $id reset_cursor } # -- options -- # if true (default) create the GUI interface (toolbox), otherwise don't itk_option define -withtoolbox withToolbox WithToolbox {1} # if true (default) use polygons for rectangles to support rotation in Tcl # (Tk doesn't support rotating, but polygons can be rotated in Tcl code). # Subclasses that define rotation by adding new canvas objects can set this # option to 0. itk_option define -withrotate withRotate WithRotate {1} # canvas window itk_option define -canvas canvas Canvas {} { set canvas_ $itk_option(-canvas) # string used in bindings to translate %x and %y to canvas coords set canvasX_ "\[$canvas_ canvasx %x\]" set canvasY_ "\[$canvas_ canvasy %y\]" } # specify bounding box of interactive drawing area as a list {x0 y0 x1 y1} itk_option define -bbox bbox Bbox {} { if {[llength $itk_option(-bbox)] == 4} { lassign $itk_option(-bbox) x0_ y0_ x1_ y1_ # leave room for the selection grips, line width, etc set w $itk_option(-gripwidth) set x0_ [expr {$x0_-$w}] set y0_ [expr {$y0_-$w}] set x1_ [expr {$x1_+$w}] set y1_ [expr {$y1_+$w}] } } # flag: if true, keep graphics within the specified bounding box (-bbox option) itk_option define -clipping clipping Clipping 1 # list of colors for menu itk_option define -colors colors Colors { white grey90 grey80 grey70 grey60 grey50 grey40 grey30 grey20 grey10 black red green blue cyan magenta yellow } # default color for outlines itk_option define -outlinecolor outlineColor OutlineColor {grey90} # default text item font itk_option define -textfont textFont TextFont TkFixedFont # default list of fonts for font menu itk_option define -fonts fonts Fonts { -*-courier-medium-r-*-*-*-120-*-*-*-*-*-* -*-courier-medium-o-*-*-*-120-*-*-*-*-*-* -*-courier-bold-r-*-*-*-120-*-*-*-*-*-* -*-courier-medium-r-*-*-*-140-*-*-*-*-*-* -*-courier-medium-o-*-*-*-140-*-*-*-*-*-* -*-courier-bold-r-*-*-*-140-*-*-*-*-*-* -*-courier-medium-r-*-*-*-180-*-*-*-*-*-* -*-courier-medium-o-*-*-*-180-*-*-*-*-*-* -*-courier-bold-r-*-*-*-180-*-*-*-*-*-* -*-courier-medium-r-*-*-*-240-*-*-*-*-*-* -*-courier-medium-o-*-*-*-240-*-*-*-*-*-* -*-courier-bold-r-*-*-*-240-*-*-*-*-*-* } # default value for smooth option itk_option define -smooth smooth Smooth 0 # default line width for drawing itk_option define -linewidth lineWidth LineWidth 1 # default arrow type for lines itk_option define -arrowtype arrowType ArrowType none # default arrow shape for lines itk_option define -arrowshape arrowShape ArrowShape {8 10 3} # default fill color for drawing itk_option define -fillcolor fillColor FillColor {white} # default stipple pattern for drawing itk_option define -stipplepattern stipplePattern StipplePattern "pat7" # default stipple for lines itk_option define -linestipple lineStipple LineStipple "pat0" # -- standard cursor names taken from X11/cursorfont.h -- # default cursor when not drawing itk_option define -defaultcursor defaultCursor DefaultCursor {} # cursor when drawing graphics itk_option define -drawcursor drawCursor DrawCursor {tcross white black} # cursor when creating region items (dashed box marking a region) itk_option define -regioncursor regionCursor RegionCursor {leftbutton white black} # Tcl command to evaluate whenever a "region" object is created, if no # specific "create" command was specified. itk_option define -regioncommand regionCommand RegionCommand {} # cursor when creating text items itk_option define -textcursor textCursor TextCursor {left_side} # cursor displayed over simple lines for resizing itk_option define -linecursor lineCursor LineCursor {draft_small white black} # size of selection grips itk_option define -gripwidth gripWidth GripWidth 5 # fill color of selection grips itk_option define -gripfill gripFill GripFill white # outline color of selection grips itk_option define -gripoutline gripOutline GripOutline black # flag: if true, display selection grips when an item is selected itk_option define -show_selection_grips show_selection_grips Show_selection_grips 1 # flag: if true, display menus over graphic objects when selected with <3> itk_option define -show_object_menu show_object_menu Show_object_menu 1 # -- protected member variables -- # list of drawing types protected variable drawing_modes_ { anyselect region line rectangle oval polyline polygon text } # available arrow shapes for canvas lines # (corresponds to bitmaps named ar$1_$2_$3) protected variable arrowshapes_ { {8 10 3} {10 13 3} {12 11 3} {12 12 3} {6 6 4} {8 12 9} {8 8 6} } # current draw type protected variable drawing_mode_ {anyselect} # starting x coord of object being drawn protected variable startx_ 0 # starting y coord of object being drawn protected variable starty_ 0 # ending x coord of object being drawn protected variable endx_ 0 # ending y coord of object being drawn protected variable endy_ 0 # x offset for move operations protected variable xoffset_ 0 # y offsets for move operations protected variable yoffset_ 0 # flag: true if resizing on X axis protected variable dragx_ 0 # flag: true if resizing on Y axis protected variable dragy_ 0 # flag, true if drawing currently protected variable drawing_ 0 # list of coords for current object being created protected variable obj_coords_ {} # canvas id of the current canvas item protected variable obj_id_ # strings used in bindings to translate %x to canvas coords protected variable canvasX_ # strings used in bindings to translate %y to canvas coords protected variable canvasY_ # counter used for compound objects to generate canvas tags protected variable tag_count_ 0 # array(canvasID,option) of option to use instead for that id protected variable option_map_ # command to evaluate when the current item has been created protected variable create_cmd_ # array(id) of tcl command to evaluate when object given by canvas id # is moved or scaled protected variable notify_ # same as notify_ above, but indicates command should be evaluated # while item is being moved or resized protected variable notify_update_ # array(id) of flag: set if object with id was moved protected variable moved_ # flag: true if currently resizing an item protected variable resizing_ 0 # popup menu for canvas items protected variable object_menu_ # saved menu (optional, from caller's menubar) with drawing commands # for setting the state of the menu items. protected variable menu_ {} # saved previous cursor for canvas protected variable prev_cursor_ {} # cursor to use in rotate mode protected variable rotate_cursor_ {exchange} # index of stipple bitmap (0 .. 15, 7 is see through, see -stipplepattern) protected variable stipple_index_ 7 # canvas widget protected variable canvas_ # x0 of bounding box of interactive drawing area protected variable x0_ 0 # y0 of bounding box of interactive drawing area protected variable y0_ 0 # x1 of bounding box of interactive drawing area protected variable x1_ 1000 # y1 of bounding box of interactive drawing area protected variable y1_ 1000 # x pos for resize operations protected variable posx_ 0 # y pos for resize operations protected variable posy_ 0 # x2 pos for resize operations protected variable posx2_ 0 # y2 pos for resize operations protected variable posy2_ 0 # center X coordinate of object being rotated protected variable rotate_cx_ 0 # center Y coordinate of object being rotated protected variable rotate_cy_ 0 # current rotation angle of object protected variable rotate_angle_ 0 # array(canvasId) of region ids, used to keep these from rotating protected variable regions_ # -- common variables -- # array(direction={n,w,e,s,nw,ne,sw,se}) of cursor names for selection handles protected common cursors_ set cursors_(n) top_side set cursors_(w) left_side set cursors_(s) bottom_side set cursors_(e) right_side set cursors_(nw) top_left_corner set cursors_(ne) top_right_corner set cursors_(sw) bottom_left_corner set cursors_(se) bottom_right_corner # const PI protected common pi_ 3.14159265358979323846 # const PI/180. protected common rad_ [expr {$pi_/180.}] } skycat-3.1.2-starlink-1b/tclutil/library/CanvasPrint.tcl000066400000000000000000000154611215713201500232240ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: CanvasPrint.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # CanvasPrint.tcl - Popup dialog for printing the contents of a Tk canvas # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created # Peter W. Draper 20 Jul 09 Removed mono widget, BLT no longer offers this. itk::usual CanvasPrint {} # This class extends the PrintDialog class to be able to # print the contents of a canvas as postscript. # Note: this class does not support printing images embedded # in the canvas. itcl::class util::CanvasPrint { inherit util::PrintDialog # constructor constructor {args} { eval itk_initialize $args } # this method is called after all options have been evaluated protected method init {} { util::PrintDialog::init global ::$w_.color ::$w_.rotate ::$w_.fit_to_page pack [frame $w_.options -borderwidth 3 -relief groove] \ -side top -fill x -expand 1 -in $w_.config pack [label $w_.options.title -text "Postscript Options"] \ -side top # color options pack [frame $w_.color -borderwidth 5] \ -side top -fill x -expand 1 -in $w_.options pack [radiobutton $w_.color.color -text "Color" \ -variable $w_.color \ -value color] \ [radiobutton $w_.color.gray -text "Gray-Scale" \ -variable $w_.color \ -value gray] \ -side left -fill x -expand 1 ::set $w_.color color # rotate options pack [frame $w_.rotate -borderwidth 5] \ -side top -fill x -expand 1 -in $w_.options pack [radiobutton $w_.rotate.yes -text "Landscape" \ -variable $w_.rotate \ -value yes] \ [radiobutton $w_.rotate.no -text "Portrait" \ -variable $w_.rotate \ -value no] \ -side left -fill x -expand 1 ::set $w_.rotate no # page size options pack [frame $w_.pagesize -borderwidth 5] \ -side top -fill x -expand 1 -in $w_.options pack [checkbutton $w_.pagesize.fit -text "Fit on page" \ -variable $w_.fit_to_page \ -command [code $this toggle_fit_pagesize]] \ -side top -anchor w pack \ [LabelEntry $w_.pagesize.width \ -text "Page width " \ -value $itk_option(-pagewidth) \ -valuewidth 6] \ [LabelEntry $w_.pagesize.height \ -text "Page height" \ -value $itk_option(-pageheight) \ -valuewidth 6] \ -side left -expand 1 ::set $w_.fit_to_page $itk_option(-fit_to_page) } # called when the "Fit on page" button is pressed protected method toggle_fit_pagesize {} { global ::$w_.fit_to_page if {[set $w_.fit_to_page]} { $w_.pagesize.width config -state normal $w_.pagesize.height config -state normal } else { $w_.pagesize.width config -state disabled $w_.pagesize.height config -state disabled } } # print the contents of the canvas to the open filedescriptor protected method print {fd} { global ::$w_.color ::$w_.rotate ::$w_.colormap ::$w_.fit_to_page set cmd [list $itk_option(-canvas) postscript \ -colormode [set $w_.color] \ -rotate [set $w_.rotate]] if {"$x0" == ""} { lassign [$itk_option(-canvas) bbox all] x0 y0 x1 y1 } if {$itk_option(-show_headers)} { add_headers } lappend cmd \ -width [expr {$x1-$x0}] \ -height [expr {$y1-$y0}] \ -x $x0 \ -y $y0 if {[set $w_.fit_to_page]} { lappend cmd \ -pagewidth [$w_.pagesize.width get] \ -pageheight [$w_.pagesize.height get] } if {"[set $w_.color]" == "mono"} { # you can add to this array, see canvas(n) man page set $w_.colormap(grey) "0.0 0.0 0.0 setrgbcolor" lappend cmd -colormap $w_.colormap } # puts $cmd puts $fd [eval $cmd] if {$itk_option(-show_headers)} { rm_headers } } # add header and footer labels above/below draw area by temporarily inserting # the text protected method add_headers {} { set hy0 [expr {$y0-25}] set hy1 [expr {$y1+25}] # white background for labels $itk_option(-canvas) create rect $x0 $hy0 $x1 $y0 \ -outline white \ -fill white \ -tags print $itk_option(-canvas) create rect $x0 $y1 $x1 $hy1 \ -outline white \ -fill white \ -tags print set y0 [expr {$y0-5}] set y1 [expr {$y1+5}] if {"$itk_option(-top_left)" != ""} { $itk_option(-canvas) create text $x0 $y0 \ -text $itk_option(-top_left) \ -font $itk_option(-header_font) \ -anchor sw \ -tags print } if {"$itk_option(-top_right)" != ""} { $itk_option(-canvas) create text $x1 $y0 \ -text $itk_option(-top_right) \ -font $itk_option(-header_font) \ -anchor se \ -tags print } if {"$itk_option(-bot_left)" != ""} { $itk_option(-canvas) create text $x0 $y1 \ -text $itk_option(-bot_left) \ -font $itk_option(-header_font) \ -anchor nw \ -tags print } if {"$itk_option(-bot_right)" != ""} { $itk_option(-canvas) create text $x1 $y1 \ -text $itk_option(-bot_right) \ -font $itk_option(-header_font) \ -anchor ne \ -tags print } set y0 $hy0 set y1 $hy1 } # remove the headers, if any and restore the original state protected method rm_headers {} { $itk_option(-canvas) delete print } # -- options -- # canvas widget itk_option define -canvas canvas Canvas {} # flag, if true, scale output to fit on page itk_option define -fit_to_page fit_to_page Fit_to_page 1 # page width, used when fit_to_page is 1 itk_option define -pagewidth pageWidth Pagewidth 8.268i # page height, used when fit_to_page is 1 itk_option define -pageheight pageHeight Pageheight 11.693i # flag, if true, insert headers before printing itk_option define -show_headers show_headers Show_headers 0 # header text to appear at top left itk_option define -top_left top_left Top_left {} # header text to appear at top right itk_option define -top_right top_right Top_right {} # header text to appear at bottom left itk_option define -bot_left bot_left Bot_left {} # header text to appear at bottom right itk_option define -bot_right bot_right Bot_right {} # header/footer fonts itk_option define -header_font header_font Header_font TkDefaultFont # x0 coordinate of area of canvas to print itk_option define -x0 x0 X0 {} {set x0 $itk_option(-x0)} # y0 coordinate of area of canvas to print itk_option define -y0 y0 Y0 {} {set y0 $itk_option(-y0)} # x1 coordinate of area of canvas to print itk_option define -x1 x1 X1 {} {set x1 $itk_option(-x1)} # y1 coordinate of area of canvas to print itk_option define -y1 y1 Y1 {} {set y1 $itk_option(-y1)} # -- protected variables -- # saved -x0 option value protected variable x0 # saved -y0 option value protected variable y0 # saved -x1 option value protected variable x1 # saved -y1 option value protected variable y1 } skycat-3.1.2-starlink-1b/tclutil/library/CanvasWidget.tcl000066400000000000000000000031311215713201500233420ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: CanvasWidget.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # CanvasWidget.tcl - Itcl class based on the Tk canvas widget # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual CanvasWidget {} # This is an itcl class based on the Tk canvas widget. It combines # a canvas window in a frame with optional scrollbars. itcl::class util::CanvasWidget { inherit util::FrameWidget # create the canvas and scrollbars constructor {args} { # Canvas widget itk_component add canvas { canvas $w_.canvas -scrollregion {0 0 0 0} } { keep -width -height -borderwidth -relief usual rename -background -canvasbackground canvasBackground CanvasBackground } # Vertical scrollbar. itk_component add vscroll { scrollbar $w_.vscroll \ -relief sunken \ -command "$w_.canvas yview" } # Horrizontal scrollbar itk_component add hscroll { scrollbar $w_.hscroll \ -orient horiz \ -relief sunken \ -command "$itk_component(canvas) xview" } $itk_component(canvas) config \ -xscrollcommand "$itk_component(hscroll) set" \ -yscrollcommand "$itk_component(vscroll) set" bind $itk_component(canvas) "$itk_component(canvas) scan mark %x %y" bind $itk_component(canvas) "$itk_component(canvas) scan dragto %x %y" pack $itk_component(hscroll) -side bottom -fill x pack $itk_component(vscroll) -side right -fill y pack $itk_component(canvas) -fill both -expand 1 eval itk_initialize $args } } skycat-3.1.2-starlink-1b/tclutil/library/CheckEntry.tcl000066400000000000000000000052261215713201500230310ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: CheckEntry.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # CheckEntry.tcl - Itcl widget combining a checkbutton and an entry # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual CheckEntry {} # This class defines an Itk widget combining a checkbutton and an entry. itcl::class util::CheckEntry { inherit util::FrameWidget # constructor: create new CheckEntry constructor {args} { set variable_ $w_.var global ::$variable_ # Tk checkbutton widget itk_component add check { checkbutton $w_.check -variable $variable_ } { keep -text -background -foreground -anchor rename -font -labelfont labelFont LabelFont rename -width -labelwidth labelWidth LabelWidth } pack $itk_component(check) \ -side left -fill x -expand 1 -ipadx 1m # Tk entry widget itk_component add entry { entry $w_.entry -relief sunken } { keep -relief -borderwidth -textvariable -show rename -font -valuefont valueFont ValueFont rename -width -valuewidth valueWidth ValueWidth } pack $itk_component(entry) \ -side left -expand 1 -fill x -padx 1m -ipadx 1m bind $itk_component(entry) <1> "[bind Entry <1>]; $itk_component(check) select" eval itk_initialize $args } # Get the value in the entry public method get {} { global ::$variable_ if {[set $variable_]} { return [$itk_component(entry) get] } return {} } # called for Return in the entry protected method _command_proc {} { if {"$itk_option(-command)" != ""} { set a $itk_option(-command) lappend a [$this get] eval $a } } # -- options -- # set the value in the entry itk_option define -value value Value {} { global ::$variable_ if {"$itk_option(-value)" == ""} { set $variable_ 0 } else { if {[winfo exists $itk_component(entry)]} { set $variable_ 1 $itk_component(entry) delete 0 end $itk_component(entry) insert 0 [cget -value] $itk_component(entry) icursor end $itk_component(entry) xview moveto 1 } } } # the command for in the entry itk_option define -command command Command {} { bind $itk_component(entry) [code $this _command_proc] } # optionally specify the trace variable to use itk_option define -variable variable Variable {} { if {"$itk_option(-variable)" != ""} { $itk_component(check) configure -variable [set variable_ $itk_option(-variable)] } } # -- protected variables -- # trace var for checkbutton protected variable variable_ } skycat-3.1.2-starlink-1b/tclutil/library/CheckEntryNumber.tcl000066400000000000000000000035711215713201500242030ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: CheckEntryNumber.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # CheckEntry.tcl - Itcl widget combining a checkbutton and an number entry # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual CheckEntryNumber {} # This class defines an Itk widget combining a checkbutton and a number entry. itcl::class util::CheckEntryNumber { inherit util::CheckEntry # constructor: create a new LabelNumber constructor {args} { # button frame itk_component add bframe { frame $w_.f } { keep -background } # button to increment number. itk_component add incr { button $w_.f.incr \ -bitmap incr \ -command [code $this increment 1] } { keep -state -background -foreground } # button to decrement number. itk_component add decr { button $w_.f.decr \ -bitmap decr \ -command [code $this increment -1] } { keep -state -background -foreground } pack $itk_component(incr) $itk_component(decr) \ -side top pack $itk_component(bframe) -side left eval itk_initialize $args if {"itk_option(-value)" == ""} { config -value $itk_option(-min) } } # increment (1) or decrement (-1) the value by the current increment protected method increment {sign} { set v [expr [get]+($sign*$itk_option(-increment))] if {$v >= $itk_option(-min) && $v <= $itk_option(-max)} { config -value [format "%g" $v] if {"$itk_option(-command)" != ""} { set cmd $itk_option(-command) lappend cmd $v eval $cmd } } } # -- options -- # maximum value itk_option define -max max Max {100} # minimum value itk_option define -min min Min {0} # amount to add or subtract for each button push itk_option define -increment increment Increment {1} } skycat-3.1.2-starlink-1b/tclutil/library/ChoiceDialog.tcl000066400000000000000000000023701215713201500233010ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: ChoiceDialog.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # ChoiceDialog.tcl - Dialog to display a message and get choice from the user # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual ChoiceDialog {} # A ChoiceDialog is a dialog widget used to display a message and # get a choice from the user. itcl::class util::ChoiceDialog { inherit util::DialogWidget # create the dialog constructor {args} { # LabelChoice(n) Itk widget itk_component add choice { util::LabelChoice $itk_component(ext).choice \ -command [code $this set_choice] } { keep -choice -value -rows -cols } pack $itk_component(choice) -side left -fill x -expand 1 \ -padx 2m -pady 2m -ipady 1m eval itk_initialize $args } # called when a choice is made public method set_choice {choice} { global ::$variable_ set $variable_ $choice } # this method is redefined here to change the value # that is returned from activate to be the contents of the choice widget protected method set_result {} { global ::$variable_ return [$itk_component(choice) get] } } skycat-3.1.2-starlink-1b/tclutil/library/Chooser.tcl000066400000000000000000000045721215713201500223770ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # "@(#) $Id: Chooser.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # Chooser.tcl - A simple widget for selecting items based on filenames # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual Chooser {} # Chooser is a simple itcl widget for selecting items based on files # with a given suffix in a given directory. itcl::class util::Chooser { inherit util::FrameWidget # create a new Chooser widget constructor {args} { itk_option add hull.borderwidth hull.relief # ListboxWidget(n) for displaying choice itk_component add list { util::ListboxWidget $w_.list \ -exportselection 0 \ -borderwidth 2 \ -relief sunken } { keep -title -vscroll -hscroll -width \ -background -foreground -font -height } pack $itk_component(list) -fill both -expand 1 set listbox_ [$itk_component(list) component listbox] bind $listbox_ "+[code $this choose]" eval itk_initialize $args } # set new values protected method choose {} { if {"$itk_option(-command)" != ""} { set sel [lindex [$itk_component(list) get_selected] 0] eval "$itk_option(-command) $itk_option(-dir)/$sel.$itk_option(-suffix)" } } # change the selection to the given file public method set_choice {file} { set n 0 foreach i $itk_option(-files) { set name [file rootname [file tail $i]] if {"$name" == "$file"} { $itk_component(list) select_row $n break } incr n } choose } # -- options -- # tcl command to evaluate with selected file name itk_option define -command command Command {} # directory for files itk_option define -dir dir Dir {.} # suffix for files itk_option define -suffix suffix Suffix {} # list of files (complete pathnames, usually output of [glob $dir/*.$suffix] itk_option define -files files Files {} { set n 0 foreach i $itk_option(-files) { set name [file rootname [file tail $i]] $itk_component(list) append $name if {"$name" == "$itk_option(-default)"} { $itk_component(list) select_row $n } incr n } } # default selection itk_option define -default default Default {} # -- protected vars -- # internal listbox widget protected variable listbox_ } skycat-3.1.2-starlink-1b/tclutil/library/DialogWidget.tcl000066400000000000000000000152421215713201500233340ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: DialogWidget.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # DialogWidget.tcl - Base class of dialog widget classes # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created # Peter W. Draper 03 Jul 06 Stop . being used as a parent, that is usually # in a withdrawn state. Why hasn't this been a # problem before? # 21 Mar 07 Raise the window on activation. Keeps hiding. # 13 Apr 07 And wait for update # 17 May 07 Make truncation lines an option. itk::usual DialogWidget {} # A DialogWidget is an itk widget for creating dialog windows. # A dialog window here is a window with a message at top and a row # of buttons at bottom. Through inheritance, you can add widgets # inbetween. itcl::class util::DialogWidget { inherit util::TopLevelWidget # create the dialog constructor {args} { set variable_ $w_.choice global ::$variable_ wm iconname $w_ DialogWidget if {[winfo parent $w_] != "." } { wm transient $w_ [winfo parent $w_] } # The top frame has one frame for the message and bitmap # and another for extensions defined in derived classes. itk_component add top { frame $w_.top -relief raised -borderwidth 2 } # default frame (for image, bitmap, message...) itk_component add def { frame $itk_component(top).def -borderwidth 2 } # extension frame (for subclasses) itk_component add ext { frame $itk_component(top).ext -borderwidth 2 } pack $itk_component(top) $itk_component(def) $itk_component(ext) \ -side top -fill both -expand 1 # optional image frame itk_component add imagef { frame $itk_component(def).imagef } # optional image label itk_component add image { label $itk_component(imagef).image } # optional message text itk_component add text { label $itk_component(def).text } { keep -justify -background rename -font -messagefont messageFont MessageFont rename -wraplength -messagewidth messageWidth MessageWidth } # optional bitmap frame itk_component add bitmapf { frame $itk_component(def).bitmapf } # optional bitmap label itk_component add bitmap { label $itk_component(bitmapf).bitmap } pack $itk_component(imagef) -side top pack $itk_component(text) -side right -expand 1 -fill both -padx 5m -pady 5m pack $itk_component(bitmapf) -side left eval itk_initialize $args } # this method is called after the options have been evaluated protected method init {} { # truncate long (many lines) error mesages set err [split $itk_option(-text) \n] if {[llength $err] > $itk_option(-max_lines) } { set err [lrange $err 0 $itk_option(-max_lines)] lappend err "..." } set err [join $err \n] $itk_component(text) config -text $err # add optional buttons add_buttons } # Create a row of buttons at the bottom of the dialog. protected method add_buttons {} { # Button frame at bottom. itk_component add bot { frame $w_.bot -relief raised -borderwidth 2 } pack $itk_component(bot) -side bottom -fill x set i 0 foreach but $itk_option(-buttons) { # Components for buttons specified with the -buttons option. # For example "buttonOK" for the OK button. itk_component add button$i { button $itk_component(bot).button$i -text $but -command "set $variable_ $i" } { } if {$i == $itk_option(-default)} { # Frame surrounding the default dialog button. itk_component add default { frame $itk_component(bot).default -relief sunken -borderwidth 1 } raise $itk_component(button$i) $itk_component(default) pack $itk_component(default) -side left -expand 1 -padx 3m -pady 2m pack $itk_component(button$i) -in $itk_component(default) -padx 2m -pady 2m \ -ipadx 2m -ipady 1m bind $w_ "$itk_component(button$i) flash; $itk_component(button$i) invoke" } else { pack $itk_component(button$i) -side left -expand 1 \ -padx 3m -pady 3m -ipadx 2m -ipady 1m } incr i } } # Display the window and return the user's selection public method activate {} { global ::$variable_ # Set a grab and claim the focus. set oldFocus [focus] if {$itk_option(-modal)} { catch {grab $w_} } catch {::raise $w_} update idletasks tkwait visibility $w_ if {$itk_option(-default) >= 0} { focus $itk_component(button$itk_option(-default)) } else { focus $w_ } # If the window is closed by the window manager we need to # get that request as well. wm protocol $w_ WM_DELETE_WINDOW "set ::$variable_ 0" # Wait for the user to respond, then restore the focus and # return the index of the selected button. tkwait variable $variable_ set result [set_result] catch {unset $variable_} catch {destroy $w_} catch {focus $oldFocus} return $result } # this method may be redefined in a derived class to change the value # that is returned from activate (default is the number of the button selected) protected method set_result {} { global ::$variable_ if {[info exists $variable_]} { return [set $variable_] } return 0 } # -- itk_option define -variables variables variables -- # Title to display in dialog's decorative frame. itk_option define -title title Title {dialog} { wm title $w_ $itk_option(-title) } # Index of button that is to display the default ring (-1 means none). itk_option define -default default Default {0} # text of message (truncated if too long) itk_option define -text text Text {} # One or more strings to display in buttons across the # bottom of the dialog box. itk_option define -buttons buttons Buttons {OK} # optional image to display above the message itk_option define -image image Image {} { if {"$itk_option(-image)" != ""} { $itk_component(image) config -image $itk_option(-image) pack $itk_component(image) -padx 5m -pady 5m } else { pack forget $itk_component(image) } } # optional bitmap to display to left of message itk_option define -bitmap bitmap Bitmap {info} { if {"$itk_option(-bitmap)" != ""} { $itk_component(bitmap) config -bitmap $itk_option(-bitmap) pack $itk_component(bitmap) -padx 5m -pady 5m } else { pack forget $itk_component(bitmap) } } # flag: if true, grab the screen itk_option define -modal modal Modal 1 # number of lines before truncation. itk_option define -max_lines max_lines Max_Lines 20 # -- protected vars -- # trace variable name protected variable variable_ } skycat-3.1.2-starlink-1b/tclutil/library/DoubleList.tcl000066400000000000000000000055731215713201500230450ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: DoubleList.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # DoubleList.tcl - Widget displaying two lists with arrows between them # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual DoubleList { } # A DoubleList is an itcl widget for displaying two lists with arrows between # them for moving items back and forth. itcl::class util::DoubleList { inherit util::FrameWidget # create a new object of this class constructor {args} { # left list component (see ListboxWidget(n)) itk_component add left { util::ListboxWidget $w_.left } { rename -title -lefttitle leftTitle LeftTitle keep -hscroll -vscroll -exportselection -selectmode -width -height } pack $itk_component(left) -side left -fill both -expand 1 # arrows pack [frame $w_.arrows -bd 1m] \ -side left -fill y -ipadx 0.5m pack [label $w_.arrows.fill -text " " ] \ -side top -fill x pack [button $w_.arrows.right \ -bitmap right_arrow \ -command [code $this move_right]] \ -side top -fill y -expand 1 pack [button $w_.arrows.left \ -bitmap left_arrow \ -command [code $this move_left]] \ -side top -fill y -expand 1 -pady 1m # right list component (see ListboxWidget(n)) itk_component add right { util::ListboxWidget $w_.right } { rename -title -righttitle rightTitle RightTitle keep -hscroll -vscroll -exportselection -selectmode -width -height } pack $itk_component(right) -side right -fill both -expand 1 eval itk_initialize $args } # move the selected elements from the left to the right list public method move_right {} { $itk_component(right) append_list [$itk_component(left) remove_selected] } # move the selected elements from the right to the left list public method move_left {} { $itk_component(left) append_list [$itk_component(right) remove_selected] } # move the selected elements from the right to the left list public method move_up {} { $itk_component(left) move_up } # move the selected elements from the right to the left list public method move_down {} { $itk_component(left) move_down } # make the lists empty public method clear {} { $itk_component(left) clear $itk_component(right) clear } # -- options -- # flag: if true, also display up and down buttons for moving # list items vertically itk_option define -updown upDown UpDown 0 { if {$itk_option(-updown)} { pack [button $w_.arrows.up \ -bitmap up_arrow \ -command [code $this move_up]] \ -side top -fill y -expand 1 pack [button $w_.arrows.down \ -bitmap down_arrow \ -command [code $this move_down]] \ -side top -fill y -expand 1 -pady 1m } else { catch {destroy $w_.arrows.up} catch {destroy $w_.arrows.down} } } } skycat-3.1.2-starlink-1b/tclutil/library/DoubleTableList.tcl000066400000000000000000000065031215713201500240070ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id" # # DoubleTableList.tcl - Widget displaying two TableLists with arrows between them. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual DoubleTableList { } # A DoubleTableList is an itcl widget for displaying two TableLists # with arrows between them for moving items back and forth. You can # access the left and right TableLists as itk components "left" and # "right". itcl::class util::DoubleTableList { inherit util::FrameWidget # create a new object of this class constructor {args} { # left table component (TableList(n)). itk_component add left { util::TableList $w_.left } { rename -title -lefttitle leftTitle LeftTitle rename -info -leftinfo leftInfo LeftInfo keep -headings -hscroll -vscroll -exportselection -selectmode -headinglines } pack $itk_component(left) -side left -fill both -expand 1 # arrows pack [frame $w_.arrows -bd 1m] \ -side left -fill y -ipadx 0.5m pack [label $w_.arrows.fill -text " " ] \ -side top -fill x pack [button $w_.arrows.right \ -bitmap right_arrow \ -command [code $this move_right]] \ -side top -fill y -expand 1 pack [button $w_.arrows.left \ -bitmap left_arrow \ -command [code $this move_left]] \ -side top -fill y -expand 1 -pady 1m # right table (see TableList(n)) itk_component add right { TableList $w_.right } { rename -title -righttitle rightTitle RightTitle rename -info -rightinfo rightInfo RightInfo keep -headings -hscroll -vscroll -exportselection -selectmode -headinglines } pack $itk_component(right) -side right -fill both -expand 1 # disable table configure here bind $itk_component(left).headbox <1> { } bind $itk_component(right).headbox <1> { } eval itk_initialize $args } # move the selected elements from the left to the right TableList public method move_right {} { $itk_component(right) append_rows [$itk_component(left) remove_selected] eval $command } # move the selected elements from the right to the left TableList public method move_left {} { $itk_component(left) append_rows [$itk_component(right) remove_selected] eval $command } # move the selected elements from the right to the left TableList public method move_up {} { $itk_component(left) move_up eval $command } # move the selected elements from the right to the left TableList public method move_down {} { $itk_component(left) move_down eval $command } # make the TableLists empty public method clear {} { $itk_component(left) clear $itk_component(right) clear eval $command } # -- options -- # command to evaluate when the list contents change public variable command {} # flag: if true, also display up and down buttons for moving # table items vertically itk_option define -updown upDown UpDown 0 { if {$itk_option(-updown)} { pack [button $w_.arrows.up \ -bitmap up_arrow \ -command [code $this move_up]] \ -side top -fill y -expand 1 pack [button $w_.arrows.down \ -bitmap down_arrow \ -command [code $this move_down]] \ -side top -fill y -expand 1 } else { catch {destroy $w_.arrows.up} catch {destroy $w_.arrows.down} } } } skycat-3.1.2-starlink-1b/tclutil/library/EntryForm.tcl000066400000000000000000000135111215713201500227130ustar00rootroot00000000000000# E.S.O. - VLT project/ESO Archive # "@(#) $Id: EntryForm.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # EntryForm.tcl - Form dialog for entering data at given labels # # who when what # -------- --------- ---------------------------------------------- # A.Brighton 26 Jun 96 created # P.Biereichel 04/08/99 Added option -scroll # P.W.Draper 03/12/08 Scroll for width as well as height. Some # reorganisations to make it work. itk::usual EntryForm {} # An EntryForm widget is a dialog for entering data at given labels. itcl::class util::EntryForm { inherit util::TopLevelWidget # constructor constructor {args} { eval itk_initialize $args } # called after options have been evaluated protected method init {} { # Title for window. itk_component add title { label $w_.title -text $itk_option(-title) } pack $itk_component(title) -side top -fill x -pady 2m -padx 2m # Frame containing dialog buttons. itk_component add buttons { util::ButtonFrame $w_.buttons \ -borderwidth 2 \ -relief raised \ -ok_label Enter \ -ok_cmd [code $this enter_data] \ -cancel_label Close \ -cancel_cmd [code $this cancel] } $itk_component(buttons) append Reset [code $this reset] foreach i $itk_option(-buttons) { lassign $i label cmd $itk_component(buttons) append $label [code $this eval_cmd $cmd] } pack $itk_component(buttons) -side bottom -fill x if {$itk_option(-scroll)} { # Canvas used to add a scrollbar itk_component add canvas { CanvasWidget $w_.canvas } set canvas [$w_.canvas component canvas] pack $w_.canvas -side top -fill both -expand 1 \ -padx 1m -pady 1m -ipadx 1m -ipady 1m # Frame containing entries. itk_component add entries { set f [frame $canvas.entries -bd 3 -relief groove] } $canvas create window 0 0 -window $f -anchor nw -tags frame $canvas configure -background [$f cget -background] after idle [code $this add_bindings_ $canvas $f] } else { itk_component add entries { set f [frame $w_.entries -bd 3 -relief groove] } pack $f -side top -fill both -expand 1 \ -padx 1m -pady 1m -ipadx 1m -ipady 1m } blt::blttable $f set row 0 foreach label $itk_option(-labels) { blt::blttable $f \ [label $f.label$row -text $label] \ $row,0 -anchor e \ [set entries_($label) [entry $f.entry$row -relief sunken]] \ $row,1 -fill x -anchor w $f.entry$row insert end [lindex $itk_option(-values) $row] bind $f.entry$row [code $this enter_data] incr row } blt::blttable configure $f c1 -resize expand blt::blttable configure $f c0 -resize none blt::blttable configure $f r* -resize none wm title $w_ {Entry Form} set initialized_ 1 } # Add bindings to the canvas. Deferred until after window is realised. protected method add_bindings_ {canvas f} { bind $canvas [code $this resize $f $canvas %w %h] } # Called when the window is resized. the arguments are the # entries frame (in the canvas), the canvas and the canvas # width and hight. public method resize {frame canvas cw ch} { # Don't resize when already resizing. if { $resizing_ } return set fh [max $ch [winfo height $frame]] set fw [max $cw [winfo width $frame]] set resizing_ 1 $canvas configure -width $fw $canvas configure -height $fh $canvas itemconfigure frame -width $fw -height $fh $canvas configure -scrollregion "0 0 $fw $fh" # Make sure we're completed before releasing the lock. update set resizing_ 0 } # reset to the original values public method reset {} { set row 0 foreach i $itk_option(-values) { set w [component entries].entry$row $w delete 0 end $w insert end $i incr row } } # called for the Cancel button public method cancel {} { destroy $w_ } # set (reset) the value for the given entry public method set_entry {label value} { if {[info exists entries_($label)]} { $entries_($label) delete 0 end $entries_($label) insert end $value } } # this method is called to enter the data when the Enter button is # pressed. Call the command specified by the -command option with # a list of values, one for each label. protected method enter_data {} { eval_cmd $itk_option(-command) #destroy $w_ } # add the contents of this window as a list argument to the given # command and then evaluate it protected method eval_cmd {cmd} { if {"$cmd" != ""} { set n 0 set list {} set row 0 set f $itk_component(entries) foreach label $itk_option(-labels) { set s [$f.entry$row get] lappend list $s incr row incr n [string length $s] } if {$n == 0} { error_dialog "No data was entered" return } lappend cmd $list eval $cmd } } # -- options -- # title for dialog itk_option define -title title Title {} # list of labels, one for each entry to be displayed itk_option define -labels labels Labels {} # optional list of values, one for each entry to be displayed itk_option define -values values Values {} { if {$initialized_} { reset } } # called with list of values when Enter button is pushed itk_option define -command command Command {} # list {{label cmd} {label cmd}} of additional buttons to display itk_option define -buttons buttons Buttons {} # use scrollbar option itk_option define -scroll scroll Scroll {1} # -- protected vars -- # array(label) of entry widget for given label protected variable entries_ # flag: set to 1 after init protected variable initialized_ 0 # resizing during configure, so don't update protected variable resizing_ 0 } skycat-3.1.2-starlink-1b/tclutil/library/FileSelect.tcl000066400000000000000000000633041215713201500230120ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: FileSelect.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # FileSelect.tcl - OSF/Motif standard file selection dialog # # ---------------------------------------------------------------------- # Implements a version of the OSF/Motif standard file selection dialog # box using primitive widgets as the building blocks. # # # PUBLIC ATTRIBUTES: # # -filterlabel ... label for filter entry, default "Filter" # -dirlabel ...... label for directory list, default "Directories" # -filelabel ..... label for file list, default "Files" # -selectlabel ... label for selection entry, default "Selection" # -dispfilter .... display filter, yes or no, default yes # -dispdir ....... display directory list, yes or no, default yes # -dispfile ...... display file list, yes or no, default yes # -dispselect .... display selection, yes or no, default yes # -filter ........ file list filter, defaults to "*" # -dir ........... initial directory, default to [pwd] # -title ......... window title text, default "Select File" # -full .......... display full file names, yes or no, default no # # -width ......... width of filter/selection entry widgets in chars # -height ........ height of displayed list in lines # # -button_1 ...... Name of the first button, default ok # -button_2 ...... Name of the second button, default filter # -button_3 ...... Name of the third button, default cancel # -button_4 ...... Name of the fourth button default "", i.e none. # # -cmd_4 ......... Command to execute when fourth button is pressed. # Note assumes that this window should be closed # (as if pressing OK, but returns 0 for the activate # status, and this action should take control, by # accessing the selected file). # # METHODS: # # config ......... used to change public attributes # get ............ return the selection # activate ....... perform a grab, upon selection of ok(1) or cancel(0), # return result. # # USAGE: # # FileSelect .fs -title "Test File Select" -full 0 # # if {[.fs activate]} { # puts stdout "OK >>==> [.fs get]" # } else { # puts stdout "Cancel" # } # # .fs destroy # # X11 OPTION DATABASE ATTRIBUTES # # ...and the rest of the usual widget attributes # # ---------------------------------------------------------------------- # AUTHOR: Mark L. Ulferts Phone: (214) 519-3947 # DSC Communications Corp E-mail: mulferts@spd.dsccc.com # ---------------------------------------------------------------------- # # Contributions: Shawn Ellis E-mail: ellis@sctc.com # o Simple Emacs key bindings for entry widgets # o Can now paste a filename or directory into entry # widgets # o Directories are checked on whether they exist before # they are cd'd into. # o Filenames displayed in alphabetical order # o Multiple FileSelect widgets can be used. # o Get method returns _selection only if the file # exists (XXX allan: no, not good when specifying a new file) # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 20 May 96 added quick hack to get this to work in itk2.0. # (New version in iwidgets2.0.1 was too slow) # # Peter W. Draper 27 Jan 97 added -filter_types option to allow caller # to see a list of "known" file extensions. # 30 Mar 00 added changes to add a file filter # when user just types in a directory # (which doesn't then show any files). # 05 Jun 00 added catch to directory list expansion, # this blows up if a file like "~noname" is # found (a failed attempt to seek # $env(HOME)/noname is made). # 16 Oct 00 Also now skips $filename and # ~$filename. These cannot be handled by # NDF (user can still enter these names by hand) # 26 Mar 01 Added panedwindow to control how the # space is divided between the directory # and files views. # 07 Jul 03 Added horizontal scrollbars. # 22 Nov 05 Removed panedwindow as this seems to be stopping # the delivery of double clicks. # 12 Jan 08 Allow extra space to be taken by the file list # by default. Add a panedwindow to control dir # and file list share of space. itk::usual FileSelect {} # This class implements a version of the OSF/Motif standard file selection # dialog box using primitive widgets as the building blocks. # This is a modified version of an old widget written by Mark Ulferts # that is still used because of poor performance in the iwidgets2.x version. # This should probably be replaced when we move to tcl8.x. itcl::class util::FileSelect { inherit util::TopLevelWidget # create new scrolled text constructor {args} { eval itk_initialize $args # # Set the minimum size to 0,0 to allow both shrinkage and expansion. # Also, set the title if one has been given. # wm minsize $w_ 250 250 wm title $w_ "$itk_option(-title)" # # Create an overall frame and separate frames for the filter, # lists, selection, and buttons. # set f [frame $w_.fs] set fs(filterf) [frame $f.filterf] set fs(listf) [panedwindow $f.listf -width 4i -orient horizontal] set fs(self) [frame $f.self] set fs(btnf) [frame $f.btnf -height 30] # # Create the label and entry widgets for the filter. Turn off # the selection capability, at least from the visual aspect. # label $fs(filterf).label -text "$itk_option(-filterlabel)" set fs(filter) [entry $fs(filterf).entry -relief sunken] #$fs(filter) configure -selectbackground \ # [lindex [$fs(filter) configure -background] 4] -selectborderwidth 0 pack $fs(filterf).label -side top -anchor w # PWD: modification here, pack to top not bottom. pack $fs(filterf).entry -side top -fill x -expand yes -ipady 1m # # Create directory list, scrollbar, and label for the directory # frame. Make the list single select. # set fs(dirf) [frame $fs(listf).dirf] label $fs(dirf).label -text "$itk_option(-dirlabel)" set fs(dirs) [listbox $fs(dirf).list -relief sunken \ -yscrollcommand "$fs(dirf).vscroll set" \ -xscrollcommand "$fs(dirf).hscroll set" \ -selectmode single \ -exportselection no] scrollbar $fs(dirf).vscroll -orient vertical -relief sunken \ -command "$fs(dirf).list yview" scrollbar $fs(dirf).hscroll -orient horizontal -relief sunken \ -command "$fs(dirf).list xview" pack $fs(dirf).label -side top -anchor w pack $fs(dirf).vscroll -side right -fill y pack $fs(dirf).hscroll -side bottom -fill x pack $fs(dirf).list -side left -expand yes -fill both # # Create file list, scrollbar, and label for the file frame. # Again, make the list single select. # set fs(filef) [frame $fs(listf).filef] label $fs(filef).label -text "$itk_option(-filelabel)" set fs(files) [listbox $fs(filef).list -relief sunken \ -yscrollcommand "$fs(filef).vscroll set" \ -xscrollcommand "$fs(filef).hscroll set" \ -selectmode single \ -exportselection no] scrollbar $fs(filef).vscroll -orient vertical -relief sunken \ -command "$fs(filef).list yview" scrollbar $fs(filef).hscroll -orient horizontal -relief sunken \ -command "$fs(filef).list xview" pack $fs(filef).label -side top -anchor w pack $fs(filef).vscroll -side right -fill y pack $fs(filef).hscroll -side bottom -fill x pack $fs(filef).list -side left -expand yes -fill both # # Add the directory and file lists based on the attributes # for displaying each list. Uses a split pane with extra space # to the file list. # frame $fs(listf).buf -width $_margin -borderwidth 0 if {$itk_option(-dispdir)} { $fs(listf) add $fs(dirf) } if {$itk_option(-dispfile)} { $fs(listf) add $fs(filef) } # # Create the label and entry widgets for the selection frame. Turn # off the selection capability, at least from the visual aspect # label $fs(self).label -text "$itk_option(-selectlabel)" set fs(select) [entry $fs(self).entry -relief sunken] set _selection "$itk_option(-dir)/" pack $fs(self).label -side top -anchor w pack $fs(self).entry -side bottom -fill x -expand yes -ipady 1m # # Add the separator and create the buttons in the button frame. # Each button is within a frame used to display as default. # The placer is used to locate the three buttons at relative # locations. # frame $f.line -height 2 -width 2 -borderwidth 1 -relief sunken frame $fs(btnf).okf -borderwidth 1 set fs(okbtn) [button $fs(btnf).okf.ok -text $itk_option(-button_1) -width 8] pack $fs(btnf).okf.ok -padx 2 -pady 2 raise $fs(btnf).okf.ok # If have a label and command for button 4, enable it. if { $itk_option(-button_4) != {} && $itk_option(-cmd_4) != {} } { frame $fs(btnf).extraf -borderwidth 1 set fs(extrabtn) [button $fs(btnf).extraf.extra \ -text $itk_option(-button_4) \ -width 8 \ -command [code $this _extracmd]] pack $fs(btnf).extraf.extra -padx 2 -pady 2 raise $fs(btnf).extraf.extra } frame $fs(btnf).ff -borderwidth 1 set fs(filterbtn) [button $fs(btnf).ff.f -text $itk_option(-button_2) -width 8 \ -command [code $this _filtercmd]] pack $fs(btnf).ff.f -padx 2 -pady 2 raise $fs(btnf).ff.f frame $fs(btnf).cf -borderwidth 1 set fs(cancelbtn) [button $fs(btnf).cf.c -text $itk_option(-button_3) -width 8] pack $fs(btnf).cf.c -padx 2 -pady 2 raise $fs(btnf).cf.c if { $itk_option(-button_4) != {} && $itk_option(-cmd_4) != {} } { place $fs(btnf).okf -relx 0.125 -rely 0.5 -anchor center place $fs(btnf).extraf -relx 0.375 -rely 0.5 -anchor center place $fs(btnf).ff -relx 0.625 -rely 0.5 -anchor center place $fs(btnf).cf -relx 0.875 -rely 0.5 -anchor center } else { place $fs(btnf).okf -relx 0 -rely 0.5 -anchor w place $fs(btnf).ff -relx 0.5 -rely 0.5 -anchor center place $fs(btnf).cf -relx 1 -rely 0.5 -anchor e } # # Pack all the components of the file selection box. The filter # and selection frames are packed based on the display attributes. # if {$itk_option(-dispfilter)} {pack $fs(filterf) -fill x -padx $_margin -pady 5} pack $fs(listf) -fill both -padx $_margin -pady 5 -expand yes if {$itk_option(-dispselect)} {pack $fs(self) -fill x -padx $_margin -pady 5} pack $f.line -fill x -pady 5 pack $fs(btnf) -fill x -padx $_margin -pady 5 pack $f -fill both -expand yes # # Set up the bindings for the list widgets. Single click in either # list executes a select method. Double click for the both lists # selects the entry and then invokes the button callback. Focus # events for the filter and select entry widgets control the default # button display, and return is mapped to the default button as well. # bind $fs(dirs) <1> [code $this _selectdir %y] bind $fs(files) <1> [code $this _selectfile %y] bind $fs(dirs) [code $this _dclickdir %y] bind $fs(files) [code $this _dclickfile %y] bind $fs(filter) [code $this _defaultbtn filter] bind $fs(select) [code $this _defaultbtn ok] bind $fs(filter) "$fs(filterbtn) invoke" bind $fs(select) "$fs(okbtn) invoke" # # Explicitly handle configs that may have been ignored earlier. # Also, check to see if the user has specified, width, or height. # If not, use the default and config. # set _initialized 1 eval itk_initialize $args # # Construction is complete. Now set up the initial text for the # filter, selection, and both lists. Finally, set the focus for # either the filter or select widget based on the display attribute. # _setfilter $itk_option(-dir) $itk_option(-filter) _setselection _filldirlist _fillfilelist if {$itk_option(-dispselect)} { focus $fs(select) } elseif {$itk_option(-dispfilter)} { focus $fs(filter) } } # Perform a grab operation, install the button # callbacks, and wait for the result. Make sure # to reset the working directory back to the # original before returning the result. public method activate {} { global ::result set curwd "[pwd]" wm deiconify $w_ if {$itk_option(-modal)} { grab $w_ } $fs(okbtn) configure -command [code $this _okcmd] $fs(cancelbtn) configure -command [code $this _cancelcmd] set seldir [file dirname [$fs(filter) get]] cd $seldir configure -dir "[pwd]" configure -filter "[file tail [$fs(filter) get]]" set _selection "$itk_option(-dir)/" _filldirlist _fillfilelist tkwait variable result($this) wm withdraw $w_ cd $curwd return $result($this) } # Return the selection. public method get {} { return $_selection } # called for double click on a filename protected method _dclickfile {y} { _selectfile $y update idletasks $fs(okbtn) invoke } # called for double click on a dir name protected method _dclickdir {y} { _selectdir $y update idletasks $fs(filterbtn) invoke } # Select the directory, set the filter to # the new directory. Set the selection to the # new directory if the file list is not # displayed. Mark the filter button as the # default. protected method _selectdir {y} { $fs(dirs) selection clear 0 end $fs(dirs) selection set [$fs(dirs) nearest $y] set curwd "[pwd]" set seldir [$fs(dirs) get [$fs(dirs) curselection]] if {$seldir == "."} { cd . } elseif {$seldir == ".."} { cd .. } else { cd $seldir } _setfilter "[pwd]" if {! $itk_option(-dispfile)} { _setselection "[pwd]" } cd $curwd _defaultbtn filter } # Select the file, set the selection to # the new file. Mark the ok button as the # default. protected method _selectfile {y} { $fs(files) selection clear 0 end $fs(files) selection set [$fs(files) nearest $y] set sel [$fs(files) curselection] if {[llength $sel]} { set _selection $itk_option(-dir)/[$fs(files) get $sel] if {[file exists $_selection]} { _setselection _defaultbtn ok } } } # Update the filter based on the parameters. # If the directory 'd' parameter is null, use # the 'dir' attribute. If the file 'f' # parameter is null use the tail of the filter # entry text. protected method _setfilter {{d ""} {f ""}} { if { $d == "" } { set filt [$fs(filter) get] if { [file isdirectory $filt] } { set d $filt } else { set d [file dirname $filt] } } if {$f == ""} { set filt [$fs(filter) get] if { [file isdirectory $filt] } { set f $last_filter_type_ } else { set f [file tail $filt] } } $fs(filter) delete 0 end $fs(filter) insert 0 "$d/$f" set last_filter_type_ $f } # Update the selection based on the # parameter. If the file 'f' parameter is # null, use the 'selection' attribute. protected method _setselection {{f ""}} { if {$f == ""} {set f $_selection} $fs(select) delete 0 end $fs(select) insert end "$f" } # Ok button callback. Set the default button to # OK, and set the selection attribute to the # current entry widget text. Undo the callbacks # for both the ok and cancel buttons. Release # the grab and set the global ::result, which frees # the wait. protected method _okcmd {} { global ::result set _selection [$fs(select) get] if {[file isdirectory $_selection]} { warning_dialog "Please select a file" $w_ return 0 } _defaultbtn ok $fs(okbtn) configure -command {} $fs(cancelbtn) configure -command {} if {$itk_option(-modal)} { grab release $w_ } set result($this) 1 return 1 } # Filter button callback. Change directories # as needed, and set the dir, filter, and # selection attributes. Change the filter and # selection text along with the list contents. # Mark the default button as filter. protected method _filtercmd {} { set filt [$fs(filter) get] if { [file isdirectory $filt] } { set seldir $filt } else { set seldir [file dirname $filt] } if {![file exists $seldir]} { return } cd $seldir set seldir [pwd] _setfilter $seldir configure -dir $seldir configure -filter "[file tail [$fs(filter) get]]" set _selection "$itk_option(-dir)/" _setselection _filldirlist _fillfilelist _defaultbtn filter } # ------------------------------------------------------------------ # METHOD: _cancelcmd - Cancel button callback. Set the default # button to cancel, undo the callbacks, and # release the grab and wait via the global # result variable. # ------------------------------------------------------------------ protected method _cancelcmd {} { global ::result _defaultbtn cancel $fs(okbtn) configure -command {} $fs(cancelbtn) configure -command {} if {$itk_option(-modal)} { grab release $w_ } set result($this) 0 } # Execute the extra command button. Assumes that this window should be # closed so prepares the selection and checks that something existent # has been selected (equivalent to pressing OK first then extra button # but activate returns 0). protected method _extracmd {} { if { $itk_option(-cmd_4) != {} } { global ::result set _selection [$fs(select) get] if {[file isdirectory $_selection]} { warning_dialog "Please select a file" $w_ return } _defaultbtn ok $fs(okbtn) configure -command {} $fs(cancelbtn) configure -command {} if {$itk_option(-modal)} { grab release $w_ } set result($this) 0 eval $itk_option(-cmd_4) } } # Clear the directory list filling with the # results of an 'ls'. Use the full attribute # to determine full file name insertion. # Select the first element if it exists. protected method _filldirlist {} { $fs(dirs) delete 0 end foreach i [exec /bin/ls -a $itk_option(-dir)] { catch { if {[file isdirectory $i]} { if {$itk_option(-full)} { $fs(dirs) insert end "$itk_option(-dir)/$i" } else { $fs(dirs) insert end [file tail $i] } } } } if {[$fs(dirs) size]} { $fs(dirs) selection clear 0 end $fs(dirs) selection set 0 } } # Clear the file list filling with the results of an 'glob'. # Use the full attribute to determine full file name insertion. # Select the first element if it exists. PWD: modification. NDF's # cannot start with "$" or "~$", so leave these files alone. protected method _fillfilelist {} { $fs(files) delete 0 end set file_temp [glob -nocomplain $itk_option(-dir)/$itk_option(-filter)] set filefiller [lsort $file_temp] foreach i $filefiller { set tail [file tail $i] if { [string match {$*} $tail] || [string match {./~$*} $tail] } { continue } if {[file isfile $i] } { if {$itk_option(-full)} { $fs(files) insert end $i } else { $fs(files) insert end $tail } } } } # Sets the default button, either ok, filter # or cancel. The focus is also adjusted. protected method _defaultbtn {btn} { if {$btn == "ok"} { $fs(btnf).okf configure -relief sunken $fs(btnf).ff configure -relief flat $fs(btnf).cf configure -relief flat focus $fs(select) } elseif {$btn == "filter"} { $fs(btnf).okf configure -relief flat $fs(btnf).ff configure -relief sunken $fs(btnf).cf configure -relief flat focus $fs(filter) } elseif {$btn == "cancel"} { $fs(btnf).okf configure -relief flat $fs(btnf).ff configure -relief flat $fs(btnf).cf configure -relief sunken } } # Method: Get the selection from an xterm and display it if # it in one of the entry widgets. A catch has to be used # because Tk will issue an error that the selection doesn't # exist. If it doesn't exist, this will still insert it # into the entry widget. I don't know of a workaround protected method get_selection {entry_widget} { set cmd "selection get" catch $cmd string $entry_widget insert insert $string } # Method: Get the position of the cursor and move it one way or another protected method entry_adjust_pos {entry_widget offset} { set pos [$entry_widget index insert] incr pos $offset if {$pos < 0} { set pos 0 } $entry_widget icursor $pos } # # Method: Set the filter type to a known value. # method set_filter_type {type} { if { $type == "" } { set type "*" } set dirname [file dirname [$fs(filter) get]] $fs(filter) delete 0 end $fs(filter) insert 0 $dirname/$type set last_filter_type_ $type update _filtercmd } # Set the window title. itk_option define -title title Title "Select File" { if {$_initialized} { wm title $w_ $itk_option(-title) } } # The label string above the filter widget. itk_option define -filterlabel filterLabel FilterLabel "Filter" { if {$_initialized} { $fs(filterf).label configure -text $itk_option(-filterlabel) } } # File list filter, defaults to "*". itk_option define -filter filter Filter "*" { if {$_initialized} { _setfilter $itk_option(-dir) $itk_option(-filter) } } # Initial directory, default to [pwd]. itk_option define -dir dir Dir "." { cd $itk_option(-dir) } # Label for directory list, default "Directories" itk_option define -dirlabel dirLabel DirLabel "Directories" { if {$_initialized} { $fs(dirf).label configure -text $itk_option(-dirlabel) } } # Label for file list, default "Files". itk_option define -filelabel fileLabel FileLabel "Files" { if {$_initialized} { $fs(filef).label configure -text $itk_option(-filelabel) } } # Label for selection entry, default # "Selection". itk_option define -selectlabel selectLabel SelectLabel "Selection" { if {$_initialized} { $fs(self).label configure -text $itk_option(-selectlabel) } } # Display full file names, yes/no, default no. itk_option define -full full Full 0 {} # Display filter, yes or no, default yes itk_option define -dispfilter dispFilter DispFilter 1 {} # Display directory list, yes or no, default yes itk_option define -dispdir dispDir DispDir 1 {} # Display file list, yes or no, default yes itk_option define -dispfile dispFile DispFile 1 {} # Display selection, yes or no, default yes itk_option define -dispselect dispSelect DispSelect 1 {} # Set the width of the selection and filter entry # widgets. itk_option define -width width Width 50 { if {$_initialized} { $fs(filter) configure -width $itk_option(-width) $fs(select) configure -width $itk_option(-width) } } # Set the height of the directory and file lists. itk_option define -height height Height 10 { if {$_initialized} { $fs(dirs) configure -height $itk_option(-height) $fs(files) configure -height $itk_option(-height) } } # The button label for button 1 itk_option define -button_1 button_1 Button_1 "OK" {} # The button label for button 2 itk_option define -button_2 button_2 Button_2 "Filter" {} # The button label for button 3 itk_option define -button_3 button_3 Button_3 "Cancel" {} # The button label for button 4 itk_option define -button_4 button_4 Button_4 {} {} # Command to execute for a button 4 press. itk_option define -cmd_4 cmd_4 Cmd_4 {} # Add an optional menu of file suffixes (preset file filters). itk_option define -filter_types filter_types Filter_Types {} { if {$_initialized} { if { [info exists fs(filter_types)] } { catch {destroy $fs(filter_types)} } if { $itk_option(-filter_types) != {} } { set fs(filter_types) [LabelMenu $fs(filterf).types \ -text {Type Filter:}] foreach pair "$itk_option(-filter_types)" { set name [lindex $pair 0] set type [lindex $pair 1] $fs(filter_types) add -label $name \ -command [code $this set_filter_type $type] } pack $fs(filterf).types -side bottom -ipady 1m -anchor w } } } # flag: if true, grab the screen itk_option define -modal modal Modal 0 # Margin distance used in construction protected variable _margin 10 # Current selection. protected variable _selection "./" protected variable fs protected variable _initialized 0 # Last filter type. protected variable last_filter_type_ "*.*" } skycat-3.1.2-starlink-1b/tclutil/library/FrameWidget.tcl000066400000000000000000000054161215713201500231710ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: FrameWidget.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # FrameWidget.tcl - Itk base class for widgets with their own frame # # who when what # -------------- -------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created # # Peter W. Draper 20 Jan 98 Fixed busy focus -lastfor so # that it does restore the focus, # not just get the window name. # 23 Jan 08 Make focus control is busy method optional. itk::usual FrameWidget {} # The FrameWidget itcl class is a subclass of itk::Widget and thus # inherits all of the features described in Widget(n). In addition, a # number of useful methods are defined, for use by the derived classes. itcl::class util::FrameWidget { inherit itk::Widget # Create a frame with the same name as this object constructor {args} { set class_ [utilNamespaceTail [$this info class]] set w_ $itk_component(hull) eval itk_initialize $args after idle [code $this init] } # derived classes can re-define the "init" method to run code after all # options have been evaluated protected method init {} { } # run the given tcl command while displaying the busy cursor # in the frame's parent top level window, if defocus is false don't handle # focussing. public method busy {cmd {defocus 1}} { global ::errorInfo ::errorCode if {[incr busy_count_] == 1} { if { $defocus } { catch {focus .} } blt::busy hold $w_ update idletasks } # save any errors and report them later if {[set code [catch [list uplevel $cmd] msg]]} { set info $errorInfo } if {[incr busy_count_ -1] == 0} { blt::busy release $w_ if { $defocus } { catch {focus [focus -lastfor $w_]} } } if {$code} { uplevel [list error $msg $info $code] } } # set the text of short help message to be displayed whenever # the mouse enters the widget w (assumes you are using class # ToplevelWidget) public method add_short_help {w text} { if {[catch {[winfo toplevel $w_] add_short_help $w $text} msg]} { # puts "$msg" } } # set the text of the short help message (display now, assumes you # are using class ToplevelWidget) public method short_help {text} { #catch {[winfo command [winfo toplevel $w_]] short_help $text} catch {[winfo toplevel $w_] short_help $text} } # -- options -- # -- class variables -- # name of this (derived) class protected variable class_ # shorter name for $itk_component(hull) protected variable w_ # count used for busy cursor private variable busy_count_ {0} } skycat-3.1.2-starlink-1b/tclutil/library/GraphPrint.tcl000066400000000000000000000035071215713201500230500ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: GraphPrint.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # GraphPrint.tcl - Print dialog box for printing the contents of a graph # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created # Peter W. Draper 11 Jul 00 Changed to use "fit" variable, previous # form wasn't working as fit to page option. # 20 Jul 09 Removed mono mode, no longer supported. itk::usual GraphPrint {} # This widget defines a print dialog box for printing the contents of a graph. itcl::class util::GraphPrint { # similar to canvas... inherit util::CanvasPrint # create a new instance of this class constructor {args} { eval itk_initialize $args } # print the contents of the graph as postscript to the given file descriptor public method print {fd} { global ::$w_.color ::$w_.rotate ::$w_.colormap ::$w_.fit_to_page if { [set $w_.fit_to_page] } { set fit yes } else { set fit no } # try to fit on a page set width [lindex [$itk_option(-graph) config -width] 4] set height [lindex [$itk_option(-graph) config -height] 4] $itk_option(-graph) postscript configure \ -colormode [set $w_.color] \ -paperwidth [$w_.pagesize.width get] \ -paperheight [$w_.pagesize.height get] \ -landscape [set $w_.rotate] \ -padx 0 \ -pady 0 \ -center 1 \ -maxpec $fit set cmd [list $itk_option(-graph) postscript output] puts $fd [eval $cmd] } # use PrintDialog::ok to get the fd (CanvasPrint::ok returns filename) public method ok {args} { PrintDialog::ok $args } # Public data # graph to print itk_option define -graph graph Graph {} } skycat-3.1.2-starlink-1b/tclutil/library/HelpWin.tcl000066400000000000000000000075111215713201500223370ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: HelpWin.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # HelpWin.tcl - Itcl class for displaying a text window with a help text. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 18 Mar 98 Copied from GAIA (Peter Draper, Starlink) # and renamed to util::HelpWin. # Modified comment format a little for use # with the itcldoc script to generate # man pages. # This is a simple class that displays the contents of a named # file in a text widget. The file should be set as a configuration # option when an instance is created. This class shares a text # window amongst all its instances, this means that it overwrites # any previous contents. itcl::class util::HelpWin { # Constructor: Note that all HelpWin objects share a single toplevel window. constructor {args} { # Evaluate any options. eval configure $args # We have an interest in health of widget. incr reference_ } # Destructor: deletes shared window if there are no more references. destructor { incr reference_ -1 if { $reference_ == 0 } { destroy_help } } # This method causes the object to take control of the text # widget and display the help text. public method display {} { if { [file readable $file] } { if { ![winfo exists $Top_] } { create_ } else { wm deiconify $Top_ raise $Top_ } $ScrollText_ clear all set fd [open $file r] $ScrollText_ insert 0.0 [read $fd] } } # Remove the help window. public method remove_help {} { if { [winfo exists $Top_] } { wm withdraw $Top_ } } # Create the help window. private method create_ {} { if { ![winfo exists $Top_] } { set Top_ [TopLevelWidget .\#auto] # Set the top-level window title. wm title $Top_ {Help} # Add the font control menu. $Top_ add_menubar set m [$Top_ add_menubutton Font] foreach font $fonts_ { $m add command -label abc -font $font \ -command [code $this set_font_ "$font"] } # Add the text widget. set ScrollText_ [ScrollText $Top_.text] set_font_ "[lindex $fonts_ 0]" # Create the control button. set Button [button $Top_.dismiss \ -text {Dismiss} \ -command [code $this remove_help]] pack $ScrollText_ -side top -fill both -expand true pack $Button -side bottom } } # Set the font of the help text. private method set_font_ {font} { if { [winfo exists $ScrollText_] } { $ScrollText_ configure -font "$font" } } # Configuration options: (public variables) # ---------------------- # The name of the file whose contents are to be displayed # in the help text widget. public variable file {name} {} # Protected variables: (available to instance) # -------------------- # Names of available fonts. protected variable fonts_ { -*-courier-medium-r-*-*-*-120-*-*-*-*-*-* -*-courier-medium-r-*-*-*-140-*-*-*-*-*-* -*-courier-medium-r-*-*-*-180-*-*-*-*-*-* } # Common variables: (shared by all instances) # ----------------- # Name of the text widget used to display the help. private common ScrollText_ {} # Name of the top-level widget the contains the help and control # buttons . private common Top_ {} # Reference count of help objects that have an interest in the # help widget. private common reference_ 0 # End of class definition. } skycat-3.1.2-starlink-1b/tclutil/library/InputDialog.tcl000066400000000000000000000025771215713201500232170ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: InputDialog.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # InputDialog.tcl - Dialog to display a message and get input from the user # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual InputDialog {} # An InputDialog is a dialog to display a message and get input from # the user. itcl::class util::InputDialog { inherit util::DialogWidget # create the dialog constructor {args} { # add an entry widget below the message global ::$variable_ # Tk entry widget for input. itk_component add entry { entry $itk_component(ext).entry -relief sunken } pack $itk_component(entry) -side left -fill x -expand 1 \ -padx 2m -pady 2m -ipady 1m eval itk_initialize $args } # called after options have been evaluated protected method init {} { DialogWidget::init bind $itk_component(entry) \ "$itk_component(button$itk_option(-default)) flash; set $variable_ $itk_option(-default)" } # this method is redefined here to change the value # that is returned from activate to be the contents of the entry widget protected method set_result {} { global ::$variable_ if {"[set $variable_]" == "$itk_option(-default)"} { return [$itk_component(entry) get] } return {} } } skycat-3.1.2-starlink-1b/tclutil/library/LabelCheck.tcl000066400000000000000000000106231215713201500227440ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: LabelCheck.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # LabelCheck.tcl - Itcl megawidget for choosing options. # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual LabelCheck {} # LabelCheck is an itcl megawidget for choosing options using a # label and radiobuttons (uses blt_table to arrange the buttons in # rows and columns). itcl::class util::LabelCheck { inherit util::LabelWidget constructor {args} { set variable_ $w_.choice # Tk frame containing checkbuttons. itk_component add table { frame $w_.table } { keep -background -relief -borderwidth } blt::blttable $itk_component(table) eval itk_initialize $args } # clear the choice display public method clear {} { if {[info exists but_]} { foreach i [array names but_] { destroy $but_($i) } unset but_ } } # layout the choices according to the options protected method do_layout {} { global ::$variable_ clear set rows $itk_option(-rows) set cols $itk_option(-cols) set choice $itk_option(-choice) set n [llength $choice] set row 0 set col 0 set i 0 # determine how many rows and columns if {$rows != 0} { set cols [expr {$n/$rows+1}] } elseif {$cols != 0} { set rows [expr {$n/$cols+1}] } elseif {"$itk_option(-orient)" == "horizontal"} { set rows 1 set cols $n } else { set rows $n set cols 1 } for {set row 0} {$row < $rows} {incr row} { for {set col 0} {$col < $cols} {incr col} { set name [lindex $choice $i] set ${variable_}($name) 0 # One Tk component is created for each item in the list # given by the -choice argument. itk_component add $name { set but_($name) \ [checkbutton $itk_component(table).choice$i \ -text $name \ -variable ${variable_}($name) \ -command [code $this command_proc_]] } { keep -state -anchor -background -foreground rename -font -valuefont valueFont Font rename -width -valuewidth valueWidth Width } blt::blttable $itk_component(table) $but_($name) $row,$col -fill x if {[incr i] == $n} { break } } if {$i == $n} { break } } } # return the current value of this option public method get {} { global ::$variable_ set value {} foreach i $itk_option(-choice) { if {[set ${variable_}($i)]} { lappend value $i } } return $value } # configure the individual buttons by name public method itemconfig {name args} { eval "$but_($name) config $args" } # call the command with the selected item private method command_proc_ {} { set cmd $itk_option(-command) if {"$cmd" != ""} { lappend cmd [$this get] } eval $cmd } # -- options -- # name of global variable to set (defaults to $w_.choice) itk_option define -variable variable Variable {} { if {"$itk_option(-variable)" != ""} { set variable_ $itk_option(-variable) global ::$variable_ if {[info exists but_]} { foreach i [array names but_] { $but_($i) config -variable ${variable_}($i) } } } } # list of choices to display as ON, all others are then OFF itk_option define -value value Value {} { global ::$variable_ if {[info exists $variable_]} { foreach i [array names $variable_] { set ${variable_}($i) 0 } } foreach i $itk_option(-value) { set ${variable_}($i) 1 } } # list of choices itk_option define -choice choice Choice {} { do_layout } # command to run when value is changed (new value is appended) itk_option define -command command Command {} # widget orientation: horizontal or vertical itk_option define -orient orient Orient {horizontal} { pack $itk_component(table) \ -side $side_ -padx 1m -pady 1m -fill both -expand 1 } # max number of rows to display (0 for unlimited) # note: specify either -rows OR -cols, but not both itk_option define -rows rows Rows {0} # max number of columns to display (0 for unlimited) # note: specify either -rows OR -cols, but not both itk_option define -cols cols Cols {0} # -- protected members -- # array(name) of button widgets protected variable but_ # name of text variable array for tracing protected variable variable_ } skycat-3.1.2-starlink-1b/tclutil/library/LabelChoice.tcl000066400000000000000000000105501215713201500231200ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: LabelChoice.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # LabelChoice.tcl - Widget for choosing options using a label and radiobuttons # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created itk::usual LabelChoice {} # LabelChoice is an itcl megawidget for choosing options using a # label and radiobuttons (uses blt_table to arrange the buttons in # rows and columns). itcl::class util::LabelChoice { inherit util::LabelWidget constructor {args} { itk_option add hull.borderwidth hull.relief set variable_ $w_.choice # Tk frame containing radiobuttons. itk_component add table { frame $w_.table } { keep -background -relief -borderwidth } blt::blttable $itk_component(table) eval itk_initialize $args } # clear the choice display public method clear {} { if {[info exists but_]} { foreach i [array names but_] { destroy $but_($i) } unset but_ } } # layout the choices according to the options protected method do_layout {} { global ::$variable_ clear set rows $itk_option(-rows) set cols $itk_option(-cols) set choice $itk_option(-choice) set n [llength $choice] set row 0 set col 0 set i 0 # determine how many rows and columns if {$rows != 0} { set cols [expr {$n/$rows+1}] } elseif {$cols != 0} { set rows [expr {$n/$cols+1}] } elseif {"$itk_option(-orient)" == "horizontal"} { set rows 1 set cols $n } else { set rows $n set cols 1 } for {set row 0} {$row < $rows} {incr row} { for {set col 0} {$col < $cols} {incr col} { set name [lindex $choice $i] # One Tk component is created for each item in the list # given by the -choice argument. The component names are # choice0, choice1, ... itk_component add choice$i { set but_($name) \ [radiobutton $itk_component(table).choice$i \ -text $name \ -value $name \ -variable $variable_ \ -command [code $this command_proc_]] } { keep -state -anchor -background -foreground rename -font -valuefont valueFont Font rename -width -valuewidth valueWidth Width } blt::blttable $itk_component(table) $but_($name) $row,$col -fill x if {[incr i] == $n} { break } } if {$i == $n} { break } } # set default value if {"$itk_option(-value)" == ""} { set $variable_ [lindex $choice 0] } } # return the current value of this option public method get {} { global ::$variable_ return [set $variable_] } # configure the individual buttons by name public method itemconfig {name args} { eval "$but_($name) config $args" } # call the command with the selected item private method command_proc_ {} { set cmd $itk_option(-command) if {"$cmd" != ""} { lappend cmd [$this get] } eval $cmd } # -- options -- # name of global variable to set (defaults to $w_.choice) itk_option define -variable variable Variable {} { if {"$itk_option(-variable)" != ""} { set variable_ $itk_option(-variable) global ::$variable_ if {[info exists but_]} { foreach i [array names but_] { $but_($i) config -variable $variable_ } } } } # value to display itk_option define -value value Value {} { if {[info exists variable_]} { global ::$variable_ set $variable_ $itk_option(-value) } } # list of choices itk_option define -choice choice Choice {} { do_layout } # command to run when value is changed (new value is appended) itk_option define -command command Command {} # widget orientation: horizontal or vertical itk_option define -orient orient Orient {horizontal} { pack $itk_component(table) \ -side $side_ -padx 1m -pady 1m -fill both -expand 1 } # max number of rows to display (0 for unlimited) # note: specify either -rows OR -cols, but not both itk_option define -rows rows Rows {0} # max number of columns to display (0 for unlimited) # note: specify either -rows OR -cols, but not both itk_option define -cols cols Cols {0} # -- protected members -- # array(name) of button widgets protected variable but_ # name of text variable for tracing protected variable variable_ } skycat-3.1.2-starlink-1b/tclutil/library/LabelEntry.tcl000066400000000000000000000205331215713201500230310ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: LabelEntry.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # LabelEntry.tcl - Itk widget for displaying a labeled entry # # Copyright: # Copyright (C) 1998-2005 Central Laboratory of the Research Councils. # Copyright (C) 2006 Particle Physics & Astronomy Research Council. # All Rights Reserved. # # Licence: # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place,Suite 330, Boston, MA # 02111-1307, USA # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created # Peter W. Draper 11 Aug 98 Expanded real definition to allow 1.0e6 # type values. # 26 Feb 99 Merged tcl8 changes from real tclutil version. itk::usual LabelEntry {} # This widget displays a label and an entry and implements convenient # methods for accessing and modifying the label and the value. itcl::class util::LabelEntry { inherit util::LabelWidget # constructor: create a new LabelEntry widget constructor {args} { # Tk entry widget. itk_component add entry { entry $w_.entry } { keep -textvariable -relief -borderwidth -show rename -font -valuefont valueFont ValueFont } eval itk_initialize $args } # Get the value in the entry public method get {} { return [$itk_component(entry) get] } # select the contents of the entry public method select {} { $itk_component(entry) select range 0 end } # called for traces on textvariable private method trace_ {args} { if {!$notrace_} { command_proc_ $itk_option(-changecmd) } } # called for return or keypress in entry, calls command proc with new value protected method command_proc_ {cmd} { lappend cmd [$itk_component(entry) get] eval $cmd } # The peek procedure returns the value of the entry with the # char inserted at the insert position. (ripped from iwidgets::entryfield) private method peek_ {char} { set str [get] set insertPos [$itk_component(entry) index insert] set firstPart [string range $str 0 [expr $insertPos - 1]] set lastPart [string range $str $insertPos end] append rtnVal $firstPart $char $lastPart return $rtnVal } # called for keypress events when validation is on (based on code from iwidgets) private method validate_ {char sym} { set cmd $validate_cmd_ if {"$cmd" == "" || "$itk_option(-validate)" == ""} { return } # pass these on to other bindings... if {$sym == "Return" || $sym == "Tab" || $sym == "BackSpace" || $sym == "Delete" || $sym == "Escape" || $sym == "space" || $char == ""} { return } regsub -all "%W" $cmd $itk_component(hull) cmd regsub -all "%P" $cmd [peek_ $char] cmd regsub -all "%S" $cmd [get] cmd if {$char == "\\"} { regsub -all "%c" $cmd {\\\\} cmd } elseif {$char == "&"} { regsub -all "%c" $cmd {\&} cmd } else { regsub "\"|\\\[|\\\]|{|}| " $char {\\\0} char regsub -all "%c" $cmd $char cmd } set valid [eval LabelEntry::$cmd] if {($valid == "") || (! $valid)} { eval $itk_option(-invalid) return -code break } } # validation methods used for -validate option (from iwidgets::entryfield class) protected proc numeric {char} { return [regexp {[0-9]} $char] } protected proc integer {string} { return [regexp {^[-+]?[0-9]*$} $string] } protected proc alphanumeric {char} { return [regexp -nocase {[0-9a-z]} $char] } protected proc alphabetic {char} { return [regexp -nocase {[a-z]} $char] } protected proc hexidecimal {string} { return [regexp {^(0x)?[0-9a-fA-F]*$} $string] } protected proc real {string} { # return [regexp {^\-?[0-9]*\.?[0-9]*$} $string] return [regexp -nocase {^[-+]?[0-9]*\.?[0-9]*([0-9]\.?e[-+]?[0-9]*)?$} $string] } # -- options -- # set the value displayed in the entry itk_option define -value value Value {} { set prev_state [$itk_component(entry) cget -state] $itk_component(entry) config -state normal set notrace_ 1 $itk_component(entry) delete 0 end $itk_component(entry) insert 0 $itk_option(-value) if {"$itk_option(-justify)" == "right"} { $itk_component(entry) icursor end $itk_component(entry) xview moveto 1 } $itk_component(entry) config -state $prev_state set notrace_ 0 } # set the width of the value displayed itk_option define -valuewidth valueWidth ValueWidth {15} { $itk_component(entry) config -width $itk_option(-valuewidth) } # set the state to normal or disabled (greyed out) itk_option define -state state State normal { $itk_component(entry) config -state $itk_option(-state) if {"$itk_option(-state)" == "normal"} { $itk_component(entry) config -foreground $itk_option(-foreground) } else { $itk_component(entry) config -foreground $itk_option(-disabledforeground) } } # the command for in the entry, called with the new value itk_option define -command command Command {} { if {"$itk_option(-command)" != ""} { bind $itk_component(entry) [code $this command_proc_ $itk_option(-command)] } } # alternative name for use when -command is already used by a derived class itk_option define -entrycommand entryCommand EntryCommand {} { if {"$itk_option(-entrycommand)" != ""} { bind $itk_component(entry) \ [code $this LabelEntry::command_proc_ $itk_option(-entrycommand)] } } # set to "right" to make sure the end of the entry is visible itk_option define -justify justify Justify {left} # commands to evaluate whenever the entry value changes itk_option define -changecmd changecmd Changecmd {} { if {"$itk_option(-changecmd)" != ""} { if {"$itk_option(-textvariable)" == ""} { config -textvariable $w_ } set var $itk_option(-textvariable) global ::$var trace variable $var w [code $this trace_] } } # widget orientation: horizontal or vertical itk_option define -orient orient Orient {horizontal} { if {"$itk_option(-valuewidth)" == "" || $itk_option(-valuewidth) == 0} { set expand 0 } else { set expand 1 } pack $itk_component(entry) \ -side $side_ -expand $expand -fill x -padx 1m -ipadx 1m } # valiadation of entry fields (based on iwidgets entryfield class) # numeric, alphabetic, integer, hexidecimal, real, and alphanumeric itk_option define -validate validate Validate {""} { if {"$itk_option(-validate)" != ""} { set validate_cmd_ "" switch $itk_option(-validate) { numeric { set validate_cmd_ "numeric %c" } integer { set validate_cmd_ "integer %P" } hexidecimal { set validate_cmd_ "hexidecimal %P" } real { set validate_cmd_ "real %P" } alphabetic { set validate_cmd_ "alphabetic %c" } alphanumeric { set validate_cmd_ "alphanumeric %c" } } if {"$validate_cmd_" != ""} { bind $itk_component(entry) [code $this validate_ %A %K] } } } # select the contents of the entry whenever it gets the focus itk_option define -autoselect autoSelect AutoSelect {0} { if {$itk_option(-autoselect)} { #bind autoSelect FocusIn "$itk_component(entry) select range 0 end" #bindtags $itk_component(entry) autoSelect } else { #bind autoSelect FocusIn { } } } # for compat with iwidgets entryfield: action for invalid char with -validate itk_option define -invalid invalid Command {bell} # -- protected vars -- # this flag is set to 1 to avoid tracing when changing the entry's value protected variable notrace_ 0 # command to validate entry contents protected variable validate_cmd_ "" } skycat-3.1.2-starlink-1b/tclutil/library/LabelEntryScale.tcl000066400000000000000000000242331215713201500240020ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: LabelEntryScale.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # LabelEntryScale.tcl - Widget combining a labeled entry with a scale widget # # Copyright: # Copyright (C) 1999-2005 Central Laboratory of the Research Councils. # Copyright (C) 2006 Particle Physics & Astronomy Research Council. # All Rights Reserved. # # Licence: # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place,Suite 330, Boston, MA # 02111-1307, USA # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created # # 23 Mar 98 Added changes from P.W. Draper, Starlink. # Sorted out alignment when packing # vertically, added -resolution to keep # list for scale, added bindings for auto # increment and decrement when pressing # left and right arrows, added state # configuration option, added check that # value has changed in scaleCmd (The scale # widget has a binding that means # this is called repeatably which means # that any -commands are also called for no # reason). # Peter W. Draper 26 Feb 99 More changes: added option to hide the # scale and just keep the arrows. Also # added option to constrain the upper and # lower value limits. # 31 Mar 06 Added bindscale method. itk::usual LabelEntryScale {} # LabelEntryScale is an Itcl widget combining a labeled entry with a # scale widget to make a scale with an editable entry field. itcl::class util::LabelEntryScale { inherit util::LabelEntry # constructor: create a new instance of this widget constructor {args} { # Remove value from configuration options as we may need to # update the range of the scale. itk_option remove util::LabelEntry::value # Tk frame containing scale widget. itk_component add scaleframe { frame $w_.scaleframe } # Tk scale widget. itk_component add scale { scale $itk_component(scaleframe).scale \ -showvalue 0 \ -orient horizontal \ -command [code $this scaleCmd] } { keep -background -foreground -length -resolution -digits rename -width -scaleWidth scaleWidth ScaleWidth } # Left arrow button. itk_component add left { button $itk_component(scaleframe).left } { keep -background -foreground } bind $itk_component(left) [code $this start_increment -1] bind $itk_component(left) [code $this stop_increment] # Right arrow button. itk_component add right { button $itk_component(scaleframe).right } { keep -background -foreground } bind $itk_component(right) [code $this start_increment 1] bind $itk_component(right) [code $this stop_increment] eval itk_initialize $args } # Start incrementing if not already doing so. protected method start_increment {sign} { if { $afterId_ == {} && $itk_option(-state) == "normal" } { increment $sign } } # Stop incrementing. protected method stop_increment {} { if { $afterId_ != {} } { after cancel $afterId_ set afterId_ {} } } # Increment (1) or decrement (-1) the value by the current increment protected method increment {sign} { set v [expr [get]+($sign*$itk_option(-increment))] if {$v >= $itk_option(-from) && $v <= $itk_option(-to)} { config -value $v if {"$itk_option(-command)" != ""} { set cmd $itk_option(-command) lappend cmd $v eval $cmd } } set afterId_ [after $itk_option(-delay) [code $this increment $sign]] } # This method is called for changes in the scale widget. It does # nothing unless the value has changed, since the Scale has a # motion event that is constantly being invoked. protected method scaleCmd {newValue} { if { $itk_option(-value) != $newValue } { config -value $newValue if {"$itk_option(-command)" != ""} { eval "$itk_option(-command) $newValue" } } } # Redefined from parent class to update scale when entry is # changed private method command_proc_ {cmd} { set v [$itk_component(entry) get] if { $itk_option(-fix_range) } { if {$v < $from_} { set v $from_ } if {$v > $to_} { set v $to_ } scaleCmd $v configure -value $v } else { set from $from_ set to $to_ if {$v < $from} { set from $v } if {$v > $to} { set to $v } $itk_component(scale) config -from $from -to $to scaleCmd $v } } # Add a binding to all widgets related to scale. If a binding exists # already this one will be appended to it. public method bindscale {sequence script} { bind $itk_component(scale) $sequence +"$script" bind $itk_component(left) $sequence +"$script" bind $itk_component(right) $sequence +"$script" } # Add a binding to all widgets related to entry field. If a binding # exists already this one will be appended to it. public method bindentry {sequence script} { bind $itk_component(entry) $sequence +"$script" } # -- options -- # Widget orientation: horizontal or vertical itk_option define -orient orient Orient {horizontal} { if { $itk_option(-show_scale) } { set arrowside left set bitmap1 left set bitmap2 right } else { set arrowside bottom set bitmap1 decr set bitmap2 incr } pack $itk_component(scaleframe) -fill x -side $side_ if {$itk_option(-show_arrows)} { pack $itk_component(left) -side $arrowside $itk_component(left) configure -bitmap $bitmap1 } if { $itk_option(-show_scale) } { pack $itk_component(scale) \ -side left -expand 1 -fill x -padx 1m -ipadx 1m } if {$itk_option(-show_arrows)} { pack $itk_component(right) -side $arrowside $itk_component(right) configure -bitmap $bitmap2 } } # Scale range -from. itk_option define -from from From {} { set v $itk_option(-from) if {"$v" != ""} { $itk_component(scale) config -from $v set from_ $v } } # Scale range -to. itk_option define -to to To {} { set v $itk_option(-to) if {"$v" != ""} { $itk_component(scale) config -to $itk_option(-to) set to_ $v } } # Set the value for scale and entry field. itk_option define -value value Value {} { set v $itk_option(-value) if {"$v" != ""} { set notrace_ 1 # Update range to reflect this, if possible. Assumes -to # -from already set. set from $itk_option(-from) set to $itk_option(-to) if { ! $itk_option(-fix_range) } { # Expand range, if needed. if { $v < $from} { set from $v } if { $v > $to } { set to $v } if { $from != {} && $to != {} } { config -from $from -to $to } } else { # Clip to range. if { $v < $from} { set v $from } if { $v > $to } { set v $to } set itk_option(-value) $v } # Now update values. set prev_state [$itk_component(entry) cget -state] $itk_component(entry) config -state normal $itk_component(entry) delete 0 end $itk_component(entry) insert 0 $v $itk_component(scale) set $v if {"$itk_option(-justify)" == "right"} { $itk_component(entry) icursor end $itk_component(entry) xview moveto 1 } $itk_component(entry) config -state $prev_state set notrace_ 0 } } # Flag: if true, display left and right arrows for incrementing the value itk_option define -show_arrows show_arrows Show_arrows {0} # Amount to add or subtract for each button push itk_option define -increment increment Increment 1 # Command to execute when the value changes itk_option define -command command Command {} # Set the state to normal or disabled (greyed out) itk_option define -state state State normal { $itk_component(scale) config -state $itk_option(-state) if {"$itk_option(-state)" == "normal"} { $itk_component(scale) config -foreground $itk_option(-foreground) } else { $itk_component(scale) config -foreground $itk_option(-disabledforeground) } } # Whether to/from range is also fixed in entry field. itk_option define -fix_range fix_range Fix_Range 0 {} # Whether to show the scale widget. itk_option define -show_scale show_scale Show_Scale 1 {} # The pause in milliseconds for the animation delay. itk_option define -delay delay Delay 150 # State of increment command. protected variable afterId_ {} # Original -from and -to values protected variable from_ {} protected variable to_ {} } skycat-3.1.2-starlink-1b/tclutil/library/LabelMenu.tcl000066400000000000000000000146041215713201500226360ustar00rootroot00000000000000# E.S.O. - VLT project/ ESO Archive # "@(#) $Id: LabelMenu.tcl,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $" # # LabelMenu.tcl - Itcl widget for displaying a label and a menubutton # # Copyright: # Copyright (C) 1999-2005 Central Laboratory of the Research Councils. # Copyright (C) 2006 Particle Physics & Astronomy Research Council. # All Rights Reserved. # # Licence: # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place,Suite 330, Boston, MA # 02111-1307, USA # # who when what # -------------- --------- ---------------------------------------- # Allan Brighton 01 Jun 94 Created # Peter W. Draper 26 Mar 99 Removed global statements for $variable_ # itcl3 scoping breaks this # 02 Apr 01 Added delete and invoke methods for a single item. itk::usual LabelMenu {} # This widget displays a label and a menubutton with a selector and a # menu of radiobuttons. This can be used for choosing items from a list # and displaying the current choice. The widget supports adding of items # to the radiobutton menu and keeps track of which items are selected. itcl::class util::LabelMenu { inherit util::LabelWidget # create a LabelMenu constructor {args} { set menu $w_.mb.m # Menubutton containing the menu. itk_component add mb { menubutton $w_.mb -menu $menu } { keep -indicatoron -relief -borderwidth -state rename -width -valuewidth valueWidth Width rename -font -valuefont valueFont Font rename -anchor -valueanchor valueAnchor ValueAnchor ignore -disabledforeground } # Component for the menu. itk_component add menu { menu $menu } { ignore -disabledforeground } set default_bg_ [$itk_component(mb) cget -background] # trace this radiobutton var to change menubutton label global ::$w_.var set $w_.var "" trace variable $w_.var w [code $this update_menubutton] eval itk_initialize $args } # destructor destructor { global ::$w_.var catch {unset $w_.var} } # remove all of the items in the menu public method clear {} { $itk_component(menu) delete 0 end } # remove a single entry public method delete {index} { $itk_component(menu) delete $index } # invoke an item. public method invoke {index} { $itk_component(menu) invoke $index } # return the current value public method get {} { global ::$w_.var set v [set $w_.var] foreach i [array names values_] { if {"$values_($i)" == "$v"} { return $i } } } # add a separator item to the menu public method add_separator {} { $itk_component(menu) add separator } # add an item to the menu. # The args may be the options: # -label