2002-06-30 09:19:30 +00:00
|
|
|
/* Interface for GSFileHandle for GNUStep
|
|
|
|
Copyright (C) 1997-2002 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
|
|
|
Date: 1997
|
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2002-06-30 09:19:30 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2002-06-30 09:19:30 +00:00
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2002-06-30 09:19:30 +00:00
|
|
|
License along with this library; if not, write to the Free
|
2006-09-13 10:20:49 +00:00
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
2002-06-30 09:19:30 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __GSFileHandle_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __GSFileHandle_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
|
2013-08-22 15:44:54 +00:00
|
|
|
#import "Foundation/NSFileHandle.h"
|
|
|
|
#import "Foundation/NSArray.h"
|
|
|
|
#import "Foundation/NSDictionary.h"
|
|
|
|
#import "Foundation/NSRunLoop.h"
|
2002-06-30 09:19:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
#if USE_ZLIB
|
|
|
|
#include <zlib.h>
|
|
|
|
#endif
|
|
|
|
|
2011-07-24 13:09:22 +00:00
|
|
|
struct sockaddr_in;
|
2011-06-20 12:46:42 +00:00
|
|
|
|
2010-03-05 10:32:15 +00:00
|
|
|
/**
|
|
|
|
* DO NOT USE ... this header is here only for the SSL file handle support
|
|
|
|
* and is not intended to be used by anyone else ... it is subject to
|
|
|
|
* change or removal without warning.
|
|
|
|
*/
|
2009-01-12 18:36:37 +00:00
|
|
|
@interface GSFileHandle : NSFileHandle <RunLoopEvents>
|
2002-06-30 09:19:30 +00:00
|
|
|
{
|
2010-02-14 10:48:10 +00:00
|
|
|
#if GS_EXPOSE(GSFileHandle)
|
2002-06-30 09:19:30 +00:00
|
|
|
int descriptor;
|
|
|
|
BOOL closeOnDealloc;
|
|
|
|
BOOL isStandardFile;
|
|
|
|
BOOL isNullDevice;
|
2002-06-30 09:43:21 +00:00
|
|
|
BOOL isSocket;
|
2002-06-30 09:19:30 +00:00
|
|
|
BOOL isNonBlocking;
|
|
|
|
BOOL wasNonBlocking;
|
|
|
|
BOOL acceptOK;
|
|
|
|
BOOL connectOK;
|
|
|
|
BOOL readOK;
|
|
|
|
BOOL writeOK;
|
|
|
|
NSMutableDictionary *readInfo;
|
|
|
|
int readMax;
|
|
|
|
NSMutableArray *writeInfo;
|
|
|
|
int writePos;
|
|
|
|
NSString *address;
|
|
|
|
NSString *service;
|
|
|
|
NSString *protocol;
|
|
|
|
#if USE_ZLIB
|
|
|
|
gzFile gzDescriptor;
|
|
|
|
#endif
|
2016-03-09 13:16:16 +00:00
|
|
|
#if defined(_WIN32)
|
2005-02-23 16:05:09 +00:00
|
|
|
WSAEVENT event;
|
2010-02-14 10:48:10 +00:00
|
|
|
#endif
|
2010-03-02 09:51:12 +00:00
|
|
|
#endif
|
2002-06-30 09:19:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id) initAsClientAtAddress: (NSString*)address
|
|
|
|
service: (NSString*)service
|
|
|
|
protocol: (NSString*)protocol;
|
|
|
|
- (id) initAsClientInBackgroundAtAddress: (NSString*)address
|
|
|
|
service: (NSString*)service
|
|
|
|
protocol: (NSString*)protocol
|
|
|
|
forModes: (NSArray*)modes;
|
|
|
|
- (id) initAsServerAtAddress: (NSString*)address
|
|
|
|
service: (NSString*)service
|
|
|
|
protocol: (NSString*)protocol;
|
|
|
|
- (id) initForReadingAtPath: (NSString*)path;
|
|
|
|
- (id) initForWritingAtPath: (NSString*)path;
|
|
|
|
- (id) initForUpdatingAtPath: (NSString*)path;
|
|
|
|
- (id) initWithStandardError;
|
|
|
|
- (id) initWithStandardInput;
|
|
|
|
- (id) initWithStandardOutput;
|
|
|
|
- (id) initWithNullDevice;
|
|
|
|
|
|
|
|
- (void) checkAccept;
|
|
|
|
- (void) checkConnect;
|
|
|
|
- (void) checkRead;
|
|
|
|
- (void) checkWrite;
|
|
|
|
|
|
|
|
- (void) ignoreReadDescriptor;
|
|
|
|
- (void) ignoreWriteDescriptor;
|
|
|
|
- (void) setNonBlocking: (BOOL)flag;
|
|
|
|
- (void) postReadNotification;
|
|
|
|
- (void) postWriteNotification;
|
2009-02-23 20:42:32 +00:00
|
|
|
- (NSInteger) read: (void*)buf length: (NSUInteger)len;
|
2002-06-30 09:19:30 +00:00
|
|
|
- (void) receivedEvent: (void*)data
|
|
|
|
type: (RunLoopEventType)type
|
|
|
|
extra: (void*)extra
|
|
|
|
forMode: (NSString*)mode;
|
2016-03-01 10:41:33 +00:00
|
|
|
|
2011-10-03 16:03:19 +00:00
|
|
|
- (void) setAddr: (struct sockaddr *)sin;
|
2016-03-01 10:41:33 +00:00
|
|
|
|
2002-06-30 09:19:30 +00:00
|
|
|
- (BOOL) useCompression;
|
|
|
|
- (void) watchReadDescriptorForModes: (NSArray*)modes;
|
|
|
|
- (void) watchWriteDescriptor;
|
2009-02-23 20:42:32 +00:00
|
|
|
- (NSInteger) write: (const void*)buf length: (NSUInteger)len;
|
2002-06-30 09:19:30 +00:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
#endif /* __GSFileHandle_h_GNUSTEP_BASE_INCLUDE */
|