summaryrefslogtreecommitdiffstats
path: root/misc/olb/Getvrsn.c
blob: d447642b5ae0fa03ad2e955bb441c0eb0c4cd711 (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
/*

 * Copyright 2009 CrossWire Bible Society (http://www.crosswire.org)

 *	CrossWire Bible Society

 *	P. O. Box 2528

 *	Tempe, AZ  85280-2528

 *

 * This program is free software; you can redistribute it and/or modify it

 * under the terms of the GNU General Public License as published by the

 * Free Software Foundation version 2.

 *

 * This program is distributed in the hope that it will be useful, but

 * WITHOUT ANY WARRANTY; without even the implied warranty of

 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

 * General Public License for more details.

 *

 */

#include <online.dcl>


/*

  Get version id for display



  If triple verse A_B_C then



  Inputs:

      1 - returns "A"

      2 - returns "B"

      3 - returns "A_B"

      4 - returns "C"

      5 - returns "A_C"

      6 - returns "B_C"

      7 - returns "A_B_C"

*/

CHAR *GETVRSN(int version)
{
 extern struct zonline online;
 static CHAR versionid[16];

 X("Getvrsn");
 if (version < 1 || version > 7) then
    call ERROR("Version Id Invalid");
 versionid[0] = 0;
 if (version & 1) then
    {
     strcat(versionid, "_");
     STRCAT(versionid, &online.versions[0][0], 16, "Getrsn-1");
    }
 if (version & 2) then
    {
     if (online.versions[1][0] != 0) then
        {
         strcat(versionid, "_");
         STRCAT(versionid, &online.versions[1][0], 16, "Getrsn-2");
        }
    }
 if (version & 4) then
    {
     if (online.versions[2][0] != 0) then
        {
         strcat(versionid, "_");
         STRCAT(versionid, &online.versions[2][0], 16, "Getrsn-3");
        }
    }
 Y();
 return(&versionid[1]);
}