summaryrefslogtreecommitdiff
path: root/sys/tools/usbdevs2h.awk
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2004-12-31 21:12:17 +0000
committerWarner Losh <imp@FreeBSD.org>2004-12-31 21:12:17 +0000
commit3c20c603ca155a518db95a5895ac16e92d96f6bf (patch)
treed1d8c2a775524410ed3e93d9e7f1a435bc3a0255 /sys/tools/usbdevs2h.awk
parent65e278a8774ae20e0b6519b2b04e513b51cbde39 (diff)
Notes
Diffstat (limited to 'sys/tools/usbdevs2h.awk')
-rw-r--r--sys/tools/usbdevs2h.awk48
1 files changed, 13 insertions, 35 deletions
diff --git a/sys/tools/usbdevs2h.awk b/sys/tools/usbdevs2h.awk
index fff6f1b63a3e..40f3cb128499 100644
--- a/sys/tools/usbdevs2h.awk
+++ b/sys/tools/usbdevs2h.awk
@@ -37,45 +37,25 @@ function usage()
exit 1;
}
-function dheader(dfile)
+function header(file)
{
if (os == "NetBSD")
- printf("/*\t\$NetBSD\$\t*/\n\n") > dfile
+ printf("/*\t\$NetBSD\$\t*/\n\n") > file
else if (os == "FreeBSD")
- printf("/* \$FreeBSD\$ */\n\n") > dfile
+ printf("/* \$FreeBSD\$ */\n\n") > file
else if (os == "OpenBSD")
- printf("/*\t\$OpenBSD\$\t*/\n\n") > dfile
+ printf("/*\t\$OpenBSD\$\t*/\n\n") > file
else
- printf("/* ??? */\n\n") > dfile
- printf("/*\n") > dfile
+ printf("/* ??? */\n\n") > file
+ printf("/*\n") > file
printf(" * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \
- > dfile
- printf(" *\n") > dfile
- printf(" * generated from:\n") > dfile
- printf(" *\t%s\n", VERSION) > dfile
- printf(" */\n") > dfile
+ > file
+ printf(" *\n") > file
+ printf(" * generated from:\n") > file
+ printf(" *\t%s\n", VERSION) > file
+ printf(" */\n") > file
}
-function hheader(hfile)
-{
- if (os == "NetBSD")
- printf("/*\t\$NetBSD\$\t*/\n\n") > hfile
- else if (os == "FreeBSD")
- printf("/* \$FreeBSD\$ */\n\n") > hfile
- else if (os == "OpenBSD")
- printf("/*\t\$OpenBSD\$\t*/\n\n") > hfile
- else
- printf("/* ??? */\n\n") > hfile
- printf("/*\n") > hfile
- printf(" * THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.\n") \
- > hfile
- printf(" *\n") > hfile
- printf(" * generated from:\n") > hfile
- printf(" *\t%s\n", VERSION) > hfile
- printf(" */\n") > hfile
-}
-
-
function vendor(hfile)
{
nvendors++
@@ -261,12 +241,10 @@ while ((getline < srcfile) > 0) {
if (line == 1) {
VERSION = $0
gsub("\\$", "", VERSION)
-
if (dfile)
- dheader(dfile)
-
+ header(dfile)
if (hfile)
- hheader(hfile)
+ header(hfile)
continue;
}
if ($1 == "vendor") {