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

« back to all changes in this revision

Viewing changes to reports/lldb.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 lldb.ll
 
3
 * @version  1.02
 
4
 * @author   Marc Nozell <marc@nozell.com>
 
5
 * @category palmpilot
 
6
 * @output   pdb import files
 
7
 * @description
 
8
 *
 
9
 *   This program produces a report of all INDI's in the database, with
 
10
 *   sorted names as output for inport into Tom Dyas' Open Source DB
 
11
 *   PalmOS app.  
 
12
 *
 
13
 *   lldb.ll V1.02
 
14
 *
 
15
 *   Marc Nozell <marc@nozell.com>
 
16
 *
 
17
 *   This report generator works only with the LifeLines Genealogy program
 
18
 *
 
19
 *   It will produce a report of all INDI's in the database, with
 
20
 *   sorted names as output for inport into Tom Dyas' Open Source DB
 
21
 *   PalmOS app.  
 
22
 * 
 
23
 * 0) Obtain Tom Wetmore's LifeLines genealogy program for Unix.
 
24
 *    See http://lifelines.sourceforge.net/
 
25
 * 
 
26
 * 1) Obtain Kenneth Albanowski's <kjahds@kjahds.com> pilot-link
 
27
 *    package.  The Microsoft Windows-based Palm desktop should also
 
28
 *    work.  Most Linux distributions include pilot-link (check
 
29
 *    http://rpmfind.net) and should build on most UNIXes.
 
30
 *
 
31
 * 2) Obtain Tom Dyas' <tdyas@vger.rutgers.edu> "DB: Open Source
 
32
 *    Database Program for PalmOS" and supporting tools from
 
33
 *    http://pilot-db.sourceforge.net/
 
34
 *
 
35
 * 3) Run this lifelines report.  It will generate two files, lldb.info
 
36
 *    and lldb.csv.
 
37
 *    
 
38
 * 5) Run the CSV to PDB conversion tool like this:
 
39
 *            csv2pdb --info=lldb.info lldb.csv lldb.pdb
 
40
 *    
 
41
 * 5) Install the converted info to the Palm device like this:
 
42
 *            pilot-link -i ll.pdb
 
43
 * 
 
44
 * 
 
45
 *   V1.00                                        11-Sep-1999
 
46
 *   Initial Version
 
47
 *
 
48
 *   V1.01                                        26-Oct-1999
 
49
 * 
 
50
 *   Cleaned up output files
 
51
 *   Updated to new version Dyas' conversion tool
 
52
 *      (pre-palm-db-tools-0.2.0.tar.gz)
 
53
 *
 
54
 *   V1.02                                        10-Nov-2000
 
55
 *   Updated URLs
 
56
 * 
 
57
 *  $Log: lldb.ll,v $
 
58
 *  Revision 1.7  2004/07/19 05:54:55  dr_doom
 
59
 *  Merge Vincent Broman Changes to reports
 
60
 *
 
61
 *  Revision 1.6  2003/01/19 02:50:23  dr_doom
 
62
 *  move 1 paragraph description to immediately before @description  for index.html
 
63
 *
 
64
 *  Revision 1.5  2000/11/28 21:39:45  nozell
 
65
 *  Add keyword tags to all reports
 
66
 *  Extend the report script menu to display script output format
 
67
 *
 
68
 *  Revision 1.4  2000/11/27 20:48:15  nozell
 
69
 *  Header is to verbose, use just Log
 
70
 *
 
71
 *  Revision 1.3  2000/11/27 20:46:26  nozell
 
72
 *  Typo in CVS header
 
73
 *
 
74
 *  Revision 1.2  2000/11/27 20:45:43  nozell
 
75
 *  Add CVS keywords
 
76
 *
 
77
 * 
 
78
 */
 
79
 
 
80
proc main ()
 
81
{
 
82
/*   newfile (concat (database (), ".info"), 0) */
 
83
 
 
84
   newfile (concat ("lldb.info"), 0)
 
85
        
 
86
   "title \"Genealogy\"\n"
 
87
   "backup off\n"
 
88
   "find on\n"
 
89
   "extended off\n"
 
90
   "field \"ID\" string 25\n"
 
91
   "field \"Name\" string 80\n"
 
92
   "field \"Birth\" string 80\n"
 
93
   "field \"Death\" string 80\n"
 
94
   "field \"SpouseID\" string 80\n"
 
95
   "field \"ChildrenID\" string 80\n"
 
96
   "field \"FatherID\" string 80\n"
 
97
   "field \"MotherID\" string 80\n"
 
98
 
 
99
/*   newfile (concat (database (), ".csv"), 0) */
 
100
 
 
101
  newfile (concat ("lldb.csv"), 0)
 
102
 
 
103
  indiset(idx)
 
104
 
 
105
    /*  monthformat(4) */
 
106
 
 
107
    /* Grab them all */
 
108
    print("Please wait...")
 
109
    forindi(indi,n) {  
 
110
        addtoset(idx,indi,n)
 
111
    }
 
112
    print(nl()) print("Found ") print(d(n)) print(" people.")
 
113
    print(nl())
 
114
    print("begin sorting") print(nl())
 
115
    namesort(idx)
 
116
    print("done sorting") print(nl())
 
117
 
 
118
/*    col(1) "ID,Name,Birth,Death,SpouseID,ChildrenID,FatherID,MotherID" nl() */
 
119
 
 
120
    forindiset(idx,indi,v,n) {
 
121
        col(1) "\"" key(indi) "\""
 
122
        ","
 
123
        "\""fullname(indi,1,0,30) "\""
 
124
        ","
 
125
 
 
126
        call showvitals(indi)
 
127
        call showspouse(indi)
 
128
        call showkids(indi)
 
129
        call showparents(indi)
 
130
        print("+") 
 
131
        }
 
132
 
 
133
        nl()
 
134
        print(nl())
 
135
}
 
136
 
 
137
/************************************************************************/
 
138
proc showvitals (i)
 
139
{
 
140
    set(b, birth(i))
 
141
    set(d, death(i))
 
142
    if (and(b, short(b))) {
 
143
        "\"" long(b) "\""
 
144
    }
 
145
    else {
 
146
        "\" \"" 
 
147
    }
 
148
 
 
149
    ","
 
150
 
 
151
    if (and(d, short(d))) {
 
152
        "\"" long(d) "\"" 
 
153
    }
 
154
    else {
 
155
        "\" \"" 
 
156
    }
 
157
}
 
158
 
 
159
proc showparents (i)
 
160
{
 
161
    ",\""
 
162
    if(fath,father(i)) {
 
163
/*        "(" key(fath) ") " */
 
164
        key(fath)
 
165
    }
 
166
    else {
 
167
        "-unknown-"
 
168
    }
 
169
 
 
170
    "\""
 
171
 
 
172
    ",\""
 
173
 
 
174
    if(moth,mother(i)) {
 
175
/*         "(" key(moth) ") " */
 
176
        key(moth)
 
177
    }
 
178
    else {
 
179
        "-unknown-"
 
180
    }
 
181
    "\""
 
182
}
 
183
/************************************************************************/
 
184
proc showspouse (i) {
 
185
    ",\""
 
186
    if (eq(1, nspouses(i))) {
 
187
        spouses(i, s, f, n) {
 
188
            name(s) "(" key(s) ") "
 
189
        }
 
190
    }
 
191
    else {
 
192
        spouses(i, s, f, n) {
 
193
        ord(n) /* First, Second ... */
 
194
        " " name(s) "(" key(s) ") "
 
195
        }
 
196
    }
 
197
    "\""
 
198
}
 
199
 
 
200
/************************************************************************/
 
201
proc showkids (i) {
 
202
    ",\""
 
203
    set(j, 0)
 
204
    families(i, f, s, n) {
 
205
        set(j, add(j, nchildren(f)))
 
206
    }
 
207
 
 
208
    if (eq(0, j)) {
 
209
        " "
 
210
    }
 
211
    else {
 
212
        if (eq(1, j)) {
 
213
            "Child: "  
 
214
        }
 
215
        else {
 
216
            d(j) " Children:"  
 
217
        }
 
218
        set(j, 1)
 
219
        families(i, f, s, n) {
 
220
            children(f, c, m) {
 
221
               " (" key(c) ")"
 
222
                set(j, add(j,1))
 
223
            }
 
224
        }
 
225
    }
 
226
    "\""
 
227
}