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"
50 #include "private/svn_subr_private.h"
52 #include "svn_private_config.h"
59 /*** From subst.c ***/
60 /* Convert an old-style svn_subst_keywords_t struct * into a new-style
61 * keywords hash. Keyword values are shallow copies, so the produced
62 * hash must not be assumed to have lifetime longer than the struct it
63 * is based on. A NULL input causes a NULL output. */
65 kwstruct_to_kwhash(const svn_subst_keywords_t *kwstruct,
73 kwhash = apr_hash_make(pool);
75 if (kwstruct->revision)
77 svn_hash_sets(kwhash, SVN_KEYWORD_REVISION_LONG, kwstruct->revision);
78 svn_hash_sets(kwhash, SVN_KEYWORD_REVISION_MEDIUM, kwstruct->revision);
79 svn_hash_sets(kwhash, SVN_KEYWORD_REVISION_SHORT, kwstruct->revision);
83 svn_hash_sets(kwhash, SVN_KEYWORD_DATE_LONG, kwstruct->date);
84 svn_hash_sets(kwhash, SVN_KEYWORD_DATE_SHORT, kwstruct->date);
88 svn_hash_sets(kwhash, SVN_KEYWORD_AUTHOR_LONG, kwstruct->author);
89 svn_hash_sets(kwhash, SVN_KEYWORD_AUTHOR_SHORT, kwstruct->author);
93 svn_hash_sets(kwhash, SVN_KEYWORD_URL_LONG, kwstruct->url);
94 svn_hash_sets(kwhash, SVN_KEYWORD_URL_SHORT, kwstruct->url);
98 svn_hash_sets(kwhash, SVN_KEYWORD_ID, kwstruct->id);
106 svn_subst_translate_stream3(svn_stream_t *src_stream,
107 svn_stream_t *dst_stream,
109 svn_boolean_t repair,
110 apr_hash_t *keywords,
111 svn_boolean_t expand,
114 /* The docstring requires that *some* translation be requested. */
115 SVN_ERR_ASSERT(eol_str || keywords);
117 /* We don't want the copy3 to close the provided streams. */
118 src_stream = svn_stream_disown(src_stream, pool);
119 dst_stream = svn_stream_disown(dst_stream, pool);
121 /* Wrap the destination stream with our translation stream. It is more
122 efficient than wrapping the source stream. */
123 dst_stream = svn_subst_stream_translated(dst_stream, eol_str, repair,
124 keywords, expand, pool);
126 return svn_error_trace(svn_stream_copy3(src_stream, dst_stream,
131 svn_subst_translate_stream2(svn_stream_t *s, /* src stream */
132 svn_stream_t *d, /* dst stream */
134 svn_boolean_t repair,
135 const svn_subst_keywords_t *keywords,
136 svn_boolean_t expand,
139 apr_hash_t *kh = kwstruct_to_kwhash(keywords, pool);
141 return svn_error_trace(svn_subst_translate_stream3(s, d, eol_str, repair,
146 svn_subst_translate_stream(svn_stream_t *s, /* src stream */
147 svn_stream_t *d, /* dst stream */
149 svn_boolean_t repair,
150 const svn_subst_keywords_t *keywords,
151 svn_boolean_t expand)
153 apr_pool_t *pool = svn_pool_create(NULL);
154 svn_error_t *err = svn_subst_translate_stream2(s, d, eol_str, repair,
155 keywords, expand, pool);
156 svn_pool_destroy(pool);
157 return svn_error_trace(err);
161 svn_subst_translate_cstring(const char *src,
164 svn_boolean_t repair,
165 const svn_subst_keywords_t *keywords,
166 svn_boolean_t expand,
169 apr_hash_t *kh = kwstruct_to_kwhash(keywords, pool);
171 return svn_error_trace(svn_subst_translate_cstring2(src, dst, eol_str,
177 svn_subst_copy_and_translate(const char *src,
180 svn_boolean_t repair,
181 const svn_subst_keywords_t *keywords,
182 svn_boolean_t expand,
185 return svn_error_trace(svn_subst_copy_and_translate2(src, dst, eol_str,
187 expand, FALSE, pool));
191 svn_subst_copy_and_translate2(const char *src,
194 svn_boolean_t repair,
195 const svn_subst_keywords_t *keywords,
196 svn_boolean_t expand,
197 svn_boolean_t special,
200 apr_hash_t *kh = kwstruct_to_kwhash(keywords, pool);
202 return svn_error_trace(svn_subst_copy_and_translate3(src, dst, eol_str,
208 svn_subst_copy_and_translate3(const char *src,
211 svn_boolean_t repair,
212 apr_hash_t *keywords,
213 svn_boolean_t expand,
214 svn_boolean_t special,
217 return svn_error_trace(svn_subst_copy_and_translate4(src, dst, eol_str,
226 svn_subst_stream_translated_to_normal_form(svn_stream_t **stream,
227 svn_stream_t *source,
228 svn_subst_eol_style_t eol_style,
230 svn_boolean_t always_repair_eols,
231 apr_hash_t *keywords,
234 if (eol_style == svn_subst_eol_style_native)
235 eol_str = SVN_SUBST_NATIVE_EOL_STR;
236 else if (! (eol_style == svn_subst_eol_style_fixed
237 || eol_style == svn_subst_eol_style_none))
238 return svn_error_create(SVN_ERR_IO_UNKNOWN_EOL, NULL, NULL);
240 *stream = svn_subst_stream_translated(source, eol_str,
241 eol_style == svn_subst_eol_style_fixed
242 || always_repair_eols,
243 keywords, FALSE, pool);
249 svn_subst_translate_string(svn_string_t **new_value,
250 const svn_string_t *value,
251 const char *encoding,
254 return svn_subst_translate_string2(new_value, NULL, NULL, value,
255 encoding, FALSE, pool, pool);
259 svn_subst_stream_detranslated(svn_stream_t **stream_p,
261 svn_subst_eol_style_t eol_style,
263 svn_boolean_t always_repair_eols,
264 apr_hash_t *keywords,
265 svn_boolean_t special,
268 svn_stream_t *src_stream;
271 return svn_subst_read_specialfile(stream_p, src, pool, pool);
273 /* This will be closed by svn_subst_stream_translated_to_normal_form
274 when the returned stream is closed. */
275 SVN_ERR(svn_stream_open_readonly(&src_stream, src, pool, pool));
277 return svn_error_trace(svn_subst_stream_translated_to_normal_form(
278 stream_p, src_stream,
285 svn_subst_translate_to_normal_form(const char *src,
287 svn_subst_eol_style_t eol_style,
289 svn_boolean_t always_repair_eols,
290 apr_hash_t *keywords,
291 svn_boolean_t special,
295 if (eol_style == svn_subst_eol_style_native)
296 eol_str = SVN_SUBST_NATIVE_EOL_STR;
297 else if (! (eol_style == svn_subst_eol_style_fixed
298 || eol_style == svn_subst_eol_style_none))
299 return svn_error_create(SVN_ERR_IO_UNKNOWN_EOL, NULL, NULL);
301 return svn_error_trace(svn_subst_copy_and_translate3(
303 eol_style == svn_subst_eol_style_fixed
304 || always_repair_eols,
306 FALSE /* contract keywords */,
313 /* Same as print_command_info2(), but with deprecated struct revision. */
315 print_command_info(const svn_opt_subcommand_desc_t *cmd,
316 const apr_getopt_option_t *options_table,
321 svn_boolean_t first_time;
324 /* Print the canonical command name. */
325 SVN_ERR(svn_cmdline_fputs(cmd->name, stream, pool));
327 /* Print the list of aliases. */
329 for (i = 0; i < SVN_OPT_MAX_ALIASES; i++)
331 if (cmd->aliases[i] == NULL)
335 SVN_ERR(svn_cmdline_fputs(" (", stream, pool));
339 SVN_ERR(svn_cmdline_fputs(", ", stream, pool));
341 SVN_ERR(svn_cmdline_fputs(cmd->aliases[i], stream, pool));
345 SVN_ERR(svn_cmdline_fputs(")", stream, pool));
349 const apr_getopt_option_t *option;
350 svn_boolean_t have_options = FALSE;
352 SVN_ERR(svn_cmdline_fprintf(stream, pool, ": %s", _(cmd->help)));
354 /* Loop over all valid option codes attached to the subcommand */
355 for (i = 0; i < SVN_OPT_MAX_OPTIONS; i++)
357 if (cmd->valid_options[i])
361 SVN_ERR(svn_cmdline_fputs(_("\nValid options:\n"),
366 /* convert each option code into an option */
368 svn_opt_get_option_from_code2(cmd->valid_options[i],
369 options_table, NULL, pool);
371 /* print the option's docstring */
372 if (option && option->description)
375 svn_opt_format_option(&optstr, option, TRUE, pool);
376 SVN_ERR(svn_cmdline_fprintf(stream, pool, " %s\n",
383 SVN_ERR(svn_cmdline_fprintf(stream, pool, "\n"));
389 const svn_opt_subcommand_desc_t *
390 svn_opt_get_canonical_subcommand(const svn_opt_subcommand_desc_t *table,
391 const char *cmd_name)
395 if (cmd_name == NULL)
398 while (table[i].name) {
400 if (strcmp(cmd_name, table[i].name) == 0)
402 for (j = 0; (j < SVN_OPT_MAX_ALIASES) && table[i].aliases[j]; j++)
403 if (strcmp(cmd_name, table[i].aliases[j]) == 0)
409 /* If we get here, there was no matching subcommand name or alias. */
414 svn_opt_subcommand_help2(const char *subcommand,
415 const svn_opt_subcommand_desc2_t *table,
416 const apr_getopt_option_t *options_table,
419 svn_opt_subcommand_help3(subcommand, table, options_table,
424 svn_opt_subcommand_help(const char *subcommand,
425 const svn_opt_subcommand_desc_t *table,
426 const apr_getopt_option_t *options_table,
429 const svn_opt_subcommand_desc_t *cmd =
430 svn_opt_get_canonical_subcommand(table, subcommand);
434 err = print_command_info(cmd, options_table, TRUE, pool, stdout);
436 err = svn_cmdline_fprintf(stderr, pool,
437 _("\"%s\": unknown command.\n\n"), subcommand);
440 svn_handle_error2(err, stderr, FALSE, "svn: ");
441 svn_error_clear(err);
446 svn_opt_args_to_target_array3(apr_array_header_t **targets_p,
448 const apr_array_header_t *known_targets,
451 return svn_error_trace(svn_opt__args_to_target_array(targets_p, os,
452 known_targets, pool));
456 svn_opt_args_to_target_array2(apr_array_header_t **targets_p,
458 const apr_array_header_t *known_targets,
461 svn_error_t *err = svn_opt_args_to_target_array3(targets_p, os,
462 known_targets, pool);
464 if (err && err->apr_err == SVN_ERR_RESERVED_FILENAME_SPECIFIED)
466 svn_error_clear(err);
474 svn_opt_args_to_target_array(apr_array_header_t **targets_p,
476 const apr_array_header_t *known_targets,
477 svn_opt_revision_t *start_revision,
478 svn_opt_revision_t *end_revision,
479 svn_boolean_t extract_revisions,
482 apr_array_header_t *output_targets;
484 SVN_ERR(svn_opt_args_to_target_array2(&output_targets, os,
485 known_targets, pool));
487 if (extract_revisions)
489 svn_opt_revision_t temprev;
492 if (output_targets->nelts > 0)
494 path = APR_ARRAY_IDX(output_targets, 0, const char *);
495 SVN_ERR(svn_opt_parse_path(&temprev, &path, path, pool));
496 if (temprev.kind != svn_opt_revision_unspecified)
498 APR_ARRAY_IDX(output_targets, 0, const char *) = path;
499 start_revision->kind = temprev.kind;
500 start_revision->value = temprev.value;
503 if (output_targets->nelts > 1)
505 path = APR_ARRAY_IDX(output_targets, 1, const char *);
506 SVN_ERR(svn_opt_parse_path(&temprev, &path, path, pool));
507 if (temprev.kind != svn_opt_revision_unspecified)
509 APR_ARRAY_IDX(output_targets, 1, const char *) = path;
510 end_revision->kind = temprev.kind;
511 end_revision->value = temprev.value;
516 *targets_p = output_targets;
521 svn_opt_print_help3(apr_getopt_t *os,
522 const char *pgm_name,
523 svn_boolean_t print_version,
525 const char *version_footer,
527 const svn_opt_subcommand_desc2_t *cmd_table,
528 const apr_getopt_option_t *option_table,
529 const int *global_options,
533 return svn_error_trace(svn_opt_print_help4(os,
548 svn_opt_print_help2(apr_getopt_t *os,
549 const char *pgm_name,
550 svn_boolean_t print_version,
552 const char *version_footer,
554 const svn_opt_subcommand_desc2_t *cmd_table,
555 const apr_getopt_option_t *option_table,
559 return svn_error_trace(svn_opt_print_help4(os,
574 svn_opt_print_help(apr_getopt_t *os,
575 const char *pgm_name,
576 svn_boolean_t print_version,
578 const char *version_footer,
580 const svn_opt_subcommand_desc_t *cmd_table,
581 const apr_getopt_option_t *option_table,
585 apr_array_header_t *targets = NULL;
588 SVN_ERR(svn_opt_parse_all_args(&targets, os, pool));
590 if (os && targets->nelts) /* help on subcommand(s) requested */
594 for (i = 0; i < targets->nelts; i++)
596 svn_opt_subcommand_help(APR_ARRAY_IDX(targets, i, const char *),
597 cmd_table, option_table, pool);
600 else if (print_version) /* just --version */
602 SVN_ERR(svn_opt__print_version_info(pgm_name, version_footer,
603 svn_version_extended(FALSE, pool),
604 quiet, FALSE, pool));
606 else if (os && !targets->nelts) /* `-h', `--help', or `help' */
607 svn_opt_print_generic_help(header,
613 else /* unknown option or cmd */
614 SVN_ERR(svn_cmdline_fprintf(stderr, pool,
615 _("Type '%s help' for usage.\n"), pgm_name));
621 svn_opt_print_generic_help(const char *header,
622 const svn_opt_subcommand_desc_t *cmd_table,
623 const apr_getopt_option_t *opt_table,
625 apr_pool_t *pool, FILE *stream)
631 if ((err = svn_cmdline_fputs(header, stream, pool)))
634 while (cmd_table[i].name)
636 if ((err = svn_cmdline_fputs(" ", stream, pool))
637 || (err = print_command_info(cmd_table + i, opt_table, FALSE,
639 || (err = svn_cmdline_fputs("\n", stream, pool)))
644 if ((err = svn_cmdline_fputs("\n", stream, pool)))
648 if ((err = svn_cmdline_fputs(footer, stream, pool)))
654 svn_handle_error2(err, stderr, FALSE, "svn: ");
655 svn_error_clear(err);
660 svn_io_open_unique_file2(apr_file_t **file,
661 const char **temp_path,
664 svn_io_file_del_t delete_when,
668 const char *filename;
670 svn_path_split(path, &dirpath, &filename, pool);
671 return svn_error_trace(svn_io_open_uniquely_named(file, temp_path,
672 dirpath, filename, suffix,
678 svn_io_open_unique_file(apr_file_t **file,
679 const char **temp_path,
682 svn_boolean_t delete_on_close,
685 return svn_error_trace(svn_io_open_unique_file2(file, temp_path,
688 ? svn_io_file_del_on_close
689 : svn_io_file_del_none,
694 svn_io_run_diff(const char *dir,
695 const char *const *user_args,
704 const char *diff_cmd,
707 SVN_ERR(svn_path_cstring_to_utf8(&diff_cmd, diff_cmd, pool));
709 return svn_error_trace(svn_io_run_diff2(dir, user_args, num_user_args,
712 outfile, errfile, diff_cmd,
717 svn_io_run_diff3_2(int *exitcode,
722 const char *mine_label,
723 const char *older_label,
724 const char *yours_label,
726 const char *diff3_cmd,
727 const apr_array_header_t *user_args,
730 SVN_ERR(svn_path_cstring_to_utf8(&diff3_cmd, diff3_cmd, pool));
732 return svn_error_trace(svn_io_run_diff3_3(exitcode, dir,
734 mine_label, older_label,
736 diff3_cmd, user_args, pool));
740 svn_io_run_diff3(const char *dir,
744 const char *mine_label,
745 const char *older_label,
746 const char *yours_label,
749 const char *diff3_cmd,
752 return svn_error_trace(svn_io_run_diff3_2(exitcode, dir, mine, older, yours,
753 mine_label, older_label,
755 merged, diff3_cmd, NULL, pool));
759 svn_io_remove_file(const char *path,
760 apr_pool_t *scratch_pool)
762 return svn_error_trace(svn_io_remove_file2(path, FALSE, scratch_pool));
765 svn_error_t *svn_io_file_lock(const char *lock_file,
766 svn_boolean_t exclusive,
769 return svn_io_file_lock2(lock_file, exclusive, FALSE, pool);
773 svn_io_get_dirents2(apr_hash_t **dirents,
777 /* Note that the first part of svn_io_dirent2_t is identical
778 to svn_io_dirent_t to allow this construct */
779 return svn_error_trace(
780 svn_io_get_dirents3(dirents, path, FALSE, pool, pool));
784 svn_io_get_dirents(apr_hash_t **dirents,
788 /* Note that in C, padding is not allowed at the beginning of structs,
789 so this is actually portable, since the kind field of svn_io_dirent_t
790 is first in that struct. */
791 return svn_io_get_dirents2(dirents, path, pool);
795 svn_io_start_cmd2(apr_proc_t *cmd_proc,
798 const char *const *args,
799 svn_boolean_t inherit,
800 svn_boolean_t infile_pipe,
802 svn_boolean_t outfile_pipe,
804 svn_boolean_t errfile_pipe,
808 return svn_io_start_cmd3(cmd_proc, path, cmd, args, NULL, inherit,
809 infile_pipe, infile, outfile_pipe, outfile,
810 errfile_pipe, errfile, pool);
814 svn_io_start_cmd(apr_proc_t *cmd_proc,
817 const char *const *args,
818 svn_boolean_t inherit,
824 return svn_io_start_cmd2(cmd_proc, path, cmd, args, inherit, FALSE,
825 infile, FALSE, outfile, FALSE, errfile, pool);
829 svn_io_file_read_full(apr_file_t *file, void *buf,
830 apr_size_t nbytes, apr_size_t *bytes_read,
833 return svn_io_file_read_full2(file, buf, nbytes, bytes_read, NULL, pool);
836 struct walk_func_filter_baton_t
838 svn_io_walk_func_t walk_func;
842 /* Implements svn_io_walk_func_t, but only allows APR_DIR and APR_REG
843 finfo types through to the wrapped function/baton. */
845 walk_func_filter_func(void *baton,
847 const apr_finfo_t *finfo,
850 struct walk_func_filter_baton_t *b = baton;
852 if (finfo->filetype == APR_DIR || finfo->filetype == APR_REG)
853 SVN_ERR(b->walk_func(b->walk_baton, path, finfo, pool));
859 svn_io_dir_walk(const char *dirname,
861 svn_io_walk_func_t walk_func,
865 struct walk_func_filter_baton_t baton;
866 baton.walk_func = walk_func;
867 baton.walk_baton = walk_baton;
868 return svn_error_trace(svn_io_dir_walk2(dirname, wanted,
869 walk_func_filter_func,
874 svn_io_stat_dirent(const svn_io_dirent2_t **dirent_p,
876 svn_boolean_t ignore_enoent,
877 apr_pool_t *result_pool,
878 apr_pool_t *scratch_pool)
880 return svn_error_trace(
881 svn_io_stat_dirent2(dirent_p,
889 /*** From constructors.c ***/
890 svn_log_changed_path_t *
891 svn_log_changed_path_dup(const svn_log_changed_path_t *changed_path,
894 svn_log_changed_path_t *new_changed_path
895 = apr_palloc(pool, sizeof(*new_changed_path));
897 *new_changed_path = *changed_path;
899 if (new_changed_path->copyfrom_path)
900 new_changed_path->copyfrom_path =
901 apr_pstrdup(pool, new_changed_path->copyfrom_path);
903 return new_changed_path;
906 /*** From cmdline.c ***/
908 svn_cmdline_prompt_user(const char **result,
909 const char *prompt_str,
912 return svn_error_trace(svn_cmdline_prompt_user2(result, prompt_str, NULL,
917 svn_cmdline_setup_auth_baton(svn_auth_baton_t **ab,
918 svn_boolean_t non_interactive,
919 const char *auth_username,
920 const char *auth_password,
921 const char *config_dir,
922 svn_boolean_t no_auth_cache,
924 svn_cancel_func_t cancel_func,
928 return svn_error_trace(svn_cmdline_create_auth_baton(
930 auth_username, auth_password,
931 config_dir, no_auth_cache, FALSE,
932 cfg, cancel_func, cancel_baton, pool));
937 svn_dso_initialize(void)
939 svn_error_t *err = svn_dso_initialize2();
942 svn_error_clear(err);
947 /*** From simple_providers.c ***/
949 svn_auth_get_simple_provider(svn_auth_provider_object_t **provider,
952 svn_auth_get_simple_provider2(provider, NULL, NULL, pool);
955 /*** From ssl_client_cert_pw_providers.c ***/
957 svn_auth_get_ssl_client_cert_pw_file_provider
958 (svn_auth_provider_object_t **provider,
961 svn_auth_get_ssl_client_cert_pw_file_provider2(provider, NULL, NULL, pool);
964 /*** From path.c ***/
966 #define SVN_EMPTY_PATH ""
969 svn_path_url_add_component(const char *url,
970 const char *component,
973 /* URL can have trailing '/' */
974 url = svn_path_canonicalize(url, pool);
976 return svn_path_url_add_component2(url, component, pool);
980 svn_path_split(const char *path,
981 const char **dirpath,
982 const char **base_name,
985 assert(dirpath != base_name);
988 *dirpath = svn_path_dirname(path, pool);
991 *base_name = svn_path_basename(path, pool);
996 svn_path_split_if_file(const char *path,
997 const char **pdirectory,
1004 SVN_ERR_ASSERT(svn_path_is_canonical(path, pool));
1006 err = svn_io_stat(&finfo, path, APR_FINFO_TYPE, pool);
1007 if (err && ! APR_STATUS_IS_ENOENT(err->apr_err))
1010 if (err || finfo.filetype == APR_REG)
1012 svn_error_clear(err);
1013 svn_path_split(path, pdirectory, pfile, pool);
1015 else if (finfo.filetype == APR_DIR)
1018 *pfile = SVN_EMPTY_PATH;
1022 return svn_error_createf(SVN_ERR_BAD_FILENAME, NULL,
1023 _("'%s' is neither a file nor a directory name"),
1024 svn_path_local_style(path, pool));
1027 return SVN_NO_ERROR;
1030 /*** From stream.c ***/
1031 svn_error_t *svn_stream_copy2(svn_stream_t *from, svn_stream_t *to,
1032 svn_cancel_func_t cancel_func,
1034 apr_pool_t *scratch_pool)
1036 return svn_error_trace(svn_stream_copy3(
1037 svn_stream_disown(from, scratch_pool),
1038 svn_stream_disown(to, scratch_pool),
1039 cancel_func, cancel_baton, scratch_pool));
1042 svn_error_t *svn_stream_copy(svn_stream_t *from, svn_stream_t *to,
1043 apr_pool_t *scratch_pool)
1045 return svn_error_trace(svn_stream_copy3(
1046 svn_stream_disown(from, scratch_pool),
1047 svn_stream_disown(to, scratch_pool),
1048 NULL, NULL, scratch_pool));
1052 svn_stream_from_aprfile(apr_file_t *file, apr_pool_t *pool)
1054 return svn_stream_from_aprfile2(file, TRUE, pool);
1058 svn_stream_contents_same(svn_boolean_t *same,
1059 svn_stream_t *stream1,
1060 svn_stream_t *stream2,
1063 return svn_error_trace(svn_stream_contents_same2(
1065 svn_stream_disown(stream1, pool),
1066 svn_stream_disown(stream2, pool),
1070 /*** From path.c ***/
1073 svn_path_internal_style(const char *path, apr_pool_t *pool)
1075 if (svn_path_is_url(path))
1076 return svn_uri_canonicalize(path, pool);
1078 return svn_dirent_internal_style(path, pool);
1083 svn_path_local_style(const char *path, apr_pool_t *pool)
1085 if (svn_path_is_url(path))
1086 return apr_pstrdup(pool, path);
1088 return svn_dirent_local_style(path, pool);
1092 svn_path_canonicalize(const char *path, apr_pool_t *pool)
1094 if (svn_path_is_url(path))
1095 return svn_uri_canonicalize(path, pool);
1097 return svn_dirent_canonicalize(path, pool);
1101 /*** From mergeinfo.c ***/
1104 svn_mergeinfo_inheritable(svn_mergeinfo_t *output,
1105 svn_mergeinfo_t mergeinfo,
1111 return svn_error_trace(svn_mergeinfo_inheritable2(output, mergeinfo, path,
1117 svn_rangelist_inheritable(svn_rangelist_t **inheritable_rangelist,
1118 const svn_rangelist_t *rangelist,
1123 return svn_error_trace(svn_rangelist_inheritable2(inheritable_rangelist,
1130 svn_rangelist_merge(svn_rangelist_t **rangelist,
1131 const svn_rangelist_t *changes,
1134 SVN_ERR(svn_rangelist_merge2(*rangelist, changes,
1137 return svn_error_trace(
1138 svn_rangelist__combine_adjacent_ranges(*rangelist, pool));
1142 svn_mergeinfo_diff(svn_mergeinfo_t *deleted, svn_mergeinfo_t *added,
1143 svn_mergeinfo_t from, svn_mergeinfo_t to,
1144 svn_boolean_t consider_inheritance,
1147 return svn_error_trace(svn_mergeinfo_diff2(deleted, added, from, to,
1148 consider_inheritance, pool,
1153 svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo,
1154 svn_mergeinfo_t changes,
1157 return svn_error_trace(svn_mergeinfo_merge2(mergeinfo, changes, pool,
1162 svn_mergeinfo_remove(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t eraser,
1163 svn_mergeinfo_t whiteboard, apr_pool_t *pool)
1165 return svn_mergeinfo_remove2(mergeinfo, eraser, whiteboard, TRUE, pool,
1170 svn_mergeinfo_intersect(svn_mergeinfo_t *mergeinfo,
1171 svn_mergeinfo_t mergeinfo1,
1172 svn_mergeinfo_t mergeinfo2,
1175 return svn_mergeinfo_intersect2(mergeinfo, mergeinfo1, mergeinfo2,
1179 /*** From config.c ***/
1181 svn_config_create(svn_config_t **cfgp,
1182 svn_boolean_t section_names_case_sensitive,
1183 apr_pool_t *result_pool)
1185 return svn_error_trace(svn_config_create2(cfgp,
1186 section_names_case_sensitive,
1192 svn_config_read2(svn_config_t **cfgp, const char *file,
1193 svn_boolean_t must_exist,
1194 svn_boolean_t section_names_case_sensitive,
1195 apr_pool_t *result_pool)
1197 return svn_error_trace(svn_config_read3(cfgp, file,
1199 section_names_case_sensitive,
1205 svn_config_read(svn_config_t **cfgp, const char *file,
1206 svn_boolean_t must_exist,
1207 apr_pool_t *result_pool)
1209 return svn_error_trace(svn_config_read3(cfgp, file,
1215 #ifdef SVN_DISABLE_FULL_VERSION_MATCH
1216 /* This double underscore name is used by the 1.6 command line client.
1217 Keeping this name is sufficient for the 1.6 client to use the 1.7
1218 libraries at runtime. */
1220 svn_opt__eat_peg_revisions(apr_array_header_t **true_targets_p,
1221 apr_array_header_t *targets,
1224 svn_opt__eat_peg_revisions(apr_array_header_t **true_targets_p,
1225 apr_array_header_t *targets,
1229 apr_array_header_t *true_targets;
1231 true_targets = apr_array_make(pool, 5, sizeof(const char *));
1233 for (i = 0; i < targets->nelts; i++)
1235 const char *target = APR_ARRAY_IDX(targets, i, const char *);
1236 const char *true_target;
1238 SVN_ERR(svn_opt__split_arg_at_peg_revision(&true_target, NULL,
1240 APR_ARRAY_PUSH(true_targets, const char *) = true_target;
1243 SVN_ERR_ASSERT(true_targets_p);
1244 *true_targets_p = true_targets;
1246 return SVN_NO_ERROR;
1251 svn_xml_make_header(svn_stringbuf_t **str, apr_pool_t *pool)
1253 svn_xml_make_header2(str, NULL, pool);
1257 svn_utf_initialize(apr_pool_t *pool)
1259 svn_utf_initialize2(FALSE, pool);
1263 svn_subst_build_keywords(svn_subst_keywords_t *kw,
1264 const char *keywords_val,
1272 const svn_string_t *val;
1274 SVN_ERR(svn_subst_build_keywords2(&kwhash, keywords_val, rev,
1275 url, date, author, pool));
1277 /* The behaviour of pre-1.3 svn_subst_build_keywords, which we are
1278 * replicating here, is to write to a slot in the svn_subst_keywords_t
1279 * only if the relevant keyword was present in keywords_val, otherwise
1280 * leaving that slot untouched. */
1282 val = svn_hash_gets(kwhash, SVN_KEYWORD_REVISION_LONG);
1286 val = svn_hash_gets(kwhash, SVN_KEYWORD_DATE_LONG);
1290 val = svn_hash_gets(kwhash, SVN_KEYWORD_AUTHOR_LONG);
1294 val = svn_hash_gets(kwhash, SVN_KEYWORD_URL_LONG);
1298 val = svn_hash_gets(kwhash, SVN_KEYWORD_ID);
1302 return SVN_NO_ERROR;
1305 /*** From version.c ***/
1307 svn_ver_check_list(const svn_version_t *my_version,
1308 const svn_version_checklist_t *checklist)
1310 return svn_ver_check_list2(my_version, checklist, svn_ver_compatible);