summaryrefslogtreecommitdiff
path: root/sys/dev/tc/devlist2h.awk
diff options
context:
space:
mode:
authorcgd <cgd@NetBSD.org>1996-03-05 23:15:05 +0000
committercgd <cgd@NetBSD.org>1996-03-05 23:15:05 +0000
commitd43ef3b959f74f913bc25fe0fcff46ed4d51bb17 (patch)
tree142a339ccb876854f49d2d083b355ddf4dd92809 /sys/dev/tc/devlist2h.awk
parent34e5c9dc84798b7dccaa2dd27c0eec8fb2dc8f1e (diff)
split device info into driver name and human readable description.
Diffstat (limited to 'sys/dev/tc/devlist2h.awk')
-rw-r--r--sys/dev/tc/devlist2h.awk24
1 files changed, 17 insertions, 7 deletions
diff --git a/sys/dev/tc/devlist2h.awk b/sys/dev/tc/devlist2h.awk
index abee1e85ac9..b1b1baba49c 100644
--- a/sys/dev/tc/devlist2h.awk
+++ b/sys/dev/tc/devlist2h.awk
@@ -1,5 +1,5 @@
#! /usr/bin/awk -f
-# $NetBSD: devlist2h.awk,v 1.1 1996/03/02 01:16:49 cgd Exp $
+# $NetBSD: devlist2h.awk,v 1.2 1996/03/05 23:15:05 cgd Exp $
#
# Copyright (c) 1995, 1996 Christopher G. Demetriou
# All rights reserved.
@@ -62,10 +62,17 @@ $1 == "device" {
devices[ndevices, 0] = $2; # devices id
devices[ndevices, 1] = $2; # C identifier for device
gsub("-", "_", devices[ndevices, 1]);
- printf("#define\tTC_PRODUCT_%s\t\"", devices[ndevices, 1]) > hfile
- f = 3;
- i = 2;
+ devices[ndevices, 2] = $3; /* driver name */
+
+ printf("\n") > hfile
+ printf("#define\tTC_DEVICE_%s\t\"%s\"\n", devices[ndevices, 1],
+ devices[ndevices, 2]) > hfile
+
+ printf("#define\tTC_DESCRIPTION_%s\t\"", devices[ndevices, 1]) > hfile
+
+ f = 4;
+ i = 3;
# comments
ocomment = oparen = 0
@@ -103,7 +110,8 @@ $1 == "device" {
{
if ($0 == "")
blanklines++
- print $0 > hfile
+ if (blanklines < 2)
+ print $0 > hfile
if (blanklines < 2)
print $0 > dfile
}
@@ -117,11 +125,13 @@ END {
printf("\t{\n") > dfile
printf("\t \"%-8s\",\n", devices[i, 0]) \
> dfile
- printf("\t TC_PRODUCT_%s,\n", devices[i, 1]) \
+ printf("\t TC_DEVICE_%s,\n", devices[i, 1]) \
+ > dfile
+ printf("\t TC_DESCRIPTION_%s,\n", devices[i, 1]) \
> dfile
printf("\t},\n") > dfile
}
- printf("\t{ NULL, NULL, }\n") > dfile
+ printf("\t{ NULL, NULL, NULL, }\n") > dfile
printf("};\n") > dfile
}