CERN org.glite.Gfal
2.0.1
|
the file of the common lib for the plugin management More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dlfcn.h>
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
#include "gfal_types.h"
#include "gfal_common_plugin.h"
#include "gfal_constants.h"
#include "gfal_common_errverbose.h"
#include "gfal_common_filedescriptor.h"
Functions | |
gfal_plugin_interface * | gfal_plugin_interface_new () |
char ** | gfal_plugins_get_list (gfal_handle handle, GError **err) |
gfal_plugin_interface * | gfal_search_plugin_with_name (gfal_handle handle, const char *name, GError **err) |
plugin_pointer_handle | gfal_plugins_list_handler (gfal_handle handle, GError **err) |
plugins walker provide a list of plugin handlers, each plugin handler is a reference to an usable plugin | |
char ** | gfal_list_directory_plugins (const char *dir, GError **err) |
char ** | gfal_localize_plugins (GError **err) |
int | gfal_modules_resolve (gfal_handle handle, GError **err) |
int | gfal_plugins_instance (gfal_handle handle, GError **err) |
int | gfal_plugins_operation_executor (gfal_handle handle, gboolean(*checker)(gfal_plugin_interface *, GError **), int(*executor)(gfal_plugin_interface *, GError **), GError **err) |
int | gfal_plugins_accessG (gfal_handle handle, const char *path, int mode, GError **err) |
int | gfal_plugin_statG (gfal_handle handle, const char *path, struct stat *st, GError **err) |
ssize_t | gfal_plugin_readlinkG (gfal_handle handle, const char *path, char *buff, size_t buffsiz, GError **err) |
int | gfal_plugin_lstatG (gfal_handle handle, const char *path, struct stat *st, GError **err) |
int | gfal_plugins_delete (gfal_handle handle, GError **err) |
int | gfal_plugin_chmodG (gfal_handle handle, const char *path, mode_t mode, GError **err) |
int | gfal_plugin_renameG (gfal_handle handle, const char *oldpath, const char *newpath, GError **err) |
int | gfal_plugin_symlinkG (gfal_handle handle, const char *oldpath, const char *newpath, GError **err) |
int | gfal_plugin_mkdirp (gfal_handle handle, const char *path, mode_t mode, gboolean pflag, GError **err) |
int | gfal_plugin_rmdirG (gfal_handle handle, const char *path, GError **err) |
gfal_file_handle | gfal_plugin_opendirG (gfal_handle handle, const char *name, GError **err) |
int | gfal_plugin_closedirG (gfal_handle handle, gfal_file_handle fh, GError **err) |
gfal_file_handle | gfal_plugin_openG (gfal_handle handle, const char *path, int flag, mode_t mode, GError **err) |
int | gfal_plugin_closeG (gfal_handle handle, gfal_file_handle fh, GError **err) |
struct dirent * | gfal_plugin_readdirG (gfal_handle handle, gfal_file_handle fh, GError **err) |
ssize_t | gfal_plugin_getxattrG (gfal_handle handle, const char *path, const char *name, void *buff, size_t s_buff, GError **err) |
implementation in the plugin of the get extended attribute function | |
ssize_t | gfal_plugin_listxattrG (gfal_handle handle, const char *path, char *list, size_t s_list, GError **err) |
int | gfal_plugin_readG (gfal_handle handle, gfal_file_handle fh, void *buff, size_t s_buff, GError **err) |
ssize_t | gfal_plugin_simulate_preadG (gfal_handle handle, gfal_plugin_interface *if_cata, gfal_file_handle fh, void *buff, size_t s_buff, off_t offset, GError **err) |
ssize_t | gfal_plugin_preadG (gfal_handle handle, gfal_file_handle fh, void *buff, size_t s_buff, off_t offset, GError **err) |
ssize_t | gfal_plugin_simulate_pwriteG (gfal_handle handle, gfal_plugin_interface *if_cata, gfal_file_handle fh, void *buff, size_t s_buff, off_t offset, GError **err) |
ssize_t | gfal_plugin_pwriteG (gfal_handle handle, gfal_file_handle fh, void *buff, size_t s_buff, off_t offset, GError **err) |
int | gfal_plugin_lseekG (gfal_handle handle, gfal_file_handle fh, off_t offset, int whence, GError **err) |
int | gfal_plugin_writeG (gfal_handle handle, gfal_file_handle fh, void *buff, size_t s_buff, GError **err) |
char * | get_default_cat () |
char * | gfal_get_cat_type (GError **err) |
int | gfal_plugin_unlinkG (gfal_handle handle, const char *path, GError **err) |
int | gfal_plugin_setxattrG (gfal_handle handle, const char *path, const char *name, const void *value, size_t size, int flags, GError **err) |
int | gfal_plugins_has_parameter (gfal_handle handle, const char *namespace, const char *key, GError **err) |
int | gfal_plugins_notify_all (gfal_handle handle, const char *namespace, const char *key, GError **err) |
the file of the common lib for the plugin management
char* get_default_cat | ( | ) |
return the plugin type configured at compilation time
char** gfal_list_directory_plugins | ( | const char * | dir, |
GError ** | err | ||
) |
Provide a list of the gfal 2.0 plugins path
err | : error handle if found |
References gfal_print_verbose().
Referenced by gfal_localize_plugins().
char** gfal_localize_plugins | ( | GError ** | err | ) |
Provide a list of the gfal 2.0 plugins path
err | : error handle if found |
References GFAL_PLUGIN_DIR_ENV, gfal_print_verbose(), and gfal_list_directory_plugins().
Referenced by gfal_modules_resolve().
int gfal_modules_resolve | ( | gfal_handle | handle, |
GError ** | err | ||
) |
search and load the gfal 2.0 plugins
References gfal_localize_plugins(), and gfal_print_verbose().
Referenced by gfal_plugins_instance().
int gfal_plugin_chmodG | ( | gfal_handle | handle, |
const char * | path, | ||
mode_t | mode, | ||
GError ** | err | ||
) |
Execute the chmod function on the first compatible plugin ( checked with check_url func )
References _gfal_plugin_interface::chmodG.
int gfal_plugin_closedirG | ( | gfal_handle | handle, |
gfal_file_handle | fh, | ||
GError ** | err | ||
) |
close the given dir handle in the proper plugin
int gfal_plugin_closeG | ( | gfal_handle | handle, |
gfal_file_handle | fh, | ||
GError ** | err | ||
) |
close the given file handle in the proper plugin
gfal_plugin_interface* gfal_plugin_interface_new | ( | ) |
function to use in order to create a new plugin interface permit to keep the ABI compatibility must be use in ALL the plugin's "gfal_plugin_init" functions
int gfal_plugin_lseekG | ( | gfal_handle | handle, |
gfal_file_handle | fh, | ||
off_t | offset, | ||
int | whence, | ||
GError ** | err | ||
) |
do a lseek operation on the plugin
int gfal_plugin_lstatG | ( | gfal_handle | handle, |
const char * | path, | ||
struct stat * | st, | ||
GError ** | err | ||
) |
Execute a lstat function in the lfc
int gfal_plugin_mkdirp | ( | gfal_handle | handle, |
const char * | path, | ||
mode_t | mode, | ||
gboolean | pflag, | ||
GError ** | err | ||
) |
Execute a mkdir function on the first compatible plugin ( checked with check url func )
handle | handle of the current context |
path | path to create |
mode | right of the file created |
pflag | if TRUE, execute the request recursively if necessary else work as the common mkdir system call |
GError | error report system |
Referenced by gfal_posix_internal_mkdir().
gfal_file_handle gfal_plugin_opendirG | ( | gfal_handle | handle, |
const char * | name, | ||
GError ** | err | ||
) |
Execute a opendir function on the first compatible plugin ( checked with check url func )
handle | handle of the current context |
path | path to open |
GError | error report system |
gfal_file_handle gfal_plugin_openG | ( | gfal_handle | handle, |
const char * | path, | ||
int | flag, | ||
mode_t | mode, | ||
GError ** | err | ||
) |
open the file specified by path on the proper plugin with the specified flag and mode
References gfal_print_verbose().
Referenced by lfc_openG(), and gfal_posix_internal_open().
ssize_t gfal_plugin_preadG | ( | gfal_handle | handle, |
gfal_file_handle | fh, | ||
void * | buff, | ||
size_t | s_buff, | ||
off_t | offset, | ||
GError ** | err | ||
) |
do a pread operation on the plugin, read s_buff chars on the fd device after the offset
References _gfal_plugin_interface::preadG, and gfal_plugin_simulate_preadG().
Referenced by gfal_posix_gfalfilehandle_pread().
ssize_t gfal_plugin_pwriteG | ( | gfal_handle | handle, |
gfal_file_handle | fh, | ||
void * | buff, | ||
size_t | s_buff, | ||
off_t | offset, | ||
GError ** | err | ||
) |
do a pread operation on the plugin, read s_buff chars on the fd device after the offset
References gfal_plugin_simulate_pwriteG().
Referenced by gfal_posix_gfalfilehandle_pwrite().
struct dirent* gfal_plugin_readdirG | ( | gfal_handle | handle, |
gfal_file_handle | fh, | ||
GError ** | err | ||
) | [read] |
execute a readdir for the given file handle on the appropriate plugin
int gfal_plugin_readG | ( | gfal_handle | handle, |
gfal_file_handle | fh, | ||
void * | buff, | ||
size_t | s_buff, | ||
GError ** | err | ||
) |
do a read operation on the plugin, read s_buff chars on the fd device
Referenced by gfal_posix_gfalfilehandle_read().
ssize_t gfal_plugin_readlinkG | ( | gfal_handle | handle, |
const char * | path, | ||
char * | buff, | ||
size_t | buffsiz, | ||
GError ** | err | ||
) |
Execute a readlink function
Referenced by gfal_posix_internal_readlink().
int gfal_plugin_renameG | ( | gfal_handle | handle, |
const char * | oldpath, | ||
const char * | newpath, | ||
GError ** | err | ||
) |
Execute the rename function on the first compatible plugin ( checked with check_url func )
int gfal_plugin_rmdirG | ( | gfal_handle | handle, |
const char * | path, | ||
GError ** | err | ||
) |
Execute a rmdir function on the first compatible plugin ( checked with check url func )
handle | handle of the current context |
path | path to delete |
GError | error report system |
Referenced by gfal_posix_internal_rmdir().
int gfal_plugin_setxattrG | ( | gfal_handle | handle, |
const char * | path, | ||
const char * | name, | ||
const void * | value, | ||
size_t | size, | ||
int | flags, | ||
GError ** | err | ||
) |
setxattr for the plugins
References _gfal_plugin_interface::setxattrG.
Referenced by gfal_posix_internal_setxattr().
ssize_t gfal_plugin_simulate_preadG | ( | gfal_handle | handle, |
gfal_plugin_interface * | if_cata, | ||
gfal_file_handle | fh, | ||
void * | buff, | ||
size_t | s_buff, | ||
off_t | offset, | ||
GError ** | err | ||
) | [inline] |
Execute an atomic thread-safe read on a file descriptor with a given offset simulate the feature of pread for plugins with no support of it
Referenced by gfal_plugin_preadG().
ssize_t gfal_plugin_simulate_pwriteG | ( | gfal_handle | handle, |
gfal_plugin_interface * | if_cata, | ||
gfal_file_handle | fh, | ||
void * | buff, | ||
size_t | s_buff, | ||
off_t | offset, | ||
GError ** | err | ||
) | [inline] |
Execute an atomic thread-safe write on a file descriptor with a given offset simulate the feature of pwrite for plugins with no support of it
Referenced by gfal_plugin_pwriteG().
int gfal_plugin_statG | ( | gfal_handle | handle, |
const char * | path, | ||
struct stat * | st, | ||
GError ** | err | ||
) |
Execute a stat function on the lfc plugin
Referenced by gfal_posix_internal_stat().
int gfal_plugin_symlinkG | ( | gfal_handle | handle, |
const char * | oldpath, | ||
const char * | newpath, | ||
GError ** | err | ||
) |
Execute the symlink function on the first compatible plugin
Referenced by gfal_posix_internal_symlink().
int gfal_plugin_unlinkG | ( | gfal_handle | handle, |
const char * | path, | ||
GError ** | err | ||
) |
apply unlink on the appropriate plugin
References _gfal_plugin_interface::unlinkG.
Referenced by gfal_posix_internal_unlink().
int gfal_plugin_writeG | ( | gfal_handle | handle, |
gfal_file_handle | fh, | ||
void * | buff, | ||
size_t | s_buff, | ||
GError ** | err | ||
) |
do a write operation on the plugin, write s_buff chars on the fd device
Referenced by gfal_posix_gfalfilehandle_write().
int gfal_plugins_accessG | ( | gfal_handle | handle, |
const char * | path, | ||
int | mode, | ||
GError ** | err | ||
) |
Execute an access function on the first plugin compatible in the plugin list return the result of the first valid plugin for a given URL
References _gfal_plugin_interface::accessG.
int gfal_plugins_delete | ( | gfal_handle | handle, |
GError ** | err | ||
) |
Delete all instance of plugins
References _gfal_plugin_interface::plugin_delete.
Referenced by gfal_handle_freeG().
char** gfal_plugins_get_list | ( | gfal_handle | handle, |
GError ** | err | ||
) |
external function to get the list of the plugins loaded
References gfal_plugins_instance().
int gfal_plugins_has_parameter | ( | gfal_handle | handle, |
const char * | namespace, | ||
const char * | key, | ||
GError ** | err | ||
) |
Check if a parameter key is used by a plugin or not
References gfal_plugins_instance(), and _gfal_plugin_interface::is_used_parameter.
Referenced by gfal_common_parameter_set_string().
int gfal_plugins_instance | ( | gfal_handle | handle, |
GError ** | err | ||
) | [inline] |
Instance all plugins for use if it's not the case return the number of plugin available
References gfal_modules_resolve().
Referenced by gfal_plugins_get_list(), gfal_search_plugin_with_name(), gfal_plugins_list_handler(), gfal_plugins_has_parameter(), and gfal_plugins_notify_all().
plugin_pointer_handle gfal_plugins_list_handler | ( | gfal_handle | , |
GError ** | err | ||
) |
plugins walker provide a list of plugin handlers, each plugin handler is a reference to an usable plugin
References gfal_plugins_instance().
int gfal_plugins_notify_all | ( | gfal_handle | handle, |
const char * | namespace, | ||
const char * | key, | ||
GError ** | err | ||
) |
Notify all the plugins of a change on a given parameter plugins must ignore and return 0 if this key is not used, or if it is a correct change they must return -1 and GError if an error occures with the new value
References gfal_plugins_instance(), and _gfal_plugin_interface::notify_change_parameter.
Referenced by gfal_common_parameter_set_string().
gfal_plugin_interface* gfal_search_plugin_with_name | ( | gfal_handle | handle, |
const char * | name, | ||
GError ** | err | ||
) |
external function to return a gfal_plugin_interface from a given plugin name
References gfal_plugins_instance().