7 find ..
/lib
/libc
/sys ..
/lib
/libsys
-name '*.c' | \
8 xargs egrep -n '((_syscall|_taskcall)\([^,][^,]*,[ ]*|_kernel_call\()[A-Z_][A-Z0-9_]*,[ ]*&m\)' | \
14 # find references to _syscall, _taskcall and _kernel_call in the libraries
17 for f
in `find_files_and_lines`
19 path
="`echo $f | cut -d: -f1`"
20 linecall
="`echo $f | cut -d: -f2`"
22 # find the matching message declaration; we can identify fields between message decl and call
23 linemsg
=`head -n "$linecall" "$path" | egrep -n 'message[ ][ ]*m;' | tail -n 1 | cut -d: -f1`
24 if [ "x$linemsg" != "x" ]
26 # watch out: message may be re-used; start from last call in this case
27 [ \
( "x$path" != "x$pathprev" \
) -o \
( "$linemsg" -gt "$linecallprev" \
) ] || linemsg
="$linecallprev"
30 callname
=`head -n "$linecall" "$path" | tail -n 1 | sed 's/.*[ (,]\([A-Z_][A-Z0-9_]*\),[ ]*&m).*/\1/'`
32 # extract message fields
33 linelast
="`expr "$linecall" - 1`"
34 linecount
="`expr "$linelast" - "$linemsg"`"
36 head -n "$linelast" "$path" | \
37 tail -n "$linecount" | \
39 egrep '^ *m\.[A-Za-z_][A-Za-z0-9_]* *=' | \
40 sed 's/^ *m\.\([A-Za-z_][A-Za-z0-9_]*\) *=.*/IDENT('$callname', \1)/'
43 linemsgprev
="$linemsg"