collecting related functions into a single source file

Rob Landley rob at landley.net
Wed May 10 17:02:20 UTC 2006


On Wednesday 10 May 2006 11:53 am, Robert P. J. Day wrote:
>   the same with routines related to string operations, such as
> chomp(), trim(), last_char_is(), skip_whitespace() and perhaps all of
> the safe_str* routines.  why not a single source file called, perhaps,
> string_ops.c.  it's hard to defend chomp() or trim() deserving their
> own source file.
>
>   thoughts?  obviously, it doesn't end there.

Right now the makefile is hardwired to have a list of symbols it gets out of a 
given file, and the makefile has to be updated when the file is.  (See 
libbb/Makefile.in for the llist_* stuff set into MOBJ6.)

If we collate much more, I'd like some automatic way to get the list of 
symbols out of the file.  (I note that for llist.c at least, "sed -n 
's/^#ifdef L_//p' llist.c" seems to works pretty well at the moment...)

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list