GNUstep CoreBase Library 0.2
CFStreamPriv.h
1/* CFStream.h
2
3 Copyright (C) 2014 Free Software Foundation, Inc.
4
5 Written by: Lubos Dolezel
6 Date: February, 2014
7
8 This file is part of GNUstep CoreBase Library.
9
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
14
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; see the file COPYING.LIB.
22 If not, see <http://www.gnu.org/licenses/> or write to the
23 Free Software Foundation, 51 Franklin Street, Fifth Floor,
24 Boston, MA 02110-1301, USA.
25*/
26
27#ifndef __COREFOUNDATION_CFSTREAMPRIV_H__
28#define __COREFOUNDATION_CFSTREAMPRIV_H__ 1
29#include <CoreFoundation/CFRuntime.h>
30#include <CoreFoundation/CFStream.h>
31
32/*
33 * This header file is intended to be used by CFStream implementations, namely
34 * by CFStream itself and CFNetwork.
35 *
36 */
37
39{
40 void (*close)(CFWriteStreamRef);
41 void (*finalize)(CFWriteStreamRef);
42 Boolean (*open)(CFWriteStreamRef);
43 CFIndex (*write)(CFWriteStreamRef, const UInt8 *, CFIndex);
44 CFTypeRef (*copyProperty)(CFWriteStreamRef, CFStringRef);
45 Boolean (*setProperty)(CFWriteStreamRef, CFStringRef, CFTypeRef);
46 Boolean (*acceptBytes)(CFWriteStreamRef);
47};
48
50{
51 CFRuntimeBase parent;
52 struct CFWriteStreamImpl impl;
53
54 Boolean open, closed, failed;
55 CFErrorRef error;
56
57 /* callbacks when used with a runloop */
58 CFOptionFlags streamEvents;
59 CFWriteStreamClientCallBack clientCB;
60};
61
63{
64 void (*close)(CFReadStreamRef);
65 void (*finalize)(CFReadStreamRef);
66 Boolean (*open)(CFReadStreamRef);
67 CFIndex (*read)(CFReadStreamRef, UInt8 *, CFIndex);
68 CFTypeRef (*copyProperty)(CFReadStreamRef, CFStringRef);
69 Boolean (*setProperty)(CFReadStreamRef, CFStringRef, CFTypeRef);
70 const UInt8* (*getBuffer)(CFReadStreamRef, CFIndex, CFIndex*);
71 Boolean (*hasBytes)(CFReadStreamRef);
72};
73
75{
76 CFRuntimeBase parent;
77 struct CFReadStreamImpl impl;
78
79 Boolean open, closed, failed;
80 CFErrorRef error;
81
82 /* callbacks when used with a runloop */
83 CFOptionFlags streamEvents;
84 CFReadStreamClientCallBack clientCB;
85};
86
87#endif
unsigned long CFOptionFlags
Definition CFBase.h:163
signed long CFIndex
Definition CFBase.h:165
Definition CFStreamPriv.h:63
Definition CFStreamPriv.h:39
Definition CFStreamPriv.h:75
Definition CFStreamPriv.h:50