aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorKai Germaschewski <kai@germaschewski.name>2003-07-27 10:53:12 -0400
committerKai Germaschewski <kai@germaschewski.name>2003-07-27 10:53:12 -0400
commiteaa380db0c4f4a9506457db08a0371e23f028dfd (patch)
tree9bc4eaaa8dfc6fea3a6640ee68479ef22cf2b8db /scripts
parent3a2b95149c36cb27d808ad90f9f3acb50dec1e08 (diff)
parent5ff48e061ca49802157a33e0d9d5b004dddadb5b (diff)
downloadhistory-eaa380db0c4f4a9506457db08a0371e23f028dfd.tar.gz
Merge germaschewski.name:/home/kai/kernel/v2.5/linux-2.5
into germaschewski.name:/home/kai/kernel/v2.5/linux-2.5.make
Diffstat (limited to 'scripts')
-rw-r--r--scripts/genksyms/lex.c_shipped194
-rw-r--r--scripts/genksyms/lex.l2
-rwxr-xr-xscripts/makelst2
-rw-r--r--scripts/makeman46
-rw-r--r--scripts/split-man112
5 files changed, 258 insertions, 98 deletions
diff --git a/scripts/genksyms/lex.c_shipped b/scripts/genksyms/lex.c_shipped
index 33e7e9e2e521f8..d9bfbb5948f2bb 100644
--- a/scripts/genksyms/lex.c_shipped
+++ b/scripts/genksyms/lex.c_shipped
@@ -294,10 +294,10 @@ static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));
#define YY_END_OF_BUFFER 14
static yyconst short int yy_accept[76] =
{ 0,
- 0, 0, 0, 0, 14, 12, 4, 3, 12, 12,
- 12, 7, 7, 12, 12, 12, 12, 12, 9, 9,
- 12, 12, 12, 4, 0, 5, 0, 0, 6, 0,
- 0, 7, 0, 0, 0, 0, 2, 8, 10, 10,
+ 0, 0, 0, 0, 14, 12, 4, 3, 12, 7,
+ 12, 12, 7, 12, 12, 12, 12, 12, 9, 9,
+ 12, 12, 12, 4, 0, 5, 0, 7, 0, 6,
+ 0, 0, 0, 0, 0, 0, 2, 8, 10, 10,
9, 0, 0, 9, 9, 0, 9, 0, 0, 11,
0, 0, 0, 10, 0, 10, 9, 9, 0, 0,
0, 0, 0, 0, 0, 10, 10, 0, 0, 0,
@@ -309,17 +309,17 @@ static yyconst int yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
4, 4, 4, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 1, 5, 6, 1, 7, 8, 9, 1,
- 1, 7, 10, 1, 11, 12, 7, 13, 14, 14,
- 14, 14, 14, 14, 14, 15, 15, 1, 1, 16,
- 17, 18, 1, 1, 19, 19, 19, 19, 20, 21,
- 22, 22, 22, 22, 22, 23, 22, 22, 22, 22,
- 22, 22, 22, 22, 24, 22, 22, 25, 22, 22,
- 1, 26, 1, 7, 22, 1, 19, 19, 19, 19,
-
- 20, 21, 22, 22, 22, 22, 22, 27, 22, 22,
- 22, 22, 22, 22, 22, 22, 24, 22, 22, 25,
- 22, 22, 1, 28, 1, 7, 1, 1, 1, 1,
+ 1, 2, 1, 5, 6, 7, 8, 9, 10, 1,
+ 1, 8, 11, 1, 12, 13, 8, 14, 15, 15,
+ 15, 15, 15, 15, 15, 16, 16, 1, 1, 17,
+ 18, 19, 1, 1, 20, 20, 20, 20, 21, 22,
+ 7, 7, 7, 7, 7, 23, 7, 7, 7, 7,
+ 7, 7, 7, 7, 24, 7, 7, 25, 7, 7,
+ 1, 26, 1, 8, 7, 1, 20, 20, 20, 20,
+
+ 21, 22, 7, 7, 7, 7, 7, 27, 7, 7,
+ 7, 7, 7, 7, 7, 7, 24, 7, 7, 25,
+ 7, 7, 1, 28, 1, 8, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -338,111 +338,113 @@ static yyconst int yy_ec[256] =
static yyconst int yy_meta[29] =
{ 0,
- 1, 1, 2, 1, 1, 1, 1, 1, 1, 3,
- 3, 4, 5, 5, 5, 1, 1, 1, 6, 7,
- 6, 8, 8, 8, 8, 1, 8, 1
+ 1, 1, 2, 1, 1, 1, 3, 1, 1, 1,
+ 4, 4, 5, 6, 6, 6, 1, 1, 1, 7,
+ 8, 7, 3, 3, 3, 1, 3, 1
} ;
static yyconst short int yy_base[88] =
{ 0,
- 0, 166, 22, 152, 151, 282, 39, 282, 26, 33,
- 138, 0, 39, 43, 124, 39, 36, 48, 52, 55,
- 41, 56, 54, 47, 73, 282, 0, 72, 282, 0,
- 116, 0, 78, 75, 122, 103, 282, 282, 106, 0,
- 97, 73, 76, 91, 65, 0, 0, 84, 81, 282,
- 132, 98, 84, 282, 117, 147, 282, 73, 134, 89,
- 100, 140, 172, 139, 134, 181, 282, 135, 106, 142,
- 168, 88, 52, 282, 282, 208, 216, 220, 228, 236,
- 244, 249, 254, 255, 260, 265, 273
+ 0, 147, 21, 140, 145, 284, 39, 284, 26, 0,
+ 32, 126, 40, 44, 115, 35, 36, 46, 50, 53,
+ 39, 61, 54, 79, 65, 284, 0, 0, 66, 284,
+ 0, 119, 79, 75, 123, 104, 284, 284, 107, 0,
+ 79, 73, 76, 76, 66, 0, 0, 85, 86, 284,
+ 133, 83, 91, 284, 99, 147, 284, 114, 122, 70,
+ 107, 141, 172, 151, 135, 181, 284, 137, 114, 157,
+ 149, 48, 45, 284, 284, 208, 214, 222, 230, 238,
+ 246, 250, 255, 256, 261, 267, 275
} ;
static yyconst short int yy_def[88] =
{ 0,
75, 1, 1, 3, 75, 75, 75, 75, 76, 77,
- 75, 78, 78, 79, 75, 75, 75, 75, 75, 19,
- 75, 75, 75, 75, 76, 75, 80, 77, 75, 81,
- 75, 78, 76, 77, 79, 79, 75, 75, 75, 39,
- 19, 82, 83, 75, 75, 84, 20, 76, 77, 75,
+ 78, 75, 77, 79, 75, 75, 75, 75, 75, 19,
+ 75, 75, 75, 75, 76, 75, 80, 77, 78, 75,
+ 81, 75, 76, 78, 79, 79, 75, 75, 75, 39,
+ 19, 82, 83, 75, 75, 84, 20, 76, 78, 75,
79, 51, 85, 75, 75, 75, 75, 84, 79, 51,
79, 79, 79, 51, 75, 75, 75, 86, 79, 63,
86, 87, 87, 75, 0, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75
} ;
-static yyconst short int yy_nxt[311] =
+static yyconst short int yy_nxt[313] =
{ 0,
- 6, 7, 8, 7, 9, 6, 6, 6, 10, 6,
- 6, 11, 6, 6, 6, 6, 6, 6, 12, 12,
- 12, 12, 13, 12, 12, 6, 12, 6, 15, 16,
+ 6, 7, 8, 7, 9, 6, 10, 6, 6, 11,
+ 6, 6, 12, 6, 6, 6, 6, 6, 6, 10,
+ 10, 10, 13, 10, 10, 6, 10, 6, 15, 16,
26, 15, 17, 18, 19, 20, 20, 21, 15, 22,
- 24, 29, 24, 33, 36, 37, 38, 34, 24, 23,
- 24, 27, 38, 38, 74, 38, 38, 38, 30, 31,
- 39, 39, 39, 40, 41, 41, 42, 47, 47, 47,
- 38, 43, 38, 38, 44, 45, 46, 26, 44, 75,
- 29, 38, 26, 29, 40, 55, 55, 57, 26, 29,
- 74, 57, 43, 65, 65, 44, 45, 30, 27, 44,
-
- 30, 59, 37, 27, 36, 37, 30, 59, 37, 27,
- 64, 64, 64, 35, 57, 51, 52, 52, 39, 39,
- 39, 75, 35, 69, 37, 53, 54, 50, 54, 56,
- 56, 56, 54, 59, 37, 59, 37, 37, 68, 35,
- 38, 59, 37, 59, 60, 60, 66, 66, 66, 31,
- 75, 64, 64, 64, 61, 62, 63, 14, 61, 56,
- 56, 56, 69, 35, 61, 62, 69, 67, 61, 67,
- 37, 14, 72, 67, 37, 75, 75, 75, 75, 75,
- 75, 75, 75, 75, 70, 70, 70, 75, 75, 75,
- 70, 70, 70, 66, 66, 66, 75, 75, 75, 75,
-
- 75, 54, 75, 54, 75, 75, 75, 54, 25, 25,
- 25, 25, 25, 25, 25, 25, 28, 28, 28, 28,
- 28, 28, 28, 28, 32, 32, 32, 32, 35, 35,
- 35, 35, 35, 35, 35, 35, 48, 75, 48, 48,
- 48, 48, 48, 48, 49, 75, 49, 49, 49, 49,
- 49, 49, 42, 42, 75, 42, 56, 75, 56, 58,
- 58, 58, 66, 75, 66, 71, 71, 71, 71, 71,
- 71, 71, 71, 73, 73, 73, 73, 73, 73, 73,
- 73, 5, 75, 75, 75, 75, 75, 75, 75, 75,
+ 24, 30, 24, 38, 33, 36, 37, 74, 23, 34,
+ 74, 27, 38, 38, 38, 38, 38, 31, 32, 39,
+ 39, 39, 40, 41, 41, 42, 47, 47, 47, 26,
+ 43, 38, 44, 45, 46, 30, 44, 75, 38, 38,
+ 24, 38, 24, 26, 30, 40, 55, 55, 57, 26,
+ 27, 31, 57, 43, 35, 30, 64, 64, 64, 57,
+
+ 31, 65, 65, 75, 27, 36, 37, 35, 59, 37,
+ 27, 31, 56, 56, 56, 59, 37, 51, 52, 52,
+ 39, 39, 39, 59, 37, 37, 68, 53, 54, 54,
+ 69, 50, 38, 54, 59, 37, 44, 45, 32, 37,
+ 44, 35, 59, 37, 75, 14, 60, 60, 66, 66,
+ 66, 37, 14, 72, 75, 61, 62, 63, 59, 61,
+ 56, 56, 56, 69, 64, 64, 64, 69, 67, 67,
+ 75, 75, 75, 67, 37, 35, 75, 75, 75, 61,
+ 62, 75, 75, 61, 75, 70, 70, 70, 75, 75,
+ 75, 70, 70, 70, 66, 66, 66, 75, 75, 75,
+
+ 75, 75, 54, 54, 75, 75, 75, 54, 25, 25,
+ 25, 25, 25, 25, 25, 25, 28, 75, 75, 28,
+ 28, 28, 29, 29, 29, 29, 29, 29, 29, 29,
+ 35, 35, 35, 35, 35, 35, 35, 35, 48, 75,
+ 48, 48, 48, 48, 48, 48, 49, 75, 49, 49,
+ 49, 49, 49, 49, 42, 42, 75, 42, 56, 75,
+ 56, 58, 58, 58, 66, 75, 66, 71, 71, 71,
+ 71, 71, 71, 71, 71, 73, 73, 73, 73, 73,
+ 73, 73, 73, 5, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
- 75, 75, 75, 75, 75, 75, 75, 75, 75, 75
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75
} ;
-static yyconst short int yy_chk[311] =
+static yyconst short int yy_chk[313] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 3, 3,
9, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 7, 10, 7, 13, 14, 14, 16, 13, 24, 3,
- 24, 9, 17, 17, 73, 16, 21, 21, 10, 18,
- 18, 18, 18, 19, 19, 19, 19, 20, 20, 20,
- 23, 19, 22, 22, 19, 19, 19, 25, 19, 20,
- 28, 23, 33, 34, 42, 43, 43, 45, 48, 49,
- 72, 45, 42, 53, 53, 58, 58, 28, 25, 58,
-
- 34, 61, 61, 33, 36, 36, 49, 69, 69, 48,
- 52, 52, 52, 60, 44, 36, 36, 36, 39, 39,
- 39, 41, 52, 61, 35, 39, 39, 31, 39, 55,
- 55, 55, 39, 51, 51, 59, 59, 68, 59, 68,
- 15, 62, 62, 70, 51, 51, 65, 65, 65, 11,
- 5, 64, 64, 64, 51, 51, 51, 4, 51, 56,
- 56, 56, 62, 64, 70, 70, 62, 56, 70, 56,
- 71, 2, 71, 56, 63, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 63, 63, 63, 0, 0, 0,
- 63, 63, 63, 66, 66, 66, 0, 0, 0, 0,
-
- 0, 66, 0, 66, 0, 0, 0, 66, 76, 76,
- 76, 76, 76, 76, 76, 76, 77, 77, 77, 77,
- 77, 77, 77, 77, 78, 78, 78, 78, 79, 79,
- 79, 79, 79, 79, 79, 79, 80, 0, 80, 80,
- 80, 80, 80, 80, 81, 0, 81, 81, 81, 81,
- 81, 81, 82, 82, 0, 82, 83, 0, 83, 84,
- 84, 84, 85, 0, 85, 86, 86, 86, 86, 86,
- 86, 86, 86, 87, 87, 87, 87, 87, 87, 87,
- 87, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+ 7, 11, 7, 16, 13, 14, 14, 73, 3, 13,
+ 72, 9, 16, 17, 17, 21, 21, 11, 18, 18,
+ 18, 18, 19, 19, 19, 19, 20, 20, 20, 25,
+ 19, 23, 19, 19, 19, 29, 19, 20, 22, 22,
+ 24, 23, 24, 33, 34, 42, 43, 43, 45, 48,
+ 25, 29, 45, 42, 60, 49, 52, 52, 52, 44,
+
+ 34, 53, 53, 41, 33, 36, 36, 52, 61, 61,
+ 48, 49, 55, 55, 55, 69, 69, 36, 36, 36,
+ 39, 39, 39, 59, 59, 35, 59, 39, 39, 39,
+ 61, 32, 15, 39, 51, 51, 58, 58, 12, 68,
+ 58, 68, 62, 62, 5, 4, 51, 51, 65, 65,
+ 65, 71, 2, 71, 0, 51, 51, 51, 70, 51,
+ 56, 56, 56, 62, 64, 64, 64, 62, 56, 56,
+ 0, 0, 0, 56, 63, 64, 0, 0, 0, 70,
+ 70, 0, 0, 70, 0, 63, 63, 63, 0, 0,
+ 0, 63, 63, 63, 66, 66, 66, 0, 0, 0,
+
+ 0, 0, 66, 66, 0, 0, 0, 66, 76, 76,
+ 76, 76, 76, 76, 76, 76, 77, 0, 0, 77,
+ 77, 77, 78, 78, 78, 78, 78, 78, 78, 78,
+ 79, 79, 79, 79, 79, 79, 79, 79, 80, 0,
+ 80, 80, 80, 80, 80, 80, 81, 0, 81, 81,
+ 81, 81, 81, 81, 82, 82, 0, 82, 83, 0,
+ 83, 84, 84, 84, 85, 0, 85, 86, 86, 86,
+ 86, 86, 86, 86, 86, 87, 87, 87, 87, 87,
+ 87, 87, 87, 75, 75, 75, 75, 75, 75, 75,
75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
- 75, 75, 75, 75, 75, 75, 75, 75, 75, 75
+ 75, 75, 75, 75, 75, 75, 75, 75, 75, 75,
+ 75, 75
} ;
static yy_state_type yy_last_accepting_state;
@@ -507,7 +509,7 @@ char *yytext;
#define V2_TOKENS 1
/* We don't do multiple input files. */
-#line 511 "scripts/genksyms/lex.c"
+#line 513 "scripts/genksyms/lex.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -666,7 +668,7 @@ YY_DECL
/* Keep track of our location in the original source files. */
-#line 670 "scripts/genksyms/lex.c"
+#line 672 "scripts/genksyms/lex.c"
if ( yy_init )
{
@@ -724,7 +726,7 @@ yy_match:
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_base[yy_current_state] != 282 );
+ while ( yy_base[yy_current_state] != 284 );
yy_find_action:
yy_act = yy_accept[yy_current_state];
@@ -836,7 +838,7 @@ YY_RULE_SETUP
#line 95 "scripts/genksyms/lex.l"
ECHO;
YY_BREAK
-#line 840 "scripts/genksyms/lex.c"
+#line 842 "scripts/genksyms/lex.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(V2_TOKENS):
yyterminate();
diff --git a/scripts/genksyms/lex.l b/scripts/genksyms/lex.l
index a3aeb92cf91f94..fe0dfeedf0ff54 100644
--- a/scripts/genksyms/lex.l
+++ b/scripts/genksyms/lex.l
@@ -37,7 +37,7 @@
%}
-IDENT [A-Za-z_][A-Za-z0-9_]*
+IDENT [A-Za-z_\$][A-Za-z0-9_\$]*
O_INT 0[0-7]*
D_INT [1-9][0-9]*
diff --git a/scripts/makelst b/scripts/makelst
index 3c04512728f264..34bd72391238d5 100755
--- a/scripts/makelst
+++ b/scripts/makelst
@@ -28,4 +28,4 @@ if [ -n "$t1" ]; then
else
t7=0
fi
-$3 --source --adjust-vma=$t7 $1
+$3 -r --source --adjust-vma=$t7 $1
diff --git a/scripts/makeman b/scripts/makeman
new file mode 100644
index 00000000000000..3c6dc5b89f21c8
--- /dev/null
+++ b/scripts/makeman
@@ -0,0 +1,46 @@
+#!/usr/bin/perl
+
+use strict;
+
+## Copyright (C) Michael Still (mikal@stillhq.com)
+## Released under the terms of the GNU GPL
+##
+## A script to make or install the manpages extracted by split-man
+##
+## Arguements: $1 -- the word "convert" or "install"
+## $2 -- the directory containing the SGML files for the manpages
+## $3 -- the filename which contained the sgmldoc output
+## (I need this so I know which manpages to convert)
+
+my($LISTING);
+
+if($ARGV[0] eq ""){
+ die "Usage: makeman [convert | install] <dir> <file>\n";
+}
+
+if( ! -d "$ARGV[1]" ){
+ die "Output directory \"$ARGV[1]\" does not exist\n";
+}
+
+if($ARGV[0] eq "convert"){
+ open LISTING, "grep \"<refentrytitle>\" $ARGV[2] |";
+ while(<LISTING>){
+ s/<\/.*$//;
+ s/^.*>//;
+ s/\.sgml//;
+ s/struct //;
+ s/typedef //;
+
+ chomp;
+ print "Processing $_\n";
+ system("cd $ARGV[1]; docbook2man $_.sgml; gzip -f $_.9\n");
+ }
+}
+elsif($ARGV[0] eq "install"){
+ system("mkdir -p /usr/local/man/man9/; install $ARGV[1]/*.9.gz /usr/local/man/man9/");
+}
+else{
+ die "Usage: makeman [convert | install] <dir> <file>\n";
+}
+
+print "Done\n";
diff --git a/scripts/split-man b/scripts/split-man
new file mode 100644
index 00000000000000..bff727ba247691
--- /dev/null
+++ b/scripts/split-man
@@ -0,0 +1,112 @@
+#!/usr/bin/perl
+
+use strict;
+
+## Copyright (C) Michael Still (mikal@stillhq.com)
+## Released under the terms of the GNU GPL
+##
+## Hoon through the specified DocBook SGML file, and split out the
+## man pages. These can then be processed into groff format, and
+## installed if desired...
+##
+## Arguements: $1 -- the name of the sgml file
+## $2 -- the directory to put the generated SGML files in
+## $3 -- kernel version
+
+my($SGML, $REF, $front, $refdata, $mode, $filename);
+
+if(($ARGV[0] eq "") || ($ARGV[1] eq "") || ($ARGV[2] eq "")){
+ die "Usage: split-man <sgml file> <output dir> <kernel version>\n";
+}
+
+open SGML, "< $ARGV[0]" or die "Could not open input file \"$ARGV[0]\"\n";
+if( ! -d "$ARGV[1]" ){
+ die "Output directory \"$ARGV[1]\" does not exist\n";
+}
+
+# Possible modes:
+# 0: Looking for input I care about
+# 1: Inside book front matter
+# 2: Inside a refentry
+# 3: Inside a refentry, and we know the filename
+
+$mode = 0;
+$refdata = "";
+$front = "";
+while(<SGML>){
+ # Starting modes
+ if(/<legalnotice>/){
+ $mode = 1;
+ }
+ elsif(/<refentry>/){
+ $mode = 2;
+ }
+ elsif(/<refentrytitle><phrase[^>]*>([^<]*)<.*$/){
+ $mode = 3;
+ $filename = $1;
+
+ $filename =~ s/struct //;
+ $filename =~ s/typedef //;
+
+ print "Found manpage for $filename\n";
+ open REF, "> $ARGV[1]/$filename.sgml" or
+ die "Couldn't open output file \"$ARGV[1]/$filename.sgml\": $!\n";
+ print REF "<!DOCTYPE refentry PUBLIC \"-//Davenport//DTD DocBook V3.0//EN\">\n\n";
+ print REF "$refdata";
+ $refdata = "";
+ }
+
+ # Extraction
+ if($mode == 1){
+ $front = "$front$_";
+ }
+ elsif($mode == 2){
+ $refdata = "$refdata$_";
+ }
+ elsif($mode == 3){
+ # There are some fixups which need to be applied
+ if(/<\/refmeta>/){
+ print REF "<manvolnum>9</manvolnum>\n";
+ }
+ if(/<\/refentry>/){
+ $front =~ s/<legalnotice>//;
+ $front =~ s/<\/legalnotice>//;
+ print REF <<EOF;
+<refsect1><title>About this document</title>
+$front
+<para>
+If you have comments on the formatting of this manpage, then please contact
+Michael Still (mikal\@stillhq.com).
+</para>
+
+<para>
+This documentation was generated with kernel version $ARGV[2].
+</para>
+</refsect1>
+EOF
+ }
+
+ # For some reason, we title the synopsis twice in the main DocBook
+ if(! /<title>Synopsis<\/title>/){
+ if(/<refentrytitle>/){
+ s/struct //;
+ s/typedef //;
+ }
+
+ print REF "$_";
+ }
+ }
+
+ # Ending modes
+ if(/<\/legalnotice>/){
+ $mode = 0;
+ }
+ elsif(/<\/refentry>/){
+ $mode = 0;
+ close REF;
+ }
+}
+
+# And make sure we don't process this unnessesarily
+$ARGV[0] =~ s/\.sgml/.9/;
+`touch $ARGV[0]`;