Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_i_error_openssl.h
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_I_ERROR_OPENSSL_H
18 #define GLOBUS_I_ERROR_OPENSSL_H
19 
20 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
21 
27 #include "globus_error_openssl.h"
28 
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 
35 #ifdef BUILD_DEBUG
36 extern int globus_i_gsi_openssl_error_debug_level;
37 
38 #define GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG(_LEVEL_) \
39  (globus_i_gsi_openssl_error_debug_level >= (_LEVEL_))
40 
41 #define GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG_FPRINTF(_LEVEL_, _MESSAGE_) \
42  { \
43  if (GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG(_LEVEL_)) \
44  { \
45  globus_libc_fprintf _MESSAGE_; \
46  } \
47  }
48 
49 
50 #define GLOBUS_I_GSI_GSSAPI_DEBUG_FNPRINTF(_LEVEL_, _MESSAGE_) \
51 { \
52  if (GLOBUS_I_GSI_GSSAPI_DEBUG(_LEVEL_)) \
53  { \
54  char * _tmp_str_ = \
55  globus_common_create_nstring _MESSAGE_; \
56  globus_libc_fprintf(globus_i_gsi_gssapi_debug_fstream, \
57  _tmp_str_); \
58  globus_libc_free(_tmp_str_); \
59  } \
60 }
61 
62 #define GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG_ENTER \
63  GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG_FPRINTF( \
64  1, (stderr, "%s entering\n", _function_name_))
65 
66 #define GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG_EXIT \
67  GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG_FPRINTF( \
68  1, (stderr, "%s exiting\n", _function_name_))
69 
70 #else
71 
72 #define GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG_FPRINTF(_LEVEL_, _MESSAGE_) {}
73 #define GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG_FNPRINTF(_LEVEL_, _MESSAGE_) {}
74 #define GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG_ENTER {}
75 #define GLOBUS_I_GSI_OPENSSL_ERROR_DEBUG_EXIT {}
76 
77 #endif
78 
79 
80 typedef struct globus_l_openssl_error_handle_s
81 {
82  unsigned long error_code;
83  const char * filename;
84  int linenumber;
85  const char * data;
86  int flags;
87 } globus_i_openssl_error_handle_t;
88 
89 globus_openssl_error_handle_t
90 globus_i_openssl_error_handle_init(void);
91 
92 void
93 globus_i_openssl_error_handle_destroy(
94  globus_openssl_error_handle_t handle);
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
101 
102 #endif /* GLOBUS_I_ERROR_OPENSSL_H */
Globus Generic Error.