home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEPLOY / SYBASEAD.Z / SybaseContext.h < prev    next >
Text File  |  1996-09-09  |  3KB  |  85 lines

  1. //  SybaseContext.h
  2. //  Copyright 1994, NeXT Software, Inc.
  3.  
  4. #import    <EOAccess/EOAccess.h>
  5.  
  6. @class SybaseAdaptor;
  7. @class SybaseChannel;
  8.  
  9. @interface SybaseContext:EOAdaptorContext
  10. {
  11.     void *_connection; // not retained to avoid cycle
  12.     unsigned _transactionCount; // will be > 1 if transactions are nested
  13.     unsigned _fetchesInProgress;
  14.     unsigned _openChannels;
  15.     int _maxTextSizeDefault;
  16.     NSException *_currentException;
  17.     struct
  18.     {
  19.         unsigned connected:1;
  20.         unsigned debugEnabled:1;
  21.     unsigned _RESERVED:30;
  22.     } _flags;
  23.     struct {
  24.         unsigned willReportClientMessage:1;
  25.         unsigned willReportServerMessage:1;
  26.         unsigned _RESERVED:30;
  27.     } _sybaseDelegateRespondsTo;
  28. }
  29.  
  30. - initWithSybaseAdaptor:(SybaseAdaptor *)adaptor;
  31.  
  32. - (void)sybaseChannelWillOpen:(SybaseChannel *)channel;
  33. - (void)sybaseChannelDidClose:(SybaseChannel *)channel;
  34. - (BOOL)sybaseChannelWillBeginFetching:(SybaseChannel *)channel;
  35. - (void)sybaseChannelDidEndFetching:(SybaseChannel *)channel;
  36.     // These methods are called by the SybaseChannel to notify
  37.     // the SybaseContext of changes.
  38.  
  39. - (SybaseChannel *)currentChannel;
  40.  
  41. - (BOOL)isConnected;
  42. - (void)connect;
  43. - (void)disconnect;
  44.     // Methods to query the current status of the SybaseContext
  45.  
  46. + (void *)contextPointer;
  47.     // Returns the sybase global context pointer (CS_CONTEXT *)
  48.     // If you are making calls directly to the sybase client library
  49.     // you may need this.
  50.  
  51. - (void *)connection;
  52.     // Returns the CT library connection for this context (CS_CONNECTION *)
  53.  
  54. - (void)raiseCurrentException;
  55.     // If the ivar "_currentException" is not null, raise it.
  56. - (void)setCurrentException:(NSException *)exception;
  57.     // Set the "_currentException" ivar.
  58.  
  59. + (void)setTimeOutInterval:(int)seconds;
  60. + (int)timeOutInterval;
  61.     // Sets timeOut interval value which will be used during creation of any
  62.     // new channels
  63.  
  64. + (void)setLoginTimeOutInterval:(int)seconds;
  65. + (int)loginTimeOutInterval;
  66.     // Sets login timeOut interval value which will be used during creation
  67.     // of any new channels
  68.  
  69. - (int)maxTextSizeDefault;
  70.     // Returns the maximum number of bytes to be returned from a sybase image
  71.     // to text field. The default is set to INT_MAX as defined for the host
  72.     // machine. This number can be overwritten on a channel by channel basis
  73.     // by sending the appropriate SQL to the channel using the
  74.     // evaluateExpression: method.
  75. - (void)setMaxTextSizeDefault:(int)textSize;
  76.     // Sets the default testsize. Any channels created after this method has
  77.     // been invoked will use the current textsize rather than the default.
  78. @end
  79.  
  80.  
  81. @interface NSObject(SybaseContextDelegation)
  82. - (BOOL)sybaseContext:(SybaseContext *)context willReportClientMessage:(NSDictionary *)clientMessage;
  83. - (BOOL)sybaseContext:(SybaseContext *)context willReportServerMessage:(NSDictionary *)serverMessage;
  84. @end
  85.