Subversion
|
Accessing SVN configuration files. More...
#include <apr.h>
#include <apr_pools.h>
#include <apr_hash.h>
#include "svn_types.h"
#include "svn_io.h"
Go to the source code of this file.
Macros | |
#define | SVN_CONFIG_DEFAULT_GLOBAL_IGNORES |
#define | SVN_CONFIG_TRUE "TRUE" |
#define | SVN_CONFIG_FALSE "FALSE" |
#define | SVN_CONFIG_ASK "ASK" |
#define | SVN_CONFIG_DEFAULT_OPTION_STORE_PASSWORDS TRUE |
#define | SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS SVN_CONFIG_ASK |
#define | SVN_CONFIG_DEFAULT_OPTION_STORE_AUTH_CREDS TRUE |
#define | SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP TRUE |
#define | SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT SVN_CONFIG_ASK |
#define | SVN_CONFIG_DEFAULT_OPTION_HTTP_MAX_CONNECTIONS 4 |
#define | SVN_CONFIG_REALMSTRING_KEY "svn:realmstring" |
A hash-key pointing to a realmstring. More... | |
#define | SVN_CONFIG_AUTHN_USERNAME_KEY "username" |
A hash-key for usernames. More... | |
#define | SVN_CONFIG_AUTHN_PASSWORD_KEY "password" |
A hash-key for passwords. More... | |
#define | SVN_CONFIG_AUTHN_PASSPHRASE_KEY "passphrase" |
A hash-key for passphrases, such as SSL client ceritifcate passphrases. More... | |
#define | SVN_CONFIG_AUTHN_PASSTYPE_KEY "passtype" |
A hash-key for the type of a password or passphrase. More... | |
#define | SVN_CONFIG_AUTHN_ASCII_CERT_KEY "ascii_cert" |
A hash-key for SSL certificates. More... | |
#define | SVN_CONFIG_AUTHN_FAILURES_KEY "failures" |
A hash-key for recorded SSL certificate verification failures. More... | |
Client configuration files strings | |
Strings for the names of files, sections, and options in the client configuration files. | |
#define | SVN_CONFIG_CATEGORY_SERVERS "servers" |
#define | SVN_CONFIG_SECTION_GROUPS "groups" |
#define | SVN_CONFIG_SECTION_GLOBAL "global" |
#define | SVN_CONFIG_OPTION_HTTP_PROXY_HOST "http-proxy-host" |
#define | SVN_CONFIG_OPTION_HTTP_PROXY_PORT "http-proxy-port" |
#define | SVN_CONFIG_OPTION_HTTP_PROXY_USERNAME "http-proxy-username" |
#define | SVN_CONFIG_OPTION_HTTP_PROXY_PASSWORD "http-proxy-password" |
#define | SVN_CONFIG_OPTION_HTTP_PROXY_EXCEPTIONS "http-proxy-exceptions" |
#define | SVN_CONFIG_OPTION_HTTP_TIMEOUT "http-timeout" |
#define | SVN_CONFIG_OPTION_HTTP_COMPRESSION "http-compression" |
#define | SVN_CONFIG_OPTION_NEON_DEBUG_MASK "neon-debug-mask" |
#define | SVN_CONFIG_OPTION_HTTP_AUTH_TYPES "http-auth-types" |
#define | SVN_CONFIG_OPTION_SSL_AUTHORITY_FILES "ssl-authority-files" |
#define | SVN_CONFIG_OPTION_SSL_TRUST_DEFAULT_CA "ssl-trust-default-ca" |
#define | SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE "ssl-client-cert-file" |
#define | SVN_CONFIG_OPTION_SSL_CLIENT_CERT_PASSWORD "ssl-client-cert-password" |
#define | SVN_CONFIG_OPTION_SSL_PKCS11_PROVIDER "ssl-pkcs11-provider" |
#define | SVN_CONFIG_OPTION_HTTP_LIBRARY "http-library" |
#define | SVN_CONFIG_OPTION_STORE_PASSWORDS "store-passwords" |
#define | SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS "store-plaintext-passwords" |
#define | SVN_CONFIG_OPTION_STORE_AUTH_CREDS "store-auth-creds" |
#define | SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP "store-ssl-client-cert-pp" |
#define | SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT "store-ssl-client-cert-pp-plaintext" |
#define | SVN_CONFIG_OPTION_USERNAME "username" |
#define | SVN_CONFIG_OPTION_HTTP_BULK_UPDATES "http-bulk-updates" |
#define | SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS "http-max-connections" |
#define | SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS "http-chunked-requests" |
#define | SVN_CONFIG_OPTION_SERF_LOG_COMPONENTS "serf-log-components" |
#define | SVN_CONFIG_OPTION_SERF_LOG_LEVEL "serf-log-level" |
#define | SVN_CONFIG_CATEGORY_CONFIG "config" |
#define | SVN_CONFIG_SECTION_AUTH "auth" |
#define | SVN_CONFIG_OPTION_PASSWORD_STORES "password-stores" |
#define | SVN_CONFIG_OPTION_KWALLET_WALLET "kwallet-wallet" |
#define | SVN_CONFIG_OPTION_KWALLET_SVN_APPLICATION_NAME_WITH_PID "kwallet-svn-application-name-with-pid" |
#define | SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE_PROMPT "ssl-client-cert-file-prompt" |
#define | SVN_CONFIG_SECTION_HELPERS "helpers" |
#define | SVN_CONFIG_OPTION_EDITOR_CMD "editor-cmd" |
#define | SVN_CONFIG_OPTION_DIFF_CMD "diff-cmd" |
#define | SVN_CONFIG_OPTION_DIFF_EXTENSIONS "diff-extensions" |
#define | SVN_CONFIG_OPTION_DIFF3_CMD "diff3-cmd" |
#define | SVN_CONFIG_OPTION_DIFF3_HAS_PROGRAM_ARG "diff3-has-program-arg" |
#define | SVN_CONFIG_OPTION_MERGE_TOOL_CMD "merge-tool-cmd" |
#define | SVN_CONFIG_SECTION_MISCELLANY "miscellany" |
#define | SVN_CONFIG_OPTION_GLOBAL_IGNORES "global-ignores" |
#define | SVN_CONFIG_OPTION_LOG_ENCODING "log-encoding" |
#define | SVN_CONFIG_OPTION_USE_COMMIT_TIMES "use-commit-times" |
#define | SVN_CONFIG_OPTION_TEMPLATE_ROOT "template-root" |
#define | SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS "enable-auto-props" |
#define | SVN_CONFIG_OPTION_ENABLE_MAGIC_FILE "enable-magic-file" |
#define | SVN_CONFIG_OPTION_NO_UNLOCK "no-unlock" |
#define | SVN_CONFIG_OPTION_MIMETYPES_FILE "mime-types-file" |
#define | SVN_CONFIG_OPTION_PRESERVED_CF_EXTS "preserved-conflict-file-exts" |
#define | SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts" |
#define | SVN_CONFIG_OPTION_MEMORY_CACHE_SIZE "memory-cache-size" |
#define | SVN_CONFIG_OPTION_DIFF_IGNORE_CONTENT_TYPE "diff-ignore-content-type" |
#define | SVN_CONFIG_SECTION_TUNNELS "tunnels" |
#define | SVN_CONFIG_SECTION_AUTO_PROPS "auto-props" |
#define | SVN_CONFIG_SECTION_WORKING_COPY "working-copy" |
#define | SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE "exclusive-locking" |
#define | SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE_CLIENTS "exclusive-locking-clients" |
#define | SVN_CONFIG_OPTION_SQLITE_BUSY_TIMEOUT "busy-timeout" |
Repository conf directory configuration files strings | |
Strings for the names of sections and options in the repository conf directory configuration files. | |
#define | SVN_CONFIG_SECTION_GENERAL "general" |
#define | SVN_CONFIG_OPTION_ANON_ACCESS "anon-access" |
#define | SVN_CONFIG_OPTION_AUTH_ACCESS "auth-access" |
#define | SVN_CONFIG_OPTION_PASSWORD_DB "password-db" |
#define | SVN_CONFIG_OPTION_REALM "realm" |
#define | SVN_CONFIG_OPTION_AUTHZ_DB "authz-db" |
#define | SVN_CONFIG_OPTION_GROUPS_DB "groups-db" |
#define | SVN_CONFIG_OPTION_FORCE_USERNAME_CASE "force-username-case" |
#define | SVN_CONFIG_OPTION_HOOKS_ENV "hooks-env" |
#define | SVN_CONFIG_SECTION_SASL "sasl" |
#define | SVN_CONFIG_OPTION_USE_SASL "use-sasl" |
#define | SVN_CONFIG_OPTION_MIN_SSF "min-encryption" |
#define | SVN_CONFIG_OPTION_MAX_SSF "max-encryption" |
#define | SVN_CONFIG_SECTION_USERS "users" |
Typedefs | |
typedef struct svn_config_t | svn_config_t |
Opaque structure describing a set of configuration options. More... | |
typedef svn_boolean_t(* | svn_config_section_enumerator_t )(const char *name, void *baton) |
Similar to svn_config_section_enumerator2_t , but is not provided with a memory pool argument. More... | |
typedef svn_boolean_t(* | svn_config_section_enumerator2_t )(const char *name, void *baton, apr_pool_t *pool) |
A callback function used in enumerating config sections. More... | |
typedef svn_boolean_t(* | svn_config_enumerator_t )(const char *name, const char *value, void *baton) |
Similar to svn_config_enumerator2_t , but is not provided with a memory pool argument. More... | |
typedef svn_boolean_t(* | svn_config_enumerator2_t )(const char *name, const char *value, void *baton, apr_pool_t *pool) |
A callback function used in enumerating config options. More... | |
typedef svn_error_t *(* | svn_config_auth_walk_func_t )(svn_boolean_t *delete_cred, void *walk_baton, const char *cred_kind, const char *realmstring, apr_hash_t *hash, apr_pool_t *scratch_pool) |
Callback for svn_config_walk_auth_data(). More... | |
Functions | |
svn_error_t * | svn_config_get_config (apr_hash_t **cfg_hash, const char *config_dir, apr_pool_t *pool) |
Read configuration information from the standard sources and merge it into the hash *cfg_hash. More... | |
svn_error_t * | svn_config_create2 (svn_config_t **cfgp, svn_boolean_t section_names_case_sensitive, svn_boolean_t option_names_case_sensitive, apr_pool_t *result_pool) |
Set *cfgp to an empty svn_config_t structure, allocated in result_pool. More... | |
svn_error_t * | svn_config_create (svn_config_t **cfgp, svn_boolean_t section_names_case_sensitive, apr_pool_t *result_pool) |
Similar to svn_config_create2, but always passes FALSE to option_names_case_sensitive. More... | |
svn_error_t * | svn_config_read3 (svn_config_t **cfgp, const char *file, svn_boolean_t must_exist, svn_boolean_t section_names_case_sensitive, svn_boolean_t option_names_case_sensitive, apr_pool_t *result_pool) |
Read configuration data from file (a file or registry path) into *cfgp, allocated in pool. More... | |
svn_error_t * | svn_config_read2 (svn_config_t **cfgp, const char *file, svn_boolean_t must_exist, svn_boolean_t section_names_case_sensitive, apr_pool_t *result_pool) |
Similar to svn_config_read3, but always passes FALSE to option_names_case_sensitive. More... | |
svn_error_t * | svn_config_read (svn_config_t **cfgp, const char *file, svn_boolean_t must_exist, apr_pool_t *result_pool) |
Similar to svn_config_read2, but always passes FALSE to section_names_case_sensitive. More... | |
svn_error_t * | svn_config_parse (svn_config_t **cfgp, svn_stream_t *stream, svn_boolean_t section_names_case_sensitive, svn_boolean_t option_names_case_sensitive, apr_pool_t *result_pool) |
Read configuration data from stream into *cfgp, allocated in result_pool. More... | |
svn_error_t * | svn_config_merge (svn_config_t *cfg, const char *file, svn_boolean_t must_exist) |
Like svn_config_read(), but merges the configuration data from file (a file or registry path) into *cfg, which was previously returned from svn_config_read(). More... | |
void | svn_config_get (svn_config_t *cfg, const char **valuep, const char *section, const char *option, const char *default_value) |
Find the value of a (section, option) pair in cfg, set *valuep to the value. More... | |
void | svn_config_set (svn_config_t *cfg, const char *section, const char *option, const char *value) |
Add or replace the value of a (section, option) pair in cfg with value. More... | |
svn_error_t * | svn_config_get_bool (svn_config_t *cfg, svn_boolean_t *valuep, const char *section, const char *option, svn_boolean_t default_value) |
Like svn_config_get(), but for boolean values. More... | |
void | svn_config_set_bool (svn_config_t *cfg, const char *section, const char *option, svn_boolean_t value) |
Like svn_config_set(), but for boolean values. More... | |
svn_error_t * | svn_config_get_int64 (svn_config_t *cfg, apr_int64_t *valuep, const char *section, const char *option, apr_int64_t default_value) |
Like svn_config_get(), but for 64-bit signed integers. More... | |
void | svn_config_set_int64 (svn_config_t *cfg, const char *section, const char *option, apr_int64_t value) |
Like svn_config_set(), but for 64-bit signed integers. More... | |
svn_error_t * | svn_config_get_yes_no_ask (svn_config_t *cfg, const char **valuep, const char *section, const char *option, const char *default_value) |
Like svn_config_get(), but only for yes/no/ask values. More... | |
svn_error_t * | svn_config_get_tristate (svn_config_t *cfg, svn_tristate_t *valuep, const char *section, const char *option, const char *unknown_value, svn_tristate_t default_value) |
Like svn_config_get_bool(), but for tristate values. More... | |
int | svn_config_enumerate_sections (svn_config_t *cfg, svn_config_section_enumerator_t callback, void *baton) |
Similar to svn_config_enumerate_sections2(), but uses a memory pool of cfg instead of one that is explicitly provided. More... | |
int | svn_config_enumerate_sections2 (svn_config_t *cfg, svn_config_section_enumerator2_t callback, void *baton, apr_pool_t *pool) |
Enumerate the sections, passing baton and the current section's name to callback. More... | |
int | svn_config_enumerate (svn_config_t *cfg, const char *section, svn_config_enumerator_t callback, void *baton) |
Similar to svn_config_enumerate2(), but uses a memory pool of cfg instead of one that is explicitly provided. More... | |
int | svn_config_enumerate2 (svn_config_t *cfg, const char *section, svn_config_enumerator2_t callback, void *baton, apr_pool_t *pool) |
Enumerate the options in section, passing baton and the current option's name and value to callback. More... | |
svn_boolean_t | svn_config_has_section (svn_config_t *cfg, const char *section) |
Return TRUE if section exists in cfg, FALSE otherwise. More... | |
const char * | svn_config_find_group (svn_config_t *cfg, const char *key, const char *master_section, apr_pool_t *pool) |
Enumerate the group master_section in cfg. More... | |
const char * | svn_config_get_server_setting (svn_config_t *cfg, const char *server_group, const char *option_name, const char *default_value) |
Retrieve value corresponding to option_name in cfg, or return default_value if none is found. More... | |
svn_error_t * | svn_config_get_server_setting_int (svn_config_t *cfg, const char *server_group, const char *option_name, apr_int64_t default_value, apr_int64_t *result_value, apr_pool_t *pool) |
Retrieve value into result_value corresponding to option_name for a given server_group in cfg, or return default_value if none is found. More... | |
svn_error_t * | svn_config_get_server_setting_bool (svn_config_t *cfg, svn_boolean_t *valuep, const char *server_group, const char *option_name, svn_boolean_t default_value) |
Set *valuep according to option_name for a given server_group in cfg, or set to default_value if no value is specified. More... | |
svn_error_t * | svn_config_ensure (const char *config_dir, apr_pool_t *pool) |
Try to ensure that the user's ~/.subversion/ area exists, and create no-op template files for any absent config files. More... | |
svn_error_t * | svn_config_read_auth_data (apr_hash_t **hash, const char *cred_kind, const char *realmstring, const char *config_dir, apr_pool_t *pool) |
Use cred_kind and realmstring to locate a file within the ~/.subversion/auth/ area. More... | |
svn_error_t * | svn_config_write_auth_data (apr_hash_t *hash, const char *cred_kind, const char *realmstring, const char *config_dir, apr_pool_t *pool) |
Use cred_kind and realmstring to create or overwrite a file within the ~/.subversion/auth/ area. More... | |
svn_error_t * | svn_config_walk_auth_data (const char *config_dir, svn_config_auth_walk_func_t walk_func, void *walk_baton, apr_pool_t *scratch_pool) |
Call walk_func with walk_baton and information describing each credential cached within the Subversion auth store located under config_dir. More... | |
svn_error_t * | svn_config_get_user_config_path (const char **path, const char *config_dir, const char *fname, apr_pool_t *pool) |
Put the absolute path to the user's configuration directory, or to a file within that directory, into *path. More... | |
svn_error_t * | svn_config_dup (svn_config_t **cfgp, const svn_config_t *src, apr_pool_t *pool) |
Create a deep copy of the config object src and return it in cfgp, allocating the memory in pool. More... | |
svn_error_t * | svn_config_copy_config (apr_hash_t **cfg_hash, apr_hash_t *src_hash, apr_pool_t *pool) |
Create a deep copy of the config hash src_hash and return it in cfg_hash, allocating the memory in pool. More... | |
Accessing SVN configuration files.
Definition in file svn_config.h.
#define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES |
Definition at line 197 of file svn_config.h.
#define SVN_CONFIG_OPTION_DIFF_EXTENSIONS "diff-extensions" |
Definition at line 123 of file svn_config.h.
#define SVN_CONFIG_OPTION_DIFF_IGNORE_CONTENT_TYPE "diff-ignore-content-type" |
Definition at line 144 of file svn_config.h.
#define SVN_CONFIG_OPTION_ENABLE_MAGIC_FILE "enable-magic-file" |
Definition at line 135 of file svn_config.h.
#define SVN_CONFIG_OPTION_FORCE_USERNAME_CASE "force-username-case" |
Definition at line 172 of file svn_config.h.
#define SVN_CONFIG_OPTION_GROUPS_DB "groups-db" |
Definition at line 170 of file svn_config.h.
#define SVN_CONFIG_OPTION_HOOKS_ENV "hooks-env" |
Definition at line 174 of file svn_config.h.
#define SVN_CONFIG_OPTION_HTTP_BULK_UPDATES "http-bulk-updates" |
Definition at line 95 of file svn_config.h.
#define SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS "http-chunked-requests" |
Definition at line 99 of file svn_config.h.
#define SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS "http-max-connections" |
Definition at line 97 of file svn_config.h.
#define SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts" |
Definition at line 140 of file svn_config.h.
#define SVN_CONFIG_OPTION_KWALLET_SVN_APPLICATION_NAME_WITH_PID "kwallet-svn-application-name-with-pid" |
Definition at line 114 of file svn_config.h.
#define SVN_CONFIG_OPTION_KWALLET_WALLET "kwallet-wallet" |
Definition at line 112 of file svn_config.h.
#define SVN_CONFIG_OPTION_MEMORY_CACHE_SIZE "memory-cache-size" |
Definition at line 142 of file svn_config.h.
#define SVN_CONFIG_OPTION_PASSWORD_STORES "password-stores" |
Definition at line 110 of file svn_config.h.
#define SVN_CONFIG_OPTION_SERF_LOG_COMPONENTS "serf-log-components" |
Definition at line 102 of file svn_config.h.
#define SVN_CONFIG_OPTION_SERF_LOG_LEVEL "serf-log-level" |
Definition at line 104 of file svn_config.h.
#define SVN_CONFIG_OPTION_SQLITE_BUSY_TIMEOUT "busy-timeout" |
Definition at line 154 of file svn_config.h.
#define SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE "exclusive-locking" |
Definition at line 150 of file svn_config.h.
#define SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE_CLIENTS "exclusive-locking-clients" |
Definition at line 152 of file svn_config.h.
#define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE_PROMPT "ssl-client-cert-file-prompt" |
Definition at line 116 of file svn_config.h.
#define SVN_CONFIG_OPTION_TEMPLATE_ROOT "template-root" |
Definition at line 132 of file svn_config.h.
#define SVN_CONFIG_SECTION_WORKING_COPY "working-copy" |
Definition at line 148 of file svn_config.h.
typedef svn_boolean_t(* svn_config_enumerator2_t)(const char *name, const char *value, void *baton, apr_pool_t *pool) |
A callback function used in enumerating config options.
See svn_config_enumerate2() for the details of this type.
Definition at line 548 of file svn_config.h.
typedef svn_boolean_t(* svn_config_enumerator_t)(const char *name, const char *value, void *baton) |
Similar to svn_config_enumerator2_t
, but is not provided with a memory pool argument.
See svn_config_enumerate() for the details of this type.
Definition at line 525 of file svn_config.h.
typedef svn_boolean_t(* svn_config_section_enumerator2_t)(const char *name, void *baton, apr_pool_t *pool) |
A callback function used in enumerating config sections.
See svn_config_enumerate_sections2() for the details of this type.
Definition at line 499 of file svn_config.h.
typedef svn_boolean_t(* svn_config_section_enumerator_t)(const char *name, void *baton) |
Similar to svn_config_section_enumerator2_t
, but is not provided with a memory pool argument.
See svn_config_enumerate_sections() for the details of this type.
Definition at line 479 of file svn_config.h.
typedef struct svn_config_t svn_config_t |
Opaque structure describing a set of configuration options.
Definition at line 54 of file svn_config.h.
svn_error_t* svn_config_create | ( | svn_config_t ** | cfgp, |
svn_boolean_t | section_names_case_sensitive, | ||
apr_pool_t * | result_pool | ||
) |
Similar to svn_config_create2, but always passes FALSE
to option_names_case_sensitive.
svn_error_t* svn_config_create2 | ( | svn_config_t ** | cfgp, |
svn_boolean_t | section_names_case_sensitive, | ||
svn_boolean_t | option_names_case_sensitive, | ||
apr_pool_t * | result_pool | ||
) |
Set *cfgp to an empty svn_config_t
structure, allocated in result_pool.
Pass TRUE to section_names_case_sensitive if section names are to be populated case sensitively.
Pass TRUE to option_names_case_sensitive if option names are to be populated case sensitively.
svn_error_t* svn_config_ensure | ( | const char * | config_dir, |
apr_pool_t * | pool | ||
) |
Try to ensure that the user's ~/.subversion/ area exists, and create no-op template files for any absent config files.
Use pool for any temporary allocation. If config_dir is not NULL
it specifies a directory from which to read the config overriding all other sources.
Don't error if something exists but is the wrong kind (for example, ~/.subversion exists but is a file, or ~/.subversion/servers exists but is a directory).
Also don't error if trying to create something and failing – it's okay for the config area or its contents not to be created. However, if creating a config template file succeeds, return an error if unable to initialize its contents.
int svn_config_enumerate | ( | svn_config_t * | cfg, |
const char * | section, | ||
svn_config_enumerator_t | callback, | ||
void * | baton | ||
) |
Similar to svn_config_enumerate2(), but uses a memory pool of cfg instead of one that is explicitly provided.
int svn_config_enumerate2 | ( | svn_config_t * | cfg, |
const char * | section, | ||
svn_config_enumerator2_t | callback, | ||
void * | baton, | ||
apr_pool_t * | pool | ||
) |
Enumerate the options in section, passing baton and the current option's name and value to callback.
Continue the enumeration if callback returns TRUE
. Return the number of times callback was called.
while callback does not return error, and if callback does return error, to return the same error (or a wrapping of it) from svn_config_enumerate(). What's the use case for svn_config_enumerate()? Is it more likely to need to break out of an enumeration early, with no error, than an invocation of callback is likely to need to return an error? ###
callback's name and value parameters are only valid for the duration of the call.
int svn_config_enumerate_sections | ( | svn_config_t * | cfg, |
svn_config_section_enumerator_t | callback, | ||
void * | baton | ||
) |
Similar to svn_config_enumerate_sections2(), but uses a memory pool of cfg instead of one that is explicitly provided.
int svn_config_enumerate_sections2 | ( | svn_config_t * | cfg, |
svn_config_section_enumerator2_t | callback, | ||
void * | baton, | ||
apr_pool_t * | pool | ||
) |
Enumerate the sections, passing baton and the current section's name to callback.
Continue the enumeration if callback returns TRUE
. Return the number of times callback was called.
function, too. ###
callback's name parameter is only valid for the duration of the call.
const char* svn_config_find_group | ( | svn_config_t * | cfg, |
const char * | key, | ||
const char * | master_section, | ||
apr_pool_t * | pool | ||
) |
Enumerate the group master_section in cfg.
Each variable value is interpreted as a list of glob patterns (separated by comma and optional whitespace). Return the name of the first variable whose value matches key, or NULL
if no variable matches.
void svn_config_get | ( | svn_config_t * | cfg, |
const char ** | valuep, | ||
const char * | section, | ||
const char * | option, | ||
const char * | default_value | ||
) |
Find the value of a (section, option) pair in cfg, set *valuep to the value.
If cfg is NULL
, just sets *valuep to default_value. If the value does not exist, expand and return default_value. default_value can be NULL.
The returned value will be valid at least until the next call to svn_config_get(), or for the lifetime of default_value. It is safest to consume the returned value immediately.
This function may change cfg by expanding option values.
svn_error_t* svn_config_get_bool | ( | svn_config_t * | cfg, |
svn_boolean_t * | valuep, | ||
const char * | section, | ||
const char * | option, | ||
svn_boolean_t | default_value | ||
) |
Like svn_config_get(), but for boolean values.
Parses the option as a boolean value. The recognized representations are 'TRUE'/'FALSE', 'yes'/'no', 'on'/'off', '1'/'0'; case does not matter. Returns an error if the option doesn't contain a known string.
svn_error_t* svn_config_get_config | ( | apr_hash_t ** | cfg_hash, |
const char * | config_dir, | ||
apr_pool_t * | pool | ||
) |
Read configuration information from the standard sources and merge it into the hash *cfg_hash.
If config_dir is not NULL it specifies a directory from which to read the configuration files, overriding all other sources. Otherwise, first read any system-wide configurations (from a file or from the registry), then merge in personal configurations (again from file or registry). The hash and all its data are allocated in pool.
*cfg_hash is a hash whose keys are const
char * configuration categories (SVN_CONFIG_CATEGORY_SERVERS
, SVN_CONFIG_CATEGORY_CONFIG
, etc.) and whose values are the svn_config_t
* items representing the configuration values for that category.
svn_error_t* svn_config_get_int64 | ( | svn_config_t * | cfg, |
apr_int64_t * | valuep, | ||
const char * | section, | ||
const char * | option, | ||
apr_int64_t | default_value | ||
) |
Like svn_config_get(), but for 64-bit signed integers.
Parses the option in section of cfg as an integer value, setting *valuep to the result. If the option is not found, sets *valuep to default_value. If the option is found but cannot be converted to an integer, returns an error.
const char* svn_config_get_server_setting | ( | svn_config_t * | cfg, |
const char * | server_group, | ||
const char * | option_name, | ||
const char * | default_value | ||
) |
Retrieve value corresponding to option_name in cfg, or return default_value if none is found.
The config will first be checked for a default. If server_group is not NULL
, the config will also be checked for an override in a server group,
svn_error_t* svn_config_get_server_setting_bool | ( | svn_config_t * | cfg, |
svn_boolean_t * | valuep, | ||
const char * | server_group, | ||
const char * | option_name, | ||
svn_boolean_t | default_value | ||
) |
Set *valuep according to option_name for a given server_group in cfg, or set to default_value if no value is specified.
Check first a default, then for an override in a server group. If a value is found but is not a valid boolean, return an SVN_ERR_BAD_CONFIG_VALUE error.
svn_error_t* svn_config_get_server_setting_int | ( | svn_config_t * | cfg, |
const char * | server_group, | ||
const char * | option_name, | ||
apr_int64_t | default_value, | ||
apr_int64_t * | result_value, | ||
apr_pool_t * | pool | ||
) |
Retrieve value into result_value corresponding to option_name for a given server_group in cfg, or return default_value if none is found.
The config will first be checked for a default, then will be checked for an override in a server group. If the value found is not a valid integer, a svn_error_t*
will be returned.
svn_error_t* svn_config_get_tristate | ( | svn_config_t * | cfg, |
svn_tristate_t * | valuep, | ||
const char * | section, | ||
const char * | option, | ||
const char * | unknown_value, | ||
svn_tristate_t | default_value | ||
) |
Like svn_config_get_bool(), but for tristate values.
Set *valuep to svn_tristate_true, svn_tristate_false, or svn_tristate_unknown, depending on the value of option in section of cfg. True and false values are the same as for svn_config_get_bool(); unknown_value specifies the option value allowed for third state (svn_tristate_unknown).
Use default_value as the default value if option cannot be found.
svn_error_t* svn_config_get_yes_no_ask | ( | svn_config_t * | cfg, |
const char ** | valuep, | ||
const char * | section, | ||
const char * | option, | ||
const char * | default_value | ||
) |
Like svn_config_get(), but only for yes/no/ask values.
Parse option in section and set *valuep to one of SVN_CONFIG_TRUE, SVN_CONFIG_FALSE, or SVN_CONFIG_ASK. If there is no setting for option, then parse default_value and set *valuep accordingly. If default_value is NULL, the result is undefined, and may be an error; we recommend that you pass one of SVN_CONFIG_TRUE, SVN_CONFIG_FALSE, or SVN_CONFIG_ASK for default value.
Valid representations are (at least) "true"/"false", "yes"/"no", "on"/"off", "1"/"0", and "ask"; they are case-insensitive. Return an SVN_ERR_BAD_CONFIG_VALUE error if either default_value or option's value is not a valid representation.
svn_boolean_t svn_config_has_section | ( | svn_config_t * | cfg, |
const char * | section | ||
) |
Return TRUE
if section exists in cfg, FALSE
otherwise.
svn_error_t* svn_config_merge | ( | svn_config_t * | cfg, |
const char * | file, | ||
svn_boolean_t | must_exist | ||
) |
Like svn_config_read(), but merges the configuration data from file (a file or registry path) into *cfg, which was previously returned from svn_config_read().
This function invalidates all value expansions in cfg, so that the next svn_config_get() takes the modifications into account.
svn_error_t* svn_config_parse | ( | svn_config_t ** | cfgp, |
svn_stream_t * | stream, | ||
svn_boolean_t | section_names_case_sensitive, | ||
svn_boolean_t | option_names_case_sensitive, | ||
apr_pool_t * | result_pool | ||
) |
Read configuration data from stream into *cfgp, allocated in result_pool.
If section_names_case_sensitive is TRUE
, populate section name hashes case sensitively, except for the "DEFAULT"
section.
If option_names_case_sensitive is TRUE
, populate option name hashes case sensitively.
svn_error_t* svn_config_read | ( | svn_config_t ** | cfgp, |
const char * | file, | ||
svn_boolean_t | must_exist, | ||
apr_pool_t * | result_pool | ||
) |
Similar to svn_config_read2, but always passes FALSE
to section_names_case_sensitive.
svn_error_t* svn_config_read2 | ( | svn_config_t ** | cfgp, |
const char * | file, | ||
svn_boolean_t | must_exist, | ||
svn_boolean_t | section_names_case_sensitive, | ||
apr_pool_t * | result_pool | ||
) |
Similar to svn_config_read3, but always passes FALSE
to option_names_case_sensitive.
svn_error_t* svn_config_read3 | ( | svn_config_t ** | cfgp, |
const char * | file, | ||
svn_boolean_t | must_exist, | ||
svn_boolean_t | section_names_case_sensitive, | ||
svn_boolean_t | option_names_case_sensitive, | ||
apr_pool_t * | result_pool | ||
) |
Read configuration data from file (a file or registry path) into *cfgp, allocated in pool.
If file does not exist, then if must_exist, return an error, otherwise return an empty svn_config_t
.
If section_names_case_sensitive is TRUE
, populate section name hashes case sensitively, except for the "DEFAULT"
section.
If option_names_case_sensitive is TRUE
, populate option name hashes case sensitively.
void svn_config_set | ( | svn_config_t * | cfg, |
const char * | section, | ||
const char * | option, | ||
const char * | value | ||
) |
Add or replace the value of a (section, option) pair in cfg with value.
This function invalidates all value expansions in cfg.
To remove an option, pass NULL for the value.
void svn_config_set_bool | ( | svn_config_t * | cfg, |
const char * | section, | ||
const char * | option, | ||
svn_boolean_t | value | ||
) |
Like svn_config_set(), but for boolean values.
Sets the option to 'TRUE'/'FALSE', depending on value.
void svn_config_set_int64 | ( | svn_config_t * | cfg, |
const char * | section, | ||
const char * | option, | ||
apr_int64_t | value | ||
) |
Like svn_config_set(), but for 64-bit signed integers.
Sets the value of option in section of cfg to the signed decimal value.