2010年8月23日月曜日

EMACS function list in c source file

char foo (int a, int b)
unsigned int bar(int a, int b)
static unsigned short foobar (int a)

grep -nH -x -P "^([\w\d]+|[\w\d]+\s+[\w\d]+|[\w\d]+\s+[\w\d]+\s+[\w\d]+)\s+(.+)\s*\(.+\)\s*$" filename
-n, --line-number print line number with output lines
-H, --with-filename print the filename for each match
-x, --line-regexp force PATTERN to match only whole lines
-P, --perl-regexp PATTERN is a Perl regular expression

0 件のコメント: