Apache Module with D

Pragma ericanderton at yahoo.removeme.com
Mon Jan 29 09:27:22 PST 2007


Robert M. Münch wrote:
> On Fri, 26 Jan 2007 20:34:52 +0100, Pragma 
> <ericanderton at yahoo.removeme.com> wrote:
> 
>> I tried a few years ago (using DMD 0.97 I think), and didn't get very 
>> far.  The major stumbling block was figuring out how to mimic Apache's 
>> endless use for macros in the C version of their dev kit.
> 
> Hi, yes that was my impression as well. I haven't seen code that uses 
> macros in such an intense way. And, IMO this code is horrible...
> 
>> But I'm not at all saying that you're stuck with C - it's just that 
>> you won't be able to easily get away from it completely.  If I had to 
>> try this again, I'd definitely go with making a generic Apache module 
>> in C that is more easily used by D as a .lib.
> 
> What would such a generic module provide? Just hooks or some standard 
> function implementations?

You got it.  Something that would map each kind of Apache callback function to something D can consume, should net you a 
bridge that you'll never have to modify once it's working.

> 
>> That said, I know that there are a few decent tutorials out there to 
>> write Apache1 and Apache2 modules floating around out there for C.
> 
> Do you have any reference at hand? I just want to cross-check with what 
> I have found.

Well, all I did before was some very simple googling to dig these up:

http://httpd.apache.org/docs/2.0/developer/
http://threebit.net/tutorials/
http://www-128.ibm.com/developerworks/linux/library/l-apache/

another thing I did was google around for the source to some of the more simple modules like mod_rewrite.c and 
mod_cgi.c.  A longer shot, would be to drop any of the apache API calls into a code search engine (like google code 
search or koders) and manually scan the results for practical examples.

> 
>> Everything else I've ever read on the topic, came straight out of the 
>> source code comments, and a few posts scattered around on Usenet.
> 
> Ok, I haven't checked Usenet yet.

Try "apache module tutorial" on groups.google.com. ;)

> 
> Thanks for the feedback. Robert


-- 
- EricAnderton at yahoo



More information about the Digitalmars-d mailing list