Author: julianfoad Date: Wed Jul 28 17:51:10 2010 New Revision: 980139 URL: http://svn.apache.org/viewvc?rev=980139&view=rev Log: Rename some function parameters for clarity: where "xxx1" and "xxx2" represent two paths in a parent-child relationship, rename them to "parent_xxx" and "child_xxx" respectively.
* subversion/include/svn_dirent_uri.h, subversion/libsvn_subr/dirent_uri.c (svn_dirent_is_child, svn_relpath_is_child, svn_uri_is_child, svn_dirent_is_ancestor, svn_relpath_is_ancestor, svn_uri_is_ancestor, svn_dirent_skip_ancestor, svn_relpath_skip_ancestor, svn_uri_skip_ancestor): Rename parameters. Modified: subversion/trunk/subversion/include/svn_dirent_uri.h subversion/trunk/subversion/libsvn_subr/dirent_uri.c Modified: subversion/trunk/subversion/include/svn_dirent_uri.h URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_dirent_uri.h?rev=980139&r1=980138&r2=980139&view=diff ============================================================================== --- subversion/trunk/subversion/include/svn_dirent_uri.h (original) +++ subversion/trunk/subversion/include/svn_dirent_uri.h Wed Jul 28 17:51:10 2010 @@ -561,19 +561,19 @@ svn_dirent_get_absolute(const char **pab const char *relative, apr_pool_t *pool); -/** Test if @a uri2 is a child of @a uri1. +/** Test if @a child_uri is a child of @a parent_uri. * If not, return @c NULL. * If so, return a copy of the remainder uri, allocated in @a pool. - * (The remainder is the component which, added to @a uri1, yields - * @a uri2. The remainder does not begin with a dir separator.) + * (The remainder is the component which, added to @a parent_uri, yields + * @a child_uri. The remainder does not begin with a dir separator.) * * Both uris must be in canonical form, and must either be absolute, * or contain no ".." components. * - * If @a uri2 is the same as @a uri1, it is not considered a child, + * If @a child_uri is the same as @a parent_uri, it is not considered a child, * so the result is @c NULL; an empty string is never returned. * - * If @a pool is @c NULL , a pointer into @a uri2 will be returned to + * If @a pool is @c NULL , a pointer into @a child_uri will be returned to * identify the remainder uri. * * ### @todo the ".." restriction is unfortunate, and would ideally @@ -584,12 +584,12 @@ svn_dirent_get_absolute(const char **pab * @since New in 1.7. */ const char * -svn_uri_is_child(const char *uri1, - const char *uri2, +svn_uri_is_child(const char *parent_uri, + const char *child_uri, apr_pool_t *pool); /** - * This function is similar as svn_uri_is_child(), except that it supports + * This function is similar to svn_uri_is_child(), except that it supports * Windows dirents and UNC paths on Windows. * * ### @todo Makes no attempt to handle one absolute and one relative @@ -598,88 +598,90 @@ svn_uri_is_child(const char *uri1, * @since New in 1.6. */ const char * -svn_dirent_is_child(const char *dirent1, - const char *dirent2, +svn_dirent_is_child(const char *parent_dirent, + const char *child_dirent, apr_pool_t *pool); /** - * This function is similar as svn_uri_is_child(), except that it supports + * This function is similar to svn_uri_is_child(), except that it supports * only relative paths. * * @since New in 1.7. */ const char * -svn_relpath_is_child(const char *relpath1, - const char *relpath2, +svn_relpath_is_child(const char *parent_relpath, + const char *child_relpath, apr_pool_t *pool); -/** Return TRUE if @a dirent1 is an ancestor of @a dirent2 or the dirents are - * equal and FALSE otherwise. +/** Return TRUE if @a parent_dirent is an ancestor of @a child_dirent or + * the dirents are equal, and FALSE otherwise. * * @since New in 1.6. */ svn_boolean_t -svn_dirent_is_ancestor(const char *path1, - const char *path2); +svn_dirent_is_ancestor(const char *parent_dirent, + const char *child_dirent); -/** Return TRUE if @a relpath1 is an ancestor of @a relpath2 or the relpaths - * are equal and FALSE otherwise. +/** Return TRUE if @a parent_relpath is an ancestor of @a child_relpath or + * the relpaths are equal, and FALSE otherwise. * * This function supports only relative paths. * * @since New in 1.7. */ svn_boolean_t -svn_relpath_is_ancestor(const char *relpath1, - const char *relpath2); +svn_relpath_is_ancestor(const char *parent_relpath, + const char *child_relpath); -/** Return TRUE if @a uri1 is an ancestor of @a uri2 or the uris are - * equal and FALSE otherwise. +/** Return TRUE if @a parent_uri is an ancestor of @a child_uri or + * the uris are equal, and FALSE otherwise. * * This function supports URLs. * * @since New in 1.7. */ svn_boolean_t -svn_uri_is_ancestor(const char *uri1, - const char *uri2); +svn_uri_is_ancestor(const char *parent_uri, + const char *child_uri); -/** Returns the relative path part of @a dirent2 that is below @a dirent1, - * or just "" iif @a dirent1 is equal to @a dirent2. If @a dirent2 is not - * below @a path1, return @a dirent2 completely. +/** Return the relative path part of @a child_dirent that is below + * @a parent_dirent, or just "" if @a parent_dirent is equal to + * @a child_dirent. If @a child_dirent is not below @a parent_dirent, + * return @a child_dirent completely. * - * This function assumes @a dirent1 and @a dirent2 are both absolute or - * relative in the same way. + * This function assumes @a parent_dirent and @a child_dirent are both + * absolute or relative in the same way. * * @since New in 1.7. */ const char * -svn_dirent_skip_ancestor(const char *dirent1, - const char *dirent2); +svn_dirent_skip_ancestor(const char *parent_dirent, + const char *child_dirent); -/** Returns the relative path part of @a relpath2 that is below @a relpath1, - * or just "" iif @a relpath1 is equal to @a relpath2. If @a relpath2 is not - * below @a relpath1, return @a relpath2. +/** Return the relative path part of @a child_relpath that is below + * @a parent_relpath, or just "" if @a parent_relpath is equal to + * @a child_relpath. If @a child_relpath is not below @a parent_relpath, + * return @a child_relpath. * * @since New in 1.7. */ const char * -svn_relpath_skip_ancestor(const char *relpath1, - const char *relpath2); +svn_relpath_skip_ancestor(const char *parent_relpath, + const char *child_relpath); -/** Returns the relative path part of @a uri2 that is below @a uri1, or just - * "" iif @a uri1 is equal to @a uri2. If @a uri2 is not below @a uri1, - * return @a uri2. +/** Return the relative path part of @a child_uri that is below + * @a parent_uri, or just "" if @a parent_uri is equal to @a child_uri. If + * @a child_uri is not below @a parent_uri, return @a child_uri. * - * This function assumes @a uri1 and @a uri2 are both absolute or relative - * in the same way. + * This function assumes @a parent_uri and @a child_uri are both absolute or + * relative in the same way. * * @since New in 1.7. */ const char * -svn_uri_skip_ancestor(const char *uri1, - const char *uri2); +svn_uri_skip_ancestor(const char *parent_uri, + const char *child_uri); /** Find the common prefix of the canonicalized dirents in @a targets * (an array of <tt>const char *</tt>'s), and remove redundant dirents if @a Modified: subversion/trunk/subversion/libsvn_subr/dirent_uri.c URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/dirent_uri.c?rev=980139&r1=980138&r2=980139&view=diff ============================================================================== --- subversion/trunk/subversion/libsvn_subr/dirent_uri.c (original) +++ subversion/trunk/subversion/libsvn_subr/dirent_uri.c Wed Jul 28 17:51:10 2010 @@ -1482,119 +1482,119 @@ svn_uri_get_longest_ancestor(const char } const char * -svn_dirent_is_child(const char *dirent1, - const char *dirent2, +svn_dirent_is_child(const char *parent_dirent, + const char *child_dirent, apr_pool_t *pool) { - return is_child(type_dirent, dirent1, dirent2, pool); + return is_child(type_dirent, parent_dirent, child_dirent, pool); } const char * -svn_relpath_is_child(const char *relpath1, - const char *relpath2, +svn_relpath_is_child(const char *parent_relpath, + const char *child_relpath, apr_pool_t *pool) { - return is_child(type_relpath, relpath1, relpath2, pool); + return is_child(type_relpath, parent_relpath, child_relpath, pool); } const char * -svn_uri_is_child(const char *uri1, - const char *uri2, +svn_uri_is_child(const char *parent_uri, + const char *child_uri, apr_pool_t *pool) { - return is_child(type_uri, uri1, uri2, pool); + return is_child(type_uri, parent_uri, child_uri, pool); } svn_boolean_t -svn_dirent_is_ancestor(const char *dirent1, const char *dirent2) +svn_dirent_is_ancestor(const char *parent_dirent, const char *child_dirent) { - return is_ancestor(type_dirent, dirent1, dirent2); + return is_ancestor(type_dirent, parent_dirent, child_dirent); } svn_boolean_t -svn_relpath_is_ancestor(const char *relpath1, const char *relpath2) +svn_relpath_is_ancestor(const char *parent_relpath, const char *child_relpath) { - return is_ancestor(type_relpath, relpath1, relpath2); + return is_ancestor(type_relpath, parent_relpath, child_relpath); } svn_boolean_t -svn_uri_is_ancestor(const char *uri1, const char *uri2) +svn_uri_is_ancestor(const char *parent_uri, const char *child_uri) { - return is_ancestor(type_uri, uri1, uri2); + return is_ancestor(type_uri, parent_uri, child_uri); } const char * -svn_dirent_skip_ancestor(const char *dirent1, - const char *dirent2) +svn_dirent_skip_ancestor(const char *parent_dirent, + const char *child_dirent) { - apr_size_t len = strlen(dirent1); + apr_size_t len = strlen(parent_dirent); apr_size_t root_len; - if (0 != memcmp(dirent1, dirent2, len)) - return dirent2; /* dirent1 is no ancestor of dirent2 */ + if (0 != memcmp(parent_dirent, child_dirent, len)) + return child_dirent; /* parent_dirent is no ancestor of child_dirent */ - if (dirent2[len] == 0) - return ""; /* dirent1 == dirent2 */ + if (child_dirent[len] == 0) + return ""; /* parent_dirent == child_dirent */ - root_len = dirent_root_length(dirent2, strlen(dirent2)); + root_len = dirent_root_length(child_dirent, strlen(child_dirent)); if (root_len > len) - return dirent2; /* Different root */ + return child_dirent; /* Different root */ - if (len == 1 && dirent2[0] == '/') - return dirent2 + 1; + if (len == 1 && child_dirent[0] == '/') + return child_dirent + 1; - if (dirent2[len] == '/') - return dirent2 + len + 1; + if (child_dirent[len] == '/') + return child_dirent + len + 1; #ifdef SVN_USE_DOS_PATHS - if (root_len == len && len > 0 && dirent2[len-1]) - return dirent2 + len; + if (root_len == len && len > 0 && child_dirent[len-1]) + return child_dirent + len; #endif - return dirent2; + return child_dirent; } const char * -svn_relpath_skip_ancestor(const char *relpath1, - const char *relpath2) +svn_relpath_skip_ancestor(const char *parent_relpath, + const char *child_relpath) { - apr_size_t len = strlen(relpath1); + apr_size_t len = strlen(parent_relpath); - if (0 != memcmp(relpath1, relpath2, len)) - return relpath2; /* relpath1 is no ancestor of relpath2 */ + if (0 != memcmp(parent_relpath, child_relpath, len)) + return child_relpath; /* parent_relpath is no ancestor of child_relpath */ - if (relpath2[len] == 0) - return ""; /* relpath1 == relpath2 */ + if (child_relpath[len] == 0) + return ""; /* parent_relpath == child_relpath */ - if (len == 1 && relpath2[0] == '/') - return relpath2 + 1; + if (len == 1 && child_relpath[0] == '/') + return child_relpath + 1; - if (relpath2[len] == '/') - return relpath2 + len + 1; + if (child_relpath[len] == '/') + return child_relpath + len + 1; - return relpath2; + return child_relpath; } const char * -svn_uri_skip_ancestor(const char *uri1, - const char *uri2) +svn_uri_skip_ancestor(const char *parent_uri, + const char *child_uri) { - apr_size_t len = strlen(uri1); + apr_size_t len = strlen(parent_uri); - if (0 != memcmp(uri1, uri2, len)) - return uri2; /* dirent1 is no ancestor of dirent2 */ + if (0 != memcmp(parent_uri, child_uri, len)) + return child_uri; /* parent_uri is no ancestor of child_uri */ - if (uri2[len] == 0) - return ""; /* dirent1 == dirent2 */ + if (child_uri[len] == 0) + return ""; /* parent_uri == child_uri */ - if (len == 1 && uri2[0] == '/') - return uri2 + 1; + if (len == 1 && child_uri[0] == '/') + return child_uri + 1; - if (len > 0 && uri2[len] == '/') - return uri2 + len + 1; + if (len > 0 && child_uri[len] == '/') + return child_uri + len + 1; - return uri2; + return child_uri; } svn_boolean_t