mysql_driver_defs.h

00001 /* File: mysql_driver.h
00002 ** Author: Saikat Mukherjee
00003 ** Contact:   xsb-contact@cs.sunysb.edu
00004 ** 
00005 ** Copyright (C) The Research Foundation of SUNY, 2002-2006
00006 ** 
00007 ** XSB is free software; you can redistribute it and/or modify it under the
00008 ** terms of the GNU Library General Public License as published by the Free
00009 ** Software Foundation; either version 2 of the License, or (at your option)
00010 ** any later version.
00011 ** 
00012 ** XSB is distributed in the hope that it will be useful, but WITHOUT ANY
00013 ** WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014 ** FOR A PARTICULAR PURPOSE.  See the GNU Library General Public License for
00015 ** more details.
00016 ** 
00017 ** You should have received a copy of the GNU Library General Public License
00018 ** along with XSB; if not, write to the Free Software Foundation,
00019 ** Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020 **
00021 */
00022 
00023 /*
00024 ** This is the header file for the driver for connecting to a MySQL database.
00025 */
00026 
00027 #include <stdio.h>
00028 #include <stdlib.h>
00029 #include <string.h>
00030 
00031 #include "mysql.h"
00032 #include "mysql_com.h"
00033 
00034 #include "cinterf.h"
00035 #include "driver_manager_defs.h"
00036 
00037 #define MAX_HANDLES 25
00038 #define MAX_QUERIES 25
00039 
00040 /****** data structures for handles *****/
00041 
00042 struct driverMySQL_connectionInfo
00043 {
00044         MYSQL* mysql;
00045         char* handle;
00046 };
00047 
00048 struct driverMySQL_queryInfo
00049 {
00050         char* query;
00051         char* handle;
00052         MYSQL_RES* resultSet;
00053         struct driverMySQL_connectionInfo* connection;
00054 };
00055 
00056 /*struct driverMySQL_preparedresultset
00057 {
00058         MYSQL_STMT* statement;
00059         struct xsb_queryHandle* handle;
00060         int returnFields;
00061         struct xsb_data** metaInfo;
00062 };*/
00063 
00064 
00065 /****** function declarations *******/
00066 
00067 DllExport int call_conv driverMySQL_initialise();
00068 DllExport int call_conv driverMySQL_connect(struct xsb_connectionHandle* handle);
00069 DllExport int call_conv driverMySQL_disconnect(struct xsb_connectionHandle* handle);
00070 DllExport struct xsb_data** call_conv driverMySQL_query(struct xsb_queryHandle* handle);
00071 DllExport int call_conv driverMySQL_register();
00072 DllExport char* call_conv driverMySQL_errorMesg();
00073 
00074 //int driverMySQL_prepareStatement(char*, struct xsb_queryHandle*);
00075 //struct xsb_data** driverMySQL_execPrepareStmt(struct xsb_data**, struct xsb_queryHandle*);
00076 //struct xsb_data** driverMySQL_prepNextRow(struct driverMySQL_preparedresultset*);
00077 
00078 extern DllExport int call_conv registerXSBDriver(char* dr, int num);
00079 extern DllExport int call_conv registerXSBFunction(char* dr, int type, union functionPtrs* func);
00080 
00081 

Generated on Wed Jul 26 13:30:44 2006 for XSB by  doxygen 1.4.5