repos.h revision f4c310fd2555c6faca1f980f00b161eadb089023
6ae232055d4d8a97267517c5e50074c2c819941and/*
6ae232055d4d8a97267517c5e50074c2c819941and** Copyright (C) 1998-2000 Greg Stein. All Rights Reserved.
6ae232055d4d8a97267517c5e50074c2c819941and**
6ae232055d4d8a97267517c5e50074c2c819941and** By using this file, you agree to the terms and conditions set forth in
6ae232055d4d8a97267517c5e50074c2c819941and** the LICENSE.html file which can be found at the top level of the mod_dav
6ae232055d4d8a97267517c5e50074c2c819941and** distribution or at http://www.webdav.org/mod_dav/license-1.html.
6ae232055d4d8a97267517c5e50074c2c819941and**
6ae232055d4d8a97267517c5e50074c2c819941and** Contact information:
6ae232055d4d8a97267517c5e50074c2c819941and** Greg Stein, PO Box 760, Palo Alto, CA, 94302
6ae232055d4d8a97267517c5e50074c2c819941and** gstein@lyra.org, http://www.webdav.org/mod_dav/
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen*/
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen/*
d29d9ab4614ff992b0e8de6e2b88d52b6f1f153erbowen** Declarations for the filesystem repository implementation
6ae232055d4d8a97267517c5e50074c2c819941and**
6ae232055d4d8a97267517c5e50074c2c819941and** Written by John Vasta, vasta@rational.com, by separating from mod_dav.h
6ae232055d4d8a97267517c5e50074c2c819941and*/
d229f940abfb2490dee17979e9a5ff31b7012eb5rbowen
3f08db06526d6901aa08c110b5bc7dde6bc39905nd#ifndef _DAV_FS_REPOS_H_
6ae232055d4d8a97267517c5e50074c2c819941and#define _DAV_FS_REPOS_H_
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941and/* the subdirectory to hold all DAV-related information for a directory */
b43f840409794ed298e8634f6284741f193b6c4ftakashi#define DAV_FS_STATE_DIR ".DAV"
6ae232055d4d8a97267517c5e50074c2c819941and#define DAV_FS_STATE_FILE_FOR_DIR ".state_for_dir"
6ae232055d4d8a97267517c5e50074c2c819941and#define DAV_FS_LOCK_NULL_FILE ".locknull"
6ae232055d4d8a97267517c5e50074c2c819941and
b43f840409794ed298e8634f6284741f193b6c4ftakashi#ifndef WIN32
6ae232055d4d8a97267517c5e50074c2c819941and
f086b4b402fa9a2fefc7dda85de2a3cc1cd0a654rjung#define DAV_FS_MODE_DIR (S_IRWXU | S_IRWXG)
6ae232055d4d8a97267517c5e50074c2c819941and#define DAV_FS_MODE_FILE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP)
b43f840409794ed298e8634f6284741f193b6c4ftakashi#define DAV_FS_MODE_XUSR (S_IXUSR)
b43f840409794ed298e8634f6284741f193b6c4ftakashi
b43f840409794ed298e8634f6284741f193b6c4ftakashi#else /* WIN32 */
b43f840409794ed298e8634f6284741f193b6c4ftakashi
6ae232055d4d8a97267517c5e50074c2c819941and#define DAV_FS_MODE_DIR (_S_IREAD | _S_IWRITE)
6ae232055d4d8a97267517c5e50074c2c819941and#define DAV_FS_MODE_FILE (_S_IREAD | _S_IWRITE)
6ae232055d4d8a97267517c5e50074c2c819941and#define DAV_FS_MODE_XUSR (_S_IEXEC)
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941and#include <limits.h>
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941andtypedef int ssize_t;
6ae232055d4d8a97267517c5e50074c2c819941and
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi#define mkdir(p,m) _mkdir(p)
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941and#endif /* WIN32 */
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
6ae232055d4d8a97267517c5e50074c2c819941and/* ensure that our state subdirectory is present */
6ae232055d4d8a97267517c5e50074c2c819941andvoid dav_fs_ensure_state_dir(pool *p, const char *dirname);
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
6ae232055d4d8a97267517c5e50074c2c819941and/* return the storage pool associated with a resource */
6ae232055d4d8a97267517c5e50074c2c819941andpool *dav_fs_pool(const dav_resource *resource);
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941and/* return the full pathname for a resource */
6ae232055d4d8a97267517c5e50074c2c819941andconst char *dav_fs_pathname(const dav_resource *resource);
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941and/* return the directory and filename for a resource */
6ae232055d4d8a97267517c5e50074c2c819941andvoid dav_fs_dir_file_name(const dav_resource *resource,
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi const char **dirpath,
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi const char **fname);
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi
1d980e5489836e977ba59b419e27b0ec875c4bd3takashi/* return the list of locknull members in this resource's directory */
6ae232055d4d8a97267517c5e50074c2c819941anddav_error * dav_fs_get_locknull_members(const dav_resource *resource,
6ae232055d4d8a97267517c5e50074c2c819941and dav_buffer *pbuf);
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941and/* DBM functions used by the repository and locking providers */
6ae232055d4d8a97267517c5e50074c2c819941andextern const dav_hooks_db dav_hooks_db_dbm;
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941anddav_error * dav_dbm_open_direct(pool *p, const char *pathname, int ro,
6ae232055d4d8a97267517c5e50074c2c819941and dav_db **pdb);
6ae232055d4d8a97267517c5e50074c2c819941andvoid dav_dbm_get_statefiles(pool *p, const char *fname,
6ae232055d4d8a97267517c5e50074c2c819941and const char **state1, const char **state2);
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941and
6ae232055d4d8a97267517c5e50074c2c819941and#endif /* _DAV_FS_REPOS_H_ */
6ae232055d4d8a97267517c5e50074c2c819941and