diff -ur ../original/stsdas/apropos.cl ./stsdas/apropos.cl --- ../original/stsdas/apropos.cl 2014-03-14 14:21:23.000000000 -0300 +++ ./stsdas/apropos.cl 2016-08-10 17:47:39.000000000 -0300 @@ -1,13 +1,66 @@ procedure apropos ( topic ) string topic {prompt = ">Apropos ? ", mode="ql"} -file index = "stsdas$lib/apropos.db" {prompt=">index to search"} +file index = "aproposdb" {prompt=">index to search"} begin -string csubject - # remove case sensitivity +string csubject, dblist, fname, pvar +int len, n, iend +bool var_ok + + # Remove case sensitivity csubject = "{"//topic//"}" - match ( csubject, index, stop=no, meta=yes, print_file_names=no) + + # As a special case, if we're given the name of the "aproposdb" + # environment variable then get the list of database filenames + # from that: + if (index == "aproposdb") { + if (defvar("aproposdb")) { + dblist = envget("aproposdb") + } else { + error(1, "variable aproposdb is not set!") + } + } else { + dblist = index + } + + len = strlen(dblist) + + # Loop over the database filenames in the list: + while (len > 0) { + + # Parse next name and remove it from the start of the list: + iend = stridx(",", dblist) - 1 + if (iend < 0) iend = len # no more commas; use what's left + fname = substr(dblist, 1, iend) # parse next filename + if (iend > len-2) { # no more filenames; empty list + dblist="" + } else { # still have another file + dblist = substr(dblist, iend+2, len) + } + len = strlen(dblist) + + # Extract any path variable and check that it exists, + # otherwise IRAF will complain: + var_ok = yes + iend = stridx("$", fname) - 1 + if (iend > -1) { + pvar = substr(fname, 1, iend) + if (!defvar(pvar)) + var_ok = no + } + + # Try to match the query if the database file exists: + if (var_ok) + if (access(fname)) { + + # Print any matches in this database file: + match ( csubject, fname, stop=no, meta=yes, \ + print_file_names=no) + + } + + } # while loop over database files end diff -ur ../original/tables/lib/tbtables/mkpkg ./tables/lib/tbtables/mkpkg --- ../original/tables/lib/tbtables/mkpkg 2014-03-14 14:21:28.000000000 -0300 +++ ./tables/lib/tbtables/mkpkg 2016-08-10 17:47:39.000000000 -0300 @@ -233,12 +233,10 @@ $ifdef (SPPFITSIO) $echo "NOTE: SPP FITSIO will be used for FITS tables." tbfhp_f.x tbtables.h tblfits.h - @fitsio $else $echo "NOTE: CFITSIO will be used for FITS tables." $echo "NOTE: CFITSIO does not support IRAF networking." tbfhp.x tbtables.h tblfits.h tbfxff.c fitsio_spp.h underscore.h - @cfitsio $endif ; diff -ur ../original/tables/lib/tbtables/tbfxff.c ./tables/lib/tbtables/tbfxff.c --- ../original/tables/lib/tbtables/tbfxff.c 2014-03-14 14:21:28.000000000 -0300 +++ ./tables/lib/tbtables/tbfxff.c 2016-08-10 17:47:39.000000000 -0300 @@ -1,5 +1,5 @@ # include -# include "cfitsio/fitsio.h" /* CFITSIO include file */ +# include /* CFITSIO include file */ # include "fitsio_spp.h" /* sizes of SPP strings and Fortran FITSIO */ # include "underscore.h" /* appends underscore, if needed */