Apache2
repos.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
25 #ifndef _DAV_FS_REPOS_H_
26 #define _DAV_FS_REPOS_H_
27 
28 #include "util_mutex.h"
29 
30 /* the subdirectory to hold all DAV-related information for a directory */
31 #define DAV_FS_STATE_DIR ".DAV"
32 #define DAV_FS_STATE_FILE_FOR_DIR ".state_for_dir"
33 #define DAV_FS_LOCK_NULL_FILE ".locknull"
34 #define DAV_FS_TMP_PREFIX ".davfs.tmp" /* prefix for tmp files */
35 
36 #define DAV_FS_QUOTA_UNSET 0
37 #define DAV_FS_QUOTA_OFF -1
38 #define DAV_FS_QUOTA_NONE -2
39 
40 #define DAV_FS_BYTES_ERROR -1
41 
42 /* ensure that our state subdirectory is present */
43 void dav_fs_ensure_state_dir(apr_pool_t *p, const char *dirname);
44 
45 /* return the storage pool associated with a resource */
47 
48 /* return the full pathname for a resource */
50 
51 /* same as dav_fs_pathname() with directories' trailing slash */
52 const char *dav_fs_fname(const dav_resource *resource);
53 
54 /* return the size for a resource, -1 if unknown */
56 
57 
58 /* return the directory and filename for a resource */
60  const char **dirpath,
61  const char **fname);
62 
63 /* return the list of locknull members in this resource's directory */
65  dav_buffer *pbuf);
66 
67 
68 /* DBM functions used by the repository and locking providers */
69 extern const dav_hooks_db dav_hooks_db_dbm;
70 
71 dav_error * dav_dbm_open_direct(apr_pool_t *p, const char *pathname,
72  const char *dbmtype, int ro, dav_db **pdb);
73 void dav_dbm_get_statefiles(apr_pool_t *p, const char *fname,
74  const char **state1, const char **state2);
81 
82 /* Per-server configuration. */
83 typedef struct {
84  const char *lockdb_path;
85  const char *lockdb_type;
88 
89 /* Returns server configuration for the request. */
91 
92 dav_error *dav_fs_get_quota(const request_rec *r, const char *path,
93  apr_off_t *quota_bytes);
96  const char *path, int *fs_low);
97 
100 
103  const char *ns_uri, const char *name,
104  const dav_hooks_liveprop **hooks);
108  dav_resource *src, const dav_resource *dst,
109  const apr_xml_doc *doc, dav_error **err);
111  dav_resource *src, const dav_resource *dst,
112  const apr_xml_doc *doc, dav_error **err);
113 
115 
116 #endif /* _DAV_FS_REPOS_H_ */
void dav_fs_ensure_state_dir(apr_pool_t *p, const char *dirname)
const char * ns_uri
Definition: mod_dav.h:1089
apr_text_header * phdr
Definition: mod_dav.h:649
void dav_fs_register(apr_pool_t *p)
const char * dav_fs_fname(const dav_resource *resource)
int ro
Definition: mod_dav.h:1428
const dav_fs_server_conf * dav_fs_get_server_conf(const request_rec *r)
const dav_hooks_db dav_hooks_db_dbm
const dav_resource dav_prop_insert what
Definition: mod_dav.h:1095
request_rec * r
Definition: mod_dav.h:518
void dav_dbm_freedatum(dav_db *db, apr_datum_t data)
const dav_hooks_propdb * dav_fs_get_propdb_hooks(request_rec *r)
const char const dav_provider * hooks
Definition: mod_dav.h:806
dav_error * dav_dbm_store(dav_db *db, apr_datum_t key, apr_datum_t value)
dav_error * dav_dbm_fetch(dav_db *db, apr_datum_t key, apr_datum_t *pvalue)
int dav_fs_quota_precondition(request_rec *r, dav_resource *src, const dav_resource *dst, const apr_xml_doc *doc, dav_error **err)
int dav_fs_find_liveprop(const dav_resource *resource, const char *ns_uri, const char *name, const dav_hooks_liveprop **hooks)
int dav_dbm_exists(dav_db *db, apr_datum_t key)
dav_prop_insert
Definition: mod_dav.h:522
void dav_dbm_close(dav_db *db)
int dav_fs_method_precondition(request_rec *r, dav_resource *src, const dav_resource *dst, const apr_xml_doc *doc, dav_error **err)
dav_error * dav_dbm_delete(dav_db *db, apr_datum_t key)
void dav_dbm_get_statefiles(apr_pool_t *p, const char *fname, const char **state1, const char **state2)
dav_error * dav_fs_get_quota(const request_rec *r, const char *path, apr_off_t *quota_bytes)
apr_off_t dav_fs_get_available_bytes(request_rec *r, const char *path, int *fs_low)
dav_error * dav_fs_get_locknull_members(const dav_resource *resource, dav_buffer *pbuf)
struct dav_db dav_db
Definition: mod_dav.h:1205
const dav_hooks_locks * dav_fs_get_lock_hooks(request_rec *r)
const dav_resource * resource
Definition: mod_dav.h:1094
apr_off_t dav_fs_get_used_bytes(request_rec *r, const char *path)
dav_error * dav_dbm_open_direct(apr_pool_t *p, const char *pathname, const char *dbmtype, int ro, dav_db **pdb)
const dav_resource dav_lockdb const apr_xml_doc * doc
Definition: mod_dav.h:1434
apr_pool_t * dav_fs_pool(const dav_resource *resource)
dav_error * src
Definition: mod_dav.h:186
const char * dav_fs_pathname(const dav_resource *resource)
void dav_fs_insert_all_liveprops(request_rec *r, const dav_resource *resource, dav_prop_insert what, apr_text_header *phdr)
apr_off_t dav_fs_size(const dav_resource *resource)
dav_buffer * pbuf
Definition: mod_dav.h:460
dav_error * err
Definition: mod_dav.h:203
dav_error * dav_fs_dir_file_name(const dav_resource *resource, const char **dirpath, const char **fname)
void dav_fs_gather_propsets(apr_array_header_t *uris)
const char * name
Definition: mod_dav.h:805
off_t apr_off_t
Definition: apr.h:396
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
Definition: apr_tables.h:62
Definition: apr_dbm.h:54
Definition: apr_arch_global_mutex.h:23
Definition: apr_xml.h:64
Definition: apr_xml.h:200
Definition: mod_dav.h:451
Definition: mod_dav.h:121
Definition: repos.h:83
apr_global_mutex_t * lockdb_mutex
Definition: repos.h:86
const char * lockdb_type
Definition: repos.h:85
const char * lockdb_path
Definition: repos.h:84
Definition: mod_dav.h:896
Definition: mod_dav.h:1481
Definition: mod_dav.h:1216
Definition: mod_dav.h:389
A structure that represents the current request.
Definition: httpd.h:856
apr_pool_t * p
Apache Mutex support library.