globus_common  15.26
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
globus_module.h
Go to the documentation of this file.
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 
22 #if !defined(GLOBUS_MODULE_H)
23 #define GLOBUS_MODULE_H 1
24 
37 #include "globus_error_generic.h"
38 
39 #include <stdio.h>
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /******************************************************************************
46  Type definitions
47 ******************************************************************************/
48 typedef int (*globus_module_activation_func_t)(void);
49 typedef int (*globus_module_deactivation_func_t)(void);
50 typedef void (*globus_module_atexit_func_t)(void);
51 typedef void * (*globus_module_get_pointer_func_t)(void);
52 
53 typedef struct
54 {
55  int major;
56  int minor;
57  /* these two members are reserved for internal Globus components */
58  unsigned long timestamp;
59  int branch_id;
60 } globus_version_t;
61 
70 {
72  char * module_name;
74  globus_module_activation_func_t activation_func;
76  globus_module_deactivation_func_t deactivation_func;
78  globus_module_atexit_func_t atexit_func;
80  globus_module_get_pointer_func_t get_pointer_func;
82  globus_version_t * version;
85 };
86 
87 /******************************************************************************
88  Function prototypes
89 ******************************************************************************/
90 
91 /*
92  * NOTE: all functions return either GLOBUS_SUCCESS or an error code
93  */
94 
95 int
97  globus_module_descriptor_t * module_descriptor);
98 
99 int
101  globus_module_descriptor_t * modules[],
102  globus_module_descriptor_t ** failed_module);
103 
104 int
106  globus_module_descriptor_t * module_descriptor);
107 
108 int
109 globus_module_deactivate_all(void);
110 
116 typedef
117 int
119  globus_module_descriptor_t * module_descriptor,
120  void * user_arg);
121 
131 int
132 globus_module_activate_proxy(
133  globus_module_descriptor_t * module_descriptor,
135  void * user_arg);
136 
140 void
141 globus_module_setenv(
142  const char * name,
143  const char * value);
144 
148 char *
149 globus_module_getenv(
150  const char * name);
151 
155 void *
156 globus_module_get_module_pointer(
158 
159 int
160 globus_module_get_version(
161  globus_module_descriptor_t * module_descriptor,
162  globus_version_t * version);
163 
164 void
165 globus_module_print_version(
166  globus_module_descriptor_t * module_descriptor,
167  FILE * stream,
168  globus_bool_t verbose);
169 
170 void
171 globus_module_print_activated_versions(
172  FILE * stream,
173  globus_bool_t verbose);
174 
175 void
176 globus_version_print(
177  const char * name,
178  const globus_version_t * version,
179  FILE * stream,
180  globus_bool_t verbose);
181 
182 
183 void
184 globus_module_set_args(
185  int * argc,
186  char *** argv);
187 
188 void
189 globus_module_get_args(
190  int ** argc,
191  char **** argv);
192 
193 
194 #ifdef __cplusplus
195 }
196 #endif
197 
198 #endif /* GLOBUS_MODULE_H */