/* * Copyright (C) 2007 Tildeslash Ltd. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation. * * There are special exceptions to the terms and conditions of the GPL * as it is applied to this software. View the full text of the exception * in the file EXCEPTIONS accompanying this software distribution. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef CONNECTIONSTRATEGY_H #define CONNECTIONSTRATEGY_H /** * This interface defines the contract for the concrete database * implementation used for delegation in the Connection class. * * @version \$Id: ConnectionStrategy.h,v 1.18 2007/01/02 10:29:50 hauk Exp $ * @file */ #define T IConnection_T typedef struct T *T; typedef struct conop { char *name; T (*new)(URL_T url, char **error); void (*free)(T *C); void (*setQueryTimeout)(T C, int ms); void (*setMaxRows)(T C, int max); int (*ping)(T C); int (*beginTransaction)(T C); int (*commit)(T C); int (*rollback)(T C); long long int (*lastRowId)(T C); long long int (*rowsChanged)(T C); int (*execute)(T C, const char *sql, va_list ap); ResultSet_T (*executeQuery)(T C, const char *sql, va_list ap); PreparedStatement_T (*prepareStatement)(T C, const char *sql); const char *(*getLastError)(T C); } *Cop_T; #undef T #endif