File: reg_html.ll

package info (click to toggle)
lifelines 3.0.50-2
  • links: PTS
  • area: main
  • in suites: etch-m68k
  • size: 11,140 kB
  • ctags: 6,517
  • sloc: ansic: 57,468; xml: 8,014; sh: 4,255; makefile: 848; yacc: 601; perl: 170; sed: 16
file content (127 lines) | stat: -rw-r--r-- 3,828 bytes parent folder | download | duplicates (2)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
 * @progname       reg_html.ll
 * @version        none
 * @author         Wetmore, Prinke
 * @category       
 * @output         HTML
 * @description
 *
 *  The output produces a HTML-marked file (without header) with
 *  one family group per line so that it is displayed on WWW when
 *  found with grep and properly formatted.
 *  Continental European genealogical symbols are used:
 *      * = born     + = died    x = married
 *
 *   Original code by Tom Wetmore, ttw@cbnewsl.att.com, 1990
 *   Modified for HTML/WWW by Rafal Prinke, rafalp@plpuam11.bitnet, 1995
 *
 *   This program is based on regvital by Tom Wetmore. I deleted
 *   all nroff output code and indexing code, and made some other
 *   modifications.
 *
 *
 *  The CGI script I wrote for searching the file and then navigating
 *  through it using the personal key numbers in angle brackets:
 *
 * #!/bin/sh
 * echo Content-type: text/html
 * echo
 * if [ $# = 0 ]
 * then
 *    echo "<HEAD>"
 *    echo "<TITLE>Surname search</TITLE>"
 *    echo "<ISINDEX>"
 *    echo "</HEAD>"
 *    echo "<BODY>"
 *    echo "<H1>Give the surname of the family</H1>"
 *    echo "Regular expressions allowed<P>"
 *    echo "</BODY>"
 * else
 *    echo "<HEAD>"
 *    echo "<TITLE>Search results</TITLE>"
 *    echo "<ISINDEX>"
 *    echo "</HEAD>"
 *    echo "<BODY>"
 *    echo "<H1>Now you can jump to any person displayed</H1>"
 *    echo "type the person's number in angle brackets (lesser/greater)<P>"
 *    grep -i "<ST>$*" <<here goes the path+filename>>
 *    echo "</BODY>"
 * fi
 *
 *
 *
 */

proc main ()
{
    monthformat(2)
    dateformat(5)
    forindi(indi,n) {
        print(" ") print(name(indi)) print(nl())
        call longvitals(indi)
        set(j,1)
        families(indi,fam,spouse,nfam) {
            if (eq(1,nspouses(indi))) {
               "<P><DL><DT>x " }
            else { "<P><DL><DT>x " d(j) ") "
                set(j,add(j,1)) }
            if (eq(0,nchildren(fam))) {
                call spousevitals(spouse,fam)
                ", children not recorded [" key(spouse,1) "]" }
            else {
                call spousevitals(spouse,fam)
                " [" key(spouse,1) "]"
                children(fam,child,nchl) {
                        "<DD>" d(nchl) ". "
                        name(child) " [" key(child,1) "]"
                    }
                }
                "</DL>"
            }
        }
    }

proc longvitals(i)
{
        set(father,father(i))
        set(mother,mother(i))
        nl() "-------------------------<P>"
        if (or(father,mother)) {
        "Parents: "
        if (father)          { name(father) }
        if (and(father,mother)) { " & " }
        if (mother)          { name(mother) }
        }
        "<H2><ST><" key(i,1) ">" givens(i) " <ST>" surname(i) "</ST></H2></ST>"
        set(e,birth(i))
        if(or(date(e),place(e))) { " * " }
        if(date(e)) { stddate(e) ", " }
        if(place(e)) { place(e) ", " }
        set(e,death(i))
        if(or(date(e),place(e))) { " + " }
        if(date(e)) { stddate(e) ", " }
        if(place(e)) { place(e) ", " }
        fornodes(inode(i), node) {
                if (eq(0,strcmp("OCCU", tag(node)))) {
                       value(node) ", "
                }
        }
        fornodes(inode(i), node) {
                if (eq(0,strcmp("NOTE", tag(node)))) {
                        value(node)
                        fornodes(node, subnode) {
                        if (eq(0,strcmp(or("CONT","CONC"), tag(subnode)))) {
                                        " " value(subnode)
                                }
                        }
                }
        }
}

proc spousevitals (sp,fam)
{
        set(e,marriage(fam))
        if(date(e)) { stddate(e) ", " }
        if(place(e)) { place(e) ", " }
        name(sp)
}