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