]> granicus.if.org Git - apache/commitdiff
In some application environments, the mod_dav hook structures are
authorGreg Stein <gstein@apache.org>
Thu, 25 Jul 2002 21:56:05 +0000 (21:56 +0000)
committerGreg Stein <gstein@apache.org>
Thu, 25 Jul 2002 21:56:05 +0000 (21:56 +0000)
allocated dynamically. The structures need a context pointer to
represent that dynamic "object", so a pointer was added to the end of
each of the more important structures.

While providers don't need to add this field to their structures (it
will default to NULL), I went ahead and added it to mod_dav_fs for
clarity.

No MMN bump is required because Apache does not use/examine the
fields (only the provider will set and use them).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@96195 13f79535-47bb-0310-9956-ffa450edef68

modules/dav/fs/dbm.c
modules/dav/fs/lock.c
modules/dav/fs/repos.c
modules/dav/main/mod_dav.h

index d31ca26d169a3cc5607334b5757482098c17e05a..ccc66644c8e8420b000ea5898d94b6d917134d7e 100644 (file)
@@ -789,4 +789,6 @@ const dav_hooks_db dav_hooks_db_dbm =
     dav_propdb_next_name,
     dav_propdb_get_rollback,
     dav_propdb_apply_rollback,
+
+    NULL /* ctx */
 };
index 1185af2a32e0d2b9f0b0bef041faed89ce4328df..02a8518dd755618e0312e8606331c27183b4f8ec 100644 (file)
@@ -1549,5 +1549,7 @@ const dav_hooks_locks dav_hooks_locks_fs =
     dav_fs_append_locks,
     dav_fs_remove_lock,
     dav_fs_refresh_locks,
-    NULL, /* get_resource */
+    NULL, /* lookup_resource */
+
+    NULL /* ctx */
 };
index cb34b3e17d64a6c97415223975bba468cfa9bdc6..661e61201efc0996d192c4d1a295fc2ec9fceb11 100644 (file)
@@ -2098,7 +2098,9 @@ static const dav_provider dav_fs_provider =
     &dav_hooks_locks_fs,
     NULL,               /* vsn */
     NULL,               /* binding */
-    NULL                /* search */
+    NULL,               /* search */
+
+    NULL                /* ctx */
 };
 
 void dav_fs_gather_propsets(apr_array_header_t *uris)
index 4793c3f6fd5351f357b4d78c0353d436fb33b03f..47b7281cdec2a86c43f31d87df89f286aa920a44 100644 (file)
@@ -606,6 +606,10 @@ DAV_DECLARE(void) dav_xmlns_generate(dav_xmlns_info *xi,
 ** are handled through the APR_HOOK interface (to allow for multiple liveprop
 ** providers). The core always provides some properties, and then a given
 ** provider will add more properties.
+**
+** Some providers may need to associate a context with the dav_provider
+** structure -- the ctx field is available for storing this context. Just
+** leave it NULL if it isn't required.
 */
 typedef struct {
     const dav_hooks_repository *repos;
@@ -614,6 +618,8 @@ typedef struct {
     const dav_hooks_vsn *vsn;
     const dav_hooks_binding *binding;
     const dav_hooks_search *search;
+
+    void *ctx;
 } dav_provider;
 
 /*
@@ -858,6 +864,12 @@ struct dav_hooks_liveprop
                                  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;
 };
 
 /*
@@ -1135,6 +1147,12 @@ struct dav_hooks_propdb
                                 dav_deadprop_rollback **prollback);
     dav_error * (*apply_rollback)(dav_db *db,
                                   dav_deadprop_rollback *rollback);
+
+    /*
+    ** 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;
 };
 
 
@@ -1481,6 +1499,12 @@ struct dav_hooks_locks
                                   const dav_locktoken *locktoken,
                                   const dav_resource *start_resource,
                                   const dav_resource **resource);
+
+    /*
+    ** 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;
 };
 
 /* what types of resources can be discovered by dav_get_resource_state() */
@@ -1921,6 +1945,12 @@ struct dav_hooks_repository
 
     /* Get the entity tag for a resource */
     const char * (*getetag)(const dav_resource *resource);
+
+    /*
+    ** 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;
 };
 
 
@@ -2310,6 +2340,12 @@ struct dav_hooks_vsn
                         int no_auto_merge, int no_checkout,
                         apr_xml_elem *prop_elem,
                         ap_filter_t *output);
+
+    /*
+    ** 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;
 };
 
 
@@ -2334,6 +2370,12 @@ struct dav_hooks_binding {
     dav_error * (*bind_resource)(const dav_resource *resource,
                                 dav_resource *binding);
 
+    /*
+    ** 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;
+
 };
 
 
@@ -2366,6 +2408,12 @@ struct dav_hooks_search {
     dav_error * (*search_resource)(request_rec *r,
                                   dav_response **response);
 
+    /*
+    ** 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;
+
 };