]> err.no Git - sope/blob - sope-gdl1/MySQL/MySQL4Channel.h
use %p for pointer formats
[sope] / sope-gdl1 / MySQL / MySQL4Channel.h
1 /* 
2    MySQL4Channel.h
3
4    Copyright (C) 2003-2005 Helge Hess
5
6    Author: Helge Hess (helge.hess@opengroupware.org)
7
8    This file is part of the MySQL4 Adaptor Library
9
10    This library is free software; you can redistribute it and/or
11    modify it under the terms of the GNU Library General Public
12    License as published by the Free Software Foundation; either
13    version 2 of the License, or (at your option) any later version.
14
15    This library is distributed in the hope that it will be useful,
16    but WITHOUT ANY WARRANTY; without even the implied warranty of
17    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18    Library General Public License for more details.
19
20    You should have received a copy of the GNU Library General Public
21    License along with this library; see the file COPYING.LIB.
22    If not, write to the Free Software Foundation,
23    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 */
25
26 #ifndef ___MySQL4_Channel_H___
27 #define ___MySQL4_Channel_H___
28
29 #import <GDLAccess/EOAdaptorChannel.h>
30
31 @class NSArray, NSString, NSMutableDictionary;
32
33 @interface MySQL4Channel : EOAdaptorChannel
34 {
35   // connection is valid after an openChannel call
36   void *_connection;
37   void *results;
38   void *fields;
39   int  fieldCount;
40
41 #if 0
42   int      tupleCount;
43   BOOL     containsBinaryData;
44   NSString *cmdStatus;
45   NSString *cmdTuples;
46   NSString *oidStatus;
47   int      currentTuple;
48 #endif
49
50   // turns on/off channel debugging
51   BOOL isDebuggingEnabled;
52
53   NSMutableDictionary *_attributesForTableName;
54   NSMutableDictionary *_primaryKeysNamesForTableName;
55 }
56
57 - (void)setDebugEnabled:(BOOL)_flag;
58 - (BOOL)isDebugEnabled;
59
60 - (BOOL)isOpen;
61 - (BOOL)openChannel;
62 - (void)closeChannel;
63
64 - (NSMutableDictionary *)primaryFetchAttributes:(NSArray *)_attributes
65   withZone:(NSZone *)_zone;
66
67 - (BOOL)evaluateExpression:(NSString *)_expression;
68
69 // cancelFetch is always called to terminate a fetch
70 // (even by primaryFetchAttributes)
71 // it frees all fetch-local variables
72 - (void)cancelFetch;
73
74 // uses dataFormat type information to create EOAttribute objects
75 - (NSArray *)describeResults;
76
77 @end
78
79 @interface NSObject(Sybase10ChannelDelegate)
80
81 - (NSArray*)sqlite3Channel:(MySQL4Channel *)channel
82   willFetchAttributes:(NSArray *)attributes;
83
84 - (BOOL)sqlite3Channel:(MySQL4Channel *)channel
85   willReturnRow:(NSDictionary *)row;
86
87 @end
88
89 #endif /* ___MySQL4_Channel_H___ */