~ubuntu-branches/ubuntu/trusty/lifelines/trusty

« back to all changes in this revision

Viewing changes to reports/tinytafel2.ll

  • Committer: Bazaar Package Importer
  • Author(s): Felipe Augusto van de Wiel (faw)
  • Date: 2007-05-23 23:49:53 UTC
  • mfrom: (3.1.3 edgy)
  • Revision ID: james.westby@ubuntu.com-20070523234953-ogno9rnbmth61i7p
Tags: 3.0.50-2etch1
* Changing docs/ll-reportmanual.xml and docs/ll-userguide.xml to fix
  documentation build problems (Closes: #418347).

* lifelines-reports
  - Adding a dependency to lifelines >= 3.0.50 to prevent file conflict.
    (Closes: #405500).

* Updating French translation. Thanks to Bernard Adrian. (Closes: #356671).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * @progname       tinytafel2
3
 
 * @version        2.0
4
 
 * @author         Wetmore, Eggert
5
 
 * @category       
6
 
 * @output         TinyTafel
7
 
 * @description    
8
 
 
9
 
This report will produce a tinytafel report on a person.
10
 
 
11
 
tinytafel2
12
 
 
13
 
Based on tinytafel1 by Tom Wetmore, ttw@cbnewsl.att.com
14
 
 
15
 
This report works only with the LifeLines Genealogy program
16
 
 
17
 
Version 1,        1991, by Tom Wetmore.
18
 
Version 2, 11 Jan 1993, by Jim Eggert, eggertj@ll.mit.edu,
19
 
                        added header, trailer, sorting, date fixing,
20
 
                        and default moderate interest.  Modified
21
 
                        empty surname recognition.
22
 
 
23
 
This report will produce a tinytafel report on a person.
24
 
 
25
 
Output is an ASCII file.  It should be edited to translate any
26
 
non-ASCII characters, to shorten long place names (to 14-16
27
 
characters), and to indicate interest level after each year:
28
 
   [space] No interest (level 0)
29
 
   .       Low interest (level 1)
30
 
   :       Moderate interest (level 2) (default)
31
 
   *       Highest interest (level 3)
32
 
 
33
 
You will want to modify the write_tafel_header() procedure to
34
 
include your name, address, etc.
35
 
 
36
 
Empty surnames or those starting with "_" or " " will not
37
 
be written to the report.  This report doesn't do birthyear
38
 
estimation; it uses other events for the year if birthyear
39
 
is not available.
40
 
 
41
 
See the end of this report for an example of a tinytafel report.
42
 
*/
43
 
 
44
 
global(tafelset)
45
 
global(fdatelist)
46
 
global(ldatelist)
47
 
global(fplacelist)
48
 
global(lplacelist)
49
 
global(line_count)
50
 
 
51
 
proc write_tafel_header() {
52
 
    "N John Q. Public\n"           /* your name, mandatory */
53
 
    "A 1234 North Maple\n"         /* address, 0-5 lines */
54
 
    "A Homesville, OX 12345-6789\n"
55
 
    "A USA\n"
56
 
    "T 1 (101) 555-1212\n"         /* telephone number */
57
 
    "C 19.2 Baud, Unix System\n"   /* communications */
58
 
    "C Send any Email to:  jqpublic@my.node.address\n"
59
 
    "B SoftRoots/1-101-555-3434\n" /* BBS system/phone number */
60
 
    "D Unix Operating System\n"    /* diskette formats */
61
 
    "F LifeLines Genealogy Program for Unix\n"  /* file format */
62
 
    "R This is a default header, please ignore.\n"  /* comments */
63
 
    "Z " d(line_count) "\n"
64
 
}
65
 
 
66
 
proc main ()
67
 
{
68
 
    list(plist)
69
 
    indiset(tafelset)
70
 
    list(fdatelist)
71
 
    list(ldatelist)
72
 
    list(fplacelist)
73
 
    list(lplacelist)
74
 
    set(line_count,0)
75
 
 
76
 
    getindi(person)
77
 
    enqueue(plist, person)
78
 
    while (person, dequeue(plist)) {
79
 
        call process_line(person, plist)
80
 
    }
81
 
    namesort(tafelset)
82
 
    call write_tafel_header()
83
 
    call write_tafelset()
84
 
    call write_tafel_trailer()
85
 
}
86
 
 
87
 
global(fdate)
88
 
global(ldate)
89
 
global(pdate)
90
 
global(fplace)
91
 
global(lplace)
92
 
global(pplace)
93
 
global(sname)
94
 
 
95
 
proc write_tafelset() {
96
 
    forindiset(tafelset,person,index,snum) {
97
 
        soundex(person) " "
98
 
        getel(ldatelist,index) ":" /* moderate interest by default */
99
 
        getel(fdatelist,index) ":"
100
 
        surname(person)
101
 
        if (lplace,getel(lplacelist,index)) { "\\" lplace }
102
 
        if (fplace,getel(fplacelist,index)) { "/" fplace }
103
 
        "\n"
104
 
    }
105
 
}
106
 
 
107
 
proc write_tafel_trailer() {
108
 
    "W " date(gettoday()) "\n"
109
 
}
110
 
 
111
 
proc process_line (person, plist)
112
 
{
113
 
    call first_in_line(person)
114
 
    set(initial,trim(sname,1))
115
 
    if (and(and(strcmp(initial, "_"),
116
 
                strcmp(initial, " ")),
117
 
            strcmp(sname,""))) {
118
 
        set(last, 0)
119
 
        while (person) {
120
 
            print(".")
121
 
            if (moth, mother(person)) {
122
 
                enqueue(plist, moth)
123
 
            }
124
 
            set(last, person)
125
 
            set(person, father(person))
126
 
            if (strcmp(sname, surname(person))) {
127
 
                call last_in_line(last)
128
 
                call first_in_line(person)
129
 
            }
130
 
        }
131
 
    }
132
 
}
133
 
 
134
 
proc first_in_line (person)
135
 
{
136
 
    call set_year_place(person)
137
 
    set(fdate, pdate)
138
 
    set(fplace, pplace)
139
 
    set(sname,save(surname(person)))
140
 
}
141
 
 
142
 
proc last_in_line (person)
143
 
{
144
 
    call set_year_place(person)
145
 
    set(ldate, pdate)
146
 
    set(lplace, pplace)
147
 
    set(line_count,add(line_count,1))
148
 
    addtoset(tafelset,person,line_count)
149
 
    if (and(strcmp(ldate,"????"),
150
 
            gt(strcmp(ldate,fdate),0))) {
151
 
        /* reverse order ldate and fdate */
152
 
        enqueue(ldatelist,save(fdate))
153
 
        enqueue(fdatelist,save(ldate))
154
 
    }
155
 
    else {
156
 
        /* normal order ldate and fdate */
157
 
        enqueue(ldatelist,save(ldate))
158
 
        enqueue(fdatelist,save(fdate))
159
 
    }
160
 
    enqueue(lplacelist,save(lplace))
161
 
    enqueue(fplacelist,save(fplace))
162
 
}
163
 
 
164
 
proc set_year_place (person)
165
 
{
166
 
    set (yr, year(birth(person)))
167
 
    if (eq(yr, 0)) {
168
 
        set (yr, year(baptism(person)))
169
 
    }
170
 
    if (eq(yr, 0)) {
171
 
        set (yr, year(death(person)))
172
 
    }
173
 
    if (eq(yr, 0)) {
174
 
        set (yr, year(burial(person)))
175
 
    }
176
 
    if (eq(yr, 0)) {
177
 
        set (yr, "????")
178
 
    }
179
 
    set(pdate, save(yr))
180
 
    set(pl, place(birth(person)))
181
 
    if (eq(pl, 0)) {
182
 
        set(pl, place(baptism(person)))
183
 
    }
184
 
    if (eq(pl, 0)) {
185
 
        set(pl, place(death(person)))
186
 
    }
187
 
    if (eq(pl, 0)) {
188
 
        set(pl, place(burial(person)))
189
 
    }
190
 
    set(pplace, save(pl))
191
 
}
192
 
 
193
 
 
194
 
/*
195
 
 
196
 
Here is an example of a tiny tafel by Cliff Manis.
197
 
 
198
 
Note that the "Z" line is the number of actual data lines.
199
 
 
200
 
N Alda Clifford Manis
201
 
A P. O. Box 33937
202
 
A San Antonio
203
 
A Texas
204
 
A 78265-3937
205
 
T 1 (512) 654-9912
206
 
C 19.2 Baud, Unix System
207
 
C Send any Email to:  cmanis@csoftec.csf.com
208
 
D Unix Operating System
209
 
F LifeLines Genealogy Program for Unix
210
 
Z 16
211
 
M520 1939 1939 Manis\Knoxville, Knox Co, TN/Knoxville, Knox Co, TN
212
 
M520 1780 1902 Manes\Sevier Co, TN ?/Union Valley, Sevier Co, TN
213
 
M520 1770 1770 Maness\Sevier Co, Tennessee ?/Sevier Co, Tennessee ?
214
 
M520 1805 1914 Manis\North Carolina ?/Dandridge, Jefferson Co, TN
215
 
C536 1820 1869 Canter\VA/Jonesboro, Washington Co, TN
216
 
B620 1765 1829 Bowers/TN
217
 
N550 1730 1881 Newman\Monroe Co., WV/Jefferson Co, TN
218
 
B630 1760 1845 Bird\Frederick Co, VA/Sevier Co, TN
219
 
B630 1730 1730 Barth\Germany/Germany
220
 
F652 1745 1810 Francis\Augusta Co, VA ?/Rutherford Co, NC
221
 
W365 1860 1846 Whitehorn\VA/Washington Co, TN ?
222
 
C500 1700 1808 Cowan/TN
223
 
C613 1720 1843 Corbett\Scotch-Irish Dec/Jefferson Co, TN
224
 
R525 1750 1806 Rankin\Scotland/Jefferson Co., TN
225
 
S636 1776 1799 Shrader\Virginia/Sevier Co, TN ?
226
 
B300 1772 1772 Boyd\Boyd's Creek, Sevier Co, TN/Boyd's Creek, Sevier Co, TN
227
 
W 24 September 1992
228
 
 
229
 
*/
230
 
 
231
 
/* End of Report */