File: get_headers

package info (click to toggle)
ngetty 1.1-3.1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 392 kB
  • sloc: ansic: 1,588; makefile: 206; sh: 193; asm: 100
file content (25 lines) | stat: -rwxr-xr-x 632 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
[ $# -lt 2 ] && exit 1

export PATH=/bin:/usr/bin
name=`echo $1 | sed -e 's/\./__DOT__/g' -e 's/\//__SLASH__/g'`
shift

echo '#ifndef' AUTO_FILE__$$__$name
echo '#define' AUTO_FILE__$$__$name
echo '/*   '`date`'   */'

while test $# -gt 0; do
  case $1 in
    -L*) echo $1 | sed -e 's/^../#include  "/' -e 's/$/"/' ; shift;;
    -G*) echo $1 | sed -e 's/^../#include  </' -e 's/$/>/' ; shift;;
    -I*) echo $1 | sed -e 's/^../#include  /'; shift;;
    *) break;;
  esac
done

if [ $# -gt 0 ] ; then
    sed -n -e 's/\(.*\) \/\*EXTRACT_INCL\*\/.*/extern \1;/p' \
    -e 's/ \/\*EXTRACT_UNMOD\*\/.*//p' $@
fi
echo '#endif'