DragonNest/Common/SVNLib/doc/svn__path_8h-source.html
2024-12-19 09:48:26 +08:00

576 lines
61 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Subversion: svn_path.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label>&nbsp;<u>S</u>earch&nbsp;for&nbsp;</label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul>
</div>
<h1>svn_path.h</h1><a href="svn__path_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**</span>
<a name="l00002"></a>00002 <span class="comment"> * @copyright</span>
<a name="l00003"></a>00003 <span class="comment"> * ====================================================================</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (c) 2000-2004 CollabNet. All rights reserved.</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * This software is licensed as described in the file COPYING, which</span>
<a name="l00007"></a>00007 <span class="comment"> * you should have received as part of this distribution. The terms</span>
<a name="l00008"></a>00008 <span class="comment"> * are also available at http://subversion.tigris.org/license-1.html.</span>
<a name="l00009"></a>00009 <span class="comment"> * If newer versions of this license are posted there, you may use a</span>
<a name="l00010"></a>00010 <span class="comment"> * newer version instead, at your option.</span>
<a name="l00011"></a>00011 <span class="comment"> *</span>
<a name="l00012"></a>00012 <span class="comment"> * This software consists of voluntary contributions made by many</span>
<a name="l00013"></a>00013 <span class="comment"> * individuals. For exact contribution history, see the revision</span>
<a name="l00014"></a>00014 <span class="comment"> * history and logs, available at http://subversion.tigris.org/.</span>
<a name="l00015"></a>00015 <span class="comment"> * ====================================================================</span>
<a name="l00016"></a>00016 <span class="comment"> * @endcopyright</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * @file svn_path.h</span>
<a name="l00019"></a>00019 <span class="comment"> * @brief A path manipulation library</span>
<a name="l00020"></a>00020 <span class="comment"> *</span>
<a name="l00021"></a>00021 <span class="comment"> * All incoming and outgoing paths are non-NULL and in UTF-8, unless</span>
<a name="l00022"></a>00022 <span class="comment"> * otherwise documented.</span>
<a name="l00023"></a>00023 <span class="comment"> *</span>
<a name="l00024"></a>00024 <span class="comment"> * No result path ever ends with a separator, no matter whether the</span>
<a name="l00025"></a>00025 <span class="comment"> * path is a file or directory, because we always canonicalize() it.</span>
<a name="l00026"></a>00026 <span class="comment"> *</span>
<a name="l00027"></a>00027 <span class="comment"> * Nearly all the @c svn_path_xxx functions expect paths passed into</span>
<a name="l00028"></a>00028 <span class="comment"> * them to be in canonical form as defined by the Subversion path</span>
<a name="l00029"></a>00029 <span class="comment"> * library itself. The only functions which do *not* have such</span>
<a name="l00030"></a>00030 <span class="comment"> * expectations are:</span>
<a name="l00031"></a>00031 <span class="comment"> *</span>
<a name="l00032"></a>00032 <span class="comment"> * - @c svn_path_canonicalize()</span>
<a name="l00033"></a>00033 <span class="comment"> * - @c svn_path_is_canonical()</span>
<a name="l00034"></a>00034 <span class="comment"> * - @c svn_path_internal_style()</span>
<a name="l00035"></a>00035 <span class="comment"> *</span>
<a name="l00036"></a>00036 <span class="comment"> * For the most part, we mean what most anyone would mean when talking</span>
<a name="l00037"></a>00037 <span class="comment"> * about canonical paths, but to be on the safe side, you must run</span>
<a name="l00038"></a>00038 <span class="comment"> * your paths through @c svn_path_canonicalize() before passing them to</span>
<a name="l00039"></a>00039 <span class="comment"> * other functions in this API.</span>
<a name="l00040"></a>00040 <span class="comment"> */</span>
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="preprocessor">#ifndef SVN_PATH_H</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define SVN_PATH_H</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span>
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="preprocessor">#include &lt;apr_pools.h&gt;</span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &lt;apr_tables.h&gt;</span>
<a name="l00048"></a>00048
<a name="l00049"></a>00049 <span class="preprocessor">#include "<a class="code" href="svn__string_8h.html" title="Counted-length strings for Subversion, plus some C string goodies.">svn_string.h</a>"</span>
<a name="l00050"></a>00050 <span class="preprocessor">#include "<a class="code" href="svn__error_8h.html" title="Common exception handling for Subversion.">svn_error.h</a>"</span>
<a name="l00051"></a>00051
<a name="l00052"></a>00052
<a name="l00053"></a>00053 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
<a name="l00055"></a>00055 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00056"></a>00056
<a name="l00057"></a>00057
<a name="l00058"></a>00058 <span class="comment"></span>
<a name="l00059"></a>00059 <span class="comment">/** Convert @a path from the local style to the canonical internal style. */</span>
<a name="l00060"></a>00060 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="svn__path_8h.html#9b002c8492b3f42010ce194bc4fe9674" title="Convert path from the local style to the canonical internal style.">svn_path_internal_style</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, apr_pool_t *pool);
<a name="l00061"></a>00061 <span class="comment"></span>
<a name="l00062"></a>00062 <span class="comment">/** Convert @a path from the canonical internal style to the local style. */</span>
<a name="l00063"></a>00063 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="svn__path_8h.html#12c6078657e62c3fa5a7c27c842f533e" title="Convert path from the canonical internal style to the local style.">svn_path_local_style</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, apr_pool_t *pool);
<a name="l00064"></a>00064
<a name="l00065"></a>00065 <span class="comment"></span>
<a name="l00066"></a>00066 <span class="comment">/** Join a base path (@a base) with a component (@a component), allocated in</span>
<a name="l00067"></a>00067 <span class="comment"> * @a pool.</span>
<a name="l00068"></a>00068 <span class="comment"> *</span>
<a name="l00069"></a>00069 <span class="comment"> * If either @a base or @a component is the empty path, then the other</span>
<a name="l00070"></a>00070 <span class="comment"> * argument will be copied and returned. If both are the empty path the</span>
<a name="l00071"></a>00071 <span class="comment"> * empty path is returned.</span>
<a name="l00072"></a>00072 <span class="comment"> *</span>
<a name="l00073"></a>00073 <span class="comment"> * If the @a component is an absolute path, then it is copied and returned.</span>
<a name="l00074"></a>00074 <span class="comment"> * Exactly one slash character ('/') is used to joined the components,</span>
<a name="l00075"></a>00075 <span class="comment"> * accounting for any trailing slash in @a base.</span>
<a name="l00076"></a>00076 <span class="comment"> *</span>
<a name="l00077"></a>00077 <span class="comment"> * Note that the contents of @a base are not examined, so it is possible to</span>
<a name="l00078"></a>00078 <span class="comment"> * use this function for constructing URLs, or for relative URLs or</span>
<a name="l00079"></a>00079 <span class="comment"> * repository paths.</span>
<a name="l00080"></a>00080 <span class="comment"> *</span>
<a name="l00081"></a>00081 <span class="comment"> * This function is NOT appropriate for native (local) file</span>
<a name="l00082"></a>00082 <span class="comment"> * paths. Only for "internal" canonicalized paths, since it uses '/'</span>
<a name="l00083"></a>00083 <span class="comment"> * for the separator. Further, an absolute path (for @a component) is</span>
<a name="l00084"></a>00084 <span class="comment"> * based on a leading '/' character. Thus, an "absolute URI" for the</span>
<a name="l00085"></a>00085 <span class="comment"> * @a component won't be detected. An absolute URI can only be used</span>
<a name="l00086"></a>00086 <span class="comment"> * for the base.</span>
<a name="l00087"></a>00087 <span class="comment"> */</span>
<a name="l00088"></a>00088 <span class="keywordtype">char</span> *<a class="code" href="svn__path_8h.html#a2d6c1ad05e2e71d91981b63a313a9d9" title="Join a base path (base) with a component (component), allocated in pool.">svn_path_join</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *base,
<a name="l00089"></a>00089 <span class="keyword">const</span> <span class="keywordtype">char</span> *component,
<a name="l00090"></a>00090 apr_pool_t *pool);
<a name="l00091"></a>00091 <span class="comment"></span>
<a name="l00092"></a>00092 <span class="comment">/** Join multiple components onto a @a base path, allocated in @a pool. The</span>
<a name="l00093"></a>00093 <span class="comment"> * components are terminated by a @c NULL.</span>
<a name="l00094"></a>00094 <span class="comment"> *</span>
<a name="l00095"></a>00095 <span class="comment"> * If any component is the empty string, it will be ignored.</span>
<a name="l00096"></a>00096 <span class="comment"> *</span>
<a name="l00097"></a>00097 <span class="comment"> * If any component is an absolute path, then it resets the base and</span>
<a name="l00098"></a>00098 <span class="comment"> * further components will be appended to it.</span>
<a name="l00099"></a>00099 <span class="comment"> *</span>
<a name="l00100"></a>00100 <span class="comment"> * See svn_path_join() for further notes about joining paths.</span>
<a name="l00101"></a>00101 <span class="comment"> */</span>
<a name="l00102"></a>00102 <span class="keywordtype">char</span> *<a class="code" href="svn__path_8h.html#8b124175ae26b1a3b04964cb3b4fce47" title="Join multiple components onto a base path, allocated in pool.">svn_path_join_many</a>(apr_pool_t *pool, <span class="keyword">const</span> <span class="keywordtype">char</span> *base, ...);
<a name="l00103"></a>00103
<a name="l00104"></a>00104 <span class="comment"></span>
<a name="l00105"></a>00105 <span class="comment">/** Get the basename of the specified canonicalized @a path. The</span>
<a name="l00106"></a>00106 <span class="comment"> * basename is defined as the last component of the path (ignoring any</span>
<a name="l00107"></a>00107 <span class="comment"> * trailing slashes). If the @a path is root ("/"), then that is</span>
<a name="l00108"></a>00108 <span class="comment"> * returned. Otherwise, the returned value will have no slashes in</span>
<a name="l00109"></a>00109 <span class="comment"> * it.</span>
<a name="l00110"></a>00110 <span class="comment"> *</span>
<a name="l00111"></a>00111 <span class="comment"> * Example: svn_path_basename("/foo/bar") -&gt; "bar"</span>
<a name="l00112"></a>00112 <span class="comment"> *</span>
<a name="l00113"></a>00113 <span class="comment"> * The returned basename will be allocated in @a pool.</span>
<a name="l00114"></a>00114 <span class="comment"> *</span>
<a name="l00115"></a>00115 <span class="comment"> * @note If an empty string is passed, then an empty string will be returned.</span>
<a name="l00116"></a>00116 <span class="comment"> */</span>
<a name="l00117"></a>00117 <span class="keywordtype">char</span> *<a class="code" href="svn__path_8h.html#5f92b0550594a647cb1aa2bf459905a0" title="Get the basename of the specified canonicalized path.">svn_path_basename</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, apr_pool_t *pool);
<a name="l00118"></a>00118 <span class="comment"></span>
<a name="l00119"></a>00119 <span class="comment">/** Get the dirname of the specified canonicalized @a path, defined as</span>
<a name="l00120"></a>00120 <span class="comment"> * the path with its basename removed.</span>
<a name="l00121"></a>00121 <span class="comment"> *</span>
<a name="l00122"></a>00122 <span class="comment"> * Get the dirname of the specified @a path, defined as the path with its</span>
<a name="l00123"></a>00123 <span class="comment"> * basename removed. If @a path is root ("/"), it is returned unchanged.</span>
<a name="l00124"></a>00124 <span class="comment"> *</span>
<a name="l00125"></a>00125 <span class="comment"> * The returned dirname will be allocated in @a pool.</span>
<a name="l00126"></a>00126 <span class="comment"> */</span>
<a name="l00127"></a>00127 <span class="keywordtype">char</span> *<a class="code" href="svn__path_8h.html#27b1486db97591805fb513a1c73014c3" title="Get the dirname of the specified canonicalized path, defined as the path with its...">svn_path_dirname</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, apr_pool_t *pool);
<a name="l00128"></a>00128 <span class="comment"></span>
<a name="l00129"></a>00129 <span class="comment">/** Split @a path into a root portion and an extension such that</span>
<a name="l00130"></a>00130 <span class="comment"> * the root + the extension = the original path, and where the</span>
<a name="l00131"></a>00131 <span class="comment"> * extension contains no period (.) characters. If not @c NULL, set</span>
<a name="l00132"></a>00132 <span class="comment"> * @a *path_root to the root portion. If not @c NULL, set</span>
<a name="l00133"></a>00133 <span class="comment"> * @a *path_ext to the extension (or "" if there is no extension</span>
<a name="l00134"></a>00134 <span class="comment"> * found). Allocate both @a *path_root and @a *path_ext in @a pool.</span>
<a name="l00135"></a>00135 <span class="comment"> *</span>
<a name="l00136"></a>00136 <span class="comment"> * @since New in 1.5.</span>
<a name="l00137"></a>00137 <span class="comment"> */</span>
<a name="l00138"></a>00138 <span class="keywordtype">void</span> <a class="code" href="svn__path_8h.html#9213e8c2c819ef1e78376bdeece0610f" title="Split path into a root portion and an extension such that the root + the extension...">svn_path_splitext</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> **path_root, <span class="keyword">const</span> <span class="keywordtype">char</span> **path_ext,
<a name="l00139"></a>00139 <span class="keyword">const</span> <span class="keywordtype">char</span> *path, apr_pool_t *pool);
<a name="l00140"></a>00140 <span class="comment"></span>
<a name="l00141"></a>00141 <span class="comment">/** Return the number of components in the canonicalized @a path.</span>
<a name="l00142"></a>00142 <span class="comment"> *</span>
<a name="l00143"></a>00143 <span class="comment"> * @since New in 1.1.</span>
<a name="l00144"></a>00144 <span class="comment">*/</span>
<a name="l00145"></a>00145 apr_size_t
<a name="l00146"></a>00146 <a class="code" href="svn__path_8h.html#e917e0db36f1e329e210ef3192b4deaf" title="Return the number of components in the canonicalized path.">svn_path_component_count</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path);
<a name="l00147"></a>00147 <span class="comment"></span>
<a name="l00148"></a>00148 <span class="comment">/** Add a @a component (a NULL-terminated C-string) to the</span>
<a name="l00149"></a>00149 <span class="comment"> * canonicalized @a path. @a component is allowed to contain</span>
<a name="l00150"></a>00150 <span class="comment"> * directory separators.</span>
<a name="l00151"></a>00151 <span class="comment"> *</span>
<a name="l00152"></a>00152 <span class="comment"> * If @a path is non-empty, append the appropriate directory separator</span>
<a name="l00153"></a>00153 <span class="comment"> * character, and then @a component. If @a path is empty, simply set it to</span>
<a name="l00154"></a>00154 <span class="comment"> * @a component; don't add any separator character.</span>
<a name="l00155"></a>00155 <span class="comment"> *</span>
<a name="l00156"></a>00156 <span class="comment"> * If the result ends in a separator character, then remove the separator.</span>
<a name="l00157"></a>00157 <span class="comment"> */</span>
<a name="l00158"></a>00158 <span class="keywordtype">void</span> <a class="code" href="svn__path_8h.html#f9aa1a5c802b9adaeffdf7cfb742350f" title="Add a component (a NULL-terminated C-string) to the canonicalized path.">svn_path_add_component</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *path,
<a name="l00159"></a>00159 <span class="keyword">const</span> <span class="keywordtype">char</span> *component);
<a name="l00160"></a>00160 <span class="comment"></span>
<a name="l00161"></a>00161 <span class="comment">/** Remove one component off the end of the canonicalized @a path. */</span>
<a name="l00162"></a>00162 <span class="keywordtype">void</span> <a class="code" href="svn__path_8h.html#a8cd686d60f29900e6f2400650c9b65d" title="Remove one component off the end of the canonicalized path.">svn_path_remove_component</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *path);
<a name="l00163"></a>00163 <span class="comment"></span>
<a name="l00164"></a>00164 <span class="comment">/** Remove @a n components off the end of the canonicalized @a path.</span>
<a name="l00165"></a>00165 <span class="comment"> * Equivalent to calling svn_path_remove_component() @a n times.</span>
<a name="l00166"></a>00166 <span class="comment"> *</span>
<a name="l00167"></a>00167 <span class="comment"> * @since New in 1.1.</span>
<a name="l00168"></a>00168 <span class="comment"> */</span>
<a name="l00169"></a>00169 <span class="keywordtype">void</span> <a class="code" href="svn__path_8h.html#deabdc440c35448dc47d540a0fe71a12" title="Remove n components off the end of the canonicalized path.">svn_path_remove_components</a>(<a class="code" href="structsvn__stringbuf__t.html" title="A buffered string, capable of appending without an allocation and copy for each append...">svn_stringbuf_t</a> *path, apr_size_t n);
<a name="l00170"></a>00170 <span class="comment"></span>
<a name="l00171"></a>00171 <span class="comment">/** Divide the canonicalized @a path into @a *dirpath and @a</span>
<a name="l00172"></a>00172 <span class="comment"> * *base_name, allocated in @a pool.</span>
<a name="l00173"></a>00173 <span class="comment"> *</span>
<a name="l00174"></a>00174 <span class="comment"> * If @a dirpath or @a base_name is NULL, then don't set that one.</span>
<a name="l00175"></a>00175 <span class="comment"> *</span>
<a name="l00176"></a>00176 <span class="comment"> * Either @a dirpath or @a base_name may be @a path's own address, but they</span>
<a name="l00177"></a>00177 <span class="comment"> * may not both be the same address, or the results are undefined.</span>
<a name="l00178"></a>00178 <span class="comment"> *</span>
<a name="l00179"></a>00179 <span class="comment"> * If @a path has two or more components, the separator between @a dirpath</span>
<a name="l00180"></a>00180 <span class="comment"> * and @a base_name is not included in either of the new names.</span>
<a name="l00181"></a>00181 <span class="comment"> *</span>
<a name="l00182"></a>00182 <span class="comment"> * examples:</span>
<a name="l00183"></a>00183 <span class="comment"> * - &lt;pre&gt;"/foo/bar/baz" ==&gt; "/foo/bar" and "baz"&lt;/pre&gt;</span>
<a name="l00184"></a>00184 <span class="comment"> * - &lt;pre&gt;"/bar" ==&gt; "/" and "bar"&lt;/pre&gt;</span>
<a name="l00185"></a>00185 <span class="comment"> * - &lt;pre&gt;"/" ==&gt; "/" and "/"&lt;/pre&gt;</span>
<a name="l00186"></a>00186 <span class="comment"> * - &lt;pre&gt;"X:/" ==&gt; "X:/" and "X:/"&lt;/pre&gt;</span>
<a name="l00187"></a>00187 <span class="comment"> * - &lt;pre&gt;"bar" ==&gt; "" and "bar"&lt;/pre&gt;</span>
<a name="l00188"></a>00188 <span class="comment"> * - &lt;pre&gt;"" ==&gt; "" and ""&lt;/pre&gt;</span>
<a name="l00189"></a>00189 <span class="comment"> */</span>
<a name="l00190"></a>00190 <span class="keywordtype">void</span> <a class="code" href="svn__path_8h.html#0bc6d306f3c26daa29a689ce0c8173aa" title="Divide the canonicalized path into *dirpath and *base_name, allocated in pool.">svn_path_split</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path,
<a name="l00191"></a>00191 <span class="keyword">const</span> <span class="keywordtype">char</span> **dirpath,
<a name="l00192"></a>00192 <span class="keyword">const</span> <span class="keywordtype">char</span> **base_name,
<a name="l00193"></a>00193 apr_pool_t *pool);
<a name="l00194"></a>00194
<a name="l00195"></a>00195 <span class="comment"></span>
<a name="l00196"></a>00196 <span class="comment">/** Return non-zero iff @a path is empty ("") or represents the current</span>
<a name="l00197"></a>00197 <span class="comment"> * directory -- that is, if prepending it as a component to an existing</span>
<a name="l00198"></a>00198 <span class="comment"> * path would result in no meaningful change.</span>
<a name="l00199"></a>00199 <span class="comment"> */</span>
<a name="l00200"></a>00200 <span class="keywordtype">int</span> <a class="code" href="svn__path_8h.html#86520f916cb63f8923af5aa40f43e091" title="Return non-zero iff path is empty (&amp;quot;&amp;quot;) or represents the current directory...">svn_path_is_empty</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path);
<a name="l00201"></a>00201 <span class="comment"></span>
<a name="l00202"></a>00202 <span class="comment">/** Return TRUE if @a directory is considered a root directory on the platform</span>
<a name="l00203"></a>00203 <span class="comment"> * at hand, amongst which '/' on all platforms or 'X:/', '\\\\?\\X:/',</span>
<a name="l00204"></a>00204 <span class="comment"> * '\\\\.\\..', '\\\\server\\share' on Windows.</span>
<a name="l00205"></a>00205 <span class="comment"> *</span>
<a name="l00206"></a>00206 <span class="comment"> * @since New in 1.5.</span>
<a name="l00207"></a>00207 <span class="comment"> */</span>
<a name="l00208"></a>00208 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="svn__path_8h.html#b28eb607dfb4fe7137b2e633f9e0604f" title="Return TRUE if directory is considered a root directory on the platform at hand,...">svn_dirent_is_root</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *dirent, apr_size_t len);
<a name="l00209"></a>00209
<a name="l00210"></a>00210 <span class="comment"></span>
<a name="l00211"></a>00211 <span class="comment">/** Return a new path (or URL) like @a path, but transformed such that</span>
<a name="l00212"></a>00212 <span class="comment"> * some types of path specification redundancies are removed.</span>
<a name="l00213"></a>00213 <span class="comment"> *</span>
<a name="l00214"></a>00214 <span class="comment"> * This involves collapsing redundant "/./" elements, removing</span>
<a name="l00215"></a>00215 <span class="comment"> * multiple adjacent separator characters, removing trailing</span>
<a name="l00216"></a>00216 <span class="comment"> * separator characters, and possibly other semantically inoperative</span>
<a name="l00217"></a>00217 <span class="comment"> * transformations.</span>
<a name="l00218"></a>00218 <span class="comment"> *</span>
<a name="l00219"></a>00219 <span class="comment"> * The returned path may be statically allocated, equal to @a path, or</span>
<a name="l00220"></a>00220 <span class="comment"> * allocated from @a pool.</span>
<a name="l00221"></a>00221 <span class="comment"> */</span>
<a name="l00222"></a>00222 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="svn__path_8h.html#71d5716a18e04df175633a65ddac7809" title="Return a new path (or URL) like path, but transformed such that some types of path...">svn_path_canonicalize</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, apr_pool_t *pool);
<a name="l00223"></a>00223 <span class="comment"></span>
<a name="l00224"></a>00224 <span class="comment">/** Return @c TRUE iff path is canonical. Use @a pool for temporary</span>
<a name="l00225"></a>00225 <span class="comment"> * allocations.</span>
<a name="l00226"></a>00226 <span class="comment"> *</span>
<a name="l00227"></a>00227 <span class="comment"> * @note The test for canonicalization is currently defined as</span>
<a name="l00228"></a>00228 <span class="comment"> * "looks exactly the same as @c svn_path_canonicalize() would make</span>
<a name="l00229"></a>00229 <span class="comment"> * it look".</span>
<a name="l00230"></a>00230 <span class="comment"> *</span>
<a name="l00231"></a>00231 <span class="comment"> * @since New in 1.5.</span>
<a name="l00232"></a>00232 <span class="comment"> */</span>
<a name="l00233"></a>00233 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="svn__path_8h.html#ee225e4d7950ad37dc1d2aad8f8411ef" title="Return TRUE iff path is canonical.">svn_path_is_canonical</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, apr_pool_t *pool);
<a name="l00234"></a>00234
<a name="l00235"></a>00235 <span class="comment"></span>
<a name="l00236"></a>00236 <span class="comment">/** Return an integer greater than, equal to, or less than 0, according</span>
<a name="l00237"></a>00237 <span class="comment"> * as @a path1 is greater than, equal to, or less than @a path2.</span>
<a name="l00238"></a>00238 <span class="comment"> */</span>
<a name="l00239"></a>00239 <span class="keywordtype">int</span> <a class="code" href="svn__path_8h.html#64b511c3c7ba94ab18090effbb5b8714" title="Return an integer greater than, equal to, or less than 0, according as path1 is greater...">svn_path_compare_paths</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path1, <span class="keyword">const</span> <span class="keywordtype">char</span> *path2);
<a name="l00240"></a>00240
<a name="l00241"></a>00241 <span class="comment"></span>
<a name="l00242"></a>00242 <span class="comment">/** Return the longest common path shared by two canonicalized paths,</span>
<a name="l00243"></a>00243 <span class="comment"> * @a path1 and @a path2. If there's no common ancestor, return the</span>
<a name="l00244"></a>00244 <span class="comment"> * empty path.</span>
<a name="l00245"></a>00245 <span class="comment"> *</span>
<a name="l00246"></a>00246 <span class="comment"> * @a path1 and @a path2 may be URLs. In order for two URLs to have</span>
<a name="l00247"></a>00247 <span class="comment"> * a common ancestor, they must (a) have the same protocol (since two URLs</span>
<a name="l00248"></a>00248 <span class="comment"> * with the same path but different protocols may point at completely</span>
<a name="l00249"></a>00249 <span class="comment"> * different resources), and (b) share a common ancestor in their path</span>
<a name="l00250"></a>00250 <span class="comment"> * component, i.e. 'protocol://' is not a sufficient ancestor.</span>
<a name="l00251"></a>00251 <span class="comment"> */</span>
<a name="l00252"></a>00252 <span class="keywordtype">char</span> *<a class="code" href="svn__path_8h.html#fc8d6c6604ebbe04537a5cfe0405138e" title="Return the longest common path shared by two canonicalized paths, path1 and path2...">svn_path_get_longest_ancestor</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path1,
<a name="l00253"></a>00253 <span class="keyword">const</span> <span class="keywordtype">char</span> *path2,
<a name="l00254"></a>00254 apr_pool_t *pool);
<a name="l00255"></a>00255 <span class="comment"></span>
<a name="l00256"></a>00256 <span class="comment">/** Convert @a relative canonicalized path to an absolute path and</span>
<a name="l00257"></a>00257 <span class="comment"> * return the results in @a *pabsolute, allocated in @a pool.</span>
<a name="l00258"></a>00258 <span class="comment"> *</span>
<a name="l00259"></a>00259 <span class="comment"> * @a relative may be a URL, in which case no attempt is made to convert it,</span>
<a name="l00260"></a>00260 <span class="comment"> * and a copy of the URL is returned.</span>
<a name="l00261"></a>00261 <span class="comment"> */</span>
<a name="l00262"></a>00262 <a class="code" href="structsvn__error__t.html" title="Subversion error object.">svn_error_t</a> *
<a name="l00263"></a>00263 <a class="code" href="svn__path_8h.html#d485d86ddbb7f8b07857a4992e243aae" title="Convert relative canonicalized path to an absolute path and return the results in...">svn_path_get_absolute</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> **pabsolute,
<a name="l00264"></a>00264 <span class="keyword">const</span> <span class="keywordtype">char</span> *relative,
<a name="l00265"></a>00265 apr_pool_t *pool);
<a name="l00266"></a>00266 <span class="comment"></span>
<a name="l00267"></a>00267 <span class="comment">/** Return the path part of the canonicalized @a path in @a</span>
<a name="l00268"></a>00268 <span class="comment"> * *pdirectory, and the file part in @a *pfile. If @a path is a</span>
<a name="l00269"></a>00269 <span class="comment"> * directory, set @a *pdirectory to @a path, and @a *pfile to the</span>
<a name="l00270"></a>00270 <span class="comment"> * empty string. If @a path does not exist it is treated as if it is</span>
<a name="l00271"></a>00271 <span class="comment"> * a file, since directories do not normally vanish.</span>
<a name="l00272"></a>00272 <span class="comment"> */</span>
<a name="l00273"></a>00273 <a class="code" href="structsvn__error__t.html" title="Subversion error object.">svn_error_t</a> *
<a name="l00274"></a>00274 <a class="code" href="svn__path_8h.html#116fa3935551000e0ad1a478fdb42057" title="Return the path part of the canonicalized path in *pdirectory, and the file part...">svn_path_split_if_file</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path,
<a name="l00275"></a>00275 <span class="keyword">const</span> <span class="keywordtype">char</span> **pdirectory,
<a name="l00276"></a>00276 <span class="keyword">const</span> <span class="keywordtype">char</span> **pfile,
<a name="l00277"></a>00277 apr_pool_t *pool);
<a name="l00278"></a>00278 <span class="comment"></span>
<a name="l00279"></a>00279 <span class="comment">/** Find the common prefix of the canonicalized paths in @a targets</span>
<a name="l00280"></a>00280 <span class="comment"> * (an array of &lt;tt&gt;const char *&lt;/tt&gt;'s), and remove redundant paths if @a</span>
<a name="l00281"></a>00281 <span class="comment"> * remove_redundancies is TRUE.</span>
<a name="l00282"></a>00282 <span class="comment"> *</span>
<a name="l00283"></a>00283 <span class="comment"> * - Set @a *pcommon to the absolute path of the path or URL common to</span>
<a name="l00284"></a>00284 <span class="comment"> * all of the targets. If the targets have no common prefix, or</span>
<a name="l00285"></a>00285 <span class="comment"> * are a mix of URLs and local paths, set @a *pcommon to the</span>
<a name="l00286"></a>00286 <span class="comment"> * empty string.</span>
<a name="l00287"></a>00287 <span class="comment"> *</span>
<a name="l00288"></a>00288 <span class="comment"> * - If @a pcondensed_targets is non-NULL, set @a *pcondensed_targets</span>
<a name="l00289"></a>00289 <span class="comment"> * to an array of targets relative to @a *pcommon, and if</span>
<a name="l00290"></a>00290 <span class="comment"> * @a remove_redundancies is TRUE, omit any paths/URLs that are</span>
<a name="l00291"></a>00291 <span class="comment"> * descendants of another path/URL in @a targets. If *pcommon</span>
<a name="l00292"></a>00292 <span class="comment"> * is empty, @a *pcondensed_targets will contain full URLs and/or</span>
<a name="l00293"></a>00293 <span class="comment"> * absolute paths; redundancies can still be removed (from both URLs</span>
<a name="l00294"></a>00294 <span class="comment"> * and paths). If @a pcondensed_targets is NULL, leave it alone.</span>
<a name="l00295"></a>00295 <span class="comment"> *</span>
<a name="l00296"></a>00296 <span class="comment"> * Else if there is exactly one target, then</span>
<a name="l00297"></a>00297 <span class="comment"> *</span>
<a name="l00298"></a>00298 <span class="comment"> * - Set @a *pcommon to that target, and</span>
<a name="l00299"></a>00299 <span class="comment"> *</span>
<a name="l00300"></a>00300 <span class="comment"> * - If @a pcondensed_targets is non-NULL, set @a *pcondensed_targets</span>
<a name="l00301"></a>00301 <span class="comment"> * to an array containing zero elements. Else if</span>
<a name="l00302"></a>00302 <span class="comment"> * @a pcondensed_targets is NULL, leave it alone.</span>
<a name="l00303"></a>00303 <span class="comment"> *</span>
<a name="l00304"></a>00304 <span class="comment"> * If there are no items in @a targets, set @a *pcommon and (if</span>
<a name="l00305"></a>00305 <span class="comment"> * applicable) @a *pcondensed_targets to @c NULL.</span>
<a name="l00306"></a>00306 <span class="comment"> *</span>
<a name="l00307"></a>00307 <span class="comment"> * @note There is no guarantee that @a *pcommon is within a working</span>
<a name="l00308"></a>00308 <span class="comment"> * copy. */</span>
<a name="l00309"></a>00309 <a class="code" href="structsvn__error__t.html" title="Subversion error object.">svn_error_t</a> *
<a name="l00310"></a>00310 <a class="code" href="svn__path_8h.html#336e77861107b3b14ac3e42c356727ab" title="Find the common prefix of the canonicalized paths in targets (an array of const char...">svn_path_condense_targets</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> **pcommon,
<a name="l00311"></a>00311 apr_array_header_t **pcondensed_targets,
<a name="l00312"></a>00312 <span class="keyword">const</span> apr_array_header_t *targets,
<a name="l00313"></a>00313 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> remove_redundancies,
<a name="l00314"></a>00314 apr_pool_t *pool);
<a name="l00315"></a>00315
<a name="l00316"></a>00316 <span class="comment"></span>
<a name="l00317"></a>00317 <span class="comment">/** Copy a list of canonicalized @a targets, one at a time, into @a</span>
<a name="l00318"></a>00318 <span class="comment"> * pcondensed_targets, omitting any targets that are found earlier in</span>
<a name="l00319"></a>00319 <span class="comment"> * the list, or whose ancestor is found earlier in the list. Ordering</span>
<a name="l00320"></a>00320 <span class="comment"> * of targets in the original list is preserved in the condensed list</span>
<a name="l00321"></a>00321 <span class="comment"> * of targets. Use @a pool for any allocations.</span>
<a name="l00322"></a>00322 <span class="comment"> *</span>
<a name="l00323"></a>00323 <span class="comment"> * How does this differ in functionality from svn_path_condense_targets()?</span>
<a name="l00324"></a>00324 <span class="comment"> *</span>
<a name="l00325"></a>00325 <span class="comment"> * Here's the short version:</span>
<a name="l00326"></a>00326 <span class="comment"> *</span>
<a name="l00327"></a>00327 <span class="comment"> * 1. Disclaimer: if you wish to debate the following, talk to Karl. :-)</span>
<a name="l00328"></a>00328 <span class="comment"> * Order matters for updates because a multi-arg update is not</span>
<a name="l00329"></a>00329 <span class="comment"> * atomic, and CVS users are used to, when doing 'cvs up targetA</span>
<a name="l00330"></a>00330 <span class="comment"> * targetB' seeing targetA get updated, then targetB. I think the</span>
<a name="l00331"></a>00331 <span class="comment"> * idea is that if you're in a time-sensitive or flaky-network</span>
<a name="l00332"></a>00332 <span class="comment"> * situation, a user can say, "I really *need* to update</span>
<a name="l00333"></a>00333 <span class="comment"> * wc/A/D/G/tau, but I might as well update my whole working copy if</span>
<a name="l00334"></a>00334 <span class="comment"> * I can." So that user will do 'svn up wc/A/D/G/tau wc', and if</span>
<a name="l00335"></a>00335 <span class="comment"> * something dies in the middles of the 'wc' update, at least the</span>
<a name="l00336"></a>00336 <span class="comment"> * user has 'tau' up-to-date.</span>
<a name="l00337"></a>00337 <span class="comment"> *</span>
<a name="l00338"></a>00338 <span class="comment"> * 2. Also, we have this notion of an anchor and a target for updates</span>
<a name="l00339"></a>00339 <span class="comment"> * (the anchor is where the update editor is rooted, the target is</span>
<a name="l00340"></a>00340 <span class="comment"> * the actual thing we want to update). I needed a function that</span>
<a name="l00341"></a>00341 <span class="comment"> * would NOT screw with my input paths so that I could tell the</span>
<a name="l00342"></a>00342 <span class="comment"> * difference between someone being in A/D and saying 'svn up G' and</span>
<a name="l00343"></a>00343 <span class="comment"> * being in A/D/G and saying 'svn up .' -- believe it or not, these</span>
<a name="l00344"></a>00344 <span class="comment"> * two things don't mean the same thing. svn_path_condense_targets()</span>
<a name="l00345"></a>00345 <span class="comment"> * plays with absolute paths (which is fine, so does</span>
<a name="l00346"></a>00346 <span class="comment"> * svn_path_remove_redundancies()), but the difference is that it</span>
<a name="l00347"></a>00347 <span class="comment"> * actually tweaks those targets to be relative to the "grandfather</span>
<a name="l00348"></a>00348 <span class="comment"> * path" common to all the targets. Updates don't require a</span>
<a name="l00349"></a>00349 <span class="comment"> * "grandfather path" at all, and even if it did, the whole</span>
<a name="l00350"></a>00350 <span class="comment"> * conversion to an absolute path drops the crucial difference</span>
<a name="l00351"></a>00351 <span class="comment"> * between saying "i'm in foo, update bar" and "i'm in foo/bar,</span>
<a name="l00352"></a>00352 <span class="comment"> * update '.'"</span>
<a name="l00353"></a>00353 <span class="comment"> */</span>
<a name="l00354"></a>00354 <a class="code" href="structsvn__error__t.html" title="Subversion error object.">svn_error_t</a> *
<a name="l00355"></a>00355 <a class="code" href="svn__path_8h.html#fa349ae99101a8be8fec7c2b514e3d8f" title="Copy a list of canonicalized targets, one at a time, into pcondensed_targets, omitting...">svn_path_remove_redundancies</a>(apr_array_header_t **pcondensed_targets,
<a name="l00356"></a>00356 <span class="keyword">const</span> apr_array_header_t *targets,
<a name="l00357"></a>00357 apr_pool_t *pool);
<a name="l00358"></a>00358
<a name="l00359"></a>00359 <span class="comment"></span>
<a name="l00360"></a>00360 <span class="comment">/** Decompose the canonicalized @a path into an array of &lt;tt&gt;const</span>
<a name="l00361"></a>00361 <span class="comment"> * char *&lt;/tt&gt; components, allocated in @a pool. If @a path is</span>
<a name="l00362"></a>00362 <span class="comment"> * absolute, the first component will be a lone dir separator (the</span>
<a name="l00363"></a>00363 <span class="comment"> * root directory).</span>
<a name="l00364"></a>00364 <span class="comment"> */</span>
<a name="l00365"></a>00365 apr_array_header_t *<a class="code" href="svn__path_8h.html#ed307c7a409271407b44c6edc50a4313" title="Decompose the canonicalized path into an array of const char * components, allocated...">svn_path_decompose</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path,
<a name="l00366"></a>00366 apr_pool_t *pool);
<a name="l00367"></a>00367 <span class="comment"></span>
<a name="l00368"></a>00368 <span class="comment">/** Join an array of &lt;tt&gt;const char *&lt;/tt&gt; components into a '/'</span>
<a name="l00369"></a>00369 <span class="comment"> * separated path, allocated in @a pool. The joined path is absolute if</span>
<a name="l00370"></a>00370 <span class="comment"> * the first component is a lone dir separator.</span>
<a name="l00371"></a>00371 <span class="comment"> *</span>
<a name="l00372"></a>00372 <span class="comment"> * Calling svn_path_compose() on the output of svn_path_decompose()</span>
<a name="l00373"></a>00373 <span class="comment"> * will return the exact same path.</span>
<a name="l00374"></a>00374 <span class="comment"> *</span>
<a name="l00375"></a>00375 <span class="comment"> * @since New in 1.5.</span>
<a name="l00376"></a>00376 <span class="comment"> */</span>
<a name="l00377"></a>00377 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="svn__path_8h.html#2c2280945af53502c92180e12cb23365" title="Join an array of const char * components into a &amp;#39;/&amp;#39; separated path, allocated...">svn_path_compose</a>(<span class="keyword">const</span> apr_array_header_t *components,
<a name="l00378"></a>00378 apr_pool_t *pool);
<a name="l00379"></a>00379 <span class="comment"></span>
<a name="l00380"></a>00380 <span class="comment">/** Test that @a name is a single path component, that is:</span>
<a name="l00381"></a>00381 <span class="comment"> * - not @c NULL or empty.</span>
<a name="l00382"></a>00382 <span class="comment"> * - not a `/'-separated directory path</span>
<a name="l00383"></a>00383 <span class="comment"> * - not empty or `..'</span>
<a name="l00384"></a>00384 <span class="comment"> */</span>
<a name="l00385"></a>00385 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="svn__path_8h.html#0fba1793cc2fd35254b86dbfdfd5bd10" title="Test that name is a single path component, that is:not NULL or empty.">svn_path_is_single_path_component</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name);
<a name="l00386"></a>00386
<a name="l00387"></a>00387 <span class="comment"></span>
<a name="l00388"></a>00388 <span class="comment">/**</span>
<a name="l00389"></a>00389 <span class="comment"> * Test to see if a backpath, i.e. '..', is present in @a path.</span>
<a name="l00390"></a>00390 <span class="comment"> * If not, return @c FALSE.</span>
<a name="l00391"></a>00391 <span class="comment"> * If so, return @c TRUE.</span>
<a name="l00392"></a>00392 <span class="comment"> *</span>
<a name="l00393"></a>00393 <span class="comment"> * @since New in 1.1.</span>
<a name="l00394"></a>00394 <span class="comment"> */</span>
<a name="l00395"></a>00395 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="svn__path_8h.html#2e27f0f689e3cd85f023b43c2a02158d" title="Test to see if a backpath, i.e.">svn_path_is_backpath_present</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path);
<a name="l00396"></a>00396
<a name="l00397"></a>00397 <span class="comment"></span>
<a name="l00398"></a>00398 <span class="comment">/** Test if @a path2 is a child of @a path1.</span>
<a name="l00399"></a>00399 <span class="comment"> * If not, return @c NULL.</span>
<a name="l00400"></a>00400 <span class="comment"> * If so, return a copy of the remainder path, allocated in @a pool.</span>
<a name="l00401"></a>00401 <span class="comment"> * (The remainder is the component which, added to @a path1, yields</span>
<a name="l00402"></a>00402 <span class="comment"> * @a path2. The remainder does not begin with a dir separator.)</span>
<a name="l00403"></a>00403 <span class="comment"> *</span>
<a name="l00404"></a>00404 <span class="comment"> * Both paths must be in canonical form, and must either be absolute,</span>
<a name="l00405"></a>00405 <span class="comment"> * or contain no ".." components.</span>
<a name="l00406"></a>00406 <span class="comment"> *</span>
<a name="l00407"></a>00407 <span class="comment"> * If @a path2 is the same as @a path1, it is not considered a child, so the</span>
<a name="l00408"></a>00408 <span class="comment"> * result is @c NULL; an empty string is never returned.</span>
<a name="l00409"></a>00409 <span class="comment"> *</span>
<a name="l00410"></a>00410 <span class="comment"> * @note In 1.5 this function has been extended to allow a @c NULL @a pool</span>
<a name="l00411"></a>00411 <span class="comment"> * in which case a pointer into @a path2 will be returned to</span>
<a name="l00412"></a>00412 <span class="comment"> * identify the remainder path.</span>
<a name="l00413"></a>00413 <span class="comment"> *</span>
<a name="l00414"></a>00414 <span class="comment"> * ### todo: the ".." restriction is unfortunate, and would ideally</span>
<a name="l00415"></a>00415 <span class="comment"> * be lifted by making the implementation smarter. But this is not</span>
<a name="l00416"></a>00416 <span class="comment"> * trivial: if the path is "../foo", how do you know whether or not</span>
<a name="l00417"></a>00417 <span class="comment"> * the current directory is named "foo" in its parent?</span>
<a name="l00418"></a>00418 <span class="comment"> */</span>
<a name="l00419"></a>00419 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="svn__path_8h.html#723fa9b91b516a3f4057877396f17c85" title="Test if path2 is a child of path1.">svn_path_is_child</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path1,
<a name="l00420"></a>00420 <span class="keyword">const</span> <span class="keywordtype">char</span> *path2,
<a name="l00421"></a>00421 apr_pool_t *pool);
<a name="l00422"></a>00422 <span class="comment"></span>
<a name="l00423"></a>00423 <span class="comment">/** Return TRUE if @a path1 is an ancestor of @a path2 or the paths are equal</span>
<a name="l00424"></a>00424 <span class="comment"> * and FALSE otherwise.</span>
<a name="l00425"></a>00425 <span class="comment"> *</span>
<a name="l00426"></a>00426 <span class="comment"> * @since New in 1.3.</span>
<a name="l00427"></a>00427 <span class="comment"> */</span>
<a name="l00428"></a>00428 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a>
<a name="l00429"></a>00429 <a class="code" href="svn__path_8h.html#a3f82e432465ad05ea28dcb9ab3d231e" title="Return TRUE if path1 is an ancestor of path2 or the paths are equal and FALSE otherwise...">svn_path_is_ancestor</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path1, <span class="keyword">const</span> <span class="keywordtype">char</span> *path2);
<a name="l00430"></a>00430 <span class="comment"></span>
<a name="l00431"></a>00431 <span class="comment">/**</span>
<a name="l00432"></a>00432 <span class="comment"> * Check whether @a path is a valid Subversion path.</span>
<a name="l00433"></a>00433 <span class="comment"> *</span>
<a name="l00434"></a>00434 <span class="comment"> * A valid Subversion pathname is a UTF-8 string without control</span>
<a name="l00435"></a>00435 <span class="comment"> * characters. "Valid" means Subversion can store the pathname in</span>
<a name="l00436"></a>00436 <span class="comment"> * a repository. There may be other, OS-specific, limitations on</span>
<a name="l00437"></a>00437 <span class="comment"> * what paths can be represented in a working copy.</span>
<a name="l00438"></a>00438 <span class="comment"> *</span>
<a name="l00439"></a>00439 <span class="comment"> * ASSUMPTION: @a path is a valid UTF-8 string. This function does</span>
<a name="l00440"></a>00440 <span class="comment"> * not check UTF-8 validity.</span>
<a name="l00441"></a>00441 <span class="comment"> *</span>
<a name="l00442"></a>00442 <span class="comment"> * Return @c SVN_NO_ERROR if valid and @c SVN_ERR_FS_PATH_SYNTAX if</span>
<a name="l00443"></a>00443 <span class="comment"> * invalid.</span>
<a name="l00444"></a>00444 <span class="comment"> *</span>
<a name="l00445"></a>00445 <span class="comment"> * @since New in 1.2.</span>
<a name="l00446"></a>00446 <span class="comment"> */</span>
<a name="l00447"></a>00447 <a class="code" href="structsvn__error__t.html" title="Subversion error object.">svn_error_t</a> *<a class="code" href="svn__path_8h.html#66126b95ddaa72ad601b2262c6cd2f6c" title="Check whether path is a valid Subversion path.">svn_path_check_valid</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, apr_pool_t *pool);
<a name="l00448"></a>00448
<a name="l00449"></a>00449 <span class="comment"></span>
<a name="l00450"></a>00450 <span class="comment">/** URI/URL stuff</span>
<a name="l00451"></a>00451 <span class="comment"> *</span>
<a name="l00452"></a>00452 <span class="comment"> * @defgroup svn_path_uri_stuff URI/URL conversion</span>
<a name="l00453"></a>00453 <span class="comment"> * @{</span>
<a name="l00454"></a>00454 <span class="comment"> */</span>
<a name="l00455"></a>00455 <span class="comment"></span>
<a name="l00456"></a>00456 <span class="comment">/** Return TRUE iff @a path looks like a valid absolute URL. */</span>
<a name="l00457"></a>00457 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="group__svn__path__uri__stuff.html#gdc3807ba2b493fcbfcf21d783ea916c0" title="Return TRUE iff path looks like a valid absolute URL.">svn_path_is_url</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path);
<a name="l00458"></a>00458 <span class="comment"></span>
<a name="l00459"></a>00459 <span class="comment">/** Return @c TRUE iff @a path is URI-safe, @c FALSE otherwise. */</span>
<a name="l00460"></a>00460 <a class="code" href="svn__types_8h.html#22b35baddc4213c688d1bb12feea1024" title="YABT: Yet Another Boolean Type.">svn_boolean_t</a> <a class="code" href="group__svn__path__uri__stuff.html#g4cf332a76cc511b00ef847b9b59633ee" title="Return TRUE iff path is URI-safe, FALSE otherwise.">svn_path_is_uri_safe</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path);
<a name="l00461"></a>00461 <span class="comment"></span>
<a name="l00462"></a>00462 <span class="comment">/** Return a URI-encoded copy of @a path, allocated in @a pool. */</span>
<a name="l00463"></a>00463 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__svn__path__uri__stuff.html#g1f2ce01ef7e239a37baad42b40d556e5" title="Return a URI-encoded copy of path, allocated in pool.">svn_path_uri_encode</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, apr_pool_t *pool);
<a name="l00464"></a>00464 <span class="comment"></span>
<a name="l00465"></a>00465 <span class="comment">/** Return a URI-decoded copy of @a path, allocated in @a pool. */</span>
<a name="l00466"></a>00466 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__svn__path__uri__stuff.html#ge7cd4fc1524784c72709fd55f1d79c88" title="Return a URI-decoded copy of path, allocated in pool.">svn_path_uri_decode</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, apr_pool_t *pool);
<a name="l00467"></a>00467 <span class="comment"></span>
<a name="l00468"></a>00468 <span class="comment">/** Extend @a url by @a component, URI-encoding that @a component</span>
<a name="l00469"></a>00469 <span class="comment"> * before adding it to the @a url; return the new @a url, allocated in</span>
<a name="l00470"></a>00470 <span class="comment"> * @a pool. If @a component is @c NULL, just return a copy of @a url,</span>
<a name="l00471"></a>00471 <span class="comment"> * allocated in @a pool.</span>
<a name="l00472"></a>00472 <span class="comment"> *</span>
<a name="l00473"></a>00473 <span class="comment"> * @a component need not be a single path segment, but if it contains</span>
<a name="l00474"></a>00474 <span class="comment"> * multiple segments, they must be separated by '/'. @a component</span>
<a name="l00475"></a>00475 <span class="comment"> * should not begin with '/', however; if it does, the behavior is</span>
<a name="l00476"></a>00476 <span class="comment"> * undefined.</span>
<a name="l00477"></a>00477 <span class="comment"> *</span>
<a name="l00478"></a>00478 <span class="comment"> * @a url need not be a canonical path; it may have a trailing '/'.</span>
<a name="l00479"></a>00479 <span class="comment"> *</span>
<a name="l00480"></a>00480 <span class="comment"> * @note gstein suggests this for when @a component begins with '/':</span>
<a name="l00481"></a>00481 <span class="comment"> * </span>
<a name="l00482"></a>00482 <span class="comment"> * "replace the path entirely</span>
<a name="l00483"></a>00483 <span class="comment"> * https://example.com:4444/base/path joined with /leading/slash,</span>
<a name="l00484"></a>00484 <span class="comment"> * should return: https://example.com:4444/leading/slash</span>
<a name="l00485"></a>00485 <span class="comment"> * per the RFCs on combining URIs"</span>
<a name="l00486"></a>00486 <span class="comment"> *</span>
<a name="l00487"></a>00487 <span class="comment"> * We may implement that someday, which is why leading '/' is</span>
<a name="l00488"></a>00488 <span class="comment"> * merely undefined right now.</span>
<a name="l00489"></a>00489 <span class="comment"> */</span>
<a name="l00490"></a>00490 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__svn__path__uri__stuff.html#g1522f308378a4a74c3d53565f627145f" title="Extend url by component, URI-encoding that component before adding it to the url;...">svn_path_url_add_component</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *url,
<a name="l00491"></a>00491 <span class="keyword">const</span> <span class="keywordtype">char</span> *component,
<a name="l00492"></a>00492 apr_pool_t *pool);
<a name="l00493"></a>00493 <span class="comment"></span>
<a name="l00494"></a>00494 <span class="comment">/**</span>
<a name="l00495"></a>00495 <span class="comment"> * Convert @a iri (Internationalized URI) to an URI.</span>
<a name="l00496"></a>00496 <span class="comment"> * The return value may be the same as @a iri if it was already</span>
<a name="l00497"></a>00497 <span class="comment"> * a URI. Else, allocate the return value in @a pool.</span>
<a name="l00498"></a>00498 <span class="comment"> *</span>
<a name="l00499"></a>00499 <span class="comment"> * @since New in 1.1.</span>
<a name="l00500"></a>00500 <span class="comment"> */</span>
<a name="l00501"></a>00501 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__svn__path__uri__stuff.html#g4c2ae9dba439035b284799fd1f5f1395" title="Convert iri (Internationalized URI) to an URI.">svn_path_uri_from_iri</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *iri,
<a name="l00502"></a>00502 apr_pool_t *pool);
<a name="l00503"></a>00503 <span class="comment"></span>
<a name="l00504"></a>00504 <span class="comment">/**</span>
<a name="l00505"></a>00505 <span class="comment"> * URI-encode certain characters in @a uri that are not valid in an URI, but</span>
<a name="l00506"></a>00506 <span class="comment"> * doesn't have any special meaning in @a uri at their positions. If no</span>
<a name="l00507"></a>00507 <span class="comment"> * characters need escaping, just return @a uri.</span>
<a name="l00508"></a>00508 <span class="comment"> *</span>
<a name="l00509"></a>00509 <span class="comment"> * @note Currently, this function escapes &lt;, &gt;, ", space, {, }, |, \, ^, and `.</span>
<a name="l00510"></a>00510 <span class="comment"> * This may be extended in the future to do context-dependent escaping.</span>
<a name="l00511"></a>00511 <span class="comment"> *</span>
<a name="l00512"></a>00512 <span class="comment"> * @since New in 1.1.</span>
<a name="l00513"></a>00513 <span class="comment"> */</span>
<a name="l00514"></a>00514 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__svn__path__uri__stuff.html#gcd52658595e60c5b6a7d989e8f92ecef" title="URI-encode certain characters in uri that are not valid in an URI, but doesn&amp;#39;t...">svn_path_uri_autoescape</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *uri,
<a name="l00515"></a>00515 apr_pool_t *pool);
<a name="l00516"></a>00516 <span class="comment"></span>
<a name="l00517"></a>00517 <span class="comment">/** @} */</span>
<a name="l00518"></a>00518 <span class="comment"></span>
<a name="l00519"></a>00519 <span class="comment">/** Charset conversion stuff</span>
<a name="l00520"></a>00520 <span class="comment"> *</span>
<a name="l00521"></a>00521 <span class="comment"> * @defgroup svn_path_charset_stuff Charset conversion</span>
<a name="l00522"></a>00522 <span class="comment"> * @{</span>
<a name="l00523"></a>00523 <span class="comment"> */</span>
<a name="l00524"></a>00524 <span class="comment"></span>
<a name="l00525"></a>00525 <span class="comment">/** Convert @a path_utf8 from UTF-8 to the internal encoding used by APR. */</span>
<a name="l00526"></a>00526 <a class="code" href="structsvn__error__t.html" title="Subversion error object.">svn_error_t</a> *<a class="code" href="group__svn__path__charset__stuff.html#g1188b3d68c589e2ef820d785627813e3" title="Convert path_utf8 from UTF-8 to the internal encoding used by APR.">svn_path_cstring_from_utf8</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> **path_apr,
<a name="l00527"></a>00527 <span class="keyword">const</span> <span class="keywordtype">char</span> *path_utf8,
<a name="l00528"></a>00528 apr_pool_t *pool);
<a name="l00529"></a>00529 <span class="comment"></span>
<a name="l00530"></a>00530 <span class="comment">/** Convert @a path_apr from the internal encoding used by APR to UTF-8. */</span>
<a name="l00531"></a>00531 <a class="code" href="structsvn__error__t.html" title="Subversion error object.">svn_error_t</a> *<a class="code" href="group__svn__path__charset__stuff.html#g624b2bd834e1dcbd4d7c05b348f5e5f6" title="Convert path_apr from the internal encoding used by APR to UTF-8.">svn_path_cstring_to_utf8</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> **path_utf8,
<a name="l00532"></a>00532 <span class="keyword">const</span> <span class="keywordtype">char</span> *path_apr,
<a name="l00533"></a>00533 apr_pool_t *pool);
<a name="l00534"></a>00534
<a name="l00535"></a>00535 <span class="comment"></span>
<a name="l00536"></a>00536 <span class="comment">/** @} */</span>
<a name="l00537"></a>00537
<a name="l00538"></a>00538 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00539"></a>00539 <span class="preprocessor"></span>}
<a name="l00540"></a>00540 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00541"></a>00541
<a name="l00542"></a>00542
<a name="l00543"></a>00543 <span class="preprocessor">#endif </span><span class="comment">/* SVN_PATH_H */</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Oct 24 16:18:25 2008 for Subversion by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>