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
|
############################################################################
#
# File: sdb2wvp.icn
#
# Subject: Program to convert sequence-draft data bases to include files
#
# Author: Ralph E. Griswold
#
# Date: May 23, 1999
#
############################################################################
#
# This file is in the public domain.
#
############################################################################
#
# AD HOC.
#
# Command-line arguments are converted into $defines in the output.
#
############################################################################
#
# Links: basename, weavutil, io, tables, xcode
#
############################################################################
link basename
link weavutil
link io
link tables
link xcode
procedure main(args)
local line, output, path, database, spec, name
weaving2 # mention to prevent deletion
database := xdecode(&input) | stop("*** cannot decode input")
put(args, "Background", "Reflect") # run in background
every spec := database[!keylist(database)] do {
name := spec.name || ".wvp"
output := open(name, "w") |
stop("*** cannot open ", name, " for writing")
every write(output, "$define ", !args)
close(output)
write_spec(name, spec)
}
end
|