Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Map coordinate cleanups.
Home

[Freeciv-Dev] Re: Map coordinate cleanups.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Kevin Brown <kevin@xxxxxxxxxxxxxx>
Cc: <rf13@xxxxxxxxxxxxxxxxxxxxxx>, Andreas Kemnade <akemnade@xxxxxxxxxxx>, Gaute B Strokkenes <gs234@xxxxxxxxx>, <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Map coordinate cleanups.
From: Marco Colombo <marco@xxxxxx>
Date: Thu, 16 Aug 2001 22:31:56 +0200 (CEST)

On Thu, 16 Aug 2001, Kevin Brown wrote:

> Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > > So, the rule is: in C source, call the same functions with the same names,
> > > and use different names for different functions (and, slightly different
> > > names for slightly different functions, like my_* variants). How the
> > > `ffs' function name will lead to the actual implementation it's a
> > > linker job, and the C compiler (and the C source human reader) should
> > > not be concerned (well, not while compiling/reading the module that uses 
> > > that
> > > function).
> > > I call that abstraction, too.
> >
> > Also if names are prefixed with "my_" you get an extra layer where you
> > can put code. Like the check for no memory in the malloc() case.
>
> Yep.  Basically, if what you want has different semantics (an extra
> check for out of memory conditions, for instance) than the base thing,
> then call it my_whatever().
>
> If it has the same semantics as some other function that exists on at
> least some systems, then let configure check for its existence on the
> system and put your own version somewhere in the source that will be
> used if configure fails to find it on the system.  Configure can also
> be used to check for the expected semantics, and fall back to using
> the Freeciv-supplied version if the semantics of the system function
> are different than expected.

That's precisely my point. The name depends on what the function does,
not on where, how (and why) it's implemented.

.TM.
-- 
      ____/  ____/   /
     /      /       /                   Marco Colombo
    ___/  ___  /   /                  Technical Manager
   /          /   /                      ESI s.r.l.
 _____/ _____/  _/                     Colombo@xxxxxx



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