Debian Codegraph @

reports/reg_html.ll

raw
1 /*
2 * @progname reg_html.ll
3 * @version none
4 * @author Wetmore, Prinke
5 * @category
6 * @output HTML
7 * @description
8 *
9 * The output produces a HTML-marked file (without header) with
10 * one family group per line so that it is displayed on WWW when
11 * found with grep and properly formatted.
12 * Continental European genealogical symbols are used:
13 * * = born + = died x = married
14 *
15 * Original code by Tom Wetmore, [email protected], 1990
16 * Modified for HTML/WWW by Rafal Prinke, [email protected], 1995
17 *
18 * This program is based on regvital by Tom Wetmore. I deleted
19 * all nroff output code and indexing code, and made some other
20 * modifications.
21 *
22 *
23 * The CGI script I wrote for searching the file and then navigating
24 * through it using the personal key numbers in angle brackets:
25 *
26 * #!/bin/sh
27 * echo Content-type: text/html
28 * echo
29 * if [ $# = 0 ]
30 * then
31 * echo "<HEAD>"
32 * echo "<TITLE>Surname search</TITLE>"
33 * echo "<ISINDEX>"
34 * echo "</HEAD>"
35 * echo "<BODY>"
36 * echo "<H1>Give the surname of the family</H1>"
37 * echo "Regular expressions allowed<P>"
38 * echo "</BODY>"
39 * else
40 * echo "<HEAD>"
41 * echo "<TITLE>Search results</TITLE>"
42 * echo "<ISINDEX>"
43 * echo "</HEAD>"
44 * echo "<BODY>"
45 * echo "<H1>Now you can jump to any person displayed</H1>"
46 * echo "type the person's number in angle brackets (lesser/greater)<P>"
47 * grep -i "<ST>$*" <<here goes the path+filename>>
48 * echo "</BODY>"
49 * fi
50 *
51 *
52 *
53 */
54
55 proc main ()
56 {
57 monthformat(2)
58 dateformat(5)
59 forindi(indi,n) {
60 print(" ") print(name(indi)) print(nl())
61 call longvitals(indi)
62 set(j,1)
63 families(indi,fam,spouse,nfam) {
64 if (eq(1,nspouses(indi))) {
65 "<P><DL><DT>x " }
66 else { "<P><DL><DT>x " d(j) ") "
67 set(j,add(j,1)) }
68 if (eq(0,nchildren(fam))) {
69 call spousevitals(spouse,fam)
70 ", children not recorded [" key(spouse,1) "]" }
71 else {
72 call spousevitals(spouse,fam)
73 " [" key(spouse,1) "]"
74 children(fam,child,nchl) {
75 "<DD>" d(nchl) ". "
76 name(child) " [" key(child,1) "]"
77 }
78 }
79 "</DL>"
80 }
81 }
82 }
83
84 proc longvitals(i)
85 {
86 set(father,father(i))
87 set(mother,mother(i))
88 nl() "-------------------------<P>"
89 if (or(father,mother)) {
90 "Parents: "
91 if (father) { name(father) }
92 if (and(father,mother)) { " & " }
93 if (mother) { name(mother) }
94 }
95 "<H2><ST><" key(i,1) ">" givens(i) " <ST>" surname(i) "</ST></H2></ST>"
96 set(e,birth(i))
97 if(or(date(e),place(e))) { " * " }
98 if(date(e)) { stddate(e) ", " }
99 if(place(e)) { place(e) ", " }
100 set(e,death(i))
101 if(or(date(e),place(e))) { " + " }
102 if(date(e)) { stddate(e) ", " }
103 if(place(e)) { place(e) ", " }
104 fornodes(inode(i), node) {
105 if (eq(0,strcmp("OCCU", tag(node)))) {
106 value(node) ", "
107 }
108 }
109 fornodes(inode(i), node) {
110 if (eq(0,strcmp("NOTE", tag(node)))) {
111 value(node)
112 fornodes(node, subnode) {
113 if (or(eqstr("CONT",tag(subnode)),
114 eqstr("CONC",tag(subnode)))) {
115 " " value(subnode)
116 }
117 }
118 }
119 }
120 }
121
122 proc spousevitals (sp,fam)
123 {
124 set(e,marriage(fam))
125 if(date(e)) { stddate(e) ", " }
126 if(place(e)) { place(e) ", " }
127 name(sp)
128 }