Re: Opinion on source organization needed

From: Robert Collins <robert.collins@dont-contact.us>
Date: Tue, 17 Apr 2001 08:28:15 +1000

----- Original Message -----
From: "Guido Serassio" <serassio@libero.it>
To: <squid-dev@squid-cache.org>
Sent: Tuesday, April 17, 2001 5:07 AM
Subject: Opinion on source organization needed

> Hi to all,
>
> I'm starting to work on include some WIN32 native features on the
CygWin
> Squid 2.5 port.
> The goal is to include in the code a work that can be useful for a
future
> WIN32/NT native port.
>
> So is born a question:
>
> I need to insert the inclusion of some WIN32 include files in many
source
> modules, so what is better ? include the header files in any module or
in a
> squid general header file, like squid.h ? Or use a global WIN32
include
> file, included only where needed ?

include the appropriate header files where they will be needed/used.
Protect win32 headers references with
#ifdef WIN32. (That way any future "native nt" work will get the headers
correctly).

> Obviously all code changes will be incapsulated between #ifdef
> _SQUID_CYGWIN_ #endif sections ....

Good.

> For code additions instead, there is no problem, I will use a win32.c
module.

I suggest you add
a) small code sections to the existing files.
b) large code sections as individual files for each related topic (ie if
service control manager support is more than 1-2kb in size, create
winnt_scm.c and put the support there.

For common win32-only code that you want available from several places,
and which is completely parameter driven, create new files libs area,
perhaps called win32_common.c, and have them linked into miscutil.a

Rob

> Please, tell me your opinions about.
>
> Guido Serassio
>
>
>
> -
> =======================================================
> Serassio Guido
> Via Albenga, 11/4 10134 -
Torino - ITALY
> Tel. : +39.011.610749
> E-mail: serassio@interfree.it
> serassio@libero.it
> WWW: http://serassio.interfree.it
>
>
Received on Mon Apr 16 2001 - 16:28:09 MDT

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