1
2#ifndef _S_FDSET_H
3#define _S_FDSET_H
4/*
5 * Copyright (c) 2000-2010 Apple Inc. All rights reserved.
6 *
7 * @APPLE_LICENSE_HEADER_START@
8 *
9 * This file contains Original Code and/or Modifications of Original Code
10 * as defined in and that are subject to the Apple Public Source License
11 * Version 2.0 (the 'License'). You may not use this file except in
12 * compliance with the License. Please obtain a copy of the License at
13 * http://www.opensource.apple.com/apsl/ and read it before using this
14 * file.
15 *
16 * The Original Code and all software distributed under the License are
17 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
18 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
19 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
21 * Please see the License for the specific language governing rights and
22 * limitations under the License.
23 *
24 * @APPLE_LICENSE_HEADER_END@
25 */
26
27/*
28 * FDSet.h
29 * - maintains a list of file descriptors to watch and corresponding
30 *   functions to call when the file descriptor is ready
31 */
32
33/*
34 * Modification History
35 *
36 * May 11, 2000		Dieter Siegmund (dieter@apple.com)
37 * - created
38 */
39
40/*
41 * Type: FDCallout_func_t
42 * Purpose:
43 *   Client registers a function to call when file descriptor is ready.
44 */
45
46typedef void (FDCalloutFunc)(void * arg1, void * arg2);
47typedef FDCalloutFunc * FDCalloutFuncRef;
48
49struct FDCallout;
50typedef struct FDCallout * FDCalloutRef;
51
52FDCalloutRef
53FDCalloutCreate(int fd, FDCalloutFuncRef func, void * arg1, void * arg2);
54
55void
56FDCalloutRelease(FDCalloutRef * callout_p);
57
58int
59FDCalloutGetFD(FDCalloutRef callout);
60
61#endif /* _S_FDSET_H */
62