00001 /** 00002 * @copyright 00003 * ==================================================================== 00004 * Licensed to the Apache Software Foundation (ASF) under one 00005 * or more contributor license agreements. See the NOTICE file 00006 * distributed with this work for additional information 00007 * regarding copyright ownership. The ASF licenses this file 00008 * to you under the Apache License, Version 2.0 (the 00009 * "License"); you may not use this file except in compliance 00010 * with the License. You may obtain a copy of the License at 00011 * 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, 00015 * software distributed under the License is distributed on an 00016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00017 * KIND, either express or implied. See the License for the 00018 * specific language governing permissions and limitations 00019 * under the License. 00020 * ==================================================================== 00021 * @endcopyright 00022 * 00023 * @file mod_dav_svn.h 00024 * @brief Subversion's backend for Apache's mod_dav module 00025 */ 00026 00027 00028 #ifndef MOD_DAV_SVN_H 00029 #define MOD_DAV_SVN_H 00030 00031 #include <httpd.h> 00032 #include <mod_dav.h> 00033 00034 00035 #ifdef __cplusplus 00036 extern "C" { 00037 #endif /* __cplusplus */ 00038 00039 00040 /** 00041 Given an apache request @a r, a @a uri, and a @a root_path to the svn 00042 location block, process @a uri and return many things, allocated in 00043 @a pool: 00044 00045 - @a cleaned_uri: The uri with duplicate and trailing slashes removed. 00046 00047 - @a trailing_slash: Whether the uri had a trailing slash on it. 00048 00049 Three special substrings of the uri are returned for convenience: 00050 00051 - @a repos_basename: The single path component that is the directory 00052 which contains the repository. (Don't confuse 00053 this with the "repository name" as optionally 00054 defined via the SVNReposName directive!) 00055 00056 - @a relative_path: The remaining imaginary path components. 00057 00058 - @a repos_path: The actual path within the repository filesystem, or 00059 NULL if no part of the uri refers to a path in 00060 the repository (e.g. "!svn/vcc/default" or 00061 "!svn/bln/25"). 00062 00063 00064 For example, consider the uri 00065 00066 /svn/repos/proj1/!svn/blah/13//A/B/alpha 00067 00068 In the SVNPath case, this function would receive a @a root_path of 00069 '/svn/repos/proj1', and in the SVNParentPath case would receive a 00070 @a root_path of '/svn/repos'. But either way, we would get back: 00071 00072 - @a cleaned_uri: /svn/repos/proj1/!svn/blah/13/A/B/alpha 00073 - @a repos_basename: proj1 00074 - @a relative_path: /!svn/blah/13/A/B/alpha 00075 - @a repos_path: A/B/alpha 00076 - @a trailing_slash: FALSE 00077 00078 NOTE: The returned dav_error will be also allocated in @a pool, not 00079 in @a r->pool. 00080 00081 @since New in 1.9 00082 */ 00083 AP_MODULE_DECLARE(dav_error *) dav_svn_split_uri2(request_rec *r, 00084 const char *uri_to_split, 00085 const char *root_path, 00086 const char **cleaned_uri, 00087 int *trailing_slash, 00088 const char **repos_basename, 00089 const char **relative_path, 00090 const char **repos_path, 00091 apr_pool_t *pool); 00092 00093 /** 00094 * Same as dav_svn_split_uri2() but allocates the result in @a r->pool. 00095 */ 00096 AP_MODULE_DECLARE(dav_error *) dav_svn_split_uri(request_rec *r, 00097 const char *uri, 00098 const char *root_path, 00099 const char **cleaned_uri, 00100 int *trailing_slash, 00101 const char **repos_basename, 00102 const char **relative_path, 00103 const char **repos_path); 00104 00105 00106 /** 00107 * Given an apache request @a r and a @a root_path to the svn location 00108 * block, set @a *repos_path to the path of the repository on disk. 00109 * Perform all allocations in @a pool. 00110 * 00111 * NOTE: The returned dav_error will be also allocated in @a pool, not 00112 * in @a r->pool. 00113 * 00114 * @since New in 1.9 00115 */ 00116 AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path2(request_rec *r, 00117 const char *root_path, 00118 const char **repos_path, 00119 apr_pool_t *pool); 00120 00121 /** 00122 * Same as dav_svn_get_repos_path2() but allocates the result in@a r->pool. 00123 */ 00124 AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r, 00125 const char *root_path, 00126 const char **repos_path); 00127 00128 #ifdef __cplusplus 00129 } 00130 #endif /* __cplusplus */ 00131 00132 #endif /* MOD_DAV_SVN_H */
1.6.1