============================================================================ Version 2.3 of IRAF frozen; began distribution (8/14 pm). Begin Version 2.4. ============================================================================ unix/boot/mkpkg/tok.c vms/boot/mkpkg/tok.c In getcmd(), there was still one case where $ was being recognized as a special character even though it occurred inside a token. This was causing the OSB mkpkg file to fail in a call to $generic. The argument list for $generic had a `\$$' embedded in a filename which was supposed to map to `\$'. This is correct for mkpkg, because with very few exceptions, the only special metacharacter in mkpkg is $, and it is escaped by doubling (as in make). Backslash is just another character in mkpkg scripts. (8/15) unix/boot/mkpkg/pkg.c vms/boot/mkpkg/pkg.c In parse_modname(), modified to map \$ or \/ (the possible vfn directory delimiter characters) into $ and /, rather than leaving the backslash in the filename. This did not cause a bug, but I noticed it while fixing above bug, and it did not look right. (8/15) lib/*.h lib/clpopn.h - Deleted the file <clpopn.h>, which I don't think is used anywhere anymore. Made minor edits to the headers of the global include files to eliminate the blank first lines in some of the older files, and add the filename in caps to the file header comment, so that they all look the same. Of course, this will cause much of the system to be recompiled, but it is time for a sysgen of the master system in any case. (8/15) ------------------ Full bootstrap and sysgen (from the sources) of UNIX/IRAF and VMS/IRAF; set up version 2.4 of the system. SUN/IRAF updated to V2.3. (8/15-16) local/mkpkg + [VMS] Added a mkpkg file to the LOCAL directory on VMS, so that a sysgen will find its way into the local/tasks directory. (8/16) dev/graphcap Deleted the `co' and `li' entries from the SGI graphcap entry for the versatec; don't see why these would be needed for this device. (8/17) unix/os/zfiomt.c In zzrfmt(), the read packet size of 32 would cause read() to return ERR on the Sun when reading a large record, whereas it would return 32 on the VAX. Changed the 32 to 32768 to ensure that it is larger than the maximum record size on the tape. This is a pretty big buffer to put on the hardware stack, but it should be safe. (8/19) -------------------------- No system modifications during the period 20 August through 5 September. (At DAO doing the port of IRAF to the Alliant vector superminicomputer). pkg/plot/doc/sgikern.hlp Updated the manual page for the `sgikern' task. (9/6) sys/osb/f77upk.f Added stripping of the blank fill at the right to the F77UPK primitive. The F77PAK primitive already blank pads at the right, so F77UPK ought to remove the padding. Use CHRUPK if this is not desired. (9/6) pkg/utilities/split.x + Added a new task SPLIT to the utilities package. SPLIT is used to break large, unmanageable files up into smaller files. (9/6) pkg/plot/mkpkg pkg/utilities/mkpkg I am not happy with either the ..x.e or ..1.e suffixes currently in use to flag temporary package local executables before installation. The former does not stand out enough, and the latter does not suggest its purpose. Changed the above packages to use an "xx_" prefix instead. The "xx_" prefix means "test (experimental) executable". (9/6) doc/ports/alliant_86.doc Installed the notes file from the Alliant port. There was some problem with the backup/tar file I made on the Alliant, hence it was not easy to get the notes file off the tape. I had to use the new SPLIT task to split the 24 Mb archive into 49 512000 byte segments, and eventually determined that the notes file was at line 11115 of segment 39! The problems with the tape are almost certainly not with the tape itself, since I did a backup/compare at DAO, and backup did not report any problems when the tape was read. I think the most likely culprit is the FTP software, which had to be used to move the archive to the VMS VAX, since the DAO Alliant did not have a tape drive. FTP (binary mode) insisted on making a file with an undefined VMS record type; this would cause RTAR to crash the VAX if I tried to look at the file on the VMS VAX at DAO. The 24 Mb archive file has one enormous section of about 3.5 Mb which is all zeroes, causing tar (or rtar) to get a premature end-of-tar indication (two zeroed file blocks). I tried the exact same operation (with a smaller test file) using our Eunice FTP and everything worked fine. The DAO TELNET also gave problems; it would hang up if fed too much data too fast, and would occasionally crash with a stack trace. Based on these experiences, I would certainly have to recommend the Wollongong networking software over the other vendor. (9/6) --------------- Begin merge of fixes from Alliant/IRAF port. unix/hlib/i1mach.f unix/hlib/r1mach.f Commented out calls to ULIBER. (9/7) unix/mc68000/zsvjmp.FX + Added the zsvjmp/zdojmp code for the Alliant. (9/7) unix/os/zgtime.c unix/os/gmttolst.c unix/boot/bootlib/ostime.c Changed all references to the 4.2BSD include <time.h> to <sys/time.h>. There is also a file <time.h> on our system and on the Sun, but the form <sys/time.h> appears to be the standard. (9/7) unix/os/zxwhen.c The hardware exception list in this code is very hardware dependent and often needs to be changed for a new UNIX host, so I replaced the code by a version which is set up to make it easy to add a machine dependent list of hardware exceptions. The default exceptions are those for the VAX. Also replaced the symbol `vector' by `vvector' as on the Alliant, since the latter serves our purposes just as well. (9/7) unix/os/zfiomt.c To zzrfmt_() (skip record forward), added a comments section noting the portability aspects of the routine, which has failed on three machines thus far (due to differences in the device drivers or C compilers). Changed the size of the auto buffer from 32768 to 29184, since the former cause a compile time error on the Alliant. This means that the largest tape block size UNIX/IRAF can handle is something close to but less than the 15 bit unsigned limit (32768). For example, 28800, i.e., FITS blocked to 10, is acceptable. (9/7) unix/boot/spp/rpp/ratlibf/dsfree.f On line 20, the hollerith string contained a tab where a space was intended. (9/7) unix/boot/mkpkg unix/boot/bootlib/mkpkg.csh Figured out a way to replace the CSH script mkpkg.csh in bootlib by a equivalent series of SH commands, one per line, so that the "sh -x mkpkg.csh" construct used throughout the rest of the unix bootstrap can be used in this case too. Besides being more consistent, this is safer, because the bootstrap no longer depends upon execute permission on the bootlib mkpkg.csh file. (9/7) sys/gio/gki/gkigca.x The min() intrinsic function was being called with operands of mixed type, i.e., int and short. Also, a Mems[] reference was missing the `gki' pointer. (9/7) sys/vops/lz/mkpkg Added $checkout etc. directives to the file header. (9/7) unix/boot/generic/tok.l unix/boot/generic/generic.c Made two fixes in the generic preprocessor: [1] changed the declaration of the external `xtype_string' in tok.l from (char *) to (char []). The former would work on most machines, but is not correct, and not portable; [2] modified so that "0$f" will be expanded for type complex to (0.0,0.0) rather than (0,0). The latter assumes that the Fortran compiler can handle the implied type coercion, which is not true for all compilers. (9/7) sys/vops/ak/a*x.x sys/vops/lz/a*x.x Deleted the following files so that their complex versions will be regenerated by the new generic preprocessor in the next sysgen: ak/abeqki.x, ak/abgeki.x, ak/abgtki.x, ak/ableki.x, ak/abltki.x, ak/abneki.x, ak/aclri.x, ak/adoti.x, ak/advzi.x, lz/allni.x, lz/alogi.x, lz/arcpi.x, lz/arczi.x, lz/assqi.x, lz/asumi.x (9/7) pkg/system/help/t_lroff.x Added an extern declaration for `getline'. (9/7) pkg/cl/task.h Eliminated the (unsigned) type coercion from the next_task macro. This should not be necessary, since (char *) is already an unsigned quantity. I checked the macro currently in use on AOS and it appears that the unsigned coercion was causing problems on that machine too, and that the present macro will probably work. (9/7) unix/hlib/mkpkg.inc sys/vops/mkpkg Added a new variable XVFLAGS to the global mkpkg include; these are the compile flags for VOPS and any other vector processing packages. Added a reference to the VOPS mkpkg to pick up the flags. (9/7) sys/gio/gki/gkiopen.x sys/gio/gki/gkititle.x The pointer `gki' was also omitted in Mems[] references in these routines. (9/7) sys/fio/osfnlock.x Changed the procedure osfn_initlock() from an integer function to a subroutine. (9/7) sys/vops/amap.gx Broke the min/max expression into two statements to fix a mixed type problem for case short. (9/7) sys/osb/mkpkg sys/osb/achtb.gc sys/osb/achtu.gc sys/osb/achtzb.gc sys/osb/achtzu.gc Modified the above files to treat type complex properly, and restored type complex to the call to generic in the mkpkg. Also deleted some old acht*.c files that were being referenced in the mkpkg and installed in the library, but which were not being regenerated from .gc generic sources. (9/7) sys/ki/irafks.x Changed the procedure kserver() from an integer function to a subroutine. (9/7) pkg/images/imdebug/mkimage.x Changed the procedure immake() from an pointer function to a subroutine. (9/7) pkg/images/tv/display/iiswnd.x Contained constructs such as `max (0, lut[i])', where `lut' is a short integer array. This caused a min/max type mismatch error. Also, a statement had a nonfunctional C like ; at the end. (9/7) pkg/images/tv/cv/iism70/iishisto.x Same problem, short integer variable `offset'. (9/7) pkg/images/tv/cv/iism70/iisrange.x Lots of problems mixing int and short in calls to AND, OR. (9/7) pkg/images/tv/cv/iism70/zsnap.x This module caused the fortran compiler to core dump with an internal error; it was trying to resolve mixed int/short operands in expressions and couldn't handle this code, evidently. (I feel much the same way trying to read it.) Deleted `int min(), max()' intrinsic function declarations. Added an itemp temporary to fix a couple min/max statements which mixed int and short operands. (9/7) pkg/images/tv/cv/iism70/iishisto.x Lots and lots of compile time problems with short variables. (9/7) unix/hlib/libc/kernel.h Changed HZ from a float constant to an int constant. (9/7) unix/os/zgtime.c sys/etc/sysptime.x Rewrote the system timer code to use only integer arithmetic; there is no good reason for low level system code to have any dependence on floating point. (9/7) -------------- (end merge of Alliant/IRAF mods and bug fixes) (did a bootstrap and sysgen) sys/imio/iki/oif/oifopen.x The oif_open procedure was setting IM_HDRFILE, but then reading the image header from disk into the imhdr structure, overwriting the new header file name. This would cause an invalid pixel file name to be generated when accessing an image that used HDR$ in the pixel file name field, but which had been moved to a new directory or node. Modified oif_open to set IM_HDRFILE after reading in the header from disk. (9/8) sys/gio/stdgraph/stgopen.x In the call to stg_openws to open the workstation at kernel open time, changed the mode from NEW_FILE to APPEND to avoid the screen clear that would otherwise occur. (9/10) dev/termcap Changed the entries for the noao versatec devices to use LPR rather than VPR and /dev/vp0. (9/11) LYRA UPGRADED TO 4.3BSD UNIX Begin port of UNIX/IRAF to 4.3BSD (on aquila, 9/11/86) ------------------------------------------------------------------- installed new system (stripped to source only) at /tmp2/u on aquila set .login, .cshrc up for new root set /usr/include/iraf.h to point to new system old command links in /local/bin left pointing to /iraf unix/hlib/libc/iraf.h Changed root to /tmp2/u/. Commented out the `#define BSD42' and added `#define BSD43'. (9/11) ---------------------- (begin bootstrap) Several files failed to compile in the kernel. unix/hlib/libc/kernel.h Added a `#ifdef BSD43' section to the header of kernel.h. First entry is a `#define _NFILE 64' for 4.3BSD. Max number of open files increased from 20 to 64, yeah! (9/11) unix/os/zfiopr.c Changed the name of the variable `sigmask', used in zfiopr.c to save the old signal mask, to `sigmask_save'. The name `sigmask' is now a defined macro in <signal.h>. (9/11) unix/boot/spp/rpp/ratlibc/initst.c Changed the _NFILE to a `10'. The RPP never has many files open at any one time, this should be fine. (9/11) --------------------- (bootstrap completed; begin sysgen) unix/hlib/iraf.h unix/hlib/mach.h unix/hlib/libc/spp.h The Fortran compiler would refuse to compile modules containing INDEFS or INDEFL, which were set to -2**15 and -2**31 for the VAX, as indicated in the VAX Architecture manual. A fatal `integer overflow in constant expression' would result. This is a bug in the compiler, but the the modules would not compile, so changed the values of these constants in the above files to one less in both cases. Probably the number is being accumulated as a positive number and the sign applied later, hence the integer overflow (since 2**31 - 1 is the largest long on a vax). (9/11) sys/gio/nspp/sysint/errprt77.f Moved SAVE statements on lines 374 and 410 to before the DATA statements. (9/12) pkg/dataio/fits/fits.h This file contains as explict integer contstants the values of FITS `blank' pixels, -2**15 and -2**31. These cause integer overflow on 4.3BSD since they are the same values as the IRAF indefinites. Also, these values should not occur in supposedly machine independent code. A 2/4 byte rather than numeric comparison should be used to test for FITS magic values instead. For the moment, I changed the values slightly to enable compilation - this does not solve the problem. (9/12) pkg/images/filters/med_sort.x In the second procedure, local variable `i' not used. Also, the underscore should be removed from the filename. (9/12) noao/mtlocal/idsmtn/read_varian.x This file contained a number of cases of very large explicit integer constants that would cause integer overflow at compile time in the 4.3BSD compiler. The values were not arbitrary hence could not easily be changed, so for the moment just deinstalled the idsmtn directory so that the remainder of MTLOCAL could be linked. (9/12) sys/imfort/* + sys/imio/imfort/* - Installed an all new IMFORT in sys, and deleted the old version in imio. The new IMFORT is much more comprehensive than the original, and includes more image i/o routines, access to image header parameters, and access to and decoding of command line arguments. (9/12) unix/boot/spp/xc.c unix/boot/spp/xc.hlp I want to use XC to compile and link host Fortran programs that use IMFORT, so added a switch `-h' to link host programs, i.e., to link without the IRAF main (a command line module must contain a main routine), and without searching the IRAF libraries unless explicitly referenced on the command line. Also added a reference to the Fortran library -I77 to XC, required to link host Fortran programs. Library references (-llib) would cause a link even if -c was given on the command line; now will not link if -c flag is given, regardless of any other flags that might be present. This switch was formerly called -Np in the UNIX XC, and was absent in the VMS XC, and the old `-h' would cause a nonstandard SPP header definitions file to be used. Changed the old `-h' (which is very rarely used) to `-Nh'. xc -hO prog.f ... -limfort -lsys -lvops -los The above command line suffices to compile and the host Fortran program PROG.F and link it with the IMFORT and other IRAF libraries. This can be defined as a foreign task `fc' or whatever in the USER package to minimize typing. (9/12) pkg/cl/builtin.c Modified the code used to construct the host command line for a foreign task to support optional argument substitution. The sequences $1, $2, etc. (up to $9) refer to the individual arguments on the IRAF foreign task command line, $* refers to the entire argument list, and $0 is replaced by the IRAF taskname. A sequence $(N) or $(*) causes each input argument to be treated as a virtual filename and mapped into its host system equivalent for insertion into the host command line. For example, this permits foreign task definitions such as the following, used to define a new task FC to compile and link host Fortran programs which use the IMFORT interface: task $fc = "$xc -hO $* -limfort -lsys -lvops -los" The facility should also be useful whenever an IRAF foreign task causes more than one host command to be executed, e.g., in combination with the ! os escape command delimiter in VMS (or ; in UNIX). An argument or the argument list may be referenced any number of times in the command template. Whitespace is not added before or after the argument reference, hence sequences such as `$1.o -o $1.e' will work. For backwards compatibilty the argument list is simply appended to the command template if no $arg sequences are encountered. The new facility is not completely backwards compatible, however, because any $ in the command template must now be escaped to be included in the final host command. (9/13) ---------------------------------- (system moved back to lyra which now runs 4.3BSD) (files modified on lyra version of IRAF in past two days merged into 4.3BSD (version of the system) sys/mkpkg sys/imfort/* + sys/imio/imfort/* - sys/imio/mkpkg The new IMFORT package contains more than just image access routines, hence was installed in sys rather than imio. Deleted the old package in imio and modified the mkpkg files to reference the new package. (9/14) sys/etc/erract.x sys/etc/xerfmt.x sys/etc/xerpue.x + Examination of the symbol tables of host Fortran programs using IMFORT showed that a lot of things were being linked in that should not be, i.e., much of IPC and KI. I have also noticed this before with the HSI programs, but did not bother to track it down. The problem proved to be in the xer_putline routine in erract.x, and in xer_fmterrmsg in xerfmt.x, both in ETC. I removed the xer_putline routine from erract.x and rewrote it to access the file driver connected to STDERR remotely through the FIO device table. This avoids a link time reference to the IPC file driver and the KI (which ordinary IRAF subprocesses must use for error recovery since they can run on a remote node). In xerfmt, I merely removed the `include <knet.h>' reference - this requires that lib$syserrmsg be available on the local node, which seems like a safe bet if an iraf kernel server is available. With this change Fortran/IMFORT programs can be as small as 60Kb on UNIX, and they should be even smaller on VMS with the Fortran shared library. (9/16) unix/os/zfiotx.c The uio_bwrite() procedure was written explicitly for the 4.2BSD stdio system to provide greater textfile i/o efficiency for block transfers. Without checking into it carefully, it appeared that this code (which has intimate knowledge of the 4.2BSD stdio internals) was not working on 4.2BSD. I was expecting that that would be the case when 4.3 came along, and anyhow the 4.3 version of fwrite() has been optimized to use block transfers, so I changed the code to use fwrite and deleted the old code. 4.2BSD is history now anyhow. (9/17) unix/boot/spp/xc.c Now accepts -f as the equivalent of -F; HSI tasks should not be case dependent for portability reasons. Added a switch -x which maps into the debug switch for the host system. These changes make the most commonly used switches the same for both the UNIX and VMS versions of XC. (9/19) lib/names + Added a file lib$names, containing a sorted list of all the external Fortran callable library names in the libraries libimfort.a, libex.a, libsys.a, libvops.a, and libos.a. MATCH can be used to ask all sorts of interesting questions about this database. In particular, the user/programmer can check to see if a name is already used by the system to avoid library conflicts with external names in their own programs. (9/20) -------------------------- Updated VMS/IRAF: all files modified in the past 35 days. Complete new versions of the following directories installed: sys/imfort sys/gio/ncarutil noao/imred/dtoi noao/mtlocal/idsmtn noao/onedspec/identify noao/twodspec/apextract Also merged all recent UNIX/IRAF HSI changes into the VMS/IRAF HSI. These included bug fixes in generic and spp, addition of the -h flag to XC, addition of a set for imfort to zzsetenv.def, bug fixes in the [ir]1mach.f files in hlib, addition of a define for FC to the default hlib$login.cl, and addition of XVFLAGS to hlib$mkpkg.inc. (9/21) vms/boot/spp/xc.c Added an alias -m for the -M (make link map) flag. Changed the default to optimize and added a flag -q to turn optimization off. Hence, the -O is no longer needed. (9/22) vms/hlib/mkpkg.inc vms/hlib/login.cl Changed the "-cO" to "-c". (9/22) unix/boot/spp/xc.c Changed the default to optimize, and added the `-q' flag to turn optimization off. (9/22) unix/hlib/mkpkg.inc unix/hlib/login.cl Changed the "-cO" to "-c". (9/22) vms/boot/bootlib/dcl.c This routine uses SHOW STATUS to get the status back from a command sent to DCL. The output from the command followed by SHOW STATUS is scanned, and when the output from SHOW STATUS is seen, that output line is filtered out and used to set the exit status to be returned to the HSI code. The problem is that a very explicit string compare was being used to match the output of SHOW STATUS, and the output string changed in 4.4 VMS. The old format was " $STATUS = %Xdddddddd" (VMS 4.3) this changed to " $STATUS == %Xdddddddd" (VMS 4.4) This would cause the status to be missed, and one of the above messages would appear mixed in with the output of the program for every command sent to DCL. I modified dcl.c to be a little more forgiving of changes to the exact format of this string. (9/22) sys/imio/iki/oif/oifmkpfn.x The / was being included in the subdirectory name, causing ZFSUBD to fail on VMS, although it would work on UNIX. (9/22) dev/pix.imh [VMS] Changed the pathname for the pixel file to HDR$pix.pix. The previous value, dev$pix.pix, was set manually with HEDIT and is illegal since it is a virtual filename, and low level programs like IMFORT programs cannot handle that. (9/22) vms/hlib/init.dbg [VMS] Had to change the window assignments because the old values were inappropriate for the V4.4 version of the debugger - DEC just can't leave the thing alone! (9/22) sys/ki/mkpkg sys/ki/kilnode.x + Added a new function to KI (used by vfntrans, see below). yes/no = ki_localnode (nodename) The function is used to test if the named node is an alias for the local node. (9/28) sys/fio/vfntrans.x Made a fix for the following problem. Start with a logical directory such as set dd = node!usr0:[user.imdir] File references will then be of the form "dd$pathname", rather than "node!ldir$pathname". We do not discover that the file is on a remote node until the logical directory has been expanded. The fix was to convert "dd$pathname" into "node!dd$pathname" during logical directory expansion, i.e., as soon as the reference to the remote node is detected, the translation is discarded and the whole thing turned into a remote file reference. The process repeats on the remote node, but when the logical directory is expanded on the remote node the node name is an alias for the "local" node, and filename translation completes normally, resolving into a server-local file reference. (9/28) TODO: will have the same problem for non-filename resources. sys/ki/kgfdir.x Filename mapping and unmapping has to take place on the node on which the resource physically resides. The problem here is filename unmapping; when a directory is read, the kernel server on the remote node unmaps the filenames into IRAF names, return IRAF filenames to the server code on the client node. These filenames were being passed up into the VOS, which would immediately "unmap" them again, causing constructs such as .e, .o, etc. to be mapped to .\e, .\o, and so on. This is necessarily so since the VOS must unmap host filenames returned by the kernel (or the KI). The fix was to map the filenames for the local host in the client, i.e., the remote kernel server maps the remote host filenames into IRAF names, sends the IRAF names to the client, the client maps them into local host name, returns these to the VOS, and the VOS unmaps them using the translation tables for the local host. (9/28) sys/imio/iki/oif/oifmkpfn.x Added an `include <knet.h>' reference since the file references KFSUBD. (9/28) vms/os/net/zfioks.c When connecting to a remote node, the "Password (...): " prompt could be printed on the terminal before pseudofile output was flushed via IPC and the CL, since both processes would be talking directly to the terminal. This lack of synchronization could confuse the user, so added a 50 millisecond delay before prompting for the password to allow the i/o streams to empty. (9/28) sys/fmtio/patmatch.x There were two cases where a procedure had a char argument but was being called with an integer character constant. (10/2) sys/gio/sgikern/mkpkg sys/gio/sgikern/sgk.h sys/gio/sgikern/sgiinit.x sys/gio/sgikern/sgipcell.x Added support for cell array output to the SGI kernel. The kernel takes 8 bits in and renders it into a 1 bit display for the output plotter device. The algorithm is suitable for both raster devices and metafile devices. (10/4) pkg/proto/imsqr.x + pkg/proto/imfunction.x pkg/proto/doc/imfunction.hlp Added support for the SQRT function to the IMFUNCTION task. (10/4) sys/gio/stdgraph/stgpcell.x Added support for cell array output to the STDGRAPH kernel. (10/6) lib/gio.h sys/gio/gstatr.x sys/gio/gsetr.x In <gio.h>, the GP_ASPECT field, which is the desired aspect ratio for the GLABAX viewport and not the physical device aspect ratio, was defined as in integer field. Changed to a Memr reference. In gsetr, the field was being assigned into with an integer value, rather than the floating point value. (10/5) dev/vdm.gki + [UNIX,VMS] Restored the standard test metacode file, which was accidentally deleted at some point on the lyra version of the system. On VMS, the file was present but had the wrong VMS file type, hence was unreadable. Restored the file on both the UNIX and VMS versions of the system. (10/6) sys/ki/kignode.x Will now skip leading whitespace at the beginning of the resource name. Whitespace or any other nonalphanumeric characters encountered while extracting the node name prefix will cause node name extraction to terminate, causing the system to treat the resource as present on the local node. (Hence, "abc!..." is a reference to resource `...' on node `abc', while "abc !..." is a reference to resource `abc !...' on the local node). (10/6) sys/ki/mkpkg sys/ki/koscmd.x + sys/ki/irafks.x unix/hlib/knet.h unix/hlib/libc/knames.h unix/hlib/libc/knames.no_ Added support for ZOSCMD to the kernel interface. If the host command string is prefixed by a node prefix (e.g., "node!...") the command will be passed to the host command interpreter on the remote node. The remote kernel server spools the output of the command in a text file, returning the name of the spool file to the KI on the local node. The KI (KOSCMD) then copies the spooled output to either the stdout_file named in the KOSCMD argument list, or the terminal if no file was named. This feature was added to provide network support for the SGI kernel, but of course it makes remote execution of a command possible wherever an OS escape occurs. The syntax can be a bit confusing, but there is no alternative. For example: cl> !node!w will execute the command `w' on node `node', whereas cl> !node !w or cl> !node\!w will execute the command `node !w' or `node!w' on the local node. On a UNIX node, if the first character to ZOSCMD is a !, /bin/sh will be used to execute the command, hence cl> !node!!w will execute the `w' command on the remote node with the Bourne shell. Just in case you aren't totally confused by now, on a VMS node, a leading ! is used to fire up a new DCL and is also the multi-command delimiter, so it is possible to create such atrocities as cl> !vmsnode!!show time!show users Since both UNIX and VMS nodes do something fairly harmless if the first character in the OS command is a !, one can type "!!oscmd" to force a command to be executed on the local node without stripping of the node prefix, unintentionally or otherwise. Note that this feature may also be used to execute foreign tasks on remote nodes, by including the node prefix in the foreign task declaration. This allows the output of the remote command to be redirected elsewhere by the local CL, although the process is not very efficient due to the use of several temporary spool files. (10/6) sys/etc/xerpue.x Fixed a bug discovered when testing the above mentioned feature. In xer_putline(), the char count being sent to ZPUTTX or ZPUTTY was being multiplied by SZB_CHAR, causing extra junk to be printed at the end of the output data string. This routine is also called to print error messages during error recovery, and the bug could produce erroneous output when a task is run standalone, e.g., when the CL is run. When a task is run as a subprocess the output is not a text device, so the bug would not matter. (10/6) sys/ki/irafks.x sys/ki/kiopenks.x The KI support for ZOSCMD requires creation of a temporary file on the remote server node to spool the oscmd output. SGI also wants to write into TMP on the remote node. It turns out that the kernel server, being an IRAF process, will automatically call ZGTENV to read the local values of the HOST, IRAF, and TMP environment variables from <iraf.h> (or the logical name table, or wherever) provided they are not already defined in the environment table. I modified the code which transmits the client's environment list to the server to exclude the local definitions for HOST, IRAF, and TMP, so that the server will use the values for the server node instead. I also deleted the SETROOT code, formerly used to reset the value of IRAF after transmitting the environment list, because it is no longer needed. (10/7) sys/gio/sgikern/sgk.x Modified to recognize a node prefix in the device name ("node!device") and include the node prefix in the spoolfile and dispose strings, causing the plot file to be written and disposed of on a remote node. (10/7) lib/syserrmsg Changed the "No entry in termcap database file..." error message so that it is suitable for both termcap and graphcap devices. (10/7) sys/etc/xgdevlist.x This facility is used to fetch the entry for a device from the DEVICES table, given the logical name of the device. The procedure was doing only a counted string compare, hence it would return the first device entry for which the device name given was a prefix. For example, "mt" would match the first magtape device in the table, no matter what it was. Modified to match only whitespace delimited device names. (10/8) ----------------------------------------- VMS/IRAF updated from lyra. (10/8) vms/os/tranlog.c Broke up _createlog into the three procedures _createlog, _createjoblog, and _mklognam. These allow the caller to specify which table the logical name is to be added to. (10/9) vms/os/net/zfioks.c vms/os/net/kutil.c Added a process tree global password cacheing mechanism to the get password code. Once the password for a given node and login is entered by the user (due to a ? in the .irafhosts file) it is encrypted and saved in the user's memory space in a place that can be accessed by all processes in the process tree. Subsequent network accesses to the same node by other processes in the same process tree used the cached entry and hence the user is not repeatedly queried for the same bit of information. (10/9) pkg/plot/doc/sgikern.hlp sys/gio/sgikern/sgk.x The DD string for an SGI device may contain the sequence $F, which is replaced by the plot file name at open time. I added a more general macro replacement facility $(CC). If this is encountered in the DD string, the string value of the graphcap capability CC is substituted. For example "-w $(xr)" would map to "-w 1024" if capability `xr' were defined as ":xr#1024:". (10/10) unix/boot/rmbin/rmbin.c The -o flag, used to specify the extensions of the files to be selected (deleted), was not working properly. Despite the threatening name, sequences like `rmbin -n -o .cl dir dir' are useful for finding all files with a certain extension in a directory tree (this is not for everyone). (10/11) pkg/... noao/... unix/hlib/clpackage.cl To all the package-tasknames in TASK statements in package script tasks, added the extension ".pkg", e.g., "task tv.pkg = tv$tv.cl". This is not used in the current CL, but was required for testing the new CL which is currently under development. (10/11) unix/os/ufstat.c - unix/os/*.c Removed the fstat cache. This is inherently unreliable and such cacheing should be done at the applications level, if at all. (10/13) noao/noao.par + Added a parameter file for the noao package; discovered it was missing while testing new CL pset code. Evidently the old CL didn't care if it couldn't find the pfile. (10/13) sys/gio/sgikern/sgk.x The sgk_vector() procedure was not recognizing the special case of a vector of zero extent (dx=dy=0), i.e., a point, as occurs when plotting a polymarker. Added a third case on the if-else to handle this. (10/15) hlib/*.cl pkg/.../*.cl noao/.../*.cl As part of an experiment with a feature in the new CL, added comments of the form #{ to the header area of all compute mode scripts. In the new CL, this sequence asserts compute mode on the stream (regardless of the value of `lexmodes') until a matching #} is seen to clear compute mode. This allows us to make command mode the default on all command input streams, without having to suffer the trauma of rewriting all our old CL scripts as procedure scripts. Note that the #{ and #} are special only if they occur at the beginning of a line. (10/15) pkg/cl/* Installed the new version of the CL. The primary changes in this version are the addition of `pset' tasks and parameters, the addition of colon commands to eparam (to read and write psets to from files, edit a new pset, run the associated task, etc.), a new cl option `showtype', default =no, to cause a type suffix character to be added to special tasks to indicate their type, and the extension of command mode to all input streams as the default (formerly, all script input was in compute mode). (10/19) sys/clio/clopset.x sys/clio/clcpset.x sys/clio/cl[gp]set.x sys/clio/cl[gp]set[bcsilrdx].x sys/clio/clpsetnm.x sys/clio/clpset.h Added support for named parameter sets to CLIO. The `clpset' procedures are equivalent to the clget/clput procedures, but they take care of the details of concatenating the pset name and parameter name in references to parameters in named psets. ********************************************************************* This is a major revision to the CL, fully documented in the paper "CL Parameter Set Extensions", Oct 21, 1986. (doc$pset.ms). (10/19) ********************************************************************* unix/hlib/motd unix/hlib/zzsetenv.def pkg/cl/cl.par Incremented the system version number to 2.5. V2.4 was just released on draco, and the new CL is a sufficiently major change to warrant a new version of the system. I am going to continue to add to the V2.4 notes file, however, until the AOS/IRAF bug fixes have been merged in and the UNIX/IRAF system settles down while I work on the SUN/IRAF system. (10/19) unix/hlib/mkiraf.csh Initialization of the uparm directory is now an option. (10/20) dev/hosts [node lyra, UNIX/IRAF] Removed the `plot' alias for carina - set up back when we switched to 4.3BSD due to problems with lpr. We should be able to do our ncar plot processing on lyra now. (10/22) sys/imfort/db/imastr.x This procedure had not yet been modified to be consistent with the other db/imadd procedures, i.e., the datatype arg was a domain string rather than a type code, and there was no comment string. This would cause the imfort procedure imaddc to create a new field with an invalid datatype. (10/24) ------------------------------- Begin merge of AOS/IRAF revisions from AOS/IRAF port. unix/hlib/libc/knames.no_ - unix/hlib/libc/xnames.no_ - unix/hlib/libc/libc.h unix/hlib/libc/iraf.h Deleted the #ifdef F77_NO_ stuff in libc.h and iraf.h, and deleted the no-underscore versions of the knames.h and xnames.h files. There is too much variation in the machine dependence of the Fortran external names to be represented by this scheme. It is simpler and safer to just have the UNIX version of the external names in the UNIX kernel, and modify that for each new system. (10/27) unix/hlib/libc/knames.h Removed duplicate define for ACHTUU. (10/27) unix/os/zfiopl.c unix/os/zfiolp.c Added a (char *) cast to the second argument to strncpy(). (10/27) unix/os/zopdir.c There was a bug which was causing the trailing / to be included in the directory name passed to opendir(). This is harmless on unix but might cause problems on some systems. (10/27) unix/os/zmaloc.c unix/hlib/libc/kernel.h Deleted the ZMEMCK memory allocator debug code, and the associated #ifdef flag in kernel.h. The 4.3BSD memory allocator is completely new hence the old debug code will no longer work. The new 4.3 BSD memory allocator, by the way, looks to be a lot more sophisticated and efficient than the old one. (10/27) unix/os/zpanic.c Added [] to the declaration of osfn_bkgfile. (10/27) unix/os/zxwhen.c Two occurrences of ZWHEN in the comments were changed to ZXWHEN. (10/27) sys/imio/imaccess.x Modified to deal with sections and cluster indices. (Not AOS related revision). (10/28) unix/os/zfioty.c Sometime back, when the VOS terminal driver was added, a new file TTOPEN.X was added to sys$etc. This file contains a routine TTOPEN which can be used to open a terminal directly as a device. The special device name "dev$tty" denotes the user terminal. This feature was evidently never fully implemented; I added a few lines of code in the UNIX terminal driver (ZOPNTY) to recognize dev$tty and open the device /dev/tty when the special device name is seen. Note that the device name dev$tty is not filename mapped since FIO does not map the names of special devices, and the name is therefore passed on without modification from the user program to the kernel. The TTOPEN function has not yet been used in IRAF, but it will be needed at some point for programs like screen editors that need efficient raw i/o to a terminal. On machines where this type of direct access cannot be implemented IPC to the CL can be used instead, at a considerable loss in efficiency for very interactive applications. The TTOPEN facility should NOT be used in ordinary applications software. (10/29) sys/fio/zfiott.x This file is the VOS terminal driver. Modified the i/o logging code to record ^ as \^ so that the actual character is not confused with the ^[ type notation used to render control characters, and to record spaces a \40 rather than as an (invisible) space. Hereafter, any whitespace in the log file was put there only to improve readability, and is not data. (10/29) pkg/cl/mkpkg Modified the `relink' entry as follows: relink: <stuff> link: $set LIBS = "..." $link cl.o ... ; The `link' symbol is thus an entry point into the `relink' subprogram, used when one does not want to check if all the object files are up to date (that is what <stuff> does). This note is partially to document this little used mkpkg construct. See also the mkpkg in imfort$tasks for another unusual but occasionally useful construct. (10/29) sys/tty/ttyputl.x The ttyputline() procedure would break lines (add a newline) that were exactly 80 chars long, terminated by an EOS but no newline. This was the bug causing EPARAM to scroll on AOS/IRAF, not anything in the eparam code itself. (10/29) sys/etc/pagefiles.x + sys/etc/lineoff.x + pkg/system/page.x pkg/system/lineoff.x - The PAGE task was repackaged as a library subroutine and installed in the ETC package so that the interactive file paging capability will be available to applications programs. pagefiles (files) pagefile (fname, prompt) gpagefiles (files, device,prompt,firstpage,clearscreen,mapcc) The procedure `pagefiles' pages through the files in a file template, `pagefile' pages a single file and allows the end-of-page prompt to be something other than the filename, and `gpagefiles' is the fully generalized routine. The global `ukey' cl parameter is used for keyboard input, transparently to the calling program (but it can be redefined with a local task parameter if desired). (10/30) sys/etc/pagefiles.x Smartened up the pager to deal properly with very long lines, i.e., lines of text that require several terminal lines to display, as in mkpkg output. (10/30) sys/fmtio/ctocc.x Modified to always output octal control codes as 3 digit octal numbers, e.g., \040 rather than \40. This is necessary for the inverse operation, as the escape sequence may be embedded in a string immediately followed by a printable digit, e.g. "\04089". (10/30) unix/hlib/libc/xnames.h Added entries for TTSETS and TTSTATS, used to set/stat string valued terminal driver parameters. Also added an entry for STTYCO, the main entry point for the new VOS STTY routine (see below). (10/31) sys/clio/clopen.x sys/clio/clcmd.x I turned off the FLUSHNL (flush at newline) bit for the CLOUT stream, to allow parameter-set requests to be batched to speed up tasks that set the values of a lot of parameters at runtime. It was necessary to add an explicit flush to CLCMD since the flush is no longer implied. This appeared to be the only place where a flush would need to be added. (10/31) unix/boot/spp/xpp/lex.sed unix/boot/spp/xpp/xppcode.c In xppcode.c, increased the size limits for defined strings and string constants to 8192 chars for string constants, 4096 chars for defined strings, and up to 128 defined strings. In lex.sed added an edit command to increase the size of the yytext token buffer from 200 to 1024 chars. This limits the maximum length of a string constant or defined string. (10/31) sys/fmtio/pargb.x Modified to print the %b `yes' and `no' strings in lower case rather than upper case. (11/2) pkg/cl/builtin.c A recent change to this file, made in support of the new terminal driver, fixes an old problem with foreign tasks. Formerly, arguments to foreign tasks of the form "keyword=value" would be translated as "value" in the generated host command line, since a foreign task has no pfile. The "keyword=" is now preserved. (11/2) lib/syserr.h lib/syserrmsg lib/ttset.h [*] pkg/cl/builtin.c pkg/cl/login.cl pkg/cl/mkpkg pkg/cl/tags pkg/language/doc/stty.hlp + [*] pkg/language/language.hd pkg/language/language.men pkg/system/doc/stty.hlp - pkg/system/mkpkg pkg/system/system.cl pkg/system/system.hd pkg/system/system.men pkg/system/x_system.x sys/clio/clcmd.x sys/clio/clopen.x sys/etc/mkpkg sys/etc/sttyco.x + [*] sys/fio/zfiott.com [*] sys/fio/zfiott.x [*] sys/gio/cursor/mkpkg sys/gio/stdgraph/mkpkg sys/gio/stdgraph/stdgraph.com sys/gio/stdgraph/stgclose.x sys/gio/stdgraph/stgopen.x sys/gio/stdgraph/stgopenws.x sys/gio/stdgraph/stgrcur.x [*] sys/libc/cttset.c sys/libc/mkpkg unix/hlib/libc/ttset.h [*] = major changes unix/hlib/libc/xnames.h The above files were modified in support of the new VOS terminal driver. The main source files for the driver are etc$sttyco.x, zfiott.x and zfiott.com in fio$, and lib$ttset.h. The file gio$stdgraph/stgrcur.x also received a substantial amount of new code; the revisions to the remaining files were minor. To summarize the revisions: the actual source for the driver in fio$zfiott.* was extensively revised. A new STTY driver task was added to etc$sttyco. The old STTY task in the system package, a CL script, was deleted, as was the _stty builtin in cl$builtin.c. A front end to the VOS STTY was added to the language package (cl$builtin.c). The new architecture concentrates all knowledge of the driver functions into the VOS files, with the CL front end serving merely to concatenate the argument list string and pass it on to the VOS routine. The new VOS terminal driver is fully documented in the manual page for the STTY task in the language package. Aside from cleaning up the architecture of the terminal driver interface and making everything execute faster, the major revisions were to the logging features of the terminal driver. The old `stty logio' function is retained with slight modifications to eliminate ambiguities in the recorded data, e.g., the characters ^ and \, if present in the data stream, are logged as \^ and \\, and spaces are logged as \s (rather than be invisible). Two new features, `stty login' and `stty logout' were added to permit logging of the input and output streams in separate files. The name of the logfile may now be specified on the command line as an option. A major new feature `stty playback' was added to permit terminal input to be taken from a logfile. One types `stty login[=file]', executes an arbitrary sequence of commands, then terminates input logging. The resultant script may be read back any number of times with `stty playback'; this is different from an ordinary CL script because all interactive queries, EPARAM keystrokes, cursor mode input, etc. is logged as well as command lines. The playback feature was added with two goals in mind. First, we hope that it will be a useful aid for testing software. One can exhaustively test a package with input logging on, entering any arbitrary sequence of commands, and then repeat the sequence automatically at a later date or on a completely different IRAF host, possibly logging the terminal output and diff-ing it with the original. The logfile is a printable and editable text file, hence can be patched manually to reflect minor changes to the software being tested, if necessary, without having to regenerate the entire thing. The second purpose of the playback feature is for demos and tutorials. A user at a remote site can playback an stty script to be led through a detailed tour of any program or package. The scripts can be annotated with explanatory comments, to be written directly to the terminal at runtime (such comments are never seen above the driver). Playback can proceed either in a fully automatic mode, with a programmable delay after each input data record, or in a synchronized mode where the user must tap the space bar to pass each record to the calling program. (11/2) sys/etc/sysid.x Deleted the call to GETUID if "userid" is not found in the environment. By now, everyone will have a "userid" defined in their login.cl file. Also, I want this routine to call only low level functions so that it can be called by other low level code w/o recursion. (11/2) unix/boot/spp/xc.c Added some code to recognize a new form of a command line switch. The construct `-/xxx' will cause a `-xxx' to be included in the command lines of the f77 and cc commands, i.e., `-/' is used to escape switches to be passed to the host programs. In particular, this is necessary to pass switches which are words rather than single characters, e.g., `xc -cf -/f68881 ...'. (11/3) math/minpack/ + Installed the raw sources for an older, non-proprietary version of the MINPACK package in the math package. There has been no attempt as yet to review the sources for portability and compile and install the library. (11/4) sys/etc/pagefiles.x Added a new colon command ":spool <fname>". One positions to the desired line in the file or stream being displayed and then turns on spooling to the named file. Thereafter, as each line is displayed on the screen it is also appended to the spool file. (11/4) sys/vops/alut.gx sys/vops/mkpkg sys/vops/lz/mkpkg The ALUT routine was extended to provide lookup tables for datatypes real and double, using an integer index array as input. (11/5) sys/etc/main.x sys/clio/clcache.x sys/clio/clio.com lib/clio.h Revised the CLIO parameter cache code to automatically search the psets for a task if no entry is found for the named parameter. For example, if the parameter is "xxx" and the task is T with psets A and B, CLIO will look first for "xxx" and then for "T.xxx", "A.xxx", and "B.xxx". The effect is that the psetname may be omitted without invalidating the cache, and the parameter search path used in the CL is used in CLIO as well. (11/6) (back to AOS/IRAF merge) unix/boot/bootlib/osfn2vfn.c unix/boot/bootlib/vfn2osfn.c unix/boot/bootlib/osdir.c No changes here for the present. It is easier for the moment to follow the original concept of a different bootlib for each host than to try to devise a portable one. At some point we do need to make more of an effort to produce a more generic UNIX/IRAF HSI. (11/7) unix/boot/bootlib/osaccess.c unix/boot/bootlib/oschdir.c unix/boot/bootlib/oscmd.c unix/boot/bootlib/oscrfile.c Minor changes, mostly adding type casts. (11/7) unix/boot/spp/rpp/ratlibc Changed the remark() argument type to (int *) and deleted the old interface files which are not used by the preprocessor. (11/7) unix/boot/wtar/wtar.c Deleted u_finfo() declaration. Cast arg to ZFINFO as (PKCHAR *). (11/7) unix/boot/rtar/rtar.c Once call to cchksum() did not cast the argument as (char *). (11/7) unix/boot/mkpkg.csh unix/boot/spp/* Added mkpkg.csh files to the SPP source directories. This will force everything to be recompiled when a bootstrap takes place, eliminating the problem of foreign binaries being used when sys/mkpkg Modified the entries for libmain.o, which was using the $checkout / $checkin directives in a way which was inappropriate for an object module. (11/7) sys/gio/elogr.x sys/gio/elogd.x Changed some (10.0 ** -x) constructs to the form (10.0 ** (-x)) to avoid a shortcoming of the AOS/VS Fortran compiler. (11/7) sys/gio/aelogr.x + sys/gio/aelogd.x + sys/gio/elogr.x sys/gio/elogd.x Moved the anti-elog functions out into separate files for a better UNIX library structure, and to avoid a topological sorting conflict. (11/7) unix/boot/xyacc/mkpkg.csh + Added a mkpkg.csh file for XYACC; the entire UNIX bootstrap is now driven via these shell scripts and make is no longer used. (11/8) unix/.../mkpkg.csh Reviewed all the mkpkg.csh files and made the following changes: [1] eliminated use of environment variables, e.g., $hlib; constructs like ../../hlib used instead; [2] scripts delete all binaries after making whatever they make; [3] switches like "-cO" were changed to "-c -O", which is more portable. These changes were made to favor user sites, so that the bootstrap works if there is no $hlib, and user sites rarely do software development in the HSI hence do not need to have the objects and package libraries left behind. (11/8) unix/mkpkg.csh unix/gdev/mkpkg.csh sys/mkpkg GDEV is now handled somewhat differently. During the bootstrap, the gdev/mkpkg.csh script is run: this calls sgidev/mkpkg.csh to compile and install the SGI translators. During a sysgen, there is now an entry in sys$mkpkg which runs the mkpkg in host$gdev to update the GDEV device drivers in libsys.a. This is kind of a weird structure, but is less error prone than the old structure (libsys.a can be deleted and it will be completely reconstructed by a sysgen). (11/8) pkg/cl/main.c Changed declaration of bkgfile to (PKCHAR *). (11/8) sys/libc/eprintf.c sys/libc/sprintf.c sys/libc/printf.c sys/libc/scanf.c Installed the versions of these files from AOS/IRAF, which were modified to use <varargs.h> to elminate the dependence on how the compiler compiles argument lists. (11/8) sys/libc/mkpkg sys/libc/cstropen.c + Added a new function c_stropen() to LIBC. (11/8) pkg/cl/clprintf.c pkg/cl/errs.c Modified to use <varargs.h>. Used AOS/IRAF version of clprintf.c, but did a merge on errs.c, and set it up to use the new c_stropen procedure and fdopen() rather than duplicating the low level interface code for sprintf. (11/8) pkg/images/tv/cv/ids/idsinit.x pkg/images/tv/cv/iism70/iisrd.x pkg/images/tv/cv/iism70/iiswr.x Eliminated type declarations for intrinsic function max(). (11/8) pkg/images/tv/cv/iism70/iispio.x pkg/images/tv/display/iispio.x pkg/images/tv/display/iisio.x The ands() function was being called with short and integer arguments. (11/8) unix/boot/bootlib/osgetenv.c Added a (char *) coercion to the call to strncpy. (11/8) (boolean expressions) The AOS/IRAF notes state that the SPP compiler translates expressions such as (! clgetb(...)) as (clgetb (...) .EQ. .FALSE.). This is not the case: ! is translated as ".NOT.", which makes sense, since the RPP always does the easy thing. Nothing changed. (11/8) pkg/images/tv/cv/iism70/iiscursor.x pkg/images/tv/cv/iism70/zclear.x Lots of problems with and, andi, etc. Not going to fix this garbage code, which will soon be dumped. (11/8) pkg/images/tv/cv/iisers.x This has a statement "andi (ERASE, 0177777B)". The original statement used and() and had problems with integer overflow in a compile time constant expression. The problem resurfaced again on AOS/IRAF due to andi() being defined onto an AOS intrinsic function in iraf.h. The workaround solution is to NOT define the type specific functions onto host intrinsics. ANDI is an ordinary external function; if I wanted an intrinsic I would have used AND instead. (11/8) unix/boot/spp/rpp/rpprat/defs unix/boot/spp/rpp/rppfor/* Increased the sizes of a number of buffers in RPP as we have managed to overflow storage recently, and it is all paged anyway. Regenerated the Fortran sources in rpp/rppfor. (11/13) sys/libc/isatty.c sys/etc/isatty.x + unix/hlib/libc/xnames.h The isatty() routine in LIBC had a builtin assumption about how external function entry point addresses are passed hence was not portable. Fixed by doing the test with a new VOS isatty() routine in ETC, which is called by the LIBC routine. (11/14) sys/osb/achtb.gc sys/osb/achtzb.gc In these functions the SPP arrays containing packed unsigned bytes were being declared as unsigned byte, which is not correct for SPP. Changed the argument declarations to XCHAR and added type coercion internally to coerce the loop pointers to unsigned byte. (11/14) sys/etc/urand.x - sys/osb/urand.x + lib/libsys.a [DELETE OBJECT FILE] sys/osb/mkpkg Fixed a (evidently harmless) bug in urand and moved the routine from ETC to OSB since it is based on integer overflow during multiplication and hence will not work on all machines. Added some $iffiles to the mkpkg to permit machdep versions in AS. (11/14) sys/tty/ttygets.x sys/fio/zfiott.x pkg/cl/edcap.c Changed those routines which interpret control codes represented as `^X' to compute the binary value of the control code by masking the lower 5 bits, rather than by subtracting a base value. This allows a ctrl/c, for example, to be represented as either ^C or ^c. (11/15) sys/osb/shift.c + sys/osb/mkpkg unix/hlib/libc/knames.h Added a set of bit shift operators to OSB. In many cases multiplying or dividing by a power of two will be preferable, but a multiply can result in integer overflow in which case the left shift operator must be used instead. Also, for large shifts it is more convenient to shift by so-many bits than to try to figure out which power of two to use, so clearly the VOS should have a set of shift operators to go along with the and/or/not primitives. The shift operators are semantically equivalent to the << and >> operators of C; they do not perform the same as the NCAR ishift primitive. (11/15) sys/gio/sgikern/sgk.x Modified to use SHIFTI rather than (2 ** N) to initialize the bit-flip bit mask array, to avoid the integer overflow which occurs on some machines (DG) when the arithmetic technique is used. I would expect that a bitwise instruction should be immune from arithmetic exceptions, but there is no way to be certain. (11/15) NOTE -- The entry for 8/19 in the AOS/IRAF notesfile appears to list some files which were not mentioned by name earlier in the notesfile. If a file revision is not explicitly mentioned in the notes file, it will not be merged into the master system. pkg/cl/*.c Reviewed all the buffers dimensioned SZ_FNAME and increased a number of them to size SZ_PATHNAME to reduce the chance of a buffer overflow. (11/15) sys/fmtio/parg.x There were a number of cases in pargg() where the double value was being coerced to int or long without first checking for INDEF. (11/15) sys/memio/realloc.x Now copies the nelems and dtype arguments into local variables before reallocating the block of memory, in case the arguments are stored in the block of memory being reallocated. (11/15) sys/etc/maideh.x Moved the next_handler assignment to before the switch statement, as it was unreachable due to an implied return in the switch. (11/15) sys/fio/zfiott.x Modified to render nulls (used for null padding to generate delays) as ^@ rather than \000, to save space in ttyio or ttyout log files. (11/15) sys/gio/cursor/gtrwaitp.x Was not reactivating the workstation, e.g., after the user would respond to the "more help" query with a `q'. This could result in a cursor read without the workstation being reactivated, which would put the terminal in graphics mode, but then the next deactivate workstation would be a no-op since the workstation was never explicitly reactivated, causing text to be output in graphics mode and lost. (11/15) unix/boot/generic/generic.c In main(), nfiles was not being initialized to zero. (11/15) dev/null Removed file protection from the dev$null dummy file; this is done with a link in UNIX/IRAF and will be messed up when the directory is moved to another host os. (11/15) lib/lib*.a Ran `lorder | tsort' on all the libraries. Found two circular references in libex.a (see below). (11/15) sys/gio/gadraw.x sys/gio/gplcancel.x + sys/gio/gplreset.x + sys/gio/gplcache.x + sys/gio/gplstype.x + Unpacked all the gpl_ (polyline cache) subroutines in gadraw.x into separate files to avoid a tsort cycle. (11/15) sys/imio/imrename.x sys/imio/imdelete.x sys/imio/imcopy.x sys/imio/imaccess.x sys/imio/immapz.x + sys/imio/immap.x sys/imio/iki/ikiopen.x [1] Fixed a tsort-cycle bug oif_rename -> immap -> iki_open -> iki_init -> oif_rename. This was done by removing the call to iki_init from iki_open, adding a call to iki_init to immap, and breaking immap up into a user procedure immap and an internal procedure immapz. Now oif_rename, which is actually quite a high level procedure, can call immapz without a circular reference. Added a call to iki_init() to imrename, imdelete, imcopy, and imaccess, just to be doubly safe, although it is not necessary. (11/15) ----------------------- (end AOS/IRAF merge) ----------------------- (begin fixing all bugs and minor feature additions reported/requested in (the past several months.) lib/lib*.a As an experiment, tried reordering the object modules in the IRAF libraries in topological order, to see if it would speed up linking. It did, somewhat, although of course it took forever to reorder the larger libraries. Results (cd cl; time mkpkg): unordered: 56.5 14.8 1:32 1001+112io ordered: 44.2 11.7 1:09 684+114io Guess it was worthwhile. Here is the csh reorder script for Berkeley UNIX (`reorder libXX.a'): ar xo $1 rm __.SYMDEF ar cq _lib.a `lorder *.o | tsort` rm *.o ranlib _lib.a mv -f _lib.a $1 Did not try linking without a library symbol table. Still need to optimize the UNIX ld program for maximum linker speed. (11/15) sys/etc/pagefiles.x Modified to print an error message without changing the position within the file if a pattern search fails, rather than position to the end of file as previously. Also found and fixed a bug introduced when the long-line code was added, which was causing the %done to be computed incorrectly. (11/16) /bin/ld I have been planning for a long time to optimize the UNIX linker, which is inefficient for large libraries such as IRAF uses. This is less important in 4.3BSD as the linker had already been optimized for this latest release of Berkeley UNIX, but I was still able to speed it up by another 20-30 percent by optimizing the code which reads the symbol table. With this improvement, the timings for a CL link are as follows: ordered, opt: 33.1 11.4 1:00 671+119io This is for a VAX 11/750. For comparison, the time for our 8600 is 1:34 (clock), i.e., UNIX running on a 750 is faster than the VMS 8600, once again! (11/16) sys/fmtio/evexpr.y pkg/images/imutil/hedit.x Fixed a couple of bugs that have been reported in HEDIT. The principal one was due to real input tokens being returned by the lexical analyzer in EVEXPR with a real value but an integer datatype. This would produce what would appear to be garbage results - a large integer number. Also added some additional type checking to xev_binop, and modified HEDIT to eliminate whitespace at either end of the value expression. (11/16) sys/etc/main.x The IRAF main command interpreter now recognizes the argument syntax `@fname', causing a set of param=value assignments to be read from the named file. These should be one assignment statement per line, in the form param = value param = value ... Blank lines and comment lines are ignored. This feature is used to save typing, e.g., when testing programs which have a lot of parameters. Multiple @fname arguments may be given, e.g., if the task has multiple named psets, and they may be mixed with any of the other constructs on the command line. For example, an explicit assignment may follow an @fname to change the value of one of the parameters set in the file, e.g., `plot @_plot title="abc"'. (11/17) sys/gio/cursor/rcursor.x Changed the 'S' key to 'W' (fix wcs), to agree with the documentation and the list of recognized keystrokes defined in grc.h. (11/17) dev/termcap Added an entry for the SUN console. (11/18) sys/fmtio/evexpr.y The lexical analyzer would accept `=' as an ordinary character within a string constant, causing boolean expressions such as `param==value' to be treated as strings, causing a `parameter not found' error message in HSELECT. (11/21) pkg/cl/exec.c sys/etc/main.x In another HSELECT bug, command line arguments such as '@"m-flag" ...' would result in a syntax error from the IRAF main. This was due to the parameter cacheing code in exec.c, which would quote the value string of string valued parameters by simply enclosing the string in double quotes. The defective routine was modified to escape any double quote characters included in the string as data. The code in the IRAF main which extracts a string was modified to recognize such escapes and convert them back into data characters. (11/21) pkg/cl/history.c pkg/cl/eparam.c EHISTORY had trouble dealing with abbreviations other than `ehi', as the latter turned out to be wired into the original edit_history_ directive code. I modified the code so that "ehistory"<whitespace> is functionally equivalent to `^'. The command `ehistory' is special in that any abbreviation is accepted, including `e'. Thus, ehistory meta e ^ # edit last command e 3 ^3 # edit command number 3 e xc ^xc # edit last command beg. with `xc' e ?p ^?mkp # edit last command containing `mkp' and so on. (11/21) pkg/cl/history.c In testing EHISTORY, found and fixed another minor bug. If the entire command were deleted a newline token would be returned to the parser, causing a syntax error since the history code is assumed to filter out blank lines in the input. Modified to get another command line if the command line being edited is deleted. (11/21) pkg/cl/param.c pkg/cl/param.h Indirection to the package pfile, e.g., ")_.param" would go to the current package rather than to the package to which the task associated with the referenced pfile belongs. Fixed this, and also modified the code to accept ").param" as an alternative to ")_.param": the latter conveys no more information than the former; both imply a reference to the package pfile. (11/21) sys/imio/oif/oifrename.x The oif_rename operator would open the image header, change the name of the pixel file therein, update and close the image header, and then rename the header and pixel files. If the header or pixel file rename then failed (e.g., due the disk being full) the header would be left no longer pointing to the pixel file. Modified to only update and rename the header file if the pixel file can be successfully renamed. Even if the header rename then fails, the header will still be pointing to the pixel file. (11/21) lib/fio.h lib/syserr.h lib/syserrmsg sys/fio/filopn.x sys/fio/finit.x sys/fio/fgetfd.x sys/fio/open.x sys/imio/iki/oif/oifopix.x sys/imio/iki/oif/oifrename.x unix/hlib/iraf.h Modified the OIF image kernel to use the static file driver. This was done by adding support for the STATIC_FILE file type to FIO, and then merely changing the file type from BINARY_FILE to STATIC_FILE when opening a preallocated pixel file in the OIF kernel. The static file driver is now loaded during FIO initialization and is recognized as a standard file type, although it is expected to be rarely used. In UNIX/IRAF the static file driver is currently just mapped onto the binary file driver, so this change is relatively safe. In VMS/IRAF there is a separate driver, but currently it is also mapped into RMS calls like the binary file driver, rather than using mapped sections. The SUN also uses the binary file driver currently, but this will change sometime soon. (11/21) NOTE -- Did not install the static file driver in the STF kernel; will hold off on this until it is well tested via the OIF kernel. vms/os/zfacss.c vms/os/zfinfo.c If a file cannot be opened but it exists and posesses the necessary permissions, FIO will issue the `waiting for access' message and wait for the file to become accessible. This situation would occur mistakenly in VMS/IRAF when trying to open a file template as a file, e.g., "file*". ZFACSS was calling SYS$PARSE with the template, and RMS would expand the template, but the subsequent RMS file open on the template would of course fail. Modifed ZFACSS and ZFINFO to check for the * character in the input filename, and return NO or ERR if it is found. Programs which are passed a file template operand but which are not set up for a template should now respond with cannot open file (filename) rather than waiting for access to file (filename) UNIX does not permit templates at the kernel level, so this was not a problem there. (11/22) pkg/cl/builtin.c The CL checks to see if any devices are still allocated at logout time, and prints an error message if all previously allocated devices have not been deallocated. Formerly the CL would rely entirely upon its internal table of allocated devices to determine if a device was still allocated. This seemed reasonable since the allocate and deallocate functions are now CL builtins, but the user could fool the system by running deallocate in the background, or by deallocating the drive at the host system level. The code was modified to physically verify that previously allocated devices are still physically allocated at logout time, clearing the entry for a device from the internal device table if that device has since been deallocated by another process. (11/22) unix/os/alloc.c Now checks to see if the effective user id is 0 (root), printing a message telling the installer what command to enter to fix the problem, and returning an error code to the calling program. This frequently happens after a bootstrap when one relinks alloc.e but then forgets to reset the uid, which is changed to the user uid by the bootstrap. This should happen less often now in any case, since the alloc.e executable is now produced as the first step of a bootstrap, allowing the user to go in and change the uid a few seconds after starting the bootstrap, before they forget to do so. (11/22) unix/os/zalloc.c In ZDVALL, the status of ZOSCMD, and hence alloc.e, was not being returned due to multiple indirection on the `status' variable. (11/22) sys/etc/xalloc.x sys/mtio/mtdealloc.x In xdeallocate() an invalid test of the status value returned by ZDVOWN was preventing rewinding of tape devices. I also changed the datatype of the `rewind' arguments from bool to integer, since we try to avoid the use of boolean outside a function. (11/22) sys/imio/iki/ikiparse.x Occasionally, operations involving 3 digit numeric pseudo-extensions in the image name would fail, e.g., cl> imcopy pix.002[*,100] pix.002 The typical symptom was that the .002 would be missing from the output image name. This turned out to be due to a bug in the iki_parse routine, which decides whether the .002 is part of the image name or an image filename extension. This was a fairly nasty bug - the pattern for the string match could not be extracted correctly - I am a little surprised that we have not had more problems. Part of the reason it was not more serious was that the field would immediately be assumed to be part of the root image name unless it were exactly 3 characters long, i.e., the same length as ".imh". (11/22) sys/gio/sgikern/sgk.x A bug was fixed which was preventing points (zero length vectors) from being plotted. (11/23) pkg/cl/builtin.c The call to c_ttyodes to open the termcap database for the CLEAR builtin was not error checking the returned value. (11/23) sys/etc/miireadc.x The second call to read() was reading `nchars' chars when it should have been reading `pksize' chars, i.e., it would read twice as much data as it should since the chars are stored externally in bytes. (11/23) pkg/cl/decl.c Modified do_option() to permit { length = N } in string declarations, as well as { len = N } as previously. The manual pages use the full term `length', but this was not being accepted by the actual CL code. The correct usage is `length' in accord with the `p_length' used in expressions. (11/23) vms/boot/spp/xc.c Added file existence checks as per 20 August ST mail. (11/23) unix/boot/rtar/rtar.c unix/boot/rtar/rtar.hlp vms/boot/rtar/rtar.c vms/boot/rtar/rtar.hlp Added a new switch `-p pathprefix' to the RTAR program. This is used to relocated files to a different directory than that specified in the archive, e.g., when the user has written an archive tape with absolute pathnames on it, in which case something like this is required to be able to read the tape at all. For example, if the archive `ldx.arc' contains the files /u2/jones/ldx/_new /u2/jones/ldx/ld.c /u2/jones/ldx/ld.o then the command rtar -p /u2/jones/ -xrtvf ldx.arc will create the subdirectory `ldx' and the files ldx/_new ldx/ld.c ldx/ld.o The option should also be useful for extracting deeply nested subdirectories without creating a path of empty directories leading to the directory of interest. (11/23) sys/fio/mkpkg sys/fio/access.x sys/fio/vfntrans.x sys/fio/nowhite.x sys/fio/open.x There was a report of the following error message from someone at ST: OPEN: File does not exist Naturally, the complaint was that the file was not named. This message is generated by FIO, which always includes the filename in the error message, but the error formatting code (syserrs) will omit the "(fname)" field if FNAME is the null string, hence the defective filename must have been the null string. To avoid this sort of thing we have to verify input filenames, checking for the null string. We also need to strip whitespace at either end of the filename, but we need to do that anyway to check for the null or blank filenames. To try to address this problem I [1] added the file nowhite.x, which returns the input string minus any whitespace, and [2] modified access, open, and vfntrans (fmapfn etc.) to call NOWHITE and take an error exit if the null string is input. FIO should now detect the null string filename and ignore any whitespace in a filename, not only at the beginning but also at the end or anywhere else in the filename string. (11/23) IMPORTANT NOTE -- The filename translation code will no longer permit null string filenames, a significant semantic difference which may break some programs. sys/imio/iki/stf/stfopen.x When opening a new image and IM_HDRFILE is the null file (dev$null), will no longer call fmkcopy to try to create a new header file. (11/23) vms/hlib/mkiraf.com The script will now force the terminal name string entered by the user to lower case before generating the LOGIN.CL file. (11/23) vms/os/str.s The comments describing the calling sequences for _strpak and _strupk where missing the third argument, `&maxch'. (11/23) vms/os/zfiopr.c In the call to _strupk in _log_ipc(), the third argument `&nchars' was missing. (11/23) vms/os/zfsubd.c The case ../ when at the root VMS directory DISK:[000000] was not working properly, the returned path would be DISK:000000]FILE due to a pointer problem. (11/23) sys/fio/fpathname.x sys/etc/oscmd.x Had to add code to deal with the special case of a null string filename, to avoid the error checking introduced into the filename translation code above. It is a nusiance to be introducing bugs into the system with this mod, but I think the benefits of runtime checking for null filenames will be worth it. (11/23) pkg/cl/exec.c In restor(), added some code to go through each loaded pfile and lop off any parameters defined above the new topd. This can happen when a declaration is entered to add a parameter to an existing loaded pfile. (11/24) pkg/plot/plot.cl Removed the reference to the IMAGES package. The new prow, pcol, etc. no longer use _imaxes. (11/24) sys/gio/stdgraph/stgpl.x sys/gio/stdgraph/stgpm.x There was a bug in the stdgraph kernel which would occasionally prevent line segments from being drawn (or erased). This was due to the unresolved point clipping code used in these routines. The last point drawn in one polyline or polymarker was being remembered and used for clipping when drawing the first point of the next polyline or polymarker. This would fail when drawing two two-point polylines where the first points (move to) were different but the second points (draw to) were the same, or when redrawing a two-point polyline in a different line style, i.e., to clear the polyline. The solution was to clip unresolved points only in the interior of the polyline or polymarker being drawn; the "last x,y" variables are cleared before entering the drawing loop. This fixes the cursor mode bug where several line segments are drawn with the D key, and then erased interactively with the B or U keys. (11/24) unix/boot/mkpkg/tok.c vms/boot/mkpkg/tok.c In do_osescape, changed the expression (ch = '(' ? ')' : ch) to (ch == '(' ? ')' : ch). This bug would cause the OS command to be extracted with the wrong delimiter character in some cases. (11/24) vms/os/vms.h Changed the value of MAXCPROC (the maximum number of connected subprocesses) from 4 to 10, to be the same as in the VOS. This was artificially limiting the maximum number of possible connected subprocesses on a VMS/IRAF system to 4, and was undoubtedly responsible for some of the process spawn failures we have seen in the past, especially when increasing the size of the process cache, e.g., to run a complex script. It has not been a serious problem since we normally run with a 3 process process-cache with space left over for one GIO subkernel. (11/24) unix/boot/mkpkg/tok.c vms/boot/mkpkg/tok.c Given mkpkg file as follows: $call test $exit test: $ifdef (...) $ifeq () ... $end $set STUFF = "..." $echo " $(STUFF) " ; If called as `mkpkg', would work. If called as `mkpkg test', prints error message "macro STUFF not found". This was happening becasue the do_end() code (the $end directive) was a no-op if called from within the main file, i.e., when there was no context pushed onto the mkpkg context stack by a $call, $update, etc. A `mkpkg test' is not the same as a $call because it is a simple goto and no new context is entered. The error message would be printed because the $set is not executed if found in the false part of a $if sequence. The $end directive now zeros the if-stack if called from the main file context, else restores the if-stack to the value it had when the current context was entered. (11/24) vms/os/zgtenv.c Changed ev_cacheloaded and ev_table to static variables. This was necessary to permit generation of a shareable image of the SDAS libraries (which use CLIO). (11/24) pkg/cl/opcodes.c pkg/cl/debug.c pkg/cl/compile.c pkg/cl/opcodes.h pkg/cl/grammar.l pkg/cl/grammar.y Added the operator //=, since it is described in the documentation, is useful, and is required for completeness (although I don't think there is a **= either). (11/24) pkg/bench/bench.hlp Updated the documented root pathname for the BENCH package, which is now "pkg$bench/". (11/24) sys/gio/glabax/glbsview.x If there were no ticklabels, axis labels, or plot title, the routine would use the full device viewport without taking the desired aspect ratio into account. A viewport with the desired aspect ratio should now be generated regardless of the values of the other options (unless the viewport is set explicitly by the user). (11/25) lib/gio.h sys/gio/gplstype.x sys/gio/gpmark.x sys/gio/gpl.com sys/gio/gadraw.x Polymarkers are currently drawn using the clipping code in gadraw. This was fine for large markers since these are drawn as a series of line segments, but for point polymarkers the line segment clipping code used by GADRAW was inappropriate. This code will add a point at the boundary of the viewport when clipping a line segment that crosses the boundary, so that the part of the line which is visible is drawn. When plotting points, one gets an extra point at the boundary, however, which is not correct. Added some extra logic to the clipping code to omit the fancy clipping when drawing pointmode polymarkers. (11/25) sys/gio/cursor/gtrwstran.x The clipping logic in the cursor mode workstation transformation code had the same problem with clipping point mode polymarkers as did gadraw. (11/25) pkg/cl/modes.c The UKEY code was modified to deal with stty playback mode in a way similar to that provided for the cursor code. In playback mode with verify enabled, after reading the logged UKEY response, the string " [key=X]" is printed and a keystroke is read from the terminal in raw mode, i.e., space to continue, q or ctrl/c to quit, or g to continue with verify disabled. (11/25) pkg/cl/history.c Whenever a CL prompt is generated, the CL now checks to see if raw mode is in effect on STDIN and clears it if so. This ensures that raw mode is cleared following a program abort. (11/25) vms/os/net/zfioks.c vms/os/net/kutil.c vms/os/tranlog.c Added a pair of delete logical name primitives to tranlog.c. One of these is used in ZFIOKS (the network device driver) to delete the cached logical name if the connection attempt fails, e.g., because the user entered an invalid password. If this were not done it would be necessary to logout (or enter a DCL command) to recover from the invalid password entry. If the connection fails and the password was entered interactively, the user is given a chance to reenter the password without leaving the kernel. (11/25) [networking and default directories] This is to clarify a bug report regarding the default directory for network accesses. In a reference `node!dir' the file `dir' could be either a subdirectory or a logical directory. Currently, the default directory of the kernel server on the remote node defaults to the user's login directory on that node, and is not affected by change directories on the local node. Hence, if `dir' is a subdirectory of the user's root directory, the usual search mechanism will reference the subdirectory rather than any logical directory of the same name. This did not use to work as expected (hence the bug report), but was fixed by a modification to the kernel server some time back. (11/25) pkg/cl/config.h Increased the stack and dictionary sizes, i.e., stack: 8000 -> 20000 dict : 30000 -> 40000 This is all paged memory on most systems, hence there is little reason to worry about the static size of the array. (11/25) sys/etc/pagefiles.x Fixed a bug in the ":f fname" file-positioning command, which would cause it to position to the wrong file in some cases. (11/26) sys/fio/zfiott.x In stty playback mode, the ZFIOTT terminal driver was not dealing with the case of an EOF on the STDIN stream, when reading from the terminal. It now returns and EOF indication (nchars=0) to the calling program, and prints "[EOF]" on the terminal. (11/26) unix/boot/spp/xc.hlp vms/boot/spp/xc.hlp Updated the XC manual page. Added -d, -v, -m to the list, and modified to reflect the recent switch to optimization by default. Recall that the new switch to defeat optimization is -q. The -O switch is still recognized. The principle reason for making optimization the default was to avoid the need to use a case sensitive switch. (11/26) unix/boot/mkpkg/main.c vms/boot/mkpkg/main.c Modified the way the mkpkg argument list is parsed, to be a bit more permissive on the grouping of single character switches behind a single `-'. Previously, mkpkg -nd -f stdin would work, while mkpkg -ndf stdin would not. Now, both will work, and even combinations like mkpkg -dfn stdin where it is understood that the embedded -f uses the next token. Processing will continue following the `stdin' argument. (11/26) pkg/utilities/utilities.cl pkg/system/system.cl pkg/softools/softools.cl pkg/plot/plot.cl pkg/images/images.cl Deleted the SET declarations for the package logical directories in all these scripts. These directories are already defined in hlib$zzsetenv.def, hence redefining them in the package script tasks is unnecessary, and prevents one from redefining the package directory before loading the package, to permit use of a private version of the package. (11/26) noao/imred/imred.cl noao/astutil/astutil.cl Also deleted the SET declarations from these package script tasks. The package logical directories are defined when the NOAO package is loaded. (11/26) sys/gio/cursor/mkpkg sys/gio/cursor/rcursor.x sys/gio/cursor/gtrgtty.x + If the HJKL keys were used to attempt to position the cursor on a terminal that did not support the write cursor (WC) capability, the software position would be updated as if the cursor had moved, which of course it wouldn't if the terminal did not support write cursor. Added a new function gtr_gtty() to return the graphcap descriptor for a cursor mode stream, and modified the cursor read loop in rcursor() to use this plus ttygetb() to test if the WC capability exists before updating the cursor position in software. (11/26) sys/tty/ttysubi.x sys/tty/ttygoto.x This is the cursor positioning code for terminals. The case %+C was not being handled correctly in all cases. It would work for printable characters, but when (X|Y)+C was a control code the formatting code being used would output it as \NNN. Moved the case `%+' to the code which handles case `%.', which should fix the problem. Also replaced the ttyputs() calls in ttygoto() by calls to ttywrite(), in case the output string contains any embedded nulls. When testing this on a terminal that uses control code adressing (e.g., 0-23 binary), note that if a control code is generated which is special to the driver (e.g., LF) the TTY code will position to a point near the desired location, and then use character level positioning to move the rest of the way in. The reserved tty driver chars are defined in file tty$tty.h. (11/26) sys/imfort/imfort.h sys/imfort/imcrex.x sys/imfort/imemsg.x sys/imfort/doc/imcrex.hlp Added code to verify the `naxis', `axlen[]', and `pixtype' input arguments to IMCREX (the create image operator). (11/26) vms/boot/bootlib/dcl.c vms/os/zoscmd.c Added a call to _zerror() to print an informative VMS error message if the DCL spawn fails or a mailbox create fails. This can happen easily if the user account has insufficient quota, and without a specific VMS error message it is almost impossible for the user to figure out what is going on. (11/26) sys/gio/wcstogki.x Added clipping of the transformed coordinates to the range zero to GKI_MAXNDC. The input world coordinates could be anything, potentially causing the transformed GKI coordinates to fall outside of the 16 bit GKI space, causing integer overflow or truncation errors when the coordinates are eventually converted to integer. (11/26) sys/fio/zfiott.x Previously, if the user typed `stty playback' while in `stty login' mode (recording the input keystrokes), playback mode would actually be started with input logging still in effect. Usually the login file would still be in a file output buffer and the actual file would be zero length. Playback would reopen the file and immediately see EOF, terminating playback mode. The `stty playback' command would be logged, however, causing a loop when the login file was later played back. This is what would happen on UNIX; on most other systems a file open error would result, due to trying to reopen a file already opened for writing by someone else. I decided the loop "feature" makes sense and might actually be useful for exhaustively testing software or hardware. If one wants to terminate login mode and enter playback mode that is already possible. Hence, the terminal driver was modified to log but not execute the playback command, if entered during `stty login' mode. A message is printed to warn the user that something out of the ordinary has occurred. (11/26) sys/imfort/imfparse.x Had the same bug as sys/imio/iki/ikiparse.x, which could cause non-filename extension dot delimited fields to occasionally be stripped from the output image name. (11/26) sys/imfort/imcrex.x The image header field IM_HDRFILE was not being set to the header file pathname before calling imf_gpixfname to generate the pixel file name. This would cause the pixel file to always be created in the current directory, which was fine unless the image header file was created in a directory other than the default. (11/26) pkg/system/help/nomore.x - Deleted this obsolete file, no longer used. (11/27) sys/clio/clgkey.x The maxch argument was not being used, allowing the output string to be overrun. This would happen when responding to the HELP prompt with a : command, since the HELP code does not use any colon commands, and hence calls clgkey() with a very small maxch. (11/27) sys/clio/clgcur.x A check of the clgcur() cursor read routine, from which the clgkey() code was derived, revealed that maxch checking was not being performed here, either. This is the original bug, inherited by clgkey, which was added later. (11/27) sys/etc/prupdate.x Added some parenthesis to a boolean expression to ensure that it will be evaluated as desired (just insurance, not a bug). (11/27) sys/etc/sttyco.x The new STTY task would set the terminal environment variables in the CL process, but the new values were not being propagated to child processes. Added calls to prenvset() to set the environment variables both in the parent and in all connected child processes. (11/27) sys/etc/envreset.x + # new function sys/etc/environ.x # modified to allocate more storage sys/etc/environ.h # added one field to list element struct sys/etc/mkpkg Added a new function ENVRESET to the environment list package. The new function is used to update, in place, the value of an environment variable when one wants to permanently change the value. To keep it simple and minimize changes to the package this was done by always allocating at least a minimum amount of storage for the value string when a new environment variable is defined. Currently, space is allocated for at least 20 chars; this is more than twice as long as any of the device names currently used on our development system. If the new string won't fit ENVRESET will silently call ENVPUTS to redefine the variable instead. A large amount of storage can be allocated for a variable by the simple expedient of defining it initially with a dummy value longer than the largest real value expected, and then "reseting" the actual value. sys/etc/sttyco.x The STTY terminal driver user interface was modified to use the new envreset function rather than redefining the device names and characteristics, since a redefinition is usually not what is desired in this case. sys/etc/envscan.x The ENVSCAN procedure is used by the IRAF main to initialize the environment list during process startup, as well as to handle SET statements received from the parent process during process execution via IPC, when new SET statements are issued in the CL. The environment mechanism has long had a defect in that while new SET statements are propagated to any connected child processes to temporarily redefine old variables, there was no mechanism for discarding temporary redefinitions in child processes when a CL context is popped (e.g., when exiting a package). As a first step in fixing this problem, ENVSCAN was modified to use ENVRESET rather than ENVPUTS. The idea is to have the CL reissue the SET statements for any uncovered redefinitions to all connected subprocesses when a CL context is popped. The master environment list in the CL will maintain all redefinitions (it already does), while the environment lists in the child processes will keep only the most recent value of each variable. This scheme seems simpler and more reliable than complicating the IPC mechanism so that it can deal with the full semantics of the environment mechanism, i.e., redefinitions, mark and free, and the new reset function. Another solution would be to flush the process cache when redefined values are uncovered, but that is too inefficient. (11/27) sys/imfort/imcrex.x The code used to generate the pixel file name would have had a problem with multiple . delimited fields. These are permissible on UNIX systems but not VMS systems (recall that IMFORT, being a low level interface, can deal only with host filenames, unlike the VOS interaces). The problem was such that, when creating an image named `pix.001', the header file would be named `pix.001.imh' but the pixel file would be named `pix.pix', due to the use of file rather than image operators to extract the root filename from `pix.001'. The new code will generate the pixel file name `pix.001.pix'. (11/27) sys/etc/environ.x Modified the calling sequence of the envfree() procedure as follows. Envfree() is used to discard recently defined or redefined environment variables following a prior call to envmark() to mark the top of the environment stack. old: nredefs = envfree (marker) new: nredefs = envfree (marker, userfcn) where `userfcn' is the integer zlocpr entry point address of a user supplied function to be called when a redefinition is uncovered. If `userfcn' is zero no function will be called. sys/etc/prenvfree.x + Added a new function PRENVFREE to facilitate updating the values of redefined environment variables uncovered in an envfree() operation in the specified connected subprocesses. The new function is equivalent to envfree() except that it updates the environment of the specified connected suprocesses as well as the current process. The calling sequence is: nredefs = prenvfree (pid, marker). sys/etc/zzdebug.x sys/libc/cenvmark.c sys/libc/cenvget.c These files contained calls to envfree() for which the calling sequences had to be modified. Also added an entry c_prenvfree() to the file cenvmark.c, and an entry c_envreset() to cenvget.c. (11/28) unix/hlib/libc/xnames.h Added entries for PRENVFREE and ENVRESET. (11/28) pkg/cl/builtin.c Added the new builtin task RESET. This is equivalent to SET except that it will (if possible) update the most recently defined value of the named environment variable in place, rather than adding a new definition or redefinition which could later be discarded. The only exception to this occurs when the new value string is too large to fit in the space allocated when the original variable was defined, in which case a new entry is added redefining the old one. In practice the update should virtually always be in place. If the new value string is 20 chars or less in length than the update is guaranteed to be in place (the 20 chars is of course a compile time variable and can be increased if necessary). Note that STTY automatically uses RESET to update the environment variables describing the terminal. A RESET in the CL will automatically be propagated to all child processes. (11/28) pkg/cl/exec.c The calls to c_envfree() and flprcache() in poptask() (called when a task terminates) were replaced by a single call to c_prenvfree(). This discards any redefinitions of environment variables made during the execution of a task, e.g., a package script task. New definitions are discarded in the CL but actually still exist in the subprocess environment tables, but this is harmless and is a hidden detail of how the environment mechansism is implemented which may safely be ignored. (11/28) unix/hlib/login.cl Replaced the `set terminal = U_TERM' entry by a call to STTY. This is necessary to pick up the correct ncols/nlines values from the termcap entry for the device. The new STTY is very fast provided the termcap entries for the terminals in common use at a site are cached with MKTTY. (11/28) sys/ki/kiopenks.x sys/ki/kienvreset.x + sys/ki/irafks.x Added a new function KI_ENVRESET, to be used to update environment variables piecemeal on call the connected kernel servers serving a given client process. This is done using the ENVINIT network function, which is also used by ki_openks() to transmit the entire initial environment set when a server is first connected. To provide reasonable efficiency for single variable updates, the kernel server (irafks.x) was modified to eliminate the status return for ENVINIT when used for single variable updates. This makes it possible to pipeline a number of ki_envreset() packets without waiting for the server to process them and respond. A status packet is still used when the full environment list is transmitted initially, mostly because if I eliminated it now then old versions of IRAF would deadlock when trying to talk to >V2.5 kernel servers. In the process of making these mods I noticed and fixed the following: in kiopenks.x, the environment value strings were not being quoted, which would have caused value strings containing whitespace to be truncated in the server. sys/etc/environ.x sys/etc/envreset.x Modified the envputs() and envreset() functions to call ki_envreset() to update the environment in any connected kernel servers if the environment list of the client process is modified. With these last two changes, the environment list will now be kept up to date at all times in all the processes in a process tree, including any kernel server processes on remote nodes in the network. All of the processes in a process tree (with either an interactive or bkg CL at the root) share the same environment list, with the exception of the three variables IRAF, HOST, and TMP, which are defined independently for each node. (11/28) unix/boot/spp/xc.c [XC, FC] Given the two files `file.e' and `file.f' in the current directory, the UNIX version of XC (or FC), when called accidentally as `xc file.e', would delete the file `file.f'! (fortunately, I discovered this and not some poor user). It turned out that the UNIX Fortran compiler f77 was the culprit; for some reason it likes to delete .f files when it sees a .e file in the file list, probably because it thinks the .e file is an EFL source file. The UNIX XC was modified to produce a fatal error and abort if a .e file is seen in the file list. (11/28) unix/boot/rmbin/rmbin.c vms/boot/rmbin/rmbin.c Commands such as rmbin -n -o .cl . would fail because the directory `.' was being taken to be one of the . prefixed filename extensions associated with the -o switch. (11/29) pkg/.../*.cl noao/.../*.cl unix/hlib/*.cl To all non-procedure CL scripts that use { } command grouping, added a #{ at the top of the script to force compute mode. (11/29) pkg/cl/lexicon.c Deleted the bracelevel test, formerly used to switch to compute mode inside curly braces. Command mode is now in effect everywhere except in procedures or within parenthesized expressions or argument lists, unless the #{ construct (or a lex=no assignment) is used to force compute mode. This should eliminate much of the confusion people have been experiencing regarding the two lexical modes. (11/29) pkg/system/cmdstr.x Increased the size of the output buffer from 1000 to 4096 and converted all character arrays from static to stack storage. (11/29) sys/etc/sttyco.x Modified the STTY program to look for the parameter `gd' in the termcap entry for a terminal when a new terminal type is set. This parameter, if given, is used to set a new value for the `stdgraph' environment variable, allowing everything to be set with a single call to the STTY command. If only the boolean capability is given, e.g., ":gd:", the stdgraph device name is assumed to be the same as the termcap device name, otherwise the stdgraph device name must be given, e.g., ":gd=4012:". If the `gd' capability is not defined stdgraph is set to "none". For example, if we set the terminal as follows: cl> stty vt100 and then enter the following command, the output shown will be generated: cl> implot dev$pix ERROR: Terminal does not support vector graphics Also added a call to TTYINIT to output the initialization sequence to the terminal when the terminal name is set. The initialization sequence, if given, is used to set the terminal to a known state, e.g., set the font and character size, the type of emulation to be used, disable reverse video, and so on. (11/29) sys/tty/ttyinit.x Rewrote this ancient code somewhat. The funny filename business is gone, it now simply opens the file named in the termcap entry, and of course the filename may be either an IRAF virtual filename or a host system pathname. The file open is error checked and a warning message printed if the file cannot be opened, and the file is now copied with the FCOPYO routine. (11/29) sys/gio/cursor/gtropenws.x When the open workstation command is first issued for a new device on a stream, this routine now checks for the special device name "none" and prints a message to the effect that the terminal does not support vector graphics, no stdimage devices are available, or whatever. Terminals which do not support vector graphics may either omit the `gd' capability from the termcap entry for the device, or set the capability to `:gd=none:'. If no standard image devices are available at a site, the system manager can set the value of `stdimage' to `none' in the hlib$zzsetenv.def file, to give the user an error message which is easier to understand than at present, if they should try to access the stream. (11/29) NOTE: the old termcap entries for graphics terminals should be modified to add the `gd' parameter to make things easy for the user. Alternatively, the value of the `stdgraph' environment variable must be reset after calling STTY to set the terminal type. dev/termcap [UNIX/IRAF] Added the :gd: capability to the entries for the more obvious graphics terminals. Deleted a sequence from the initialization sequence for the vt100 and vt220 which was moving the cursor to the lower left corner for some unexplained reason; all that it does now is disable the scrolling region, if any is set. Added an initialization sequence to the entry for the vt640 (vt100+retrographics) which sets vt100 mode and then resets the scrolling region. (11/29) dev/termcap The vt240/vt220 entries in the termcap file did not load when I tried to cache them - there was a reference to a nonexistent entry for the vt200. Deleted the vt200 series entries and replaced them by the versions in the UNIX /etc/termcap. (11/29) dev/cachet.dat Rebuilt the termcap cache to reflect the changes to the termcap file. (11/29) sys/etc/sttyco.x dev/termcap This terminal initialization stuff is just too obnoxious, given the initialization sequences given in the standard termcap file. Initialization is no longer performed by default, instead I added a new option `init' to STTY. The commands cl> stty init or cl> stty vt100 init # (for example) will cause the initialization sequence to be output to the terminal. Of course this can be indicated in the STTY command line in the LOGIN.CL file, if desired. Restored the goto to the termcap entries for the vt100 and vt200 classes of devices. (11/29) sys/gio/gopen.x Added code to check for the special device name "none", and to generate an error abort if a program attempts to open a graphics kernel on a stream which is connected to a nongraphics device or no device. (11/29) lib/fio.h sys/fio/fseti.x sys/gio/cursor/prpsio.x sys/fio/zfiott.x Added a RAWON escape sequence to go along with the RAWOFF already recognized by the IRAF terminal drivers. The length of both sequences is defined by LEN_RAWCMD, and the first character of the sequence is guaranteed to be ESC (escape), to permit rapid comparisons. FSETI was modified to transmit the RAWON sequence when raw mode in enabled, as well as transmitting the RAWOFF sequence when raw mode is disabled, which it has always done. The virtual terminal driver ZFIOTT was modified to recognize the new control sequence. This change was made to that raw mode can be enabled without having to read from the terminal, which is not possible if input is not expected. Raw mode is useful for output only (as when the terminal initialization sequence is issued) because output processing of tabs and newlines etc. is supposed to be disabled when raw mode is in effect. (11/29) sys/fio/ttyinit.x Modified to turn raw mode on while transmitting the terminal initialization string. (11/29) unix/hlib/libc/kernel.h unix/os/zfiotx.c Modified the UNIX OS terminal driver to recognize the new RAWON sequence. (11/29) vms/os/vms.h vms/os/zfioty.c Modified the VMS OS terminal driver to recognize the new RAWON sequence. The driver now also disables output processing during rawmode output, i.e., newlines are output as newlines and not mapped into CRLF. (11/29) unix/boot/spp/xpp/xppcode.c In the function hashtbl(), changed the MAX_KEY to MAX_KEY-1. This was evidently done on VMS/IRAF some time ago, but the change was never propagated to the UNIX/IRAF HSI (and evidently it has never caused any problems). (11/29) -------------------------------- (begin update of VMS/IRAF [IRAFX@USR$1] to V2.5) dev/termcap [both UNIX, VMS] Set up the printers like in the graphcap file, e.g., a system independent entry `ver' with tc= pointing to uver for UNIX and vver for VMS, and so on for each device. When new versions of the file are moved to VMS, one only has to go down a column and change a few `u's to `v's. (11/29) dev vms/... Merged in all recent changes into the VMS/IRAF HSI. These were mostly in hlib and hlib/libc (#{ changes, .pkg extensions, libc/*.h changes for new tt driver), and in XPP and RPP (larger buffers). (11/29) -------------------------------- (Did a full bootstrap of VMS/IRAF) (Deleted the entire contents of the doc,lib,math,noao,pkg,sys directories (on VMS/IRAf and replaced these by the V2.5 versions from lyra. Started up (a full sysgen to run overnight. 11/29) sys/etc/pagefiles.x Fixed a problem with files containing formfeeds; would not be able to advance beyond the formfeed in some cases due to interaction between seeks and pushback. (11/30) sys/tty/tty.h sys/tty/ttyodes.x sys/tty/ttyputl.x The ttyputline() procedure was modified to know how to deal with terminals that have an automatic right margin (the `am' capability of termcap). On these terminals when the last character on a line is written the terminal automatically advances to the next line, and the newline which normally ends a line must be omitted or the output will come out double spaced. On terminals without automargins, the line must be broken and an extra newline output, or the rest of the line will be lost. (11/30) ------------------------------- (VMS/IRAF did not come up on the first attempt...) pkg/cl/mkpkg The object opcodes.o must be explicitly linked on the command line on VMS, like globals.o (on AOS, only globals.o needs to be referenced on the command line). Modified the mkpkg file to link both objects explicitly and to maintain them in the package directory independently of the package library. (11/30) pkg/cl/clprintf.c pkg/cl/errs.c sys/libc/printf.c sys/libc/eprintf.c sys/libc/sprintf.c sys/libc/scanf.c The initial attempt to use <varargs.h> in the C files which deal with variable numbers of arguments was not quite correct. We have been setting things up as follows (for example): eprintf (fmtstr, va_alist) char *fmtstr; va_dcl { va_list argp; The correct usage is the following: eprintf (va_alist) va_dcl { va_list argp; char *fmtstr; va_start (argp) fmtstr = va_arg (argp, char *); Specifically, the va_alist must replace the entire argument list, not just a portion of it. The VMS implementation ignores the va_alist entirely and instead calls a library subroutine written in assembler to set argp to point to the first argument, regardless of where the va_alist appears in the function declaration. To be fair, it does appear from the UNIX specifications for <varargs.h> that the va_alist should denote the entire argument list. In each of the affected files, made the changes noted above, and also replaced the "#include <varargs.h>" by an "#define import_varargs" so that the HSI will have control over the varargs interface. (11/30) unix/hlib/libc/varargs.h + unix/hlib/libc/iraf.h Added an include file for varargs.h in hlib/libc. For UNIX, this just does a "#include <varargs.h>" to pick up the UNIX definitions. (11/30) vms/hlib/libc/varargs.h + vms/hlib/libc/iraf.h The VMS version of <varargs.h> uses a library function to implement the va_start() macro. I implemented this in macro and it works, but in studying the two interfaces there seem so reason not to use the simpler UNIX macros, thereby eliminating the dependence upon the quirky VMS/C interface. Hence, varargs.h is the UNIX file, i.e., it is the real thing, it does not do a #include. (11/30) pkg/cl/grammar.y pkg/cl/grammar.h pkg/cl/lexicon.c The lexmodes switch had to be taught about procedures. (12/1) sys/etc/isatty.x sys/libc/isatty.c unix/hlib/libc/xnames.h vms/hlib/libc/xnames.h Changed the name of the VOS ISATTY routine to XISATTY. Using the UNIX name was asking for trouble, and indeed it caused problems on VMS/IRAF, although in an unexpected way. The VOS name with no underscore mapped to `isatty', the LIBC and UNIX name. This would cause infinite recursion in the VMS version of IRAF. (12/1) -------------------------------------------------------------------------- SDAS installation, December 4, S.R., VMS (Draco!irafx, usr$1 only) vms/hlib/clpackage.cl Changed SDAS definition to point to sdasdisk:[sdas.sysiraf]sdas.cl. (12/4) vms/hlib/zzsetenv.def Added definition for "sdasx". (12/4) vms/hlib/clpackage.hd Added SDAS help file pointers. (12/4) mkhelpdb (vms) Ran softools.mkhelpdb to pick up SDAS stuff. (12/4) vms/hlib/mkpkg.inc Added $include for SDAS macros. (12/4) vms/hlib/stripper Changed "math -all" to "math -allbut .hd" for SDAS inst. (12/4) ---------------------- dev/termcap Merged in entry for the Sun apple laserwriter (printer), and added host printer entries for the Sun. (12/18) sys/fio/zfiott.x Increased the maximum size of a playback record from 1024 to 4096. The buffer is dynamically allocated and only used during playback mode. (12/19) sys/memio/begmem.x Replaced the "text_size" output parameter, formerly returned by BEGMEM, by a "max_size" parameter. The new parameter gives the hard limit on the amount of physical memory available to a process at runtime, taking into account the dynamic working set adjustment facilities available on many systems. A process which exceeds its allocated working set but not its hard limit can be expected to page some or heavily depending upon system load; if the hard limit is exceeded it will either page heavily or malloc will fail. (12/22) unix/os/zawset.c unix/hlib/libc/kernel.h Rewrote the ZAWSET code to use the 4.2BSD+ set/getrlimit facilities rather than the obsolete 4.1BSD vlimit. Increased the default advisory working set to 500K. There does not appear to be any reliable way to determine the physical memory size in 4.XBSD UNIX, so the kernel parameter SZ_MAXWORKSET is used to set an upper limit on the value of the "max_size" parameter returned by BEGMEM. (12/22) vms/os/zawset.c Replaced the text_size parameter by max_size (WSEXTENT). (12/22) sys/imio/imsetr.x sys/imio/imunmap.x sys/imio/imrmbufs.x + lib/imset.h Added a new imset option IM_CANCEL, the function of which is to free up all pixel data buffers previously allocated when i/o was done on an image. This is occasionally useful when very large buffers (e.g., large subrasters) are accessed by a program. (12/22) pkg/system/help/houtput.x The HELP program would leave the last line or two on the screen empty when paging through a manual page (this was especially evident on a workstation since the window boundary is so clearly defined). Modified so that each screen is filled. Will also pick up changes to the number of lines per screen (ttynlines) as soon as the value of the environment variable is changed, e.g., in an stty call. (12/24) pkg/system/help/t_help.x Now checks the create date on the help database file every time HELP is run, and re-reads the database if a new database has been created and installed. This should eliminate the need to flush x_system.e from the process cache when mkhelpdb is run. (12/24) sys/vops/amed.gx This routine calls ASOK to compute the median of a vector in the general case of npix>3. Since the ASOK routine partially sorts the input vector in place, this would result in AMED also sorting the input vector, which is probably not what the user expects. Accordingly, AMED was modified to copy the input data vector into an internal salloc-ed temporary buffer so that it no longer modifies the input vector. If the slight inefficiency introduced by this modification is unacceptable the ASOK routine should be called directly instead. (1/8) dev/termcap dev/graphcap The entry for the calcomp was modified to give the calcomp a standard landscape mode aspect ratio like everything else. (1/9) dev/termcap dev/graphcap Added new entries gterm,gterm40,gterm34,gterm24 for the GTERM virtual graphics terminal running on a Sun workstation. These are currently identical to the "sun" entries with the addition of a "gd=gterm" capability indicating that the terminal supports graphics. (1/10) dev/cacheg.dat dev/cachet.dat The termcap and graphcap entries for the GTERM Sun virtual graphics terminal were added to the cache. (1/10) sys/gio/stdgraph/mkpkg sys/gio/stdgraph/stdgraph.com sys/gio/stdgraph/stgactive.x + sys/gio/stdgraph/stgctrl.x sys/gio/stdgraph/stgdeact.x sys/gio/stdgraph/stgdraw.x sys/gio/stdgraph/stgmove.x sys/gio/stdgraph/stgopen.x sys/gio/stdgraph/stgoutput.x sys/gio/stdgraph/stgpcell.x sys/gio/stdgraph/stgpl.x sys/gio/stdgraph/stgpm.x sys/gio/stdgraph/stgrcur.x sys/gio/stdgraph/stgreact.x sys/gio/stdgraph/stgreset.x sys/gio/stdgraph/stgtx.x The stdgraph kernel was modified to eliminate unnecessary deactivate workstation calls. When writing to an dual frame, either/or terminal like Sun/GTERM, the deactivate workstation directive may cause the graphics frame to be turned off and the text frame turned on. If the next thing that happens is that the graphics is turned back on, this is a great waste of time and if one of the frames is not retained its contents are lost. The nature of the modification was to cause the deactivate workstation call to set a flag. If the next command received by the kernel is a i/o command the deactivate workstation control sequence is issued to the terminal and the flag is cleared. If the next command received is reactivate workstation the flag is cleared and no other action is taken, i.e., the workstation remains activated. [This revision was actually made on 3 Jan]. (1/10) sys/gio/cursor/giotr.x sys/gio/cursor/grcclose.x sys/gio/cursor/grcopen.x sys/gio/cursor/grcwaitp.x sys/gio/cursor/grcwcs.x sys/gio/cursor/gtr.h sys/gio/cursor/gtrctrl.x sys/gio/cursor/gtropenws.x The cursor mode code also had to be modified to eliminate unecessary close/open deactivate/reactivate workstation commands. A number of cases were defined which had to be dealt with carefully: cursor mode may be entered [1] from within an interactive program after the workstation has already been opened with GOPEN, [2] while the kernel is connected to the stream but after GCLOSE has been called, [3] while the stream is in its initial state, i.e., no kernel connected. Furthermore, a distinction had to be made between kernel control directives (DEACTIVATEWS etc.) issued at runtime by an interactive program, and those present in GKI metacode being played back. It is difficult to describe the actual revisions precisely here, but briefly, the list of control directives handled by the pseudofile i/o controller (gtr_control) was expanded to include CLOSEWS, DEACTIVATEWS, and REACTIVATEWS, the controller now passes all runtime control directives directly on to the graphics kernel, and GIOTR was modified to filter out all control directives except OPENWS. In other words, control directives such as close or deactivate workstation present in spooled GKI metacode are ignored when the metacode is retransmitted to a graphics kernel following a `0' or `:.read'. The open workstation directive is still recognized when replaying spooled metacode, and is all that is required to cause a frame advance or screen clear between successive graphics frames. (1/10) sys/gio/gki/gkiclose.x sys/gio/gki/gkideact.x sys/gio/gki/gkireact.x These GKI primitives were modified to send a copy of their GKI instruction to the PSIOCTRL stream as well as to the output graphics stream. The PSIOCTRL version is the one which causes some action at runtime, whereas the data version is included in the output GKI metacode stream only for the sake of completeness (some program may wish to make use of it) and for debugging purposes. (1/10) sys/gio/stdgraph/t_stdgraph.x The STDGRAPH kernel (PLOT task) was modified to [1] filter all close workstation, deactivate workstation, and reactivate workstation directives out of the input metacode stream, and [2] explicitly add a close workstation directive before task termination to ensure that the terminal is left in text mode. (1/10) sys/etc/pagefiles.x The clear_screen option is now used to defeat screen clears only when sequentially advancing through a file, e.g., with space bar or 'f'. All backwards motions or seeks cause a screen clear followed by output of the data. The file or object name in the end-of-page prompt is no longer changed to EOF at the end of file, rather, the percent done indicator is changed to -(EOF). This was necessary for it to be possible to always see what was being paged. (1/14) unix/hlib/iraf.h unix/hlib/SUN_kludge/precomp.csh [SUN/IRAF] Changed the definition of IS_INDEFX so that it no longers uses a complex comparison; it now does only a single precision real comparison of the real part of the complex number, i.e., define IS_INDEFX (real($1)==INDEFR) The complex comparison would cause the Sun fortran compiler to crash when used with the hardware floating point options. (The floating point equality used here and in the other IS_INDEFs has yet to cause any problems when comparing magic numbers, but will be replaced by an order comparison in a future version of the system to eliminate the risk). On the Sun systems, removed the entries for gctod.x and xtoc.x from the precomp.csh file, since complex comparison is no longer used. (1/14) os/mkpkg os/net/mkpkg boot/bootlib/mkpkg boot/mkpkg/mkpkg sys/mkpkg (module libmain.o:) Added a $set XFLAGS = "-c" statement to each of these mkpkg files. This is needed on systems like the SUN to override any host dependent compiler options used for the main IRAF system, e.g., floating point compiler options like -f/68881 etc. The HSI wants to be compiled without any special options, e.g., it should use only software floating point (if floating point is used at all), for maximum portability of the binaries. (1/15) unix/boot/spp/xc.c The f77 command line switch "-cu" was changed to "-c -u". The Sun f77 does not permit clustering of switches, and hence the -u switch was not being seen and the Sun XC was not checking for undefined variables and functions. (1/15) unix/os/zfiopr.c unix/os/zopdpr.c unix/os/zoscmd.c unix/os/zmain.c Modified these routines to use fcntl() to arrange for file descriptors other than stdin, stdout, and stderr (0-2) to be closed in the child if the execl succeeds, and deleted the loop over close() in zmain. This was necessary for the Sun-3 fpa and was necessary before for the Sun-2 skyfpa; I thought I had merged the changes into the master system but evidently not. (1/15) --------------------- (The following revisions are from the first installation of SUN/IRAF at the (KPNO 4-meter telescope on 21 January 1987). /usr/lib/suntools Installed latest version of GTERM in suntools. (1/21) dev/graphcap Changed MF from 8 to 1 for the apple laserwriter. There is no need to spool plots for this device. Also added the aliases "lw" and "lws" for the two apple laserwriter entries, since the device name on the Sun is "lw" rather than the "apple" currently used in IRAF. (1/21) sys/gio/cursor/grccmd.x Modified to do an automatic gflush if MF is <= 1. In the process of making this modification and testing the new system, discovered [1] this routine was calling grc_open() as a subroutine, while it is a function, and [2] the code which calls grc_command assumes that the stream data structures are left intact by the call. Added a call to gtr_init() at the end, before exiting, to insure that the latter assumption is correct. (1/21) sys/gio/cursor/gtr.h sys/gio/cursor/rcursor.x lib/scr/cursor.key Added a new key "=" to cursor mode. This is shorthand for the commonly used function :.snap. A prior call to ":.snap dev" is needed to set the output device, else the default stdplot device will be used. (1/21) sys/gio/cursor/gtrinit.x There was a bug in this code, when called immediately after a :.gflush on some other stream. The gflush would invalidate the cache but gtr_init would find the stream already inited and would not reload the cache for the new stream. The logic was changed so that it always reloads the cache for the new stream if it is not already set up for the correct stream, moving the conditional which used to check for an invalidated cache to the code which saves the cache in the descriptor for the formerly cached stream. In other words, the old cache contents are now saved only if they are valid, and the cache is always set up correctly for the new stream, which was what was not being done formerly. (1/21) ---------------------- (Begin the final bug-fixing pass for V2.5) unix/os/zpanic.c Modified zpanic to core dump the current process if called when the debug_sig flag is set. (This revision need not be made in all V2.5 IRAF versions). (2/4) sys/gio/cursor/prpsio.x Modified to discard graphics control output via stream PSIOCTRL when the associated graphics stream has been redirected to a file. This is the fix for the graphics stream redirection bug (>G). What was happening was that the call by pr_psio to gtr_control would take an error action when the stream had been redirected and hence the graphics kernel had never been activated. UNIX stdio (LIBC) converts getc errors to EOF, and the CL lexical input stream does not check EOF's to see if they are really i/o errors, hence the CL would see a premature EOF on the command input stream from the graphics task. The task would be terminated at the CL level without reading the graphics output and writing it to the redirection file, hence the file size would be zero. The next time a task was run in the subprocess (e.g., x_plot.e), the graphics output from the previous task would be read and passed on to the graphics kernel connected to the stream of the new task. (2/5) pkg/cl/gquery.c EPARAM could not be used to set the value field (list file name) of a list structured parameter, due to some muddled code in gquery(), which was originally derived from query(), but which is not used in the same way for list structured params (since it is used to assign a new value to a param, rather than verify the current value). (2/5) sys/imio/iki/stf/stfopen.x Now forces the datatype of a NEW_COPY image to real if a new physical image is being created. This fixes the bug where imcopy dev$pix[*,1] pix.hhh would create a type real image with short integer pixels. For some reason this would work correctly if the section were omitted. (2/5) sys/imio/imt.x Disabled sorting of image template lists. Image templates are often used to generate both input and output lists from the same database. The lists must be of the same length and in the same order for this to work as expected. The problem is that the output list is often edited with a // or %%, and it is the edited list which is sorted, hence it is possible for the input and output lists to be sorted differently if the output list is edited. (2/6) sys/fio/filopn.x After the call to zopen_proc (the device driver open procedure for the file), added an fp=fiodes[fd] statement to reinitialize the file pointer, in case it is clobbered by the called procedure. In the case tested, the LPOPEN device open procedure was clobbering fp in the fio common, and an open failure was not getting caught. (2/7) dev/hosts For the VMS nodes, changed the kernel server pathnames to the UNIX syntax, since the REXEC server used in the tcp/ip network interface uses the unix syntax even on VMS. (2/7) sys/ki/irafks.x Added some new debug conditionals. (2/8) vms/os/net/zfioks.c Replaced the network channel by input and output channels, which can be the same but do not need to be. (2/8) bin/irafks.e [VMS] I tried various experiments to get the VMS TCP/IP kernel server going, without success. The main conclusion appears to be that use of the REXEC daemon is not the way to go for VMS. The process tree to the actual kernel server is as follows: rexecd.exe csh.exe irafks.exe where rexecd.exe is itself spawned by the INET_SERVERS daemon. This hardly seems an efficient process structure. Furthermore, the Eunice REXEC server does not read the user LOGIN.COM file, hence the IRAF logical names will not be defined and some things will not work. Ignoring all that, I was able to execute the kernel server but could not make the network connection. The irafks.e SYS$INPUT was set to "_INET28". The system knows about a logical network device _INET0: (the Eunice tcp/ip device driver), but trying to sys$assign a channel to _INET28: causes a "no such device" error. Beats me why the process would be spawned with an invalid SYS$INPUT device. Another bothersome thing was that the 28 counted up from a smaller number during the first few trials, then pegged out at 28, suggesting a channel was not being freed or something within INET_SERVERS or REXECD. RSH from a UNIX host continued to work, but the SYS$INPUT for tasks spawned via the RSH daemon was a mailbox rather than the _INET device, so this proves nothing. I was tempted to try rebooting to see if the 28 was reset to a smaller number, but was unable to do so. It appears to me that the best solution for network access to a VMS node is to use DECNET, if DECNET software is available from a UNIX node. Barring that, a special daemon should be written which spawns the LOGINOUT process to login with the given name and password, start up a DCL, read the user's LOGIN.COM file, and execute a user specified command file which runs irafks.e (like the DECNET interface). This appears to be possible, although the VMS hooks required to make it work are incompletely documented and are noted in the documentation as "intended for use by VMS system software". (2/8) dev/hosts dev/uhosts [discussion] unix/os/zghost.c Looked into the long node name problem. It was reported that filename mapping would fail on UNIX systems where gethostname() would return a host name longer than the builtin KI limit of 9 characters; this is evidently common on 4.3BSD systems which use a long host name containing several . delimited fields. As our system has short node names, I simulated the problem by faking the call to gethostname() in zghost.c. I was unable to duplicate the bug, and in fact it appears that there should be no problem. If a long node name is returned it will be truncated to 9 characters. If the system does not use the IRAF networking facilities this should be harmless. If the system does use networking the KI should still function correctly, provided the node names in dev$hosts and dev$uhosts are also truncated to 9 chars. The only requirement is that the system be internally consistent; the local node names are independent of the integer internet address, which is what goes out on the network to actually connect to a remote node. (2/9) sys/clio/clpset.h sys/clio/clpsetnm.x If the pset name is null, the CLIO pset package will now return just the param name, rather than ".param". (2/9) sys/tty/ttyodes.x If either the "li" or "co" parameter is missing from the termcap (or printcap) entry, a default value is assumed (previously the value would be zero, which could cause programs to misbehave). (2/9) sys/gio/gopen.x Deleted the code for the now obsolete "@stddevice" redirection feature, e.g., it used to be possible to set stdgraph = "@terminal" to use the same device name for both the stdgraph and terminal devices. The STTY task now handles this in a better way, and the @ feature proved to be difficult to implement consistently throughout the system, hence was never fully implemented. (2/9) pkg/cl/debug.c Fixed an off-by-one array overrun bug in d_f which could cause a segmentation violation on systems with large numbers of file descriptors. (2/9) pkg/cl/pfiles.c pkg/cl/param.c Fixed a bug in the CL that would cause list files to fail to be closed at task termination. The list file pointer p_listfp was not being copied back by pfcopyback(), and hence the list file was not being closed by restor(). (2/9) sys/osb/chrpak.c sys/osb/chrupk.c sys/ki/kiencode.x The base 128 integer encoding scheme employed in this kiencode.x had a bug that would cause it to lose the signedness of -128 and its integer multiples. There was also a problem with integer overflow. The bugs were discovered when networking was brought up under AOS/IRAF, however, I did not fix them quite the same way. The new AOS/IRAF code assumed that SPP chars are unsigned values and generated values in the range 0-255, whereas the SPP language specification defines SPP chars as signed quantities (since they are usually implemented as integer*2, which is signed). I kept the negative char values in the the encoding, and instead changed the chrpak/chrupk primitives in OSB to explicitly preserve the signedness, since the C specification does not specify the signedness of chars. The new versions of chrpak/chrupk map SPP chars into unsigned bytes, using ranges to restore any negative values in the unpack operation. The new routines are upwards compatible with the original encoding (except for negative numbers, which are not currenty used anyhow hence should not matter) hence network communications with older versions of IRAF should not be affected by this change. (2/9) unix/os/net/zfioks.c unix/os/net/kutil.c Merged in some bug fixes from the AOS/IRAF network interface. Note that the routines in the UNIX/IRAF os$net are not actually used in the runtime system, but are provided only as a template to be used to contruct the network interface for a new system. (2/10) sys/imio/immapz.x Added a runtime check for an environment variable "min_lenuserarea"; if no such variable is defined the value of MIN_LENUSERAREA in <imio.h> will be used instead to size the IMIO user area, i.e., the amount of buffer space available for user header parameters. The new environment variable may be defined by the user or the site manager (e.g., in hlib$zzsetenv.def) if images with very large numbers of user params (or history cards) are to be processed. Note that applications which simultaneously open many images, e.g., IMSUM, may run out of memory if the value is set arbitrarily large. (2/10) vms/os/zpanic.c Changed sys$exit error code to SS$_ABORT. This should get rid of the strange error messages like "SYSTEM-F-UNSAFE, drive unsafe", which we have occasionally been seeing following panic shutdowns. (2/10) sys/vops/amed.gx Modified the file header comment to agree with the recent addition of stack allocation to avoid modifying the input vector. (2/10) vms/hlib/gripes.cl Added a NOAO site specific command to cause gripe mail to be forwarded to the master iraf mail file on lyra. (2/10) sys/imfort/imioff.x sys/imfort/imcrex.x Changed the name of the imioff procedure to imf_initoffsets, as used in IMFORT, to avoid a shared library conflict on VMS (IMIO uses a procedure of the same name). This is just as well but should actually not be necessary, as IMFORT programs are not supposed to be linking with libex. (2/10) unix/os/zfioty.c Replaced the string constant "/dev/tty" by the macro TTYNAME. (2/10) unix/os/zfiotx.c [discussion] There was a question about the (*op = XEOS) statements herein writing beyond the maxch characters specified for the output string. In all IRAF code, a "maxch" for the output string specifies the maximum number of characters to be returned, excluding the EOS. For example, if maxch is 80 and the output string is filled, 80 chars will be returned followed by an EOS in element 81. The only exception to this is operators which return raw character data, rather than a string. Strings are always EOS delimited, but data may consist of exactly so many chars and no EOS. I thought that ZGETTX, as a low level kernel routine, returned a data array with no EOS, but evidently this is not the case. Since it does return an EOS, it MUST be at buf[*maxch] (or before, if the data array is shorter). It may be that the routine should be modified to not return any EOS at all, but since everything seems to be working I am not going to modify anything at present. (2/10) unix/bootlib/osfcopy.c Changed datatype of "buf" to XCHAR, and added (char *) casts in the calls to read() and write(). (2/10) pkg/images/tv/display/t_display.x In the calculation of the "unitary_greyscale_transformation" flag, replaced several (abs(x-y) < EPSILON) floating point comparsions by fp_equalr(x,y) calls. The latter performs the comparison correctly regardless of the magnitude of the quantities being compared. (2/10) sys/tty/ttygets.x Fixed an argument type mismatch (char,int) in a call to the mod intrinsic function. (2/10) sys/imio/db/impstr.x Fixed an off-by-one bug in a format statment which would cause the closing quote of a short string valued keyword to be placed in column 19 rather than 20, contrary to the FITS standard. (2/10) sys/imio/db/idbfind.x sys/imfort/db/idbfind.x The keyword search code would formerly match the first keyword for which the given keyword name was any abbreviation, rather than requiring that the full name match. Modified to require an exact match. (2/10) pkg/images/imutil/hedit.x Fixed an uninitialized variable bug in the call to lexnum() which would cause new numeric parameters to be added as type string rather than as integer or real parameters. (2/10) pkg/cl/globals.c Set the default editor type to the null string rather than "emacs", to force the .ed file to be read when the editor is first used. If this is not done and the default editor is the same as in globals.c, then changes in the .ed file have no effect. (2/10) sys/vops/amap.gx Fixed point overflows were reported in the short integer version of this routine, so I modified it to perform the computation internally in integer for type short arrays. No doubt there will be other VOPS operators which should do this, too. (2/10) sys/imio/db/impstr.x More problems with updating string parameters in image headers: when replacing a long string, e.g., '...................', by a short string, e.g., 'abc', the old value would not always be cleared. Also, in image headers with variable length records (< 80 chars), it was possible to overwrite the newline at the end of the record, clobbering the next record and joining the two. All of these problems derive from the storage of header paramters internally in ascii. (2/10) pkg/cl/pfiles.c Added a "long filetime()" declaration to the file header. (2/10) pkg/proto/imreplace.x - pkg/proto/mkpkg Deleted this obsolete file. (2/10) pkg/proto/imrep.gx Was coercing INDEFR to INDEFD, rather than testing for INDEFR and doing an assignment. (2/10) pkg/cl/task.c The addltask() function was not explicitly returning a pointer to the new task, although it is supposed to. It was probably working because the second to the last statement is a call to newltask(), which is leaving the desired task pointer in the function return value register. This will (accidentally) work provided the register is not clobbered before the function returns. (2/10) sys/mtio/mtparse.x Modified to handle a drive syntax like "mta.1600". It would handle "mta1600" or "mt.a.1600" (a special case of "mt.*.1600"), but could not handle an unmatched . delimiter as in the first example, and as in the dev$devices file. Note that the syntax "mta.a.1600" cannot be used unless it appears that way in the dev$devices file, which will probably be the case only if the 'a' is some more complex multi- character device name. (2/10) vms/boot/bootlib/osfpathname.c Now checks for a null string vfn and calls vfn2osfn() only if a nonnull vfn is given. (2/12) dev/graphcap Added ":kf=x_sgikern.e:tn=sgikern:" fields to the entries for the logical devices sgimc and sgibi; these work now and never did up until now. Also changed the MF count from 8 to 1, so that one file is generated for each output frame. (2/12) sys/gio/sgikern/sgk.x - Increased the bitmap buffer size to 2550 lines by 3300 columns, sufficient for an 8.5x11 plot at 300 dpi, and larger than all currently supported bitmap plotter devices. - Moved the $(XX) substitution code so that it is the first operation performed on the DD string. This allows parameter substitution to be performed on the node, device, and spoolfile fields, as well as the dispose string. - If the dispose string is null, oscmd() is no longer called. (2/12) sys/ki/kignode.x This is the procedure used to extract a node name prefix and determine whether a resource resides on the local node or a remote node. It was modified to return immediately indicating that the resource is local if the first character in the resource name is the node delimiter character, i.e., '!'. This was the source of the bug whereby the !! were being stripped from OS escape commands such as "cl> !!!oscmd". (2/12) unix/hlib/login.cl [HSI] vms/hlib/login.cl Added a statement to the code which builds the "user" package which will cause commands to be read from a file LOGINUSER.CL, if such exists in the user's home directory at login time. This makes it possible for the user have a custom login.cl file without having to edit the login file every time they do a mkiraf. The file is read in command mode and must end with a KEEP statement if it contains any declarations. (2/12) unix/boot/mkpkg/main.c vms/boot/mkpkg/main.c In the default case, in the second call to strcat there was an invalid argument *ip. (2/12) sys/gio/cursor/prpsio.x This code calls the stdgraph kernel to deactivate the workstation if a task writes to STDOUT or STDERR while in graphics mode. This was not taking effect immediately any longer, due to the recent revision to the stdgraph kernel, whereby transmission of deactivate-ws commands is delayed until the next graphics command is received, so that no-op deactivate/reactive ws commands can be eliminated. Added a call to stg_active() after the call to stg_deactivate() to flush the deactivate ws command to the terminal, ensuring that error messages and such will come out in readable form. (2/12) pkg/system/help/lroff/center.x The lroff (help) text formatter was not centering text properly. Evidently the page width and margin parameters used on our development system would just happen to cancel out the logical error in the code; with different parameters, the centering error was obvious. (2/13) pkg/system/help/help.par pkg/system/doc/help.hlp Changed the default number of lines per page (nlpp) for HELP pages from 60 to 59. This was the cause of "help | lprint" producing a blank page every other page. It turns out that the laser printer (at least ours, an imagen) is 60 lines per page, with an automatic formfeed after line 60. Help output includes an embedded formfeed, so you get a blank page if pages are exactly 60 lines long followed by a formfeed. A recent bug fix in HELP caused it to fill a page, whereas before it was not completely filling each page, i.e., it was this bug FIX which caused the blank-page bug. NOTE - The value of the help parameter 'nlpp' should be set smaller than the size of the device page on which the document will be printed. The HELP task has no way of knowing this, e.g., documents formatted by help are often spooled in a .doc file and can be printed later on any device. We will distribute the system with the default value of 'nlpp' set for the shortest printer page size we know about. TODO - This fix is really a bit of a kludge. The real solution is for lprint to know whether the device auto-formfeeds after so many lines, so that it can omit the formfeed if the page is filled. The 3 line page footer built into lprint should also be a device parameter. I do not want to get into all this now. I plan to move the printer stuff out of the termcap file into a "printcap" file, with a set of device parameters defined especially for printer devices; these LPRINT modifications are best left until the printcap file is set up. (2/13) pkg/system/help/t_help.x pkg/system/help/manout.x Added a test to eliminate the formfeed preceeding the first page of manpage output; a formfeed before the first page can cause a blank page on some printers. Also added a "man_init()" procedure, and a call to it in the program main, to clean up the manpage internals if manpage output is interrupted. (2/13) sys/gio/stdgraph/stgpm.x The stdgraph polymarker code was used for the first time in the non-polypoint mode for the vt240 terminal, which needs to draw points as <move> <x,y> <draw> <x,y>, and so on, repeated for each point. The polymarker code was modified to draw the polymarker as a series of primitive vector move/draw commands, if the marker start (MS) sequence is not defined for the device. MS (and ME if needed) should only be defined for a device if it can draw a multipoint polymarker following a single <markerstart> control sequence at the beginning. (2/14) sys/gio/cursor/prpsio.x sys/gio/stdgraph/stgwtty.x + sys/gio/stdgraph/stgrtty.x + sys/gio/stdgraph/stgactive.x [IMPORTANT CHANGE TO GIO] sys/gio/stdgraph/deact.x sys/gio/stdgraph/onerr.x sys/gio/gdeact.x + sys/gio/greact.x + A number of changes were made to the stdgraph kernel and to the pseudofile i/o system, as used while the workstation is active (i.e., in graphics mode). The changes affect only programs which write to STDOUT or STDERR, or read from STDIN, while doing interactive graphics to STDGRAPH. All i/o is completely normal if the workstation is not activated, i.e., if the terminal is not in graphics mode. The pseudofile i/o system now completely controls i/o to STDIN, STDOUT, or STDERR while in graphics mode. Since this type of i/o is now under the complete control of the i/o system it may be used safely in applications programs, with more predictable and consistent results. This revision addresses the major device dependency remaining in the old graphics terminal interface. 1. Device model Our logical device model assumes that the terminal has separate text and graphics planes. Some terminals will display both planes simultaneously, i.e., as transparent overlays, some will display one plane or the other but not both simultaneously; some will display both planes simultaneously as separate windows, and some will have only a single plane which must be used for both text and graphics. We assume that there is a "status line" in the graphics plane which is cleared and prepared for text output by the graphcap GD (graphics disable) function. Graphics mode is later restored with GE (graphics enable). The OW (open workstation) function places the terminal into graphics mode and causes the graphics plane to be displayed (OW will be equivalent to GE for most terminals). The CW (close workstation) function restores the terminal to normal text mode, causing the graphics plane to be turned off and the text plane to be displayed. 2. Write to STDOUT, STDERR These streams are treated equivalently by the low level i/o system. A write to either stream while the graphics workstation is activated will cause one or more lines of text to be written to the "status line" in the terminal graphics plane. Text lines should be delimited by newlines in the usual way, but the newline will not be output, i.e., no carriage-return line-feed will occur. If multiple lines of text are output they will be written successively to the status line, with each line overwriting the previous one, and possibly not giving the user time to read the first N-1 lines of text. In the usual case where a single newline delimited line of text is output, the text is written to the status line minus the newline and the terminal is restored to graphics mode, i.e., no mode switch takes place and the terminal is NOT left in text mode following output to the status line. 3. Read from STDIN If the text written to STDOUT while in graphics mode is not newline delimited, e.g., in a prompt string such as "prompt: ", the GE sequence will not be issued and the terminal will be left in text mode with the text cursor positioned at the end of the line of text in the status line. The application may then read the user response string from STDIN. The i/o system performs the read in raw mode to prevent echoing of the newline character, which might cause the terminal to scroll. The read terminates when the user types carriage return, line feed, or an end of file character. Backspace and delete may be used to delete single characters, and <ctrl/c> or <ctrl/u> may be used to delete the entire string. The GE sequence is issued when the read terminates, completing the sequence and leaving the terminal in graphics mode. 4. Raw i/o to the status line Although the i/o system always reads from the status line in FIO raw mode, this is transparent to the application, which receives full lines of text with normal input processing. Actual raw i/o at the applications level is also supported. Raw mode is initiated by calling fseti to set F_RAW to YES on STDIN. The first write to the status line in raw mode clears the status line and outputs some text; additional text, e.g., single characters, may be output in successive calls, with output being appended to the status line (in the normal mode, the status line is erased and overwritten in each call). Raw mode reads return single characters with no input processing and with no echo. Writing a newline character to the status line reenables graphics (GE). Raw mode is cleared with fseti(STDIN,F_RAW,NO). 5. Deactivate, reactivate workstation Two new commands have been added to GIO, to be used to deactivate and later reactivate the workstation, following a call to GOPEN. Note that GOPEN does an open-workstation, which implicitly activates the workstation, hence it is not necessary to explicitly reactivate the workstation at GOPEN time. gdeactivate (gp, flags) # deactivate workstation greactivate (gp, flags) # reactivate workstation flags (<gset.h>): AW_CLEAR # clear tty screen on CW AW_PAUSE # waitpage prompt on OW The deactivate workstation directive, when called for a STDGRAPH device, causes the CW (close workstation) directive to be issued to the terminal, leaving the terminal in text mode like GCLOSE, but without affecting the graphics state. Note that it is the CW directive which is issued, NOT the GD directive, which is only used to write to the status line in the graphics plane. Any amount of conventional text i/o may be performed while the workstation is deactivated, with graphics i/o resuming following a call to greactivate. The FLAGS argument should be either zero, or the inclusive-or (arithmetic sum) of some set of the AW_ flag bits defined in <gset.h>. For example, to clear the text screen and display a page of text, pausing at the end for the user to type a key before reentering graphics mode: call gdeactivate (gp, AW_CLEAR) <code to output lines of text> call greactivate (gp, AW_PAUSE) 6. Paging a file in cursor mode Help text may be generated either on the fly by a program, using the g[dr]eactivate calls to control the workstation, or help text may be paged from a file. A new routine has been added to GIO to make the latter case very easy: gpagefile (gp, fname, prompt) This routine pages the named file (which should be in noao$lib/scr, lib$scr, or some such directory) using the library version of the PAGE task. The graphics state is not affected by the call. 7. Cursor mode help The key '?' is no longer treated specially. Existing applications programs must be modified to use the facilities described in [5-6] above. Aside from this one change, all the GIO modifications discussed herein should be upwards compatible. Cursor mode itself now uses the file pager to display the cursor mode keystrokes, hence the text will no longer scroll off the screen. Note that escapes to the CL do not work while the pager is running within the context of the CL. 8. Cursor reads Reading the graphics cursor while the workstation is open no longer has any effect on the graphics state, i.e., the workstation is not deactivated. (2/15) sys/gio/stdgraph/*.x A number of little changes were made to the stdgraph routines in accord with the revisions mentioned in the previous item. The de/re activate workstation filtering code, added only a few weeks ago in an early attempt to fix the confusion over what deactivate workstation means, was deleted since we now have a precise definition and extra deactivate/reactivate workstation calls are no longer generated. The simplified the stdgraph kernel code significantly. (2/15) sys/gio/cursor/*.x A number of litte changes were also made to this code, mostly dealing with the few deactivate/reactivate workstation calls remaining in the code. The workstation is no longer deactivated when cursor mode exits while the workstation is active, i.e., following a gopen; this is of course the way it should always have been. Since the workstation is no longer deactivated unless it really needs to be, the automatic reactivate workstation call was removed from GIOTR. Calls were eliminated in several other places as well. Once again, things got somewhat simpler and make more sense now. (2/15) gcancel.x gclear.x gclose.x gdeact.x greact.x The calls to flush() in the routines were technically incorrect; these were replaced by calls to gki_flush() in all routines listed except gclose(), which will have already issued a gki_closews. The flush call in gclear was deleted as it is not needed, and it can be annoying to wait a second for something to happen (e.g., the next block of graphics output to be transmitted) after the screen clears. (2/15) sys/clio/clgkey.x sys/clio/rdukey.x + pkg/cl/modes.c Moved the rd_ukey() code out of modes.c and into the VOS, as the SPP subroutine clio$rdukey.x (this is interesting, by the way, as a direct comparison of C and SPP). Modified clgkey() to call rdukey() if the calling process is run standalone. This was done so that pagefiles() can be called from within the CL. (2/16) sys/libc/crdukey.c + unix/hlib/libc/xnames.h [HSI] Added an entry c_rdukey() to the VOS C language binding. (2/16) sys/gio/cursor/grcpage.x - sys/gio/cursor/grcwaitp.x - sys/gio/cursor/gtrwaitp.x + sys/gio/cursor/rcursor.x sys/gio/cursor/gtrctrl.x sys/gio/cursor/crccmd.x Modified the cursor mode code to use pagefiles() to page the cursor mode help file. Added support for the deactivate-ws waitpage function to the PSIO controller. (2/16) sys/gio/gpagefile.x + Added the gpagefile() cursor mode file pager, discussed above. (2/16) pkg/system/page.x sys/etc/pagefiles.x Changed the name of the "general" file pager from gpagefiles to xpagefiles, to avoid confusion with the GIO gpagefile() routine. As far as I know, this relatively new routine has not yet been used anywhere other than in the system PAGE task, which was modified to use the new name. (2/16) unix/os/zfioty.c Added a (char *) typecast to the first arg to strcmp. (2/16) unix/os/zxwhen.c Fixed a typo: "if (unix_signal = ..." --> "if (unix_signal == ...). The effect was to cause any stdout data buffered at the unix level to be discarded whenever an exception occurs, rather than only when an interrupt occurs. (2/16) lib/gki.h sys/gio/gki/gkideact.x sys/gio/gki/gkireact.x sys/gio/gki/gkiexe.x sys/gio/gki/gkiprint.x These files were modified to implement the changes to the gki_[rd]eact* instructions. (2/16) sys/clio/clcmd.x sys/clio/clcmdw.x These routines now look for a ! at the beginning of the CL command; if present, OSCMD is called directly instead of sending the command to the CL. This allows the routine to be used to send OS escapes when running a process standalone. If the command must be passed to the CL, the code now checks to see if the process is a connected subprocess, and if not (e.g., run standalone), an informative error message is printed. (2/16) sys/etc/pagefiles.x Now error checks CLCMDW, printing a warning message if an error occurs. (2/16) sys/gio/cursor/rcursor.x sys/gio/stdgraph/stgrtty.x Modified these routines so that typing delete or rubout at the start of a colon prompted sequence which requires text entry (colon command or "text: " prompt) will cause a silent exit back to cursor mode (without ringing the bell and/or flashing the screen and punishing the user for changing their mind). (2/16) sys/gio/stdgraph/stgscur.x sys/gio/stdgraph/stggcur.x sys/gio/stdgraph/stginit.x sys/gio/stdgraph/stdgraph.h sys/gio/doc/gio.hlp Added a new STDGRAPH device capability UC (update cursor). If this capability is defined for a device, every time the cursor is read or written the new position is saved by the kernel, and used to manually reset the cursor position before the next cursor read. This is desirable on devices which modify the cursor position as an unwanted side effect of other, unrelated graphics operations. In general, it is undesirable for the cursor to move other than under user or program control. (2/16) vms/boot/mkpkg/modlist.c The hash function was modified so that only the first 20 characters of an identifer are used to compute the hash value. This was necessary to prevent integer overflow (resulting in an exception and/or a negative hash key value depending upon the system) when hashing very long identifiers. (2/16) pkg/cl/gram.c pkg/cl/eparam.c Looked into the problem of multiline parameter prompts, which were causing problems for EPARAM. Actually found two problems: [1] For normal terminal output with fputs etc., one should not write into the rightmost column as on terminals with autowrap this will cause every other line to be blank. Note that as long as output is filtered through ttyputline() this is not a problem, but the low level i/o facilities cannot handle this device dependence. [2] EPARAM could not handle multiline prompts correctly in all cases. It was working in the case when the prompt occurred in a parameter in the first screen. The only problem I found was one of display; it was always possible to edit the param. To address these problems, I [1] replaced some (maxcols) by (maxcols-1) in gram.c (for LPARAM and ?), and [2] in EPARAM, I rewrote the code which displays multiline prompts, discarding the e_indent_prompt() function, and rewriting the e_display function to break the prompt into lines, outputting each separately with e_goto and e_putline, and truncating each at the right margin. The old code was invalid for terminals with automargins. (2/16) sys/gio/stdgraph/* sys/gio/cursor/* In testing the new support for the status line and text/graphics io in the graphics system, a few bugs were fixed and some tuning was done. The changes were as follows: [1] Gdeactivate will now clear the text screen if the AW_CLEAR bit is set, even if the workstation has already been deactivated. [2] The AW_CLEAR and AW_PAUSE actions are now recognized by both the gactivate and gdeactivate routines. gdeactivate: PAUSE: Print "[Hit return to continue]" on status line and wait for return to be typed before deactivating the workstation. CLEAR: Clear the text plane after deactivating the workstation (disabling graphics). On some terminals this may also cause the graphics screen to be cleared; this is determined by the "cl" capability in the termcap entry. greactivate: PAUSE: Print the "[space=cmhelp,...]" message on the text screen and pause until the user types a key before reactivating the workstation. CLEAR: Erase the graphics plane after reactivating the workstation. Since these are bit flags, multiple flags may be passed, as follows: call gdeactivate (gp, AW_PAUSE+AW_CLEAR) Other flags may be added in the future. [3] Setting ":.page-" in cursor mode disables the AW_CLEAR page in gdeactivate (this has no effect on the gpagefiles() screen clear). This option is sometimes useful on terminals with transparent graphics overlays. On these terminals, since the graphics plane cannot be turned off, both planes are cleared when either a full page of text or a graph is to be drawn. Disabling ":.page" in cursor mode defeats the initial screen clear and the graphics redraw. The text is displayed beneath the plot, and is erased after the greactivate prompt (AW_PAUSE) with a series of line clears in the text plane. This option permits greater speed, but one has to try to read the text through the graph. A bug in ":.clear" was also fixed; it now uses the same technique to clear the screen. To try out nopage mode, try the following on a terminal with a transparent graphics overlay like the vt100+retrographics: :.page- :.show (show text appears underneath plot) q (text is erases and cursor comes back) Unfortunately, this does not work for ?, :.help, etc., unless the clear screen entry in the termcap file does not clear the graphics screen. A special terminal entry can easily be prepared which does not clear the graphics plane, if desired. [4] When writing to stdout|stderr, you can now append to the status line. The status line is cleared when changing from graphics mode to status line mode. Since writing a newline causes a switch from status line mode to graphics mode, lines of text overwrite each other, but if the newline is omitted you can append to the status line. [5] Graphics output or reading the cursor automatically resets graphics mode from status line mode, in case one forgets the trailing \n when writing to the status line. Important Notes: o When mixing status line graphics output, remember to call gflush before writing to stdout or stderr, otherwise graphics output will not be flushed and a synchronization error will occur. o Remember to flush stdout or stderr after writing to the status line, else you won't get any output until later, and it might go to the wrong place. call gline (gp, x1, y1, x2, y2) call gflush (gp) call printf ("status line message\n") call flush (STDOUT) call gline (gp, x1, y1, x2, y2) A gdeactivate automatically flushes graphics output, and greactivate automatically flushes stdout and stderr, so explicit flushing is not necessary when writing to the text plane, but when you write to the status line you are in graphics mode, so flushing is not automatic. Reading the cursor with clgcur will also automatically flush any buffered standard output. (2/17) pkg/plot/implot.x Modified the IMPLOT task to use the new 'gpagefile' facility to page the .key file, to add \n to some of the status line output, and so on. (2/17) sys/gio/gki/gkifflush.x + Added a new procedure gki_fflush() to the GKI library package. This differs from gki_flush() in that its only function is to perform a FIO flush of the file connected to the named standard graphics stream, whereas the gki_flush() procedure issues the GKI_FLUSH graphics instruction to the remote kernel, and then does the file flush. The new operator is a no-op for an inline kernel. (2/17) sys/gio/gcancel.x sys/gio/cursor/gtrctrl.x Modified these routines to use gki_fflush() rather than gki_flush(), since all I want to do is flush a control directive on to the kernel, rather than flush any grahics output buffered by the kernel. (2/17) dev/termcap Removed the "am" capability (automargins) from the termcap device entry for the imagen. This would cause lines exactly 80 cols long to be output without a trailing \n, causing the next line to be discarded. Not putting the capability in when the device does have automargins would have caused an extra blank line instead. This bug only showed up recently due to the recent bug fix in ttyputline(). (2/17) sys/gio/stdgraph/stgrcur.x [** IMPORTANT CHANGE TO GIO **] Since we have already made so many changes to GIO in V2.5, I decided to go ahead with another major change to the GIO user interface (for the better, hopefully). The change is in the cursor read code - the carriage return key is no longer mapped into EOF, but both the common EOF chars, <ctrl/z> and <ctrl/d>, are. If the application wants to use return to exit a cursor loop it can still do so, but now it has the choice. The problem with return as an alias for EOF is that it is too easy to type by mistake, particularly since return is commonly used for other purposes, and one extra return can easily cause one to accidentally exit a routine. (2/17) sys/gio/stdgraph/stgrtty.x sys/gio/stdgraph/stgwtty.x Added the two functions stg_putline() and stg_getline() to these routines. These are used to read and write lines of text to the graphics terminal, whether or not the terminal is in graphics mode. When the terminal is not in graphics mode, they do normal i/o, otherwise they read and write the status line. These functions are for use only within processes which are linked with the STDGRAPH kernel, i.e., the CL. (2/18) sys/libc/stgio.c + sys/libc/spf.c unix/hlib/libc/xnames.h [HSI] Added two small packages to LIBC. The first, STGIO, is just the C binding for the stg_putline() and stg_getline() routines mentioned in the last section. The second, SPF, is provided to make STROPEN style file i/o to a string buffer more convenient to use in a C program. The VOS provides convenient facilities for this, but some sort of C interface was needed to provide a similar facility in C, for use in the CL code. (2/18) pkg/cl/modes.c Modified query() to use the new STGIO facilities to do terminal i/o to satisfy an interactive query. This provides equivalent functionality to what we had before for normal queries, and adds support for CLIO parameter queries to the graphics terminal status line while in graphics mode. Note that in the case of multiline parameter prompts, only the last line will be printed, but this should not be a problem since the programmer knows when they prepare the parameter file which parameters might be called interactively during the execution of a graphics program. (2/18) sys/libc/fdopen.c No longer performs file access mode compatibility checking unless the file is a conventional text or binary file (e.g., not a string file). (2/18) pkg/plot/implot.x pkg/plot/doc/implot.hlp lib/scr/implot.key Modified the IMPLOT task to recognize the 'q' key for a quick exit. (2/18) sys/gio/gqverify.x + Added a new utility procedure to GIO, for use in interactive cursor loop programs to verify the quit command via an interactive query. The procedure prints a query on the status line and the user types 'q' again to verify the quit, or 'return' to abort the quit and return to the cursor loop. (2/18) Exiting Interactive Cursor Loops (discussion) The following standards have been defined for dealing with EOF/quit in interactive cursor loops. EOF End of file is indicated for a cursor list either by an actual end of file in the case of a true cursor list, or by typing the <ctrl/z>, <ctrl/d>, or interrupt character in an interactive cursor read. The 'Q' alias for EOF has been deleted. The argument is that a true EOF on the cursor list is to be taken seriously by the applications program, and not treated as just another key, hence it should not be something that one types all the time. If a program gets EOF back as the value of CLGCUR it should exit immediately, without any verification queries etc, since it may well have been run in batch mode with input redirected to a cursor list file. q The standard interactive cursor loop exit character is 'q'. All interactive graphics programs should recognize this character and take some action to exit the cursor loop, e.g.: while (clgcur (...) != EOF) switch (key) { case 'q': break case ... The 'q' character is intended to be handled directly by the application program, rather than mapped into EOF by the system (like Q was, and CR and the gt_gcur 'q' before that), to distinguish this case from a hard-EOF and to provide maximum flexibility in how the program treats a request from the user to exit. If the user would suffer from an accidental program exit then the 'q' key action should do something before exiting, e.g., ask that the user first update the database, ask that CR be hit to verify the quit, and so on. In general, if it would take the user more than a minute to recover after an accidental program exit, one should consider coding some sort of verification action to be executed before exiting when 'q' is typed (but not when EOF is seen on the list). A new procedure gqverify() has been added to GIO for the simple case where only verification is desired. Note that "lightweight" tasks or submenus which can easily be reentered should not bother even with this, but should just exit. Example: case 'q': if (gqverify() == YES) break As a more complex example, suppose the program is used to edit or create some database which could be lost or damaged in an accidental exit, if not updated first. We do not want to update the database automatically because this would overwrite the former contents of the database. The program might be set up as follows. 'q' program prints error message on status line, e.g., "No write since last change (:quit! overrides)" :w[rite] updates the database; q will execute silently :q[uit]! force a quit w/o an update; discard changes This example, as you may have guessed, is from the VI editor, upon which the colon escapes, EPARAM colon commands, etc., are loosely modeled. This model should be used in applications programs as well, where appropriate. (2/18) sys/gio/stdgraph/stgrcur.x Found an obscure bug in the cursor read code while testing. Interrupt is defined to be just another character in a raw mode read. In a cursor read, interrupt is one of the keys mapped into EOF, since it is a type of quit request. What was happening was that when the interrupt key (<ctrl/c>) was typed on the terminal during a cursor read, the terminal would treat it as a normal cursor read, returning a 6 char sequence to the computer. The cursor input loop was terminating immediately after seeing the interrupt character, without reading the remaining 5 characters, returning an EOF cursor read to the high level code. The program would exit, and the CL would then see the 5 extra characters as the command "0 ,&", which would cause a syntax error abort. The fix was to exit the interpreter only if a true EOF is seen on the input stream, otherwise accumulate all 6 chars. The only problem is, I am not sure why one doesn't also see the extra chars when the EOF character is typed, but it wouldn't make a lot of sense to continue reading after seeing EOF on the input stream. (2/18) pkg/system/files.x Just typing "files" with no arguments is supposed to list the files in the current directory; it was querying for the file template parameter instead. (2/19) sys/fio/fdirname.x This routine would formerly return the input name unmodified if it started with the node name prefix of a remote node. This would cause tasks like DIRECTORY to misbehave if the directory name did not end with a path delimiter like $, /, or a host delimiter. The routine was modified to always concatenate a / to the supplied string if the last character is a normal filename (identifier) character, e.g., a letter. For example, dir node!iraf$bin would fail, whereas dir node!iraf$bin/ would work. FDIRNAME will now add the trailing /, given a name like "node!iraf$bin" as input. This will work only the remote directory name is a VFN; a more rigorous solution must wait until there is time to change the way the kernel interface treats general filename translation. (2/19) unix/os/net/kutil.c In ku_gpasswd(), ZGETTX was being called to read a single character into a scalar output variable, with no space reserved for the EOS delimiter currently associated with the string (array) value returned by ZGETTX. The code was modified to read each character into an array, with adequate room for the EOS. (2/19) pkg/cl/bkg.c The command string printed by the JOBS task, the CL task which shows the status of background jobs, would occasionally print garbage characters following the last command string. This was due to a missing EOS in cases when the command string copied by strncpy completely filled the output buffer. I increased the size of the allocated string array from SZ_CMD to SZ_CMD+1; since the buffer is statically allocated and initialized to zero, this should be sufficient to ensure that the string is EOS delimited, but just to be sure I added an explicit EOS assignment as well. In general in CL code, all strings should be dimensioned to whatever+1 (like SPP strings) to avoid this sort of problem. (2/19) unix/hlib/mach.h [HSI] Added the following new machine constants: MAX_EXPONENTR MAX_EXPONENTD MAX_DOUBLE The related values MAX_EXPONENT and MAX_REAL were already defined. The new values were added to remove the assumption that the real and double datatypes have the same number of bits in the exponent, which is certainly not the case on all machines. More work needs to be done to define the optimum set of machine constants. (2/19) pkg/cl/decl.c pkg/cl/pfiles.c Increased the default amount of storage allocated for a string type parameter from SZ_FNAME to SZ_LINE. The shorter size was causing truncation of long string values, e.g., file or image templates, when the value on the operand stack was assigned into the parameter during initialization of the task argument list. The default amount of storage allocated for filename type parameters is still SZ_FNAME; filename parameters are equivalent to string parameters in nearly all cases, hence these may be used to reserve storage for objects for which SZ_FNAME is sufficient. This is similar to the situation in SPP, where SZ_FNAME is used for a lot more than just filenames, and really means something more like "general operand name". (2/19) NOTE - A few tests were made following this change, running compiled tasks which have template strings dimensioned SZ_LINE or larger internally. In all cases I was able to enter a template string of a least two lines of text (which is what SZ_LINE is). On some systems, one will need to use backslash continuation to enter the long string on two host lines, and this works too. If longer file lists are desired, one must use an @file or something similar. A file list entered with an @file can be arbitrarily large, e.g., I have run tasks using an @file containing a list of all the files in IRAF (about 7000), each by their full pathname. sys/tty/ttysubi.x There was a bug which came into play when %. was used with %r. The %r would swap the [x,y] coordinates upon input, but would not swap the deltas returned on output by the special character avoidance code. The routine was modified to swap the deltas before returning, if a %r was executed while processing the output sequence. (untested) (2/20) dev/termcap Added a device `textw', a wide (132 column by 60 line) version of the generic textfile device `text'. (2/20) pkg/system/help/t_help.x This code was restricting rmargin (the right margin) to the value of `ttyncols', preventing wide or right-shifted output on wide printer devices. The task was modified to use `ttyncols' only if the device type is `terminal'. (2/20) sys/etc/main.x When using the @parfile syntax to enter task parameters while running a task standalone, an illegal parameter assignment line would cause the task to abort with an IRAF main syntax error. Changed this to a warning message with a copy of the offending line of text. (2/20) unix/os/zfiotx.c [UNIX HSI] Fixed the following obscure bug in the UNIX HSI, which surfaced because the stg_getline()/stg_readtty() code services STDIN reads from a subprocess while the workstation is in graphics mode by reading the terminal raw mode, rather than the usual line oriented mode. In UNIX, when EOF is seen on a stdio stream, the EOF bit is set on the stream. This must be cleared, e.g., with clearerr(), or all subsequent reads will see EOF as well. The terminal driver was doing this for line mode reads, but was not doing so for raw mode reads, so a raw mode read following a raw mode read which returned EOF (because the user typed <ctrl/[dz]>) would return a spurious EOF, causing the reader to terminate prematurely. Fixed this, and also replaced the line mode code which was clearing the <stdio.h> flags _IOEOF|_IOERR explicitly by name by an equivalent call to the clearerr() macro, for greater independence of the local UNIX implementation. (2/20) sys/gio/cursor/rcursor.x The 'E' key in cursor mode is supposed to expand the plot only in X or Y if the range is negligible in the other axis, i.e., if the cursor is moved along only one axis when marking the expand rectangle. The range tolerance used for the test was .001 ndc, which was too small for some devices. Increased the range to .01 ndc. (2/21) pkg/plot/implot.x Added a similar feature to the 'e' key in IMPLOT. If the range marked has a negligible Y extent the data is plotted with autoexpansion in Y. This feature depends upon the ability to set the cursor position in software via the HL keys; if the terminal does not support this, the ":x" command may be used instead. (2/21) sys/gio/ginit.x - sys/gio/gfrinit.x + sys/gio/greset.x + sys/gio/gframe.x + sys/gio/gcancel.x sys/gio/gclear.x sys/gio/gdeact.x sys/gio/gopen.x sys/gio/greact.x sys/gio/doc/gio.hlp The GCLEAR routine not only clears the screen (or whatever), it also resets the internal state of GIO to the GOPEN state. This is desirable when making plots which are fairly independent of one another, since it automatically resets the line style, glabax parameters, and so on, eliminating the possibility that the plot currently being drawn will be accidentally affected by the parameters used to draw the previous one. In some cases, however, particularly when using GSET calls to set the glabax options, it is desirable to not reinitialize everything, as then one must keep a state table independent of GIO and reset the prior state after a GCLEAR. Two new routines have been added to GIO to give the application a choice of how they want to do this. The GFRAME routine, like GCLEAR, clears the screen, but it does not reset anything in the internal state of GIO, including even the WCS (some flags are however set to cause the GIO state to be retransmitted to the graphics kernel when i/o occurs). An additional routine GRESET has also been added to selectively reset the internal state of GIO. The GRESET call is as follows: greset (gp, flags) flags: GR_RESETALL reset everything GR_RESETGIO reset only GIO drawing parameters GR_RESETWCS reset the WCS to wcs=1, all NDC GR_RESETGLABAX reset the GLABAX parameters A GCLEAR is equivalent to a GFRAME followed by a greset(gp,GR_RESETALL). This revision is upwards compatible and should not require any changes to existing code. (2/21) sys/gio/stdgraph/stgtxset.x Deleted the "- GT_ROMAN + 1" conversion that was being applied to the font code, as this is already done when the code is passed to the encoder for output, and the text drawing code assumes throughout that the font code is as defined in <gset.h>. (2/21) sys/gio/stdgraph/stgplset.x sys/gio/stdgraph/stgpmset.x In stg_plset(), the polyline width is passed via GKI as a packed integer, but was not being unpacked into an int. Fixed this, and also added a max(1,width) to both stg_plset() and stg_pmset() to prevent zero linewidths. (2/21) sys/gio/cursor/grcaxes.x Changed the font for the cursor mode 'A' tick labels from roman to bold, for consistency with the glabax code. (2/21) dev/graphcap dev/cacheg.dat Added an LW (polyline linewidth) capability for the GTERM entry. (2/21) sys/tty/ttyopen.x If the routine returned with an error exit it was not closing the termcap/graphcap file, causing a wasted file descriptor. (2/21) lib/gio.h lib/gset.h sys/gio/gactivate.x + sys/gio/*.x The GOPEN procedure now supports a new open mode modifier, AW_DEFER, which allows activation of the workstation to be deferred until i/o to the workstation is ready to take place (AW = Activate Workstation). The workstation may then be activated either explicitly by calling the new GACTIVATE procedure, or implicitly by calling greactivate, gclear, or by doing i/o to the workstation. If the AW_DEFER mode is not indicated the workstation is activated at GOPEN time, i.e., physically placed into graphics mode, and clearing the graphics plane if NEW_FILE mode is also specified. This feature is intended for use in interactive graphics applications and will most likely be ignored if graphics is redirected to a noninteractive device. An example illustrating when this might be useful is shown below. include <gset.h> gp = gopen (device, NEW_FILE+AW_DEFER, STDGRAPH) <in terminal mode> for (;;) { call greactivate (gp, AW_CLEAR) <draw a plot> call gdeactivate (gp, AW_PAUSE) <revert to terminal mode> } call gclose (gp) This is an example of an application which executes alternately in terminal and graphics mode. Since the application wishes to start out in terminal mode, activation of the workstation is deferred; if one were going to start out in graphics mode, there would be no reason to open the workstation in deferred-activate mode. The workstation is later explicitly reactivated when a new plot is to be drawn, and subsequently deactivated to return to terminal mode. This sequence can be repeated any number of times. The same thing can be acomplished somewhat simpler by replacing the calls to g[rd]eactivate by calls to gopen and gclose and dropping the outer set of calls, i.e., closing the graphics stream completely off when not actually in graphics mode. The main reason for using g[dr]eactivate instead, with or without deferred-activate mode, is one of efficiency in highly interactive applications, to avoid the need to repeatedly access the graphcap file, particularly if the graphcap entry for the user's graphics terminal is not cached. (2/21) lib/fio.h lib/fset.h sys/fio/areadb.x sys/fio/awriteb.x sys/fio/filopn.x sys/fio/fseti.x sys/fio/fstati.x sys/fio/fgetfd.x Added a new FSET option to FIO called F_CLOSEFD. If this option is set for a file, the host file descriptor or channel will be closed whenever the channel is inactive, i.e., the channel will be open only while an AREAD or AWRITE operation is actually taking place. This is used when a program must be able to simultaneously access a larger number of files than can be opened simultaneously at the host system level, e.g., when one needs to median-sum 100 images and the host system only provides 20 file descriptors. Note that the maximum number of open files will still be limited by FIO; the builtin limit is currently 70, but this will probably be increased to 128 or larger in the future. Naturally, it is inefficient to have to open and close a file for every i/o operation, but since it is done at the lowest possible level without closing the FIO file descriptor or returning any buffers, the expense is not too bad, particularly if large transfers are used to minimize file accesses. The F_CLOSEFD option is permitted only for existing (not NEW_FILE) binary files. Special devices are supported, e.g., the static file driver, but only if there are no significant changes to the file state when it is closed and later reopened. For example, the F_CLOSEFD option cannot be used in conjunction with mapped segments and the static file driver, since the data in the FIO buffer must remain intact when the file is closed and later reopened at the host system level, and closing a mapped file would cause the mapped pages (the FIO buffer itself) to be unmapped. (2/22) lib/imio.h lib/imset.h sys/imio/imopsf.x sys/imio/imsetr.x sys/imio/imstati.x sys/imio/immapz.x sys/imio/imsetbuf.x Added two new IMSET options IM_CLOSEFD and IM_BUFSIZE to IMIO, and modified the way the IM_ADVICE parameter is treated: IM_ADVICE If the value given is RANDOM, the FIO buffer size will be set to the size of an image line, rather than passing the RANDOM advice parameter on to the pixel file, as previously. Otherwise, the advice parameter is ignored and IM_BUFSIZE (default 64KC=128Kb) is used as a starting point to set the FIO buffer size. IM_BUFSIZE The recommended FIO buffer size for the pixel file. The value given is taken as a starting point to compute the actual buffer size, which will normally be an integral multiple of the size of an image line (assuming image lines are blocked to fill an integral number of device blocks). IM_CLOSEFD Setting this on an image descriptor causes IMIO to set F_FCLOSEFD on the pixel file descriptor when the pixel file is opened. This may be useful in applications which must simultaneously open a large number of images, to save host file descriptors. In most applications there is no need to fiddle with these parameters. They are provided primarily for programming image operations which require either very large amounts of memory, or simultaneous access to very large numbers of images. (2/22) lib/fio.h lib/fset.h sys/fio/ffault.x sys/fio/ffilsz.x sys/fio/fseti.x sys/fio/fstati.x Carefully adjusting the FIO buffer size to an integral number of image lines does one no good if the first image line in the pixel file is not aligned to the offset of a file buffer. With the OIF format, for example, the first image line will begin at some offset like 1025 (due to the pixel file header record), whereas the first file buffer will by default begin at file offset 1. It turns out that the file offset to which the FIO buffers are aligned is pretty arbitrary as far as FIO is concerned; one need only replace a "1" (in ffault.x) by an offset variable defined in the file descriptor. The new offset option is implemented as an FSET option named F_FIRSTBUFOFF, default value 1. Setting F_FIRSTBUFOFF causes any existing buffers to be destroyed. Setting the first buffer offset to a value greater than 1 causes the file data to the left of F_FIRSTBUFOFF to become inaccessible. (2/22) sys/imio/imsetbuf.x Added a call to FSETI to align the first file buffer to the file offset of the first image line. By the time this is called the image kernel will already have written the pixel file header (if any), hence the fact that the first part of the file will be inaccessible is not a problem - in fact it is probably an advantage. (2/22) NOTE - This revision should make IMIO somewhat more efficient in general. It also fixes a potential file fault thrashing problem that could occur when BT_NEAREST boundary extension was used on an image, and the first or last line of the image was not wholly contained in a file buffer. This behavior has actually been observed with the ROTATE image operator, when an image happened to be just the right size. If ROTATE (or any similar geometric operator) has been observed to be particularly slow, file faulting as decribed here may have been the cause. (2/22) unix/hlib/mkmlist.csh No longer returns references to <syserr.h> in the module list; since this file is frequently modified and the error codes never change, it should not be referenced in library module dependency lists. (2/22) ------------------------------ (All caught up with current bugmail, minor feature enhancement requests, etc.) VMS/IRAF HSI updated. VMS/IRAF (IRAFX) bootstrapped. VMS/IRAF - all MIP files deleted and replaced via tar from lyra. VMS/IRAF - started full sysgen. (2/22) sys/memio/*.x sys/memio/kmalloc.x + sys/memio/krealloc.x + Extensively revised the MEMIO sources, moving all the procedures out into separate files. The major functional change was to modfiy MALLOC, CALLOC, and REALLOC so that they take a normal error action (causing error restart if not caught in an error handler) instead of causing a fatal error and process shutdown. The new procedures KMALLOC and KREALLOC were added for use in low level code where the calls to the error recovery code in MALLOC and REALLOC would cause reentrancy problems. (2/22) sys/ki/ktzopn.x sys/ki/kopdir.x etc/envinit.x etc/environ.x These files were modified to use the new KMALLOC and KREALLOC procedures to avoid reentrancy problems with the error recovery code. (2/22) sys/*/*.x sys/*/*.gx Added errchk declarations where needed for MALLOC, CALLOC, and REALLOC. (2/22) sys/etc/main.x Replaced the calls to CLCMD by calls to putline(CLOUT,...), to avoid the error checking recently put into CLCMD. (2/22) --------------------- VMS/IRAF - full sysgen completed without incident. Updated VMS/IRAF again from lyra. (2/23 2 pm) Updated SUN/IRAF (pavo), and started a full sysgen. (2/23) unix/hlib/config.h unix/hlib/libc/libc.h vms/hlib/config.h vms/hlib/libc/libc.h Increased the number of VOS file descriptors from 70 to 128. This number needs to be 10-20 larger than the maximum number of host file descriptors (e.g., 64 on 4.3BSD). (2/23) sys/gio/cursor/gtr.h sys/gio/cursor/grcopen.x sys/gio/cursor/grcclose.x sys/gio/cursor/gtrctrl.x Cursor mode is supposed to leave the terminal in the same state it was in when cursor mode was entered, e.g., when the cursor is read following a GOPEN, with the terminal in graphics mode, the terminal is left in graphics mode. This works fine, but there was one case which was not being dealt with properly - if the cursor was read with the workstation open but deactivated, i.e., in terminal mode, the workstation was not being reactivated for the cursor read, nor was it being restored to deactivated mode. The cursor read would nonetheless work for the vt640 since the graphcap read-cursor control string forces the terminal into graphics mode, but since the graphics system did not explicitly reactivate the terminal it would not deactivate it either, causing it to be left in a funny mode - deactivated but in graphics mode. The code was modified to keep track of reactivate/deactivate calls, with cursor mode automatically reactivating and deactivating the workstation if necessary, when cursor mode is entered and exited. (2/24) sys/gio/greact.x sys/gio/cursor/gtrctrl.x When greactivate is called in AW_DEFER mode before the workstation has been activated, it automatically does an activate (OPENWS) rather than a REACTIVATEWS. The problem was that the "flags" argument was being ignored in this case, thus defeating AW_PAUSE and possibly causing the graphics plane to be activated before the user has a chance to read the text. Added some code to handle the pause function in this special case. Also, in this routine and gtrctrl.x, added some IF statements so that page and waitpage are ignored except for the STDGRAPH stream; one does want an interactive pause prompt if graphics is sent to a batch plotter device. We may want to recognize this type of interaction for STDIMAGE too, but I will wait until later to decide about that. (2/24) pkg/cl/eparam.c There were some problems with EHIST, probably due to the recent bug fixes for EPARAM (the eparam code is rather convoluted). The cursor was coming up one line too high; deleting a "- 1" seemed to fix this. Also added a clear-to-end-of-line in e_display so that short history commands completely overwrite longer ones when moving up or down in the history list, and added a newline at the end when ehist exits so that the command output does not overwrite the command. Some of these problems were probably in the eariler code, too. (2/24) --------------------- Sun/IRAF, VMS/IRAF systems updated (incremental). (2/24) Skip made wtar tape for AOS/IRAF. (2/25) unix/hlib/zzsetenv.def [SUN/IRAF only] On the Sun systems pavo and tucana, changed the default devices in the environment (hlib$zzsetenv.def) to stdplot=printer=lw, terminal=gterm40, and so on. (2/25) unix/os/zfiomt.c When a tape read fails on UNIX, at least with the driver I used for testing, evidently the read aborts immediately when the hardware error occurs, leaving the current record partially read. Since the VOS assumes that the tape has been positioned to the next record following the bad record, I had to add a skip record forward to the ZZRDMT primitive. This causes the routine to work correctly most of the time, but unfortunately it does not appear to reliably do the same thing. This needs further investigation. (2/25) sys/fio/filbuf.x sys/fio/fseti.x Modified the way the F_VALIDATE fseti option is implemented slightly. This option is used to validate the data in the FIO buffer following a read error on the input device, e.g., magtape. It was working the way I had it, but the data for two records would be returned in the single read following the failed read and buffer validation. The purpose of the modification was to preserve the record structure of the tape for those application which count on a FIO read to return one tape record at a time. The fix was for FSETI to set a flag for FILBUF to validate the buffer, rather than having FSETI immediately validate the buffer itself. This was tested and it works fine provided the kernel succeeds in detecting the bad read and positioning the tape properly to the next record following the bad one. (2/25) sys/fio/zfiott.x sys/fio/zfiott.com Modified the playback code in the terminal driver (ZGETTT) to permit multiple data chars in each input line of text when reading in raw mode. In playback mode, each input line is saved in an internal buffer, and characters are returned out of this until it is exhausted and another line of the log file is read. In the process of testing this, I also found and fixed a char/int mismatch bug in a call to cctoc(). (2/26) pkg/cl/errs.c Added code to check during error recovery if the terminal is in raw mode, and reset it to normal line-buffered mode if so. (2/26) sys/gio/gactivate.x sys/gio/greactivate.x sys/gio/cursor/gtr.h sys/gio/cursor/gtrctrl.x sys/gio/cursor/gtropenws.x Had to scrap the changes made to greactivate(), etc., on 2/24. The main revision made at that time was to have greactivate() implement the AW_PAUSE feature directly, when opening the workstation in response to a call to greactivate() in AW_DEFER mode. The problem with this is that the GIO code must be metacode output only, with no direct interaction with the user terminal. I put the code in with an IF-test on the stream, disabling interaction if not writing to STDGRAPH, but of course that is not sufficient. Just goes to show how easy it is to mess the system up if you don't really know whats going on (or if you forget). Interaction with the user in interactive graphics is permitted only in the cursor mode code. Recognition of the activate workstation flags (AW_PAUSE, etc.) in the initial activate workstation implied in the GKI_OPENWS directive is possible in cursor mode, but would have required a change to the external format of the GKI_OPENWS instruction, so I did not do it. The GKI metacode format will probably suffer some changes in the upcoming GIO imaging extensions project, but I did not want to change the metacode format at this time. The AW_PAUSE code was removed from greactivate(), and for the moment the pause flag will simply be ignored when opening the workstation in defer mode. A flags argument was added to the GIO gactivate() function, so that greactivate() can pass the flags argument to OPENWS via gactivate(), so that the calling sequence of this routine will not have to be changed when OPENWS is modified to include a flags field. The IF-test on STDGRAPH in gtrctrl.x, used to test if the AW_PAUSE flags are to be executed or ignored, was replaced by a test on a new descriptor flag field TR_INTERACTIVE(tr). This is set when the workstation is opened in gtropenws.x, if the graphics device is the user terminal. Otherwise, the interactive deactivate/reactivate workstation flags are ignored. (2/27) sys/gio/stdgraph/stgrtty.x [1] When reading from STDIN with the workstation activated, characters are read in raw mode. EOF was not being detected since the raw EOF character is returned as data when in raw mode, and the code was checking for a FIO EOF, rather than looking at the character itself. [2] This routine was not performing a graphics disable (GD), hence a series of reads to the STDIN while in graphics mode, with no associated writes to STDOUT or STDERR, would execute with the entered lines text echoing as if they were appended to the previous line. (2/27) vms/gdev/sgidev/mkpkg.com Modified to move the executables to the HLIB directory, so that this happens automatically when doing a bootstrap. (2/27) sys/fio/fntgfn.x Found an obscure bug in the filename template code, which has probably been there since the code was written. The bug would cause an infinite loop when trying to expand a filename template with FNTGFN (or any of the routines which call it). The routine which returns the next token from the template, upon reaching EOS on the template string, was incorrectly looking at the "last" character in the output string. Since the output string would be the null string, the "last" character was one char off the front end of the array, and could contain any random data. The code was looking for one of the chars $/, and the bug would be harmless unless one of these characters just happened to be at that location. (3/4) unix/hlib/SUN_kludge/precomp.csh [SUN/IRAF] Added a compile-no/optimize entry for main.x (the IRAF main). Did not fully analyze the problem, but an address is being saved in a register and then the register is clobbered before it is used (while building up the argument list to a FSETI call). (3/5) Analysis, 3/6/87 --- This bug fix bothered me, so I went in and analysed it in detail to see what was really causing the problem. The actual compiler bug turned out to be in the module pds_apdp8s in the RPDS task in mtlocal. This is a trivial little procedure, the body of which is so small that I will include it here for reference: for (i=1; i <= npix; i = i + 1) b[i] = (a[i] / 400b) * 100b + mod (int (a[i]), 400b) What is happening is that the compiler is using the register D2 to evaluate the mod function, but the procedure preamble/postamble is not saving and restoring the contents of this register (the bug probably has something to do with the code used to do inline expansion of the MOD intrinsic function). It turns out that the Sun procedure calling sequence requires a procedure to save and restore the contents of registers D2-D7, etc., if they are used in a procedure, so that a procedure which calls a subprocedure can assume that its registers are intact when the called procedure returns (this is common practice on many systems). This can lead to some very obscure bugs like the one we have here. The register D2 is used in the IRAF main; the main calls a task, the task calls a number of procedures, and so on for hundreds of procedure calls before returning to the main. If any of those procedures uses register D2 but does not save and restore it, then the FSETI call in the main either bombs out with a segmentation violation, or FSETI causes a fatal panic shutdown due to an illegal file type code. (Actually, the bug could be masked if any of the intermediate procedures leading back to the main also use, and hence save and restore, the register). In a procedure other than the main, the same bug could occur with completely different results, possibly resulting in improper execution rather than an obvious program crash. Compiling the main without optimization defeats register allocation in the main and the bug goes away (because the main is no longer using the register), but this is treating the symptoms and not fixing the actual bug. Clearly, it is extremely important on machines with calling sequences like that on the Sun that registers be properly saved and restored by called procedures (particularly hand written assembly code procedures), else extremely obscure bugs may result. ------------------- (Begin fixing bugs reported since the new V2.5 was ported to Sun,VMS,AOS). pkg/cl/exec.c In oneof(), added a counter so that the "use logout to logout of the CL" error is only taken a finite number of times. It was still possible to get into a loop when the CL input was a terminal, but the user managed to logout of the computer somehow, causing an infinite sequence of EOF's on the input stream. (3/7) sys/gio/cursor/gtrctrl.x Removed the call to gki_fflush(), which would flush the control instruction to the graphics kernel. This must not be called from within gtr_control() since it involves a call to prpsio() (the pseudofile i/o controller) when writing to a connected subkernel (e.g., the stdplot device), and gtr_control() is itself called from prpsio(), resulting in a reentrant call to prpsio and thus immediate brain damage to the pseudofile i/o system. This was the bug which was causing graphics tasks run with dev=stdplot to fail. (3/7) NOTE - One wonders, if prpsio() reentrancy occurs here, why doesn't it occur in the other calls to gki_flush() and gki_fflush() in the cursor mode code. The reason is that when prpsio() is called to read the next CL command from a subprocess (the user graphics task), a cursor read takes the form of a CL statement like "=gcur". This is a CL command, hence prpsio() will exit back to the CL interpreter. Then when cursor mode is entered and one does something like a snap, which writes to a subkernel and hence involves a call to prpsio(), the routine is called afresh. sys/gio/mkpkg sys/gio/gactivate.x Added a "include <knet.h>". When opening a graphics stream in APPEND mode, the routine was checking the file driver of the output stream to see if it was zardbf, to know whether to get the old WCS from the CL or from UPARM. The test would fail because without <knet.h>, zardbf would be the real routine, rather than the KI version kardbf, used with networking. This was the cause of the bug which would cause a task to hang up reading from CLIN when opening a metacode file in APPEND mode. (3/7) vms/gdev/sgidev/sgi2vccp.f vms/gdev/sgidev/sgi2vimp.f vms/gdev/sgidev/sgi2vptx.f vms/gdev/sgidev/sgi2vqms.f vms/gdev/sgidev/sgi2vtri.f vms/gdev/sgidev/sgi2vver.f vms/gdev/sgidev/sgitranlib.f [+] vms/gdev/sgidev/mkpkg.com Standardized the support routines common to most of the translators and relocated them in sgitranlib.f; modified mkpkg.com to link with it. Detabbed and rewrote fortran continuation lines to make shipment of translators by electronic mail more reliable. Made all translators that can submit to a VMS queue recognize the special queue name 'none', to better support nonspooled devices. (3/2 SRo/SH) (3/7) sys/fio/fseti.x In the F_FIRSTBUFFOFF case, added a call to flush() to flush any buffered file output before calling frmbfs() to return the file buffer. (3/8) sys/imio/db/mkpkg The module list was missing a reference to <imio.h> for idbfind.x. The library module was out of date (on lyra) and was not correctly referencing the IM_UABLOCKED(im) field, causing header parameter searches to fail. (3/8) sys/.../mkpkg Went through and rebuilt most of the module lists in the VOS, to avoid more problems of this type. There were some errors, but did not notice any other serious ones. (3/8) pkg/cl/eparam.c The e_display() function, used by EPARAM to display parameter prompt strings, had a bug which would cause the first character to be repeated in all lines after the first when displaying multiline prompts. I also added a feature which allows a prompt line to take over the whole terminal line if the first char is \r; otherwise, the prompt is displayed in the prompt area at the right of the screen. (3/8) pkg/cl/history.c The #{ ... #} sequences, used to switch to and from command mode on a stream, were not being recognized in "interactive" command streams, i.e., for commands typed in interactively from the terminal. (3/8) pkg/cl/param.h Discovered that the parameter type flags (field p_type in the param structure) were overflowing the allocated storage word (type short) by one bit. The bit that didn't fit was PT_ARRAY, which explains why arrays haven't been working recently in the new CL. Changed the allocation to a full integer and rebuilt the CL. (3/8) pkg/cl/grammar.y Modified the grammar so that compute mode is automatically enabled when typing a parameter declaration in interactively, e.g., "int woof[3]". (3/8) pkg/plot/implot.x Modified so that a ":x" or ":y" with no x/y range arguments both reenables autoscaling and replots the current line or column with autoscaling, rather than merely reenabling autoscaling, as previously. (3/8) unix/os/net/kutil.c Fixed a typo: "text[1] -> text[0]". (3/8) sys/tty/ttysubi.x Replaced the last two occurrences of "argnum" by "revstart" in the code which reverses the deltas; overlooked this when I made the original bug fix on 2/20. The code has now been tested (by Skip). (3/8) sys/clio/clputx.x sys/clio/clputr.x sys/clio/clputi.x sys/clio/clputd.x sys/clio/clputc.x sys/clio/clputb.x sys/clio/clpstr.x sys/clio/clcache.x Modified the CLPUT procedures to update the cached value of a parameter as well as the CL value. If this is not done subsequent CLGET calls during the execution of the same task will continue to return the same value. (3/8) --------------------- (End last round of bug fixes - all bugs reported since 2/24 now fixed.) (VMS/IRAF updated 3/8) (SUN/IRAF updated 3/8) vms/hlib/sgiqueue.com dev/graphcap As part of the current effort to standardize the sgi translators, I changed sgiqueue.com to have a maximum of 4 DCL parameters for each entry. Devices affected are vver, vtri and vptx. Graphcap entries for those devices were updated accordingly. (3/10 SH) sys/osb/f77pak.f Was not blank filling the last character in the F77 output string. (3/10) sys/fio/fntgfn.x There was a problem in the filename template code, when using string substitution to edit a file list expanded upon a logical directory. The pattern matching would be always be performed on the filename ignoring the directory prefix, but the edit would be performed on the full filename including the directory prefix if any, causing the edit to be performed so many chars to the left of where it should be. For example, "lib$*%%_o%.com" should expand to "lib$fio_o.com", "lib$prc_o.com", etc., but "lib_o$fio.com", "lib_o$prc.com" was being produced instead, a 4 char left shift of the insertion, since the ldir prefix is 4 chars long. With no ldir prefix there was no problem, which is why this has gone unreported until now. (3/10) sys/imio/imsetbuf.x The FIO first buffer offset cannot be set to the offset of the first image line unless the offset of that line is aligned on a device block boundary. Added a test to omit the call if the first image line is not aligned in this way (as in STF images). (3/11) dev/graphcap dev/termcap Entries were added for the Graphon 140 terminal. Both entries were originally created by Raymond Talbot of the Aerospace Corp. in L.A., then later modified by George Kaplan at U.C. Berkeley, Space Sciences Lab. The entries have now been tested extensively at UCB. Users should note that they may have to set the GIN terminator to CR in local setup mode. (3/11 SRo) sys/imio/iki/stf/stfopix.x sys/imio/iki/stf/stfwgpb.x Back when the STF image kernel was first written, the GEIS format required that group parameter block header parameters be ordered or sized to avoid holes in the structure, caused by alignment of double floating values to quadword addresses (or so I recall). Anyhow, the STF kernel was written to order the GPB of new images in this way, but it would assume that the GPB of existing images was already ordered this way. STF images have recently appeared which do not adhere to these alignment restrictions for double values, causing the STF kernel to mess up the GPB when opening an existing image READ_WRITE and subsequently updating the header. For example, DATAMIN real DATAMAX real CRPIX1 real CRVAL1 double would cause problems, since there are 3, rather than 2 or 4, reals before the double, causing the double to fail to be aligned to a quadword offset relative to the start of the GPB. I am going to assume that there are no longer any special alignment restrictions on the GPB fields; maybe there never was and this was a misunderstanding on my part. The write-GPB code was modified to work regardless of the field alignment, and the open-pixfile code was modified to skip the reorder-GPB step when create a new image. This will also avoid the annoying reordering of the group parameters for new images, which was being done by the kernel in the past to enforce the alignment restrictions when the input GPB specification was not doing so. (3/13) unix/gdev/mkpkg unix/gdev/zfiogd.x unix/gdev/iism75 A UNIX version of the IIS model 75 interface (M70 data stream filter) was installed. This was tested remotely working with the group at AT&T (Tony Tyson), since we do not have a model 75 here. (3/14 DT/SRo) vms/boot/mkpkg/host.c The $purge function now checks for a missing directory name argument, and avoids the call to vfn2osfn(), which would produce an error message if called with the null string. Also, the VMS PURGE is called with the /LOG switch if mkpkg is executed in debug mode. (3/14) dev/termcap dev/graphcap dev/cacheg.dat dev/cachet.dat Updated the termcap and graphcap files on lyra and draco, and rebuilt the cache files to capture the updated device entries. (3/14) unix/os/zfiomt.c vms/os/zfiomt.c Following a long series of tests to determine the best way to recover from parity errors when reading magtapes, the ZZRDMT primitive was modified to scrap the attempt to zero out the user buffer and repeat the read, which would cause the tape to be left at an unpredictable position. It now simply returns ERR for the first few bad reads, and then starts doing skip record forwards to attempt to recover if a bad read causes the driver to enter an infinite loop trying to read the same record. If a large number of read errors are seen on a tape the driver eventually just returns EOF on the file. We were still getting unpredictable results when trying to read tapes with bad records, but this works in most cases and seems to be the best we can do; the rest is really the responsibility of the host driver and the hardware controller. (3/14) vms/os/net/zfioks.c Someone reported that they could not access a remote node over the network, using a 22 character password on the remote node. God only knows why anyone would want to have a 22 character password, and I guess the Berkeley people didn't expect that either, since the problem turned out to be a 16 char limit imposed by the REXEC daemon. Allowing for the EOS, the maximum password length when calling into a remote UNIX node should thus be 15 chars; in actual tests this failed too, but a 12 char password was ok (maybe a bit longer, I didn't try). The ZFIOKS (IRAF) limit is 32 chars, and I verified that the password string was being written out over the network correctly. I also modified the ZFIOKS open procedure to only ask for the password for a remote node twice, if the same string is entered both times. This prevents the user from being repeatedly asked for the password for a remote node if the node is physically unreachable for some reason, e.g., because the machine is down. The disadvantage is that if the same mistake is made the second time, causing an invalid password to be entered into the password cache, it will be necessary to log out of VMS to clear the error. Note that rubouts are permitted when entering a password, so it should not be difficult to enter a password without any typing errors. (3/14) ------------------ The following changes were made mostly to eliminate library conflicts for the VMS/IRAF shared libraries, and do not involve any functional changes to the affected routines. This initial implementation of VMS shared libraries closely follows that done by Dennis Crabtree last December. pkg/cl/scan.c pkg/cl/opcodes.c Changed the name clscan() to cl_scan(), to avoid a library conflict with the CLSCAN procedure in FMTIO. (3/15) pkg/cl/gram.c pkg/cl/edcap.c pkg/cl/builtin.c pkg/cl/clprintf.c Changed all occurrences of 'strsrt' to 'strsort', and all occurrences of 'strtbl' to 'strtable'. (3/15) pkg/system/sort.x This program contained two internal routines GTEXT and GOPEN which conflicted with the GIO procedures of the same name. Went through and cleaned up this ancient code, adding a package prefix to all internal routines (which solved the name problem), and in general bringing the code up to modern IRAF standards. (3/15) vms/gdev/iism70/mkpkg vms/gdev/iism70/m70wti.f - Deleted the M70WTI routine, which was not used anywhere, and which referenced a lower level routine RBUTN which was not present in the library, causing an unresolved module reference when building the shared library. (3/15) sys/imio/imdmap.x This routine had an illegal backwards library reference to the IMDOPEN procedure (FIO device open procedure for the display device) in the TV package code. Since the routine bypasses the IMIO interface and has explicit knowledge of the IMIO internal data structures, it needs to be part of the IMIO interface and it was not really correct to move it to a package source directory. I solved the problem by deleting the old, unused min_lenuserarea argument and replacing it by a reference to the imdopen() external function, so that the application can pass this in at runtime. (3/15) pkg/images/tv/display/dsmap.x Modified the call to the IMDMAP procedure in accord with the above change to the calling sequence. Note that all the other hacked versions of the display task (grinnell@ctio, iism75@steward/cti, deanza@stsci) will also need to be modified. (3/15) pkg/images/imutil/t_imcopy.x pkg/images/imutil/imcopy.x pkg/images/imfit/t_lineclean.x Added a local package prefix to the internal procedure name 'imcopy', to avoid a name conflict with the (as yet partially implemented) IMIO procedure of the same name. (3/15) ------------------------- (end of shared library related changes to the VOS and applications) unix/boot/rtar/rtar.c vms/boot/rtar/rtar.c In the switch/case which processes the argument list flags, case 'f', added a test for (*argp==NULL) to avoid a segmentation violation in tape_open in the event of a missing filename argument. (3/15) ------------------------- (All systems updated; on draco, deleted all binaries and did a full sysgen (to ensure that all old objects were removed from the libraries.) (3/15) local/login.cl [UNIX/IRAF] Regenerated the login.cl file for V2.5. (3/16) ------------------------- System moved to node GLL1 (microvax/gpx); Ultrix 1.2 port begun. (3/16) dev/hosts dev/uhosts Brought these files up to date for our local network. (3/17) unix/os/zfiotx.c pkg/cl/errs.c pkg/cl/history.c Minor changes were made in these files to improve the ability of the CL to recover (restore line mode i/o) when an error occurs in a program which uses raw mode i/o. The OS terminal driver would save and restore the terminal mode bits when setting raw mode, which is great, but if raw mode somehow got physically set on the device then it could never be cleared. Now, when the terminal driver is commanded to disable raw mode it will do so, regardless of the previous state of the device. Also, if the terminal driver receives the raw mode off escape sequence it will clear raw mode even if it was never set at the driver level. (3/17) ------------------------- Initial port of IRAF to Ultrix 1.2 completed without incident. (3/17) gio/cursor/rcursor.x Added calls to gtr_page() and gtr_waitpage() to take the workstation into and out of terminal mode when executing a :! os escape from cursor mode. (3/18) gio/cursor/grccmd.x gio/cursor/grcread.x gio/cursor/grcwrite.x gio/cursor/grcwarn.x + There were still situations where messages written by low level code in the CL process could end up in alpha mode text in the graphics plane, while processing a :. command in cursor mode, e.g., :.read, :.write, :.snap, and so on. For example, error messages would come out in the graphics plane, as would the enter password prompt when sending graphics output to a remote node for the first time. This would happen because when a colon command is read, the GE sequence is issued when newline is seen, i.e., when the user types carriage return. This is not a problem for colon commands in applications code since all pseudofile i/o is processed through the stdgraph kernel, but the low level code in the CL process can read and write directly to the terminal. The solution was to echo the colon command on the status line without the newline terminator. Any subsequent text is then appended to the text already in the status line. One nice benefit of this is that when the user types the "=" key to do a snap, the command ":.snap" is echoed on the status line, providing positive feedback to the user. I also added some code to intercept error messages (grcwarn.x) and print them in the status line. (3/18) pkg/plot/implot.x IMPLOT now includes the system banner (etc.sysid) in the plot title. (3/18) vms/os/zfchdr.c Modified ZFGCWD to return the current directory in lower case, rather than upper case. This was breaking the new MKPKG special file search code described below (directory string comparisons were failing due to a case mismatch). Anyhow, pathnames have long been coming out in mixed case on VMS (e.g., "[IRAF.SYS.OSB]f77pak.for"), which is inconsistent and unaesthetic. (3/19) unix/boot/mkpkg/char.c unix/boot/mkpkg/main.c unix/boot/mkpkg/mkpkg unix/boot/mkpkg/mkpkg.csh unix/boot/mkpkg/mkpkg.h unix/boot/mkpkg/mkpkg.hlp [UNIX,VMS,SUN] unix/boot/mkpkg/pkg.c unix/boot/mkpkg/sflist.c unix/boot/mkpkg/tok.c Made several enhancements to MKPKG, the major one being the addition of a new "special file list" capability. Other, minor enhancements include reorganization of the main to permit multiple subprograms on the command line, e.g., "mkpkg relink install", and some improvements to the detection of interrupts. The special file list capability makes it possible to flag any source file in the system for special processing in a host specific fashion, without making any changes to the portable system. This is done by declaring all the special files for a given host operating system in the new file "mkpkg.sf" in HLIB. Examples of files needing special processing are files which have been optimized in assembler for a specific host system, and files which need to be compiled in a nonstandard way to avoid bugs in a host compiler. The special file list replaces both the "$iffile as$file.s" type constructs in portable mkpkg files, as well as compiler bug scripts like the "precomp.csh" file in the "hlib$SUN_kludge" directory in SUN/IRAF. (3/19) unix/as/*.s unix/hlib/mkpkg.inc [UNIX,SUN] unix/hlib/mkpkg.sf + vms/as/*.s vms/hlib/mkpkg.inc [VMS] vms/hlib/mkpkg.sf + Added the mkpkg.sf special file list for each system (it is similar but different for every system), and a $include for it in hlib$mkpkg.inc so that the special files are defined regardless of who runs mkpkg, or from what directory. Some changes were also required in the AS directory, e.g., bitpak.s/bitupk.s were combined as bitfields.s, to provide a one to one file mapping with bitfields.c in OSB. (3/19) sys/osb/mkpkg sys/libc/mkpkg sys/gio/nspp/sysint/mkpkg sys/gio/ncarutil/sysint/mkpkg sys/vops/lz/mkpkg sys/vops/ak/mkpkg These mkpkg files were modified to remove $iffile references to special source files in AS, since this is now handled by the special file list capability. (3/19) pkg/xtools/mkpkg Added a "$purge lib$" to get rid of the new version of libxtools on VMS. (3/19) ----------------------- Updated all systems. (3/19) bin/s_iraf.e + vms/hlib/linkiraf.opt + vms/hlib/irafuser.com [VMS/IRAF SHARED LIBRARIES] vms/hlib/login.cl vms/boot/spp/xc.c vms/hlib/share/* Modified VMS/IRAF to use shared libraries. For this to work, the system manager must install the image bin$s_share.e when IRAF is installed. The use of shared libaries reduced the amount of disk consumed by the IRAF executables (BIN) from around 30000 blocks (15Mb) to less than 10000 blocks (5Mb), i.e., slightly more than a factor of 3; this should be a real boon to our microvax users with small disks. Memory usage and link time should be correspondingly reduced, and process startup should be speeded up somewhat, although most of the time is probably spent on things other than paging. The XC task can be used to link images either with the shared library image (-n) or as a fully resolved image (-z). I set the default to be to use the shared library, since that is fastest and most efficient, and is bound to be what people want most of the time. The principle disadvantage is that symbol table information is not available for the shared library, hence it is more diffiicult (but still possible) to wander around in the system libraries with the debugger. To get around this I added the -z flag to the foreign task definition for MKDEBUG; it is necessary to run MKIRAF or edit your LOGIN.CL file to pick this up. If one only wants to debug user code, "xc -x" will use the shared library, giving a much faster link but no system symbols. The code used to generate the shared library is a bit of a kluge at present. In particular, the shared library must be generated manually; it is not done automatically in a sysgen. This will be remedied in a future release. (3/21) sys/fmtio/strsrt.x sys/fmtio/strcmp.x + Added a new routine strcmp (more efficient than using strncmp with maxch=ARB), and made minor optimizations to the code of the other routines. The calling sequence of STRSRT (the string sorter) was chanaged slightly, after first searching the system for all the routines that use it; the routine is relatively new and is currently only used in system code. The new string sorter chooses the pivot element for the quick sort algorithm differently, to avoid quadratic behavior when sorting an already sorted array. (3/22) sys/fio/fntgfn.x sys/imio/db/imgnfn.x sys/imfort/db/imgnfn.x pkg/system/directory.x These routines all referenced STRSRT, and had to be modified to agree with the change to the calling sequence noted above. (3/22) sys/fmtio/str*.x sys/fmtio/gstr*.x sys/fmtio/zzdebug.x All of these old routines used for-loops rather than do-loops to march down the string. Where appropriate, converted these to use do-loops to trigger the Fortran optimizer. In many of the string comparison operators (strlt, strge, strncmp, etc.) I was also able to simplify the logic considerably, making them somewhat faster. STRTBL was rewritten to use the more efficient putline rather than putc to format the output table. Since some of the routines were either extensively revised or completely rewritten, I added a set of test programs to zzdebug.x and tested all the routines. An old bug was found and fixed in the process: strmatch was not recognizing EOS for an end of line match ($). This was added to patmatch() a while back, but evidently I forgot to add it to strmatch too. (3/22) pkg/system/directory.x pkg/system/doc/directory.hlp The directory lister was reworked extensively to recognize and execute specially optimized code for the most common cases. The most important of the low level routines called by the directory program were also optimized, as noted above. A new "horizontal" (VMS like) file ordering format was added as an option to supplement the default "vertical" format. In common cases the directory lister is now about 50% faster than previously. I also determined that there were a couple of cases where the old program would perform especially poorly. The first case was when listing very large directories, since the way the old program was constructed it would always read the entire file list into memory before formatting the output table. The new "horizontal" format is provided as an option to address this case. The second case where poor performance could result was when listing very large directories that are stored by the host system in sort order (as in VMS). The quick sort algorithm used would exhibit quadratic behavior when sorting an already sorted list, i.e., the sort time would grow as the number of files squared if the file list was already sorted. For small directories (less than 100 files) the effect was not significant, but when listing very large directories this could be a major effect. The latter problem was solved in two ways: [1] the new non-sorting, "horizontal" listing option avoids the problem entirely, and [2] the new STRSRT subroutine avoids the quadratic behavior. With the revised quick sort algorithm, the expense of sorting typically runs only about 3% of the total run time. The pattern matching code was also optimized. Simple "*.xx" style filename extension templates are recognized as a special case and a very fast custom inline pattern matching scheme is used in this case. The "horizontal" format option is enabled by setting the directory.sort parameter to NO (the default is YES, which is faster and nicer in most cases). If sorting is disabled, the task will print the listing out line by line as files are physically read from the directory, in much the same way that the VMS directory lister does. In addition, if the standard output is not redirected the output will be flushed after every 1 to 4 lines. The only significant optimization remaining to be made would be to move the directory program into the CL process, but provided that the system is not paging heavily the performance should be fine with the current process structure, i.e., the directory listing should appear in few tenths of a second for modest sized listings, even on an 11/750. (3/22) pkg/system/sort.x pkg/system/sort.par pkg/system/doc/sort.hlp Modified the quick sort code in the SORT program to avoid quadratic behavior on an already sorted list. (3/22) sys/etc/qsort.x sys/vops/asrt.gx Put the same fixes into these quick sorters. (3/22) ------------------- (All systems updated.) (3/22) local/notes.v24 [all systems] Changed the name of the system notes file to notes.v25. Actually, it contains the notes for both IRAF revisions 2.4 and 2.5. (3/23) unix/*/mkpkg unix/*/mkpkg.csh unix/hlib/irafuser.csh Changed the name of all the 'mkpkg.csh' files, used to bootstrap the UNIX HSI, to 'mkpkg.sh', since they are SH command files. Added system definable switches HSI_CF and HSI_FF to all calls to compile or link HSI C or Fortran code, e.g, "cc -c $HSI_CF file.c". These are defined as environment variables in hlib$irafuser.csh. An additional variable, HSI_XF, is also defined and is used as XFLAGS in all the HSI mkpkg files. This feature makes it possible to control the compilation and linking of all the HSI programs by changing a single file. [SUN/IRAF]: I tried to use this new feature to compile the HSI bootstrap programs for SUN/IRAF with the -mc68010 option, so that the HSI could be run on the old Sun-2s, but it turns out that this does not work because all the Sun system libraries were compiled for the mc68020. Hence, sites with Sun-2s will need to do a bootstrap, but that is not a big deal. The Sun HSI uses only software floating point (if it uses any at all), so most sites will not need to do a bootstrap, although it may be necessary to do a full sysgen. (3/23) unix/rmbin.sh + Added a new shell script to the UNIX HSI, to be used to strip the binaries from the HSI if the RMBIN task is not runnable for some reason, e.g., if the binaries were compiled on an incompatible host, or if the bootstrap is aborted. (3/23) ------------------ The standard VMS/IRAF user system (IRAF) updated to V2.5 on draco. (3/23) V2.5 is now the standard user system at NOAO. pkg/cl/gram.c Changed the trailing "EOF" output by DPARAM to "# EOF" so that naive programs will ignore it, but it will still be there to mark the end of the list. This is really just a workaround though; the IPC mechanism should provide better support for list and array i/o. (3/24) pkg/system/directory.x Fixed a bug in the special case extension matching code which would cause it to accept a partial match of the extension string, rather than requiring a full match. (3/25) vms/hlib/login.cl For VMS/IRAF, added a -z to the FC foreign task definition to prevent use of the IRAF shared library, which is not needed (the IMFORT interface is layered directly upon the kernel), and which causes name conflicts. (3/25) sys/fio/fwtacc.x sys/fio/zzdebug.x Added code to fwtacc (the "waiting for access to file" code) to check if the maximum number of physical file descriptors for the process has been exceeded. If this occurs a file open error will occur, returning errcode = SYS_FTOOMANYFILES to the caller. (3/25) sys/imio/imt.x sys/fio/fntgfn.x Modified both the image template and file template packages to permit the input template string to be any arbitrary size. (3/26) unix/hlib/stripper unix/hlib/stripall Deleted the reference to the cryomap map data file, since the file no longer exists. Also modified the stripall script to not delete the .h files in hlib and hlib$libc. (3/26) doc/aosvsiraf.hlp + Added the installation guide for AOS/IRAF (courtesy of Skip Schaller, Steward Obs.) to the system docs file. (3/26) local/tasks/lnews.cl + local/tasks/local.cl [VMS/IRAF only] local/tasks/local.men Added a new task LNEWS to the LOCAL package on VMS/IRAF. This task uses the IRAF pager to page the local (NOAO) VMS system news file. Although this can also be done with !news, the IRAF pager is much more sophisticated, and it works for non-DEC terminals. (3/26) unix/gdev/sgidev/sgi2uapl.c unix/gdev/sgidev/sgi2uimp.c unix/gdev/sgidev/sgi2uqms.c Replaced the #define SWAP_BYTES with code to determine whether we are running on a byte-swapping machine at runtime. (3/27 SRo) ------------------------- Nodes aquila and carina were updated to V2.5. (3/27) Draco, pavo, tucana, octans updated. (3/28) /etc/printcap /usr/spool/lw + /local/bin/sgi2uapl + unix/hlib/sgi2uapl.e + unix/hlib/sgi2uqms.e + Installed the Apple laserwriter as an lpr device under UNIX on lyra, and compiled and installed the appropriate IRAF/SGI translator in HLIB, with link in /usr/bin. (3/30) dev/termcap dev/graphcap Added tek 4010 entry, identical to 4012 except that it uses 74 text columns instead of 75. (3/31 SRo) dev/graphcap dev/termcap Merged the AOS graphcap and termcap files, contributed by Skip Schaller, into the lyra graphcap and termcap files. (3/31 SeH) pkg/cl/grammar.y The grammar was not permitting switch (xxx) { case 1: <stmt> ... as the newline following the "case 1:" was not allowed for in the grammar. Modified the grammar to permit the newline. (3/31) dev/hosts Added entries for the three U. of A. nodes, recently added to our Ethernet (solpl, cti, taurus). (4/1) pkg/images/tv/display/iispio.x pkg/images/tv/display/zsttim.x pkg/images/tv/cv/iism70/iispio.x Egad! Found a quite serious bug in the display code which must have been there quite a while. Probably hasn't shown up because it only affects display access over the network, and the network was probably placing enough of a limit on the max transfer size to hide the problem. The size of the intermediate buffer which is malloc'ed in the IISPIO code was being calculated improperly. The code was assuming the value IIS_MAXBUFSIZE to be in units of xchars, whereas it is actually in units of bytes since it is an FIO parameter. The buffer being allocated would therefore be too small by a factor of two, causing a segmentation violation on the Sun. (4/4) pkg/images/tv/display/t_display.x In the call to AMAPS, the z1,z2 etc. arguments, which are supposed to be of type short, were being passed as short(z1),short(z2), etc. This ought to work, but coercion to type char or short in SPP argument lists is not currently supported, and it is easier to just use temporary variables of type short in the code. (4/4) ------------------------------- All systems updated; first version of IMTOOL installed on the Sun systems. (4/5) dev/termcap Added a missing `=' to the `cl' parameter for the vt640. (4/14 SRo) sys/gio/doc/gio.hlp Updated the GIO documentation; fairly extensive modifications, accurately describes all recent GIO revisions and fixes many ancient errors in the documentation. (4/22) pkg/language/language.hd pkg/language/language.men pkg/language/doc/eparam.hlp pkg/language/doc/set.hlp pkg/language/doc/lparam.hlp pkg/language/doc/dparam.hlp + pkg/language/doc/edit.hlp pkg/language/doc/task.hlp pkg/language/doc/commands.hlp pkg/language/doc/cursors.hlp Updated the LANGUAGE package manual pages. (4/23) [shared library name collisions] [DISCUSSION] I did a cross reference of all symbols in the 4 main IRAF libraries used to build the shared library (sys,ex,vops,os) against all the other libraries and all the .o and .a files in PKG and NOAO, to locate any redefinitions of system symbols by applications code. This was done on UNIX node pavo (using the UNIX tools, of course), with the following results: pkg/cl/cl.o:0000023c T _onenty_ pkg/images/libpkg.a:shiftlines.o:0000046c T _shifti_ pkg/images/libpkg.a:shiftlines.o:00000000 T _shifts_ These symbols collide with system symbols of the same name; not bad out of the 5000 or so procedures in the system. The _onenty_ (ONENTRY) is well understood, and is already allowed for in the shared libraries. The _shift[is]_ collide with bit shift procedures in OSB, and it turns out that this problem has already been discovered and fixed in the master lyra system, so for the moment at least, there are no name collisions in the system (except possibly between applications code and the math and tools libraries). (4/23) sys/gio/cursor/prpsio.x Fixed a bug which was causing the OPENWS instruction to be lost when writing to a GIO subkernel. When the GTRCTRL routine sees OPENWS it physically connects the kernel and deposits the OPENWS instruction in the stream spoolfile, but does not flush the metacode to the subkernel as this would result in a reentrant call to PRPSIO. The bug was that the PRPSIO routine was unnecessarily cancelling the graphics stream before calling GIOTR to process input metacode through the workstation tranformation and depositing the transformed metacode in the stream, ready to be ready by the subkernel in an XFER request. Logically, it should only be necessary to cancel the graphics stream once, when the kernel is connected to a stream, and thereafter only AFTER the reader has read the data formerly posted to the stream. (4/23) sys/imfort/imps3s.x Fixed a typo; the procedure name was given as 'imps2s', whereas of course it should have been 'imps3s'. (4/23) unix/os/alloc.c Made a couple of minor changes to the device allocator for system security reasons. The old program would allow the knowledgeable user to specify by pathname the files to be allocated. Now only files in /dev can be allocated, and since /dev is protected the process should be secure. Furthermore, the old program would allow files to be allocated to the user regardless of their former permissions, allowing the user access to raw devices or kernel memory. The new program only allows device files to be allocated which have world read/write permissions prior to allocation. (4/23) dev/pix.imh dev/pix.pix Replaced the old standard test image, dev$pix, by a new picture of M51 (the whirlpool nebula). The new image is more interesting, and also has the advantage of being the canonical image size, 512 square (this was interpolated up from a 508 square CCD frame). The pixel type is short integer. (4/23) sys/imio/imdmap.x Modified this procedure (used to open a image display as an image file) to look for a graphcap parameter "z0", used to set the zero point for the output device pixel range. If the value is not given a zero origin is assumed. (4/25) pkg/images/iminfo/t_imstat.x Hacked the IMSTAT code to make the inner loop somewhat more efficient, and to add package prefixes to internal procedure names. (4/25) dev/graphcap Added an entry for the IMTOOL display server. (4/25) unix/hlib/irafuser.csh In the entries HSI_XFLAGS etc., deleted the "-c" flag, as this is supplied where needed by all the HSI mkpkg.sh files, and it must not be there unless needed (it can cause an object file to be installed in the system as an executable, causing myserious runtime problems, to say the least). (4/25) unix/gdev/zfiogd.x [SUN/IRAF] unix/hlib/mkpkg.sf [SUN/IRAF] local/sun/iisopn.x [SUN/IRAF] The current prototype IMTOOL display server on the SUN systems uses the standard DISPLAY program with very minor changes, in particular, the file iisopn.x was hacked. To avoid having to modify the portable part of the system I put the hacked file in local/sun and added the file to the SUN/IRAF special file list. This is all temporary, probably the next step will require more significant changes. (4/25) dev/termcap [SUN/IRAF] dev/graphcap [SUN/IRAF] Updated from Lyra. (4/25) ---------------------------------- VMS/IRAF Updated. Full compile of IRAF performed to correct optimizer problem. (4/25) pkg/images/mkpkg [VMS/IRAF, usr$2 only (production system!)] The mkpkg file had a -x flag in the $link, which someone had obviously added for debugging and then forgotten to delete. Note that there is no reason to do such a dangerous thing, since 'mkdebug' is already available (as a foreign task), and it does the same thing. (4/25) vms/hlib/mkpkg.sf [VMS/IRAF] unix/hlib/mkpkg.sf [VAX UNIX/IRAF] In the MKPKG special file list, the reference to vops$lz/amov*.x had to be changed to an explicit series of references amovi.x, amovs.x, etc., since amov*.x matches the amovk*.x as well. (4/25) vms/hlib/mkpkg.inc vms/hlib/install.com [VMS/IRAF] Although there is not supposed to be any interaction between the production iraf system 'IRAF' and 'IRAFX', when the sysgen of IRAFX completed it turned out that IRAF no longer worked. I eventually decided that one cannot have more than one version of VMS/IRAF on the system which uses shared libraries, unless of course they both use the same identical shared library. Without resorting to reading the VMS manuals, I think what may be happening is that the shared library defines a number of global sections which are literally global. If two different shared libraries define different global sections with the same names, the one which is actually used at runtime depends upon the order in which they were installed or something, hence a completely wrong section may be referenced, causing an access violation, illegal instruction, or whatever at runtime. The solution for the moment is to use the shared libraries only in the production IRAF system. In IRAFX, I set LFLAGS to "-z" in mkpkg.inc, causing all the executables to be linked stand alone. I found that even so much as installing one of the non-shared library linked IRAFX executables would cause IRAF processes to fail (despite being on another disk), so at present none of the IRAFX executables are even installed. (4/26) lib/imset.h sys/imio/imstats.x + Added a new procedure IMSTATS to IMIO, and a new imstat parameter code IM_IMAGENAME to <imset.h>. This is used to return the image (section) name, as passed to IMMAP at image open time. (4/27) sys/imfort/doc/imfort.ms The pathname of the OS library was incorrectly given as "lib$libos.a" rather than "hlib$libos.a". (4/27) local/tasks/mkpkg Added a '$purge bin$' statement to purge the newly installed x_local.e executable in bin. (4/27) ------------------------------- Archive tapes made for ISI, Masscomp ports. (4/28) sys/gio/gtick.gx Fixed a bug that in a special case (negative axis limits, negative step) would cause the wrong first tick to be selected. (4/28) sys/gio/glabax/glbfind.x Added protection against INLEFT ever being set to a negative value when setting up the drawing parmeters for an axis. This should not be possible, but was happening as a result of the above bug, and would result in an infinite loop. (4/28) ------------------------------------------------- Archive tapes made for SAO Ultrix site (limited disk). (4/29 SRo) unix/gdev/sgidev/sgidispatch.c + unix/gdev/sgidev/mkpkg.sh unix/hlib/sgi.tab + dev/graphcap local/bin/sgidispatch -> hlib$sgidispatch.e + local/bin/sgi2uimp - local/bin/sgi2uapl - Modified the UNIX SGI translator mechanism to require only one link, sgidispatch, which gets passed the name of the translator from the DD string in graphcap and locates its pathname from the sgi.tab file. This simplifies device installation in UNIX and no longer requires one to remember which systems require which links in /local/bin. (4/29 SRo) ----------------------------------- Updated {IRAFX,IRAF}@draco, tucana. (4/30) ---------------------------------- Updated gll1 Ultrix/IRAF (5/1 SRo) lib/scr/implot.key Implot was exhibiting different behaviour on draco from lyra when requesting task help with `?'; the implot.key file on draco had a more recent file date and had one fewer screen line (22 rather than 23, the latter a blank line). Since the user of a 23-line terminal experiences one less keystroke with a 22-line help page, the lyra version was edited to match that on draco. (5/8 SRo) sys/imfort/imakwd.x Fixed a typo; the comment string was being unpacked into the keyword name string, overwriting it, with the actual comment string never being initialized. (5/15) unix/boot/generic/chario.c + unix/boot/generic/lexyy.c unix/boot/generic/mkpkg.sh (VMS generic preprocessor bug) unix/boot/generic/generic.c unix/boot/generic/lex.sed The $for ... $endfor construct was not working in the VMS version of the GENERIC utility due to the old FSEEK bug in the VMS C compiler, which I ran into back when MKPKG was developed. I ended up developing a set of routines k_getc, k_fseek, etc., to get around this problem in MKPKG; the code for these was copied to file chario.c, and the other files modified to make use of the new routines instead of calling the C library routines directly. (5/16) vms/boot/generic/chario.c + vms/boot/generic/lexyy.c vms/boot/generic/mkpkg.com vms/boot/generic/generic.c Updated the VMS version of GENERIC. (5/16) sys/etc/maideh.x Changed the default action for an arithmetic exception to a fatal error (causing task termination), like the other classes of exceptions. There is no way an arithmetic exception can be caught and handled in an IFERR reliably anyhow, due to limitations on the semantics of ZXWHEN imposed by different host systems. An arithmetic exception occurring within an IFERR could lead to an infinite loop on some systems. (5/17) sys/imio/db/idbgstr.x sys/imio/db/idbpstr.x sys/imio/db/imgftype.x Modified so that the "i_" prefix is optional, to be consistent with idb_kwlookup(). (5/17) sys/imio/db/imgftype.x Changed the "if (numeric)" at the end to "if (!numeric)". (5/17) dev/vi.ed Made various changes to this file so that either <ctrl/d> or <ctrl/z> can be used to exit from EPARAM when editor=vi. (5/18) pkg/cl/eparam.c Made minor changes, deleting a few redundant fflush() calls (reduced to only one per output line) to speed things up a trifle. (5/18) pkg/bench/bench.hlp Updated the document, adding/deleting a few paragraphs here and there, fixing some erroneous pathnames, and so on. Still need to update the actual benchmarks section. (5/19) sys/ki/irafks.x Fixed several bugs in the (never before used) device allocation and remote magtape access code. These bugs were found when the KI was used (at Steward Obs.) to access magtape devices on a Data General MV/10000 from IRAF programs on a Sun workstation. (5/20) unix/os/gmttolst.c Fixed a bug in the way daylight savings time was calculated. (5/20) unix/os/mkpkg unix/os/net/mkpkg unix/boot/bootlib/mkpkg unix/boot/mkpkg/mkpkg Changed the '$set XFLAGS = "$(HSI_XC)"' definitions in these files to '$set XFLAGS = "-c $(HSI_XC)"', since the definition of HSI_XC in hlib$irafuser.csh no longer includes the -c (since it is used to make executables as well as compile objects). (5/21) unix/os/zfacss.c Modified the heuristic used to discriminate between text and binary files to increase the amount of file data inspected, and to require the presence of newline characters in text data for the file to be considered a text file. This is required to discriminate between text files and binary files containing text, e.g., card image files or FITS files. (5/21) [The VMS version of this routine does not use the heuristic, since VMS [makes a distinction between text and binary files at the host system [level, hence did not have to be modified. unix/os/zfioks.c unix/os/net/zfioks.c vms/os/net/zfioks.c Modified the code which parses the .irafhosts file to permit arbitrary characters (other than just alphanumerics and underscores) in whitespace delimited tokens, e.g., host names, login names, and passwords. (5/21) [Ran a test and verified that node names (and presumably also login [names and passwords) may contain arbitrary characters such as '-'. sys/fmtio/parg.x Added some errchk declarations to PARGG. (5/21) sys/imio/db/idbkwlu.x sys/imfort/db/idbkwlu.x This code was permitting abbreviations of the standard keywords; modified to require a full match. (5/21) sys/etc/oscmd.x This routine was not recognizing dev$null as an output file, causing foreign tasks executed with their output redirected to the null file (e.g., "mkpkg >& dev$null") to do a physical file write. To avoid having to mess with null files at the ZOSCMD level, I set the routine up to spool the output into a temporary file, deleting the file at the end to dispose of the output. (5/22) sys/gio/stdgraph/stginit.x Added a check for the capability "tx", used to indicate whether or not the device implements text generation in hardware. If the capability is not defined, the kernel will now set software character generation automatically. (5/22) sys/ki/irafks.x Fixed a typo in the kernel server code for ZFRNAM (the file rename primitive). The first filename was being used twice, ignoring the second filename and causing the rename to be a no-op. (5/22) unix/boot/mkpkg/host.c Modified the h_direq() function, used to compare to host directory pathnames for equality, to ignore everything to the left of the "iraf/", if both strings contains such a substring. This was necessary for VMS, and now it turns out to be necessary for UNIX too. The problem occurs when a UNIX directory name like "/usr" is a symbolic link to some other directory. Directory pathnames will appear to be rooted off "/usr" in MKPKG, but the get-cwd primitive will always return the physical pathname, causing the directory comparison to fail when it shouldn't. This happens on our Sun systems currently when a fileserver system accesses the same version of IRAF as the primary system, e.g., because the physical directory name is "/usr.MC68020" but appears as "/usr" in all the IRAF files. Replacing the "/usr" in the IRAF files (.login etc.) did not solve the problem, as the physical directory name was "/usr" on the diskless node. (5/24) unix/boot/mkpkg/pkg.c unix/boot/mkpkg/tok.c unix/boot/mkpkg/host.c If a file was checked out of a remote directory which had the same name as a file in the local directory, the local file would be deleted and replaced by the checked out file, and the latter would be deleted when the update finished. This is appropriate for checking out libraries, but not for checking out source files on the special file list, as this could result in the standard source file being deleted if the file was on the special file list. Modified h_outcheck and h_incheck to add a "clobber" parameter to h_outcheck noting whether any local copy is to be clobbered or preserved, with the extension ".cko" being added to the local file if the file is to be preserved. At checkin time, if the pointer to the remote directory name is NULL the file is not actually checked back in, rather the local copy is deleted, renaming the .cko file, if present, back to its orignal name. (5/25) vms/boot/mkpkg/pkg.c vms/boot/mkpkg/tok.c vms/boot/mkpkg/host.c Merged above bug fix into the VMS version of mkpkg. (5/25) sys/ki/kzopmt.x Was calling ki_getchan() to assign a channel slot even if the kernel open procedure returned ERR, causing the high level open procedure to fail to see the open failure. (5/25) sys/fio/fseti.x To the F_VALIDATE case, added an assignment into field FNBYTES of the FIO file descriptor, so that a fstati(fd,F_SBBLK) will return the validated record size in bytes. (5/25) unix/os/zfiomt.c vms/os/zfiomt.c For technical reasons (reliable detection of EOT) when positioning to a file, files are skipped by executing a record skip forward followed by a file skip forward for each file to be skipped. If a read/parity error occurred while doing the skip record on the first record of a file, the driver would formerly abort the file open. Since the record skip is followed by a file skip it is probably harmless, so the driver was changed to print a warning message, ignore the error, and proceed with the file skip. (5/25) unix/os/zmaloc.c Restored the source for the old 4.1BSD memory allocator. This will be used in place of the host system memory allocator (malloc,free,realloc) if any of the following are defined (in <iraf.h>): DEBUGMEM, BSD42, BSD43. It turns out that the memory allocator used in 4.[23]BSD, while undoubtedly a very fast allocator for applications using zillions of very small buffers, utilizes storage extremely inefficiently in applications which use a few possibly very large buffers. The old allocator used a circular list allocation scheme which could be very time (and working set) inefficient for applications with zillions of small buffers, but which would allocate no more space than needed and would reclaim, join, and reuse freed buffers efficiently. The new allocator is time efficient but requires that storage be allocated internally in units of 2**N bytes, allowing freed buffers to be reused but not changed in size. This could lead to gross inefficiencies when allocating large buffers, e.g., the actual space allocated might be twice as large as what is needed, and once the space was allocated the no-resize restriction would prevent it being used again for a large number of small buffers. Note that use of a non-standard memory allocator may not be possible on some UNIX systems, because applications may link with modules in host libraries which assume the existence of a different (host system) memory allocator with special properties. Unless there is good reason to do otherwise, the memory allocator provided should only be used with 4.[23]BSD systems. (5/26) dev/devices [UNIX,VMS] sys/etc/xgdevlist.x sys/etc/xalloc.x sys/mtio/mtio.h sys/mtio/mtopen.x sys/mtio/mtosdev.x sys/mtio/mtrewind.x sys/mtio/zsttmt.x Added an optional new parmeter to the entry for a device in the dev$devices file. The new parameter, if present, specifies the max transfer size for the device, or the maximum record size for magtape devices. If the parameter is not present MTIO will indicate to FIO that there is no max record size, leaving it up to the application to determine the actual record size to be used. Old dev$devices syntax: device device_driver_text New syntax: device [%NNNN] device_driver_text e.g., mta.1600 %8192 nrmt8 mt0 mt4 ... The % notation was used to make the parameter optional, making the change upwards compatible with the existing device tables. (5/26) sys/vops/alui.gx This vector operator (lookup and interpolate) is not supposed to do bounds checking, but this sets a subtle trap as the case X = exactly NPIX will cause a reference one pixel off the right end of the input array. Even though the out of bounds pixel value is only multiplied by zero, this can cause an arithmetic error as the garbage pixel can have any value. To detect and avoid this case, and also speed up the case where the interpolation points are integral, I added a check to see if the fractional offset from the leftmost pixel of an interval is near zero, using the value of the leftmost pixel directly without interpolation in this case. Note that the routine still does not do actual bounds checking. (5/26-27) unix/as/aluis.s unix/as/aluir.s unix/hlib/mkpkg.sf This change obsoletes the VAX-optimized assembler versions of these routines. The UNIX f77 compiler is now good enough that we do not need the hand optimized routines anyhow, so I commented out the entries for them in the mkpkg.sf file. The assembler sources will be kept around for a while with [OBSOLETE] comments in the code. These routines are not optimized in assembler on any other system. (5/27) ------------------------ Updated IRAFX, tucana/pavo. (5/26) unix/os/zfiomt.c If the drive is opened with newfile=0, the tape will not be moved. The VMS/IRAF version of the magtape driver was already set up this way. (5/27) sys/mtio/mtopen.x sys/mtio/mtrdlock.x sys/mtio/mtparse.x If a tape is opened explicitly to file zero, e.g., "mta[0]", MTIO will now try to open the drive without moving the tape, by ignoring the information in the .lok file, and by calling the kernel driver with newfile=0. Since the actual file position is unknown, the tape is arbitrarily assumed to be at file=1, record=1 following the open. NOTE that this feature may not be implemented, or be implementable, on all systems. The intended use of the feature is to allow recovery of bad tapes which cannot ordinarily be read by the portable IRAF readers, by using a host dependent utility to manually position the drive, which is then opened at file "[0]" and read without being moved. (5/27) sys/mtio/mtopen.x When writing to a tape, a warning message is now printed if the record size (FIO buffer size) requested in a MTOPEN call exceeds the maximum record size (F_MAXBUFSIZE) for the device. Nothing is done on a read since it is routine to open tape devices with a very large input buffer, to accomodate arbitrarily large records. Reader programs which must be able to read or write a certain size record may wish to check F_MAXBUFSIZE themselves (any time after the MTOPEN). (5/27) sys/fio/read.x READ is not supposed to read more than one record at a time when reading from a streaming (record structured) device. This would always work previously because we sized the buffer to be larger than the largest possible device record. If a max record size parameter is now defined for the device, however, the FIO buffer will be set to the size of the max transfer permitted for the device. This case was not being recognized, causing READ to read lots of physical device records to satisfy a large logical read request, if the FIO buffer size happened to be exactly the same as the device block size. (5/27) [All MTIO, dev$devices file revisions were tested, 5/27] sys/imio/iki/stf/stfmerge.x When a new parameter is merged into the GPB of a new copy image, the STF_PSIZE and STF_SZGROUP fields of the GPB descriptor for the new image are now updated, along with STF_PCOUNT. This bug was fixed originally by STScI; the original fix appeared to be using P_PSIZE(n_pp) before it was being set, so I made the fix slightly differently, and this should be tested. (5/28) sys/imio/iki/stf/stfopix.x The WCS data structure will not be copied (call stf_copywcs()) if the pointer o_im (old image, e.g., for a NEW_COPY operation) is null. (5/28) pkg/images/imdebug/mktest.x Modified the make-test-image program slightly to avoid integer overflow when creating a short integer test image. (5/28) pkg/images/imdebug/mkimage.x Made a minor change to avoid a possible char/int argument mismatch problem (no bug ever actually observed). (5/28) pkg/cl/builtin.c Modified the code for Keep to search back down the call stack to find the earliest task reading command input from the same place as the task which called Keep, then execute "keep" for every task back to that point (unless the task calling Keep is reading commands from stdin). Formerly only the context of the tasking calling Keep would be preserved. With this change, ***** IT IS NOW PERMISSIBLE TO PERMANENTLY LOAD PACKAGES FROM WITHIN A SCRIPT, E.G., THE LOGIN.CL FILE *****. (5/28) unix/hlib/login.cl vms/hlib/login.cl A [commented out - 5/29] command to load the NOAO package at login time was added to the default LOGIN.CL file (NOAO also loads PLOT and IMAGES). A comment was added to tell users how to list additional packages to be loaded at login time. It is expected that users will personalize the set of packages to be loaded at login time, and that system installers will modify the default LOGIN.CL to load whatever standard and local packages are in common use at their site. Note that packages loaded in this way can only be discarded by logging out. (5/28) --------------------------- Updated IRAFX, tucana+pavo. (5/28) unix/os/zfiotx.c If a process (e.g., the CL) is suspended while the terminal driver is set for raw mode, the terminal driver will now be restored to normal mode while the process is suspended. Note that only the state of the terminal driver is affected, not the state of the terminal itself, e.g., reverse video highlighting will not be automatically cleared if in effect when a process is suspended. (5/29) [Although this feature will prove useful to expert users, it is [essential on Berkeley UNIX systems to avoid leaving the terminal [in raw mode with no echo if the novice user accidentally types the [suspend process control code. lib/fio.h lib/fset.h unix/hlib/libc/fset.h sys/fio/fseti.x unix/os/zfiotx.c Added a new terminal driver and FSET option named F_SETREDRAW. The statement call fseti (STDIN, F_SETREDRAW, ch) will cause the terminal driver to return 'ch' (integer!) as the value of any pending GETC when a temporarily suspended process resumes execution. The intention is that screen oriented applications programs such as EPARAM, PAGE, etc., will make such a call to enable transmission of their screen redraw keystroke (ctrl/l, ctrl/r, etc.). This will be returned to the application if the process is suspended while awating input in raw mode, causing the screen to be automatically redrawn when the process resumes execution without the user having to manually type the redraw character. Programs which make use of this feature should call FSETI twice, once at the beginning to enable the automatic redraw, and once at the end with ch=0 to disable the feature, as other programs may not be prepared to deal with the unexpected input. (5/29) sys/etc/xisatty.x This routine is called to determine if a text stream is connected to a terminal rather than a text file. Added logic to return yes (is a tty) if the file is standard stream, the stream has not been redirected, and the process is running as a connected subprocess. In this case the stream is highly likely to be connected to a terminal in the CL process, and transmission of terminal driver control sequences (like F_SETREDRAW and F_RAW) is a reasonable thing to do. (5/29) sys/etc/pagefiles.x pkg/system/help/houtput.x Added calls to set F_SETREDRAW to these routines, which call CLGKEY to read keystrokes from the terminal in raw mode. The pager can be suspended and restarted with full recovery; HELP does not (yet) buffer previously displayed text, so the redraw action is temporarily set to cause the next page of help text to be displayed. (5/29) pkg/cl/edcap.c pkg/cl/eparam.c In EDCAP, routines edtinit/edtexit (called upon entry and exit from a screen routine to initialize the terminal), added calls to F_SETREDRAW to enable the redraw keystroke defined in the dev$*.ed file for the user's favorite editor. In EPARAM, deleted countless calls to e_ctrl to set/clear standout mode, and replaced them by a few calls to set standout mode only when text needs to be drawn in standout mode. The original code was leaving the terminal in standout mode most of the time and only restoring normal mode when drawing normal text, causing the terminal to be left in standout mode if the CL was suspended (the new code is also simpler and more efficient). (5/29) ---------------------------- Deleted all machine independent files on IRAFX and tucana and started a full recompile sysgen on both systems, to get rid of any junk files left by the incremental updates, and to ensure that everything still compiles. (5/29) unix/boot/mkpkg unix/boot/mkpkg.hlp unix/boot/scanlib.c unix/boot/main.c unix/boot/pkg.c unix/boot/extern.h Merged the revisions for the '-u' option (forcibly update library module dates) into the master version of MKPKG. This option, currently fully implemented on AOSVS/IRAF, causes the dates of all library modules looked at during a mkpkg run to be updated to be no older than the file "hlib$iraf.h", which is assumed to have been "touched" after system installation to mark the system installation time. This option is needed on systems like AOS/VS which cannot restore the modify dates of source files; when the system is installed on such a system, all files will appear to MKPKG to have been modified at system installation time. Updating the library module dates to a time shortly after the system was installed prevents recompilation of the entire system, without interfering with the ability of MKPKG to detect changes to files which have been modified since the system was installed, which should force recompilation. (5/31) vms/boot/mkpkg Updated the machine independent files changed in the above revision. (5/31) sys/ki/ktzsek.x Modified to mark the internal KI text data cache empty when a seek occurs on a file, so that the next read will force the buffer to be refilled at the new file offset. This was the reason why randomly paging a file over the network was not working properly. (5/31) sys/imio/imioff.x Changed the code which checks the value of 'ndim' to allow opening images with ndim=0, i.e., a header file with no pixels. (5/31) sys/osb/f77upk.f Changed the "lastch=nchars" to "lastch=0" so that a blank f77 string would be returned as an SPP null string (the routine is supposed to trim blank padding at the right). (5/31) sys/osb/f77pak.f This routine was not blank padding to the full length (len(str)) of the Fortran string, as the F77 standard requires. (5/31) [Carefully tested, 6/2] unix/boot/generic/generic.c vms/boot/generic/generic.c In the code for outstr(), replaced the call to fprintf() by a call to fputs(). There was no evident reason to use fprintf, and if the string being output contained any % characters it would be mangled. (5/31) vms/os/net/zfioks_obj.dna + This file is the zfioks.obj (binary object file) of zfioks.c, configured for DECNET. A precompiled version of the file is provided so that sites which do not have a C compiler can reconfigure the IRAF network software for DECNET. (5/31) --------------------- Updated all systems. (5/31) Deleted the standard production VMS/IRAF system on draco (IRAF), and installed the "final" V2.5 system (more bug fixes are sure to follow during testing). (5/31) sys/gio/ncarutil/*.f On the request of UCAR, we added a 12 line copyright banner to the header of each Fortran source file. (6/1) sys/mtio/mtcache.x Fix a bug which could cause the tape position cache to still be considered valid following an error abort during a tape operation, which is supposed to render the tape position undefined. The mt_sync procedure will now invalidate the entire cache if called during error recovery. In the process of fixing this I changed the file number used to indicate an undefined position from 0 to -1. (6/1-2) vms/hlib/login.cl 1. Added a $(1) argument reference to the foreign task definition for vdir (the interface to the VMS directory lister), to allow use of the routine with IRAF logical directory pathnames, and to give the user a more sophisticated example of the foreign task syntax. 2. Added a new foreign task VFILE (with a $(1) filename reference to permit use of IRAF virtual filenames) to allow use of the VMS command DUMP/HEADER to examine in detail the header of VMS files. (6/2) vms/* [lyra] Updated the copy of the VMS HSI maintained on lyra. (6/3) sys/imio/db/imaddf.x In the course of testing the error recovery that occurs when the user area of the image header overflows, found and fixed a minor bug in this routine. The max size of the user area was off by one SU hence the descriptor buffer could be overwritten if overflow of the user area occurred. Also, the use of F_CANCEL to cancel the string buffer if overflow occurred seemed questionable and obscure and was removed. This appeared to have been put in originally because a CLOSE on a string buffer which had overflowed would cause an error in the STRCLOSE (see below). (6/3) sys/fio/stropen.x In STRCLOSE, replaced the putci(fd,EOS) by an explicit assignment to avoid a possible error condition. If a string buffer of length N chars overflows during a write, the EOS will be written into char N+1, in accord with the usual SPP stringop semantics. (6/3) sys/imio/imunmap.x This routine contained a section of code to compute the value of IM_HDRLEN which was redundant with the equivalent section of code in oif/oifupdhdr.x, and irrelevant in the STF kernel. Since this is an expensive operation for images with large headers, I removed the code. (6/3) ------------------------------------- Updated all systems. (6/3) Kitt Peak 4-Meter system updated; full SUN/IRAF system recompiled for -ffpa. (6/4) unix/boot/mkpkg/modlist.c.NU + Added a copy of the library module list filename/date database file from ASOVS/IRAF to the UNIX mkpkg, with a NU (not-unix) suffix to indicate that it is not an active file. Although not used for UNIX, this code is machine independent and hence it is probably worthwhile to maintain the source in the master system. (6/5) local/Gterm.install [SUN/IRAF] Added additional user oriented documentation to the installation notes for the GTERM and IMTOOL Sunview tools. (6/5) sys/vops/ak/mkpkg sys/vops/ak/apow*.x Deleted a set of APOW files in the AK subdirectory. These were not supposed to be there, as the real sources are maintained in LZ. (6/7) ---------------------- Updated all systems. (6/14) unix/gdev/sgidev/sgi2uimp.c [lyra] vms/gdev/sgidev/sgi2vimp.for [irafx] vms/hlib/sgiqueue.com [irafx] Added "prerasterization on" to Impress document header in both SGI translators, and removed it from IMPRINT command in VMS (sgiqueue.com). Formerly this was done only in VMS, for the 300dpi imagen, in IMPRINT. A recent experience at AT&T on a UNIX 11/785 running a 300dpi Imagen showed that prerasterization is a builtin function of the Imprint engine, rather than a separate VMS IMPRINT task option. (6/17 SRo) sys/etc/errget.x Replaced the call to strcpy, used to return the error message string in the xer common to the caller, by a call to xer_fmterrmsg. The latter will expand error message encoded as "XXX opstr" into the more readable format, using the system error message in the lib$syserrmsg file. I discovered this when testing the cursor mode ":.snap" with garbage device names; everthing was working correctly, i.e., the error was being detected and recovered from properly, but the error message being printed was just a number, similar to what :.snap prints when it is working correctly, possibly causing the error to go unnoticed. (6/17) unix/hlib/install + Added an INSTALL script for UNIX/IRAF. Starting with the system read into an $iraf directory somewhere, and an $iraf account, this completes the basic installation, modifying pathnames in all the necessary files, and installing all the necessary symbolic links in UNIX land. It can also be run anytime after the initial installation to verify that all is ok. The user must still configure the device tables, default login.cl, and so on, but the system should run once the tape has been read in and the INSTALL script run, assuming the binaries are compatible with the local host (not necessarily true for SUN/IRAF). (6/17) Added a SUN/IRAF version of the script, identical to the UNIX/IRAF version except for some extra stuff at the end to do the custom suntools installation. (6/18) sys/gio/cursor/grccmd.x sys/gio/cursor/grcopen.x sys/gio/cursor/gtropenws.x sys/gio/cursor/gtrreset.x 1. In gtropenws.x, rearranged the statements which shut down the old kernel and open a new one. There was a problem with error recovery the way the code was originally. The code would partially close down the old kernel and then abort if an unknown device name were entered in :.snap. The abort, causing an immediate exit from the routine, of course, would cause the data structures to indicate that the old kernel was still connected, when in fact it had been partially shut down. This was causing a segmentation violation or other error when a valid snap was entered after a failed snap. 2. In gtrreset.x, updated the code which closes down the old kernel to be like the equivalent code in gtropenws.x. In particular, the graphcap descriptor was not getting closed off in a reset, e.g., when doing a GFLUSH. This was harmless, but would leave an unused malloc-ed buffer behind which would never be freed. 3. In grccmd.x, added a "- done" message to the :.snap code, to indicate that the snap has completed successfully. 4. In grcopen.x, fixed a grammatical error in a comment. (6/18) lib/syserr.h lib/syserrmsg sys/tty/ttyindex.x Added a system error code/message SYS_TTYINVDES ("invalid or null tty descriptor") and a check for a null descriptor to the tty_find_cap* procedure, called by all ttyget* procedures. This will avoid a segmentation violation in the future if a ttyget routine is called with a null descriptor. (6/18) --------------------------- Updated tucana, irafx@draco. (6/18) unix/hlib/mkiraf.csh Removed the trailing '/' from the 'set iraf = /iraf/'. This is not needed and has confused people. (6/19) unix/hlib/install This is to document the use of the INSTALL script, used to install UNIX/IRAF on a UNIX host. The install script is used [1] During the initial installation, to automatically modify those iraf configuration files containing pathnames, and to make all the necessary links in UNIX land to get IRAF to run. [2] After the initial installation, to verify that the system is still correctly installed. The script will examine all the files and links to verify that each is correct and still in place. This may be necessary, for example, after UNIX itself has been updated, which may cause the IRAF links to be lost. The installation procedure for UNIX/IRAF is greatly simplified by the install script. To install the system from scratch: [1] Create an account for user 'iraf', with a root directory such as /usr/iraf, and a login directory such as /usr/iraf/local ($iraf = /usr/iraf, $home = /usr/iraf/local). The actual pathname is arbitrary but should be kept as short as possible to speed up runtime pathname resolution. [2] Login as 'iraf', cd to $iraf, and read in the distribution tar tape or tapes, e.g., tar -xpf /dev/nrmtXX. [3] Cd to $iraf/unix/hlib, become superuser, and type 'install'. To get a default installation, just hit return to accept the prompted response to each query. To see what the script will do without actually doing anything, run 'install -n' once before running it for real. [4] The install script may have modified the .login file, so login again, and do a 'mkiraf' to initialize the IRAF runtime environment for user 'iraf', then 'cl' to run IRAF. That is all that is necessary for the basic installation of a binary distribution. It will still be necessary to manually modify the device tables in hlib and dev, interface any local terminals, printers, plotters, etc., as described in the installation guide. (6/19) gdev/sgidev/sgi2vln03.c + [VMS] gdev/sgidev/mkpkg.com [VMS] Added DEC C sgi translator for the ln03+ in Tektronix (extended addressing) mode. (6/24 SRo) vms/gdev/iism70/m70.h vms/gdev/iism75/m75.h Changed the value of IIS_MAXBUFSIZE from 16384 to ((32768-512)/2), i.e., 16384-256. This was necessary to avoid having sign extension when converting from long to short and back to long from promoting 16384*2=32768 to a negative number. This would happen when doing i/o to the IIS on the local node on VMS, since byte packing is not used and the byte count is 32768 rather than 16384. (6/24) sys/gio/ncarutil/sysint/support.f In subroutines ENCODE and ENCD, the declaration of a dummy array was changed from character*11 to character*(*). When these subroutines were called with an argument of fewer than 11 characters, memory was inadvertently being overwritten. (6/24 SHJ) pkg/cl/lists.c Modified scanlist() to permit comments and blank lines in formatted lists, e.g., all but simple string or struct type (unformatted) lists. This permits cursor or filename lists, for example, to have embedded blank lines or comments without affecting the operation of programs which read these lists. (6/25) unix/hlib/install 1. Modified to remove any trailing / from the old 'iraf' and 'imdir' pathnames present in the existing system sources (taken from the mkiraf.csh file). These strings are used as input to SED pattern matching, and if the trailing / is included but is not present in the substitution string, it will be omitted from the output string. The strategy for trailing slashes in INSTALL is that everything in INSTALL is done according to UNIX conventions (no trailing slashes), but if the trailing slashes are present in the files being edited they are retained. This hides this issue from the user and preserves the trailing slashes where they are needed in the IRAF system configuration files. 2. For the SUN/IRAF version of the INSTALL script, added some code at the end to check that there are entries for devices 'gterm' and 'imtool' in the termcap and graphcap files. (6/25) pkg/images/tv/display/iisrd.x pkg/images/tv/display/iiswr.x pkg/images/tv/cv/iism70/iisrd.x pkg/images/tv/cv/iism70/iiswr.x The recent change to the FIO buffer size used in the display code lead to a problem, as the buffer size chosen did not fit into the display frame an integral number of times. This was causing a problem as the last write, at the end of the frame buffer, would overflow causing garbage to be written to the display. I could have worked around the problem by simply halving the buffer size to 8192, but the larger buffer is more efficient and code which runs off the end of the display is not very robust, so I added clipping to the above routines instead. (6/27) sys/gio/cursor/giotr.x sys/gio/cursor/gtrctrl.x Changed the AMOVI calls used in these routines to move the WCS structure to AMOVS calls. The former code should have been ok since the array references get turned into byte or word addresses in the procedure call, but a site reported a portability problem so I converted all array references and the procedure call to type short. (6/27) sys/tty/ttyputl.x The formfeed handling code was not breaking lines properly when the formfeed occurred as the first character in a line and the device had the 'am' (automargin) capability. An extra newline would be output followed by the formfeed. When printing a large file containing several pages of text delimited by formfeeds, this would effectively add a line of text to each page, potentially causing page overflow (output of a blank page) on the output device. (6/27) ---------------------------- Updated all systems. (6/27) dev/termcap dev/graphcap [VMS/IRAF] Merged in latest stuff from lyra. (6/27) dev/cacheg.dat dev/cachet.dat Rebuilt these files to make sure they were up to date. (6/27) vms/boot/spp/rpp/ratlibc/readf.c vms/boot/spp/rpp/ratlibc/writef.c ---------------------------------------------------------------------- Deleted all binaries from the VMS directories and did a full bootstrap. ---------------------------------------------------------------------- Unfortunately, a new DEC C compiler was installed recently and there were minor problems. 1. In vms/boot/mkpkg, trying to compile XCSUB.C, I got the following message: $ cc/nolist host.c,modlist.c,scanlib.c,xcsub.c # include fab %CC-F-LIBLOOKUP, "fab" was not found in any of the specified\ libraries. At line number 4 in SYS$COMMON:[SYSLIB]RMS.H;4. The problem went away when I compiled the file interactively. Probably some sort of quota problem, or a bug in the VMS software. UNRESOLVED. MKPKG came up when I compiled it interactively, so I will ignore this one for now. 2. In vms/boot/spp/rpp/ratlibc, files READF.C, WRITEF.C, got messages such as (for both fread() and fwrite()): $ cc/nolist readf.c unsigned fread(), count; %CC-W-CONFLICTDECL, This declaration of "fread" conflicts with a previous declaration of the same name. This was a reasonable warning message; edited the two file to delete the unnecessary function declarations. With these changes I appeared to have a successful bootstrap of all the latest software. (6/27) vms/os/mkpkg.com ---------------------------------------------------------------------- Rebuilt the VMS HSI - 'IRAF' system. ---------------------------------------------------------------------- To make life even more difficult, I next deleted all the VMS files in 'IRAF' (USR$2) and moved a copy of the new VMS HSI over from the 'IRAFX' system. Only the IRAFUSER.COM and MOTD files had to be edited to install the new copy. Next, since LIBOS had been completely rebuilt I attempted to rebuild the IRAF shared library. This failed with lots of error messages complaining that _MCSUB was not found. This turned out to be due to the lack of an entry for MCSUB.C in the MKPKG.COM bootstrap-the-os file, so I added one and all was well. (6/27) --------------- Standard VMS/IRAF ('IRAF') now up to date. (6/27) sys/vops/ahiv.gx Was computing the minimum rather than the maximum value of the array. This operator has not been used up until now, obviously. (6/28) sys/fmtio/dtoc3.x This routine would use a 'D' rather than an 'E' for exponential format when the number being output exceeded single precision. Changed it to always output an 'E'. (6/29) sys/imio/iki/stf/mkpkg sys/imio/iki/stf/stfordgpb.x - Deleted this file and its entry in mkpkg, since the routine therein is no longer used and is not likely to be used ever again. (6/29) sys/imio/iki/stf/stf.h sys/imio/iki/stf/stfwfits.x sys/imio/iki/stf/stfreblk.x sys/imio/iki/stf/stfrdhdr.x sys/imio/iki/stf/stfordgpb.x sys/imio/iki/stf/stfopix.x sys/imio/iki/stf/stfopen.x sys/imio/iki/stf/stfnewim.x sys/imio/iki/stf/stfmerge.x Merged in the new versions of these files, developed by Dave Ball at STScI. Changes were made to stfmerge.x and stfnewim.x, other than that the code was kept pretty much as is. 1. The principal change was to allow the STF interface to read and write images in datatypes other than real. In general, the datatype of the input image is now preserved, whereas before it was being forced to type real, since the STF image format is used for SDAS, and the old SDAS software could only be used with type real images. Since the new SDAS software is being layered upon the VOS this restriction is no longer needed. 2. As far as possible, the order of group parameters is preserved when making a new copy image. (6/29) vms/os/net/kutil.c A bug in this routine was causing the characters "rA" to be printed on a new line, after entering the password for a remote node when establishing a network connection. The values of the variable 'nchars' was not being set before the final call to ZPUTTY, causing extra characters to be sent to the terminal. (7/1) unix/hlib/install The INSTALL script how checks for the existence of the executable files in HLIB (mkiraf.csh, mkmlist.csh, rmbin.e, xc.e, etc.) and verifies that they have the correct file permissions, in particular, execute permission for everyone. When restoring files from tape, or copying files from one computer to another, it is possible to lose the file permissions. (7/1) local/.login 1. Deleted the 'users', since this command is not available on Ultrix. 2. Changed the name of the 'page' alias to 'pg', to avoid modifying the behavior of a standard command, and because the referenced local command 'less' is not available in standard UNIX. (7/1) ---------------------------- All systems updated. (7/1) sys/imio/iki/ikiopen.x When creating a new "clustered" (group) image, this routine has a built in restriction that the cluster index must be 1, e.g., newim[1/10] to write to image 1 of a new cluster-image containing 10 images. People have complained about the restriction to writing to image [1], so I am looking at the file to see if the restriction can be lifted. 1. In the process of looking into this, fixed a typo in a comment. No functional modifications yet. 2. The revision suggested by ST to remove the restriction on writing image [1], i.e., to delete the "cl_index <= 1" from the two expressions, does not handle the case where the input and output image formats are not the same. I think the code can be modified to remove the restriction, but it is too tricky to do this and test the software sufficiently for the version 2.5 release, so this change is postponed to a future release. (7/5) dev/termcap Added entries for `wyse' and `414a'; added `:gd' to go140. (7/6 SRo) pkg/bench/bench.hlp pkg/bench/bench.ms + pkg/bench/bench_tab.ms + Installed a heavily revised version of the benchmarks paper, including comparative benchmarks for nearly all current IRAF host machines. (7/6) unix/gdev/iism75/m75put.x unix/gdev/iism75/zrdm75.x These files both contained a "short = short-expr" construct which was being evaluated at compile time and causing a short integer overflow, preventing compilation of these files on the SUN (harmless, but annoying). Replaced by two statements with an intermediate assignment into an integer temporary to get truncation to a short. (7/6) unix/gdev/* [SUN/IRAF only] os/zxwhen.c os/net/kutil.c Did a full diff of the UNIX/IRAF and SUN/IRAF HSI sources to see if there were any revisions to standard UNIX/IRAF which had not made it into SUN/IRAF yet. Did find several, although all were harmless. Fixed these to minimize unnecessary diffs. 1. Added the iism75 code to gdev. Note that the SUN/IRAF version of zfiogd.x temporarily includes support for IMTOOL. 2. Updated the source for the sgi2uimp.c SGI translator, which was older than the UNIX/IRAF version (prerasterization rev). 3. In zxwhen.c, fixed a classic C typo, "=" -> "==". 4. In os/net/kutil.c (which is not active code), changed a C array reference text[1] -> text[0]. All other diffs were as they should be. (7/6) ------------------------------- Updated all systems (including bug fixes in NOAO). (7/6) Hopefully, this is the frozen V2.5 release.