Debian Codegraph @

reports/ped.ll

raw
1 /*
2 * @progname ped.ll
3 * @version 1996-08-09
4 * @author [email protected]
5 * @category
6 * @output HTML
7 * @description
8
9 html pedigree/ancestral chart part of an individuals report.
10 This coding can be generalised to print many generations back but
11 for html purposes we only need go back 2 generations because the
12 width of the page becomes far too big otherwise. In this case I've
13 hard coded out what the generalised coding would look like. I've
14 used ideas from the output of the gedcom2html program.
15
16 Typical output from this reports looks like:
17
18 <pre>
19 <a href="genweb_9.html">_William Alford___</a>
20 <a href="genweb_1.html">_William Alford____</a>|
21 | |<a href="genweb_10.html">_Elizabeth Shore__</a>
22 |
23 |--<a href="genweb_5.html">William Alford</a>
24 |
25 | <a href="genweb_186.html">_Robert Goldsbrough__</a>
26 |<a href="genweb_2.html">_Jane Goldsbrough__</a>|
27 |<a href="genweb_187.html">_Hannah Browne_______</a>
28 </pre>
29 <p><hr>
30
31 [email protected] 9 Aug 1996 */
32
33 global(line1) /* position on line 1 */
34 global(line2) /* position on line 2 */
35 global(line3) /* position on line 3 */
36 global(line5) /* position on line 5 */
37 global(line6) /* position on line 6 */
38 global(line7) /* position on line 7 */
39 global(nstrngff) /* father's fathers name string */
40 global(nstrngf) /* father's name string */
41 global(nstrngfm) /* father's mothers name string */
42 global(nstrngi) /* individual's name string */
43 global(nstrngmf) /* mother's father name string */
44 global(nstrngm) /* mother's name string */
45 global(nstrngmm) /* mother's mother name string */
46
47 proc ped(indi, href_table)
48 {
49 set(nstrngff,save(name(father(father(indi)),0)))
50 set(nstrngf,save(name(father(indi),0)))
51 set(nstrngfm,save(name(mother(father(indi)),0)))
52 set(nstrngi,save(name(indi,0)))
53 set(nstrngmf,save(name(father(mother(indi)),0)))
54 set(nstrngm,save(name(mother(indi),0)))
55 set(nstrngmm,save(name(mother(mother(indi)),0)))
56 set(line1,strlen(nstrngff))
57 set(line2,strlen(nstrngf))
58 set(line3,strlen(nstrngfm))
59 set(line5,strlen(nstrngmf))
60 set(line6,strlen(nstrngm))
61 set(line7,strlen(nstrngmm))
62 set(dif1,0)
63 set(dif2,0)
64 set(dif3,0)
65 set(dif5,0)
66 set(dif6,0)
67 set(dif7,0)
68 if (ne(line2,line6)) {
69 if (gt(line2,line6)) { set(dif6,sub(line2,line6)) }
70 else { set(dif2,sub(line6,line2)) }
71 }
72 if (ne(line1,line3)) {
73 if (gt(line1,line3)) { set(dif3,sub(line1,line3)) }
74 else { set(dif1,sub(line3,line1)) }
75 }
76 if (ne(line5,line7)) {
77 if (gt(line5,line7)) { set(dif7,sub(line5,line7)) }
78 else { set(dif5,sub(line7,line5)) }
79 }
80 set(diff1,dif1)
81 set(diff2,dif2)
82 set(diff3,dif3)
83 set(diff5,dif5)
84 set(diff6,dif6)
85 set(diff7,dif7)
86
87 /* Output the html */
88
89 "<pre>\n"
90 col(add(line2,6,dif2)) call ped_ahref(father(father(indi)),href_table)
91 "_" nstrngff "__"
92 while (gt(diff1,0)) { "_" decr(diff1) }
93 "</a>" nl()
94 " " call ped_ahref(father(indi),href_table) "_" nstrngf "__"
95 while (gt(diff2,0)) { "_" decr(diff2) }
96 "</a>|" nl()
97 "|" col(add(line2,5,dif2)) "|"
98 call ped_ahref(mother(father(indi)),href_table) "_" nstrngfm "__"
99 while (gt(diff3,0)) { "_" decr(diff3) }
100 "</a>" nl()
101 "|" nl()
102 "|--" call ped_ahref(indi,href_table) nstrngi "</a>" nl()
103 "|" nl()
104 "|" col(add(line6,6,dif6))
105 call ped_ahref(father(mother(indi)),href_table) "_" nstrngmf "__"
106 while (gt(diff5,0)) { "_" decr(diff5) }
107 "</a>" nl()
108 "|" call ped_ahref(mother(indi),href_table) "_" nstrngm "__"
109 while (gt(diff6,0)) { "_" decr(diff6) }
110 "</a>|" nl()
111 col(add(line6,5,dif6)) "|"
112 call ped_ahref(mother(mother(indi)),href_table) "_" nstrngmm "__"
113 while (gt(diff7,0)) { "_" decr(diff7) }
114 "</a>" nl()
115 "</pre>\n"
116 "<p><hr>\n"
117 }
118
119 proc ped_ahref(indi,href_table)
120 {
121 "<a href=" qt()
122 get_href(indi, href_table)
123 qt() ">"
124 }