Grid Community Toolkit
6.2.1653033972 (tag: v6.2.20220524)
|
Globus Extension Modules. More...
Go to the source code of this file.
Macros | |
#define | GlobusExtensionDefineModule(name) globus_module_descriptor_t name##_module |
Functions | |
int | globus_extension_activate (const char *extension_name) |
void * | globus_extension_lookup (globus_extension_handle_t *handle, globus_extension_registry_t *registry, void *symbol) |
int | globus_extension_register_builtin (const char *extension_name, globus_module_descriptor_t *module_descriptor) |
Globus Extension Modules.
#define GlobusExtensionDefineModule | ( | name | ) | globus_module_descriptor_t name##_module |
Declare your module with the following.
Ex: GlobusExtensionDefineModule(my_module) = { "my_module", globus_l_my_module_activate, globus_l_my_module_deactivate, NULL, NULL, &local_version };
int globus_extension_activate | ( | const char * | extension_name | ) |
loads the shared library 'libextension_name_flavor.so' from $GLOBUS_LOCATION/lib (or other location in LD_LIBRARY_PATH and activates the module defined within.
In the future, a configuration file will be supported allowing arbitrary extension names to be mapped to a specific library name.
Also, when builtin (compiled in) extensions are supported, this will activate those directly without needing to load the library.
Search order:
void* globus_extension_lookup | ( | globus_extension_handle_t * | handle, |
globus_extension_registry_t * | registry, | ||
void * | symbol | ||
) |
Get the datum associated with symbol in this registry.
You MUST call globus_extension_release() when you are done using the data. the lookup() and release() calls handle the reference counting that prevents an extension from being unloaded while things it provides are being used. Do NOT call release() until you are done accessing the data from * the lookup() call.
release() could potentially block as a result of module deactivation and unloading. ensuring that globus_extension_deactivate() is not called with outstanding references will prevent that.
symbol is a char * by default. the key can be changed by calling globus_extension_registry_set_hashing() before it is accessed.
int globus_extension_register_builtin | ( | const char * | extension_name, |
globus_module_descriptor_t * | module_descriptor | ||
) |
hopefully in the future, these functions will only be needed by generated code