Loading...
Searching...
No Matches
globus_extension.h
Go to the documentation of this file.
/*
* Copyright 1999-2006 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GLOBUS_EXTENSION_H
#define GLOBUS_EXTENSION_H
#include "globus_common_include.h"
#include "globus_module.h"
#include "globus_hashtable.h"
#ifdef __cplusplus
extern "C" {
#endif
extern globus_module_descriptor_t globus_i_extension_module;
#define GLOBUS_EXTENSION_MODULE (&globus_i_extension_module)
enum
{
GLOBUS_EXTENSION_ERROR_OPEN_FAILED,
GLOBUS_EXTENSION_ERROR_LOOKUP_FAILED
};
#define GlobusExtensionDefineModule(name) \
globus_module_descriptor_t name##_module
#define GlobusExtensionDeclareModule(name) \
extern globus_module_descriptor_t name##_module
#define GlobusExtensionMyModule(name) &name##_module
int
globus_extension_activate(
const char * extension_name);
int
globus_extension_deactivate(
const char * extension_name);
typedef struct globus_l_extension_handle_s * globus_extension_handle_t;
typedef struct
{
globus_hashtable_t table;
globus_bool_t initialized;
globus_bool_t user_hashing;
} globus_extension_registry_t;
/* these two calls are only to be called from within an extensions activate
* and deactivate functions
*
* the module in the add can either be GlobusExtensionMyModule(name),
* some other module, or NULL. It's purpose is to specify the module that
* is associated with the error objects that might come from use of this
* addition to the registry.
*
* symbol is a char * by default. the key can be changed by calling
* globus_extension_registry_set_hashing() before it is accessed.
*
* regardless, the memory pointed to by symbol must exist as long as the entry
* is in the registry
*/
int
globus_extension_registry_add(
globus_extension_registry_t * registry,
void * symbol,
globus_module_descriptor_t * module,
void * data);
void *
globus_extension_registry_remove(
globus_extension_registry_t * registry,
void * symbol);
int
globus_extension_registry_set_hashing(
globus_extension_registry_t * registry,
globus_hashtable_hash_func_t hash_func,
globus_hashtable_keyeq_func_t keyeq_func);
void *
globus_extension_lookup(
globus_extension_handle_t * handle,
globus_extension_registry_t * registry,
void * symbol);
void *
globus_extension_reference(
globus_extension_handle_t handle);
void
globus_extension_release(
globus_extension_handle_t handle);
/* get the module version of a loaded extension. version is a pointer to
an existing globus_version_t */
int
globus_extension_get_module_version(
globus_extension_handle_t handle,
globus_version_t * version);
globus_bool_t
globus_extension_error_match(
globus_extension_handle_t handle,
globus_object_t * error,
int type);
typedef
globus_bool_t
(*globus_extension_error_match_cb_t)(
globus_object_t * error,
globus_module_descriptor_t * module,
void * type);
globus_bool_t
globus_extension_error_match_with_cb(
globus_extension_handle_t handle,
globus_object_t * error,
globus_extension_error_match_cb_t callback,
void * type);
int
globus_extension_register_builtin(
const char * extension_name,
globus_module_descriptor_t * module_descriptor);
void
globus_extension_unregister_builtin(
const char * extension_name);
typedef struct
{
char * extension_name;
globus_module_descriptor_t * module_descriptor;
} globus_extension_builtin_t;
/* array of builtins, with null entry at end */
int
globus_extension_register_builtins(
globus_extension_builtin_t * builtins);
void
globus_extension_unregister_builtins(
globus_extension_builtin_t * builtins);
#ifdef __cplusplus
}
#endif
#endif /* GLOBUS_EXTENSION_H */
globus_common_include.h
Include System Headers.
globus_extension_lookup
void * globus_extension_lookup(globus_extension_handle_t *handle, globus_extension_registry_t *registry, void *symbol)
Definition globus_extension.c:872
globus_extension_register_builtin
int globus_extension_register_builtin(const char *extension_name, globus_module_descriptor_t *module_descriptor)
Definition globus_extension.c:1100
globus_extension_activate
int globus_extension_activate(const char *extension_name)
Definition globus_extension.c:528
globus_hashtable.h
Hash Table.
globus_module.h
Reference Counting Module Activation and Deactivation.
globus_bool_t
int globus_bool_t
Boolean type.
Definition globus_types.h:93
globus_hashtable_hash_func_t
int(* globus_hashtable_hash_func_t)(void *key, int limit)
Definition globus_hashtable.h:58
globus_hashtable_keyeq_func_t
int(* globus_hashtable_keyeq_func_t)(void *key1, void *key2)
Definition globus_hashtable.h:70