2 * config_impl.h : private header for the config file implementation.
4 * ====================================================================
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License. You may obtain a copy of the License at
13 * http://www.apache.org/licenses/LICENSE-2.0
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied. See the License for the
19 * specific language governing permissions and limitations
21 * ====================================================================
26 #ifndef SVN_LIBSVN_SUBR_CONFIG_IMPL_H
27 #define SVN_LIBSVN_SUBR_CONFIG_IMPL_H
29 #define APR_WANT_STDIO
33 #include "svn_types.h"
34 #include "svn_string.h"
36 #include "svn_config.h"
37 #include "svn_private_config.h"
41 #endif /* __cplusplus */
44 /* The configuration data. This is a superhash of sections and options. */
47 /* Table of cfg_section_t's. */
50 /* Pool for hash tables, table entries and unexpanded values */
53 /* Pool for expanded values -- this is separate, so that we can
54 clear it when modifying the config data. */
57 /* Indicates that some values in the configuration have been expanded. */
58 svn_boolean_t x_values;
60 /* Temporary string used for lookups. (Using a stringbuf so that
61 frequent resetting is efficient.) */
62 svn_stringbuf_t *tmp_key;
64 /* Temporary value used for expanded default values in svn_config_get.
65 (Using a stringbuf so that frequent resetting is efficient.) */
66 svn_stringbuf_t *tmp_value;
68 /* Specifies whether section names are populated case sensitively. */
69 svn_boolean_t section_names_case_sensitive;
71 /* Specifies whether option names are populated case sensitively. */
72 svn_boolean_t option_names_case_sensitive;
76 /* Read sections and options from a file. */
77 svn_error_t *svn_config__parse_file(svn_config_t *cfg,
79 svn_boolean_t must_exist,
82 /* Read sections and options from a stream. */
83 svn_error_t *svn_config__parse_stream(svn_config_t *cfg,
85 apr_pool_t *result_pool,
86 apr_pool_t *scratch_pool);
88 /* The name of the magic [DEFAULT] section. */
89 #define SVN_CONFIG__DEFAULT_SECTION "DEFAULT"
93 /* Get the common or user-specific AppData folder */
94 svn_error_t *svn_config__win_config_path(const char **folder,
98 /* Read sections and options from the Windows Registry. */
99 svn_error_t *svn_config__parse_registry(svn_config_t *cfg,
101 svn_boolean_t must_exist,
104 /* ### It's unclear to me whether this registry stuff should get the
105 double underscore or not, and if so, where the extra underscore
106 would go. Thoughts? -kff */
107 # define SVN_REGISTRY_PREFIX "REGISTRY:"
108 # define SVN_REGISTRY_PREFIX_LEN ((sizeof(SVN_REGISTRY_PREFIX)) - 1)
109 # define SVN_REGISTRY_HKLM "HKLM\\"
110 # define SVN_REGISTRY_HKLM_LEN ((sizeof(SVN_REGISTRY_HKLM)) - 1)
111 # define SVN_REGISTRY_HKCU "HKCU\\"
112 # define SVN_REGISTRY_HKCU_LEN ((sizeof(SVN_REGISTRY_HKCU)) - 1)
113 # define SVN_REGISTRY_PATH "Software\\Tigris.org\\Subversion\\"
114 # define SVN_REGISTRY_PATH_LEN ((sizeof(SVN_REGISTRY_PATH)) - 1)
115 # define SVN_REGISTRY_SYS_CONFIG_PATH \
116 SVN_REGISTRY_PREFIX \
119 # define SVN_REGISTRY_USR_CONFIG_PATH \
120 SVN_REGISTRY_PREFIX \
125 /* System-wide and configuration subdirectory names.
126 NOTE: Don't use these directly; call svn_config__sys_config_path()
127 or svn_config_get_user_config_path() instead. */
129 # define SVN_CONFIG__SUBDIRECTORY "Subversion"
130 #elif defined __HAIKU__ /* HAIKU */
131 # define SVN_CONFIG__SYS_DIRECTORY "subversion"
132 # define SVN_CONFIG__USR_DIRECTORY "subversion"
133 #else /* ! WIN32 && ! __HAIKU__ */
134 # define SVN_CONFIG__SYS_DIRECTORY "/etc/subversion"
135 # define SVN_CONFIG__USR_DIRECTORY ".subversion"
138 /* The description/instructions file in the config directory. */
139 #define SVN_CONFIG__USR_README_FILE "README.txt"
141 /* The name of the main authentication subdir in the config directory */
142 #define SVN_CONFIG__AUTH_SUBDIR "auth"
144 /* Set *PATH_P to the path to config file FNAME in the system
145 configuration area, allocated in POOL. If FNAME is NULL, set
146 *PATH_P to the directory name of the system config area, either
147 allocated in POOL or a static constant string.
149 If the system configuration area cannot be located (possible under
150 Win32), set *PATH_P to NULL regardless of FNAME. */
152 svn_config__sys_config_path(const char **path_p,
159 #endif /* __cplusplus */
161 #endif /* SVN_LIBSVN_SUBR_CONFIG_IMPL_H */