Debian Codegraph @

reports/net-ped.ll

raw
1 /*
2 * @progname net-ped.ll
3 * @version 2.1
4 * @author Rafal T. Prinke
5 * @category
6 * @output Netscape HTML
7 * @description
8
9 This program generates a set of files covering all known ancestors
10 with hypertextual links from the top and bottom persons for
11 easy on-line browsing using Netscape.
12
13 The amount and format of data can be edited in the "vitals" procedure
14 and "mylong" function.
15
16 Net-Ped -- Pedigree in Netscape HTML table -- bottom to top
17 Rafal T. Prinke
18 v.1 -- 25 JUN 1996 - one file/tafel
19 v.2 -- 25 JUN 1996 (later at night than v.1)
20 - multiple files/tafels for all ancestors
21 v.2.1 -- 28 JUN 1996
22 - changed table holding last filename to list
23 - no files for top persons without a parent
24 - cross-links for related ancestors
25 - nicer layout
26 v.2.2 - misc cleanup - tighten checking for non-existent persons
27 - make html slightly more readable -- by Stephen Dum.
28
29 "proc vitals" code stolen from Tom Wetmore's "ahnentafel" 1995
30 output uses some Polish specific abbreviations
31 */
32
33 global(mindi)
34 global(toplist)
35 global(fillist)
36 global(t)
37 global(a)
38 global(lastfile)
39 global(onelist)
40 global(all)
41 global(mdupli)
42 global(fdupli)
43
44 proc main()
45 {
46 list(toplist)
47 list(fillist)
48 list(onelist)
49 table(all)
50 table(mdupli)
51 table(fdupli)
52
53 getindimsg(mindi, "Whose Ahnentafel do you want?")
54 enqueue(toplist, mindi)
55 set(t,1)
56 set(t2,concat("t",d(t),".html"))
57 enqueue(fillist, t2)
58 set(t,add(t,1))
59
60 while(indi, dequeue(toplist)) {
61 set(nf,dequeue(fillist))
62 print("file: ") print(nf) print("\n")
63 newfile(nf,0)
64 call tafel(indi)
65 }
66 }
67
68 proc tafel(indi)
69 {
70 table(quart)
71 insert(quart,"1",indi)
72 set(a,1)
73 while(lt(a,16)) {
74 if(person,lookup(quart,d(a))) {
75 if (par,father(person)) {
76 set(before, lookup(all, key(par)))
77 if (before) {
78 insert(fdupli, key(person),1)
79 } else {
80 insert(all, key(par), outfile())
81 insert(quart,d(mul(a,2)),par)
82 }
83 }
84 if (par,mother(person)) {
85 set(before, lookup(all, key(par)))
86 if (before) {
87 insert(mdupli, key(person),1)
88 } else {
89 insert(all, key(par), outfile())
90 insert(quart,d(add(1,mul(a,2))),par)
91 }
92 }
93 }
94 set(a,add(a,1))
95 }
96
97 "<html>\n<body>\n<table border>\n"
98 set(a,16)
99 "<tr>"
100 while(lt(a,32)) {
101 if (lookup(quart,d(a))) {
102 if (or( father(lookup(quart,d(a))), mother(lookup(quart,d(a))) )) {
103 set(t2,concat("t",d(t),".html"))
104 "<td valign=top>"
105 "<sup>" d(a) ".</sup> <p align=center>"
106 "<a href=" t2 ">"
107 call vitals(lookup(quart,d(a))) nl() "</a></td>\n"
108 enqueue(toplist,lookup(quart,d(a)))
109 enqueue(onelist,outfile())
110 set(t,add(t,1))
111 enqueue(fillist, t2)
112 } else {
113 "<td valign=top>"
114 "<sup>" d(a) ".</sup> <p align=center>"
115 call vitals(lookup(quart,d(a))) nl() "</td>\n"
116 }
117
118
119
120 } else { "<td valign=top><sup>" d(a) ".</sup></td>\n" }
121 set(a,add(a,1))
122 } "</tr>\n"
123 set(a,8)
124 "<tr>"
125 while(lt(a,16)) {
126 "<td valign=top colspan=2>"
127 "<sup>" d(a) ".</sup><p align=center>"
128 call dup(lookup(quart,d(a)))
129 call vitals(lookup(quart,d(a))) nl() "</td>\n"
130 set(a,add(a,1))
131 } "</tr>\n"
132 set(a,4)
133 "<tr>"
134 while(lt(a,8)) {
135 "<td valign=top colspan=4>"
136 "<sup>" d(a) ".</sup><p align=center>"
137 call dup(lookup(quart,d(a)))
138 call vitals(lookup(quart,d(a))) nl() "</td>\n"
139 set(a,add(a,1))
140 } "</tr>\n"
141 set(a,2)
142 "<tr>"
143 while(lt(a,4)) {
144 "<td valign=top colspan=8>"
145 "<sup>" d(a) ".</sup><p align=center>"
146 call dup(lookup(quart,d(a)))
147 call vitals(lookup(quart,d(a))) nl() "</td>\n"
148 set(a,add(a,1))
149 } "</tr>\n"
150
151 if(nestr(key(lookup(quart,d(1))),key(mindi))) {
152 "<tr><td valign=top colspan=16>"
153 "<sup>" d(1) ".</sup><p align=center>"
154 call dup(lookup(quart,d(1)))
155 call vitals(lookup(quart,d(1))) nl()
156 "<hr><a href=" dequeue(onelist)
157 "><font color=FF0000><blink>BACK</blink></font></a></td>\n</tr>\n"
158 } else {
159 "<tr><td valign=top colspan=16>"
160 "<sup>" d(1) ".</sup><p align=center>"
161 call vitals(lookup(quart,d(1))) nl() "</td>\n</tr>\n"
162 }
163
164
165 "</table>\n</body>\n</html>\n"
166
167 }
168
169 proc vitals(persn) {
170 set(e,marriage(fam))
171 if (and(e,long(e))) { mylong(e) }
172 "<strong>" name(persn,0) "</strong><br>\n<i>"
173
174 set(e,birth(persn))
175 if(and(e,long(e))) { "*&nbsp;" mylong(e) "<br>\n" }
176 set(e,death(persn))
177 if(and(e,long(e))) { "+&nbsp;" mylong(e) "</i><br>\n" }
178 "<small>"
179 set(srd,0)
180 if (gt(nspouses(persn),1)) {
181 spouses(persn,ind2,fm,nsp) {
182 set(dad,father(ind2))
183 set(mom,mother(ind2))
184 if (srd) { "; " }
185 " x&nbsp;(" d(nsp) ") "
186 set (es,marriage(fm))
187 if (and(es,long(es))) { mylong(es) " " }
188 name(ind2,0)
189
190 if (or(dad,mom)) {
191 ", "
192 if (male(ind2)) { "s.&nbsp;" }
193 elsif (female(ind2)) { "c.&nbsp;" }
194 else { "dz.&nbsp;" }
195 }
196
197 if (dad) {
198 name(dad,0)
199 fornodes(inode(dad), ok) {
200 if (eqstr(tag(ok),"OCCU")) { ", " value(ok) }
201 }
202 }
203 else { name(mom,0) }
204
205 set(srd,1)
206 } }
207 if (eq(nspouses(persn),1)) {
208 if (male(persn)) {
209 spouses(persn,ind2,fm,nsp) {
210 set (es,marriage(fm))
211 if (and(es,long(es))) { "x&nbsp;" mylong(es) }
212 } }
213 }
214 "</small>"
215 }
216
217 proc dup(persn) {
218 if (persn) {
219 if(lookup(fdupli,key(persn))) {
220 set(yest,lookup(all,key(father(persn))))
221 "<small><a href=" yest "><font color=FF0000><blink>FATHER:</blink></font><font color=0000FF> " name(father(persn)) "</font></a></small><br>\n"
222 }
223
224 if(lookup(mdupli,key(persn))) {
225 set (yest,lookup(all,key(mother(persn))))
226 "<small><a href=" yest "><font color=FF0000><blink>MOTHER:</blink></font><font color=0000FF> " name(mother(persn)) "</font></a></small><br>\n"
227 }
228 }
229 }
230
231 func mylong(ev) {
232 set(nic,0)
233 if (ne(index(date(ev),"/",1),0)) { date(ev) set(nic,1) }
234 if (ne(index(date(ev),"BEF",1),0)) {
235 "p.&nbsp;" substring(date(ev),5,strlen(date(ev))) set(nic,1) }
236 if (ne(index(date(ev),"AFT",1),0)) {
237 "po&nbsp;" substring(date(ev),5,strlen(date(ev))) set(nic,1) }
238 if (ne(index(date(ev),"ABT",1),0)) {
239 "ok.&nbsp;" substring(date(ev),5,strlen(date(ev))) set(nic,1) }
240 if (eq(nic,0)) { date(ev) }
241 if (place(ev)) { ", " place(ev) }
242 }