📄 svn_config.h
字号:
typedef svn_boolean_t (*svn_config_section_enumerator_t)(const char *name, void *baton);/** Similar to svn_config_enumerate_sections2(), but uses a memory pool of * @a cfg instead of one that is explicitely provided. * * @deprecated Provided for backwards compatibility with the 1.2 API. */int svn_config_enumerate_sections(svn_config_t *cfg, svn_config_section_enumerator_t callback, void *baton);/** A callback function used in enumerating config sections. * * See svn_config_enumerate_sections2() for the details of this type. * * @since New in 1.3. */typedef svn_boolean_t (*svn_config_section_enumerator2_t)(const char *name, void *baton, apr_pool_t *pool);/** Enumerate the sections, passing @a baton and the current section's name * to @a callback. Continue the enumeration if @a callback returns @c TRUE. * Return the number of times @a callback was called. * * ### See kff's comment to svn_config_enumerate2(). It applies to this * function, too. ### * * @a callback's @a name and @a name parameters are only valid for the * duration of the call. * * @since New in 1.3. */int svn_config_enumerate_sections2(svn_config_t *cfg, svn_config_section_enumerator2_t callback, void *baton, apr_pool_t *pool);/** Similar to @c svn_config_enumerator2_t, but is not * provided with a memory pool argument. * See svn_config_enumerate() for the details of this type. * * @deprecated Provided for backwards compatibility with the 1.2 API. */typedef svn_boolean_t (*svn_config_enumerator_t)(const char *name, const char *value, void *baton);/** Similar to svn_config_enumerate2(), but uses a memory pool of * @a cfg instead of one that is explicitely provided. * * @deprecated Provided for backwards compatibility with the 1.2 API. */int svn_config_enumerate(svn_config_t *cfg, const char *section, svn_config_enumerator_t callback, void *baton);/** A callback function used in enumerating config options. * * See svn_config_enumerate2() for the details of this type. * * @since New in 1.3. */typedef svn_boolean_t (*svn_config_enumerator2_t)(const char *name, const char *value, void *baton, apr_pool_t *pool);/** Enumerate the options in @a section, passing @a baton and the current * option's name and value to @a callback. Continue the enumeration if * @a callback returns @c TRUE. Return the number of times @a callback * was called. * * ### kff asks: A more usual interface is to continue enumerating * while @a callback does not return error, and if @a 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 * @a callback is likely to need to return an error? ### * * @a callback's @a name and @a value parameters are only valid for the * duration of the call. * * @since New in 1.3. */int svn_config_enumerate2(svn_config_t *cfg, const char *section, svn_config_enumerator2_t callback, void *baton, apr_pool_t *pool);/** * Return @c TRUE if @a section exists in @a config, @c FALSE otherwise. * * @since New in 1.4. */svn_boolean_t svn_config_has_section(svn_config_t *cfg, const char *section);/** Enumerate the group @a master_section in @a 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 @a key, or @c NULL if no variable matches. */const char *svn_config_find_group(svn_config_t *cfg, const char *key, const char *master_section, apr_pool_t *pool);/** Retrieve value corresponding to @a option_name for a given * @a server_group in @a cfg , or return @a 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. */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 into @a result_value corresponding to @a option_name for a * given @a server_group in @a cfg, or return @a 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 @c svn_error_t* will be returned. */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);/** Try to ensure that the user's ~/.subversion/ area exists, and create * no-op template files for any absent config files. Use @a pool for any * temporary allocation. If @a config_dir is not @c 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. */svn_error_t *svn_config_ensure(const char *config_dir, apr_pool_t *pool);/** Accessing cached authentication data in the user config area. * * @defgroup cached_authentication_data cached authentication data. * @{ *//** A hash-key pointing to a realmstring. Every file containing * authentication data should have this key. */#define SVN_CONFIG_REALMSTRING_KEY "svn:realmstring"/** Use @a cred_kind and @a realmstring to locate a file within the * ~/.subversion/auth/ area. If the file exists, initialize @a *hash * and load the file contents into the hash, using @a pool. If the * file doesn't exist, set @a *hash to NULL. * * If @a config_dir is not NULL it specifies a directory from which to * read the config overriding all other sources. * * Besides containing the original credential fields, the hash will * also contain @c SVN_CONFIG_REALMSTRING_KEY. The caller can examine * this value as a sanity-check that the correct file was loaded. * * The hashtable will contain <tt>const char *</tt> keys and * <tt>svn_string_t *</tt> values. */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 @a cred_kind and @a realmstring to create or overwrite a file * within the ~/.subversion/auth/ area. Write the contents of @a hash into * the file. If @a config_dir is not NULL it specifies a directory to read * the config overriding all other sources. * * Also, add @a realmstring to the file, with key @c * SVN_CONFIG_REALMSTRING_KEY. This allows programs (or users) to * verify exactly which set credentials live within the file. * * The hashtable must contain <tt>const char *</tt> keys and * <tt>svn_string_t *</tt> values. */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);/** @} */#ifdef __cplusplus}#endif /* __cplusplus */#endif /* SVN_CONFIG_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -