Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mod_dav_svn.h
Go to the documentation of this file.
1 /**
2  * @copyright
3  * ====================================================================
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.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file mod_dav_svn.h
24  * @brief Subversion's backend for Apache's mod_dav module
25  */
26 
27 
28 #ifndef MOD_DAV_SVN_H
29 #define MOD_DAV_SVN_H
30 
31 #include <httpd.h>
32 #include <mod_dav.h>
33 
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif /* __cplusplus */
38 
39 
40 /**
41  Given an apache request @a r, a @a uri, and a @a root_path to the svn
42  location block, process @a uri and return many things, allocated in
43  @a r->pool:
44 
45  - @a cleaned_uri: The uri with duplicate and trailing slashes removed.
46 
47  - @a trailing_slash: Whether the uri had a trailing slash on it.
48 
49  Three special substrings of the uri are returned for convenience:
50 
51  - @a repos_basename: The single path component that is the directory
52  which contains the repository. (Don't confuse
53  this with the "repository name" as optionally
54  defined via the SVNReposName directive!)
55 
56  - @a relative_path: The remaining imaginary path components.
57 
58  - @a repos_path: The actual path within the repository filesystem, or
59  NULL if no part of the uri refers to a path in
60  the repository (e.g. "!svn/vcc/default" or
61  "!svn/bln/25").
62 
63 
64  For example, consider the uri
65 
66  /svn/repos/proj1/!svn/blah/13//A/B/alpha
67 
68  In the SVNPath case, this function would receive a @a root_path of
69  '/svn/repos/proj1', and in the SVNParentPath case would receive a
70  @a root_path of '/svn/repos'. But either way, we would get back:
71 
72  - @a cleaned_uri: /svn/repos/proj1/!svn/blah/13/A/B/alpha
73  - @a repos_basename: proj1
74  - @a relative_path: /!svn/blah/13/A/B/alpha
75  - @a repos_path: A/B/alpha
76  - @a trailing_slash: FALSE
77 */
78 AP_MODULE_DECLARE(dav_error *) dav_svn_split_uri(request_rec *r,
79  const char *uri,
80  const char *root_path,
81  const char **cleaned_uri,
82  int *trailing_slash,
83  const char **repos_basename,
84  const char **relative_path,
85  const char **repos_path);
86 
87 
88 /**
89  * Given an apache request @a r and a @a root_path to the svn location
90  * block, set @a *repos_path to the path of the repository on disk. */
91 AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r,
92  const char *root_path,
93  const char **repos_path);
94 
95 #ifdef __cplusplus
96 }
97 #endif /* __cplusplus */
98 
99 #endif /* MOD_DAV_SVN_H */
dav_error * dav_svn_get_repos_path(request_rec *r, const char *root_path, const char **repos_path)
Given an apache request r and a root_path to the svn location block, set *repos_path to the path of t...
dav_error * dav_svn_split_uri(request_rec *r, const char *uri, const char *root_path, const char **cleaned_uri, int *trailing_slash, const char **repos_basename, const char **relative_path, const char **repos_path)
Given an apache request r, a uri, and a root_path to the svn location block, process uri and return m...