4 # The first argument is the directory in which the source files live.
10 # All subsequent arguments are the files to scan.
13 echo '/* Do not modify this file. */' >register.c-tmp
14 echo '/* It is created automatically by the Makefile. */'>>register.c-tmp
15 echo '#include "register.h"' >>register.c-tmp
18 # Build code to call all the protocol registration routines.
20 echo 'void register_all_protocols(void) {' >>register.c-tmp
29 grep '^proto_register_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
30 done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
39 grep '^void proto_register_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
40 done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
41 echo '}' >>register.c-tmp
44 # Build code to call all the protocol handoff registration routines.
46 echo 'void register_all_protocol_handoffs(void) {' >>register.c-tmp
55 grep '^proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
56 done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
65 grep '^void proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcfile 2>/dev/null | grep -v ';'
66 done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
67 echo '}' >>register.c-tmp
68 mv register.c-tmp register.c