Grid Community Toolkit  6.2.1541705016
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
133  globus_module_descriptor_t * module_descriptor,
135  void * user_arg);
136 
140 void
142  const char * name,
143  const char * value);
144 
148 char *
150  const char * name);
151 
155 void *
158 
159 int
161  globus_module_descriptor_t * module_descriptor,
162  globus_version_t * version);
163 
164 void
166  globus_module_descriptor_t * module_descriptor,
167  FILE * stream,
168  globus_bool_t verbose);
169 
170 void
172  FILE * stream,
173  globus_bool_t verbose);
174 
175 void
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 */
int globus_module_deactivate(globus_module_descriptor_t *module_descriptor)
Deactivate a module.
Definition: globus_module.c:377
int globus_module_get_version(globus_module_descriptor_t *module_descriptor, globus_version_t *version)
Definition: globus_module.c:679
char * globus_module_getenv(const char *name)
Definition: globus_module.c:604
void globus_module_print_activated_versions(FILE *stream, globus_bool_t verbose)
Definition: globus_module.c:754
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
globus_version_t * version
Definition: globus_module.h:82
globus_module_get_pointer_func_t get_pointer_func
Definition: globus_module.h:80
void globus_module_setenv(const char *name, const char *value)
Definition: globus_module.c:528
int globus_module_activate_proxy(globus_module_descriptor_t *module_descriptor, globus_module_deactivate_proxy_cb_t deactivate_cb, void *user_arg)
Definition: globus_module.c:166
void globus_version_print(const char *name, const globus_version_t *version, FILE *stream, globus_bool_t verbose)
Definition: globus_module.c:826
int globus_module_activate_array(globus_module_descriptor_t *modules[], globus_module_descriptor_t **failed_module)
Activate a group of modules.
Definition: globus_module.c:280
char * module_name
Definition: globus_module.h:72
globus_module_atexit_func_t atexit_func
Definition: globus_module.h:78
int globus_module_activate(globus_module_descriptor_t *module_descriptor)
Activate a module.
Definition: globus_module.c:260
int(* globus_module_deactivate_proxy_cb_t)(globus_module_descriptor_t *module_descriptor, void *user_arg)
Definition: globus_module.h:118
globus_module_deactivation_func_t deactivation_func
Definition: globus_module.h:76
void globus_module_print_version(globus_module_descriptor_t *module_descriptor, FILE *stream, globus_bool_t verbose)
Definition: globus_module.c:723
Globus Error API.
globus_error_print_friendly_t friendly_error_func
Definition: globus_module.h:84
void * globus_module_get_module_pointer(globus_module_descriptor_t *)
Definition: globus_module.c:501
char *(* globus_error_print_friendly_t)(globus_object_t *error, const globus_object_type_t *type)
Definition: globus_error_generic.h:244
globus_module_activation_func_t activation_func
Definition: globus_module.h:74
Module Descriptor.
Definition: globus_module.h:69