XDispatch 0.7.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
source.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008-2009 Apple Inc. All rights reserved.
00003  *
00004  * @APPLE_APACHE_LICENSE_HEADER_START@
00005  * 
00006  * Licensed under the Apache License, Version 2.0 (the "License");
00007  * you may not use this file except in compliance with the License.
00008  * You may obtain a copy of the License at
00009  * 
00010  *     http://www.apache.org/licenses/LICENSE-2.0
00011  * 
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  * 
00018  * @APPLE_APACHE_LICENSE_HEADER_END@
00019  */
00020 
00021 #ifndef __DISPATCH_SOURCE__
00022 #define __DISPATCH_SOURCE__
00023 
00029 #ifndef __DISPATCH_INDIRECT__
00030 #error "Please #include <dispatch/dispatch.h> instead of this file directly."
00031 #include "base.h"  // for HeaderDoc
00032 #endif
00033 
00047 DISPATCH_DECL(dispatch_source);
00048 
00057 typedef const struct dispatch_source_type_s *dispatch_source_type_t;
00058 
00059 __DISPATCH_BEGIN_DECLS
00060 
00067 #define DISPATCH_SOURCE_TYPE_DATA_ADD (&_dispatch_source_type_data_add)
00068 
00069 extern DISPATCH_EXPORT
00070 const struct dispatch_source_type_s _dispatch_source_type_data_add;
00071 
00079 #define DISPATCH_SOURCE_TYPE_DATA_OR (&_dispatch_source_type_data_or)
00080 
00081 extern DISPATCH_EXPORT
00082 const struct dispatch_source_type_s _dispatch_source_type_data_or;
00083 
00090 #define DISPATCH_SOURCE_TYPE_MACH_SEND (&_dispatch_source_type_mach_send)
00091 
00092 extern DISPATCH_EXPORT
00093 const struct dispatch_source_type_s _dispatch_source_type_mach_send;
00094 
00100 #define DISPATCH_SOURCE_TYPE_MACH_RECV (&_dispatch_source_type_mach_recv)
00101 
00102 extern DISPATCH_EXPORT
00103 const struct dispatch_source_type_s _dispatch_source_type_mach_recv;
00104 
00111 #define DISPATCH_SOURCE_TYPE_PROC (&_dispatch_source_type_proc)
00112 
00113 extern DISPATCH_EXPORT
00114 const struct dispatch_source_type_s _dispatch_source_type_proc;
00115 
00122 #define DISPATCH_SOURCE_TYPE_READ (&_dispatch_source_type_read)
00123 
00124 extern DISPATCH_EXPORT
00125 const struct dispatch_source_type_s _dispatch_source_type_read;
00126 
00132 #define DISPATCH_SOURCE_TYPE_SIGNAL (&_dispatch_source_type_signal)
00133 
00134 extern DISPATCH_EXPORT
00135 const struct dispatch_source_type_s _dispatch_source_type_signal;
00136 
00143 #define DISPATCH_SOURCE_TYPE_TIMER (&_dispatch_source_type_timer)
00144 
00145 extern DISPATCH_EXPORT
00146 const struct dispatch_source_type_s _dispatch_source_type_timer;
00147 
00154 #define DISPATCH_SOURCE_TYPE_VNODE (&_dispatch_source_type_vnode)
00155 
00156 extern DISPATCH_EXPORT
00157 const struct dispatch_source_type_s _dispatch_source_type_vnode;
00158 
00165 #define DISPATCH_SOURCE_TYPE_WRITE (&_dispatch_source_type_write)
00166 
00167 extern DISPATCH_EXPORT 
00168 const struct dispatch_source_type_s _dispatch_source_type_write;
00169 
00170 __DISPATCH_END_DECLS
00171 
00175 enum {
00176     DISPATCH_MACH_SEND_DEAD = 0x1, 
00177 };
00178 
00182 enum {
00183     DISPATCH_PROC_EXIT = 0x80000000, 
00184     DISPATCH_PROC_FORK = 0x40000000, 
00185     DISPATCH_PROC_EXEC = 0x20000000, 
00186     DISPATCH_PROC_SIGNAL = 0x08000000, 
00187 };
00188 
00192 enum {
00193     DISPATCH_VNODE_DELETE = 0x1, 
00194     DISPATCH_VNODE_WRITE = 0x2, 
00195     DISPATCH_VNODE_EXTEND = 0x4, 
00196     DISPATCH_VNODE_ATTRIB = 0x8, 
00197     DISPATCH_VNODE_LINK     = 0x10, 
00198     DISPATCH_VNODE_RENAME = 0x20, 
00199     DISPATCH_VNODE_REVOKE = 0x40, 
00200 };
00201 
00202 __DISPATCH_BEGIN_DECLS
00203 
00230 DISPATCH_EXPORT  
00231 dispatch_source_t
00232 dispatch_source_create(dispatch_source_type_t type,
00233        uintptr_t handle,
00234        unsigned long mask,
00235        dispatch_queue_t queue);
00236 
00247 #ifdef __BLOCKS__
00248 
00249 DISPATCH_EXPORT  
00250 void
00251 dispatch_source_set_event_handler(dispatch_source_t source,
00252        dispatch_block_t handler);
00253 #endif /* __BLOCKS__ */
00254 
00269 DISPATCH_EXPORT  
00270 void
00271 dispatch_source_set_event_handler_f(dispatch_source_t source,
00272        dispatch_function_t handler);
00273 
00297 #ifdef __BLOCKS__
00298 
00299 DISPATCH_EXPORT  
00300 void
00301 dispatch_source_set_cancel_handler(dispatch_source_t source,
00302        dispatch_block_t cancel_handler);
00303 #endif /* __BLOCKS__ */
00304 
00320 DISPATCH_EXPORT  
00321 void
00322 dispatch_source_set_cancel_handler_f(dispatch_source_t source,
00323        dispatch_function_t cancel_handler);
00324 
00344 DISPATCH_EXPORT  
00345 void
00346 dispatch_source_cancel(dispatch_source_t source);
00347 
00359 DISPATCH_EXPORT  
00360 long
00361 dispatch_source_testcancel(dispatch_source_t source);
00362 
00385 DISPATCH_EXPORT    
00386 uintptr_t
00387 dispatch_source_get_handle(dispatch_source_t source);
00388 
00411 DISPATCH_EXPORT    
00412 unsigned long
00413 dispatch_source_get_mask(dispatch_source_t source);
00414 
00443 DISPATCH_EXPORT    
00444 unsigned long
00445 dispatch_source_get_data(dispatch_source_t source);
00446 
00461 DISPATCH_EXPORT  
00462 void
00463 dispatch_source_merge_data(dispatch_source_t source, unsigned long value);
00464 
00493 DISPATCH_EXPORT  
00494 void
00495 dispatch_source_set_timer(dispatch_source_t source,
00496        dispatch_time_t start,
00497        uint64_t interval,
00498        uint64_t leeway);
00499 
00500 __DISPATCH_END_DECLS
00501 
00504 #endif

Generated on Tue Jun 12 2012 14:11:47 for XDispatch by Doxygen 1.8.0
© 2010-2012 MLBA (about | privacy) All Rights reserved.