home *** CD-ROM | disk | FTP | other *** search
- // SybaseContext.h
- // Copyright 1994, NeXT Software, Inc.
-
- #import <EOAccess/EOAccess.h>
-
- @class SybaseAdaptor;
- @class SybaseChannel;
-
- @interface SybaseContext:EOAdaptorContext
- {
- void *_connection; // not retained to avoid cycle
- unsigned _transactionCount; // will be > 1 if transactions are nested
- unsigned _fetchesInProgress;
- unsigned _openChannels;
- int _maxTextSizeDefault;
- NSException *_currentException;
- struct
- {
- unsigned connected:1;
- unsigned debugEnabled:1;
- unsigned _RESERVED:30;
- } _flags;
- struct {
- unsigned willReportClientMessage:1;
- unsigned willReportServerMessage:1;
- unsigned _RESERVED:30;
- } _sybaseDelegateRespondsTo;
- }
-
- - initWithSybaseAdaptor:(SybaseAdaptor *)adaptor;
-
- - (void)sybaseChannelWillOpen:(SybaseChannel *)channel;
- - (void)sybaseChannelDidClose:(SybaseChannel *)channel;
- - (BOOL)sybaseChannelWillBeginFetching:(SybaseChannel *)channel;
- - (void)sybaseChannelDidEndFetching:(SybaseChannel *)channel;
- // These methods are called by the SybaseChannel to notify
- // the SybaseContext of changes.
-
- - (SybaseChannel *)currentChannel;
-
- - (BOOL)isConnected;
- - (void)connect;
- - (void)disconnect;
- // Methods to query the current status of the SybaseContext
-
- + (void *)contextPointer;
- // Returns the sybase global context pointer (CS_CONTEXT *)
- // If you are making calls directly to the sybase client library
- // you may need this.
-
- - (void *)connection;
- // Returns the CT library connection for this context (CS_CONNECTION *)
-
- - (void)raiseCurrentException;
- // If the ivar "_currentException" is not null, raise it.
- - (void)setCurrentException:(NSException *)exception;
- // Set the "_currentException" ivar.
-
- + (void)setTimeOutInterval:(int)seconds;
- + (int)timeOutInterval;
- // Sets timeOut interval value which will be used during creation of any
- // new channels
-
- + (void)setLoginTimeOutInterval:(int)seconds;
- + (int)loginTimeOutInterval;
- // Sets login timeOut interval value which will be used during creation
- // of any new channels
-
- - (int)maxTextSizeDefault;
- // Returns the maximum number of bytes to be returned from a sybase image
- // to text field. The default is set to INT_MAX as defined for the host
- // machine. This number can be overwritten on a channel by channel basis
- // by sending the appropriate SQL to the channel using the
- // evaluateExpression: method.
- - (void)setMaxTextSizeDefault:(int)textSize;
- // Sets the default testsize. Any channels created after this method has
- // been invoked will use the current textsize rather than the default.
- @end
-
-
- @interface NSObject(SybaseContextDelegation)
- - (BOOL)sybaseContext:(SybaseContext *)context willReportClientMessage:(NSDictionary *)clientMessage;
- - (BOOL)sybaseContext:(SybaseContext *)context willReportServerMessage:(NSDictionary *)serverMessage;
- @end
-