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  * Copyright (c) 2000-2007 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/.
15  * ====================================================================
16  * @endcopyright
17  *
18  * @file mod_dav_svn.h
19  * @brief Subversion's backend for Apache's mod_dav module
20  */
21 
22 
23 #ifndef MOD_DAV_SVN_H
24 #define MOD_DAV_SVN_H
25 
26 #include <httpd.h>
27 #include <mod_dav.h>
28 #include <apr_optional.h>
29 
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif /* __cplusplus */
34 
35 
36 /* Given an apache request R, a URI, and a ROOT_PATH to the svn
37  location block, process URI and return many things, allocated in
38  r->pool:
39 
40  * CLEANED_URI: The uri with duplicate and trailing slashes removed.
41 
42  * TRAILING_SLASH: Whether the uri had a trailing slash on it.
43 
44  Three special substrings of the uri are returned for convenience:
45 
46  * REPOS_NAME: The single path component that is the directory
47  which contains the repository.
48 
49  * RELATIVE_PATH: The remaining imaginary path components.
50 
51  * REPOS_PATH: The actual path within the repository filesystem, or
52  NULL if no part of the uri refers to a path in
53  the repository (e.g. "!svn/vcc/default" or
54  "!svn/bln/25").
55 
56 
57  For example, consider the uri
58 
59  /svn/repos/proj1/!svn/blah/13//A/B/alpha
60 
61  In the SVNPath case, this function would receive a ROOT_PATH of
62  '/svn/repos/proj1', and in the SVNParentPath case would receive a
63  ROOT_PATH of '/svn/repos'. But either way, we would get back:
64 
65  * CLEANED_URI: /svn/repos/proj1/!svn/blah/13/A/B/alpha
66  * REPOS_NAME: proj1
67  * RELATIVE_PATH: /!svn/blah/13/A/B/alpha
68  * REPOS_PATH: A/B/alpha
69  * TRAILING_SLASH: FALSE
70 */
71 AP_MODULE_DECLARE(dav_error *) dav_svn_split_uri(request_rec *r,
72  const char *uri,
73  const char *root_path,
74  const char **cleaned_uri,
75  int *trailing_slash,
76  const char **repos_name,
77  const char **relative_path,
78  const char **repos_path);
79 APR_DECLARE_OPTIONAL_FN(dav_error *, dav_svn_split_uri,
80  (request_rec *r,
81  const char *uri,
82  const char *root_path,
83  const char **cleaned_uri,
84  int *trailing_slash,
85  const char **repos_name,
86  const char **relative_path,
87  const char **repos_path));
88 
89 
90 /* Given an apache request R and a ROOT_PATH to the svn location
91  block sets *REPOS_PATH to the path of the repository on disk.
92 */
93 AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r,
94  const char *root_path,
95  const char **repos_path);
96 APR_DECLARE_OPTIONAL_FN(dav_error *, dav_svn_get_repos_path,
97  (request_rec *r,
98  const char *root_path,
99  const char **repos_path));
100 
101 #ifdef __cplusplus
102 }
103 #endif /* __cplusplus */
104 
105 #endif /* MOD_DAV_SVN_H */