config.c revision 05b261ec
105b261ecSmrg/*
205b261ecSmrg * Copyright © 2006-2007 Daniel Stone
305b261ecSmrg *
405b261ecSmrg * Permission is hereby granted, free of charge, to any person obtaining a
505b261ecSmrg * copy of this software and associated documentation files (the "Software"),
605b261ecSmrg * to deal in the Software without restriction, including without limitation
705b261ecSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
805b261ecSmrg * and/or sell copies of the Software, and to permit persons to whom the
905b261ecSmrg * Software is furnished to do so, subject to the following conditions:
1005b261ecSmrg *
1105b261ecSmrg * The above copyright notice and this permission notice (including the next
1205b261ecSmrg * paragraph) shall be included in all copies or substantial portions of the
1305b261ecSmrg * Software.
1405b261ecSmrg *
1505b261ecSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1605b261ecSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1705b261ecSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
1805b261ecSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1905b261ecSmrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2005b261ecSmrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2105b261ecSmrg * DEALINGS IN THE SOFTWARE.
2205b261ecSmrg *
2305b261ecSmrg * Author: Daniel Stone <daniel@fooishbar.org>
2405b261ecSmrg */
2505b261ecSmrg
2605b261ecSmrg#ifdef HAVE_DIX_CONFIG_H
2705b261ecSmrg#include <dix-config.h>
2805b261ecSmrg#endif
2905b261ecSmrg
3005b261ecSmrg#include "os.h"
3105b261ecSmrg#include "hotplug.h"
3205b261ecSmrg#include "config-backends.h"
3305b261ecSmrg
3405b261ecSmrgvoid
3505b261ecSmrgconfig_init()
3605b261ecSmrg{
3705b261ecSmrg#if defined(CONFIG_DBUS_API) || defined(CONFIG_HAL)
3805b261ecSmrg    if (config_dbus_core_init()) {
3905b261ecSmrg# ifdef CONFIG_DBUS_API
4005b261ecSmrg       if (!config_dbus_init())
4105b261ecSmrg	    ErrorF("[config] failed to initialise D-Bus API\n");
4205b261ecSmrg# endif
4305b261ecSmrg# ifdef CONFIG_HAL
4405b261ecSmrg        if (!config_hal_init())
4505b261ecSmrg            ErrorF("[config] failed to initialise HAL\n");
4605b261ecSmrg# endif
4705b261ecSmrg    }
4805b261ecSmrg    else {
4905b261ecSmrg	ErrorF("[config] failed to initialise D-Bus core\n");
5005b261ecSmrg    }
5105b261ecSmrg#endif
5205b261ecSmrg}
5305b261ecSmrg
5405b261ecSmrgvoid
5505b261ecSmrgconfig_fini()
5605b261ecSmrg{
5705b261ecSmrg#if defined(CONFIG_DBUS_API) || defined(CONFIG_HAL)
5805b261ecSmrg# ifdef CONFIG_HAL
5905b261ecSmrg    config_hal_fini();
6005b261ecSmrg# endif
6105b261ecSmrg# ifdef CONFIG_DBUS_API
6205b261ecSmrg    config_dbus_fini();
6305b261ecSmrg# endif
6405b261ecSmrg    config_dbus_core_fini();
6505b261ecSmrg#endif
6605b261ecSmrg}
67