* receiving its own per-install context pointer.
*
* Callbacks are associated with a filter definition, which is specified
- * by name. See ap_register_filter() for setting the association between
- * a name for a filter and its associated callback (and other information).
+ * by name. See ap_register_input_filter() and ap_register_output_filter()
+ * for setting the association between a name for a filter and its
+ * associated callback (and other information).
*
* The *bucket structure (and all those referenced by ->next and ->prev)
* should be considered "const". The filter is allowed to modify the
API_EXPORT(apr_status_t) ap_pass_brigade(ap_filter_t *filter, ap_bucket_brigade *bucket);
/*
- * ap_register_filter():
+ * ap_register_input_filter():
*
- * This function is used to register a filter with the system. After this
- * registration is performed, then a filter may be added into the filter
- * chain by using ap_add_filter() and simply specifying the name.
+ * This function is used to register an input filter with the system.
+ * After this registration is performed, then a filter may be added
+ * into the filter chain by using ap_add_filter() and simply specifying
+ * the name.
*
* The filter's callback and type should be passed.
*/
API_EXPORT(void) ap_register_input_filter(const char *name,
ap_filter_func filter_func,
ap_filter_type ftype);
+/*
+ * ap_register_output_filter():
+ *
+ * This function is used to register an output filter with the system.
+ * After this registration is performed, then a filter may be added
+ * into the filter chain by using ap_add_filter() and simply specifying
+ * the name.
+ *
+ * The filter's callback and type should be passed.
+ */
/**
* Register an output filter for later use. This allows modules to name their
* filter functions for later addition to a specific request
return APR_SUCCESS;
}
-static void ap_register_filter(const char *name,
- ap_filter_func filter_func,
- ap_filter_type ftype,
- ap_filter_rec_t *reg_filter_list)
+static void register_filter(const char *name,
+ ap_filter_func filter_func,
+ ap_filter_type ftype,
+ ap_filter_rec_t **reg_filter_list)
{
ap_filter_rec_t *frec = apr_palloc(FILTER_POOL, sizeof(*frec));
frec->filter_func = filter_func;
frec->ftype = ftype;
- frec->next = reg_filter_list;
- reg_filter_list = frec;
+ frec->next = *reg_filter_list;
+ *reg_filter_list = frec;
apr_register_cleanup(FILTER_POOL, NULL, filter_cleanup, apr_null_cleanup);
}
API_EXPORT(void) ap_register_input_filter(const char *name,
- ap_filter_func filter_func,
- ap_filter_type ftype)
+ ap_filter_func filter_func,
+ ap_filter_type ftype)
{
- ap_register_filter(name, filter_func, ftype,
- registered_input_filters);
+ register_filter(name, filter_func, ftype,
+ ®istered_input_filters);
}
API_EXPORT(void) ap_register_output_filter(const char *name,
- ap_filter_func filter_func,
- ap_filter_type ftype)
+ ap_filter_func filter_func,
+ ap_filter_type ftype)
{
- ap_register_filter(name, filter_func, ftype,
- registered_output_filters);
+ register_filter(name, filter_func, ftype,
+ ®istered_output_filters);
}
API_EXPORT(void) ap_add_filter(const char *name, void *ctx, request_rec *r)