bug-hurd
[Top][All Lists]
Advanced

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

Internal library naming conventions


From: Igor Khavkine
Subject: Internal library naming conventions
Date: Sun, 17 Jun 2001 01:43:26 -0400
User-agent: Mutt/1.3.18i

This is just a curiosity question and could be a bit of topic.
Why is it that most libraries (like glibc) prefix all their
functions with __. Even the ones that will eventually be exported.
I've come up with two possible reasons:

1) avoid global namespace polution. This can also be avoided
by grouping more functions into files and declaring some of then
static.
2) avoid problems with interposing. So that when a user defines
a function of the same name the internals of the library are
not affected because it uses the same function but with __ in
front of it.

Which one of these reasons most relevant? Are there other ones?

Thanks.




reply via email to

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