1 # cat someFile.h | sed -f fdfixh.sed
3 # It contains the instructions that sed requires to manipulate
4 # the header files produced by fdesign into a form usable by LyX
8 # s/\(extern \)\(.*\)/\1 "C" \2/
10 # Replaces lines such as "extern void func(args);"
11 # with "extern "C" void func(args);"
15 # Deletes lines containing "/create_form_/d"
18 # typedef struct { struct someStruct {
26 # This is detailed more closely below
28 s/\(extern \)\(.*\)/\1 "C" \2/
31 /typedef struct {/,/} .*;/{
32 # delete lines containing ...
38 # copy remaining lines into the hold space
41 # rewrite "} someStruct;" as "struct someStruct {" and print
42 s/} \(.*\);/struct \1 {/p
44 # delete line from pattern space
47 # swap the hold space back into the pattern space and...
50 # rewrite "} someStruct;" as "};"