Back in November, we briefly discussed an expression parser
as a core httpd feature[1].
I've now gone ahead and abstracted the expression parser
from mod_include, as far as I can without breaking
back-compatibility in the optional functions mod_include
exports (with include_ctx_t in their args). For future
versions (3.0 if not 2.4), I think we should also abstract
out the variable interpolation and standardise that
across everywhere we parse expressions.
Applications for this I currently have in mind include
mod_filter (see PR#43956 - fix it to do what the original
reporter and others wanted), and dynamic configuration
(proposal to follow; looking to the hackathon).
Attached for review:
ap_expr.h
ap_expr.c
Patch to mod_include to use it.
As you'll see, the debug stuff is still there, but I haven't
taken the trouble to make it work. The updated mod_include
passes everything in the test suite.
--
Nick Kew
Application Development with Apache - the Apache Modules Book
http://www.apachetutor.org/
|