thoughts on coalescing libbb/ source files

Robert P. J. Day rpjday at mindspring.com
Mon Mar 27 12:55:35 UTC 2006


  from the libbb/ README file, i can see the history of libbb:

"libbb is BusyBox's utility library.  All of this stuff used to be
stuffed into a single file named utility.c.  When I split utility.c to
create libbb, ..."

  fair enough but it seems that the breaking into separate source
files went a little too far in the other direction.  in many cases,
there are *closely* related routines that are placed in separate
source files for no obvious reason that i can see, where it would make
more sense to group tightly-related routines in a single source file.

  a perfect example would be all of the *error*.c files (defining
functions like bb_error_msg(), bb_error_msg_and_die(),
bb_herror_msg(), bb_hrror_msg_and_die(), ... and on and on.)  each of
those functions is only a few lines long but is in its own source
file, requiring the duplication of the copyright info and inclusion of
header files and "end code" stuff.

  it would seem to make more sense to pack all these error routines
into a single source file (called "bb_error.c"?) so one could, if one
wanted, peruse all of those related routines by scrolling through a
single file, no?  at the very least, i don't see any immediate
drawback to it but maybe i'm just not looking closely enough.

  there are, naturally, other possibilities.  one might combine
safe_read.c and safe_write.c to get, say, safe_io.c.  it just seems
that the libbb source files would be more manageable if there weren't
so many of them.

  thoughts?

rday



More information about the busybox mailing list