1 | /***************************************
2 | $Revision:
3 |
4 | CA module: a wrapper for the functions which parse the
5 | dictionary, configuration and source files.
6 |
7 | Status: NOT REVIEWED, NOT TESTED
8 |
9 | Author(s): Ambrose Magee
10 |
11 | ******************//******************
12 | Modification History:
13 |
14 | ******************/
15 |
16 | /************************************
17 | Copyright (c) 2000 RIPE NCC
18 |
19 | All Rights Reserved
20 |
21 | Permission to use, copy, modify, and distribute this software and its
22 | documentation for any purpose and without fee is hereby granted,
23 | provided that the above copyright notice appear in all copies and that
24 | both that copyright notice and this permission notice appear in
25 | supporting documentation, and that the name of the author not be
26 | used in advertising or publicity pertaining to distribution of the
27 | software without specific, written prior permission.
28 |
29 | THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
30 | ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL
31 | AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
32 | DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
33 | AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
34 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
35 | ***************************************/
36 |
37 | #include <stdio.h>
38 | #include "ca_defs.h"
39 | #include "ca_configFns.h"
40 | #include "ca_dictionary.h"
41 |
42 | /* #define DEBUG */
43 |
44 | /*
45 | * The initialization function.
46 | */
47 |
48 | void ca_init(const char *configFile)
49 | /****************************************************************
50 | * ca_init() -- Initialisation function; *
51 | * - a wrapper for the ca_populateDictionary,` *
52 | * the ca_readConfig and the ca_readSources *
53 | * functions. *
54 | * *
55 | * Parameters *
56 | * configFile -- the name of the configuration file *
57 | * *
58 | * Returns *
59 | * Nothing -- perhaps make this return 0 on successful *
60 | * completion ? *
61 | * *
62 | ****************************************************************/
63 | {
64 | /*
65 | * We use CA_NUMBEROFSYMBOLS instead.
66 | * int varNo = VARS;
67 | */
68 |
69 | int varNo = CA_NUMBEROFSYMBOLS;
70 |
71 | /*
72 | * We do not need this function now; the dictionary is hardcoded.
73 | *
74 | * ca_populateDictionary(dictionary, varNo);
75 | */
76 |
77 | #ifdef DEBUG
78 | ca_getDictionary(dictionary, varNo);
79 | #endif /* DEBUG */
80 |
81 | ca_readConfig(configFile, confVars, varNo);
82 | /*
83 | * ca_sanityChk(confVars);
84 | */
85 | if (ca_mandVarChk() != 0)
86 | {
87 | fprintf(stderr, "Mandatory variable(s) undefined\n\n");
88 | fprintf(stderr, "<<<<<<<<<<<<<<< >>>>>>>>>>>\n\n");
89 | }
90 |
91 | /*
92 | * sourcesFile = ca_get_dirlist(94);
93 | */
94 | sourcesFile = ca_get_dirlist(CA_SOURCEFILE);
95 | ca_readSources(sourcesFile, confVars);
96 | }