GME
13
|
00001 00028 00029 #ifndef SVN_CONFIG_H 00030 #define SVN_CONFIG_H 00031 00032 #include <apr.h> /* for apr_int64_t */ 00033 #include <apr_pools.h> /* for apr_pool_t */ 00034 #include <apr_hash.h> /* for apr_hash_t */ 00035 00036 #include "svn_types.h" 00037 #include "svn_io.h" 00038 00039 #ifdef __cplusplus 00040 extern "C" { 00041 #endif /* __cplusplus */ 00042 00043 00044 /************************************************************************** 00045 *** *** 00046 *** For a description of the SVN configuration file syntax, see *** 00047 *** your ~/.subversion/README, which is written out automatically by *** 00048 *** svn_config_ensure(). *** 00049 *** *** 00050 **************************************************************************/ 00051 00052 00054 typedef struct svn_config_t svn_config_t; 00055 00056 00057 /*** Configuration Defines ***/ 00058 00066 /* This list of #defines is intentionally presented as a nested list 00067 that matches the in-config hierarchy. */ 00068 00069 #define SVN_CONFIG_CATEGORY_SERVERS "servers" 00070 #define SVN_CONFIG_SECTION_GROUPS "groups" 00071 #define SVN_CONFIG_SECTION_GLOBAL "global" 00072 #define SVN_CONFIG_OPTION_HTTP_PROXY_HOST "http-proxy-host" 00073 #define SVN_CONFIG_OPTION_HTTP_PROXY_PORT "http-proxy-port" 00074 #define SVN_CONFIG_OPTION_HTTP_PROXY_USERNAME "http-proxy-username" 00075 #define SVN_CONFIG_OPTION_HTTP_PROXY_PASSWORD "http-proxy-password" 00076 #define SVN_CONFIG_OPTION_HTTP_PROXY_EXCEPTIONS "http-proxy-exceptions" 00077 #define SVN_CONFIG_OPTION_HTTP_TIMEOUT "http-timeout" 00078 #define SVN_CONFIG_OPTION_HTTP_COMPRESSION "http-compression" 00079 #define SVN_CONFIG_OPTION_NEON_DEBUG_MASK "neon-debug-mask" 00080 #define SVN_CONFIG_OPTION_HTTP_AUTH_TYPES "http-auth-types" 00081 #define SVN_CONFIG_OPTION_SSL_AUTHORITY_FILES "ssl-authority-files" 00082 #define SVN_CONFIG_OPTION_SSL_TRUST_DEFAULT_CA "ssl-trust-default-ca" 00083 #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE "ssl-client-cert-file" 00084 #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_PASSWORD "ssl-client-cert-password" 00085 #define SVN_CONFIG_OPTION_SSL_PKCS11_PROVIDER "ssl-pkcs11-provider" 00086 #define SVN_CONFIG_OPTION_HTTP_LIBRARY "http-library" 00087 #define SVN_CONFIG_OPTION_STORE_PASSWORDS "store-passwords" 00088 #define SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS "store-plaintext-passwords" 00089 #define SVN_CONFIG_OPTION_STORE_AUTH_CREDS "store-auth-creds" 00090 #define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP "store-ssl-client-cert-pp" 00091 #define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \ 00092 "store-ssl-client-cert-pp-plaintext" 00093 #define SVN_CONFIG_OPTION_USERNAME "username" 00094 00095 #define SVN_CONFIG_OPTION_HTTP_BULK_UPDATES "http-bulk-updates" 00096 00097 #define SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS "http-max-connections" 00098 00099 #define SVN_CONFIG_CATEGORY_CONFIG "config" 00100 #define SVN_CONFIG_SECTION_AUTH "auth" 00101 #define SVN_CONFIG_OPTION_PASSWORD_STORES "password-stores" 00102 #define SVN_CONFIG_OPTION_KWALLET_WALLET "kwallet-wallet" 00103 #define SVN_CONFIG_OPTION_KWALLET_SVN_APPLICATION_NAME_WITH_PID "kwallet-svn-application-name-with-pid" 00104 00105 #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE_PROMPT "ssl-client-cert-file-prompt" 00106 /* The majority of options of the "auth" section 00107 * has been moved to SVN_CONFIG_CATEGORY_SERVERS. */ 00108 #define SVN_CONFIG_SECTION_HELPERS "helpers" 00109 #define SVN_CONFIG_OPTION_EDITOR_CMD "editor-cmd" 00110 #define SVN_CONFIG_OPTION_DIFF_CMD "diff-cmd" 00111 00112 #define SVN_CONFIG_OPTION_DIFF_EXTENSIONS "diff-extensions" 00113 #define SVN_CONFIG_OPTION_DIFF3_CMD "diff3-cmd" 00114 #define SVN_CONFIG_OPTION_DIFF3_HAS_PROGRAM_ARG "diff3-has-program-arg" 00115 #define SVN_CONFIG_OPTION_MERGE_TOOL_CMD "merge-tool-cmd" 00116 #define SVN_CONFIG_SECTION_MISCELLANY "miscellany" 00117 #define SVN_CONFIG_OPTION_GLOBAL_IGNORES "global-ignores" 00118 #define SVN_CONFIG_OPTION_LOG_ENCODING "log-encoding" 00119 #define SVN_CONFIG_OPTION_USE_COMMIT_TIMES "use-commit-times" 00120 00121 #define SVN_CONFIG_OPTION_TEMPLATE_ROOT "template-root" 00122 #define SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS "enable-auto-props" 00123 #define SVN_CONFIG_OPTION_NO_UNLOCK "no-unlock" 00124 #define SVN_CONFIG_OPTION_MIMETYPES_FILE "mime-types-file" 00125 #define SVN_CONFIG_OPTION_PRESERVED_CF_EXTS "preserved-conflict-file-exts" 00126 #define SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts" 00127 #define SVN_CONFIG_OPTION_MEMORY_CACHE_SIZE "memory-cache-size" 00128 #define SVN_CONFIG_SECTION_TUNNELS "tunnels" 00129 #define SVN_CONFIG_SECTION_AUTO_PROPS "auto-props" 00130 00131 #define SVN_CONFIG_SECTION_WORKING_COPY "working-copy" 00132 00133 #define SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE "exclusive-locking" 00134 00135 #define SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE_CLIENTS "exclusive-locking-clients" 00136 00143 /* For repository svnserve.conf files */ 00144 #define SVN_CONFIG_SECTION_GENERAL "general" 00145 #define SVN_CONFIG_OPTION_ANON_ACCESS "anon-access" 00146 #define SVN_CONFIG_OPTION_AUTH_ACCESS "auth-access" 00147 #define SVN_CONFIG_OPTION_PASSWORD_DB "password-db" 00148 #define SVN_CONFIG_OPTION_REALM "realm" 00149 #define SVN_CONFIG_OPTION_AUTHZ_DB "authz-db" 00150 00151 #define SVN_CONFIG_OPTION_GROUPS_DB "groups-db" 00152 00153 #define SVN_CONFIG_OPTION_FORCE_USERNAME_CASE "force-username-case" 00154 00155 #define SVN_CONFIG_OPTION_HOOKS_ENV "hooks-env" 00156 #define SVN_CONFIG_SECTION_SASL "sasl" 00157 #define SVN_CONFIG_OPTION_USE_SASL "use-sasl" 00158 #define SVN_CONFIG_OPTION_MIN_SSF "min-encryption" 00159 #define SVN_CONFIG_OPTION_MAX_SSF "max-encryption" 00160 00161 /* For repository password database */ 00162 #define SVN_CONFIG_SECTION_USERS "users" 00163 00165 /*** Configuration Default Values ***/ 00166 00167 /* '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'. */ 00168 /* We want this to be printed on two lines in the generated config file, 00169 * but we don't want the # character to end up in the variable. 00170 */ 00171 #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \ 00172 "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__" 00173 #define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \ 00174 "*.rej *~ #*# .#* .*.swp .DS_Store" 00175 00176 #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \ 00177 SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \ 00178 SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 00179 00180 #define SVN_CONFIG_TRUE "TRUE" 00181 #define SVN_CONFIG_FALSE "FALSE" 00182 #define SVN_CONFIG_ASK "ASK" 00183 00184 /* Default values for some options. Should be passed as default values 00185 * to svn_config_get and friends, instead of hard-coding the defaults in 00186 * multiple places. */ 00187 #define SVN_CONFIG_DEFAULT_OPTION_STORE_PASSWORDS TRUE 00188 #define SVN_CONFIG_DEFAULT_OPTION_STORE_PLAINTEXT_PASSWORDS SVN_CONFIG_ASK 00189 #define SVN_CONFIG_DEFAULT_OPTION_STORE_AUTH_CREDS TRUE 00190 #define SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP TRUE 00191 #define SVN_CONFIG_DEFAULT_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \ 00192 SVN_CONFIG_ASK 00193 #define SVN_CONFIG_DEFAULT_OPTION_HTTP_MAX_CONNECTIONS 4 00194 00209 svn_error_t * 00210 svn_config_get_config(apr_hash_t **cfg_hash, 00211 const char *config_dir, 00212 apr_pool_t *pool); 00213 00225 svn_error_t * 00226 svn_config_create2(svn_config_t **cfgp, 00227 svn_boolean_t section_names_case_sensitive, 00228 svn_boolean_t option_names_case_sensitive, 00229 apr_pool_t *result_pool); 00230 00237 SVN_DEPRECATED 00238 svn_error_t * 00239 svn_config_create(svn_config_t **cfgp, 00240 svn_boolean_t section_names_case_sensitive, 00241 apr_pool_t *result_pool); 00242 00257 svn_error_t * 00258 svn_config_read3(svn_config_t **cfgp, 00259 const char *file, 00260 svn_boolean_t must_exist, 00261 svn_boolean_t section_names_case_sensitive, 00262 svn_boolean_t option_names_case_sensitive, 00263 apr_pool_t *result_pool); 00264 00271 SVN_DEPRECATED 00272 svn_error_t * 00273 svn_config_read2(svn_config_t **cfgp, 00274 const char *file, 00275 svn_boolean_t must_exist, 00276 svn_boolean_t section_names_case_sensitive, 00277 apr_pool_t *result_pool); 00278 00284 SVN_DEPRECATED 00285 svn_error_t * 00286 svn_config_read(svn_config_t **cfgp, 00287 const char *file, 00288 svn_boolean_t must_exist, 00289 apr_pool_t *result_pool); 00290 00303 svn_error_t * 00304 svn_config_parse(svn_config_t **cfgp, 00305 svn_stream_t *stream, 00306 svn_boolean_t section_names_case_sensitive, 00307 svn_boolean_t option_names_case_sensitive, 00308 apr_pool_t *result_pool); 00309 00316 svn_error_t * 00317 svn_config_merge(svn_config_t *cfg, 00318 const char *file, 00319 svn_boolean_t must_exist); 00320 00321 00335 void 00336 svn_config_get(svn_config_t *cfg, 00337 const char **valuep, 00338 const char *section, 00339 const char *option, 00340 const char *default_value); 00341 00349 void 00350 svn_config_set(svn_config_t *cfg, 00351 const char *section, 00352 const char *option, 00353 const char *value); 00354 00361 svn_error_t * 00362 svn_config_get_bool(svn_config_t *cfg, 00363 svn_boolean_t *valuep, 00364 const char *section, 00365 const char *option, 00366 svn_boolean_t default_value); 00367 00372 void 00373 svn_config_set_bool(svn_config_t *cfg, 00374 const char *section, 00375 const char *option, 00376 svn_boolean_t value); 00377 00387 svn_error_t * 00388 svn_config_get_int64(svn_config_t *cfg, 00389 apr_int64_t *valuep, 00390 const char *section, 00391 const char *option, 00392 apr_int64_t default_value); 00393 00401 void 00402 svn_config_set_int64(svn_config_t *cfg, 00403 const char *section, 00404 const char *option, 00405 apr_int64_t value); 00406 00423 svn_error_t * 00424 svn_config_get_yes_no_ask(svn_config_t *cfg, 00425 const char **valuep, 00426 const char *section, 00427 const char *option, 00428 const char* default_value); 00429 00443 svn_error_t * 00444 svn_config_get_tristate(svn_config_t *cfg, 00445 svn_tristate_t *valuep, 00446 const char *section, 00447 const char *option, 00448 const char *unknown_value, 00449 svn_tristate_t default_value); 00450 00458 typedef svn_boolean_t (*svn_config_section_enumerator_t)(const char *name, 00459 void *baton); 00460 00466 SVN_DEPRECATED 00467 int 00468 svn_config_enumerate_sections(svn_config_t *cfg, 00469 svn_config_section_enumerator_t callback, 00470 void *baton); 00471 00478 typedef svn_boolean_t (*svn_config_section_enumerator2_t)(const char *name, 00479 void *baton, 00480 apr_pool_t *pool); 00481 00493 int 00494 svn_config_enumerate_sections2(svn_config_t *cfg, 00495 svn_config_section_enumerator2_t callback, 00496 void *baton, apr_pool_t *pool); 00497 00504 typedef svn_boolean_t (*svn_config_enumerator_t)(const char *name, 00505 const char *value, 00506 void *baton); 00507 00513 SVN_DEPRECATED 00514 int 00515 svn_config_enumerate(svn_config_t *cfg, 00516 const char *section, 00517 svn_config_enumerator_t callback, 00518 void *baton); 00519 00520 00527 typedef svn_boolean_t (*svn_config_enumerator2_t)(const char *name, 00528 const char *value, 00529 void *baton, 00530 apr_pool_t *pool); 00531 00550 int 00551 svn_config_enumerate2(svn_config_t *cfg, 00552 const char *section, 00553 svn_config_enumerator2_t callback, 00554 void *baton, 00555 apr_pool_t *pool); 00556 00562 svn_boolean_t 00563 svn_config_has_section(svn_config_t *cfg, 00564 const char *section); 00565 00571 const char * 00572 svn_config_find_group(svn_config_t *cfg, 00573 const char *key, 00574 const char *master_section, 00575 apr_pool_t *pool); 00576 00585 const char * 00586 svn_config_get_server_setting(svn_config_t *cfg, 00587 const char* server_group, 00588 const char* option_name, 00589 const char* default_value); 00590 00599 svn_error_t * 00600 svn_config_get_server_setting_int(svn_config_t *cfg, 00601 const char *server_group, 00602 const char *option_name, 00603 apr_int64_t default_value, 00604 apr_int64_t *result_value, 00605 apr_pool_t *pool); 00606 00607 00618 svn_error_t * 00619 svn_config_get_server_setting_bool(svn_config_t *cfg, 00620 svn_boolean_t *valuep, 00621 const char *server_group, 00622 const char *option_name, 00623 svn_boolean_t default_value); 00624 00625 00626 00641 svn_error_t * 00642 svn_config_ensure(const char *config_dir, 00643 apr_pool_t *pool); 00644 00645 00646 00647 00658 #define SVN_CONFIG_REALMSTRING_KEY "svn:realmstring" 00659 00675 svn_error_t * 00676 svn_config_read_auth_data(apr_hash_t **hash, 00677 const char *cred_kind, 00678 const char *realmstring, 00679 const char *config_dir, 00680 apr_pool_t *pool); 00681 00694 svn_error_t * 00695 svn_config_write_auth_data(apr_hash_t *hash, 00696 const char *cred_kind, 00697 const char *realmstring, 00698 const char *config_dir, 00699 apr_pool_t *pool); 00700 00701 00722 typedef svn_error_t * 00723 (*svn_config_auth_walk_func_t)(svn_boolean_t *delete_cred, 00724 void *cleanup_baton, 00725 const char *cred_kind, 00726 const char *realmstring, 00727 apr_hash_t *hash, 00728 apr_pool_t *scratch_pool); 00729 00758 svn_error_t * 00759 svn_config_walk_auth_data(const char *config_dir, 00760 svn_config_auth_walk_func_t walk_func, 00761 void *walk_baton, 00762 apr_pool_t *scratch_pool); 00763 00782 svn_error_t * 00783 svn_config_get_user_config_path(const char **path, 00784 const char *config_dir, 00785 const char *fname, 00786 apr_pool_t *pool); 00787 00793 svn_error_t * 00794 svn_config_dup(svn_config_t **cfgp, 00795 svn_config_t *src, 00796 apr_pool_t *pool); 00797 00803 svn_error_t * 00804 svn_config_copy_config(apr_hash_t **cfg_hash, 00805 apr_hash_t *src_hash, 00806 apr_pool_t *pool); 00807 00810 #ifdef __cplusplus 00811 } 00812 #endif /* __cplusplus */ 00813 00814 #endif /* SVN_CONFIG_H */