diff options
Diffstat (limited to 'subversion/include/svn_config.h')
-rw-r--r-- | subversion/include/svn_config.h | 232 |
1 files changed, 223 insertions, 9 deletions
diff --git a/subversion/include/svn_config.h b/subversion/include/svn_config.h index b689360..a3fa9df 100644 --- a/subversion/include/svn_config.h +++ b/subversion/include/svn_config.h @@ -34,6 +34,7 @@ #include <apr_hash.h> /* for apr_hash_t */ #include "svn_types.h" +#include "svn_io.h" #ifdef __cplusplus extern "C" { @@ -61,6 +62,10 @@ typedef struct svn_config_t svn_config_t; * client configuration files. * @{ */ + + /* This list of #defines is intentionally presented as a nested list + that matches the in-config hierarchy. */ + #define SVN_CONFIG_CATEGORY_SERVERS "servers" #define SVN_CONFIG_SECTION_GROUPS "groups" #define SVN_CONFIG_SECTION_GLOBAL "global" @@ -86,12 +91,21 @@ typedef struct svn_config_t svn_config_t; #define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \ "store-ssl-client-cert-pp-plaintext" #define SVN_CONFIG_OPTION_USERNAME "username" +/** @since New in 1.8. */ +#define SVN_CONFIG_OPTION_HTTP_BULK_UPDATES "http-bulk-updates" +/** @since New in 1.8. */ +#define SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS "http-max-connections" #define SVN_CONFIG_CATEGORY_CONFIG "config" #define SVN_CONFIG_SECTION_AUTH "auth" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_PASSWORD_STORES "password-stores" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_KWALLET_WALLET "kwallet-wallet" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_KWALLET_SVN_APPLICATION_NAME_WITH_PID "kwallet-svn-application-name-with-pid" +/** @since New in 1.8. */ +#define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE_PROMPT "ssl-client-cert-file-prompt" /* The majority of options of the "auth" section * has been moved to SVN_CONFIG_CATEGORY_SERVERS. */ #define SVN_CONFIG_SECTION_HELPERS "helpers" @@ -106,15 +120,24 @@ typedef struct svn_config_t svn_config_t; #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" +/** @deprecated Not used by Subversion since 2003/r847039 (well before 1.0) */ #define SVN_CONFIG_OPTION_TEMPLATE_ROOT "template-root" #define SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS "enable-auto-props" #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" +/** @since New in 1.7. */ #define SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts" +/** @since New in 1.7. */ #define SVN_CONFIG_OPTION_MEMORY_CACHE_SIZE "memory-cache-size" #define SVN_CONFIG_SECTION_TUNNELS "tunnels" #define SVN_CONFIG_SECTION_AUTO_PROPS "auto-props" +/** @since New in 1.8. */ +#define SVN_CONFIG_SECTION_WORKING_COPY "working-copy" +/** @since New in 1.8. */ +#define SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE "exclusive-locking" +/** @since New in 1.8. */ +#define SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE_CLIENTS "exclusive-locking-clients" /** @} */ /** @name Repository conf directory configuration files strings @@ -129,8 +152,12 @@ typedef struct svn_config_t svn_config_t; #define SVN_CONFIG_OPTION_PASSWORD_DB "password-db" #define SVN_CONFIG_OPTION_REALM "realm" #define SVN_CONFIG_OPTION_AUTHZ_DB "authz-db" +/** @since New in 1.8. */ +#define SVN_CONFIG_OPTION_GROUPS_DB "groups-db" /** @since New in 1.7. */ #define SVN_CONFIG_OPTION_FORCE_USERNAME_CASE "force-username-case" +/** @since New in 1.8. */ +#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" @@ -146,10 +173,12 @@ typedef struct svn_config_t svn_config_t; /* We want this to be printed on two lines in the generated config file, * but we don't want the # character to end up in the variable. */ +#ifndef DOXYGEN_SHOULD_SKIP_THIS #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \ - "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo" + "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__" #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \ "*.rej *~ #*# .#* .*.swp .DS_Store" +#endif #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \ SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \ @@ -168,6 +197,7 @@ typedef struct svn_config_t svn_config_t; #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 /** Read configuration information from the standard sources and merge it * into the hash @a *cfg_hash. If @a config_dir is not NULL it specifies a @@ -188,15 +218,30 @@ svn_config_get_config(apr_hash_t **cfg_hash, const char *config_dir, apr_pool_t *pool); - /** Set @a *cfgp to an empty @c svn_config_t structure, * allocated in @a result_pool. * * Pass TRUE to @a section_names_case_sensitive if * section names are to be populated case sensitively. * + * Pass TRUE to @a option_names_case_sensitive if + * option names are to be populated case sensitively. + * + * @since New in 1.8. + */ +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); + +/** Similar to svn_config_create2, but always passes @c FALSE to + * @a option_names_case_sensitive. + * * @since New in 1.7. + * @deprecated Provided for backward compatibility with 1.7 API. */ +SVN_DEPRECATED svn_error_t * svn_config_create(svn_config_t **cfgp, svn_boolean_t section_names_case_sensitive, @@ -208,21 +253,38 @@ svn_config_create(svn_config_t **cfgp, * If @a file does not exist, then if @a must_exist, return an error, * otherwise return an empty @c svn_config_t. * - * If @a section_names_case_sensitive is TRUE, populate section name hashes - * case sensitively, except for the default SVN_CONFIG__DEFAULT_SECTION. + * If @a section_names_case_sensitive is @c TRUE, populate section name hashes + * case sensitively, except for the @c "DEFAULT" section. * - * @since New in 1.7. + * If @a option_names_case_sensitive is @c TRUE, populate option name hashes + * case sensitively. + * + * @since New in 1.8. */ +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); +/** Similar to svn_config_read3, but always passes @c FALSE to + * @a option_names_case_sensitive. + * + * @since New in 1.7. + * @deprecated Provided for backward compatibility with 1.7 API. + */ +SVN_DEPRECATED 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 *pool); + apr_pool_t *result_pool); -/** Similar to svn_config_read2, but always passes FALSE to - * section_names_case_sensitive. +/** Similar to svn_config_read2, but always passes @c FALSE to + * @a section_names_case_sensitive. * * @deprecated Provided for backward compatibility with 1.6 API. */ @@ -231,7 +293,26 @@ svn_error_t * svn_config_read(svn_config_t **cfgp, const char *file, svn_boolean_t must_exist, - apr_pool_t *pool); + apr_pool_t *result_pool); + +/** Read configuration data from @a stream into @a *cfgp, allocated in + * @a result_pool. + * + * If @a section_names_case_sensitive is @c TRUE, populate section name hashes + * case sensitively, except for the @c "DEFAULT" section. + * + * If @a option_names_case_sensitive is @c TRUE, populate option name hashes + * case sensitively. + * + * @since New in 1.8. + */ + +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); /** Like svn_config_read(), but merges the configuration data from @a file * (a file or registry path) into @a *cfg, which was previously returned @@ -301,6 +382,35 @@ svn_config_set_bool(svn_config_t *cfg, const char *option, svn_boolean_t value); +/** Like svn_config_get(), but for 64-bit signed integers. + * + * Parses the @a option in @a section of @a cfg as an integer value, + * setting @a *valuep to the result. If the option is not found, sets + * @a *valuep to @a default_value. If the option is found but cannot + * be converted to an integer, returns an error. + * + * @since New in 1.8. + */ +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_set(), but for 64-bit signed integers. + * + * Sets the value of @a option in @a section of @a cfg to the signed + * decimal @a value. + * + * @since New in 1.8. + */ +void +svn_config_set_int64(svn_config_t *cfg, + const char *section, + const char *option, + apr_int64_t value); + /** Like svn_config_get(), but only for yes/no/ask values. * * Parse @a option in @a section and set @a *valuep to one of @@ -324,6 +434,27 @@ svn_config_get_yes_no_ask(svn_config_t *cfg, const char *option, const char* default_value); +/** Like svn_config_get_bool(), but for tristate values. + * + * Set @a *valuep to #svn_tristate_true, #svn_tristate_false, or + * #svn_tristate_unknown, depending on the value of @a option in @a + * section of @a cfg. True and false values are the same as for + * svn_config_get_bool(); @a unknown_value specifies the option value + * allowed for third state (#svn_tristate_unknown). + * + * Use @a default_value as the default value if @a option cannot be + * found. + * + * @since New in 1.8. + */ +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); + /** Similar to @c svn_config_section_enumerator2_t, but is not * provided with a memory pool argument. * @@ -574,6 +705,69 @@ svn_config_write_auth_data(apr_hash_t *hash, const char *config_dir, apr_pool_t *pool); + +/** Callback for svn_config_walk_auth_data(). + * + * Called for each credential walked by that function (and able to be + * fully purged) to allow perusal and selective removal of credentials. + * + * @a cred_kind and @a realmstring specify the key of the credential. + * @a hash contains the hash data associated with the record. + * + * Before returning set @a *delete_cred to TRUE to remove the credential from + * the cache; leave @a *delete_cred unchanged or set it to FALSE to keep the + * credential. + * + * Implementations may return #SVN_ERR_CEASE_INVOCATION to indicate + * that the callback should not be called again. Note that when that + * error is returned, the value of @a delete_cred will still be + * honored and action taken if necessary. (For other returned errors, + * @a delete_cred is ignored by svn_config_walk_auth_data().) + * + * @since New in 1.8. + */ +typedef svn_error_t * +(*svn_config_auth_walk_func_t)(svn_boolean_t *delete_cred, + void *cleanup_baton, + const char *cred_kind, + const char *realmstring, + apr_hash_t *hash, + apr_pool_t *scratch_pool); + +/** Call @a walk_func with @a walk_baton and information describing + * each credential cached within the Subversion auth store located + * under @a config_dir. If the callback sets its delete_cred return + * flag, delete the associated credential. + * + * If @a config_dir is not NULL, it must point to an alternative + * config directory location. If it is NULL, the default location + * is used. + * + * @note @a config_dir may only be NULL in 1.8.2 and later. + * + * @note Removing credentials from the config-based disk store will + * not purge them from any open svn_auth_baton_t instance. Consider + * using svn_auth_forget_credentials() -- from the @a cleanup_func, + * even -- for this purpose. + * + * @note Removing credentials from the config-based disk store will + * not also remove any related credentials from third-party password + * stores. (Implementations of @a walk_func which delete credentials + * may wish to consult the "passtype" element of @a hash, if any, to + * see if a third-party store -- such as "gnome-keyring" or "kwallet" + * is being used to hold the most sensitive portion of the credentials + * for this @a cred_kind and @a realmstring.) + * + * @see svn_auth_forget_credentials() + * + * @since New in 1.8. + */ +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); + /** Put the absolute path to the user's configuration directory, * or to a file within that directory, into @a *path. * @@ -598,6 +792,26 @@ svn_config_get_user_config_path(const char **path, const char *fname, apr_pool_t *pool); +/** Create a deep copy of the config object @a src and return + * it in @a cfgp, allocating the memory in @a pool. + * + * @since New in 1.8. + */ +svn_error_t * +svn_config_dup(svn_config_t **cfgp, + svn_config_t *src, + apr_pool_t *pool); + +/** Create a deep copy of the config hash @a src_hash and return + * it in @a cfg_hash, allocating the memory in @a pool. + * + * @since New in 1.8. + */ +svn_error_t * +svn_config_copy_config(apr_hash_t **cfg_hash, + apr_hash_t *src_hash, + apr_pool_t *pool); + /** @} */ #ifdef __cplusplus |