repos.h revision 6f15570e3adc0faf87bf55f70857028276fc9e32
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl/* ====================================================================
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * The Apache Software License, Version 1.1
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl *
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * Copyright (c) 2000-2002 The Apache Software Foundation. All rights
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * reserved.
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl *
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * Redistribution and use in source and binary forms, with or without
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * modification, are permitted provided that the following conditions
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * are met:
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl *
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * 1. Redistributions of source code must retain the above copyright
a530dde7009b0a808300c420def741354a4d13d2Martin Kühl * notice, this list of conditions and the following disclaimer.
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco *
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * 2. Redistributions in binary form must reproduce the above copyright
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * notice, this list of conditions and the following disclaimer in
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * the documentation and/or other materials provided with the
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * distribution.
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco *
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * 3. The end-user documentation included with the redistribution,
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * if any, must include the following acknowledgment:
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * "This product includes software developed by the
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * Apache Software Foundation (http://www.apache.org/)."
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * Alternately, this acknowledgment may appear in the software itself,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * if and wherever such third-party acknowledgments normally appear.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco *
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * 4. The names "Apache" and "Apache Software Foundation" must
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * not be used to endorse or promote products derived from this
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * software without prior written permission. For written
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * permission, please contact apache@apache.org.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco *
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * 5. Products derived from this software may not be called "Apache",
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * nor may "Apache" appear in their name, without prior written
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * permission of the Apache Software Foundation.
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco *
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
b9840e4ee6fda6e42fa4ee9f337482ccc4839a39Adrián Riesco * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * SUCH DAMAGE.
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco * ====================================================================
223be434693e8c97e2522ac19155a284b3536035Adrián Riesco *
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * This software consists of voluntary contributions made by many
51c15129e8118fed5c33c334f8df82619ce98e7dAdrián Riesco * individuals on behalf of the Apache Software Foundation. For more
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco * information on the Apache Software Foundation, please see
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco * <http://www.apache.org/>.
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/*
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco** Declarations for the filesystem repository implementation
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco*/
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#ifndef _DAV_FS_REPOS_H_
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#define _DAV_FS_REPOS_H_
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/* the subdirectory to hold all DAV-related information for a directory */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#define DAV_FS_STATE_DIR ".DAV"
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#define DAV_FS_STATE_FILE_FOR_DIR ".state_for_dir"
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#define DAV_FS_LOCK_NULL_FILE ".locknull"
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
aea9000fc94442cbfc92596f4264473c0fce51e4Adrián Riesco
d72e314a1952b4418fb1c98b17dbab0d16bba585Adrián Riesco/* ensure that our state subdirectory is present */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescovoid dav_fs_ensure_state_dir(apr_pool_t *p, const char *dirname);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/* return the storage pool associated with a resource */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoapr_pool_t *dav_fs_pool(const dav_resource *resource);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/* return the full pathname for a resource */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoconst char *dav_fs_pathname(const dav_resource *resource);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/* return the directory and filename for a resource */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescodav_error * dav_fs_dir_file_name(const dav_resource *resource,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char **dirpath,
7474965b2e6323002c96c0b39a59843cde201870Adrián Riesco const char **fname);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/* return the list of locknull members in this resource's directory */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescodav_error * dav_fs_get_locknull_members(const dav_resource *resource,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco dav_buffer *pbuf);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/* DBM functions used by the repository and locking providers */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoextern const dav_hooks_db dav_hooks_db_dbm;
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescodav_error * dav_dbm_open_direct(apr_pool_t *p, const char *pathname, int ro,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco dav_db **pdb);
7474965b2e6323002c96c0b39a59843cde201870Adrián Riescovoid dav_dbm_get_statefiles(apr_pool_t *p, const char *fname,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char **state1, const char **state2);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescodav_error * dav_dbm_delete(dav_db *db, apr_datum_t key);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescodav_error * dav_dbm_store(dav_db *db, apr_datum_t key, apr_datum_t value);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescodav_error * dav_dbm_fetch(dav_db *db, apr_datum_t key, apr_datum_t *pvalue);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescovoid dav_dbm_freedatum(dav_db *db, apr_datum_t data);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoint dav_dbm_exists(dav_db *db, apr_datum_t key);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescovoid dav_dbm_close(dav_db *db);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco/* where is the lock database located? */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoconst char *dav_get_lockdb_path(const request_rec *r);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoconst dav_hooks_locks *dav_fs_get_lock_hooks(request_rec *r);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoconst dav_hooks_propdb *dav_fs_get_propdb_hooks(request_rec *r);
7474965b2e6323002c96c0b39a59843cde201870Adrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescovoid dav_fs_gather_propsets(apr_array_header_t *uris);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescoint dav_fs_find_liveprop(const dav_resource *resource,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const char *ns_uri, const char *name,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco const dav_hooks_liveprop **hooks);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescovoid dav_fs_insert_all_liveprops(request_rec *r, const dav_resource *resource,
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco dav_prop_insert what, apr_text_header *phdr);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riescovoid dav_fs_register(apr_pool_t *p);
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco#endif /* _DAV_FS_REPOS_H_ */
5318901bb69bf247e0f341312c800ba4ea87e46bAdrián Riesco