Subversion
mod_dav_svn.h
Go to the documentation of this file.
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 r->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 AP_MODULE_DECLARE(dav_error *) dav_svn_split_uri(request_rec *r,
00079                                                  const char *uri,
00080                                                  const char *root_path,
00081                                                  const char **cleaned_uri,
00082                                                  int *trailing_slash,
00083                                                  const char **repos_basename,
00084                                                  const char **relative_path,
00085                                                  const char **repos_path);
00086 
00087 
00088 /**
00089  * Given an apache request @a r and a @a root_path to the svn location
00090  * block, set @a *repos_path to the path of the repository on disk.  */
00091 AP_MODULE_DECLARE(dav_error *) dav_svn_get_repos_path(request_rec *r,
00092                                                       const char *root_path,
00093                                                       const char **repos_path);
00094 
00095 #ifdef __cplusplus
00096 }
00097 #endif /* __cplusplus */
00098 
00099 #endif /* MOD_DAV_SVN_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines