]> granicus.if.org Git - apache/commitdiff
Provide an ap_set_deprecated() fn for quick-and-dirty 'we don't do this'
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 3 Aug 2001 00:59:01 +0000 (00:59 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 3 Aug 2001 00:59:01 +0000 (00:59 +0000)
  entries in the command table.

  (Also fixes a nit about returning a single bit of an apr_int_64 as an int.
  Know how this group loves !! expresssions :)

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

include/http_config.h
server/config.c

index 9e4a524d47a7b5fb4bd3ce52d4b944ece2f7eb7d..84903fbbfc0d6dd53ca9cc15435f85ca3a807862 100644 (file)
@@ -505,7 +505,19 @@ AP_DECLARE_NONSTD(const char *) ap_set_flag_slot(cmd_parms *cmd, void *struct_pt
  * @return An error string or NULL on success
  */
 AP_DECLARE_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, void *struct_ptr, const char *arg);
-
+/**
+ * Generic command handling function to respond with cmd->help as an error
+ * @param cmd The command parameters for this directive
+ * @param struct_ptr pointer into a given type
+ * @param arg The argument to the directive
+ * @return The cmd->help value as the error string
+ * @tip This allows simple declarations such as;
+ * <pre>
+ *     AP_INIT_RAW_ARGS("Foo", ap_set_deprecated, NULL, OR_ALL, 
+ *         "The Foo directive is no longer supported, use Bar"),
+ * </pre>
+ */
+AP_DECLARE_NONSTD(const char *) ap_set_deprecated(cmd_parms *cmd, void *struct_ptr, const char *arg);
 /**
  * For modules which need to read config files, open logs, etc. ...
  * this returns the fname argument if it begins with '/'; otherwise
index 1896d617725d6e1c86f25554f306fba9a8b28a3b..a8f1f26b5e9adff82a588eceef93309ce9efac6f 100644 (file)
@@ -362,7 +362,7 @@ AP_DECLARE(int) ap_method_is_limited(cmd_parms *cmd, const char *method) {
      * added by a module and registered.
      */
     if (methnum != M_INVALID) {
-       return  (cmd->limited & (1<<methnum));
+       return !!(cmd->limited & (1<<methnum));
     }
 
     return 0; /* not found */
@@ -1171,6 +1171,14 @@ AP_DECLARE_NONSTD(const char *) ap_set_file_slot(cmd_parms *cmd, void *struct_pt
     return NULL;
 }
 
+AP_DECLARE_NONSTD(const char *) ap_set_deprecated(cmd_parms *cmd,
+                                                 void *struct_ptr,
+                                                 const char *arg)
+{
+    /* This one's really generic... */
+    return cmd->cmd->errmsg;
+}
+
 /*****************************************************************
  *
  * Reading whole config files...