[pacman-dev] Long functions and other minor fixes

Aaron Griffin aaronmgriffin at gmail.com
Tue Jan 2 11:31:28 EST 2007


On 12/29/06, James Rosten <seinfeld90 at gmail.com> wrote:
> ~ Jamie / yankees26
> * VMiklos <vmiklos at frugalware.org> [061229 22:12]:
> > why don't you just call it pkg_checker and make it static?
>
> I didn't think about that.  That is probably the
> smarter choice.  I'm sort of new the libalpm
> programming, so I haven't gotten the style down yet.

Yeah.  I'm not 100% sure of the rationale in the design doc, but
according to that writeup, "private" functions should be named _alpm_*
and "public" functions should be named alpm_*.  _However_, if a
function is entirely internal, as this one is, it should, at the very
least, be marked static (FTR this prevents gcc from adding an entry to
the symbol table of the object, which speeds loading ever so slightly
and gives us a cleaner interface in the long run).  Additionally, I
see no reason to prefer either _alpm_* for purely internal functions,
unless, of course, you expect a name collision in the future.




More information about the pacman-dev mailing list