CERN GFAL 2.0 2.0.1
Data Fields
_gfal_plugin_interface Struct Reference

#include <gfal_common_plugin_interface.h>

Data Fields

plugin_handle plugin_data
const char *(* getName )()
void(* plugin_delete )(plugin_handle plugin_data)
gboolean(* check_plugin_url )(plugin_handle plugin_data, const char *url, plugin_mode operation, GError **err)
int(* accessG )(plugin_handle plugin_data, const char *url, int mode, GError **err)
int(* chmodG )(plugin_handle plugin_data, const char *url, mode_t mode, GError **err)
int(* renameG )(plugin_handle plugin_data, const char *oldurl, const char *urlnew, GError **err)
int(* symlinkG )(plugin_handle plugin_data, const char *oldurl, const char *newold, GError **err)
int(* statG )(plugin_handle plugin_data, const char *url, struct stat *buf, GError **err)
int(* lstatG )(plugin_handle plugin_data, const char *url, struct stat *buf, GError **err)
ssize_t(* readlinkG )(plugin_handle plugin_data, const char *url, char *buff, size_t buffsiz, GError **)
gfal_file_handle(* opendirG )(plugin_handle plugin_data, const char *url, GError **err)
int(* closedirG )(plugin_handle plugin_data, gfal_file_handle dir_desc, GError **err)
struct dirent *(* readdirG )(plugin_handle plugin_data, gfal_file_handle dir_desc, GError **err)
int(* mkdirpG )(plugin_handle plugin_data, const char *url, mode_t, gboolean pflag, GError **err)
int(* rmdirG )(plugin_handle plugin_data, const char *url, GError **err)
gfal_file_handle(* openG )(plugin_handle plugin_data, const char *url, int flag, mode_t mode, GError **)
int(* readG )(plugin_handle, gfal_file_handle fd, void *buff, size_t count, GError **)
int(* writeG )(plugin_handle, gfal_file_handle fd, void *buff, size_t count, GError **)
int(* closeG )(plugin_handle, gfal_file_handle fd, GError **)
int(* lseekG )(plugin_handle, gfal_file_handle fd, off_t offset, int whence, GError **err)
ssize_t(* preadG )(plugin_handle, gfal_file_handle fd, void *buff, size_t count, off_t offset, GError **)
ssize_t(* pwriteG )(plugin_handle, gfal_file_handle fd, const void *buff, size_t count, off_t offset, GError **)
int(* unlinkG )(plugin_handle plugin_data, const char *url, GError **err)
ssize_t(* getxattrG )(plugin_handle plugin_data, const char *url, const char *key, void *buff, size_t s_buff, GError **err)
ssize_t(* listxattrG )(plugin_handle plugin_data, const char *url, char *list, size_t s_list, GError **err)
int(* setxattrG )(plugin_handle plugin_data, const char *url, const char *key, const void *buff, size_t s_buff, int flags, GError **err)
int(* is_used_parameter )(plugin_handle, const char *namespacep, const char *key)
void(* notify_change_parameter )(plugin_handle, const char *namespacep, const char *key)

Detailed Description

Main interface that MUST be returned the entry point function "gfal_plugin_init" of each GFAL 2.0 plugin. the minimum calls are : getName, plugin_delete, check_plugin_url all the unused function pointers must be set to NULL


Field Documentation

int(* _gfal_plugin_interface::accessG)(plugin_handle plugin_data, const char *url, int mode, GError **err)

OPTIONAL : gfal_access function support

Parameters:
plugin_data: internal plugin data
url: URL for access checking
mode: mode to check ( see man 2 access )
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 or -1 if error occures, err MUST be set in case of error
gboolean(* _gfal_plugin_interface::check_plugin_url)(plugin_handle plugin_data, const char *url, plugin_mode operation, GError **err)

MANDATORY: Main critical function of the plugins, URL checker. check the availability of the given operation on this plugin for the given URL

This function is used by gfal 2.0 to determine which plugin need to be contacted for a given operation

Warning:
This function is a key function of GFAL 2.0, It MUST be as fast as possible.
Parameters:
plugin_data: internal plugin data
url: URL to check for the protocol compatibility
operation: operation to check
err: error handle, should be used ONLY in case of major failure.
Returns:
must return TRUE if the operation is compatible with this plugin, else FALSE
int(* _gfal_plugin_interface::chmodG)(plugin_handle plugin_data, const char *url, mode_t mode, GError **err)

OPTIONAL : gfal_chmod function support

Parameters:
plugin_data: internal plugin data
url: URL of the file
mode: mode to set
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::closedirG)(plugin_handle plugin_data, gfal_file_handle dir_desc, GError **err)

MANDATORY IF OPENDIR : gfal_closedir function support

Parameters:
plugin_data: internal plugin data
dir_desc: directory descriptor to use
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 in case of success or -1 if error, err MUST be set in case of error
int(* _gfal_plugin_interface::closeG)(plugin_handle, gfal_file_handle fd, GError **)

MANDATORY IF OPEN : gfal_close function support

MANDATORY : return a the string id of the plugin. string id must be short, constant and unique ( ex : "plugin_gridftp" )

Returns:
the constant identity string
ssize_t(* _gfal_plugin_interface::getxattrG)(plugin_handle plugin_data, const char *url, const char *key, void *buff, size_t s_buff, GError **err)

OPTIONAL : gfal_getxattr function support

Parameters:
plugin_data: internal plugin data
url: url of the file to delete
key: key of the attribute to get
buff: buffer for the attribute content
s_buff: maximum buffer size
err: Error report, the code field of err should be set to errno value when possible
Returns:
size of the attribute in case of success or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::is_used_parameter)(plugin_handle, const char *namespacep, const char *key)

this function is called to inform plugin of a new parameter must return 1 if this parameter is used by the plugin else return 0

Warning:
must be a NULL pointer if not used
ssize_t(* _gfal_plugin_interface::listxattrG)(plugin_handle plugin_data, const char *url, char *list, size_t s_list, GError **err)

OPTIONAL : gfal_listxattr function support

Parameters:
plugin_data: internal plugin data
url: url of the file to delete
list: buffer for the list attribute content
s_buff: maximum buffer size
s_list: Error report, the code field of err should be set to errno value when possible
Returns:
size of the list in case of success or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::lseekG)(plugin_handle, gfal_file_handle fd, off_t offset, int whence, GError **err)

MANDATORY IF OPEN : gfal_lseek function support

int(* _gfal_plugin_interface::lstatG)(plugin_handle plugin_data, const char *url, struct stat *buf, GError **err)

OPTIONAL : gfal_lstat function support In case of non support for this function, calls to gfal_lstat are mapped to gfal_stat.

Parameters:
plugin_data: internal plugin data
url: url to stat
buf: informations of the file
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::mkdirpG)(plugin_handle plugin_data, const char *url, mode_t, gboolean pflag, GError **err)

OPTIONAL : gfal_mkdir function support

Parameters:
plugin_data: internal plugin data
url: url of the directory to create
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 in case of success or -1 if error occures, err MUST be set in case of error
void(* _gfal_plugin_interface::notify_change_parameter)(plugin_handle, const char *namespacep, const char *key)

called when a change occures on a parameter push the information to the plugins to check the new value associated with the key, call gfal_get_*_parameter functions

Warning:
must be a NULL pointer if not used
Returns:
0 if parameter changed or if no parameter triggered, -1 if major error with the new parameter
gfal_file_handle(* _gfal_plugin_interface::opendirG)(plugin_handle plugin_data, const char *url, GError **err)

OPTIONAL : gfal_opendir function support

Parameters:
plugin_data: internal plugin data
url: url of directory to list
err: Error report, the code field of err should be set to errno value when possible
Returns:
gfa_file_handle in case of success or NULL if error, err MUST be set in case of error
gfal_file_handle(* _gfal_plugin_interface::openG)(plugin_handle plugin_data, const char *url, int flag, mode_t mode, GError **)

OPTIONAL : gfal_open function support

Parameters:
plugin_data: internal plugin data
url: url of the directory to open
flag: open flags
mode: mode of the file, in case of creation
err: Error report, the code field of err should be set to errno value when possible
Returns:
gfal_file_handle in case of success or NULL if error occures, err MUST be set in case of error

plugin reserved pointer, free to use for plugin's personnal datas

OPTIONAL : Last call before the unload of the plugin for the associated handle You can use this to clear your internal context

Parameters:
plugin_data: internal plugin data
ssize_t(* _gfal_plugin_interface::preadG)(plugin_handle, gfal_file_handle fd, void *buff, size_t count, off_t offset, GError **)

OPTIONAL : gfal_pread function support

Allow fast parallels read support, If not implemented, this function is simulated by GFAL 2.0

ssize_t(* _gfal_plugin_interface::pwriteG)(plugin_handle, gfal_file_handle fd, const void *buff, size_t count, off_t offset, GError **)

OPTIONAL : gfal_pwriteG function support

Allow fast parallels write support, If not implemented, this function is simulated by GFAL 2.0

struct dirent*(* _gfal_plugin_interface::readdirG)(plugin_handle plugin_data, gfal_file_handle dir_desc, GError **err) [read]

MANDATORY IF OPENDIR : gfal_readdir function support

Parameters:
plugin_data: internal plugin data
dir_desc: directory descriptor to use
err: Error report, the code field of err should be set to errno value when possible
Returns:
dirent information in case of success or NULL if end of listing or error, err MUST be set in case of error
int(* _gfal_plugin_interface::readG)(plugin_handle, gfal_file_handle fd, void *buff, size_t count, GError **)

MANDATORY IF OPEN : gfal_read function support

ssize_t(* _gfal_plugin_interface::readlinkG)(plugin_handle plugin_data, const char *url, char *buff, size_t buffsiz, GError **)

OPTIONAL : gfal_readlink function support

Parameters:
plugin_data: internal plugin data
url: url to stat
buff: buffer for the readlink result
size_t: buffsize maximum size to fill in the buffer
err: Error report, the code field of err should be set to errno value when possible
Returns:
number of bytes in buff in case of success or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::renameG)(plugin_handle plugin_data, const char *oldurl, const char *urlnew, GError **err)

OPTIONAL : gfal_rename function support

Parameters:
plugin_data: internal plugin data
oldurl: old url of the file
urlnew: new url of the file
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::rmdirG)(plugin_handle plugin_data, const char *url, GError **err)

OPTIONAL : gfal_rmdir function support

Parameters:
plugin_data: internal plugin data
url: url of the directory to delete
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 in case of success or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::setxattrG)(plugin_handle plugin_data, const char *url, const char *key, const void *buff, size_t s_buff, int flags, GError **err)

OPTIONAL : gfal_setxattr function support

Parameters:
plugin_data: internal plugin data
url: url of the file to delete
key: key of the attribute to set
buff: buffer for the attribute content
s_buff: maximum buffer size
flas: set/get flags
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::statG)(plugin_handle plugin_data, const char *url, struct stat *buf, GError **err)

MANDATORY : gfal_stat function support

Parameters:
plugin_data: internal plugin data
url: url to stat
buf: informations of the file
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::symlinkG)(plugin_handle plugin_data, const char *oldurl, const char *newold, GError **err)

OPTIONAL : gfal_symlink function support

Parameters:
plugin_data: internal plugin data
oldurl: old url of the file
urlnew: symlink to create
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::unlinkG)(plugin_handle plugin_data, const char *url, GError **err)

OPTIONAL : gfal_unlink function support

Parameters:
plugin_data: internal plugin data
url: url of the file to delete
err: Error report, the code field of err should be set to errno value when possible
Returns:
0 in case of success or -1 if error occures, err MUST be set in case of error
int(* _gfal_plugin_interface::writeG)(plugin_handle, gfal_file_handle fd, void *buff, size_t count, GError **)

MANDATORY IF OPEN : gfal_write function support


The documentation for this struct was generated from the following file: