Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
ec5783cb
提交
ec5783cb
9月 08, 2006
创建
作者:
rsc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
runoff changes
上级
72a590d9
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
160 行增加
和
91 行删除
+160
-91
pr.pl
pr.pl
+35
-0
runoff
runoff
+12
-91
runoff1
runoff1
+90
-0
toc.ftr
toc.ftr
+16
-0
toc.hdr
toc.hdr
+7
-0
没有找到文件。
pr.pl
0 → 100755
浏览文件 @
ec5783cb
#!/usr/bin/perl
use
POSIX
qw(strftime)
;
if
(
$ARGV
[
0
]
eq
"-h"
){
shift
@ARGV
;
$h
=
$ARGV
[
0
];
shift
@ARGV
;
}
else
{
$h
=
$ARGV
[
0
];
}
$page
=
0
;
$now
=
strftime
"%b %e %H:%M %Y"
,
localtime
;
@lines
=
<>
;
for
(
$i
=
0
;
$i
<
@lines
;
$i
+=
50
){
print
"\n\n"
;
++
$page
;
print
"$now $h Page $page\n"
;
print
"\n\n"
;
for
(
$j
=
$i
;
$j
<
@lines
&&
$j
<
$i
+
50
;
$j
++
){
print
$lines
[
$j
];
}
for
(;
$j
<
$i
+
50
;
$j
++
){
print
"\n"
;
}
$sheet
=
""
;
if
(
$lines
[
$i
]
=~
/^([0-9][0-9])[0-9][0-9] /
){
$sheet
=
"Sheet $1"
;
}
print
"\n\n"
;
print
"$sheet\n"
;
print
"\n\n"
;
}
runoff
浏览文件 @
ec5783cb
...
...
@@ -16,90 +16,7 @@ files=`grep -v '^#' runoff.list | awk '{print $1}'`
n
=
99
for
i
in
$files
do
perl
-e
'$n='
$n
';'
-e
'
$n = int(($n+49)/50)*50 - 1;
@lines = <>;
foreach (@lines) {
chomp;
s/\s+$//;
if(length() >= 75){
print "$ARGV[0]:$.: line too long";
}
}
@outlines = ();
$nextout = 0;
for($i=0; $i<@lines; ){
# Skip leading blank lines.
$i++ while $i<@lines && $lines[$i] =~ /^$/;
last if $i>=@lines;
# If the rest of the file fits, use the whole thing.
if(@lines <= $i+50){
$breakbefore = @lines;
}else{
# Find a good next page break;
# Hope for end of function.
# but settle for a blank line (but not first blank line
# in function, which comes after variable declarations).
$breakbefore = $i;
$lastblank = $i;
$sawbrace = 0;
$breaksize = 15; # 15 lines to get to function
for($j=$i; $j<$i+50 && $j < @lines; $j++){
if($lines[$j] =~ /PAGEBREAK:\s*([0-9]+)/){
$breaksize = int($2);
$breakbefore = $j;
$lines[$j] = "";
}
if($lines[$j] =~ /^}$/){
$breakbefore = $j+1;
}
if($lines[$j] =~ /^{$/){
$sawbrace = 1;
}
if($lines[$j] =~ /^$/){
if($sawbrace){
$sawbrace = 0;
}else{
$lastblank = $j;
}
}
}
if($j<@lines && $lines[$j] =~ /^$/){
$lastblank = $j;
}
# If we are not putting enough on a page, try a blank line.
if($breakbefore - $i < 50 - $breaksize && $lastblank > $breakbefore && $lastblank >= $i+50 - 5){
$breakbefore = $lastblank;
$breaksize = 5; # only 5 lines to get to blank line
}
# If we are not putting enough on a page, force a full page.
if($breakbefore - $i < 50 - $breaksize && $breakbefore != @lines){
$breakbefore = $i + 50;
$breakbefore = @lines if @lines < $breakbefore;
}
if($breakbefore < $i+2){
$breakbefore = $i+2;
}
}
# Emit the page.
$i50 = $i + 50;
for(; $i<$breakbefore; $i++){
printf "%04d %s\n", ++$n, $lines[$i];
}
# Finish page
for($j=$i; $j<$i50; $j++){
printf "%04d \n", ++$n;
}
}
'
$i
>
fmt
/
$i
runoff1
-n
$n
$i
>
fmt
/
$i
nn
=
`
tail
-1
fmt
/
$i
|
sed
's/ .*//; s/^0*//'
`
if
[
"x
$nn
"
!=
x
]
;
then
n
=
$nn
...
...
@@ -107,8 +24,9 @@ do
done
# create table of contents
cat
toc.hdr
>
fmt
/toc
pr
-e8
-t
runoff.list |
awk
'
/^[a-z]/ {
/^[a-z
0-9
]/ {
s=$0
f="fmt/"$1
getline<f
...
...
@@ -119,7 +37,8 @@ pr -e8 -t runoff.list | awk '
}
{
print
}'
>
fmt
/toc
}'
|
pr
-3
-t
>>
fmt
/toc
cat
toc.ftr
>>
fmt
/toc
# make definition list
cd fmt
...
...
@@ -197,13 +116,15 @@ awk '
# format the whole thing
(
pr
-l60
-e8
README
pr
-l60
-h
"table of contents"
-e8
-2
toc
pr
-l60
-h
"definitions"
-2
t.defs | pad
pr
-l60
-h
"cross-references"
-2
refs | pad
../pr.pl README
../pr.pl
-h
"table of contents"
toc
# pr -t -2 t.defs | ../pr.pl -h "definitions" | pad
pr
-t
-l50
-2
refs | ../pr.pl
-h
"cross-references"
| pad
# pr.pl -h "definitions" -2 t.defs | pad
# pr.pl -h "cross-references" -2 refs | pad
for
i
in
$files
do
cat
$i
|
pr
-l60
-e8
-h
"xv6/
$i
"
../pr.pl
-h
"xv6/
$i
"
$i
done
)
| mpage
-m50t50b
-o
-bLetter
-T
-t
-2
-FCourier
-L60
>
all.ps
grep
Pages: all.ps
...
...
runoff1
0 → 100755
浏览文件 @
ec5783cb
#!/usr/bin/perl
$n
=
0
;
if
(
$ARGV
[
0
]
eq
"-n"
)
{
$n
=
$ARGV
[
1
];
shift
@ARGV
;
shift
@ARGV
;
}
$n
=
int
((
$n
+
49
)
/
50
)
*
50
-
1
;
@lines
=
<>
;
foreach
(
@lines
)
{
chomp
;
s/\s+$//
;
if
(
length
()
>=
75
){
print
"$ARGV[0]:$.: line too long"
;
}
}
@outlines
=
();
$nextout
=
0
;
for
(
$i
=
0
;
$i
<
@lines
;
){
# Skip leading blank lines.
$i
++
while
$i
<
@lines
&&
$lines
[
$i
]
=~
/^$/
;
last
if
$i
>=
@lines
;
# If the rest of the file fits, use the whole thing.
if
(
@lines
<=
$i
+
50
){
$breakbefore
=
@lines
;
}
else
{
# Find a good next page break;
# Hope for end of function.
# but settle for a blank line (but not first blank line
# in function, which comes after variable declarations).
$breakbefore
=
$i
;
$lastblank
=
$i
;
$sawbrace
=
0
;
$breaksize
=
15
;
# 15 lines to get to function
for
(
$j
=
$i
;
$j
<
$i
+
50
&&
$j
<
@lines
;
$j
++
){
if
(
$lines
[
$j
]
=~
/PAGEBREAK:\s*([0-9]+)/
){
$breaksize
=
int
(
$2
);
$breakbefore
=
$j
;
$lines
[
$j
]
=
""
;
}
if
(
$lines
[
$j
]
=~
/^}$/
){
$breakbefore
=
$j
+
1
;
}
if
(
$lines
[
$j
]
=~
/^{$/
){
$sawbrace
=
1
;
}
if
(
$lines
[
$j
]
=~
/^$/
){
if
(
$sawbrace
){
$sawbrace
=
0
;
}
else
{
$lastblank
=
$j
;
}
}
}
if
(
$j
<
@lines
&&
$lines
[
$j
]
=~
/^$/
){
$lastblank
=
$j
;
}
# If we are not putting enough on a page, try a blank line.
if
(
$breakbefore
-
$i
<
50
-
$breaksize
&&
$lastblank
>
$breakbefore
&&
$lastblank
>=
$i
+
50
-
5
){
$breakbefore
=
$lastblank
;
$breaksize
=
5
;
# only 5 lines to get to blank line
}
# If we are not putting enough on a page, force a full page.
if
(
$breakbefore
-
$i
<
50
-
$breaksize
&&
$breakbefore
!=
@lines
){
$breakbefore
=
$i
+
50
;
$breakbefore
=
@lines
if
@lines
<
$breakbefore
;
}
if
(
$breakbefore
<
$i
+
2
){
$breakbefore
=
$i
+
2
;
}
}
# Emit the page.
$i50
=
$i
+
50
;
for
(;
$i
<
$breakbefore
;
$i
++
){
printf
"%04d %s\n"
,
++
$n
,
$lines
[
$i
];
}
# Finish page
for
(
$j
=
$i
;
$j
<
$i50
;
$j
++
){
printf
"%04d \n"
,
++
$n
;
}
}
toc.ftr
0 → 100644
浏览文件 @
ec5783cb
The source listing is preceded by a cross-reference listing every defined
constant, struct, global variable, and function in xv6. Each entry gives,
on the same line as the name, the line number (or, in a few cases, numbers)
where the name is defined. Successive lines in an entry list the line
numbers where the name is used. For example, this entry:
namei 4760
0333 4760 4859 4908
4958 5007 5016 5414
5427 5512 5560 5640
indicates that namei is defined on line 4760 and is mentioned on twelve lines
on sheets 03, 47, 48, 49, 50, 54, 55, and 56.
toc.hdr
0 → 100644
浏览文件 @
ec5783cb
The numbers to the left of the file names in the table are sheet numbers.
The source code has been printed in a double column format with fifty
lines per column, giving one hundred lines per sheet (or page).
Thus there is a convenient relationship between line numbers and sheet numbers.
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论