17 #ifndef GLOBUS_I_CALLBACK_H
18 #define GLOBUS_I_CALLBACK_H
26 #define GLOBUS_CALLBACK_NONTHREADED_MODULE (&globus_i_callback_module_nonthreaded)
27 #define GLOBUS_CALLBACK_THREADED_MODULE (&globus_i_callback_module_threaded)
30 #define GLOBUS_L_CALLBACK_CONSTRUCT_INVALID_CALLBACK_HANDLE(func) \
32 globus_error_construct_error( \
33 GLOBUS_CALLBACK_MODULE, \
35 GLOBUS_CALLBACK_ERROR_INVALID_CALLBACK_HANDLE, \
39 "Invalid callback handle"))
41 #define GLOBUS_L_CALLBACK_CONSTRUCT_INVALID_SPACE(func) \
43 globus_error_construct_error( \
44 GLOBUS_CALLBACK_MODULE, \
46 GLOBUS_CALLBACK_ERROR_INVALID_SPACE, \
50 "Invalid space handle"))
52 #define GLOBUS_L_CALLBACK_CONSTRUCT_MEMORY_ALLOC(func, alloc) \
54 globus_error_construct_error( \
55 GLOBUS_CALLBACK_MODULE, \
57 GLOBUS_CALLBACK_ERROR_MEMORY_ALLOC, \
61 "Could not allocate memory for %s", \
64 #define GLOBUS_L_CALLBACK_CONSTRUCT_INVALID_ARGUMENT(func, argument) \
66 globus_error_construct_error( \
67 GLOBUS_CALLBACK_MODULE, \
69 GLOBUS_CALLBACK_ERROR_INVALID_ARGUMENT, \
73 "Invalid argument: %s", \
76 #define GLOBUS_L_CALLBACK_CONSTRUCT_ALREADY_CANCELED(func) \
78 globus_error_construct_error( \
79 GLOBUS_CALLBACK_MODULE, \
81 GLOBUS_CALLBACK_ERROR_ALREADY_CANCELED, \
85 "Callback previoulsy unregistered"))
87 #define GLOBUS_L_CALLBACK_CONSTRUCT_NO_ACTIVE_CALLBACK(func) \
89 globus_error_construct_error( \
90 GLOBUS_CALLBACK_MODULE, \
92 GLOBUS_CALLBACK_ERROR_NO_ACTIVE_CALLBACK, \
96 "No cuurently running callback"))
98 #define GlobusICallbackReadyInit(queue) \
100 (queue)->head = GLOBUS_NULL; \
101 (queue)->tail = &(queue)->head; \
104 #define GlobusICallbackReadyEnqueue(queue, callback_info) \
106 (callback_info)->next = GLOBUS_NULL; \
107 *(queue)->tail = callback_info; \
108 (queue)->tail = &callback_info->next; \
111 #define GlobusICallbackReadyEnqueueFirst(queue, callback_info) \
113 (callback_info)->next = (queue)->head; \
116 (queue)->tail = &callback_info->next; \
118 (queue)->head = (callback_info); \
121 #define GlobusICallbackReadyDequeue(queue, callback_info) \
123 (callback_info) = (queue)->head; \
124 if((callback_info)) \
126 (queue)->head = (callback_info)->next; \
129 (queue)->tail = &(queue)->head; \
134 #define GlobusICallbackReadyPeak(queue, callback_info) \
136 (callback_info) = (queue)->head; \
139 #define GlobusICallbackReadyRemove(queue, callback_info) \
141 globus_l_callback_info_t ** tmp; \
143 tmp = &(queue)->head; \
144 while(*tmp && *tmp != (callback_info)) \
146 tmp = &(*tmp)->next; \
151 if(!(callback_info)->next) \
153 (queue)->tail = tmp; \
155 *tmp = (*tmp)->next; \
Module Descriptor.
Definition: globus_module.h:71