17 #ifndef GLOBUS_I_CALLOUT_H
18 #define GLOBUS_I_CALLOUT_H
20 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
34 extern int globus_i_callout_debug_level;
35 extern FILE * globus_i_callout_debug_fstream;
37 #define GLOBUS_I_CALLOUT_DEBUG(_LEVEL_) \
38 (globus_i_callout_debug_level >= (_LEVEL_))
40 #define GLOBUS_I_CALLOUT_DEBUG_FPRINTF(_LEVEL_, _MESSAGE_) \
42 if (GLOBUS_I_CALLOUT_DEBUG(_LEVEL_)) \
44 globus_libc_fprintf _MESSAGE_; \
48 #define GLOBUS_I_CALLOUT_DEBUG_FNPRINTF(_LEVEL_, _MESSAGE_) \
50 if (GLOBUS_I_CALLOUT_DEBUG(_LEVEL_)) \
53 globus_common_create_nstring _MESSAGE_; \
54 globus_libc_fprintf(globus_i_callout_debug_fstream, \
56 globus_libc_free(_tmp_str_); \
60 #define GLOBUS_I_CALLOUT_DEBUG_PRINT(_LEVEL_, _MESSAGE_) \
62 if (GLOBUS_I_CALLOUT_DEBUG(_LEVEL_)) \
64 globus_libc_fprintf(globus_i_callout_debug_fstream, \
69 #define GLOBUS_I_CALLOUT_DEBUG_PRINT_OBJECT(_LEVEL_, _OBJ_NAME_, _OBJ_) \
71 if (GLOBUS_I_CALLOUT_DEBUG(_LEVEL_)) \
73 _OBJ_NAME_##_print_fp(globus_i_callout_debug_fstream, _OBJ_); \
79 #define GLOBUS_I_CALLOUT_DEBUG(_LEVEL_) 0
80 #define GLOBUS_I_CALLOUT_DEBUG_FPRINTF(_LEVEL_, _MESSAGE_) {}
81 #define GLOBUS_I_CALLOUT_DEBUG_FNPRINTF(_LEVEL_, _MESSAGE_) {}
82 #define GLOBUS_I_CALLOUT_DEBUG_PRINT(_LEVEL_, _MESSAGE_) {}
83 #define GLOBUS_I_CALLOUT_DEBUG_PRINT_OBJECT(_LEVEL_, _OBJ_NAME_, _OBJ_) {}
87 #define GLOBUS_I_CALLOUT_DEBUG_ENTER \
88 GLOBUS_I_CALLOUT_DEBUG_FPRINTF( \
89 1, (globus_i_callout_debug_fstream, \
90 "%s entering\n", _function_name_))
92 #define GLOBUS_I_CALLOUT_DEBUG_EXIT \
93 GLOBUS_I_CALLOUT_DEBUG_FPRINTF( \
94 2, (globus_i_callout_debug_fstream, \
95 "%s exiting\n", _function_name_))
99 #define GLOBUS_CALLOUT_ERROR_RESULT(_RESULT_, _ERRORTYPE_, _ERRSTR_) \
102 globus_common_create_string _ERRSTR_; \
103 _RESULT_ = globus_i_callout_error_result(_ERRORTYPE_, \
109 globus_libc_free(_tmp_str_); \
112 #define GLOBUS_CALLOUT_ERROR_CHAIN_RESULT(_TOP_RESULT_, _ERRORTYPE_) \
113 _TOP_RESULT_ = globus_i_callout_error_chain_result( \
123 #define GLOBUS_CALLOUT_LONG_ERROR_RESULT(_RESULT_, \
129 globus_common_create_string _ERRSTR_; \
130 _RESULT_ = globus_i_callout_error_result(_ERRORTYPE_, \
136 globus_libc_free(_tmp_str_); \
139 #define GLOBUS_CALLOUT_LONG_ERROR_CHAIN_RESULT(_TOP_RESULT_, \
142 _TOP_RESULT_ = globus_i_callout_error_chain_result( \
151 #define GLOBUS_CALLOUT_MALLOC_ERROR(_RESULT_) \
154 globus_l_callout_error_strings[ \
155 GLOBUS_CALLOUT_ERROR_OUT_OF_MEMORY]; \
156 _RESULT_ = globus_error_put( \
157 globus_error_wrap_errno_error( \
158 GLOBUS_CALLOUT_MODULE, \
160 GLOBUS_CALLOUT_ERROR_OUT_OF_MEMORY, \
168 #define GLOBUS_CALLOUT_ERRNO_ERROR_RESULT(_RESULT_, \
169 _ERRORTYPE_, _ERRORSTR_) \
172 globus_common_create_string _ERRORSTR_; \
173 _RESULT_ = globus_error_put( \
174 globus_error_wrap_errno_error( \
175 GLOBUS_CALLOUT_MODULE, \
183 globus_libc_free(_tmp_str_); \
186 extern char * globus_l_callout_error_strings[];
189 globus_i_callout_error_result(
191 const char * filename,
192 const char * function_name,
194 const char * short_desc,
195 const char * long_desc);
198 globus_i_callout_error_chain_result(
201 const char * filename,
202 const char * function_name,
204 const char * short_desc,
205 const char * long_desc);
215 typedef struct globus_i_callout_handle_s
217 globus_hashtable_t symbol_htable;
218 globus_hashtable_t library_htable;
220 globus_i_callout_handle_t;
222 typedef struct globus_i_callout_data_s
227 struct globus_i_callout_data_s * next;
231 } globus_i_callout_data_t;
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
Globus Callout Infrastructure.
uint32_t globus_result_t
Definition: globus_types.h:99