Commit | Line | Data |
---|---|---|
84f87e82 | 1 | #!/bin/sh |
2 | exec >automech.c.new | |
3 | exec 3>automech.h.new | |
4 | ||
5 | cat <<END | |
aaa9ab3a | 6 | #include "forwarder.h" |
84f87e82 | 7 | const struct mechanism *const mechanismlists[]= { |
8 | END | |
9 | ||
10 | cat >&3 <<END | |
11 | #ifndef AUTOMECH_H | |
12 | #define AUTOMECH_H | |
13 | END | |
14 | ||
15 | for m in "$@"; do | |
16 | echo " mechlist_$m," | |
17 | echo "extern const struct mechanism mechlist_$m[];" >&3 | |
18 | done | |
19 | ||
20 | cat <<END | |
21 | 0 | |
22 | }; | |
23 | END | |
24 | ||
25 | cat >&3 <<END | |
26 | #endif | |
27 | END | |
28 | ||
29 | for e in c h; do mv -f automech.$e.new automech.$e; done |