On Wed, 2008-04-23 at 16:31 +1200, Amos Jeffries wrote: > First step is to generate a new folder, for this proposal I'll call it > 'squidbits'.
How about squidsquidsquidbits, to make sure we all realize this is a squid header file? Seriously, I would prefer just "bits". If we must put squid inside squid, then please use squid_bits to make the name readable. > It would eventually reside in Alex's ./compat directory as > ./compat/squidbits. and is modelled on the kernel bits folder insofar as > nothing around squid is supposed to reference it directly and it contains > all the 'expert only' compat and type setup code needed. > > That sub-directory would contain a file for each OS requiring OS-specific > tuning. > * squidbits/mswin.h > * squidbits/bsd.h (shared *BSD tuning) > * squidbits/linux.h (shared 'nix tuning) > * squidbits/freebsd.h (FreeBSD-only tuning) > > And some bits-files for specific tuning. > * squidbits/fdsetsize.h (for the global FD_SETSIZE logics currently in > config.h) > * squidbits/resinit.h (for the global res_init logics currently in config.h) > * others maybe for logics currently in squid.h I am not sure we really need the compat/bits, but I am not against it. What will happen is that you will have to place two-line wrappers in compat/ so that the rest of the code can get access to some of the stuff in compat/bits/. That's not a big deal. > Secondly migrating the existing config.h to do a guaranteed short sequence > of actions: > * include autoconf.h (autotools generated settings) > * include version.h (release maintainer generated settings) > * define OS-specific macros (ie #define _SQUID_FREEBSD_) > * include squidbits/types.h (currently squid_types.h) > * include squidbits/* for each OS. > > It already has the first 4 sections, but the last section about squidbits > will be added in place of the existing direct-code which has so muddled > squid.h and is already starting to grow in config.h > > This means config.h guaranteed: > * is the ONLY place to include anything from squidbits/* > * can be placed cleanly at the top of every .cc > * stays clean of any lengthy compat code in itself > > > Finally, is to seamlessly rename (squid.h -> old_dirty_squid.h) and > (config.h -> squid.h) > then continue the cleanups removing stuff from old_dirty_squid.h Sounds good to me. Thank you, Alex.
