Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
svn_config.h
Go to the documentation of this file.
1 /**
2  * @copyright
3  * ====================================================================
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements. See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership. The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License. You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied. See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_config.h
24  * @brief Accessing SVN configuration files.
25  */
26 
27 
28 
29 #ifndef SVN_CONFIG_H
30 #define SVN_CONFIG_H
31 
32 #include <apr.h> /* for apr_int64_t */
33 #include <apr_pools.h> /* for apr_pool_t */
34 #include <apr_hash.h> /* for apr_hash_t */
35 
36 #include "svn_types.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41 
42 
43 /**************************************************************************
44  *** ***
45  *** For a description of the SVN configuration file syntax, see ***
46  *** your ~/.subversion/README, which is written out automatically by ***
47  *** svn_config_ensure(). ***
48  *** ***
49  **************************************************************************/
50 
51 
52 /** Opaque structure describing a set of configuration options. */
53 typedef struct svn_config_t svn_config_t;
54 
55 
56 /*** Configuration Defines ***/
57 
58 /**
59  * @name Client configuration files strings
60  * Strings for the names of files, sections, and options in the
61  * client configuration files.
62  * @{
63  */
64 #define SVN_CONFIG_CATEGORY_SERVERS "servers"
65 #define SVN_CONFIG_SECTION_GROUPS "groups"
66 #define SVN_CONFIG_SECTION_GLOBAL "global"
67 #define SVN_CONFIG_OPTION_HTTP_PROXY_HOST "http-proxy-host"
68 #define SVN_CONFIG_OPTION_HTTP_PROXY_PORT "http-proxy-port"
69 #define SVN_CONFIG_OPTION_HTTP_PROXY_USERNAME "http-proxy-username"
70 #define SVN_CONFIG_OPTION_HTTP_PROXY_PASSWORD "http-proxy-password"
71 #define SVN_CONFIG_OPTION_HTTP_PROXY_EXCEPTIONS "http-proxy-exceptions"
72 #define SVN_CONFIG_OPTION_HTTP_TIMEOUT "http-timeout"
73 #define SVN_CONFIG_OPTION_HTTP_COMPRESSION "http-compression"
74 #define SVN_CONFIG_OPTION_NEON_DEBUG_MASK "neon-debug-mask"
75 #define SVN_CONFIG_OPTION_HTTP_AUTH_TYPES "http-auth-types"
76 #define SVN_CONFIG_OPTION_SSL_AUTHORITY_FILES "ssl-authority-files"
77 #define SVN_CONFIG_OPTION_SSL_TRUST_DEFAULT_CA "ssl-trust-default-ca"
78 #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE "ssl-client-cert-file"
79 #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_PASSWORD "ssl-client-cert-password"
80 #define SVN_CONFIG_OPTION_SSL_PKCS11_PROVIDER "ssl-pkcs11-provider"
81 #define SVN_CONFIG_OPTION_HTTP_LIBRARY "http-library"
82 #define SVN_CONFIG_OPTION_STORE_PASSWORDS "store-passwords"
83 #define SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS "store-plaintext-passwords"
84 #define SVN_CONFIG_OPTION_STORE_AUTH_CREDS "store-auth-creds"
85 #define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP "store-ssl-client-cert-pp"
86 #define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \
87  "store-ssl-client-cert-pp-plaintext"
88 #define SVN_CONFIG_OPTION_USERNAME "username"
89 
90 #define SVN_CONFIG_CATEGORY_CONFIG "config"
91 #define SVN_CONFIG_SECTION_AUTH "auth"
92 #define SVN_CONFIG_OPTION_PASSWORD_STORES "password-stores"
93 #define SVN_CONFIG_OPTION_KWALLET_WALLET "kwallet-wallet"
94 #define SVN_CONFIG_OPTION_KWALLET_SVN_APPLICATION_NAME_WITH_PID "kwallet-svn-application-name-with-pid"
95 /* The majority of options of the "auth" section
96  * has been moved to SVN_CONFIG_CATEGORY_SERVERS. */
97 #define SVN_CONFIG_SECTION_HELPERS "helpers"
98 #define SVN_CONFIG_OPTION_EDITOR_CMD "editor-cmd"
99 #define SVN_CONFIG_OPTION_DIFF_CMD "diff-cmd"
100 /** @since New in 1.7. */
101 #define SVN_CONFIG_OPTION_DIFF_EXTENSIONS "diff-extensions"
102 #define SVN_CONFIG_OPTION_DIFF3_CMD "diff3-cmd"
103 #define SVN_CONFIG_OPTION_DIFF3_HAS_PROGRAM_ARG "diff3-has-program-arg"
104 #define SVN_CONFIG_OPTION_MERGE_TOOL_CMD "merge-tool-cmd"
105 #define SVN_CONFIG_SECTION_MISCELLANY "miscellany"
106 #define SVN_CONFIG_OPTION_GLOBAL_IGNORES "global-ignores"
107 #define SVN_CONFIG_OPTION_LOG_ENCODING "log-encoding"
108 #define SVN_CONFIG_OPTION_USE_COMMIT_TIMES "use-commit-times"
109 #define SVN_CONFIG_OPTION_TEMPLATE_ROOT "template-root"
110 #define SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS "enable-auto-props"
111 #define SVN_CONFIG_OPTION_NO_UNLOCK "no-unlock"
112 #define SVN_CONFIG_OPTION_MIMETYPES_FILE "mime-types-file"
113 #define SVN_CONFIG_OPTION_PRESERVED_CF_EXTS "preserved-conflict-file-exts"
114 #define SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts"
115 #define SVN_CONFIG_OPTION_MEMORY_CACHE_SIZE "memory-cache-size"
116 #define SVN_CONFIG_SECTION_TUNNELS "tunnels"
117 #define SVN_CONFIG_SECTION_AUTO_PROPS "auto-props"
118 /** @} */
119 
120 /** @name Repository conf directory configuration files strings
121  * Strings for the names of sections and options in the
122  * repository conf directory configuration files.
123  * @{
124  */
125 /* For repository svnserve.conf files */
126 #define SVN_CONFIG_SECTION_GENERAL "general"
127 #define SVN_CONFIG_OPTION_ANON_ACCESS "anon-access"
128 #define SVN_CONFIG_OPTION_AUTH_ACCESS "auth-access"
129 #define SVN_CONFIG_OPTION_PASSWORD_DB "password-db"
130 #define SVN_CONFIG_OPTION_REALM "realm"
131 #define SVN_CONFIG_OPTION_AUTHZ_DB "authz-db"
132 /** @since New in 1.7. */
133 #define SVN_CONFIG_OPTION_FORCE_USERNAME_CASE "force-username-case"
134 #define SVN_CONFIG_SECTION_SASL "sasl"
135 #define SVN_CONFIG_OPTION_USE_SASL "use-sasl"
136 #define SVN_CONFIG_OPTION_MIN_SSF "min-encryption"
137 #define SVN_CONFIG_OPTION_MAX_SSF "max-encryption"
138 
139 /* For repository password database */
140 #define SVN_CONFIG_SECTION_USERS "users"
141 /** @} */
142 
143 /*** Configuration Default Values ***/
144 
145 /* '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'. */
146 /* We want this to be printed on two lines in the generated config file,
147  * but we don't want the # character to end up in the variable.
148  */
149 #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \
150  "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo"
151 #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \
152  "*.rej *~ #*# .#* .*.swp .DS_Store"
153 
154 #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \
155  SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \
156  SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2
157 
158 #define SVN_CONFIG_TRUE "TRUE"
159 #define SVN_CONFIG_FALSE "FALSE"
160 #define SVN_CONFIG_ASK "ASK"
161 
162 /* Default values for some options. Should be passed as default values
163  * to svn_config_get and friends, instead of hard-coding the defaults in
164  * multiple places. */
165 #define SVN_CONFIG_DEFAULT_OPTION_STORE_PASSWORDS TRUE
166 #define SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS SVN_CONFIG_ASK
167 #define SVN_CONFIG_DEFAULT_OPTION_STORE_AUTH_CREDS TRUE
168 #define SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP TRUE
169 #define SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \
170  SVN_CONFIG_ASK
171 
172 /** Read configuration information from the standard sources and merge it
173  * into the hash @a *cfg_hash. If @a config_dir is not NULL it specifies a
174  * directory from which to read the configuration files, overriding all
175  * other sources. Otherwise, first read any system-wide configurations
176  * (from a file or from the registry), then merge in personal
177  * configurations (again from file or registry). The hash and all its data
178  * are allocated in @a pool.
179  *
180  * @a *cfg_hash is a hash whose keys are @c const char * configuration
181  * categories (@c SVN_CONFIG_CATEGORY_SERVERS,
182  * @c SVN_CONFIG_CATEGORY_CONFIG, etc.) and whose values are the @c
183  * svn_config_t * items representing the configuration values for that
184  * category.
185  */
186 svn_error_t *
187 svn_config_get_config(apr_hash_t **cfg_hash,
188  const char *config_dir,
189  apr_pool_t *pool);
190 
191 
192 /** Set @a *cfgp to an empty @c svn_config_t structure,
193  * allocated in @a result_pool.
194  *
195  * Pass TRUE to @a section_names_case_sensitive if
196  * section names are to be populated case sensitively.
197  *
198  * @since New in 1.7.
199  */
200 svn_error_t *
202  svn_boolean_t section_names_case_sensitive,
203  apr_pool_t *result_pool);
204 
205 /** Read configuration data from @a file (a file or registry path) into
206  * @a *cfgp, allocated in @a pool.
207  *
208  * If @a file does not exist, then if @a must_exist, return an error,
209  * otherwise return an empty @c svn_config_t.
210  *
211  * If @a section_names_case_sensitive is TRUE, populate section name hashes
212  * case sensitively, except for the default SVN_CONFIG__DEFAULT_SECTION.
213  *
214  * @since New in 1.7.
215  */
216 
217 svn_error_t *
219  const char *file,
220  svn_boolean_t must_exist,
221  svn_boolean_t section_names_case_sensitive,
222  apr_pool_t *pool);
223 
224 /** Similar to svn_config_read2, but always passes FALSE to
225  * section_names_case_sensitive.
226  *
227  * @deprecated Provided for backward compatibility with 1.6 API.
228  */
230 svn_error_t *
232  const char *file,
233  svn_boolean_t must_exist,
234  apr_pool_t *pool);
235 
236 /** Like svn_config_read(), but merges the configuration data from @a file
237  * (a file or registry path) into @a *cfg, which was previously returned
238  * from svn_config_read(). This function invalidates all value
239  * expansions in @a cfg, so that the next svn_config_get() takes the
240  * modifications into account.
241  */
242 svn_error_t *
244  const char *file,
245  svn_boolean_t must_exist);
246 
247 
248 /** Find the value of a (@a section, @a option) pair in @a cfg, set @a
249  * *valuep to the value.
250  *
251  * If @a cfg is @c NULL, just sets @a *valuep to @a default_value. If
252  * the value does not exist, expand and return @a default_value. @a
253  * default_value can be NULL.
254  *
255  * The returned value will be valid at least until the next call to
256  * svn_config_get(), or for the lifetime of @a default_value. It is
257  * safest to consume the returned value immediately.
258  *
259  * This function may change @a cfg by expanding option values.
260  */
261 void
263  const char **valuep,
264  const char *section,
265  const char *option,
266  const char *default_value);
267 
268 /** Add or replace the value of a (@a section, @a option) pair in @a cfg with
269  * @a value.
270  *
271  * This function invalidates all value expansions in @a cfg.
272  *
273  * To remove an option, pass NULL for the @a value.
274  */
275 void
277  const char *section,
278  const char *option,
279  const char *value);
280 
281 /** Like svn_config_get(), but for boolean values.
282  *
283  * Parses the option as a boolean value. The recognized representations
284  * are 'TRUE'/'FALSE', 'yes'/'no', 'on'/'off', '1'/'0'; case does not
285  * matter. Returns an error if the option doesn't contain a known string.
286  */
287 svn_error_t *
289  svn_boolean_t *valuep,
290  const char *section,
291  const char *option,
292  svn_boolean_t default_value);
293 
294 /** Like svn_config_set(), but for boolean values.
295  *
296  * Sets the option to 'TRUE'/'FALSE', depending on @a value.
297  */
298 void
300  const char *section,
301  const char *option,
302  svn_boolean_t value);
303 
304 /** Like svn_config_get(), but only for yes/no/ask values.
305  *
306  * Parse @a option in @a section and set @a *valuep to one of
307  * SVN_CONFIG_TRUE, SVN_CONFIG_FALSE, or SVN_CONFIG_ASK. If there is
308  * no setting for @a option, then parse @a default_value and set
309  * @a *valuep accordingly. If @a default_value is NULL, the result is
310  * undefined, and may be an error; we recommend that you pass one of
311  * SVN_CONFIG_TRUE, SVN_CONFIG_FALSE, or SVN_CONFIG_ASK for @a default value.
312  *
313  * Valid representations are (at least) "true"/"false", "yes"/"no",
314  * "on"/"off", "1"/"0", and "ask"; they are case-insensitive. Return
315  * an SVN_ERR_BAD_CONFIG_VALUE error if either @a default_value or
316  * @a option's value is not a valid representation.
317  *
318  * @since New in 1.6.
319  */
320 svn_error_t *
322  const char **valuep,
323  const char *section,
324  const char *option,
325  const char* default_value);
326 
327 /** Similar to @c svn_config_section_enumerator2_t, but is not
328  * provided with a memory pool argument.
329  *
330  * See svn_config_enumerate_sections() for the details of this type.
331  *
332  * @deprecated Provided for backwards compatibility with the 1.2 API.
333  */
334 typedef svn_boolean_t (*svn_config_section_enumerator_t)(const char *name,
335  void *baton);
336 
337 /** Similar to svn_config_enumerate_sections2(), but uses a memory pool of
338  * @a cfg instead of one that is explicitly provided.
339  *
340  * @deprecated Provided for backwards compatibility with the 1.2 API.
341  */
343 int
346  void *baton);
347 
348 /** A callback function used in enumerating config sections.
349  *
350  * See svn_config_enumerate_sections2() for the details of this type.
351  *
352  * @since New in 1.3.
353  */
355  void *baton,
356  apr_pool_t *pool);
357 
358 /** Enumerate the sections, passing @a baton and the current section's name
359  * to @a callback. Continue the enumeration if @a callback returns @c TRUE.
360  * Return the number of times @a callback was called.
361  *
362  * ### See kff's comment to svn_config_enumerate2(). It applies to this
363  * function, too. ###
364  *
365  * @a callback's @a name parameter is only valid for the duration of the call.
366  *
367  * @since New in 1.3.
368  */
369 int
372  void *baton, apr_pool_t *pool);
373 
374 /** Similar to @c svn_config_enumerator2_t, but is not
375  * provided with a memory pool argument.
376  * See svn_config_enumerate() for the details of this type.
377  *
378  * @deprecated Provided for backwards compatibility with the 1.2 API.
379  */
380 typedef svn_boolean_t (*svn_config_enumerator_t)(const char *name,
381  const char *value,
382  void *baton);
383 
384 /** Similar to svn_config_enumerate2(), but uses a memory pool of
385  * @a cfg instead of one that is explicitly provided.
386  *
387  * @deprecated Provided for backwards compatibility with the 1.2 API.
388  */
390 int
392  const char *section,
393  svn_config_enumerator_t callback,
394  void *baton);
395 
396 
397 /** A callback function used in enumerating config options.
398  *
399  * See svn_config_enumerate2() for the details of this type.
400  *
401  * @since New in 1.3.
402  */
403 typedef svn_boolean_t (*svn_config_enumerator2_t)(const char *name,
404  const char *value,
405  void *baton,
406  apr_pool_t *pool);
407 
408 /** Enumerate the options in @a section, passing @a baton and the current
409  * option's name and value to @a callback. Continue the enumeration if
410  * @a callback returns @c TRUE. Return the number of times @a callback
411  * was called.
412  *
413  * ### kff asks: A more usual interface is to continue enumerating
414  * while @a callback does not return error, and if @a callback does
415  * return error, to return the same error (or a wrapping of it)
416  * from svn_config_enumerate(). What's the use case for
417  * svn_config_enumerate()? Is it more likely to need to break out
418  * of an enumeration early, with no error, than an invocation of
419  * @a callback is likely to need to return an error? ###
420  *
421  * @a callback's @a name and @a value parameters are only valid for the
422  * duration of the call.
423  *
424  * @since New in 1.3.
425  */
426 int
428  const char *section,
429  svn_config_enumerator2_t callback,
430  void *baton,
431  apr_pool_t *pool);
432 
433 /**
434  * Return @c TRUE if @a section exists in @a cfg, @c FALSE otherwise.
435  *
436  * @since New in 1.4.
437  */
440  const char *section);
441 
442 /** Enumerate the group @a master_section in @a cfg. Each variable
443  * value is interpreted as a list of glob patterns (separated by comma
444  * and optional whitespace). Return the name of the first variable
445  * whose value matches @a key, or @c NULL if no variable matches.
446  */
447 const char *
449  const char *key,
450  const char *master_section,
451  apr_pool_t *pool);
452 
453 /** Retrieve value corresponding to @a option_name in @a cfg, or
454  * return @a default_value if none is found.
455  *
456  * The config will first be checked for a default.
457  * If @a server_group is not @c NULL, the config will also be checked
458  * for an override in a server group,
459  *
460  */
461 const char *
463  const char* server_group,
464  const char* option_name,
465  const char* default_value);
466 
467 /** Retrieve value into @a result_value corresponding to @a option_name for a
468  * given @a server_group in @a cfg, or return @a default_value if none is
469  * found.
470  *
471  * The config will first be checked for a default, then will be checked for
472  * an override in a server group. If the value found is not a valid integer,
473  * a @c svn_error_t* will be returned.
474  */
475 svn_error_t *
477  const char *server_group,
478  const char *option_name,
479  apr_int64_t default_value,
480  apr_int64_t *result_value,
481  apr_pool_t *pool);
482 
483 
484 /** Set @a *valuep according to @a option_name for a given
485  * @a server_group in @a cfg, or set to @a default_value if no value is
486  * specified.
487  *
488  * Check first a default, then for an override in a server group. If
489  * a value is found but is not a valid boolean, return an
490  * SVN_ERR_BAD_CONFIG_VALUE error.
491  *
492  * @since New in 1.6.
493  */
494 svn_error_t *
496  svn_boolean_t *valuep,
497  const char *server_group,
498  const char *option_name,
499  svn_boolean_t default_value);
500 
501 
502 
503 /** Try to ensure that the user's ~/.subversion/ area exists, and create
504  * no-op template files for any absent config files. Use @a pool for any
505  * temporary allocation. If @a config_dir is not @c NULL it specifies a
506  * directory from which to read the config overriding all other sources.
507  *
508  * Don't error if something exists but is the wrong kind (for example,
509  * ~/.subversion exists but is a file, or ~/.subversion/servers exists
510  * but is a directory).
511  *
512  * Also don't error if trying to create something and failing -- it's
513  * okay for the config area or its contents not to be created.
514  * However, if creating a config template file succeeds, return an
515  * error if unable to initialize its contents.
516  */
517 svn_error_t *
518 svn_config_ensure(const char *config_dir,
519  apr_pool_t *pool);
520 
521 
522 
523 
524 /** Accessing cached authentication data in the user config area.
525  *
526  * @defgroup cached_authentication_data Cached authentication data
527  * @{
528  */
529 
530 
531 /** A hash-key pointing to a realmstring. Every file containing
532  * authentication data should have this key.
533  */
534 #define SVN_CONFIG_REALMSTRING_KEY "svn:realmstring"
535 
536 /** Use @a cred_kind and @a realmstring to locate a file within the
537  * ~/.subversion/auth/ area. If the file exists, initialize @a *hash
538  * and load the file contents into the hash, using @a pool. If the
539  * file doesn't exist, set @a *hash to NULL.
540  *
541  * If @a config_dir is not NULL it specifies a directory from which to
542  * read the config overriding all other sources.
543  *
544  * Besides containing the original credential fields, the hash will
545  * also contain @c SVN_CONFIG_REALMSTRING_KEY. The caller can examine
546  * this value as a sanity-check that the correct file was loaded.
547  *
548  * The hashtable will contain <tt>const char *</tt> keys and
549  * <tt>svn_string_t *</tt> values.
550  */
551 svn_error_t *
552 svn_config_read_auth_data(apr_hash_t **hash,
553  const char *cred_kind,
554  const char *realmstring,
555  const char *config_dir,
556  apr_pool_t *pool);
557 
558 /** Use @a cred_kind and @a realmstring to create or overwrite a file
559  * within the ~/.subversion/auth/ area. Write the contents of @a hash into
560  * the file. If @a config_dir is not NULL it specifies a directory to read
561  * the config overriding all other sources.
562  *
563  * Also, add @a realmstring to the file, with key @c
564  * SVN_CONFIG_REALMSTRING_KEY. This allows programs (or users) to
565  * verify exactly which set credentials live within the file.
566  *
567  * The hashtable must contain <tt>const char *</tt> keys and
568  * <tt>svn_string_t *</tt> values.
569  */
570 svn_error_t *
571 svn_config_write_auth_data(apr_hash_t *hash,
572  const char *cred_kind,
573  const char *realmstring,
574  const char *config_dir,
575  apr_pool_t *pool);
576 
577 /** Put the absolute path to the user's configuration directory,
578  * or to a file within that directory, into @a *path.
579  *
580  * If @a config_dir is not NULL, it must point to an alternative
581  * config directory location. If it is NULL, the default location
582  * is used. If @a fname is not NULL, it must specify the last
583  * component of the path to be returned. This can be used to create
584  * a path to any file in the configuration directory.
585  *
586  * Do all allocations in @a pool.
587  *
588  * Hint:
589  * To get the user configuration file, pass @c SVN_CONFIG_CATEGORY_CONFIG
590  * for @a fname. To get the servers configuration file, pass
591  * @c SVN_CONFIG_CATEGORY_SERVERS for @a fname.
592  *
593  * @since New in 1.6.
594  */
595 svn_error_t *
596 svn_config_get_user_config_path(const char **path,
597  const char *config_dir,
598  const char *fname,
599  apr_pool_t *pool);
600 
601 /** @} */
602 
603 #ifdef __cplusplus
604 }
605 #endif /* __cplusplus */
606 
607 #endif /* SVN_CONFIG_H */
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 *c...
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.
Definition: svn_config.h:403
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_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.
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)
Read configuration data from file (a file or registry path) into *cfgp, allocated in pool...
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...
svn_error_t * svn_config_create(svn_config_t **cfgp, svn_boolean_t section_names_case_sensitive, apr_pool_t *result_pool)
Set *cfgp to an empty svn_config_t structure, allocated in result_pool.
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.
Definition: svn_config.h:380
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.
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 exp...
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...
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.
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. ...
Subversion error object.
Definition: svn_types.h:90
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.
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...
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.
struct svn_config_t svn_config_t
Opaque structure describing a set of configuration options.
Definition: svn_config.h:53
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...
Definition: svn_config.h:334
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 v...
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...
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.
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 p...
Subversion's data types.
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 abs...
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...
#define SVN_DEPRECATED
Macro used to mark deprecated functions.
Definition: svn_types.h:58
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.
int svn_boolean_t
YABT: Yet Another Boolean Type.
Definition: svn_types.h:370
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...
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.
Definition: svn_config.h:354
svn_error_t * svn_config_read(svn_config_t **cfgp, const char *file, svn_boolean_t must_exist, apr_pool_t *pool)
Similar to svn_config_read2, but always passes FALSE to section_names_case_sensitive.