globus_error.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 1999-2006 University of Chicago
00003  * 
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  * 
00008  * http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00022 #ifndef GLOBUS_ERROR_H
00023 #define GLOBUS_ERROR_H
00024 
00025 #include "globus_common_include.h"
00026 #include "globus_object.h"
00027 #include "globus_module.h"
00028 
00029 #include <inttypes.h>  
00030 
00031 typedef uint_least32_t globus_uint_t;
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 /**********************************************************************
00038  * Error API Types
00039  *   globus_result_t          --   used as error object handle
00040  **********************************************************************/
00041 
00042 /**********************************************************************
00043  * Error Creation API
00044  **********************************************************************/
00045 
00046 extern globus_object_t *
00047 globus_error_initialize_base (
00048     globus_object_t *                   error,
00049     globus_module_descriptor_t *        source_module,
00050     globus_object_t *                   causal_error);
00051 
00052 extern globus_object_t *
00053 globus_error_construct_base (
00054     globus_module_descriptor_t *        source_module,
00055     globus_object_t *                   causal_error);
00056 
00057 #define globus_error_type_static_initializer(parent_type,                   \
00058                                              copy_func,                     \
00059                                              destructor,                    \
00060                                              string_func)                   \
00061         globus_object_type_static_initializer ((parent_type),               \
00062                                                (copy_func),                 \
00063                                                (destructor),                \
00064                                                ((void *) string_func))
00065 
00066 
00067 /**********************************************************************
00068  * Standard Error Type
00069  *    ERROR_TYPE_BASE
00070  **********************************************************************/
00071 
00072 extern const globus_object_type_t GLOBUS_ERROR_TYPE_BASE_DEFINITION;
00073 #define GLOBUS_ERROR_TYPE_BASE (&GLOBUS_ERROR_TYPE_BASE_DEFINITION)
00074 
00075 /**********************************************************************
00076  * Standard Error Prototype
00077  *    ERROR_NO_INFO  (type GLOBUS_ERROR_TYPE_BASE)
00078  **********************************************************************/
00079 
00080 extern globus_object_t GLOBUS_ERROR_BASE_STATIC_PROTOTYPE;
00081 #define GLOBUS_ERROR_BASE_PROTOTYPE (&GLOBUS_ERROR_BASE_STATIC_PROTOTYPE)
00082 
00083 #define GLOBUS_ERROR_NO_INFO GLOBUS_ERROR_BASE_PROTOTYPE
00084 
00085 /**********************************************************************
00086  * Error Management API
00087  **********************************************************************/
00088 
00089 extern globus_object_t *
00090 globus_error_get(
00091     globus_result_t                     result);
00092 /* returns corresponding object for result,
00093  * may return GLOBUS_ERROR_NO_INFO */
00094 
00095 extern globus_object_t *
00096 globus_error_peek(
00097     globus_result_t                     result);
00098 /* returns pointer to object for result DOES NOT REMOVE object.
00099  * This pointer is only valid for the current thread and until another call to
00100  * globus_error_peek is made
00101  * may return GLOBUS_ERROR_NO_INFO
00102  */
00103 
00104 extern globus_result_t
00105 globus_error_put(
00106     globus_object_t *                   error);
00107 /* does nothing if error is NULL */
00108 
00109 /**********************************************************************
00110  * Error Manipulation API
00111  **********************************************************************/
00112 
00113 extern globus_module_descriptor_t *
00114 globus_error_base_get_source (
00115     globus_object_t *                   error);
00116 
00117 extern void
00118 globus_error_base_set_source (
00119     globus_object_t *                   error,
00120     globus_module_descriptor_t *        source_module);
00121 
00122 extern globus_object_t *
00123 globus_error_base_get_cause (
00124     globus_object_t *                   error);
00125 
00126 extern void
00127 globus_error_base_set_cause (
00128     globus_object_t *                   error,
00129     globus_object_t *                   causal_error);
00130 
00131 
00132 #include "globus_thread.h"
00133 
00134 extern globus_bool_t globus_i_error_verbose;
00135 extern globus_thread_key_t globus_i_error_verbose_key;
00136 
00137 /**********************************************************************
00138  * Module definition
00139  **********************************************************************/
00140 
00141 extern globus_module_descriptor_t globus_i_error_module;
00142 
00143 #define GLOBUS_ERROR_MODULE (&globus_i_error_module)
00144 
00145 #ifdef __cplusplus
00146 }
00147 #endif
00148 
00149 #endif /* GLOBUS_ERROR_H */

Generated on 17 Mar 2017 for globus_common by  doxygen 1.4.7