globus_common  15.26
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_callback.h
Go to the documentation of this file.
1 /*
2  * Copyright 1999-2006 University of Chicago
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef GLOBUS_CALLBACK_H
18 #define GLOBUS_CALLBACK_H
19 
31 #include "globus_common_include.h"
32 #include "globus_module.h"
33 #include "globus_time.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 extern
40 globus_module_descriptor_t globus_i_callback_module;
41 
54 #define GLOBUS_CALLBACK_MODULE (&globus_i_callback_module)
55 
65 #define GLOBUS_POLL_MODULE GLOBUS_CALLBACK_MODULE
66 
78 typedef enum
79 {
93 
103 
113 
121 typedef struct globus_l_callback_space_attr_s * globus_callback_space_attr_t;
122 
133 /* @{ */
134 
146 #define globus_callback_poll(a) \
147  globus_callback_space_poll((a), GLOBUS_CALLBACK_GLOBAL_SPACE)
148 
160 #define globus_poll_blocking() \
161  globus_callback_poll(&globus_i_abstime_infinity)
162 
174 #define globus_poll_nonblocking() \
175  globus_callback_poll(&globus_i_abstime_zero)
176 
188 #define globus_poll() \
189  globus_poll_nonblocking()
190 
201 #define globus_signal_poll() \
202  globus_callback_signal_poll()
203 
215 #define globus_callback_register_oneshot( \
216  callback_handle, \
217  delay_time, \
218  callback_func, \
219  callback_user_arg) \
220  globus_callback_space_register_oneshot( \
221  (callback_handle), \
222  (delay_time), \
223  (callback_func), \
224  (callback_user_arg), \
225  GLOBUS_CALLBACK_GLOBAL_SPACE)
226 
238 #define globus_callback_register_periodic( \
239  callback_handle, \
240  delay_time, \
241  period, \
242  callback_func, \
243  callback_user_arg) \
244  globus_callback_space_register_periodic( \
245  (callback_handle), \
246  (delay_time), \
247  (period), \
248  (callback_func), \
249  (callback_user_arg), \
250  GLOBUS_CALLBACK_GLOBAL_SPACE)
251 
264 #define globus_callback_register_signal_handler( \
265  signum, \
266  persist, \
267  callback_func, \
268  callback_user_arg) \
269  globus_callback_space_register_signal_handler( \
270  (signum), \
271  (persist), \
272  (callback_func), \
273  (callback_user_arg), \
274  GLOBUS_CALLBACK_GLOBAL_SPACE)
275 
276 /* @} */
277 
281 /* @{ */
282 
312 typedef
313 void
315  void * user_arg);
316 
317 /* @} */
318 
322 /* @{ */
323 
359  globus_callback_handle_t * callback_handle,
360  const globus_reltime_t * delay_time,
361  globus_callback_func_t callback_func,
362  void * callback_user_arg,
363  globus_callback_space_t space);
364 
365 /* @} */
366 
370 /* @{ */
371 
411  globus_callback_handle_t * callback_handle,
412  const globus_reltime_t * delay_time,
413  const globus_reltime_t * period,
414  globus_callback_func_t callback_func,
415  void * callback_user_arg,
416  globus_callback_space_t space);
417 
464  globus_callback_handle_t callback_handle,
465  globus_callback_func_t unregister_callback,
466  void * unreg_arg,
467  globus_bool_t * active);
468 
498  globus_callback_handle_t callback_handle,
499  const globus_reltime_t * new_delay);
500 
535  globus_callback_handle_t callback_handle,
536  const globus_reltime_t * new_period);
537 /* @} */
538 
542 /* @{ */
543 
585 void
587  const globus_abstime_t * timestop,
588  globus_callback_space_t space);
589 
608 void
610 /* @} */
611 
615 /* @{ */
616 
637  globus_reltime_t * time_left);
638 
654 
674 
675 /* @} */
676 
693 #define GLOBUS_CALLBACK_GLOBAL_SPACE -2
694 
725 typedef enum
726 {
738 
766  globus_callback_space_t * space,
767  globus_callback_space_attr_t attr);
768 
788  globus_callback_space_t space);
789 
815  globus_callback_space_t space);
816 
836  globus_callback_space_attr_t * attr);
837 
854  globus_callback_space_attr_t attr);
855 
874  globus_callback_space_attr_t attr,
876 
898  globus_callback_space_attr_t attr,
900 
915  globus_callback_space_t * space);
916 
928 int
930  globus_callback_space_t space);
931 
945  globus_callback_space_t space);
946 
947 
962 #ifdef SIGINT
963 #define GLOBUS_SIGNAL_INTERRUPT SIGINT
964 #else
965 #define GLOBUS_SIGNAL_INTERRUPT 0
966 #endif
967 
1005  int signum,
1006  globus_bool_t persist,
1007  globus_callback_func_t callback_func,
1008  void * callback_user_arg,
1009  globus_callback_space_t space);
1010 
1037  int signum,
1038  globus_callback_func_t unregister_callback,
1039  void * unreg_arg);
1040 
1068 void
1070  void (*wakeup)(void *),
1071  void * user_arg);
1072 
1073 #ifdef __cplusplus
1074 }
1075 #endif
1076 
1077 #endif /* GLOBUS_CALLBACK_H */