mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
Changes for NSStream support, especially in mingw32 ... not yet complete.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@22693 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
74446f056e
commit
fa5f31547f
22 changed files with 1561 additions and 1863 deletions
|
@ -51,6 +51,17 @@
|
|||
*/
|
||||
|
||||
#include <Foundation/NSStream.h>
|
||||
#include <Foundation/NSRunLoop.h>
|
||||
|
||||
/**
|
||||
* Convenience methods used to add streams to the run loop.
|
||||
*/
|
||||
@interface NSRunLoop (NSStream)
|
||||
- (void) addStream: (NSStream*)aStream mode: (NSString*)mode;
|
||||
- (void) removeStream: (NSStream*)aStream mode: (NSString*)mode;
|
||||
@end
|
||||
|
||||
@class NSMutableData;
|
||||
|
||||
#define IVARS \
|
||||
{ \
|
||||
|
@ -61,7 +72,7 @@
|
|||
NSStreamStatus _currentStatus;/* current status */\
|
||||
NSMutableArray *_modes; /* currently scheduled modes. */\
|
||||
NSRunLoop *_runloop; /* currently scheduled loop. */\
|
||||
void *_fd; /* the file descriptor (if any) */\
|
||||
void *_loopID; /* file descriptor etc */\
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -72,28 +83,40 @@
|
|||
@interface GSStream : NSStream
|
||||
IVARS
|
||||
@end
|
||||
@interface GSStream(Private)
|
||||
|
||||
@interface NSStream(Private)
|
||||
|
||||
/**
|
||||
* Async notification
|
||||
*/
|
||||
- (void) _dispatch;
|
||||
|
||||
/**
|
||||
* Return YES if the stream is opened, NO otherwise.
|
||||
*/
|
||||
- (BOOL) _isOpened;
|
||||
|
||||
/**
|
||||
* Return previously set reference for IO in run loop.
|
||||
*/
|
||||
- (void*) _loopID;
|
||||
|
||||
/**
|
||||
* send an event to delegate
|
||||
*/
|
||||
- (void) _sendEvent: (NSStreamEvent)event;
|
||||
|
||||
/**
|
||||
* setter for IO event reference (file descriptor, file handle etc )
|
||||
*/
|
||||
- (void) _setLoopID: (void *)ref;
|
||||
|
||||
/**
|
||||
* set the status to newStatus. an exception is error cannot
|
||||
* be overwriten by closed
|
||||
*/
|
||||
- (void) _setStatus: (NSStreamStatus)newStatus;
|
||||
|
||||
/**
|
||||
* setter for fd
|
||||
*/
|
||||
- (void) _setFd: (void *)fd;
|
||||
|
||||
/**
|
||||
* record an error based on errno
|
||||
*/
|
||||
|
@ -103,35 +126,14 @@ IVARS
|
|||
@interface GSInputStream : NSInputStream
|
||||
IVARS
|
||||
@end
|
||||
@interface GSInputStream (Private)
|
||||
- (BOOL) _isOpened;
|
||||
- (void) _sendEvent: (NSStreamEvent)event;
|
||||
- (void) _setStatus: (NSStreamStatus)newStatus;
|
||||
- (void) _setFd: (void*)fd;
|
||||
- (void) _recordError;
|
||||
@end
|
||||
|
||||
@interface GSOutputStream : NSOutputStream
|
||||
IVARS
|
||||
@end
|
||||
@interface GSOutputStream (Private)
|
||||
- (BOOL) _isOpened;
|
||||
- (void) _sendEvent: (NSStreamEvent)event;
|
||||
- (void) _setStatus: (NSStreamStatus)newStatus;
|
||||
- (void) _setFd: (void*)fd;
|
||||
- (void) _recordError;
|
||||
@end
|
||||
|
||||
@interface GSAbstractServerStream : GSServerStream
|
||||
IVARS
|
||||
@end
|
||||
@interface GSAbstractServerStream (private)
|
||||
- (BOOL) _isOpened;
|
||||
- (void) _sendEvent: (NSStreamEvent)event;
|
||||
- (void) _setStatus: (NSStreamStatus)newStatus;
|
||||
- (void) _setFd: (void*)fd;
|
||||
- (void) _recordError;
|
||||
@end
|
||||
|
||||
/**
|
||||
* The concrete subclass of NSInputStream that reads from the memory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue