⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mod_dav.h

📁 最新apache的源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
** LIVE PROPERTY HANDLING*//* opaque type for PROPPATCH rollback information */typedef struct dav_liveprop_rollback dav_liveprop_rollback;struct dav_hooks_liveprop{    /*    ** Insert property information into a text block. The property to    ** insert is identified by the propid value. The information to insert    ** is identified by the "what" argument, as follows:    **   DAV_PROP_INSERT_NAME    **      property name, as an empty XML element    **   DAV_PROP_INSERT_VALUE    **      property name/value, as an XML element    **   DAV_PROP_INSERT_SUPPORTED    **      if the property is defined on the resource, then    **      a DAV:supported-live-property element, as defined    **      by the DeltaV extensions to RFC2518.    **                          ** Providers should return DAV_PROP_INSERT_NOTDEF if the property is    ** known and not defined for this resource, so should be handled as a    ** dead property. If a provider recognizes, but does not support, a    ** property, and does not want it handled as a dead property, it should    ** return DAV_PROP_INSERT_NOTSUPP.    **    ** Returns one of DAV_PROP_INSERT_* based on what happened.    **    ** ### we may need more context... ie. the lock database    */    dav_prop_insert (*insert_prop)(const dav_resource *resource,                                   int propid, dav_prop_insert what,                                   apr_text_header *phdr);    /*    ** Determine whether a given property is writable.    **    ** ### we may want a different semantic. i.e. maybe it should be    ** ### "can we write <value> into this property?"    **    ** Returns 1 if the live property can be written, 0 if read-only.    */    int (*is_writable)(const dav_resource *resource, int propid);    /*    ** This member defines the set of namespace URIs that the provider    ** uses for its properties. When insert_all is called, it will be    ** passed a list of integers that map from indices into this list    ** to namespace IDs for output generation.    **    ** The last entry in this list should be a NULL value (sentinel).    */    const char * const * namespace_uris;    /*    ** ### this is not the final design. we want an open-ended way for    ** ### liveprop providers to attach *new* properties. To this end,    ** ### we'll have a "give me a list of the props you define", a way    ** ### to check for a prop's existence, a way to validate a set/remove    ** ### of a prop, and a way to execute/commit/rollback that change.    */    /*    ** Validate that the live property can be assigned a value, and that    ** the provided value is valid.    **    ** elem will point to the XML element that names the property. For    ** example:    **     <lp1:executable>T</lp1:executable>    **    ** The provider can access the cdata fields and the child elements    ** to extract the relevant pieces.    **    ** operation is one of DAV_PROP_OP_SET or _DELETE.    **    ** The provider may return a value in *context which will be passed    ** to each of the exec/commit/rollback functions. For example, this    ** may contain an internal value which has been processed from the    ** input element.    **    ** The provider must set defer_to_dead to true (non-zero) or false.    ** If true, then the set/remove is deferred to the dead property    ** database. Note: it will be set to zero on entry.    */    dav_error * (*patch_validate)(const dav_resource *resource,                                  const apr_xml_elem *elem,                                  int operation,                                  void **context,                                  int *defer_to_dead);    /* ### doc... */    dav_error * (*patch_exec)(const dav_resource *resource,                              const apr_xml_elem *elem,                              int operation,                              void *context,                              dav_liveprop_rollback **rollback_ctx);    /* ### doc... */    void (*patch_commit)(const dav_resource *resource,                         int operation,                         void *context,                         dav_liveprop_rollback *rollback_ctx);    /* ### doc... */    dav_error * (*patch_rollback)(const dav_resource *resource,                                  int operation,                                  void *context,                                  dav_liveprop_rollback *rollback_ctx);    /*    ** If a provider needs a context to associate with this hooks structure,    ** then this field may be used. In most cases, it will just be NULL.    */    void *ctx;};/*** dav_liveprop_spec: specify a live property**** This structure is used as a standard way to determine if a particular** property is a live property. Its use is not part of the mandated liveprop** interface, but can be used by liveprop providers in conjuction with the** utility routines below.**** spec->name == NULL is the defined end-sentinel for a list of specs.*/typedef struct {    int ns;             /* provider-local namespace index */    const char *name;   /* name of the property */    int propid;         /* provider-local property ID */    int is_writable;    /* is the property writable? */} dav_liveprop_spec;/*** dav_liveprop_group: specify a group of liveprops**** This structure specifies a group of live properties, their namespaces,** and how to handle them.*/typedef struct {    const dav_liveprop_spec *specs;    const char * const *namespace_uris;    const dav_hooks_liveprop *hooks;} dav_liveprop_group;/* ### docco */DAV_DECLARE(int) dav_do_find_liveprop(const char *ns_uri, const char *name,                                      const dav_liveprop_group *group,                                      const dav_hooks_liveprop **hooks);/* ### docco */DAV_DECLARE(int) dav_get_liveprop_info(int propid,                                       const dav_liveprop_group *group,                                       const dav_liveprop_spec **info);/* ### docco */DAV_DECLARE(void) dav_register_liveprop_group(apr_pool_t *pool,                                               const dav_liveprop_group *group);/* ### docco */DAV_DECLARE(int) dav_get_liveprop_ns_index(const char *uri);/* ### docco */DAV_DECLARE(int) dav_get_liveprop_ns_count(void);/* ### docco */DAV_DECLARE(void) dav_add_all_liveprop_xmlns(apr_pool_t *p,                                             apr_text_header *phdr);/*** The following three functions are part of mod_dav's internal handling** for the core WebDAV properties. They are not part of mod_dav's API.*/DAV_DECLARE_NONSTD(int) dav_core_find_liveprop(    const dav_resource *resource,    const char *ns_uri,    const char *name,    const dav_hooks_liveprop **hooks);DAV_DECLARE_NONSTD(void) dav_core_insert_all_liveprops(    request_rec *r,    const dav_resource *resource,    dav_prop_insert what,    apr_text_header *phdr);DAV_DECLARE_NONSTD(void) dav_core_register_uris(apr_pool_t *p);/*** Standard WebDAV Property Identifiers**** A live property provider does not need to use these; they are simply** provided for convenience.**** Property identifiers need to be unique within a given provider, but not** *across* providers (note: this uniqueness constraint was different in** older versions of mod_dav).**** The identifiers start at 20000 to make it easier for providers to avoid** conflicts with the standard properties. The properties are arranged** alphabetically, and may be reordered from time to time (as properties** are introduced).**** NOTE: there is no problem with reordering (e.g. binary compat) since the** identifiers are only used within a given provider, which would pick up** the entire set of changes upon a recompile.*/enum {    DAV_PROPID_BEGIN = 20000,    /* Standard WebDAV properties (RFC 2518) */    DAV_PROPID_creationdate,    DAV_PROPID_displayname,    DAV_PROPID_getcontentlanguage,    DAV_PROPID_getcontentlength,    DAV_PROPID_getcontenttype,    DAV_PROPID_getetag,    DAV_PROPID_getlastmodified,    DAV_PROPID_lockdiscovery,    DAV_PROPID_resourcetype,    DAV_PROPID_source,    DAV_PROPID_supportedlock,    /* DeltaV properties (from the I-D (#14)) */    DAV_PROPID_activity_checkout_set,    DAV_PROPID_activity_set,    DAV_PROPID_activity_version_set,    DAV_PROPID_auto_merge_set,    DAV_PROPID_auto_version,    DAV_PROPID_baseline_collection,    DAV_PROPID_baseline_controlled_collection,    DAV_PROPID_baseline_controlled_collection_set,    DAV_PROPID_checked_in,    DAV_PROPID_checked_out,    DAV_PROPID_checkin_fork,    DAV_PROPID_checkout_fork,    DAV_PROPID_checkout_set,    DAV_PROPID_comment,    DAV_PROPID_creator_displayname,    DAV_PROPID_current_activity_set,    DAV_PROPID_current_workspace_set,    DAV_PROPID_default_variant,    DAV_PROPID_eclipsed_set,    DAV_PROPID_label_name_set,    DAV_PROPID_merge_set,    DAV_PROPID_precursor_set,    DAV_PROPID_predecessor_set,    DAV_PROPID_root_version,    DAV_PROPID_subactivity_set,    DAV_PROPID_subbaseline_set,    DAV_PROPID_successor_set,    DAV_PROPID_supported_method_set,    DAV_PROPID_supported_live_property_set,    DAV_PROPID_supported_report_set,    DAV_PROPID_unreserved,    DAV_PROPID_variant_set,    DAV_PROPID_version_controlled_binding_set,    DAV_PROPID_version_controlled_configuration,    DAV_PROPID_version_history,    DAV_PROPID_version_name,    DAV_PROPID_workspace,    DAV_PROPID_workspace_checkout_set,    DAV_PROPID_END};/*** Property Identifier Registration**** At the moment, mod_dav requires live property providers to ensure that** each property returned has a unique value. For now, this is done through** central registration (there are no known providers other than the default,** so this remains manageable).**** WARNING: the TEST ranges should never be "shipped".*/#define DAV_PROPID_CORE         10000   /* ..10099. defined by mod_dav */#define DAV_PROPID_FS           10100   /* ..10299.                                           mod_dav filesystem provider. */#define DAV_PROPID_TEST1        10300   /* ..10399 */#define DAV_PROPID_TEST2        10400   /* ..10499 */#define DAV_PROPID_TEST3        10500   /* ..10599 *//* Next: 10600 *//* --------------------------------------------------------------------**** DATABASE FUNCTIONS*/typedef struct dav_db dav_db;typedef struct dav_namespace_map dav_namespace_map;typedef struct dav_deadprop_rollback dav_deadprop_rollback;typedef struct {    const char *ns;     /* "" signals "no namespace" */    const char *name;} dav_prop_name;/* hook functions to enable pluggable databases */struct dav_hooks_propdb{    dav_error * (*open)(apr_pool_t *p, const dav_resource *resource, int ro,                        dav_db **pdb);    void (*close)(dav_db *db);    /*    ** In bulk, define any namespaces that the values and their name    ** elements may need.    **    ** Note: sometimes mod_dav will defer calling this until output_value    ** returns found==1. If the output process needs the dav_xmlns_info    ** filled for its work, then it will need to fill it on demand rather    ** than depending upon this hook to fill in the structure.    **    ** Note: this will *always* be called during an output sequence. Thus,    ** the provider may rely solely on using this to fill the xmlns info.    */    dav_error * (*define_namespaces)(dav_db *db, dav_xmlns_info *xi);    /*    ** Output the value from the database (i.e. add an element name and    ** the value into *phdr). Set *found based on whether the name/value    ** was found in the propdb.    **    ** Note: it is NOT an error for the key/value pair to not exist.    **    ** The dav_xmlns_info passed to define_namespaces() is also passed to    ** each output_value() call so that namespaces can be added on-demand.    ** It can also be used to look up prefixes or URIs during the output    ** process.    */    dav_error * (*output_value)(dav_db *db, const dav_prop_name *name,                                dav_xmlns_info *xi,                                apr_text_header *phdr, int *found);    /*    ** Build a mapping from "global" namespaces (stored in apr_xml_*)    ** into provider-local namespace identifiers.    **    ** This mapping should be done once per set of namespaces, and the    ** resulting mapping should be passed into the store() hook function.    **    ** Note: usually, there is just a single document/namespaces for all    ** elements passed. However, the generality of creating multiple    ** mappings and passing them to store() is provided here.    **    ** Note: this is only in preparation for a series of store() calls.    ** As a result, the propdb must be open for read/write access when    ** this function is called.    */    dav_error * (*map_namespaces)(dav_db *db,                                  const apr_array_header_t *namespaces,                                  dav_namespace_map **mapping);        /*    ** Store a property value for a given name. The value->combined field    ** MUST be set for this call.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -