lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-devel] Cleaner include handling / using pbuf standalone


From: Kieran Mansley
Subject: Re: [lwip-devel] Cleaner include handling / using pbuf standalone
Date: Mon, 08 Feb 2010 14:50:25 +0000

On Mon, 2010-02-08 at 09:39 -0500, Bill Auerbach wrote:
> I have 3 points on lwIP #includes I’d like to make and maybe see
> improvements for:
> 
> 1)      When I use other 3rd party libraries or code to include in a
> project, I have rarely had to use anything but one search path in the
> compiler options to have the compiler find all of the #include files.
> With lwIP I find I have to add 3 or 4 search paths to the compiler
> options.  It sure would be nice to have one, like “lwip/src/include”
> and have that be all that’s required to find all of the files.

This is largely down to the way lwIP is distributed in two parts: the
core lwIP code and a system-dependent port.  You get header files from
the two halves.  Historically these have been kept in two separate
places in the filing system for simplicity of porting I suppose.
There's no reason why a port couldn't be done by putting all of its own
code in with the lwIP tree and so cut down on the locations of header
files, if you wanted to do things that way.

> 2)      I’m doing a new lwIP platform port and I want the low-level
> hardware driver to be as standalone as possible.  The driver needs
> only the struct pbuf declaration to be able to send and receive
> packets.  So I added #include “pbuf.h”.  But it includes opts.h and
> err.h.  pbuf.h only needs the type definitions.  It would be nice to
> include only that file.  Doing this also shows point 1 above – I had
> to add 4 search paths simply to include pbuf.h.

Can you give examples of what the four search paths you needed were?
opt.h and err.h should both be in the same location as pbuf.h

Splitting header files is usually a good idea so that code can just
import the actual bits it needs, but you reach a practical limit where
dependencies between header files get complex and cyclical. 

> 3)      Can the wiki show in what folders user’s should create and
> store sys_arch.*, cc.h, and even lwipopts.h?  It would be nice to know
> there is a consistent layout users can create for lwIP ports.

The example ports in the contrib module would be a good place to start.

Kieran 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]