/usr/include/gfal2/common/gfal_config.h is in libgfal2-dev 2.15.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | /*
* Copyright (c) CERN 2013-2017
*
* Copyright (c) Members of the EMI Collaboration. 2010-2013
* See http://www.eu-emi.eu/partners for details on the copyright
* holders.
*
* 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.
*/
#pragma once
#ifndef GFAL_CONFIG_H_
#define GFAL_CONFIG_H_
#if !defined(__GFAL2_H_INSIDE__) && !defined(__GFAL2_BUILD__)
# warning "Direct inclusion of gfal2 headers is deprecated. Please, include only gfal_api.h or gfal_plugins_api.h"
#endif
#include "gfal_common.h"
#ifdef __cplusplus
extern "C"
{
#endif
#define CORE_CONFIG_GROUP "CORE"
#define CORE_CONFIG_CHECKSUM_TIMEOUT "CHECKSUM_TIMEOUT"
#define CORE_CONFIG_NAMESPACE_TIMEOUT "NAMESPACE_TIMEOUT"
/**
* @file gfal_config.h
* @brief gfal2 configuration API
* set/get option for the running configuration of GFAL 2.0
* @author Adrien Devresse
*/
/*!
\defgroup config_group Parameter API
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);
*/
/*!
\addtogroup config_group
@{
*/
/**
* @brief get a string parameter in the current GFAL 2.0 configuration
* see gfal2.d configuration files or gfal2 documentation to know group/key/values
*
* @param context : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param error : GError error report system
* @return parameter value. Must be freed using g_free
**/
gchar * gfal2_get_opt_string(gfal2_context_t context, const gchar *group_name,
const gchar *key, GError **error);
/**
* @brief similar to \ref gfal2_get_opt_string but return a default value if
* an error occurs
*
* @param handle : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param default_value : Default value
* @return parameter value. Must be freed using g_free
**/
gchar * gfal2_get_opt_string_with_default(gfal2_context_t handle, const gchar *group_name,
const gchar *key, const gchar* default_value);
/**
* @brief set a string parameter in the current GFAL 2.0 configuration
* see gfal2.d configuration files or gfal2 documentation to know group/key/values
*
* @param context : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param value : value to set
* @param error : GError error report system
* @return parameter value
**/
gint gfal2_set_opt_string(gfal2_context_t context, const gchar *group_name,
const gchar *key, const gchar* value, GError **error);
/**
* @brief get an integer parameter in the current GFAL 2.0 configuration
* see gfal2.d configuration files or gfal2 documentation to know group/key/values
*
* @param context : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param error : GError error report system
* @return parameter value
**/
gint gfal2_get_opt_integer(gfal2_context_t context, const gchar *group_name,
const gchar *key, GError **error);
/**
* @brief similar to \ref gfal2_get_opt_integer but return a default value if
* an error occurs
*
* @param handle : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param default_value : default value returned if not present
* @return parameter value
**/
gint gfal2_get_opt_integer_with_default(gfal2_context_t handle, const gchar *group_name,
const gchar *key, gint default_value);
/**
* @brief set an integer parameter in the current GFAL 2.0 configuration
* see gfal2.d configuration files or gfal2 documentation to know group/key/values
*
* @param context : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param value : value to set
* @param error : GError error report system
* @return parameter value
**/
gint gfal2_set_opt_integer(gfal2_context_t context, const gchar *group_name,
const gchar *key, gint value,
GError** error);
/**
* @brief set a boolean parameter in the current GFAL 2.0 configuration
* see gfal2.d configuration files or gfal2 documentation to know group/key/values
*
* @param context : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param value : value to set
* @param error : GError error report system
* @return parameter value
**/
gint gfal2_set_opt_boolean(gfal2_context_t context, const gchar *group_name,
const gchar *key, gboolean value, GError **error);
/**
* @brief get a boolean parameter in the current GFAL 2.0 configuration
* see gfal2.d configuration files or gfal2 documentation to know group/key/values
*
* @param context : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param error : GError error report system
* @return parameter value
**/
gboolean gfal2_get_opt_boolean(gfal2_context_t context, const gchar *group_name,
const gchar *key, GError **error);
/**
* @brief similar to \ref gfal2_get_opt_boolean but return a default value if
* an error occures
*
* @param context : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param default_value : default value returned if not present
* @return parameter value
**/
gboolean gfal2_get_opt_boolean_with_default(gfal2_context_t context, const gchar *group_name,
const gchar *key, gboolean default_value);
/**
* @brief 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
*
* @param context : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param list : list of strings
* @param length : length of the list
* @param error : GError error report system
* @return parameter value
**/
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);
/**
* @brief 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
*
* @param context : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param length : the length of the string is stored here
* @param error : GError error report system
* @return parameter value
**/
gchar ** gfal2_get_opt_string_list(gfal2_context_t context, const gchar *group_name,
const gchar *key, gsize *length, GError **error);
/**
* @brief 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
*
* @param context : context of gfal2
* @param group_name : group name of the parameter
* @param key : key of the parameter
* @param length : the length of the string is stored here
* @param default_value : Default array of not found
* @return parameter value
**/
gchar ** gfal2_get_opt_string_list_with_default(gfal2_context_t context, const gchar *group_name,
const gchar *key, gsize *length, char** default_value);
/**
* @brief load configuration parameters from the file specified by path
*/
gint gfal2_load_opts_from_file(gfal2_context_t context, const char* path, GError** error);
/**
* Get all keys defined for the given group_name
* @param context : context of gfal2
* @param group_name : group name of the parameters
* @param length : the number of keys is stored here
* @param error : GError error report system
* @return NULL on error. A NULL-terminated array with the list of keys. Use g_strfreev() to free it.
*/
gchar **gfal2_get_opt_keys(gfal2_context_t context, const gchar *group_name, gsize *length, GError **error);
/**
* Removes a key from the settings
* @param context : context of gfal2
* @param group_name : group name of the parameters
* @param key : key of the parameter
* @param error : GError error report system
* @return TRUE if the key was removed, FALSE otherwise
*/
gboolean gfal2_remove_opt(gfal2_context_t context, const gchar *group_name,
const gchar *key, GError **error);
/**
* Set the user agent for those protocols that support this
*/
gint gfal2_set_user_agent(gfal2_context_t handle, const char* user_agent,
const char* version, GError** error);
/**
* Returns the user agent and version specified before with gfal2_set_user_agent
* Leave user_agent and version to NULL if not found
*/
gint gfal2_get_user_agent(gfal2_context_t handle, const char** user_agent,
const char** version);
/**
* 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
*/
gint gfal2_add_client_info(gfal2_context_t handle, const char* key, const char* value, GError** error);
/**
* Removes a key/value pair set previously with gfal2_add_client_info
* Return < 0 on error
*/
gint gfal2_remove_client_info(gfal2_context_t handle, const char* key, GError** error);
/**
* Clear the client information
* Return < 0 on error
*/
gint gfal2_clear_client_info(gfal2_context_t handle, GError** error);
/**
* Return how many custom pairs have been set
* Return < 0 on error
*/
gint gfal2_get_client_info_count(gfal2_context_t handle, GError** error);
/**
* Put into key and value the pair at position index, or NULL if it does not exist
* Return < 0 on error
*/
gint gfal2_get_client_info_pair(gfal2_context_t handle, int index, const char** key,
const char** value, GError** error);
/**
* Put into value the value associated with the given key
* Return < 0 on error
*/
gint gfal2_get_client_info_value(gfal2_context_t handle, const char* key, const char** value, GError** error);
/**
* 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.
*/
char* gfal2_get_client_info_string(gfal2_context_t handle);
/**
@}
End of the FILE group
*/
#ifdef __cplusplus
}
#endif
#endif /* GFAL_CONFIG_H_ */
|