[haiku-development] Re: Coding style conflicting with API

  • From: Axel Dörfler <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sun, 18 Nov 2012 14:58:53 +0100

On 11/18/2012 01:41 PM, Jonathan Schleifer wrote:
Am 18.11.2012 um 13:19 schrieb Ingo Weinhold:
Using the k* style for constants doesn't have much to do with the 
all-upper-case style
looking aged. I believe the convention stems from the OpenTracker coding style, 
which
our current coding style has been derived from. I guess the purpose of the 
different
style for constants is that they can be discriminated from macros.
Is this coding style already set in stone, or can we still adjust this to make 
an exception
for constants that are part of an API?

AFAIK all public API that we added follows the BeOS style, so this is already the status quo. Besides that, the coding style is not set in stone; it just makes sense to keep most of it as is, as changes would require lots of changes in the source code -- most of it should follow our current style by now :-)

There are other namespace issues, BTW. All C functions and structures pollute 
the public
namespace, so they really should be renamed.

The same could be said about POSIX. They pollute the global namespace, and so do we. I think all we can do about this is exporting only weak symbols. Renaming would work, too, but I'm not sure this really is a necessity.

Are there some coming from BeOS that have no prefix?

The C API is not using any prefix, ie. a semaphore is created by create_sem(), the structure to get info about a semaphore is called sem_info, etc.

Bye,
   Axel.


Other related posts: