Re: confoig.h squid.h design

From: Amos Jeffries <squid3@dont-contact.us>
Date: Mon, 28 Apr 2008 14:03:28 +1200 (NZST)

> On Mon, 2008-04-28 at 11:17 +1200, Amos Jeffries wrote:
>> > 1) config.h includes the autogenerated configuration file and does
>> > virtually nothing else
>> >
>> > 2) squid.h includes config.h and does virtually nothing else.
>> >
>>
>> Right. To be blunt and as simple as possible.
>>
>> Where does "squid_types.h" get included when every file in squid needs
>> "uint32_t" ??
>
> squid.h
>
> and only if every source file in squid really needs it.
>
>> THEN, where does "squid_mswin.h" get included for the same type
>> definition in windows?
>
> squid_types.h
>
> because the code should be platform-independent to the extent possible
> and should not care which platform it is being compiled on. OS-specific
> hacks should be pushed as deep down as possible so that almost nobody
> has to care about them.
>
>> (NP: mswin (rightly!) setups more than types...)
>
> Not sure what you mean, but we should have one .h file per type (or
> "concept" or related group of types).
>
>> Methinks squid_mswin.h goes in config.h and squid_types.h goes in
>> squid_mswin.h (and other OS-specifics)
>
> I think that would be wrong (but not a big deal). Universal type or
> concept trumps OS-specific hacks. The main code that needs that
> universal type should include the corresponding "universal" header (like
> squid_types.h). That header may include OS-specific hacks as needed.

Which would be my #2 design. The more I think about it, the more it seems
it is the right thing to do.

Thanks for the feedback and things to think about.
I'm off to do more shuffling and see how it works.

Amos
Received on Mon Apr 28 2008 - 02:03:33 MDT

This archive was generated by hypermail 2.2.0 : Wed Apr 30 2008 - 12:00:07 MDT