Add "proto_item_set_text()", which sets the "representation" field of an
[obnox/wireshark/wip.git] / make-reg-dotc
1 #! /bin/sh
2
3 #
4 # The first argument is the directory in which the source files live.
5 #
6 srcdir="$1"
7 shift
8
9 #
10 # All subsequent arguments are the files to scan.
11 #
12 rm -f register.c-tmp
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
16 echo 'void register_all_protocols(void) {' >>register.c-tmp
17 for f in "$@"
18 do
19         grep '^proto_register_[a-z_0-9A-Z]* *(' $srcdir/$f 2>/dev/null
20 done | sed -e 's/^.*://' -e 's/^\([a-z_0-9A-Z]*\).*/  {extern void \1 (void); \1 ();}/' >>register.c-tmp
21 for f in "$@"
22 do
23         grep '^void proto_register_[a-z_0-9A-Z]* *(' $srcdir/$f 2>/dev/null
24 done | sed -e 's/^.*://' -e 's/^void \([a-z_0-9A-Z]*\).*/  {extern void \1 (void); \1 ();}/' >>register.c-tmp
25 echo '}' >>register.c-tmp
26 mv register.c-tmp register.c