Re: Organisation of C programs

From: Rowland (banksr0_at_hotmail.com)
Date: 07/28/04


Date: Wed, 28 Jul 2004 14:40:07 +0000 (UTC)


"Thomas Matthews" <Thomas_MatthewsSpitsOnSpamBots@sbcglobal.net> wrote in
message news:htONc.1120$uC7.1051@newssvr19.news.prodigy.com...
> Richard Evans wrote:
>
<snip>
> > So now I am looking for resources describing how to layout and
> > organize the parts of a program into subdirectories, how to
> > include exported library headers, local headers and the overall
> > collection of common includes, include guards, and preprocessor
> > statements.
> >
<snip>
> This becomes a religious issue: everybody has their own
> belief as to what is correct.
>
> A common layout is:
> Project
> |
> +-------
> | |
> docs source
> |
> ----- include
> Where the source contains all the ".c" files and the
> include contains all the ".h" or header files.
>
> I favor grouping by theme:
>
> |
> +-------------+---+----+--------+------------->
> | | | |
> utilities Flash UART Containers
>
> In my opinion, this allows for better reuse of code.
> Just point the search path to the correct directories.
> I believe that processor specific code should be in
> sub-directories under the themes (such as utilities
> using processor specific features or assembly language).
>
> I've only had one shop agree to to this. Most prefer to
> dump all the files into one directory per project. That
> way all the files can be easily duplicated for another
> project (that is their definition of code reuse).
>
> --
> Thomas Matthews
>
I really like that, and think I might start doing it that way in future.
I've always tended to do it on a per-project basis, like you first
described. I would store all my projects in their own subdirectories of
\dev\null, but, as you say, code-reuse was impossible...



Relevant Pages

  • Minnesota Transfer layout - update
    ... > Stein in Norway ... what is going on with this layout. ... The yard will be flat switching, long enough yard drill track, 8 ...
    (rec.models.railroad)
  • Re: Please criticize my website.
    ... I design pages using FireFox and Opera as main browser to check out how ... After layout is pretty much done, ... layout work this way than testing in IE first, ...
    (alt.html)
  • Re: jsplitpane - set divider location ??
    ... I believe the problem is in the BasicSplitPaneUI. ... always been disappointed with the behaviour of the JSplitPane and I ... // is no way to determine when the layout process has completed. ...
    (comp.lang.java.programmer)
  • Re: To UL or not to UL
    ... dorayme wrote: ... in a 2 col table with only one row, used for layout, would satisfy this unless the definition was longer and more complex. ...
    (alt.html)