1 /* 2 * ra_local.h : shared internal declarations for ra_local module 3 * 4 * ==================================================================== 5 * Licensed to the Apache Software Foundation (ASF) under one 6 * or more contributor license agreements. See the NOTICE file 7 * distributed with this work for additional information 8 * regarding copyright ownership. The ASF licenses this file 9 * to you under the Apache License, Version 2.0 (the 10 * "License"); you may not use this file except in compliance 11 * with the License. You may obtain a copy of the License at 12 * 13 * http://www.apache.org/licenses/LICENSE-2.0 14 * 15 * Unless required by applicable law or agreed to in writing, 16 * software distributed under the License is distributed on an 17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 * KIND, either express or implied. See the License for the 19 * specific language governing permissions and limitations 20 * under the License. 21 * ==================================================================== 22 */ 23 24 #ifndef SVN_LIBSVN_RA_LOCAL_H 25 #define SVN_LIBSVN_RA_LOCAL_H 26 27 #include <apr_pools.h> 28 #include <apr_tables.h> 29 30 #include "svn_types.h" 31 #include "svn_fs.h" 32 #include "svn_repos.h" 33 #include "svn_ra.h" 34 35 #ifdef __cplusplus 36 extern "C" { 37 #endif /* __cplusplus */ 38 39 40 /** Structures **/ 41 42 /* A baton which represents a single ra_local session. */ 43 typedef struct svn_ra_local__session_baton_t 44 { 45 /* The user accessing the repository. */ 46 const char *username; 47 48 /* The URL of the session, split into two components. */ 49 const char *repos_url; 50 svn_stringbuf_t *fs_path; /* URI-decoded, always with a leading slash. */ 51 52 /* A repository object. */ 53 svn_repos_t *repos; 54 55 /* The filesystem object associated with REPOS above (for 56 convenience). */ 57 svn_fs_t *fs; 58 59 /* The UUID associated with REPOS above (cached) */ 60 const char *uuid; 61 62 /* Callbacks/baton passed to svn_ra_open. */ 63 const svn_ra_callbacks2_t *callbacks; 64 void *callback_baton; 65 66 /* Slave auth baton */ 67 svn_auth_baton_t *auth_baton; 68 69 const char *useragent; 70 } svn_ra_local__session_baton_t; 71 72 73 74 75 /** Private routines **/ 76 77 78 79 80 /* Given a `file://' URL, figure out which portion specifies a 81 repository on local disk, and return that in REPOS_URL (if not 82 NULL); URI-decode and return the remainder (the path *within* the 83 repository's filesystem) in FS_PATH. Open REPOS to the repository 84 root (if not NULL). Allocate the return values in POOL. 85 Currently, we are not expecting to handle `file://hostname/'-type 86 URLs; hostname, in this case, is expected to be the empty string or 87 "localhost". */ 88 svn_error_t * 89 svn_ra_local__split_URL(svn_repos_t **repos, 90 const char **repos_url, 91 const char **fs_path, 92 const char *URL, 93 apr_pool_t *pool); 94 95 96 97 98 #ifdef __cplusplus 99 } 100 #endif /* __cplusplus */ 101 102 #endif /* SVN_LIBSVN_RA_LOCAL_H */ 103