Subversion
mod_dav_svn.h
Go to the documentation of this file.
00001 /**
00002  * @copyright
00003  * ====================================================================
00004  * Copyright (c) 2000-2007 CollabNet.  All rights reserved.
00005  *
00006  * This software is licensed as described in the file COPYING, which
00007  * you should have received as part of this distribution.  The terms
00008  * are also available at http://subversion.tigris.org/license-1.html.
00009  * If newer versions of this license are posted there, you may use a
00010  * newer version instead, at your option.
00011  *
00012  * This software consists of voluntary contributions made by many
00013  * individuals.  For exact contribution history, see the revision
00014  * history and logs, available at http://subversion.tigris.org/.
00015  * ====================================================================
00016  * @endcopyright
00017  *
00018  * @file mod_dav_svn.h
00019  * @brief Subversion's backend for Apache's mod_dav module
00020  */
00021 
00022 
00023 #ifndef MOD_DAV_SVN_H
00024 #define MOD_DAV_SVN_H
00025 
00026 #include <httpd.h>
00027 #include <mod_dav.h>
00028 #include <apr_optional.h>
00029 
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif /* __cplusplus */
00034 
00035 
00036 /* Given an apache request R, a URI, and a ROOT_PATH to the svn
00037    location block, process URI and return many things, allocated in
00038    r->pool:
00039 
00040    * CLEANED_URI:     The uri with duplicate and trailing slashes removed.
00041 
00042    * TRAILING_SLASH:  Whether the uri had a trailing slash on it.
00043 
00044    Three special substrings of the uri are returned for convenience:
00045 
00046    * REPOS_NAME:      The single path component that is the directory
00047                       which contains the repository.
00048 
00049    * RELATIVE_PATH:   The remaining imaginary path components.
00050 
00051    * REPOS_PATH:      The actual path within the repository filesystem, or
00052                       NULL if no part of the uri refers to a path in
00053                       the repository (e.g. "!svn/vcc/default" or
00054                       "!svn/bln/25").
00055 
00056 
00057    For example, consider the uri
00058 
00059        /svn/repos/proj1/!svn/blah/13//A/B/alpha
00060 
00061    In the SVNPath case, this function would receive a ROOT_PATH of
00062    '/svn/repos/proj1', and in the SVNParentPath case would receive a
00063    ROOT_PATH of '/svn/repos'.  But either way, we would get back:
00064 
00065      * CLEANED_URI:    /svn/repos/proj1/!svn/blah/13/A/B/alpha
00066      * REPOS_NAME:     proj1
00067      * RELATIVE_PATH:  /!svn/blah/13/A/B/alpha
00068      * REPOS_PATH:     A/B/alpha
00069      * TRAILING_SLASH: FALSE
00070 */
00071 AP_MODULE_DECLARE(dav_error *) dav_svn_split_uri(request_rec *r,
00072                                                  const char *uri,
00073                                                  const char *root_path,
00074                                                  const char **cleaned_uri,
00075                                                  int *trailing_slash,
00076                                                  const char **repos_name,
00077                                                  const char **relative_path,
00078                                                  const char **repos_path);
00079 APR_DECLARE_OPTIONAL_FN(dav_error *, dav_svn_split_uri,
00080                         (request_rec *r,
00081                          const char *uri,
00082                          const char *root_path,
00083                          const char **cleaned_uri,
00084                          int *trailing_slash,
00085                          const char **repos_name,
00086                          const char **relative_path,
00087                          const char **repos_path));
00088 
00089 
00090 /* Given an apache request R and a ROOT_PATH to the svn location
00091    block sets *REPOS_PATH to the path of the repository on disk.
00092 */
00093 AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r,
00094                                                       const char *root_path,
00095                                                       const char **repos_path);
00096 APR_DECLARE_OPTIONAL_FN(dav_error *, dav_svn_get_repos_path,
00097                         (request_rec *r,
00098                          const char *root_path,
00099                          const char **repos_path));
00100 
00101 #ifdef __cplusplus
00102 }
00103 #endif /* __cplusplus */
00104 
00105 #endif /* MOD_DAV_SVN_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines