Introduced Logger.
[bpdyndnsd] / src / main.cpp
1 /** @file
2  * @brief The main function.
3  *
4  *
5  *
6  * @copyright Intra2net AG
7  * @license GPLv2
8 */
9
10 #ifdef HAVE_CONFIG_H
11 #include <config.h>
12 #endif
13
14 #define VERSION     0
15 #define REVISION    1
16 #define RELEASE     0
17
18 #include <iostream>
19 #include <list>
20 #include <string>
21
22 #include <boost/foreach.hpp>
23
24 #include "updater.cpp"
25 #include "config.cpp"
26 #include "logger.cpp"
27
28 #include "service.cpp"
29
30 #include "dhs.cpp"
31 #include "ods.cpp"
32
33 using namespace std;
34
35 typedef boost::shared_ptr<Updater> UpdaterPtr;
36
37 /**
38  * @brief The main part.
39  * @param argc Number of arguments
40  * @param argv Command line arguments
41  * @return 0 if all is fine.
42  */
43 int main(int argc, char *argv[])
44 {
45     // initialize Updater
46     UpdaterPtr updater(new Updater);
47
48     // load the cmd options
49     if ( updater->init_config_from_cmd(argc,argv) != 0 )
50         return 0;
51
52     // load the config and service files
53     if ( updater->init_config_from_files() != 0 )
54         return 0;
55
56     // set the configured loggin facility, default stdout
57
58     // initialize daemon mode if configured
59
60     // update all configured services
61     updater->update_services();
62
63     return 0;
64 }