~ubuntu-branches/ubuntu/trusty/subversion/trusty-proposed

« back to all changes in this revision

Viewing changes to subversion/include/svn_path.h

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft
  • Date: 2012-06-21 15:36:36 UTC
  • mfrom: (0.4.13 sid)
  • Revision ID: package-import@ubuntu.com-20120621153636-amqqmuidgwgxz1ly
Tags: 1.7.5-1ubuntu1
* Merge from Debian unstable.  Remaining changes:
  - Create pot file on build.
  - Build a python-subversion-dbg package.
  - Build-depend on python-dbg.
  - Build-depend on default-jre-headless/-jdk.
  - Do not apply java-build patch.
  - debian/rules: Manually create the doxygen output directory, otherwise
    we get weird build failures when running parallel builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**
2
2
 * @copyright
3
3
 * ====================================================================
4
 
 * Copyright (c) 2000-2004 CollabNet.  All rights reserved.
5
 
 *
6
 
 * This software is licensed as described in the file COPYING, which
7
 
 * you should have received as part of this distribution.  The terms
8
 
 * are also available at http://subversion.tigris.org/license-1.html.
9
 
 * If newer versions of this license are posted there, you may use a
10
 
 * newer version instead, at your option.
11
 
 *
12
 
 * This software consists of voluntary contributions made by many
13
 
 * individuals.  For exact contribution history, see the revision
14
 
 * history and logs, available at http://subversion.tigris.org/.
 
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.
15
20
 * ====================================================================
16
21
 * @endcopyright
17
22
 *
49
54
 
50
55
#include "svn_types.h"
51
56
#include "svn_string.h"
 
57
#include "svn_dirent_uri.h"
52
58
 
53
59
 
54
60
#ifdef __cplusplus
57
63
 
58
64
 
59
65
 
60
 
/** Convert @a path from the local style to the canonical internal style. */
 
66
/** Convert @a path from the local style to the canonical internal style.
 
67
 *
 
68
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
69
 * New code should use svn_dirent_internal_style().
 
70
 */
 
71
SVN_DEPRECATED
61
72
const char *
62
73
svn_path_internal_style(const char *path, apr_pool_t *pool);
63
74
 
64
 
/** Convert @a path from the canonical internal style to the local style. */
 
75
/** Convert @a path from the canonical internal style to the local style.
 
76
 *
 
77
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
78
 * New code should use svn_dirent_local_style().
 
79
 */
 
80
SVN_DEPRECATED
65
81
const char *
66
82
svn_path_local_style(const char *path, apr_pool_t *pool);
67
83
 
88
104
 * based on a leading '/' character.  Thus, an "absolute URI" for the
89
105
 * @a component won't be detected. An absolute URI can only be used
90
106
 * for the base.
 
107
 *
 
108
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
109
 * New code should use svn_dirent_join(), svn_uri_join(),
 
110
 * svn_relpath_join() or svn_fspath__join().
91
111
 */
 
112
SVN_DEPRECATED
92
113
char *
93
114
svn_path_join(const char *base, const char *component, apr_pool_t *pool);
94
115
 
103
124
 * This function does not support URLs.
104
125
 *
105
126
 * See svn_path_join() for further notes about joining paths.
 
127
 *
 
128
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
129
 * For new code, consider using svn_dirent_join_many() or a sequence of
 
130
 * calls to one of the *_join() functions.
106
131
 */
 
132
SVN_DEPRECATED
107
133
char *
108
134
svn_path_join_many(apr_pool_t *pool, const char *base, ...);
109
135
 
119
145
 * The returned basename will be allocated in @a pool.
120
146
 *
121
147
 * @note If an empty string is passed, then an empty string will be returned.
 
148
 *
 
149
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
150
 * New code should use svn_dirent_basename(), svn_uri_basename(),
 
151
 * svn_relpath_basename() or svn_fspath__basename().
122
152
 */
 
153
SVN_DEPRECATED
123
154
char *
124
155
svn_path_basename(const char *path, apr_pool_t *pool);
125
156
 
128
159
 * returned unchanged.
129
160
 *
130
161
 * The returned dirname will be allocated in @a pool.
 
162
 *
 
163
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
164
 * New code should use svn_dirent_dirname(), svn_uri_dirname(),
 
165
 * svn_relpath_dirname() or svn_fspath__dirname().
131
166
 */
 
167
SVN_DEPRECATED
132
168
char *
133
169
svn_path_dirname(const char *path, apr_pool_t *pool);
134
170
 
195
231
 *             - <pre>"X:/"           ==>  "X:/" and "X:/"</pre>
196
232
 *             - <pre>"bar"           ==>  ""   and "bar"</pre>
197
233
 *             - <pre>""              ==>  ""   and ""</pre>
 
234
 *
 
235
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
236
 * New code should use svn_dirent_split(), svn_uri_split(),
 
237
 * svn_relpath_split() or svn_fspath__split().
198
238
 */
 
239
SVN_DEPRECATED
199
240
void
200
241
svn_path_split(const char *path,
201
242
               const char **dirpath,
210
251
int
211
252
svn_path_is_empty(const char *path);
212
253
 
 
254
 
213
255
#ifndef SVN_DIRENT_URI_H
214
 
/* This declaration has been moved to svn_dirent_uri.h, remains here only for
215
 
   compatiblity reasons. */
 
256
/* This declaration has been moved to svn_dirent_uri.h, and remains
 
257
   here only for compatibility reasons. */
216
258
svn_boolean_t
217
259
svn_dirent_is_root(const char *dirent, apr_size_t len);
218
260
#endif /* SVN_DIRENT_URI_H */
219
261
 
 
262
 
220
263
/** Return a new path (or URL) like @a path, but transformed such that
221
264
 * some types of path specification redundancies are removed.
222
265
 *
229
272
 *
230
273
 * The returned path may be statically allocated, equal to @a path, or
231
274
 * allocated from @a pool.
 
275
 *
 
276
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
277
 * New code should use svn_dirent_canonicalize(), svn_uri_canonicalize(),
 
278
 * svn_relpath_canonicalize() or svn_fspath__canonicalize().
232
279
 */
 
280
SVN_DEPRECATED
233
281
const char *
234
282
svn_path_canonicalize(const char *path, apr_pool_t *pool);
235
283
 
237
285
 * allocations.
238
286
 *
239
287
 * @since New in 1.5.
 
288
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
289
 * New code should use svn_dirent_is_canonical(), svn_uri_is_canonical(),
 
290
 * svn_relpath_is_canonical() or svn_fspath__is_canonical().
240
291
 */
 
292
SVN_DEPRECATED
241
293
svn_boolean_t
242
294
svn_path_is_canonical(const char *path, apr_pool_t *pool);
243
295
 
258
310
 * with the same path but different protocols may point at completely
259
311
 * different resources), and (b) share a common ancestor in their path
260
312
 * component, i.e. 'protocol://' is not a sufficient ancestor.
 
313
 *
 
314
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
315
 * New code should use svn_dirent_get_longest_ancestor(),
 
316
 * svn_uri_get_longest_ancestor(), svn_relpath_get_longest_ancestor() or
 
317
 * svn_fspath__get_longest_ancestor().
261
318
 */
 
319
SVN_DEPRECATED
262
320
char *
263
321
svn_path_get_longest_ancestor(const char *path1,
264
322
                              const char *path2,
269
327
 *
270
328
 * @a relative may be a URL, in which case no attempt is made to convert it,
271
329
 * and a copy of the URL is returned.
 
330
 *
 
331
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
332
 * New code should use svn_dirent_get_absolute() on a non-URL input.
272
333
 */
 
334
SVN_DEPRECATED
273
335
svn_error_t *
274
336
svn_path_get_absolute(const char **pabsolute,
275
337
                      const char *relative,
280
342
 * directory, set @a *pdirectory to @a path, and @a *pfile to the
281
343
 * empty string.  If @a path does not exist it is treated as if it is
282
344
 * a file, since directories do not normally vanish.
 
345
 *
 
346
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
347
 * New code should implement the required logic directly; no direct
 
348
 * replacement is provided.
283
349
 */
 
350
SVN_DEPRECATED
284
351
svn_error_t *
285
352
svn_path_split_if_file(const char *path,
286
353
                       const char **pdirectory,
316
383
 * applicable) @a *pcondensed_targets to @c NULL.
317
384
 *
318
385
 * @note There is no guarantee that @a *pcommon is within a working
319
 
 * copy.  */
 
386
 * copy.
 
387
 *
 
388
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
389
 * New code should use svn_dirent_condense_targets() or
 
390
 * svn_uri_condense_targets().
 
391
 */
 
392
SVN_DEPRECATED
320
393
svn_error_t *
321
394
svn_path_condense_targets(const char **pcommon,
322
395
                          apr_array_header_t **pcondensed_targets,
435
508
 *       in which case a pointer into @a path2 will be returned to
436
509
 *       identify the remainder path.
437
510
 *
438
 
 * ### @todo the ".." restriction is unfortunate, and would ideally
439
 
 * be lifted by making the implementation smarter.  But this is not
440
 
 * trivial: if the path is "../foo", how do you know whether or not
441
 
 * the current directory is named "foo" in its parent?
 
511
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
512
 * New code should use svn_dirent_is_child(), svn_uri_is_child(),
 
513
 * svn_relpath_is_child() or svn_fspath__is_child().
442
514
 */
 
515
SVN_DEPRECATED
443
516
const char *
444
517
svn_path_is_child(const char *path1, const char *path2, apr_pool_t *pool);
445
518
 
447
520
 * and FALSE otherwise.
448
521
 *
449
522
 * @since New in 1.3.
 
523
 *
 
524
 * @deprecated Provided for backward compatibility with the 1.6 API.
 
525
 * New code should use svn_dirent_is_ancestor(), svn_uri_is_ancestor(),
 
526
 * svn_relpath_is_ancestor() or svn_fspath__is_ancestor().
450
527
 */
 
528
SVN_DEPRECATED
451
529
svn_boolean_t
452
530
svn_path_is_ancestor(const char *path1, const char *path2);
453
531
 
530
608
                            const char *component,
531
609
                            apr_pool_t *pool);
532
610
 
533
 
/** Like svn_path_url_add_component2, but allows path components that
 
611
/** Like svn_path_url_add_component2(), but allows path components that
534
612
 * end with a trailing '/'
535
613
 *
536
614
 * @deprecated Provided for backward compatibility with the 1.5 API.