]> granicus.if.org Git - apache/commitdiff
some stylistic tweaks post- John's patch
authorGreg Stein <gstein@apache.org>
Sat, 20 Jan 2001 11:29:35 +0000 (11:29 +0000)
committerGreg Stein <gstein@apache.org>
Sat, 20 Jan 2001 11:29:35 +0000 (11:29 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87758 13f79535-47bb-0310-9956-ffa450edef68

modules/dav/fs/repos.c
modules/dav/main/mod_dav.c
modules/dav/main/mod_dav.h
modules/dav/main/props.c
modules/dav/main/std_liveprop.c

index 913067d591f3cf68729d66b6ec12bc6f63aac5cc..f9ac747ff37cc89b1bf6bb99efccbefcd81b5645 100644 (file)
@@ -1814,8 +1814,9 @@ static dav_prop_insert dav_fs_insert_prop(const dav_resource *resource,
     }
     else {
         /* assert: what == DAV_PROP_INSERT_SUPPORTED */
-        s = apr_psprintf(p, "<supported-live-property name=\"%s\""
-                            " namespace=\"%s\" xmlns=\"DAV:\"/>" DEBUG_CR,
+        s = apr_psprintf(p,
+                         "<D:supported-live-property D:name=\"%s\" "
+                         "D:namespace=\"%s\"/>" DEBUG_CR,
                          info->name, dav_fs_namespace_uris[info->ns]);
     }
     ap_text_append(p, phdr, s);
@@ -1903,7 +1904,7 @@ static dav_error *dav_fs_patch_validate(const dav_resource *resource,
 
 }
 
-static dav_error *dav_fs_patch_exec(dav_resource *resource,
+static dav_error *dav_fs_patch_exec(const dav_resource *resource,
                                    const ap_xml_elem *elem,
                                    int operation,
                                    void *context,
@@ -1938,7 +1939,7 @@ static dav_error *dav_fs_patch_exec(dav_resource *resource,
     return NULL;
 }
 
-static void dav_fs_patch_commit(dav_resource *resource,
+static void dav_fs_patch_commit(const dav_resource *resource,
                                int operation,
                                void *context,
                                dav_liveprop_rollback *rollback_ctx)
@@ -1946,7 +1947,7 @@ static void dav_fs_patch_commit(dav_resource *resource,
     /* nothing to do */
 }
 
-static dav_error *dav_fs_patch_rollback(dav_resource *resource,
+static dav_error *dav_fs_patch_rollback(const dav_resource *resource,
                                        int operation,
                                        void *context,
                                        dav_liveprop_rollback *rollback_ctx)
index 3fe03d223be732c3d71e9ee161c9770f54187500..fd525289878ee8463dbcfa430820ea05ffc50904 100644 (file)
@@ -1342,14 +1342,14 @@ static dav_error *dav_gen_supported_live_props(request_rec *r,
     if ((err = dav_open_lockdb(r, 0, &lockdb)) != NULL) {
        return dav_push_error(r->pool, err->status, 0,
                              "The lock database could not be opened, "
-                             "preventing report of supported lock properties.",
+                             "preventing the reporting of supported lock "
+                              "properties.",
                              err);
     }
 
     /* open the property database (readonly) for the resource */
-    if ((err = dav_open_propdb(r, lockdb,
-                              (dav_resource *)resource, 1,
-                               NULL, &propdb)) != NULL) {
+    if ((err = dav_open_propdb(r, lockdb, resource, 1, NULL,
+                               &propdb)) != NULL) {
         if (lockdb != NULL)
             (*lockdb->hooks->close_lockdb)(lockdb);
 
@@ -1388,8 +1388,9 @@ static dav_error *dav_gen_supported_live_props(request_rec *r,
 
                 if (name == NULL) {
                     err = dav_new_error(r->pool, HTTP_BAD_REQUEST, 0,
-                                        "A DAV:supported-live-property element "
-                                        "does not have a \"name\" attribute");
+                                        "A DAV:supported-live-property "
+                                        "element does not have a \"name\" "
+                                        "attribute");
                     break;
                 }
 
@@ -1433,10 +1434,10 @@ static dav_error *dav_gen_supported_reports(request_rec *r,
 
         if ((err = (*vsn_hooks->avail_reports)(resource, &reports)) != NULL) {
            return dav_push_error(r->pool, err->status, 0,
-                                "DAV:supported-report-set could not be determined "
-                                 "due to a problem fetching the available reports "
-                                 "for this resource.",
-                                err);
+                                  "DAV:supported-report-set could not be "
+                                  "determined due to a problem fetching the "
+                                  "available reports for this resource.",
+                                  err);
         }
 
         if (reports != NULL) {
@@ -1664,6 +1665,8 @@ static int dav_method_options(request_rec *r)
         }
         else if (resource->working) {
             apr_table_addn(methods, "CHECKIN", "");
+
+            /* ### we might not support this DeltaV option */
             apr_table_addn(methods, "UNCHECKOUT", "");
         }
         else if (vsn_hooks->add_label != NULL) {
@@ -1819,8 +1822,7 @@ static dav_error * dav_propfind_walker(dav_walk_resource *wres, int calltype)
     ** Note: we cast to lose the "const". The propdb won't try to change
     ** the resource, however, since we are opening readonly.
     */
-    err = dav_open_propdb(ctx->r, ctx->w.lockdb,
-                         (dav_resource *)wres->resource, 1,
+    err = dav_open_propdb(ctx->r, ctx->w.lockdb, wres->resource, 1,
                          ctx->doc ? ctx->doc->namespaces : NULL, &propdb);
     if (err != NULL) {
        /* ### do something with err! */
index a58bb8acce033e3c42d3a164d083951e75e63ca7..6d553692d8aea44813c98a50bc2647405f5d6063 100644 (file)
@@ -497,8 +497,8 @@ typedef enum {
                                   resource (it may be present as a dead
                                   property). */
     DAV_PROP_INSERT_NOTSUPP,    /* property is recognized by this provider,
-                                 * but it is not supported, and cannot be
-                                 * treated as a dead property */
+                                   but it is not supported, and cannot be
+                                   treated as a dead property */
     DAV_PROP_INSERT_NAME,      /* a property name (empty elem) was
                                   inserted into the text block */
     DAV_PROP_INSERT_VALUE,     /* a property name/value pair was inserted
@@ -707,10 +707,10 @@ struct dav_hooks_liveprop
     **      a DAV:supported-live-property element, as defined
     **      by the DeltaV extensions to RFC2518.
     **                      
-    ** Providers should return DAV_PROP_INSERT_NOTDEF if they do not define
-    ** the specified propid, but allow the property to be handled as a
-    ** dead property. If a provider recognizes, but does not support,
-    ** property, and does not want it handled as a dead property, it should
+    ** 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.
@@ -778,20 +778,20 @@ struct dav_hooks_liveprop
                                  int *defer_to_dead);
 
     /* ### doc... */
-    dav_error * (*patch_exec)(dav_resource *resource,
+    dav_error * (*patch_exec)(const dav_resource *resource,
                              const ap_xml_elem *elem,
                              int operation,
                              void *context,
                              dav_liveprop_rollback **rollback_ctx);
 
     /* ### doc... */
-    void (*patch_commit)(dav_resource *resource,
+    void (*patch_commit)(const dav_resource *resource,
                         int operation,
                         void *context,
                         dav_liveprop_rollback *rollback_ctx);
 
     /* ### doc... */
-    dav_error * (*patch_rollback)(dav_resource *resource,
+    dav_error * (*patch_rollback)(const dav_resource *resource,
                                  int operation,
                                  void *context,
                                  dav_liveprop_rollback *rollback_ctx);
@@ -1355,7 +1355,7 @@ typedef struct dav_propdb dav_propdb;
 dav_error *dav_open_propdb(
     request_rec *r,
     dav_lockdb *lockdb,
-    dav_resource *resource,
+    const dav_resource *resource,
     int ro,
     apr_array_header_t *ns_xlate,
     dav_propdb **propdb);
index e529deac3b203e3db3541f55a9512dd4b6b4da51..58b369c0008d55f7c39764edca878cea29f6bbf3 100644 (file)
@@ -250,7 +250,7 @@ struct dav_propdb {
     apr_pool_t *p;             /* the pool we should use */
     request_rec *r;            /* the request record */
 
-    dav_resource *resource;    /* the target resource */
+    const dav_resource *resource;      /* the target resource */
 
     int deferred;              /* open of db has been deferred */
     dav_db *db;                        /* underlying database containing props */
@@ -375,6 +375,8 @@ static void dav_find_liveprop(dav_propdb *propdb, ap_xml_elem *elem)
 
     priv->propid = dav_find_liveprop_provider(propdb, ns_uri, elem->name,
                                               &hooks);
+
+    /* ### this test seems redundant... */
     if (priv->propid != DAV_PROPID_CORE_UNKNOWN) {
         priv->provider = hooks;
     }
@@ -921,7 +923,7 @@ static dav_error *dav_really_open_db(dav_propdb *propdb, int ro)
 }
 
 dav_error *dav_open_propdb(request_rec *r, dav_lockdb *lockdb,
-                          dav_resource *resource,
+                          const dav_resource *resource,
                           int ro,
                           apr_array_header_t * ns_xlate,
                           dav_propdb **p_propdb)
@@ -1228,7 +1230,8 @@ dav_get_props_result dav_get_props(dav_propdb *propdb, ap_xml_doc *doc)
         }
 
        /*
-       ** If not handled as a live property, look in the dead property database
+       ** If not handled as a live property, look in the dead property
+        ** database.
        */
         if (!is_liveprop) {
             /* make sure propdb is really open */
index 01b6b925af9cb2f80917fdd50cbd6207b758f5fa..d730ee0ca4285a758311211481598b7b0b1554b4 100644 (file)
@@ -160,11 +160,12 @@ static dav_prop_insert dav_core_insert_prop(const dav_resource *resource,
     /* assert: info != NULL && info->name != NULL */
 
     if (what == DAV_PROP_INSERT_SUPPORTED) {
-        s = apr_psprintf(p, "<supported-live-property name=\"%s\""
-                            " namespace=\"%s\" xmlns=\"DAV:\"/>" DEBUG_CR,
+        s = apr_psprintf(p,
+                         "<D:supported-live-property D:name=\"%s\" "
+                         "D:namespace=\"%s\"/>" DEBUG_CR,
                          info->name, dav_core_namespace_uris[info->ns]);
     }
-       else if (what == DAV_PROP_INSERT_VALUE && *value != '\0') {
+    else if (what == DAV_PROP_INSERT_VALUE && *value != '\0') {
         s = apr_psprintf(p, "<lp%d:%s>%s</lp%d:%s>" DEBUG_CR,
                          global_ns, info->name, value, global_ns, info->name);
     }