Re: [ng-spice] Main headers


To ng-spice@ieee.ing.uniroma1.it
From Arno <A.W.Peters@ieee.org>
Date Thu, 9 Sep 1999 01:14:13 +0200
Delivered-To mailing list ng-spice@ieee.ing.uniroma1.it
In-Reply-To <37D6CF28.B57F4F4C@wanadoo.fr >
Mailing-List contact ng-spice-help@ieee.ing.uniroma1.it; run by ezmlm
References <37D6CF28.B57F4F4C@wanadoo.fr >
Reply-To ng-spice@ieee.ing.uniroma1.it
User-Agent Mutt/1.0pre1i

On Wed, Sep 08, 1999 at 11:03:36PM +0200, Manu Rouat wrote:
> 
> I am trying to condense the various header files in src/include
> into 4 header files only:
> 
> ngspice.h
> defines.h 
> struct.h
> macros.h
> 
> 
> ngspice.h #includes the 3 others, plus (when finished) all header files
> in the various source directories, so that just #including ngspice.h will
> be enough for all .c files to have acces to all extern function protos they
> need , all struture definitions etc.

It is a good first step.  If you can, please add the full prototype
for the function pointers in DISPDEVICE in struct.h.

Also, can we standardize on the BSD coding style?  That is, four
spaces indents etc.  As most of the source already uses this style I
prefer we keep it also for new files that get added.

As a more comprehensive approach to the header files I propose the
following.  I would like to see the header files separated from the
source files.  They define the API the rest of the program will use
and are less subject to change once a good API is in place.  The
directory structure for the include files should mirror the structure
the libraries have now.

 lib
   ckt
   cp
   dev
   fte
   ...
 include
   ckt
   cp
   dev
   fte
   ...

Each include directory should have a global include file such as
fte.h.  Using the FTE routines in a source file can be done by
including only one line:

  #include <fte/fte.h>

or

  #include <dev/bsim3/bsim3.h>


(note the use of <> instead of "")

This also assures that once we install the header files under
/usr/local/include they will not conflict with other libraries and are
nicely separated into their own subdirectories.  A nice side effect of
this approach is also that we don't have to specify zillions of -I
switches to the compiler to find all the header files, we only need to
specify the top level include directory.

Comments?

-- 
Arno

Partial thread listing: