Commit 24bdcb32 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  Provide an ap_set_deprecated() fn for quick-and-dirty 'we don't do this'
  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
parent 4e3615d1
Loading
Loading
Loading
Loading
+13 −1
Original line number Diff line number Diff line
@@ -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
+9 −1
Original line number Diff line number Diff line
@@ -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...