GFAL2 2.22.1
Functions
Parameter API

Functions

gchar * gfal2_get_opt_string (gfal2_context_t context, const gchar *group_name, const gchar *key, GError **error)
 get a string parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values
 
gchar * gfal2_get_opt_string_with_default (gfal2_context_t handle, const gchar *group_name, const gchar *key, const gchar *default_value)
 similar to gfal2_get_opt_string but return a default value if an error occurs
 
gint gfal2_set_opt_string (gfal2_context_t context, const gchar *group_name, const gchar *key, const gchar *value, GError **error)
 set a string parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values
 
gint gfal2_get_opt_integer (gfal2_context_t context, const gchar *group_name, const gchar *key, GError **error)
 get an integer parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values
 
gint gfal2_get_opt_integer_with_default (gfal2_context_t handle, const gchar *group_name, const gchar *key, gint default_value)
 similar to gfal2_get_opt_integer but return a default value if an error occurs
 
gint gfal2_set_opt_integer (gfal2_context_t context, const gchar *group_name, const gchar *key, gint value, GError **error)
 set an integer parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values
 
gint gfal2_set_opt_boolean (gfal2_context_t context, const gchar *group_name, const gchar *key, gboolean value, GError **error)
 set a boolean parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values
 
gboolean gfal2_get_opt_boolean (gfal2_context_t context, const gchar *group_name, const gchar *key, GError **error)
 get a boolean parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values
 
gboolean gfal2_get_opt_boolean_with_default (gfal2_context_t context, const gchar *group_name, const gchar *key, gboolean default_value)
 similar to gfal2_get_opt_boolean but return a default value if an error occures
 
gint gfal2_set_opt_string_list (gfal2_context_t context, const gchar *group_name, const gchar *key, const gchar *const list[], gsize length, GError **error)
 set a list of string parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values
 
gchar ** gfal2_get_opt_string_list (gfal2_context_t context, const gchar *group_name, const gchar *key, gsize *length, GError **error)
 get a list of string parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values
 
gchar ** gfal2_get_opt_string_list_with_default (gfal2_context_t context, const gchar *group_name, const gchar *key, gsize *length, char **default_value)
 get a list of string parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values
 
gint gfal2_load_opts_from_file (gfal2_context_t context, const char *path, GError **error)
 load configuration parameters from the file specified by path
 
gchar ** gfal2_get_opt_keys (gfal2_context_t context, const gchar *group_name, gsize *length, GError **error)
 
gboolean gfal2_remove_opt (gfal2_context_t context, const gchar *group_name, const gchar *key, GError **error)
 
gint gfal2_set_user_agent (gfal2_context_t handle, const char *user_agent, const char *version, GError **error)
 
gint gfal2_get_user_agent (gfal2_context_t handle, const char **user_agent, const char **version)
 
gint gfal2_add_client_info (gfal2_context_t handle, const char *key, const char *value, GError **error)
 
gint gfal2_remove_client_info (gfal2_context_t handle, const char *key, GError **error)
 
gint gfal2_clear_client_info (gfal2_context_t handle, GError **error)
 
gint gfal2_get_client_info_count (gfal2_context_t handle, GError **error)
 
gint gfal2_get_client_info_pair (gfal2_context_t handle, int index, const char **key, const char **value, GError **error)
 
gint gfal2_get_client_info_value (gfal2_context_t handle, const char *key, const char **value, GError **error)
 
char * gfal2_get_client_info_string (gfal2_context_t handle)
 

Detailed Description

Allows to overwrite or/and define any parameter of gfal2. A complete list of parameter is accessible in the gfal2 configuration files directory ( by default : /etc/gfal2.d/ )

Example ( enable IPv6 support for the gridFTP plugin ) : gfal2_set_opt_boolean("GRIDFTP PLUGIN", "IPV6", true, NULL);

Function Documentation

◆ gfal2_add_client_info()

gint gfal2_add_client_info ( gfal2_context_t  handle,
const char *  key,
const char *  value,
GError **  error 
)

Add a new key/value pair with additional information to be passed to the storage for protocols that support it. For instance, this will be passed via CLIENTINFO for GridFTP, or the ClientInfo header for SRM and HTTP Return < 0 on error

◆ gfal2_clear_client_info()

gint gfal2_clear_client_info ( gfal2_context_t  handle,
GError **  error 
)

Clear the client information Return < 0 on error

◆ gfal2_get_client_info_count()

gint gfal2_get_client_info_count ( gfal2_context_t  handle,
GError **  error 
)

Return how many custom pairs have been set Return < 0 on error

◆ gfal2_get_client_info_pair()

gint gfal2_get_client_info_pair ( gfal2_context_t  handle,
int  index,
const char **  key,
const char **  value,
GError **  error 
)

Put into key and value the pair at position index, or NULL if it does not exist Return < 0 on error

◆ gfal2_get_client_info_string()

char * gfal2_get_client_info_string ( gfal2_context_t  handle)

For convenience, return all the key/value information in the form key1=value1;key2=value2 The return value is NULL if there is no information. Otherwise, use g_free on it when done.

◆ gfal2_get_client_info_value()

gint gfal2_get_client_info_value ( gfal2_context_t  handle,
const char *  key,
const char **  value,
GError **  error 
)

Put into value the value associated with the given key Return < 0 on error

◆ gfal2_get_opt_boolean()

gboolean gfal2_get_opt_boolean ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
GError **  error 
)

get a boolean parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values

Parameters
context: context of gfal2
group_name: group name of the parameter
key: key of the parameter
error: GError error report system
Returns
parameter value

◆ gfal2_get_opt_boolean_with_default()

gboolean gfal2_get_opt_boolean_with_default ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
gboolean  default_value 
)

similar to gfal2_get_opt_boolean but return a default value if an error occures

Parameters
context: context of gfal2
group_name: group name of the parameter
key: key of the parameter
default_value: default value returned if not present
Returns
parameter value

◆ gfal2_get_opt_integer()

gint gfal2_get_opt_integer ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
GError **  error 
)

get an integer parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values

Parameters
context: context of gfal2
group_name: group name of the parameter
key: key of the parameter
error: GError error report system
Returns
parameter value

◆ gfal2_get_opt_integer_with_default()

gint gfal2_get_opt_integer_with_default ( gfal2_context_t  handle,
const gchar *  group_name,
const gchar *  key,
gint  default_value 
)

similar to gfal2_get_opt_integer but return a default value if an error occurs

Parameters
handle: context of gfal2
group_name: group name of the parameter
key: key of the parameter
default_value: default value returned if not present
Returns
parameter value

◆ gfal2_get_opt_keys()

gchar ** gfal2_get_opt_keys ( gfal2_context_t  context,
const gchar *  group_name,
gsize *  length,
GError **  error 
)

Get all keys defined for the given group_name

Parameters
context: context of gfal2
group_name: group name of the parameters
length: the number of keys is stored here
error: GError error report system
Returns
NULL on error. A NULL-terminated array with the list of keys. Use g_strfreev() to free it.

◆ gfal2_get_opt_string()

gchar * gfal2_get_opt_string ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
GError **  error 
)

get a string parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values

Parameters
context: context of gfal2
group_name: group name of the parameter
key: key of the parameter
error: GError error report system
Returns
parameter value. Must be freed using g_free

◆ gfal2_get_opt_string_list()

gchar ** gfal2_get_opt_string_list ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
gsize *  length,
GError **  error 
)

get a list of string parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values

Parameters
context: context of gfal2
group_name: group name of the parameter
key: key of the parameter
length: the length of the string is stored here
error: GError error report system
Returns
parameter value

◆ gfal2_get_opt_string_list_with_default()

gchar ** gfal2_get_opt_string_list_with_default ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
gsize *  length,
char **  default_value 
)

get a list of string parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values

Parameters
context: context of gfal2
group_name: group name of the parameter
key: key of the parameter
length: the length of the string is stored here
default_value: Default array of not found
Returns
parameter value

◆ gfal2_get_opt_string_with_default()

gchar * gfal2_get_opt_string_with_default ( gfal2_context_t  handle,
const gchar *  group_name,
const gchar *  key,
const gchar *  default_value 
)

similar to gfal2_get_opt_string but return a default value if an error occurs

Parameters
handle: context of gfal2
group_name: group name of the parameter
key: key of the parameter
default_value: Default value
Returns
parameter value. Must be freed using g_free

◆ gfal2_get_user_agent()

gint gfal2_get_user_agent ( gfal2_context_t  handle,
const char **  user_agent,
const char **  version 
)

Returns the user agent and version specified before with gfal2_set_user_agent Leave user_agent and version to NULL if not found

◆ gfal2_remove_client_info()

gint gfal2_remove_client_info ( gfal2_context_t  handle,
const char *  key,
GError **  error 
)

Removes a key/value pair set previously with gfal2_add_client_info Return < 0 on error

◆ gfal2_remove_opt()

gboolean gfal2_remove_opt ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
GError **  error 
)

Removes a key from the settings

Parameters
context: context of gfal2
group_name: group name of the parameters
key: key of the parameter
error: GError error report system
Returns
TRUE if the key was removed, FALSE otherwise

◆ gfal2_set_opt_boolean()

gint gfal2_set_opt_boolean ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
gboolean  value,
GError **  error 
)

set a boolean parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values

Parameters
context: context of gfal2
group_name: group name of the parameter
key: key of the parameter
value: value to set
error: GError error report system
Returns
parameter value

◆ gfal2_set_opt_integer()

gint gfal2_set_opt_integer ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
gint  value,
GError **  error 
)

set an integer parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values

Parameters
context: context of gfal2
group_name: group name of the parameter
key: key of the parameter
value: value to set
error: GError error report system
Returns
parameter value

◆ gfal2_set_opt_string()

gint gfal2_set_opt_string ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
const gchar *  value,
GError **  error 
)

set a string parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values

Parameters
context: context of gfal2
group_name: group name of the parameter
key: key of the parameter
value: value to set
error: GError error report system
Returns
parameter value

◆ gfal2_set_opt_string_list()

gint gfal2_set_opt_string_list ( gfal2_context_t  context,
const gchar *  group_name,
const gchar *  key,
const gchar *const  list[],
gsize  length,
GError **  error 
)

set a list of string parameter in the current GFAL 2.0 configuration see gfal2.d configuration files or gfal2 documentation to know group/key/values

Parameters
context: context of gfal2
group_name: group name of the parameter
key: key of the parameter
list: list of strings
length: length of the list
error: GError error report system
Returns
parameter value

◆ gfal2_set_user_agent()

gint gfal2_set_user_agent ( gfal2_context_t  handle,
const char *  user_agent,
const char *  version,
GError **  error 
)

Set the user agent for those protocols that support this