5 # The contents of this file are subject to the terms of the
6 # Common Development and Distribution License, Version 1.0 only
7 # (the "License"). You may not use this file except in compliance
10 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11 # or http://www.opensolaris.org/os/licensing.
12 # See the License for the specific language governing permissions
13 # and limitations under the License.
15 # When distributing Covered Code, include this CDDL HEADER in each
16 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17 # If applicable, add the following below this CDDL HEADER, with the
18 # fields enclosed by brackets "[]" replaced with your own identifying
19 # information: Portions Copyright [yyyy] [name of copyright owner]
24 # Copyright (c) 2000 by Sun Microsystems, Inc.
25 # All rights reserved.
28 #pragma ident "%Z%%M% %I% %E% SMI"
32 $line =~ s
#/\*|\*/##g;
33 $line =~ s
#^\s+|\s+$##g;
40 $prefix{$ARGV[0]} = 0;
50 my $n = m@
^#define\s(E\w\w\w)\w+\s+(\d+)(.*)@;
52 next unless ($filter == 0 || defined $prefix{$1});
54 if (length($txt) == 0) {
59 $base = $2 if (!defined $base);
60 if (defined $bnd && $2 != $bnd + 1) {
61 push(@sets, { base
=> $base, bnd
=> $bnd });
68 push(@sets, { base
=> $base, bnd
=> $bnd });
70 printf "#include <sys/sbd_ioctl.h>\n";
77 printf "static char *sbd_t%d[] = {\n", $set->{base
};
78 my $n = $set->{bnd
} - $set->{base
} + 1;
80 printf "\t\"%s\",\n", $text[$i++];
83 } while (++$s <= $#sets);
85 printf "sbd_etab_t sbd_etab[] = {\n";
89 printf "\t{ %d, %d, sbd_t%d },\n",
90 $set->{base
}, $set->{bnd
}, $set->{base
};
91 } while (++$s <= $#sets);
93 printf "int sbd_etab_len = %d;\n", $s;