is there a naming convention for libbb files/routines?

Robert P. J. Day rpjday at mindspring.com
Mon Mar 27 08:35:06 PST 2006


  (while i'm being annoyingly pedantic, might as well just get it out
of my system.)

  is there some sort of naming convention for both files and functions
in libbb, since what's there seems confusingly inconsistent.

  in some cases, a source file has exactly the same (generic) name as
its function, such as chomp() being defined in the source file
"chomp.c".  fair enough.

  in some cases, the function name will *not* exactly match the source
file name -- witness the source file "mtab.c" which defines only the
function erase_mtab().  so why not "erase_mtab.c"?  no big deal,
though.  onward.

  in many cases, function or file names have a "bb_" prefix, such as
"bb_askpass()" being defined in "bb_askpass.c".  why the sudden need
for a "bb_" prefix in some places but not others?

  slightly different are cases where the routine has the prefix but
the source file *doesn't* -- "bb_xgetlarg()" is defined in the source
file "xgetlarg.c".  any reason for the difference here?

  in yet another case, the difference is subtle -- the source file
"bb_asprint.f" defines the routine "bb_xasprintf()".  huh?
                                       ^

  and, finally, there is the variety of things that start with "x".
what's *that* all about?  especially given that some of those source
files will define routines with a "bb_" prefix and some not.

  i realize all of this sounds nitpicky but, given that one of the
best ways to understand the workings of BB is to RTFS, it would make
life easier if TFS was a little more self-explanatory.

  thoughts?

rday


More information about the busybox mailing list