4 * @brief Main settingsd source file.
7 * Copyright 2012, 2013 Intel Corporation All Rights Reserved.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation;
12 * version 2.1 of the License.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 * Boston, MA 02110-1301 USA
25 #include "../lib/config.hpp"
26 #include "../lib/manager.hpp"
28 #include "configurator.hpp"
29 #include "websocket_server.hpp"
31 #include <settingsd/glib_traits.hpp>
32 #include <settingsd/smart_ptr.hpp>
39 * settingsd program entry point.
41 * @param[in] argc The number of settingsd command line arguments.
42 * @param[in] argv The settingsd command line option/argument vector.
45 main(int argc, char * argv[])
47 std::cerr << PACKAGE_STRING << '\n';
52 settings::configurator config(argc, argv, IVI_SETTINGS_DBUS_NAME);
54 settings::manager manager(config.settings_dir());
56 // The websocket server will run in its own thread.
57 settings::websocket_server server(config, manager);
60 // Glib related events, including GDbus related signal handlers,
61 // will handled in this (main) thread.
62 settings::smart_ptr<GMainLoop> const loop(g_main_loop_new(nullptr, false));
63 g_main_loop_run(loop.get());
65 catch (std::exception & e) {
66 std::cerr << e.what();
77 // indent-tabs-mode: nil