Loading...
Searching...
No Matches
globus_module.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.
*/
#if !defined(GLOBUS_MODULE_H)
#define GLOBUS_MODULE_H 1
struct globus_module_descriptor_s;
typedef struct globus_module_descriptor_s globus_module_descriptor_t;
#include "globus_error_generic.h"
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
Type definitions
******************************************************************************/
typedef int (*globus_module_activation_func_t)(void);
typedef int (*globus_module_deactivation_func_t)(void);
typedef void (*globus_module_atexit_func_t)(void);
typedef void * (*globus_module_get_pointer_func_t)(void);
typedef struct
{
int major;
int minor;
/* these two members are reserved for internal Globus components */
unsigned long timestamp;
int branch_id;
} globus_version_t;
struct globus_module_descriptor_s
{
char * module_name;
globus_module_activation_func_t activation_func;
globus_module_deactivation_func_t deactivation_func;
globus_module_atexit_func_t atexit_func;
globus_module_get_pointer_func_t get_pointer_func;
globus_version_t * version;
globus_error_print_friendly_t friendly_error_func;
};
/******************************************************************************
Function prototypes
******************************************************************************/
/*
* NOTE: all functions return either GLOBUS_SUCCESS or an error code
*/
int
globus_module_activate(
globus_module_descriptor_t * module_descriptor);
int
globus_module_activate_array(
globus_module_descriptor_t * modules[],
globus_module_descriptor_t ** failed_module);
int
globus_module_deactivate(
globus_module_descriptor_t * module_descriptor);
int
globus_module_deactivate_all(void);
typedef
int
(*globus_module_deactivate_proxy_cb_t)(
globus_module_descriptor_t * module_descriptor,
void * user_arg);
int
globus_module_activate_proxy(
globus_module_descriptor_t * module_descriptor,
globus_module_deactivate_proxy_cb_t deactivate_cb,
void * user_arg);
void
globus_module_setenv(
const char * name,
const char * value);
char *
globus_module_getenv(
const char * name);
void *
globus_module_get_module_pointer(
globus_module_descriptor_t *);
int
globus_module_get_version(
globus_module_descriptor_t * module_descriptor,
globus_version_t * version);
void
globus_module_print_version(
globus_module_descriptor_t * module_descriptor,
FILE * stream,
globus_bool_t verbose);
void
globus_module_print_activated_versions(
FILE * stream,
globus_bool_t verbose);
void
globus_version_print(
const char * name,
const globus_version_t * version,
FILE * stream,
globus_bool_t verbose);
void
globus_module_set_args(
int * argc,
char *** argv);
void
globus_module_get_args(
int ** argc,
char **** argv);
#ifdef __cplusplus
}
#endif
#endif /* GLOBUS_MODULE_H */
globus_error_generic.h
Globus Error API.
globus_error_print_friendly_t
char *(* globus_error_print_friendly_t)(globus_object_t *error, const globus_object_type_t *type)
Definition globus_error_generic.h:249
globus_module_print_version
void globus_module_print_version(globus_module_descriptor_t *module_descriptor, FILE *stream, globus_bool_t verbose)
Definition globus_module.c:741
globus_module_setenv
void globus_module_setenv(const char *name, const char *value)
Definition globus_module.c:546
globus_module_activate_proxy
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
globus_module_deactivate_proxy_cb_t
int(* globus_module_deactivate_proxy_cb_t)(globus_module_descriptor_t *module_descriptor, void *user_arg)
Definition globus_module.h:120
globus_version_print
void globus_version_print(const char *name, const globus_version_t *version, FILE *stream, globus_bool_t verbose)
Definition globus_module.c:844
globus_module_getenv
char * globus_module_getenv(const char *name)
Definition globus_module.c:622
globus_module_get_version
int globus_module_get_version(globus_module_descriptor_t *module_descriptor, globus_version_t *version)
Definition globus_module.c:697
globus_module_print_activated_versions
void globus_module_print_activated_versions(FILE *stream, globus_bool_t verbose)
Definition globus_module.c:772
globus_module_get_module_pointer
void * globus_module_get_module_pointer(globus_module_descriptor_t *)
Definition globus_module.c:519
globus_bool_t
int globus_bool_t
Boolean type.
Definition globus_types.h:93
globus_module_deactivate
int globus_module_deactivate(globus_module_descriptor_t *module_descriptor)
Deactivate a module.
Definition globus_module.c:395
globus_module_activate
int globus_module_activate(globus_module_descriptor_t *module_descriptor)
Activate a module.
Definition globus_module.c:266
globus_module_activate_array
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:289
globus_module_descriptor_s
Module Descriptor.
Definition globus_module.h:72
globus_module_descriptor_s::module_name
char * module_name
Definition globus_module.h:74
globus_module_descriptor_s::friendly_error_func
globus_error_print_friendly_t friendly_error_func
Definition globus_module.h:86
globus_module_descriptor_s::get_pointer_func
globus_module_get_pointer_func_t get_pointer_func
Definition globus_module.h:82
globus_module_descriptor_s::version
globus_version_t * version
Definition globus_module.h:84
globus_module_descriptor_s::activation_func
globus_module_activation_func_t activation_func
Definition globus_module.h:76
globus_module_descriptor_s::deactivation_func
globus_module_deactivation_func_t deactivation_func
Definition globus_module.h:78
globus_module_descriptor_s::atexit_func
globus_module_atexit_func_t atexit_func
Definition globus_module.h:80