CFStreamAbstract.h [plain text]
#if !defined(__COREFOUNDATION_CFSTREAMABSTRACT__)
#define __COREFOUNDATION_CFSTREAMABSTRACT__ 1
#include <CoreFoundation/CFStream.h>
CF_EXTERN_C_BEGIN
typedef struct {
CFIndex version;
void *(*create)(CFReadStreamRef stream, void *info);
void (*finalize)(CFReadStreamRef stream, void *info);
CFStringRef (*copyDescription)(CFReadStreamRef stream, void *info);
Boolean (*open)(CFReadStreamRef stream, CFErrorRef *error, Boolean *openComplete, void *info);
Boolean (*openCompleted)(CFReadStreamRef stream, CFErrorRef *error, void *info);
CFIndex (*read)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFErrorRef *error, Boolean *atEOF, void *info);
const UInt8 *(*getBuffer)(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFErrorRef *error, Boolean *atEOF, void *info);
Boolean (*canRead)(CFReadStreamRef stream, CFErrorRef *error, void *info);
void (*close)(CFReadStreamRef stream, void *info);
CFTypeRef (*copyProperty)(CFReadStreamRef stream, CFStringRef propertyName, void *info);
Boolean (*setProperty)(CFReadStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info);
void (*requestEvents)(CFReadStreamRef stream, CFOptionFlags streamEvents, void *info);
void (*schedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
void (*unschedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
} CFReadStreamCallBacks;
typedef struct {
CFIndex version;
void *(*create)(CFWriteStreamRef stream, void *info);
void (*finalize)(CFWriteStreamRef stream, void *info);
CFStringRef (*copyDescription)(CFWriteStreamRef stream, void *info);
Boolean (*open)(CFWriteStreamRef stream, CFErrorRef *error, Boolean *openComplete, void *info);
Boolean (*openCompleted)(CFWriteStreamRef stream, CFErrorRef *error, void *info);
CFIndex (*write)(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength, CFErrorRef *error, void *info);
Boolean (*canWrite)(CFWriteStreamRef stream, CFErrorRef *error, void *info);
void (*close)(CFWriteStreamRef stream, void *info);
CFTypeRef (*copyProperty)(CFWriteStreamRef stream, CFStringRef propertyName, void *info);
Boolean (*setProperty)(CFWriteStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info);
void (*requestEvents)(CFWriteStreamRef stream, CFOptionFlags streamEvents, void *info);
void (*schedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
void (*unschedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
} CFWriteStreamCallBacks;
CF_EXPORT
CFReadStreamRef CFReadStreamCreate(CFAllocatorRef alloc, const CFReadStreamCallBacks *callbacks, void *info);
CF_EXPORT
CFWriteStreamRef CFWriteStreamCreate(CFAllocatorRef alloc, const CFWriteStreamCallBacks *callbacks, void *info);
CF_EXPORT
void CFReadStreamSignalEvent(CFReadStreamRef stream, CFStreamEventType event, const void *error);
CF_EXPORT
void CFWriteStreamSignalEvent(CFWriteStreamRef stream, CFStreamEventType event, const void *error);
CF_EXPORT
void _CFReadStreamSignalEventDelayed(CFReadStreamRef stream, CFStreamEventType event, const void *error);
CF_EXPORT
void _CFWriteStreamSignalEventDelayed(CFWriteStreamRef stream, CFStreamEventType event, const void *error);
CF_EXPORT
void _CFReadStreamClearEvent(CFReadStreamRef stream, CFStreamEventType event);
CF_EXPORT
void *CFReadStreamGetInfoPointer(CFReadStreamRef stream);
CF_EXPORT
void *CFWriteStreamGetInfoPointer(CFWriteStreamRef stream);
CF_EXPORT
void *_CFReadStreamGetClient(CFReadStreamRef readStream);
CF_EXPORT
void *_CFWriteStreamGetClient(CFWriteStreamRef writeStream);
CF_EXPORT
CFArrayRef _CFReadStreamGetRunLoopsAndModes(CFReadStreamRef readStream);
CF_EXPORT
CFArrayRef _CFWriteStreamGetRunLoopsAndModes(CFWriteStreamRef writeStream);
typedef struct {
CFIndex version;
void *(*create)(CFReadStreamRef stream, void *info);
void (*finalize)(CFReadStreamRef stream, void *info);
CFStringRef (*copyDescription)(CFReadStreamRef stream, void *info);
Boolean (*open)(CFReadStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info);
Boolean (*openCompleted)(CFReadStreamRef stream, CFStreamError *error, void *info);
CFIndex (*read)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, Boolean *atEOF, void *info);
const UInt8 *(*getBuffer)(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFStreamError *error, Boolean *atEOF, void *info);
Boolean (*canRead)(CFReadStreamRef stream, void *info);
void (*close)(CFReadStreamRef stream, void *info);
CFTypeRef (*copyProperty)(CFReadStreamRef stream, CFStringRef propertyName, void *info);
Boolean (*setProperty)(CFReadStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info);
void (*requestEvents)(CFReadStreamRef stream, CFOptionFlags streamEvents, void *info);
void (*schedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
void (*unschedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
} CFReadStreamCallBacksV1;
typedef struct {
CFIndex version;
void *(*create)(CFWriteStreamRef stream, void *info);
void (*finalize)(CFWriteStreamRef stream, void *info);
CFStringRef (*copyDescription)(CFWriteStreamRef stream, void *info);
Boolean (*open)(CFWriteStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info);
Boolean (*openCompleted)(CFWriteStreamRef stream, CFStreamError *error, void *info);
CFIndex (*write)(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, void *info);
Boolean (*canWrite)(CFWriteStreamRef stream, void *info);
void (*close)(CFWriteStreamRef stream, void *info);
CFTypeRef (*copyProperty)(CFWriteStreamRef stream, CFStringRef propertyName, void *info);
Boolean (*setProperty)(CFWriteStreamRef stream, CFStringRef propertyName, CFTypeRef propertyValue, void *info);
void (*requestEvents)(CFWriteStreamRef stream, CFOptionFlags streamEvents, void *info);
void (*schedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
void (*unschedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
} CFWriteStreamCallBacksV1;
typedef struct {
CFIndex version;
Boolean (*open)(CFReadStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info);
Boolean (*openCompleted)(CFReadStreamRef stream, CFStreamError *error, void *info);
CFIndex (*read)(CFReadStreamRef stream, UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, Boolean *atEOF, void *info);
const UInt8 *(*getBuffer)(CFReadStreamRef stream, CFIndex maxBytesToRead, CFIndex *numBytesRead, CFStreamError *error, Boolean *atEOF, void *info);
Boolean (*canRead)(CFReadStreamRef stream, void *info);
void (*close)(CFReadStreamRef stream, void *info);
CFTypeRef (*copyProperty)(CFReadStreamRef stream, CFStringRef propertyName, void *info);
void (*schedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
void (*unschedule)(CFReadStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
} CFReadStreamCallBacksV0;
typedef struct {
CFIndex version;
Boolean (*open)(CFWriteStreamRef stream, CFStreamError *error, Boolean *openComplete, void *info);
Boolean (*openCompleted)(CFWriteStreamRef stream, CFStreamError *error, void *info);
CFIndex (*write)(CFWriteStreamRef stream, const UInt8 *buffer, CFIndex bufferLength, CFStreamError *error, void *info);
Boolean (*canWrite)(CFWriteStreamRef stream, void *info);
void (*close)(CFWriteStreamRef stream, void *info);
CFTypeRef (*copyProperty)(CFWriteStreamRef stream, CFStringRef propertyName, void *info);
void (*schedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
void (*unschedule)(CFWriteStreamRef stream, CFRunLoopRef runLoop, CFStringRef runLoopMode, void *info);
} CFWriteStreamCallBacksV0;
CF_EXTERN_C_END
#endif