~ubuntu-branches/debian/squeeze/sword/squeeze

« back to all changes in this revision

Viewing changes to olb/addstrongs.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Glassey
  • Date: 2004-01-15 15:50:07 UTC
  • Revision ID: james.westby@ubuntu.com-20040115155007-n9mz4x0zxrs1isd3
Tags: upstream-1.5.7
ImportĀ upstreamĀ versionĀ 1.5.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "online.dcl"
 
2
#include <stdlib.h>
 
3
#include <fcntl.h>
 
4
#include <io.h>
 
5
 
 
6
/*
 
7
   Online Bible Database Access Routines
 
8
*/
 
9
 
 
10
INT versedata[MAX_VERSE];
 
11
CHAR data[MAX_DATA];
 
12
 
 
13
void main(argc, argv)
 
14
int  argc;
 
15
CHAR *argv[];
 
16
{
 
17
        int fd;
 
18
 CHAR found, passage[64], *p;
 
19
 int i, j;
 
20
 INT word;
 
21
short verse_list[MAX_LIST];
 
22
 extern struct zonline online;
 
23
 
 
24
 if (argc > 1)
 
25
    call DOINIT(argv[1]);   /* initialise system */
 
26
 else
 
27
    call DOINIT("g:\\bible\\av");   /* initialise system */
 
28
        fd = open("../modules/texts/rawtext/kjv/ot", O_RDONLY);
 
29
 
 
30
                                           /* get text for Ge 1:1 & Rev 22:21 */
 
31
 
 
32
 for (i = 1; i < 8; i++)
 
33
    puts(GETVRSN(i));
 
34
 
 
35
 verse_list[0] = 10;
 
36
 for (i=1; i <= 8; i++)
 
37
    verse_list[i] = i;
 
38
 verse_list[9] = 31101;
 
39
 verse_list[10] = 31102;
 
40
 for (i = 1; i <= 10; i++)
 
41
    puts(VRSTOREF(verse_list[i], 0));
 
42
 call DUMPVRS(verse_list, versedata, data);
 
43
 
 
44
 word = MAPWORD("Aaron", &found);   /* map a word into an absolute number */
 
45
 call PUTLIST("Aaron=", word);
 
46
 if (found == 0) then
 
47
    puts("*Not Found");
 
48
 else
 
49
    puts("*Found");
 
50
 call GETWORD(word, verse_list);    /* get list of verses for a word */
 
51
 call DUMPVRS(verse_list, versedata, (CHAR *) data);
 
52
 
 
53
 /* first word in index */
 
54
 word = MAPWORD("a", &found);   /* map a word into an absolute number */
 
55
 call PUTLIST("a=", word);
 
56
 if (found == 0) then
 
57
    puts("*Not Found");
 
58
 else
 
59
    puts("*Found");
 
60
 call GETWORD(word, verse_list);    /* get list of verses for a word */
 
61
 call DUMPVRS(verse_list, versedata, (CHAR *) data);
 
62
 call GETSTRNG(1, verse_list, 0);   /* get list of verses for Strong's */
 
63
 call DUMPVRS(verse_list, versedata, (CHAR *) data);
 
64
 
 
65
 /* last word in index */
 
66
 word = MAPWORD("Zuzims", &found);   /* map a word into an absolute number */
 
67
 call PUTLIST("Zuzims=", word);
 
68
 if (found == 0) then
 
69
    puts("*Not Found");
 
70
 else
 
71
    puts("*Found");
 
72
 
 
73
 call GETWORD(word, verse_list);    /* get list of verses for a word */
 
74
 call DUMPVRS(verse_list, versedata, (CHAR *) data);
 
75
 
 
76
 printf("\nCross References for Ge 1:1\n");
 
77
 call GETCXREF(1, verse_list);      /* get cross-references for a verse */
 
78
 verse_list[1] = verse_list[66];
 
79
 verse_list[2] = verse_list[67];
 
80
 call DUMPVRS(verse_list, versedata, (CHAR *) data);
 
81
 
 
82
 for (i = 1; i <= 31102; i++)   /* verify conversion routines work */
 
83
    {
 
84
        if ((i % 1000) == 0) then
 
85
        puts(DECIMAL(i));
 
86
        p = VRSTOREF(i, 0);
 
87
        if (*p < '9' && *(p+1) == ' ') then
 
88
           {                      /* fix book names like 1 Timothy -> 1Timothy */
 
89
         *(p+1) = *p;
 
90
            *p = ' ';
 
91
           }
 
92
        j = REFTOVRS(p);
 
93
     if (j != i) then
 
94
        {
 
95
            printf("i=%d, j=%d, ref=%s\n", i, j, p);
 
96
            call ERROR("VRSTOREF - Error");
 
97
        }
 
98
    }
 
99
 
 
100
 DOEND();
 
101
}
 
 
b'\\ No newline at end of file'