globus_common 18.13
Loading...
Searching...
No Matches
globus_extension.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
21
22#ifndef GLOBUS_EXTENSION_H
23#define GLOBUS_EXTENSION_H
24
26#include "globus_module.h"
27#include "globus_hashtable.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33extern globus_module_descriptor_t globus_i_extension_module;
34#define GLOBUS_EXTENSION_MODULE (&globus_i_extension_module)
35
36enum
37{
38 GLOBUS_EXTENSION_ERROR_OPEN_FAILED,
39 GLOBUS_EXTENSION_ERROR_LOOKUP_FAILED
40};
41
56#define GlobusExtensionDefineModule(name) \
57 globus_module_descriptor_t name##_module
58#define GlobusExtensionDeclareModule(name) \
59 extern globus_module_descriptor_t name##_module
60#define GlobusExtensionMyModule(name) &name##_module
61
94int
96 const char * extension_name);
97
98int
99globus_extension_deactivate(
100 const char * extension_name);
101
102typedef struct globus_l_extension_handle_s * globus_extension_handle_t;
103
104typedef struct
105{
106 globus_hashtable_t table;
107 globus_bool_t initialized;
108 globus_bool_t user_hashing;
109} globus_extension_registry_t;
110
111/* these two calls are only to be called from within an extensions activate
112 * and deactivate functions
113 *
114 * the module in the add can either be GlobusExtensionMyModule(name),
115 * some other module, or NULL. It's purpose is to specify the module that
116 * is associated with the error objects that might come from use of this
117 * addition to the registry.
118 *
119 * symbol is a char * by default. the key can be changed by calling
120 * globus_extension_registry_set_hashing() before it is accessed.
121 *
122 * regardless, the memory pointed to by symbol must exist as long as the entry
123 * is in the registry
124 */
125int
126globus_extension_registry_add(
127 globus_extension_registry_t * registry,
128 void * symbol,
129 globus_module_descriptor_t * module,
130 void * data);
131
132void *
133globus_extension_registry_remove(
134 globus_extension_registry_t * registry,
135 void * symbol);
136
137int
138globus_extension_registry_set_hashing(
139 globus_extension_registry_t * registry,
142
143
159void *
161 globus_extension_handle_t * handle,
162 globus_extension_registry_t * registry,
163 void * symbol);
164
165void *
166globus_extension_reference(
167 globus_extension_handle_t handle);
168
169void
170globus_extension_release(
171 globus_extension_handle_t handle);
172
173/* get the module version of a loaded extension. version is a pointer to
174 an existing globus_version_t */
175int
176globus_extension_get_module_version(
177 globus_extension_handle_t handle,
178 globus_version_t * version);
179
181globus_extension_error_match(
182 globus_extension_handle_t handle,
183 globus_object_t * error,
184 int type);
185
186typedef
188(*globus_extension_error_match_cb_t)(
189 globus_object_t * error,
190 globus_module_descriptor_t * module,
191 void * type);
192
194globus_extension_error_match_with_cb(
195 globus_extension_handle_t handle,
196 globus_object_t * error,
197 globus_extension_error_match_cb_t callback,
198 void * type);
199
204int
206 const char * extension_name,
207 globus_module_descriptor_t * module_descriptor);
208
209void
210globus_extension_unregister_builtin(
211 const char * extension_name);
212
213typedef struct
214{
215 char * extension_name;
216 globus_module_descriptor_t * module_descriptor;
217} globus_extension_builtin_t;
218
219/* array of builtins, with null entry at end */
220int
221globus_extension_register_builtins(
222 globus_extension_builtin_t * builtins);
223
224void
225globus_extension_unregister_builtins(
226 globus_extension_builtin_t * builtins);
227
228#ifdef __cplusplus
229}
230#endif
231
232#endif /* GLOBUS_EXTENSION_H */
Include System Headers.
void * globus_extension_lookup(globus_extension_handle_t *handle, globus_extension_registry_t *registry, void *symbol)
Definition globus_extension.c:872
int globus_extension_register_builtin(const char *extension_name, globus_module_descriptor_t *module_descriptor)
Definition globus_extension.c:1100
int globus_extension_activate(const char *extension_name)
Definition globus_extension.c:528
Reference Counting Module Activation and Deactivation.
int globus_bool_t
Boolean type.
Definition globus_types.h:93
int(* globus_hashtable_hash_func_t)(void *key, int limit)
Definition globus_hashtable.h:58
int(* globus_hashtable_keyeq_func_t)(void *key1, void *key2)
Definition globus_hashtable.h:70