1#!/bin/sh 2#
| 1#!/bin/sh 2#
|
3# $FreeBSD: head/usr.bin/kdump/mkioctls 179308 2008-05-25 22:11:40Z rwatson $
| 3# $FreeBSD: head/usr.bin/kdump/mkioctls 188978 2009-02-24 00:53:10Z thompsa $
|
4 5set -e 6 7if [ "x$1" = "x-s" ]; then 8 use_switch=1 9 shift 10else 11 use_switch=0 12fi 13 14if [ -z "$1" ]; then 15 echo "usage: sh $0 [-s] include-dir" 16 exit 1 17fi 18 19LC_ALL=C; export LC_ALL 20
| 4 5set -e 6 7if [ "x$1" = "x-s" ]; then 8 use_switch=1 9 shift 10else 11 use_switch=0 12fi 13 14if [ -z "$1" ]; then 15 echo "usage: sh $0 [-s] include-dir" 16 exit 1 17fi 18 19LC_ALL=C; export LC_ALL 20
|
| 21# include subdirs to exclude from the search 22exclude="^legacy/.*" 23
|
21# Build a list of headers that have ioctls in them. 22# XXX should we use an ANSI cpp? 23ioctl_includes=` 24 cd $1
| 24# Build a list of headers that have ioctls in them. 25# XXX should we use an ANSI cpp? 26ioctl_includes=` 27 cd $1
|
25 find -H -s * -name '*.h' |
| 28 find -H -s * -name '*.h' \! -regex $exclude |
|
26 xargs egrep -l \ 27'^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | 28 awk '{printf("#include <%s>\\\\n", $1)}' 29` 30 31awk -v x="$ioctl_includes" 'BEGIN {print x}' | 32 gcc -E -I$1 -dM - | 33 awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" '
--- 56 unchanged lines hidden --- | 29 xargs egrep -l \ 30'^#[ ]*define[ ]+[A-Za-z_][A-Za-z0-9_]*[ ]+_IO[^a-z0-9_]' | 31 awk '{printf("#include <%s>\\\\n", $1)}' 32` 33 34awk -v x="$ioctl_includes" 'BEGIN {print x}' | 35 gcc -E -I$1 -dM - | 36 awk -v ioctl_includes="$ioctl_includes" -v use_switch="$use_switch" '
--- 56 unchanged lines hidden --- |