1 /* spmfilter - mail filtering framework 2 * Copyright (C) 2012 Axel Steiner and SpaceNet AG 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 3 of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public 15 * License along with this program. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18 #ifndef _SMF_LOOKUP_SQL_H 19 #define _SMF_LOOKUP_SQL_H 20 21 #ifdef HAVE_ZDB 22 #include <zdb.h> 23 24 typedef struct { 25 ConnectionPool_T pool; 26 URL_T url; 27 } SMFSQLConnection_T; 28 29 char *smf_lookup_sql_get_rand_host(SMFSettings_T *settings); 30 char *smf_lookup_sql_get_dsn(SMFSettings_T *settings, char *host); 31 int smf_lookup_sql_start_pool(SMFSettings_T *settings, char *dsn); 32 void smf_lookup_sql_con_close(Connection_T c); 33 Connection_T smf_lookup_sql_get_connection(ConnectionPool_T pool); 34 void smf_lookup_sql_abort_handler(const char *error); 35 #endif 36 37 #endif /* _SMF_LOOKUP_SQL_H */ 38 39