9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] locatefn
@ 2004-03-10 12:01 Tiit Lankots
  2004-03-10 15:45 ` Fco.J.Ballesteros
  0 siblings, 1 reply; 2+ messages in thread
From: Tiit Lankots @ 2004-03-10 12:01 UTC (permalink / raw)
  To: Plan 9 Mailing List (E-mail)

While developing, I found myself constantly needing to locate
definitions of functions in a diverse source tree, so I wrote
the following function. If I've reinvented the wheel, please
let me know.

fn locatefn {
	fun=$1
	shift
	if (~ $#* 0) dirs=(.)
	if not dirs=$*
	for (dir in $dirs) {
		files=`{eval echo `{subdirs $dir}^'/*.c'}
		grep -n '^'$fun'\(' /dev/null $files >[2] /dev/null
	}
} 

Tiit


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-03-10 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-10 12:01 [9fans] locatefn Tiit Lankots
2004-03-10 15:45 ` Fco.J.Ballesteros

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).