Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 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 
39 #include "globus_error_generic.h"
40 
41 #include <stdio.h>
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /******************************************************************************
48  Type definitions
49 ******************************************************************************/
50 typedef int (*globus_module_activation_func_t)(void);
51 typedef int (*globus_module_deactivation_func_t)(void);
52 typedef void (*globus_module_atexit_func_t)(void);
53 typedef void * (*globus_module_get_pointer_func_t)(void);
54 
55 typedef struct
56 {
57  int major;
58  int minor;
59  /* these two members are reserved for internal Globus components */
60  unsigned long timestamp;
61  int branch_id;
62 } globus_version_t;
63 
72 {
74  char * module_name;
76  globus_module_activation_func_t activation_func;
78  globus_module_deactivation_func_t deactivation_func;
80  globus_module_atexit_func_t atexit_func;
82  globus_module_get_pointer_func_t get_pointer_func;
84  globus_version_t * version;
87 };
88 
89 /******************************************************************************
90  Function prototypes
91 ******************************************************************************/
92 
93 /*
94  * NOTE: all functions return either GLOBUS_SUCCESS or an error code
95  */
96 
97 int
99  globus_module_descriptor_t * module_descriptor);
100 
101 int
103  globus_module_descriptor_t * modules[],
104  globus_module_descriptor_t ** failed_module);
105 
106 int
108  globus_module_descriptor_t * module_descriptor);
109 
110 int
111 globus_module_deactivate_all(void);
112 
118 typedef
119 int
121  globus_module_descriptor_t * module_descriptor,
122  void * user_arg);
123 
133 int
135  globus_module_descriptor_t * module_descriptor,
137  void * user_arg);
138 
142 void
144  const char * name,
145  const char * value);
146 
150 char *
152  const char * name);
153 
157 void *
160 
161 int
163  globus_module_descriptor_t * module_descriptor,
164  globus_version_t * version);
165 
166 void
168  globus_module_descriptor_t * module_descriptor,
169  FILE * stream,
170  globus_bool_t verbose);
171 
172 void
174  FILE * stream,
175  globus_bool_t verbose);
176 
177 void
179  const char * name,
180  const globus_version_t * version,
181  FILE * stream,
182  globus_bool_t verbose);
183 
184 
185 void
186 globus_module_set_args(
187  int * argc,
188  char *** argv);
189 
190 void
191 globus_module_get_args(
192  int ** argc,
193  char **** argv);
194 
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 
200 #endif /* GLOBUS_MODULE_H */
int globus_module_deactivate(globus_module_descriptor_t *module_descriptor)
Deactivate a module.
Definition: globus_module.c:395
int globus_module_get_version(globus_module_descriptor_t *module_descriptor, globus_version_t *version)
Definition: globus_module.c:697
char * globus_module_getenv(const char *name)
Definition: globus_module.c:622
void globus_module_print_activated_versions(FILE *stream, globus_bool_t verbose)
Definition: globus_module.c:772
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
globus_version_t * version
Definition: globus_module.h:84
globus_module_get_pointer_func_t get_pointer_func
Definition: globus_module.h:82
void globus_module_setenv(const char *name, const char *value)
Definition: globus_module.c:546
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:169
void globus_version_print(const char *name, const globus_version_t *version, FILE *stream, globus_bool_t verbose)
Definition: globus_module.c:844
int globus_module_activate_array(globus_module_descriptor_t *module_array[], globus_module_descriptor_t **failed_module)
Activate a group of modules.
Definition: globus_module.c:289
char * module_name
Definition: globus_module.h:74
globus_module_atexit_func_t atexit_func
Definition: globus_module.h:80
int globus_module_activate(globus_module_descriptor_t *module_descriptor)
Activate a module.
Definition: globus_module.c:266
globus_module_deactivation_func_t deactivation_func
Definition: globus_module.h:78
void globus_module_print_version(globus_module_descriptor_t *module_descriptor, FILE *stream, globus_bool_t verbose)
Definition: globus_module.c:741
Globus Error API.
char *(* globus_error_print_friendly_t)(globus_object_t *error, const globus_object_type_t *type)
Definition: globus_error_generic.h:249
globus_error_print_friendly_t friendly_error_func
Definition: globus_module.h:86
void * globus_module_get_module_pointer(globus_module_descriptor_t *)
Definition: globus_module.c:519
int(* globus_module_deactivate_proxy_cb_t)(globus_module_descriptor_t *module_descriptor, void *user_arg)
Definition: globus_module.h:120
globus_module_activation_func_t activation_func
Definition: globus_module.h:76
Module Descriptor.
Definition: globus_module.h:71