Re: A programming style question

From: Duane Wessels <wessels@dont-contact.us>
Date: Wed, 12 Jan 2000 15:09:09 -0700

On Wed, 12 Jan 2000, Yee Man Chan wrote:

> Hi,
>
> I find that all .c files in the src directory of 2.2S5 or 2.3S1 only includes
> squid.h. And squid.h includes protos.h, enums.h, etc. I am just curious why
> squid choose to include in this way in favor of the old fashion: (arguably
> more widely used) one .h for one .c, so u have put those #ifndef .... #endif
> in each .h? Can anyone tell me the advantages and disadvantages of these two
> styles?

This was my doing.

Previously, the .h files were confusing because some structures had
cross references. After making changes, I was often required to
re-order the list of .h files so that it would compile.

I found it was much easier to manage by listing all enums and typedefs
before structs and prototypes.
Received on Wed Jan 12 2000 - 14:09:40 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:12:20 MST