You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by David Goeke <da...@flame.org> on 1998/08/18 21:36:05 UTC

[patch] mod_include macros

I've included with this a small patch to mod_include to allow macros to be
created and executed via 'define' and 'macro' directives.  This is
something I've been looking around for for a long time and never found
adequate support for, so eventually came down to the
if-you-want-something-done-do-it-yourself philosophy.

This is a preliminary version that I'm posting mostly because I'd like to
hear comments first on whether or not this is a good idea at all, and then
on the code.  This is the literally the first thing I've ever written for
apache, and I've learned everything I know since about this time
yesterday, so there are probably better ways to do some things, with
internal apache functions.  So, while the code is good and stable IMHO,
there are probably people who can improve it.

The one thing I feel is missing from this patch is the ability to embed
shtml inside the macro, but, as I mentioned, I'm very new to apache
coding, and the few ways I can think of to accomplish this wouldn't be
very good.

Anyway, macros are created and stored in normal variables in a way *very*
similar to the normal 'set' directive, except variables aren't parsed.
When called later with the 'macro' directive, given arguments are parsed
into ircii-like variables ($1, $1-, $2, $2-, etc), and any variables in
the string are parsed at that time.

Again, I consider myself a good coder, but am too new at apache to think
this will go through without being fixed, so please post comments 
privately and/or on this list.

-- David Goeke
david@flame.org