You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rob Hartill <ro...@imdb.com> on 1996/03/27 15:26:54 UTC
Remarks on Apache code (fwd)
No ack sent.
Message-Id: <19...@chryso.nsl.fr>
Subject: Remarks on Apache code
To: apache-bugs@apache.org
Date: Wed, 27 Mar 1996 11:24:07 +0100 (MET)
Reply-To: sh@nsl.fr
From: Sonia Heimann <sh...@nsl.fr>
Organization: Non Standard Logics S.A.
(Note : I already submitted this via the WWW bug report page, but had no
feedback. The same day, my subscription to apache-announce seemed to get
lost in cyberspace, so maybe the bug report too got lost)
So, this is not a bug report, just comments on problems I had while writing a
complicated C++ module. (and, congratulations for this apache extension
scheme, it's really great)
1- Your include files are not protected against self-inclusion, for example
httpd.h should read
#ifndef _HTTPD_H_
#define _HTTPD_H_
(real httpd.h code)
#endif
2- Since I compiled in C++ and had to put some extern "C" around the apache
includes I made, some things could no longer compile.
The main problem was with "struct pool".
(btw, in some places of the code, you refer to it as "struct pool",
sometimes as "pool", OK, it's the same since it's typedef'ed, but ... it's
not very nice.)
I could not make the lines like
pool * pool;
compile. (they are found in the typedefs for request_rec if I remember
well). And anyway, it's no very good to name a type, a typedef'ed type and a
variable the same name ...
I then renamed the structure as _pool_t, then typedef struct _pool_t pool_t,
and the problems disappeared.
3- #define OK 0. Tell me you didn't *really* mean this...
This broke one of my include files, who had the bad idea of having an OK as
a class method name :(. If the only purpose of this OK is for handlers
response, then please call it HANDLED, or APACHE_OK, or whatever you want,
but not just, simple, plain OK.
4- By the way, are there any plans to make Apache a C++ program, and have
modules as a class with virtual methods for handlers, and derive this class
to create new modules? :-) (just dreaming...)
Regards,
--
+ _ | "Cap'tain, the voltmeter shows a 3
++ /\/ / /-\ | ohm change in the magnetic field of
| the planet!" -- Star Trek
----- End of forwarded message from Sonia Heimann -----