03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews/*
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * Copyright (C) 2005 Internet Systems Consortium, Inc. ("ISC")
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * Permission to use, copy, modify, and distribute this software for any
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * purpose with or without fee is hereby granted, provided that the above
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * copyright notice and this permission notice appear in all copies.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews *
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * PERFORMANCE OF THIS SOFTWARE.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews */
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
422009fe5b15e31e7f5d09212bd1480121a1464eEvan Hunt/* $Id: dlz_drivers.c,v 1.4 2011/03/10 04:36:16 each Exp $ */
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews/*! \file */
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <config.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <isc/result.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews/*
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * Pull in declarations for this module's functions.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews */
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <dlz/dlz_drivers.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews/*
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * Pull in driver-specific stuff.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews */
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_STUB
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <dlz/dlz_stub_driver.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_POSTGRES
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <dlz/dlz_postgres_driver.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_MYSQL
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <dlz/dlz_mysql_driver.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_FILESYSTEM
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <dlz/dlz_filesystem_driver.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_BDB
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <dlz/dlz_bdb_driver.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <dlz/dlz_bdbhpt_driver.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_LDAP
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <dlz/dlz_ldap_driver.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_ODBC
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#include <dlz/dlz_odbc_driver.h>
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews/*%
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * Call init functions for all relevant DLZ drivers.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews */
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsisc_result_t
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdlz_drivers_init(void) {
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews isc_result_t result = ISC_R_SUCCESS;
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_STUB
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews result = dlz_stub_init();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if (result != ISC_R_SUCCESS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews return (result);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_POSTGRES
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews result = dlz_postgres_init();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if (result != ISC_R_SUCCESS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews return (result);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_MYSQL
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews result = dlz_mysql_init();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if (result != ISC_R_SUCCESS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews return (result);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_FILESYSTEM
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews result = dlz_fs_init();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if (result != ISC_R_SUCCESS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews return (result);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_BDB
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews result = dlz_bdb_init();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if (result != ISC_R_SUCCESS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews return (result);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews result = dlz_bdbhpt_init();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if (result != ISC_R_SUCCESS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews return (result);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_LDAP
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews result = dlz_ldap_init();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if (result != ISC_R_SUCCESS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews return (result);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_ODBC
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews result = dlz_odbc_init();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews if (result != ISC_R_SUCCESS)
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews return (result);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews return (result);
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews}
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews/*%
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews * Call shutdown functions for all relevant DLZ drivers.
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews */
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsvoid
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrewsdlz_drivers_clear(void) {
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_STUB
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews dlz_stub_clear();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_POSTGRES
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews dlz_postgres_clear();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_MYSQL
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews dlz_mysql_clear();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_FILESYSTEM
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews dlz_fs_clear();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_BDB
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews dlz_bdb_clear();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews dlz_bdbhpt_clear();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_LDAP
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews dlz_ldap_clear();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#ifdef DLZ_ODBC
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews dlz_odbc_clear();
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews#endif
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews
03e200df5dc283f24a6a349f0b31d3eab26da893Mark Andrews}