collecting related functions into a single source file

Robert P. J. Day rpjday at mindspring.com
Wed May 10 17:23:14 UTC 2006


On Wed, 10 May 2006, Rob Landley wrote:

> 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.)

oh, i realize how it's done.

> 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...)

i'm sure i posted a short solution to that a while back -- a simple
pattern match in the makefile.  i'll go back thru the archives and see
if i can find it but i could have sworn i mocked up some code to do
just that.

rday



More information about the busybox mailing list