1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
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 <tbset.h> 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 <tbset.h> tbtables.h tblfits.h
tbfxff.c <fitsio.h> 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 <stdlib.h>
-# include "cfitsio/fitsio.h" /* CFITSIO include file */
+# include <fitsio.h> /* CFITSIO include file */
# include "fitsio_spp.h" /* sizes of SPP strings and Fortran FITSIO */
# include "underscore.h" /* appends underscore, if needed */
|