globus_gridmap_callout_error.h

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 
00017 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
00018 
00022 #endif
00023 
00024 #ifndef GLOBUS_GRIDMAP_CALLOUT_ERROR_H
00025 #define GLOBUS_GRIDMAP_CALLOUT_ERROR_H
00026 
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030 
00031 #include "globus_common.h"
00032 #include "globus_error_gssapi.h"
00033 
00069 #define GLOBUS_GRIDMAP_CALLOUT_ERROR_MODULE    (&globus_i_gridmap_callout_error_module)
00070 
00071 extern 
00072 globus_module_descriptor_t              globus_i_gridmap_callout_error_module;
00073 
00082 typedef enum
00083 {
00085     GLOBUS_GRIDMAP_CALLOUT_LOOKUP_FAILED = 0,
00087     GLOBUS_GRIDMAP_CALLOUT_GSSAPI_ERROR = 1,
00089     GLOBUS_GRIDMAP_CALLOUT_BUFFER_TOO_SMALL = 2,
00091     GLOBUS_GRIDMAP_CALLOUT_ERROR_LAST = 3
00092 }
00093 globus_gridmap_callout_error_t;
00094 
00095 extern char * globus_i_gridmap_callout_error_strings[];
00096 
00097 #define GLOBUS_GRIDMAP_CALLOUT_ERROR(__RESULT, __TYPE, __ERRSTR)         \
00098 {                                                                        \
00099     char *                          _tmp_str_ =                          \
00100         globus_common_create_string __ERRSTR;                            \
00101     (__RESULT) = globus_error_put(                                       \
00102         globus_error_construct_error(                                    \
00103             GLOBUS_GRIDMAP_CALLOUT_ERROR_MODULE,                         \
00104             (__RESULT) ? globus_error_get(__RESULT) : NULL,              \
00105             __TYPE,                                                      \
00106             __FILE__, \
00107             "Globus Gridmap Callout",                \
00108             __LINE__, \
00109             "%s%s%s",                                         \
00110             globus_i_gridmap_callout_error_strings[__TYPE],              \
00111             _tmp_str_ ? ": " : "",                                       \
00112             _tmp_str_ ? _tmp_str_ : ""));                                \
00113     if(_tmp_str_) free(_tmp_str_);                                       \
00114 }
00115 
00116 #define GLOBUS_GRIDMAP_CALLOUT_GSS_ERROR(__RESULT, __MAJOR_STATUS, __MINOR_STATUS) \
00117     __RESULT = globus_error_put(                                                   \
00118         globus_error_wrap_gssapi_error(                                            \
00119             GLOBUS_GRIDMAP_CALLOUT_ERROR_MODULE,                                   \
00120             __MAJOR_STATUS,                                                        \
00121             __MINOR_STATUS,                                                        \
00122             GLOBUS_GRIDMAP_CALLOUT_GSSAPI_ERROR,                                   \
00123             __FILE__,                                                              \
00124             "Globus Gridmap Callout",                                              \
00125             __LINE__,                                                              \
00126             "%s",                                                                  \
00127             globus_i_gridmap_callout_error_strings[GLOBUS_GRIDMAP_CALLOUT_GSSAPI_ERROR]))
00128 
00129 #ifdef __cplusplus
00130 }
00131 #endif
00132 
00133 #endif

Generated on 27 Jan 2015 for globus_gridmap_callout_error by  doxygen 1.4.7