aboutsummaryrefslogtreecommitdiffstats
path: root/olb/Online.c
blob: 66c26f00e46a380c506c3e841c9185b4a5a424dd (plain) (blame)
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
#include "online.dcl"

/*
   Online Bible Database Access Routines
*/

INT versedata[MAX_VERSE];
INT verse_list[MAX_LIST];
CHAR data[MAX_DATA];

void main(argc, argv)
int  argc;
CHAR *argv[];
{
 CHAR found, passage[64], *p;
 int i, j;
 INT word;
short verse_list[MAX_LIST];
 extern struct zonline online;

 if (argc > 1)
    call DOINIT(argv[1]);   /* initialise system */
 else
    call DOINIT("g:\\bible\\av");   /* initialise system */

					   /* get text for Ge 1:1 & Rev 22:21 */

 for (i = 1; i < 8; i++)
    puts(GETVRSN(i));

 verse_list[0] = 10;
 for (i=1; i <= 8; i++)
    verse_list[i] = i;
 verse_list[9] = 31101;
 verse_list[10] = 31102;
 for (i = 1; i <= 10; i++)
    puts(VRSTOREF(verse_list[i], 0));
 call DUMPVRS(verse_list, versedata, data);

 word = MAPWORD("Aaron", &found);   /* map a word into an absolute number */
 call PUTLIST("Aaron=", word);
 if (found == 0) then
    puts("*Not Found");
 else
    puts("*Found");
 call GETWORD(word, verse_list);    /* get list of verses for a word */
 call DUMPVRS(verse_list, versedata, (CHAR *) data);

 /* first word in index */
 word = MAPWORD("a", &found);   /* map a word into an absolute number */
 call PUTLIST("a=", word);
 if (found == 0) then
    puts("*Not Found");
 else
    puts("*Found");
 call GETWORD(word, verse_list);    /* get list of verses for a word */
 call DUMPVRS(verse_list, versedata, (CHAR *) data);
 call GETSTRNG(1, verse_list, 0);   /* get list of verses for Strong's */
 call DUMPVRS(verse_list, versedata, (CHAR *) data);

 /* last word in index */
 word = MAPWORD("Zuzims", &found);   /* map a word into an absolute number */
 call PUTLIST("Zuzims=", word);
 if (found == 0) then
    puts("*Not Found");
 else
    puts("*Found");

 call GETWORD(word, verse_list);    /* get list of verses for a word */
 call DUMPVRS(verse_list, versedata, (CHAR *) data);

 printf("\nCross References for Ge 1:1\n");
 call GETCXREF(1, verse_list);      /* get cross-references for a verse */
 verse_list[1] = verse_list[66];
 verse_list[2] = verse_list[67];
 call DUMPVRS(verse_list, versedata, (CHAR *) data);

 for (i = 1; i <= 31102; i++)   /* verify conversion routines work */
    {
	if ((i % 1000) == 0) then
        puts(DECIMAL(i));
	p = VRSTOREF(i, 0);
	if (*p < '9' && *(p+1) == ' ') then
	   {                      /* fix book names like 1 Timothy -> 1Timothy */
         *(p+1) = *p;
	    *p = ' ';
	   }
	j = REFTOVRS(p);
     if (j != i) then
        {
	    printf("i=%d, j=%d, ref=%s\n", i, j, p);
	    call ERROR("VRSTOREF - Error");
        }
    }

 DOEND();
}