Alien-SVN

 view release on metacpan or  search on metacpan

src/subversion/subversion/mod_dav_svn/dav_svn.h  view on Meta::CPAN

 * ====================================================================
 */

#ifndef DAV_SVN_H
#define DAV_SVN_H

#include <apr_tables.h>
#include <apr_xml.h>

#include <httpd.h>
#include <http_log.h>
#include <mod_dav.h>

#include "svn_error.h"
#include "svn_fs.h"
#include "svn_repos.h"
#include "svn_path.h"
#include "svn_xml.h"
#include "private/svn_dav_protocol.h"
#include "private/svn_skel.h"
#include "mod_authz_svn.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */



/* what the one VCC is called */
#define DAV_SVN__DEFAULT_VCC_NAME        "default"

/* a pool-key for the shared dav_svn_root used by autoversioning  */
#define DAV_SVN__AUTOVERSIONING_ACTIVITY "svn-autoversioning-activity"

/* Option values for SVNAllowBulkUpdates.  Note that
   it's important that CONF_BULKUPD_DEFAULT is 0 to make
   dav_svn_merge_dir_config do the right thing. */
typedef enum dav_svn__bulk_upd_conf {
    CONF_BULKUPD_DEFAULT,
    CONF_BULKUPD_ON,
    CONF_BULKUPD_OFF,
    CONF_BULKUPD_PREFER
} dav_svn__bulk_upd_conf;

/* dav_svn_repos
 *
 * Record information about the repository that a resource belongs to.
 * This structure will be shared between multiple resources so that we
 * can optimized our FS access.
 *
 * Note that we do not refcount this structure. Presumably, we will need
 * it throughout the life of the request. Therefore, we can just leave it
 * for the request pool to cleanup/close.
 *
 * Also, note that it is possible that two resources may have distinct
 * dav_svn_repos structures, yet refer to the same repository. This is
 * allowed by the SVN FS interface.
 *
 * ### should we attempt to merge them when we detect this situation in
 * ### places like is_same_resource, is_parent_resource, or copy/move?
 * ### I say yes: the FS will certainly have an easier time if there is
 * ### only a single FS open; otherwise, it will have to work a bit harder
 * ### to keep the things in sync.
 */
typedef struct dav_svn_repos {
  apr_pool_t *pool;     /* request_rec -> pool */

  /* Remember the root URL path of this repository (just a path; no
     scheme, host, or port).

     Example: the URI is "http://host/repos/file", this will be "/repos".

     This always starts with "/", and if there are any components
     beyond that, then it does not end with "/".
  */
  const char *root_path;

  /* Remember an absolute URL for constructing other URLs. In the above
     example, this would be "http://host" (note: no trailing slash)
  */
  const char *base_url;

  /* Remember the special URI component for this repository */
  const char *special_uri;

  /* This records the filesystem path to the SVN FS */
  const char *fs_path;

  /* The name of this repository */
  const char *repo_name;

  /* The repository filesystem basename */
  const char *repo_basename;

  /* The URI of the XSL transform for directory indexes */
  const char *xslt_uri;

  /* Whether autoversioning is active for this repository. */
  svn_boolean_t autoversioning;

  /* Whether bulk updates are allowed for this repository. */
  dav_svn__bulk_upd_conf bulk_updates;

  /* Whether HTTP protocol version 2 is allowed to be used. */
  svn_boolean_t v2_protocol;

  /* the open repository */
  svn_repos_t *repos;

  /* a cached copy of REPOS->fs above. */
  svn_fs_t *fs;

  /* the user operating against this repository */
  const char *username;

  /* is the client a Subversion client? */
  svn_boolean_t is_svn_client;

  /* The client's capabilities.  Maps SVN_RA_CAPABILITY_* keys to
     "yes" or "no" values.  If a capability is not yet discovered, it
     is absent from the table.  The table itself is allocated in this

src/subversion/subversion/mod_dav_svn/dav_svn.h  view on Meta::CPAN

  /* This is identical to the 'token' field of an svn_lock_t. */
  const char *uuid_str;
};


/* for the repository referred to by this request, where is the SVN FS? */
const char *dav_svn__get_fs_path(request_rec *r);
const char *dav_svn__get_fs_parent_path(request_rec *r);

/* for the repository referred to by this request, is autoversioning active? */
svn_boolean_t dav_svn__get_autoversioning_flag(request_rec *r);

/* for the repository referred to by this request, are bulk updates allowed? */
dav_svn__bulk_upd_conf dav_svn__get_bulk_updates_flag(request_rec *r);

/* for the repository referred to by this request, are subrequests active? */
svn_boolean_t dav_svn__get_pathauthz_flag(request_rec *r);

/* for the repository referred to by this request, is txdelta caching active? */
svn_boolean_t dav_svn__get_txdelta_cache_flag(request_rec *r);

/* for the repository referred to by this request, is fulltext caching active? */
svn_boolean_t dav_svn__get_fulltext_cache_flag(request_rec *r);

/* for the repository referred to by this request, is revprop caching active? */
svn_boolean_t dav_svn__get_revprop_cache_flag(request_rec *r);

/* for the repository referred to by this request, are subrequests bypassed?
 * A function pointer if yes, NULL if not.
 */
authz_svn__subreq_bypass_func_t dav_svn__get_pathauthz_bypass(request_rec *r);

/* for the repository referred to by this request, is a GET of
   SVNParentPath allowed? */
svn_boolean_t dav_svn__get_list_parentpath_flag(request_rec *r);

/* For the repository referred to by this request, should HTTPv2
   protocol support be advertised?  Note that this also takes into
   account the support level expected of based on the specified
   master server version (if provided via SVNMasterVersion).  */
svn_boolean_t dav_svn__check_httpv2_support(request_rec *r);

/* For the repository referred to by this request, should ephemeral
   txnprop support be advertised?  */
svn_boolean_t dav_svn__check_ephemeral_txnprops_support(request_rec *r);



/* SPECIAL URI

   SVN needs to create many types of "pseudo resources" -- resources
   that don't correspond to the users' files/directories in the
   repository. Specifically, these are:

   - working resources
   - activities
   - version resources
   - version history resources

   Each of these will be placed under a portion of the URL namespace
   that defines the SVN repository. For example, let's say the user
   has configured an SVN repository at http://host/svn/repos. The
   special resources could be configured to live at .../!svn/ under
   that repository. Thus, an activity might be located at
   http://host/svn/repos/!svn/act/1234.

   The special URI is configurable on a per-server basis and defaults
   to "!svn".

   NOTE: the special URI is RELATIVE to the "root" of the
   repository. The root is generally available only to
   dav_svn_get_resource(). This is okay, however, because we can cache
   the root_dir when the resource structure is built.
*/

/* Return the repo-root-relative URI of the special namespace to be used for
 * this resource.
 * Comes from the <SVNSpecialURI> directive. */
/* ### Is this assumed to be URI-encoded? */
const char *dav_svn__get_special_uri(request_rec *r);

/* Return a descriptive name for the repository.
 * Comes from the <SVNReposName> directive. */
const char *dav_svn__get_repo_name(request_rec *r);

/* Return the server-relative URI of an XSL transform stylesheet.
   Comes from the <SVNIndexXSLT> directive. */
/* ### Is this assumed to be URI-encoded? */
const char *dav_svn__get_xslt_uri(request_rec *r);

/* Return the full URL of the master repository (for mirroring).
   Comes from the <SVNMasterURI> directive. */
/* ### Is this assumed to be URI-encoded? */
const char *dav_svn__get_master_uri(request_rec *r);

/* Return the version of the master server (used for mirroring) iff a
   master URI is in place for this location; otherwise, return NULL.
   Comes from the <SVNMasterVersion> directive. */
svn_version_t *dav_svn__get_master_version(request_rec *r);

/* Return the disk path to the activities db.
   Comes from the <SVNActivitiesDB> directive. */
const char *dav_svn__get_activities_db(request_rec *r);

/* Return the server-relative URI of the repository root.
   Comes from the <Location> directive. */
/* ### Is this assumed to be URI-encoded? */
const char *dav_svn__get_root_dir(request_rec *r);

/* Return the data compression level to be used over the wire. */
int dav_svn__get_compression_level(request_rec *r);

/* Return the hook script environment parsed from the configuration. */
const char *dav_svn__get_hooks_env(request_rec *r);

/** For HTTP protocol v2, these are the new URIs and URI stubs
    returned to the client in our OPTIONS response.  They all depend
    on the 'special uri', which is configurable in httpd.conf.  **/

/* Where REPORT requests are sent (typically "!svn/me") */
const char *dav_svn__get_me_resource_uri(request_rec *r);



( run in 0.403 second using v1.01-cache-2.11-cpan-483215c6ad5 )