2 * deprecated.c: holding file for all deprecated APIs.
3 * "we can't lose 'em, but we can shun 'em!"
5 * ====================================================================
6 * Licensed to the Apache Software Foundation (ASF) under one
7 * or more contributor license agreements. See the NOTICE file
8 * distributed with this work for additional information
9 * regarding copyright ownership. The ASF licenses this file
10 * to you under the Apache License, Version 2.0 (the
11 * "License"); you may not use this file except in compliance
12 * with the License. You may obtain a copy of the License at
14 * http://www.apache.org/licenses/LICENSE-2.0
16 * Unless required by applicable law or agreed to in writing,
17 * software distributed under the License is distributed on an
18 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
19 * KIND, either express or implied. See the License for the
20 * specific language governing permissions and limitations
22 * ====================================================================
25 /* ==================================================================== */
31 /* We define this here to remove any further warnings about the usage of
32 deprecated functions in this file. */
33 #define SVN_DEPRECATED
36 #include "svn_subst.h"
39 #include "svn_cmdline.h"
40 #include "svn_version.h"
41 #include "svn_pools.h"
43 #include "svn_mergeinfo.h"
48 #include "private/svn_opt_private.h"
49 #include "private/svn_mergeinfo_private.h"
51 #include "svn_private_config.h"
58 /*** From subst.c ***/
59 /* Convert an old-style svn_subst_keywords_t struct * into a new-style
60 * keywords hash. Keyword values are shallow copies, so the produced
61 * hash must not be assumed to have lifetime longer than the struct it
62 * is based on. A NULL input causes a NULL output. */
64 kwstruct_to_kwhash(const svn_subst_keywords_t *kwstruct,
72 kwhash = apr_hash_make(pool);
74 if (kwstruct->revision)
76 svn_hash_sets(kwhash, SVN_KEYWORD_REVISION_LONG, kwstruct->revision);
77 svn_hash_sets(kwhash, SVN_KEYWORD_REVISION_MEDIUM, kwstruct->revision);
78 svn_hash_sets(kwhash, SVN_KEYWORD_REVISION_SHORT, kwstruct->revision);
82 svn_hash_sets(kwhash, SVN_KEYWORD_DATE_LONG, kwstruct->date);
83 svn_hash_sets(kwhash, SVN_KEYWORD_DATE_SHORT, kwstruct->date);
87 svn_hash_sets(kwhash, SVN_KEYWORD_AUTHOR_LONG, kwstruct->author);
88 svn_hash_sets(kwhash, SVN_KEYWORD_AUTHOR_SHORT, kwstruct->author);
92 svn_hash_sets(kwhash, SVN_KEYWORD_URL_LONG, kwstruct->url);
93 svn_hash_sets(kwhash, SVN_KEYWORD_URL_SHORT, kwstruct->url);
97 svn_hash_sets(kwhash, SVN_KEYWORD_ID, kwstruct->id);
105 svn_subst_translate_stream3(svn_stream_t *src_stream,
106 svn_stream_t *dst_stream,
108 svn_boolean_t repair,
109 apr_hash_t *keywords,
110 svn_boolean_t expand,
113 /* The docstring requires that *some* translation be requested. */
114 SVN_ERR_ASSERT(eol_str || keywords);
116 /* We don't want the copy3 to close the provided streams. */
117 src_stream = svn_stream_disown(src_stream, pool);
118 dst_stream = svn_stream_disown(dst_stream, pool);
120 /* Wrap the destination stream with our translation stream. It is more
121 efficient than wrapping the source stream. */
122 dst_stream = svn_subst_stream_translated(dst_stream, eol_str, repair,
123 keywords, expand, pool);
125 return svn_error_trace(svn_stream_copy3(src_stream, dst_stream,
130 svn_subst_translate_stream2(svn_stream_t *s, /* src stream */
131 svn_stream_t *d, /* dst stream */
133 svn_boolean_t repair,
134 const svn_subst_keywords_t *keywords,
135 svn_boolean_t expand,
138 apr_hash_t *kh = kwstruct_to_kwhash(keywords, pool);
140 return svn_error_trace(svn_subst_translate_stream3(s, d, eol_str, repair,
145 svn_subst_translate_stream(svn_stream_t *s, /* src stream */
146 svn_stream_t *d, /* dst stream */
148 svn_boolean_t repair,
149 const svn_subst_keywords_t *keywords,
150 svn_boolean_t expand)
152 apr_pool_t *pool = svn_pool_create(NULL);
153 svn_error_t *err = svn_subst_translate_stream2(s, d, eol_str, repair,
154 keywords, expand, pool);
155 svn_pool_destroy(pool);
156 return svn_error_trace(err);
160 svn_subst_translate_cstring(const char *src,
163 svn_boolean_t repair,
164 const svn_subst_keywords_t *keywords,
165 svn_boolean_t expand,
168 apr_hash_t *kh = kwstruct_to_kwhash(keywords, pool);
170 return svn_error_trace(svn_subst_translate_cstring2(src, dst, eol_str,
176 svn_subst_copy_and_translate(const char *src,
179 svn_boolean_t repair,
180 const svn_subst_keywords_t *keywords,
181 svn_boolean_t expand,
184 return svn_error_trace(svn_subst_copy_and_translate2(src, dst, eol_str,
186 expand, FALSE, pool));
190 svn_subst_copy_and_translate2(const char *src,
193 svn_boolean_t repair,
194 const svn_subst_keywords_t *keywords,
195 svn_boolean_t expand,
196 svn_boolean_t special,
199 apr_hash_t *kh = kwstruct_to_kwhash(keywords, pool);
201 return svn_error_trace(svn_subst_copy_and_translate3(src, dst, eol_str,
207 svn_subst_copy_and_translate3(const char *src,
210 svn_boolean_t repair,
211 apr_hash_t *keywords,
212 svn_boolean_t expand,
213 svn_boolean_t special,
216 return svn_error_trace(svn_subst_copy_and_translate4(src, dst, eol_str,
225 svn_subst_stream_translated_to_normal_form(svn_stream_t **stream,
226 svn_stream_t *source,
227 svn_subst_eol_style_t eol_style,
229 svn_boolean_t always_repair_eols,
230 apr_hash_t *keywords,
233 if (eol_style == svn_subst_eol_style_native)
234 eol_str = SVN_SUBST_NATIVE_EOL_STR;
235 else if (! (eol_style == svn_subst_eol_style_fixed
236 || eol_style == svn_subst_eol_style_none))
237 return svn_error_create(SVN_ERR_IO_UNKNOWN_EOL, NULL, NULL);
239 *stream = svn_subst_stream_translated(source, eol_str,
240 eol_style == svn_subst_eol_style_fixed
241 || always_repair_eols,
242 keywords, FALSE, pool);
248 svn_subst_translate_string(svn_string_t **new_value,
249 const svn_string_t *value,
250 const char *encoding,
253 return svn_subst_translate_string2(new_value, NULL, NULL, value,
254 encoding, FALSE, pool, pool);
258 svn_subst_stream_detranslated(svn_stream_t **stream_p,
260 svn_subst_eol_style_t eol_style,
262 svn_boolean_t always_repair_eols,
263 apr_hash_t *keywords,
264 svn_boolean_t special,
267 svn_stream_t *src_stream;
270 return svn_subst_read_specialfile(stream_p, src, pool, pool);
272 /* This will be closed by svn_subst_stream_translated_to_normal_form
273 when the returned stream is closed. */
274 SVN_ERR(svn_stream_open_readonly(&src_stream, src, pool, pool));
276 return svn_error_trace(svn_subst_stream_translated_to_normal_form(
277 stream_p, src_stream,
284 svn_subst_translate_to_normal_form(const char *src,
286 svn_subst_eol_style_t eol_style,
288 svn_boolean_t always_repair_eols,
289 apr_hash_t *keywords,
290 svn_boolean_t special,
294 if (eol_style == svn_subst_eol_style_native)
295 eol_str = SVN_SUBST_NATIVE_EOL_STR;
296 else if (! (eol_style == svn_subst_eol_style_fixed
297 || eol_style == svn_subst_eol_style_none))
298 return svn_error_create(SVN_ERR_IO_UNKNOWN_EOL, NULL, NULL);
300 return svn_error_trace(svn_subst_copy_and_translate3(
302 eol_style == svn_subst_eol_style_fixed
303 || always_repair_eols,
305 FALSE /* contract keywords */,
312 /* Same as print_command_info2(), but with deprecated struct revision. */
314 print_command_info(const svn_opt_subcommand_desc_t *cmd,
315 const apr_getopt_option_t *options_table,
320 svn_boolean_t first_time;
323 /* Print the canonical command name. */
324 SVN_ERR(svn_cmdline_fputs(cmd->name, stream, pool));
326 /* Print the list of aliases. */
328 for (i = 0; i < SVN_OPT_MAX_ALIASES; i++)
330 if (cmd->aliases[i] == NULL)
334 SVN_ERR(svn_cmdline_fputs(" (", stream, pool));
338 SVN_ERR(svn_cmdline_fputs(", ", stream, pool));
340 SVN_ERR(svn_cmdline_fputs(cmd->aliases[i], stream, pool));
344 SVN_ERR(svn_cmdline_fputs(")", stream, pool));
348 const apr_getopt_option_t *option;
349 svn_boolean_t have_options = FALSE;
351 SVN_ERR(svn_cmdline_fprintf(stream, pool, ": %s", _(cmd->help)));
353 /* Loop over all valid option codes attached to the subcommand */
354 for (i = 0; i < SVN_OPT_MAX_OPTIONS; i++)
356 if (cmd->valid_options[i])
360 SVN_ERR(svn_cmdline_fputs(_("\nValid options:\n"),
365 /* convert each option code into an option */
367 svn_opt_get_option_from_code2(cmd->valid_options[i],
368 options_table, NULL, pool);
370 /* print the option's docstring */
371 if (option && option->description)
374 svn_opt_format_option(&optstr, option, TRUE, pool);
375 SVN_ERR(svn_cmdline_fprintf(stream, pool, " %s\n",
382 SVN_ERR(svn_cmdline_fprintf(stream, pool, "\n"));
388 const svn_opt_subcommand_desc_t *
389 svn_opt_get_canonical_subcommand(const svn_opt_subcommand_desc_t *table,
390 const char *cmd_name)
394 if (cmd_name == NULL)
397 while (table[i].name) {
399 if (strcmp(cmd_name, table[i].name) == 0)
401 for (j = 0; (j < SVN_OPT_MAX_ALIASES) && table[i].aliases[j]; j++)
402 if (strcmp(cmd_name, table[i].aliases[j]) == 0)
408 /* If we get here, there was no matching subcommand name or alias. */
413 svn_opt_subcommand_help2(const char *subcommand,
414 const svn_opt_subcommand_desc2_t *table,
415 const apr_getopt_option_t *options_table,
418 svn_opt_subcommand_help3(subcommand, table, options_table,
423 svn_opt_subcommand_help(const char *subcommand,
424 const svn_opt_subcommand_desc_t *table,
425 const apr_getopt_option_t *options_table,
428 const svn_opt_subcommand_desc_t *cmd =
429 svn_opt_get_canonical_subcommand(table, subcommand);
433 err = print_command_info(cmd, options_table, TRUE, pool, stdout);
435 err = svn_cmdline_fprintf(stderr, pool,
436 _("\"%s\": unknown command.\n\n"), subcommand);
439 svn_handle_error2(err, stderr, FALSE, "svn: ");
440 svn_error_clear(err);
445 svn_opt_args_to_target_array3(apr_array_header_t **targets_p,
447 const apr_array_header_t *known_targets,
450 return svn_error_trace(svn_opt__args_to_target_array(targets_p, os,
451 known_targets, pool));
455 svn_opt_args_to_target_array2(apr_array_header_t **targets_p,
457 const apr_array_header_t *known_targets,
460 svn_error_t *err = svn_opt_args_to_target_array3(targets_p, os,
461 known_targets, pool);
463 if (err && err->apr_err == SVN_ERR_RESERVED_FILENAME_SPECIFIED)
465 svn_error_clear(err);
473 svn_opt_args_to_target_array(apr_array_header_t **targets_p,
475 const apr_array_header_t *known_targets,
476 svn_opt_revision_t *start_revision,
477 svn_opt_revision_t *end_revision,
478 svn_boolean_t extract_revisions,
481 apr_array_header_t *output_targets;
483 SVN_ERR(svn_opt_args_to_target_array2(&output_targets, os,
484 known_targets, pool));
486 if (extract_revisions)
488 svn_opt_revision_t temprev;
491 if (output_targets->nelts > 0)
493 path = APR_ARRAY_IDX(output_targets, 0, const char *);
494 SVN_ERR(svn_opt_parse_path(&temprev, &path, path, pool));
495 if (temprev.kind != svn_opt_revision_unspecified)
497 APR_ARRAY_IDX(output_targets, 0, const char *) = path;
498 start_revision->kind = temprev.kind;
499 start_revision->value = temprev.value;
502 if (output_targets->nelts > 1)
504 path = APR_ARRAY_IDX(output_targets, 1, const char *);
505 SVN_ERR(svn_opt_parse_path(&temprev, &path, path, pool));
506 if (temprev.kind != svn_opt_revision_unspecified)
508 APR_ARRAY_IDX(output_targets, 1, const char *) = path;
509 end_revision->kind = temprev.kind;
510 end_revision->value = temprev.value;
515 *targets_p = output_targets;
520 svn_opt_print_help3(apr_getopt_t *os,
521 const char *pgm_name,
522 svn_boolean_t print_version,
524 const char *version_footer,
526 const svn_opt_subcommand_desc2_t *cmd_table,
527 const apr_getopt_option_t *option_table,
528 const int *global_options,
532 return svn_error_trace(svn_opt_print_help4(os,
547 svn_opt_print_help2(apr_getopt_t *os,
548 const char *pgm_name,
549 svn_boolean_t print_version,
551 const char *version_footer,
553 const svn_opt_subcommand_desc2_t *cmd_table,
554 const apr_getopt_option_t *option_table,
558 return svn_error_trace(svn_opt_print_help4(os,
573 svn_opt_print_help(apr_getopt_t *os,
574 const char *pgm_name,
575 svn_boolean_t print_version,
577 const char *version_footer,
579 const svn_opt_subcommand_desc_t *cmd_table,
580 const apr_getopt_option_t *option_table,
584 apr_array_header_t *targets = NULL;
587 SVN_ERR(svn_opt_parse_all_args(&targets, os, pool));
589 if (os && targets->nelts) /* help on subcommand(s) requested */
593 for (i = 0; i < targets->nelts; i++)
595 svn_opt_subcommand_help(APR_ARRAY_IDX(targets, i, const char *),
596 cmd_table, option_table, pool);
599 else if (print_version) /* just --version */
601 SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer,
602 svn_version_extended(FALSE, pool),
603 quiet, FALSE, pool));
605 else if (os && !targets->nelts) /* `-h', `--help', or `help' */
606 svn_opt_print_generic_help(header,
612 else /* unknown option or cmd */
613 SVN_ERR(svn_cmdline_fprintf(stderr, pool,
614 _("Type '%s help' for usage.\n"), pgm_name));
620 svn_opt_print_generic_help(const char *header,
621 const svn_opt_subcommand_desc_t *cmd_table,
622 const apr_getopt_option_t *opt_table,
624 apr_pool_t *pool, FILE *stream)
630 if ((err = svn_cmdline_fputs(header, stream, pool)))
633 while (cmd_table[i].name)
635 if ((err = svn_cmdline_fputs(" ", stream, pool))
636 || (err = print_command_info(cmd_table + i, opt_table, FALSE,
638 || (err = svn_cmdline_fputs("\n", stream, pool)))
643 if ((err = svn_cmdline_fputs("\n", stream, pool)))
647 if ((err = svn_cmdline_fputs(footer, stream, pool)))
653 svn_handle_error2(err, stderr, FALSE, "svn: ");
654 svn_error_clear(err);
659 svn_io_open_unique_file2(apr_file_t **file,
660 const char **temp_path,
663 svn_io_file_del_t delete_when,
667 const char *filename;
669 svn_path_split(path, &dirpath, &filename, pool);
670 return svn_error_trace(svn_io_open_uniquely_named(file, temp_path,
671 dirpath, filename, suffix,
677 svn_io_open_unique_file(apr_file_t **file,
678 const char **temp_path,
681 svn_boolean_t delete_on_close,
684 return svn_error_trace(svn_io_open_unique_file2(file, temp_path,
687 ? svn_io_file_del_on_close
688 : svn_io_file_del_none,
693 svn_io_run_diff(const char *dir,
694 const char *const *user_args,
703 const char *diff_cmd,
706 SVN_ERR(svn_path_cstring_to_utf8(&diff_cmd, diff_cmd, pool));
708 return svn_error_trace(svn_io_run_diff2(dir, user_args, num_user_args,
711 outfile, errfile, diff_cmd,
716 svn_io_run_diff3_2(int *exitcode,
721 const char *mine_label,
722 const char *older_label,
723 const char *yours_label,
725 const char *diff3_cmd,
726 const apr_array_header_t *user_args,
729 SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, pool));
731 return svn_error_trace(svn_io_run_diff3_3(exitcode, dir,
733 mine_label, older_label,
735 diff3_cmd, user_args, pool));
739 svn_io_run_diff3(const char *dir,
743 const char *mine_label,
744 const char *older_label,
745 const char *yours_label,
748 const char *diff3_cmd,
751 return svn_error_trace(svn_io_run_diff3_2(exitcode, dir, mine, older, yours,
752 mine_label, older_label,
754 merged, diff3_cmd, NULL, pool));
758 svn_io_remove_file(const char *path,
759 apr_pool_t *scratch_pool)
761 return svn_error_trace(svn_io_remove_file2(path, FALSE, scratch_pool));
764 svn_error_t *svn_io_file_lock(const char *lock_file,
765 svn_boolean_t exclusive,
768 return svn_io_file_lock2(lock_file, exclusive, FALSE, pool);
772 svn_io_get_dirents2(apr_hash_t **dirents,
776 /* Note that the first part of svn_io_dirent2_t is identical
777 to svn_io_dirent_t to allow this construct */
778 return svn_error_trace(
779 svn_io_get_dirents3(dirents, path, FALSE, pool, pool));
783 svn_io_get_dirents(apr_hash_t **dirents,
787 /* Note that in C, padding is not allowed at the beginning of structs,
788 so this is actually portable, since the kind field of svn_io_dirent_t
789 is first in that struct. */
790 return svn_io_get_dirents2(dirents, path, pool);
794 svn_io_start_cmd2(apr_proc_t *cmd_proc,
797 const char *const *args,
798 svn_boolean_t inherit,
799 svn_boolean_t infile_pipe,
801 svn_boolean_t outfile_pipe,
803 svn_boolean_t errfile_pipe,
807 return svn_io_start_cmd3(cmd_proc, path, cmd, args, NULL, inherit,
808 infile_pipe, infile, outfile_pipe, outfile,
809 errfile_pipe, errfile, pool);
813 svn_io_start_cmd(apr_proc_t *cmd_proc,
816 const char *const *args,
817 svn_boolean_t inherit,
823 return svn_io_start_cmd2(cmd_proc, path, cmd, args, inherit, FALSE,
824 infile, FALSE, outfile, FALSE, errfile, pool);
828 svn_io_file_read_full(apr_file_t *file, void *buf,
829 apr_size_t nbytes, apr_size_t *bytes_read,
832 return svn_io_file_read_full2(file, buf, nbytes, bytes_read, NULL, pool);
835 struct walk_func_filter_baton_t
837 svn_io_walk_func_t walk_func;
841 /* Implements svn_io_walk_func_t, but only allows APR_DIR and APR_REG
842 finfo types through to the wrapped function/baton. */
844 walk_func_filter_func(void *baton,
846 const apr_finfo_t *finfo,
849 struct walk_func_filter_baton_t *b = baton;
851 if (finfo->filetype == APR_DIR || finfo->filetype == APR_REG)
852 SVN_ERR(b->walk_func(b->walk_baton, path, finfo, pool));
858 svn_io_dir_walk(const char *dirname,
860 svn_io_walk_func_t walk_func,
864 struct walk_func_filter_baton_t baton;
865 baton.walk_func = walk_func;
866 baton.walk_baton = walk_baton;
867 return svn_error_trace(svn_io_dir_walk2(dirname, wanted,
868 walk_func_filter_func,
873 svn_io_stat_dirent(const svn_io_dirent2_t **dirent_p,
875 svn_boolean_t ignore_enoent,
876 apr_pool_t *result_pool,
877 apr_pool_t *scratch_pool)
879 return svn_error_trace(
880 svn_io_stat_dirent2(dirent_p,
888 /*** From constructors.c ***/
889 svn_log_changed_path_t *
890 svn_log_changed_path_dup(const svn_log_changed_path_t *changed_path,
893 svn_log_changed_path_t *new_changed_path
894 = apr_palloc(pool, sizeof(*new_changed_path));
896 *new_changed_path = *changed_path;
898 if (new_changed_path->copyfrom_path)
899 new_changed_path->copyfrom_path =
900 apr_pstrdup(pool, new_changed_path->copyfrom_path);
902 return new_changed_path;
905 /*** From cmdline.c ***/
907 svn_cmdline_prompt_user(const char **result,
908 const char *prompt_str,
911 return svn_error_trace(svn_cmdline_prompt_user2(result, prompt_str, NULL,
916 svn_cmdline_setup_auth_baton(svn_auth_baton_t **ab,
917 svn_boolean_t non_interactive,
918 const char *auth_username,
919 const char *auth_password,
920 const char *config_dir,
921 svn_boolean_t no_auth_cache,
923 svn_cancel_func_t cancel_func,
927 return svn_error_trace(svn_cmdline_create_auth_baton(
929 auth_username, auth_password,
930 config_dir, no_auth_cache, FALSE,
931 cfg, cancel_func, cancel_baton, pool));
936 svn_dso_initialize(void)
938 svn_error_t *err = svn_dso_initialize2();
941 svn_error_clear(err);
946 /*** From simple_providers.c ***/
948 svn_auth_get_simple_provider(svn_auth_provider_object_t **provider,
951 svn_auth_get_simple_provider2(provider, NULL, NULL, pool);
954 /*** From ssl_client_cert_pw_providers.c ***/
956 svn_auth_get_ssl_client_cert_pw_file_provider
957 (svn_auth_provider_object_t **provider,
960 svn_auth_get_ssl_client_cert_pw_file_provider2(provider, NULL, NULL, pool);
963 /*** From path.c ***/
965 #define SVN_EMPTY_PATH ""
968 svn_path_url_add_component(const char *url,
969 const char *component,
972 /* URL can have trailing '/' */
973 url = svn_path_canonicalize(url, pool);
975 return svn_path_url_add_component2(url, component, pool);
979 svn_path_split(const char *path,
980 const char **dirpath,
981 const char **base_name,
984 assert(dirpath != base_name);
987 *dirpath = svn_path_dirname(path, pool);
990 *base_name = svn_path_basename(path, pool);
995 svn_path_split_if_file(const char *path,
996 const char **pdirectory,
1003 SVN_ERR_ASSERT(svn_path_is_canonical(path, pool));
1005 err = svn_io_stat(&finfo, path, APR_FINFO_TYPE, pool);
1006 if (err && ! APR_STATUS_IS_ENOENT(err->apr_err))
1009 if (err || finfo.filetype == APR_REG)
1011 svn_error_clear(err);
1012 svn_path_split(path, pdirectory, pfile, pool);
1014 else if (finfo.filetype == APR_DIR)
1017 *pfile = SVN_EMPTY_PATH;
1021 return svn_error_createf(SVN_ERR_BAD_FILENAME, NULL,
1022 _("'%s' is neither a file nor a directory name"),
1023 svn_path_local_style(path, pool));
1026 return SVN_NO_ERROR;
1029 /*** From stream.c ***/
1030 svn_error_t *svn_stream_copy2(svn_stream_t *from, svn_stream_t *to,
1031 svn_cancel_func_t cancel_func,
1033 apr_pool_t *scratch_pool)
1035 return svn_error_trace(svn_stream_copy3(
1036 svn_stream_disown(from, scratch_pool),
1037 svn_stream_disown(to, scratch_pool),
1038 cancel_func, cancel_baton, scratch_pool));
1041 svn_error_t *svn_stream_copy(svn_stream_t *from, svn_stream_t *to,
1042 apr_pool_t *scratch_pool)
1044 return svn_error_trace(svn_stream_copy3(
1045 svn_stream_disown(from, scratch_pool),
1046 svn_stream_disown(to, scratch_pool),
1047 NULL, NULL, scratch_pool));
1051 svn_stream_from_aprfile(apr_file_t *file, apr_pool_t *pool)
1053 return svn_stream_from_aprfile2(file, TRUE, pool);
1057 svn_stream_contents_same(svn_boolean_t *same,
1058 svn_stream_t *stream1,
1059 svn_stream_t *stream2,
1062 return svn_error_trace(svn_stream_contents_same2(
1064 svn_stream_disown(stream1, pool),
1065 svn_stream_disown(stream2, pool),
1069 /*** From path.c ***/
1072 svn_path_internal_style(const char *path, apr_pool_t *pool)
1074 if (svn_path_is_url(path))
1075 return svn_uri_canonicalize(path, pool);
1077 return svn_dirent_internal_style(path, pool);
1082 svn_path_local_style(const char *path, apr_pool_t *pool)
1084 if (svn_path_is_url(path))
1085 return apr_pstrdup(pool, path);
1087 return svn_dirent_local_style(path, pool);
1091 svn_path_canonicalize(const char *path, apr_pool_t *pool)
1093 if (svn_path_is_url(path))
1094 return svn_uri_canonicalize(path, pool);
1096 return svn_dirent_canonicalize(path, pool);
1100 /*** From mergeinfo.c ***/
1103 svn_mergeinfo_inheritable(svn_mergeinfo_t *output,
1104 svn_mergeinfo_t mergeinfo,
1110 return svn_error_trace(svn_mergeinfo_inheritable2(output, mergeinfo, path,
1116 svn_rangelist_inheritable(svn_rangelist_t **inheritable_rangelist,
1117 const svn_rangelist_t *rangelist,
1122 return svn_error_trace(svn_rangelist_inheritable2(inheritable_rangelist,
1129 svn_rangelist_merge(svn_rangelist_t **rangelist,
1130 const svn_rangelist_t *changes,
1133 SVN_ERR(svn_rangelist_merge2(*rangelist, changes,
1136 return svn_error_trace(
1137 svn_rangelist__combine_adjacent_ranges(*rangelist, pool));
1141 svn_mergeinfo_diff(svn_mergeinfo_t *deleted, svn_mergeinfo_t *added,
1142 svn_mergeinfo_t from, svn_mergeinfo_t to,
1143 svn_boolean_t consider_inheritance,
1146 return svn_error_trace(svn_mergeinfo_diff2(deleted, added, from, to,
1147 consider_inheritance, pool,
1152 svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo,
1153 svn_mergeinfo_t changes,
1156 return svn_error_trace(svn_mergeinfo_merge2(mergeinfo, changes, pool,
1161 svn_mergeinfo_remove(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t eraser,
1162 svn_mergeinfo_t whiteboard, apr_pool_t *pool)
1164 return svn_mergeinfo_remove2(mergeinfo, eraser, whiteboard, TRUE, pool,
1169 svn_mergeinfo_intersect(svn_mergeinfo_t *mergeinfo,
1170 svn_mergeinfo_t mergeinfo1,
1171 svn_mergeinfo_t mergeinfo2,
1174 return svn_mergeinfo_intersect2(mergeinfo, mergeinfo1, mergeinfo2,
1178 /*** From config.c ***/
1180 svn_config_create(svn_config_t **cfgp,
1181 svn_boolean_t section_names_case_sensitive,
1182 apr_pool_t *result_pool)
1184 return svn_error_trace(svn_config_create2(cfgp,
1185 section_names_case_sensitive,
1191 svn_config_read2(svn_config_t **cfgp, const char *file,
1192 svn_boolean_t must_exist,
1193 svn_boolean_t section_names_case_sensitive,
1194 apr_pool_t *result_pool)
1196 return svn_error_trace(svn_config_read3(cfgp, file,
1198 section_names_case_sensitive,
1204 svn_config_read(svn_config_t **cfgp, const char *file,
1205 svn_boolean_t must_exist,
1206 apr_pool_t *result_pool)
1208 return svn_error_trace(svn_config_read3(cfgp, file,
1214 #ifdef SVN_DISABLE_FULL_VERSION_MATCH
1215 /* This double underscore name is used by the 1.6 command line client.
1216 Keeping this name is sufficient for the 1.6 client to use the 1.7
1217 libraries at runtime. */
1219 svn_opt__eat_peg_revisions(apr_array_header_t **true_targets_p,
1220 apr_array_header_t *targets,
1223 svn_opt__eat_peg_revisions(apr_array_header_t **true_targets_p,
1224 apr_array_header_t *targets,
1228 apr_array_header_t *true_targets;
1230 true_targets = apr_array_make(pool, 5, sizeof(const char *));
1232 for (i = 0; i < targets->nelts; i++)
1234 const char *target = APR_ARRAY_IDX(targets, i, const char *);
1235 const char *true_target;
1237 SVN_ERR(svn_opt__split_arg_at_peg_revision(&true_target, NULL,
1239 APR_ARRAY_PUSH(true_targets, const char *) = true_target;
1242 SVN_ERR_ASSERT(true_targets_p);
1243 *true_targets_p = true_targets;
1245 return SVN_NO_ERROR;
1250 svn_xml_make_header(svn_stringbuf_t **str, apr_pool_t *pool)
1252 svn_xml_make_header2(str, NULL, pool);
1256 svn_utf_initialize(apr_pool_t *pool)
1258 svn_utf_initialize2(FALSE, pool);
1262 svn_subst_build_keywords(svn_subst_keywords_t *kw,
1263 const char *keywords_val,
1271 const svn_string_t *val;
1273 SVN_ERR(svn_subst_build_keywords2(&kwhash, keywords_val, rev,
1274 url, date, author, pool));
1276 /* The behaviour of pre-1.3 svn_subst_build_keywords, which we are
1277 * replicating here, is to write to a slot in the svn_subst_keywords_t
1278 * only if the relevant keyword was present in keywords_val, otherwise
1279 * leaving that slot untouched. */
1281 val = svn_hash_gets(kwhash, SVN_KEYWORD_REVISION_LONG);
1285 val = svn_hash_gets(kwhash, SVN_KEYWORD_DATE_LONG);
1289 val = svn_hash_gets(kwhash, SVN_KEYWORD_AUTHOR_LONG);
1293 val = svn_hash_gets(kwhash, SVN_KEYWORD_URL_LONG);
1297 val = svn_hash_gets(kwhash, SVN_KEYWORD_ID);
1301 return SVN_NO_ERROR;