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
23 grep '^proto_register_[a-z_0-9A-Z]* *(' $srcdir/$f 2>/dev/null
24 done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
27 grep '^void proto_register_[a-z_0-9A-Z]* *(' $srcdir/$f 2>/dev/null
28 done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
29 echo '}' >>register.c-tmp
32 # Build code to call all the protocol handoff registration routines.
34 echo 'void register_all_protocol_handoffs(void) {' >>register.c-tmp
37 grep '^proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcdir/$f 2>/dev/null
38 done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
41 grep '^void proto_reg_handoff_[a-z_0-9A-Z]* *(' $srcdir/$f 2>/dev/null
42 done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/ {extern void \1 (void); \1 ();}/' >>register.c-tmp
43 echo '}' >>register.c-tmp
44 mv register.c-tmp register.c