httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Anderson <...@redes.int.com.mx>
Subject Apache 1.3b3 compiled with g++, looking for a test suite.
Date Mon, 19 Jan 1998 17:07:40 GMT
A few days ago, I posted an inquiry to the list about
documentation for Apache C functions for modules, and
a C++ compilable version of Apache. Informed that neither
was available, I begin to work on my module - a gateway
to a middleware-type product. After a couple of
excruciating days trying to understand the module
processing model, and to remove and rewrite constructors,
member functions, etc. in my code, I thought it might be
easier to patch the Apache C code to compile with g++.
It took only 5 hours!

The Apache code is in very good condition. The following areas
gave g++ trouble:

1. "pool" is used at least 3 ways:
	a) struct pool { ... }
	b) typedef struct pool pool
	c) pool *pool

	I changed "struct pool" to "struct POOL",
	"typedef struct pool pool" to "typedef struct POOL Pool;",
	all possible references of "struct pool" to
	Pool, and all types from "pool" to "Pool".

2. several functions such as palloc(), get_module_config(), etc.
needed casts on their return values.

3. all uses of "new" as variable names were changed to "newer",
"delete" was changed to "deleter".

4. void pointers (including NULL) used as function arguments
were cast to the proper types.

5. functions names in command_rec initializations were cast to
(char * (*)()).

6. forward module declarations (ie: module example_module) were made
extern.

7. SERVER_BUILT[] changed to *SERVER_BUILT.

8. all the functions in the regex package needed ansi-type function
declarations.

9. the Configuration file, the htdocs, and the module code for
these modules did not match (they were changed to fit the htdocs):
	action_module changed to actions_module,
	includes_module changed to include_module,
	config_log_module changed to log_config_module.

10. a few other trivial changes.

Now the $64K question: does anyone have a test-bed for testing
all (some?, any?) of the modules and basic functionality? Seems
lynx and expect could be used for this ...


With just a few days of working with Apache, my opinion is that
the following 5 items are needed to encourage and facilitate new
module writing:
	1. C++ compilable,
	2. a good description of the server/module processing model,
	3. a better example (ie. with real commands),
	4. basic docs on available C functions,
	5. a test suite, so we know when we've broken other code.

I hope to produce something for items 2 & 3, as I work through my
own module. I probably won't use many of the existing C functions
(though I might if I knew about them) so I doubt I'll do item 4.
I'm hoping one of the multitude of Apache experts has item 5.

As for item 1, if anyone but me cares about C++ compatibility,
email me at mka@redes.int.com.mx and I'll mail the code. I began
with the 1.3b3 release, with NO patches applied, compiled on a linux
box. I'll attempt to apply the patches when I'm sure what and where
they are.

Best Regards,

-- 

Mike Anderson
mka@redes.int.com.mx
Guanajuato, GTO, Mexico

Mime
View raw message