Some man pages.

This commit is contained in:
rsc 2005-01-03 06:40:20 +00:00
parent 2600337aa7
commit 058b0118a5
214 changed files with 17112 additions and 1999 deletions

175
man/man1/9c.1 Normal file
View file

@ -0,0 +1,175 @@
.TH 9C 1
.SH NAME
9c, 9a, 9l, 9ar \- C compiler, assembler, linker, archiver
.SH SYNOPSIS
.B 9c
.I file
\&...
.PP
.B 9a
.I file
\&...
.PP
.B 9l
[
.I -o
.I target
]
.I object
\&...
[
.I library
\&...
]
[
.BI -L path
\&...
]
[
.BI -l library
\&...
]
.PP
.B 9ar
.I key
[
.I posname
]
.I afile
[
.I file
\&...
]
.SH DESCRIPTION
These programs are shell scripts that invoke the appropriate standard tools
for the current operating system and architecture.
One can use them to write portable recipes for mkfiles.
.PP
.I 9c
compiles the named C
.I files
into object files for the current system.
The system C compiler is invoked with warnings enabled,
with the symbol
.B PLAN9PORT
is defined in the C preprocessor, and with
.B $PLAN9/include
on the include path.
.PP
.I 9c
also defines
.B __sun__
on SunOS systems and
.B __Linux26__
on Linux systems with 2.6-series kernels.
.PP
.I 9a
assembles the named files into object files for the current system.
Unlike some system assemblers, it does
.I not
promise to run the C preprocessor on the source files.
.PP
.I 9l
links the named object files and libraries to create the target executable.
Each
.B -l
option specifies that a library named
.BI lib library .a
be found and linked.
The
.B -L
option adds directories to the library search path.
.I 9l
invokes the system linker with
.B $PLAN9/lib
already on the library search path.
.PP
.I 9ar
maintains object file archives called libraries.
The exact set of valid command keys varies from system to system,
but
.I 9ar
always provides the following key characters:
.TP
.B d
Delete
.I files
from the archive file.
.TP
.B r
Replace
.I files
in the archive file, or add them if missing.
.TP
.B t
List a table of contents of the archive.
If names are given, only those files are listed.
.TP
.B x
Extract the named files.
If no names are given, all files in the archive are
extracted.
In neither case does
.B x
alter the archive file.
.TP
.B v
Verbose.
Give a file-by-file
description of the making of a
new archive file from the old archive and the constituent files.
With
.BR t ,
give a long listing of all information about the files,
somewhat like a listing by
.IR ls (1),
showing
.br
.ns
.IP
.B
mode uid/gid size date name
.TP
.B c
Create.
Normally
.I 9ar
will create a new archive when
.I afile
does not exist, and give a warning.
Option
.B c
discards any old contents and suppresses the warning.
.PD
.PP
When a
.BR d ,
.BR r ,
or
.BR m
.I key
is specified,
.I 9ar
inserts a table of contents, required by the linker, at
the front of the library.
The table of contents is
rebuilt whenever the archive is modified.
.SH EXAMPLE
.TP
.L
9c file1.c file2.c file3.c
Compile three C source files.
.TP
.L
9a file4.s
Assemble one assembler source file.
.TP
.L
9ar rvc lib.a file[12].o
Archive the first two object files into a library.
.L
9l -o prog file3.o file4.o lib.a
Link the final two object files and any necessary objects from the library
into an executable.
.SH SOURCE
.B /usr/local/plan9/bin

125
man/man1/9p.1 Normal file
View file

@ -0,0 +1,125 @@
.TH 9P 1
.SH NAME
9p \- read and write files on a 9P server
.SH SYNOPSIS
.B 9p
[
.B -a
.I addr
]
.B read
.I path
.br
.B 9p
[
.B -a
.I addr
]
.B readfd
.I path
.PP
.B 9p
[
.B -a
.I addr
]
.B write
.I path
.br
.B 9p
[
.B -a
.I addr
]
.B writefd
.I path
.PP
.B 9p
[
.B -a
.I addr
]
.B stat
.I path
.SH DESCRIPTION
.I 9p
is a trivial 9P client that can access a single file on a 9P server.
It can be useful for manual interaction with a 9P server or for
accessing simple 9P services from within shell scripts.
.PP
The first argument is a command, one of:
.TP
.B read
print the contents of
.I path
to standard output
.TP
.B write
write data on standard input to
.I path
.TP
.BR readfd ", " writefd
like
.B read
and
.B write
but use
.IR openfd (9p)
instead of
.IR open ;
this masks errors and is mainly useful for debugging
the implementation of
.I openfd
.TP
.B stat
execute
.I stat (9p)
on
.I path
and print the result
.PD
.PP
.I 9p
dials
.I address
to connect to the 9P server.
If the
.B -a
option is not given,
.I 9p
requires the
.I path
to be of the form
.IB service / subpath \fR;
it connects to the Unix domain socket
.I service
in the name space directory
(see
.IR intro (4))
and then accesses
.IR subpath .
.SH EXAMPLE
To update
.IR plumber (4)'s
copy of your plumbing rules after editing
.BR $HOME/lib/plumbing :
.IP
.EX
cat $HOME/lib/plumbing | 9p write plumb/rules
.EE
.PP
To display the contents of the current
.IR acme (4)
window (specified by the environment variable
.BR $winid )
on standard output:
.IP
.EX
9p read acme/$winid/body
.EE
.SH SOURCE
.B /usr/local/plan9/src/cmd/9p.c
.SH SEE ALSO
.IR intro (4),
.IR intro (9p),
.IR 9pclient (3)

View file

@ -12,7 +12,7 @@
] ]
[ [
.I cmd .I cmd
... \&...
] ]
.PP .PP
.B label .B label
@ -272,7 +272,9 @@ to turn on hold mode first.
The The
.B plumb .B plumb
menu item sends the contents of the selection (not the snarf buffer) to the menu item sends the contents of the selection (not the snarf buffer) to the
.IR plumber (1). .I plumber
(see
.IR plumb (1)).
If the selection is empty, it sends the white-space-delimited text If the selection is empty, it sends the white-space-delimited text
containing the selection (typing cursor). containing the selection (typing cursor).
A typical use of this feature is to tell the editor to find the source of an error A typical use of this feature is to tell the editor to find the source of an error

170
man/man1/INDEX Normal file
View file

@ -0,0 +1,170 @@
9a 9c.1
9ar 9c.1
9c 9c.1
9l 9c.1
9p 9p.1
9term 9term.1
label 9term.1
acid acid.1
acidtypes acid.1
acme acme.1
awd acme.1
win acme.1
ascii ascii.1
unicode ascii.1
astro astro.1
basename basename.1
bc bc.1
bundle bundle.1
cal cal.1
calendar calendar.1
cat cat.1
read cat.1
cleanname cleanname.1
cmp cmp.1
colors colors.1
getmap colors.1
comm comm.1
core core.1
crop crop.1
iconv crop.1
clock date.1
date date.1
db db.1
dc dc.1
delatex deroff.1
deroff deroff.1
dict dict.1
diff diff.1
doctype doctype.1
echo echo.1
ed ed.1
eqn eqn.1
factor factor.1
primes factor.1
fmt fmt.1
htmlfmt fmt.1
fortune fortune.1
freq freq.1
fsize fsize.1
mtime fsize.1
grap grap.1
graph graph.1
g grep.1
grep grep.1
gview gview.1
bunzip2 gzip.1
bzip2 gzip.1
gunzip gzip.1
gzip gzip.1
unzip gzip.1
zip gzip.1
hoc hoc.1
idiff idiff.1
join join.1
bmp jpg.1
gif jpg.1
ico jpg.1
jpg jpg.1
png jpg.1
ppm jpg.1
togif jpg.1
toico jpg.1
topng jpg.1
toppm jpg.1
yuv jpg.1
kill kill.1
slay kill.1
start kill.1
stop kill.1
awd label.1
label label.1
lex lex.1
look look.1
lc ls.1
ls ls.1
lookman man.1
man man.1
map map.1
mapdemo map.1
mc mc.1
membername mk.1
mk mk.1
mkdir mkdir.1
namespace namespace.1
news news.1
p p.1
img page.1
page page.1
psv page.1
pic pic.1
tpic pic.1
plot plot.1
plumb plumb.1
pr pr.1
proof proof.1
ps ps.1
psu ps.1
pbd pwd.1
pwd pwd.1
. rc.1
cd rc.1
eval rc.1
exec rc.1
exit rc.1
flag rc.1
rc rc.1
rfork rc.1
shift rc.1
wait rc.1
whatis rc.1
~ rc.1
rio rio.1
rm rm.1
B sam.1
E sam.1
sam sam.1
sam.save sam.1
samsave sam.1
samterm sam.1
scat scat.1
aescbc secstore.1
ipso secstore.1
secstore secstore.1
9sed sed.1
sed sed.1
seq seq.1
sleep sleep.1
sort sort.1
spell spell.1
sprog spell.1
split split.1
src src.1
stats stats.1
strings strings.1
md5sum sum.1
sha1sum sum.1
sum sum.1
tail tail.1
tbl tbl.1
tcs tcs.1
tee tee.1
test test.1
time time.1
touch touch.1
tr tr.1
nroff troff.1
troff troff.1
tweak tweak.1
uniq uniq.1
units units.1
vac vac.1
wc wc.1
web web.1
wmail web.1
" wintext.1
"" wintext.1
wintext wintext.1
xd xd.1
yacc yacc.1

View file

@ -26,7 +26,7 @@ acid, acidtypes \- debugger
.I prefix .I prefix
] ]
.I file .I file
... \&...
.\" .PP .\" .PP
.\" .B acid .\" .B acid
.\" .B -l .\" .B -l
@ -69,17 +69,9 @@ at startup; see below.
.TP .TP
.BI -m " machine .BI -m " machine
Assume instructions are for the given CPU type Assume instructions are for the given CPU type
(one of (see
.BR 3210 , .IR mach (3))
.BR 386 , instead of using the executable header to select
etc., as listed in
.IR 2c (1),
or
.B sunsparc
or
.B mipsco
for the manufacturer-defined instruction notation for those processors)
instead of using the magic number to select
the CPU type. the CPU type.
.TP .TP
.BI -k .BI -k
@ -100,9 +92,17 @@ Definitions in any file may override previously defined functions.
If the function If the function
.IR acidinit () .IR acidinit ()
is defined, it will be invoked after all modules have been loaded. is defined, it will be invoked after all modules have been loaded.
See Then the function
.IR 2c (1) .IR acidmap ()
for information about creating will be invoked if defined.
.B /usr/local/plan9/acid/port
provides a definition of
.I acidmap
that attaches all the shared libraries being used by the target process
and then runs
.I acidtypes
.RI ( q.v. )
to create
.I acid .I acid
functions for examining data structures. functions for examining data structures.
.SS Language .SS Language

View file

@ -345,7 +345,7 @@ With no arguments,
prints the supplementary list. prints the supplementary list.
This command is largely superseded by plumbing This command is largely superseded by plumbing
(see (see
.IR plumb (6)). .IR plumb (7)).
.TP .TP
.B Kill .B Kill
Send a Send a
@ -355,20 +355,30 @@ note to
commands named as arguments. commands named as arguments.
.TP .TP
.B Local .B Local
When prefixed to a command In the Plan 9
run the .IR acme ,
command in the same file name space and environment variable group as this prefix causes a command to be run in
.IR acme . .IR acme 's own
The environment of the command file name space and environment variable group.
is restricted but is sufficient to run On Unix this is impossible.
.IR bind (1), .B Local
.IR 9fs is recognized as a prefix, but has no effect on the command being executed.
(see .\" .TP
.IR srv (4)), .\" .B Local
.IR import (4), .\" When prefixed to a command
etc., .\" run the
and to set environment variables such as .\" command in the same file name space and environment variable group as
.BR $objtype . .\" .IR acme .
.\" The environment of the command
.\" is restricted but is sufficient to run
.\" .IR bind (1),
.\" .IR 9fs
.\" (see
.\" .IR srv (4)),
.\" .IR import (4),
.\" etc.,
.\" and to set environment variables such as
.\" .BR $objtype .
.TP .TP
.B Load .B Load
Restore the state of Restore the state of
@ -662,9 +672,9 @@ MIPS-specific binaries for applications
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/acme .B /usr/local/plan9/src/cmd/acme
.br .br
.B /acme/bin/source/win .B /usr/local/plan9/src/cmd/9term/win.c
.br .br
.B /usr/local/plan9/src/cmd/awd.c .B /usr/local/plan9/bin/awd
.SH SEE ALSO .SH SEE ALSO
.IR acme (4) .IR acme (4)
.br .br

View file

@ -91,7 +91,7 @@ control characters or insert newlines.
is similar; it converts between is similar; it converts between
.SM UTF .SM UTF
and character values from the Unicode Standard (see and character values from the Unicode Standard (see
.IR utf (6)). .IR utf (7)).
If given a range of hexadecimal numbers, If given a range of hexadecimal numbers,
.I unicode .I unicode
prints a table of the specified Unicode characters \(em their values and prints a table of the specified Unicode characters \(em their values and
@ -157,5 +157,5 @@ table of characters and descriptions.
.SH "SEE ALSO" .SH "SEE ALSO"
.IR look (1) .IR look (1)
.IR tcs (1), .IR tcs (1),
.IR utf (6), .IR utf (7),
.IR font (6) .IR font (7)

122
man/man1/astro.1 Normal file
View file

@ -0,0 +1,122 @@
.TH ASTRO 1
.SH NAME
astro \- print astronomical information
.SH SYNOPSIS
.B astro
[
.B -dlpsatokm
]
[
.B -c
n
]
[
.B -C
d
]
[
.B -e
.I obj1
.I obj2
]
.SH DESCRIPTION
.I Astro
reports upcoming celestial events, by default for 24 hours starting now.
The options are:
.TP
.B d
Read the starting date.
A prompt gives the input
format.
.TP
.B l
Read the north latitude, west longitude, and elevation of the observation point.
A prompt gives the input format.
If
.B l
is missing, the initial position is read from the file
.BR /lib/sky/here .
.TP
.B c
Report for
.I n
(default 1) successive days.
.TP
.B C
Used with
.BR -c ,
set the interval to
.B d
days (or fractions of days).
.TP
.B e
Report distance between the centers of
objects, in arc seconds, during eclipses or occultations involving
.I obj1
and
.IR obj2 .
.TP
.B p
Print the positions of objects at the
given time rather than searching for interesting
conjunctions.
For each, the name is followed by
the right ascension (hours, minutes, seconds),
declination (degrees, minutes, seconds),
azimuth (degrees),
elevation (degrees),
and semidiameter (arc seconds).
For the sun and moon, the magnitude is also printed.
The first line of output presents the date and time,
sidereal time, and the latitude, longitude, and elevation.
.TP
.B s
Print output in English words suitable for speech synthesizers.
.TP
.B a
Include a list of artificial earth satellites for interesting events.
(There are no orbital elements for the satellites, so this option
is not usable.)
.TP
.B t
Read
ΔT
from standard input.
ΔT
is the difference between ephemeris and
universal time (seconds) due to the slowing of the earth's rotation.
ΔT
is normally calculated from an empirical formula.
This option is needed only for very accurate timing of
occultations, eclipses, etc.
.TP
.B o
Search for stellar occultations.
.TP
.B k
Print times in local time (`kitchen clock')
as described in the
.B timezone
environment variable.
.TP
.B m
Includes a single comet in the list of objects.
This is modified (in the source) to refer to an approaching comet
but in steady state
usually refers to the last interesting comet (currently Hale-Bopp, C/1995 O1).
.SH FILES
.TF /lib/sky/estartab
.TP
.B /lib/sky/estartab
ecliptic star data
.TP
.B /lib/sky/here
default latitude (N), longitude (W), and elevation (meters)
.SH SOURCE
.B /usr/local/plan9/src/cmd/astro
.SH SEE ALSO
.IR scat (1)
.SH BUGS
The
.B k
option reverts to GMT outside of 1970-2036.

292
man/man1/bc.1 Normal file
View file

@ -0,0 +1,292 @@
.TH BC 1
.SH NAME
bc \- arbitrary-precision arithmetic language
.SH SYNOPSIS
.B bc
[
.B -c
]
[
.B -l
]
[
.B -s
]
[
.I file ...
]
.SH DESCRIPTION
.I Bc
is an interactive processor for a language that resembles
C but provides arithmetic on numbers of arbitrary length with up
to 100 digits right of the decimal point.
It takes input from any files given, then reads
the standard input.
The
.B -l
argument stands for the name
of an arbitrary precision math library.
The
.B -s
argument suppresses the automatic display
of calculation results; all output is via the
.B print
command.
.PP
The following syntax for
.I bc
programs is like that of C;
.I L
means letter
.BR a - z ,
.I E
means expression,
.I S
means statement.
.TF length(E)
.TP
Lexical
.RS
.HP
comments are enclosed in
.B /* */
.HP
newlines end statements
.RE
.TP
Names
.IP
simple variables:
.I L
.br
array elements:
.IB L [ E ]
.br
The words
.BR ibase ,
.BR obase ,
and
.B scale
.TP
Other operands
.IP
arbitrarily long numbers with optional sign and decimal point.
.RS
.TP
.BI ( E )
.TP
.BI sqrt( E )
.TP
.BI length( E )
number of significant decimal digits
.TP
.BI scale( E )
number of digits right of decimal point
.TP
.IB L ( E , ... ,\fIE\fP)
function call
.RE
.TP
Operators
.RS
.HP
.B "+ - * / % ^\ "
.RB ( %
is remainder;
.B ^
is power)
.HP
.B "++ --\ "
.TP
.B "== <= >= != < >"
.TP
.B "= += -= *= /= %= ^="
.RE
.TP
Statements
.RS
.br
.I E
.br
.B {
.I S
.B ;
\&...
.B ;
.I S
.B }
.br
.B "print"
.I E
.br
.B "if ("
.I E
.B )
.I S
.br
.B "while ("
.I E
.B )
.I S
.br
.B "for ("
.I E
.B ;
.I E
.B ;
.I E
.B ")"
.I S
.br
null statement
.br
.B break
.br
.B quit
.br
\fL"\fRtext\fL"\fR
.RE
.TP
Function definitions
.RS
.br
.B define
.I L
.B (
.I L
.B ,
\&...
.B ,
.I L
.B ){
.PD0
.br
.B auto
.I L
.B ,
\&...
.B ,
.I L
.br
.I S
.B ;
\&...
.B ;
.I S
.br
.B return
.I E
.LP
.B }
.RE
.TP
Functions in
.B -l
math library
.RS
.TP
.BI s( x )
sine
.TP
.BI c( x )
cosine
.TP
.BI e( x )
exponential
.TP
.BI l( x )
log
.TP
.BI a( x )
arctangent
.TP
.BI j( "n, x" )
Bessel function
.RE
.PP
.DT
All function arguments are passed by value.
.PD
.PP
The value of an expression at the top level is printed
unless the main operator is an assignment or the
.B -s
command line argument is given.
Text in quotes, which may include newlines, is always printed.
Either semicolons or newlines may separate statements.
Assignment to
.B scale
influences the number of digits to be retained on arithmetic
operations in the manner of
.IR dc (1).
Assignments to
.B ibase
or
.B obase
set the input and output number radix respectively.
.PP
The same letter may be used as an array, a function,
and a simple variable simultaneously.
All variables are global to the program.
Automatic variables are pushed down during function calls.
In a declaration of an array as a function argument
or automatic variable
empty square brackets must follow the array name.
.PP
.I Bc
is actually a preprocessor for
.IR dc (1),
which it invokes automatically, unless the
.B -c
(compile only)
option is present.
In this case the
.I dc
input is sent to the standard output instead.
.SH EXAMPLE
Define a function to compute an approximate value of
the exponential.
Use it to print 10 values.
(The exponential function in the library gives better answers.)
.PP
.EX
scale = 20
define e(x) {
auto a, b, c, i, s
a = 1
b = 1
s = 1
for(i=1; 1; i++) {
a *= x
b *= i
c = a/b
if(c == 0) return s
s += c
}
}
for(i=1; i<=10; i++) print e(i)
.EE
.SH FILES
.B /sys/lib/bclib
mathematical library
.SH SOURCE
.B /usr/local/plan9/src/cmd/bc.y
.SH "SEE ALSO"
.IR dc (1),
.IR hoc (1)
.SH BUGS
No
.LR && ,
.LR || ,
or
.L !
operators.
.br
A
.L for
statement must have all three
.LR E s.
.br
A
.L quit
is interpreted when read, not when executed.

57
man/man1/bundle.1 Normal file
View file

@ -0,0 +1,57 @@
.TH BUNDLE 1
.SH NAME
bundle \- collect files for distribution
.SH SYNOPSIS
.B bundle
.I file ...
.SH DESCRIPTION
.I Bundle
writes on its standard output a shell script for
.IR rc (1)
or a Bourne shell
which, when executed,
will recreate the original
.IR files .
Its main use is for distributing small numbers of text files by
.IR mail (1).
.PP
Although less refined than standard archives from
.I 9ar
(see
.IR 9c (1))
or
.IR tar (1),
a
.IR bundle
file
is self-documenting and complete; little preparation is required on
the receiving machine.
.SH EXAMPLES
.TP
.L
bundle mkfile *.[ch] | mail kremvax!boris
Send a makefile to Boris together with related
.L .c
and
.L .h
files.
Upon receiving the mail, Boris may save the file sans postmark,
say in
.BR gift/horse ,
then do
.TP
.L
cd gift; rc horse; mk
.SH SOURCE
.B /usr/local/plan9/bin/bundle
.SH SEE ALSO
.I 9ar
(in
.IR 9c (1)),
.IR tar (1),
.IR mail (1)
.SH BUGS
.I Bundle
will not create directories and is unsatisfactory for non-text files.
.br
Beware of gift horses.

View file

@ -1,6 +1,6 @@
.TH CAT 1 .TH CAT 1
.SH NAME .SH NAME
cat, read \- catenate files cat, read, nobs \- catenate files
.SH SYNOPSIS .SH SYNOPSIS
.B cat .B cat
[ [
@ -16,6 +16,11 @@ cat, read \- catenate files
] [ ] [
.I file ... .I file ...
] ]
.br
nobs
[
.I file ...
]
.SH DESCRIPTION .SH DESCRIPTION
.I Cat .I Cat
reads each reads each
@ -57,15 +62,32 @@ causes it to read no more than
.I nline .I nline
lines. lines.
.PP .PP
Read always executes a single .I Read
always executes a single
.B write .B write
for each line of input, which can be helpful when for each line of input, which can be helpful when
preparing input to programs that expect line-at-a-time data. preparing input to programs that expect line-at-a-time data.
It never reads any more data from the input than it prints to the output. It never reads any more data from the input than it prints to the output.
.PP
.I Nobs
copies the named files to
standard output except that it removes all backspace
characters and the characters that precede them.
It is useful to use as
.B $PAGER
with the Unix version of
.IR man (1)
when run inside a
.I win
(see
.IR acme (1))
window.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/cat.c .B /usr/local/plan9/src/cmd/cat.c
.br .br
.B /usr/local/plan9/src/cmd/read.c .B /usr/local/plan9/src/cmd/read.c
.br
.B /usr/local/plan9/bin/nobs
.SH SEE ALSO .SH SEE ALSO
.IR cp (1) .IR cp (1)
.SH DIAGNOSTICS .SH DIAGNOSTICS

View file

@ -29,4 +29,4 @@ before processing.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/cleanname.c .B /usr/local/plan9/src/cmd/cleanname.c
.SH SEE ALSO .SH SEE ALSO
.IR cleanname (2). .IR cleanname (3).

73
man/man1/colors.1 Normal file
View file

@ -0,0 +1,73 @@
.TH COLORS 1
.SH NAME
getmap, colors \- display color map
.SH SYNOPSIS
.PP
.B colors
[
.B -r
.B -x
]
.PP
.B getmap
[
.I colormap
]
.SH DESCRIPTION
.I Colors
presents a grid showing the colors in the current color map.
If the display is true color,
.I colors
shows a grid of the RGBV color map
(see
.IR color (7)).
.PP
Clicking mouse button 1 over a color in the grid will display the map index for that color,
its
red, green, and blue components,
and the 32-bit hexadecimal color value as defined in
.IR allocimage (3).
If the
.B -x
option is specified, the components will also be listed in hexadecimal.
.PP
The
.B -r
option instead shows, in the same form, a grey-scale ramp.
.PP
A menu on mouse button 3 contains a single entry, to exit the program.
.PP
On 8-bit color-mapped displays,
.I getmap
loads the display's color map (default
.BR rgbv ).
The named
.I colormap
can be a file in the current directory or in the standard repository
.BR /lib/cmap .
It can also be a string of the form
.B gamma
or
.BI gamma N\f1 ,
where
.I N
is a floating point value for the gamma, defining the contrast for a monochrome map.
Similarly,
.B rgamma
and
.BI rgamma N
define a reverse-video monochrome map.
Finally, the names
.B screen
or
.B display
or
.B vga
are taken as synonyms for the current color map stored in the display hardware.
.SH FILES
.B /lib/cmap
directory of color map files
.SH SOURCE
.B /usr/local/plan9/src/cmd/draw/colors.c
.SH SEE ALSO
.IR color (7)

46
man/man1/core.1 Normal file
View file

@ -0,0 +1,46 @@
.TH CORE 1
.SH NAME
core \- print information about dead processes
.SH SYNOPSIS
.B core
[
.I dir
|
.I corefile
]...
.SH DESCRIPTION
.I Core
prints information about dead processes that have
been saved as core dumps.
.PP
Core reads its arguments in order.
If a directory is encountered,
.I core
reads every core file named
.B core.*
or
.B *.core
in that directory.
.PP
For each core file read,
.I core
prints the date and time the core was generated,
the command that generated it, and a short stack trace
at the time of the core dump.
.PP
If no arguments are given,
.I core
searches the directory
.B $COREDIR
for core files;
if
.B $COREDIR
is not set,
.I core
searches the current directory.
.SH SOURCE
.B /usr/local/plan9/src/cmd/core.c
.SH "SEE ALSO
.IR acid (1),
.IR db (1),
.IR core (5)

147
man/man1/crop.1 Normal file
View file

@ -0,0 +1,147 @@
.TH CROP 1
.SH NAME
crop, iconv \- frame, crop, and convert image
.SH SYNOPSIS
.B crop
[
.BI -c
.I red
.I green
.I blue
]
[
.B -i
.I n
|
.B -x
.I dx
|
.B -y
.I dy
|
.B -r
.I minx
.I miny
.I maxx
.I maxy
]
[
.B -t
.I tx
.I ty
]
[
.B -b
.I red
.I green
.I blue
]
[
.I file
]
.PP
.B iconv
[
.B -u
] [
.B -c
.I chandesc
]
[
.I file
]
.SH DESCRIPTION
.I Crop
reads an
.IR image (7)
file (default standard input), crops it, and writes it as a compressed
.IR image (7)
file to standard output.
There are two ways to specify a crop, by color value or by geometry.
They may be combined in a single run of
.IR crop ,
in which case the color value crop will be done first.
.PP
The
.B -c
option takes a red-green-blue triplet as described in
.IR color (3).
(For example, white
is
.B 255
.B 255
.BR 255 .)
The corresponding color is used as a value to be cut from the outer
edge of the picture; that is, the image is cropped to remove the maximal
outside rectangular strip in which every pixel has the specified color.
.PP
The
.B -i
option insets the image rectangle by a constant amount,
.IR n ,
which may be negative to generate extra space around the image.
The
.B -x
and
.B -y
options are similar, but apply only to the
.I x
or
.I y
coordinates of the image.
.PP
The
.B -r
option specifies an exact rectangle.
.PP
The
.B -t
option specifies that the image's coordinate system should
be translated by
.IR tx ,
.IR ty
as the last step of processing.
.PP
The
.B -b
option specifies a background color to be used to fill around the image
if the cropped image is larger than the original, such as if the
.B -i
option is given a negative argument.
This can be used to draw a monochrome frame around the image.
The default color is black.
.PP
.I Iconv
changes the format of pixels in the image
.I file
(default standard input) and writes the resulting image to standard output.
Pixels in the image are converted according to the channel descriptor
.IR chandesc ,
(see
.IR image (7)).
For example, to convert a 4-bit-per-pixel grey-scale image to an 8-bit-per-pixel
color-mapped image,
.I chandesc
should be
.BR m8 .
If
.I chandesc
is not given, the format is unchanged.
The output image is by default compressed; the
.B -u
option turns off the compression.
.SH EXAMPLE
To crop white edges off the picture and add a ten-pixel pink border,
.IP
.EX
crop -c 255 255 255 -i -10 -b 255 150 150 imagefile > cropped
.EE
.SH SOURCE
.B /usr/local/plan9/src/cmd/draw/crop.c
.SH SEE ALSO
.IR image (7),
.IR color (3)
.SH BUGS
.I Iconv
should be able to do Floyd-Steinberg error diffusion or dithering
when converting to small image depths.

View file

@ -8,8 +8,8 @@ date, clock \- date and time
] [ ] [
.I seconds .I seconds
] ]
.br .\" .br
.B clock .\" .B clock
.SH DESCRIPTION .SH DESCRIPTION
Print the date, in the format Print the date, in the format
.PP .PP
@ -28,31 +28,31 @@ epoch, 00:00:00 GMT, January 1, 1970.
The conversion from Greenwich Mean Time to local time depends on the The conversion from Greenwich Mean Time to local time depends on the
.B $timezone .B $timezone
environment variable; see environment variable; see
.IR ctime (2). .IR ctime (3).
.PP .PP
If the optional argument If the optional argument
.I seconds .I seconds
is present, it is used as the time to convert rather than is present, it is used as the time to convert rather than
the real time. the real time.
.SH FILES .\" .SH FILES
.TF /adm/timezone/local .\" .TF /adm/timezone/local
.TP .\" .TP
.B /env/timezone .\" .B /env/timezone
Current timezone name and adjustments. .\" Current timezone name and adjustments.
.TP .\" .TP
.B /adm/timezone .\" .B /adm/timezone
A directory containing timezone tables. .\" A directory containing timezone tables.
.TP .\" .TP
.B /adm/timezone/local .\" .B /adm/timezone/local
Default timezone file, copied by .\" Default timezone file, copied by
.IR init (8) .\" .IR init (8)
into .\" into
.BR /env/timezone . .\" .BR /env/timezone .
.PD .\" .PD
.PP .\" .PP
.I Clock .\" .I Clock
draws a simple analog clock in its window. .\" draws a simple analog clock in its window.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/date.c .B /usr/local/plan9/src/cmd/date.c
.br .\" .br
.B /usr/local/plan9/src/cmd/clock.c .\" .B /usr/local/plan9/src/cmd/draw/clock.c

View file

@ -33,9 +33,7 @@ specifies the memory image of a process.
A A
.I pid .I pid
gives the id of an executing process to be accessed via gives the id of an executing process to be accessed via
.IR ptrace (2) .IR ptrace (2).
or
.IR proc (5).
A A
.I corefile .I corefile
specifies the name of a core dump (see specifies the name of a core dump (see
@ -949,7 +947,6 @@ is one the breakpoint will fire.
Beware that local variables may be stored in registers; see the Beware that local variables may be stored in registers; see the
BUGS section. BUGS section.
.SH "SEE ALSO" .SH "SEE ALSO"
.IR 9nm (1),
.IR acid (1) .IR acid (1)
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/db .B /usr/local/plan9/src/cmd/db

View file

@ -67,7 +67,7 @@ requests.
Remove titles, attachments, etc., as well as ordinary Remove titles, attachments, etc., as well as ordinary
.IR troff .IR troff
constructs, from constructs, from
.IR ms (6) .IR ms (7)
or or
.I mm .I mm
documents. documents.
@ -93,7 +93,7 @@ files.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/deroff.c .B /usr/local/plan9/src/cmd/deroff.c
.br .br
.B /usr/local/plan9/src/cmd/tex/local/delatex.c .B /usr/local/plan9/src/cmd/delatex.lx
.SH "SEE ALSO" .SH "SEE ALSO"
.IR troff (1), .IR troff (1),
.IR tex (1), .IR tex (1),

View file

@ -1,4 +1,4 @@
.TH DICT 7 .TH DICT 1
.SH NAME .SH NAME
dict \- dictionary browser dict \- dictionary browser
.SH SYNOPSIS .SH SYNOPSIS
@ -46,7 +46,7 @@ Print a pronunciation key.
.PD .PD
.PP .PP
Patterns are regular expressions (see Patterns are regular expressions (see
.IR regexp (6)), .IR regexp (7)),
with an implicit leading with an implicit leading
.L ^ .L ^
and trailing and trailing
@ -146,18 +146,22 @@ Otherwise, the default command is the previous command.
Other files in Other files in
.BR /lib . .BR /lib .
.SH "SEE ALSO" .SH "SEE ALSO"
.IR regexp (6) .IR regexp (7)
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/dict .B /usr/local/plan9/src/cmd/dict
.SH BUGS .SH BUGS
A font with wide coverage of the Unicode Standard A font with wide coverage of the Unicode Standard
should be used for best results. should be used for best results.
(Try (Try
.BR /lib/font/bit/pelm/unicode.9.font .) .BR /usr/local/plan9/font/pelm/unicode.9.font .)
.br .PP
If the If the
.I pattern .I pattern
doesn't begin with doesn't begin with
a few literal characters, matching takes a long time. a few literal characters, matching takes a long time.
.br .PP
The dictionaries are not distributed outside Bell Labs. The dictionaries are not distributed outside Bell Labs,
though see
.B /usr/local/plan9/dict/README
for information on using free dictionaries prepared
by Project Gutenberg.

56
man/man1/doctype.1 Normal file
View file

@ -0,0 +1,56 @@
.TH DOCTYPE 1
.SH NAME
doctype \- intuit command line for formatting a document
.SH SYNOPSIS
.B doctype
[
.I option ...
] [
.I file
]
\&...
.SH DESCRIPTION
.I Doctype
examines a
.IR troff (1)
input file to deduce the appropriate text formatting command
and prints it on standard output.
.I Doctype
recognizes input for
.IR troff (1),
related preprocessors like
.IR eqn (1),
and the
.IR ms (7)
and
.I mm
macro packages.
.PP
Option
.B -n
invokes
.I nroff
instead of
.IR troff .
Other options are passed to
.IR troff .
.SH EXAMPLES
.TP
.L
eval `{doctype chapter.?} | lp
Typeset files named
.BR chapter.0 ,
.BR chapter.1 ,
\&...
.SH SOURCE
.B /usr/local/plan9/bin/doctype
.SH SEE ALSO
.IR troff (1),
.IR eqn (1),
.IR tbl (1),
.IR pic (1),
.IR grap (1),
.IR ms (7),
.IR man (7)
.SH BUGS
In true A.I. style, its best guesses are inspired rather than accurate.

View file

@ -96,7 +96,7 @@ beginning of a line.
supports the supports the
.I "regular expression" .I "regular expression"
notation described in notation described in
.IR regexp (6). .IR regexp (7).
Regular expressions are used in addresses to specify Regular expressions are used in addresses to specify
lines and in one command lines and in one command
(see (see
@ -673,7 +673,7 @@ and all characters after the last newline.
.SH "SEE ALSO" .SH "SEE ALSO"
.IR sam (1), .IR sam (1),
.IR sed (1), .IR sed (1),
.IR regexp (6) .IR regexp (7)
.SH DIAGNOSTICS .SH DIAGNOSTICS
.BI ? name .BI ? name
for inaccessible file; for inaccessible file;

View file

@ -316,7 +316,7 @@ when all else fails.
.B /sys/lib/troff/font/devutf .B /sys/lib/troff/font/devutf
font descriptions for PostScript font descriptions for PostScript
.SH SOURCE .SH SOURCE
.B /sys/src/cmd/eqn .B /usr/local/plan9/src/cmd/eqn
.SH "SEE ALSO" .SH "SEE ALSO"
.IR troff (1), .IR troff (1),
.IR tbl (1) .IR tbl (1)

View file

@ -36,5 +36,5 @@ character, respectively.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/freq.c .B /usr/local/plan9/src/cmd/freq.c
.SH SEE ALSO .SH SEE ALSO
.IR utf (6), .IR utf (7),
.IR wc (1) .IR wc (1)

22
man/man1/fsize.1 Normal file
View file

@ -0,0 +1,22 @@
.TH FSIZE 1
.SH NAME
fsize, mtime \- print file information
.SH SYNOPSIS
.B fsize
.I file ...
.PP
.B mtime
.I file ...
.SH DESCRIPTION
.I Fsize
prints the name and size of each of the files.
.PP
.I Mtime
prints the name and modification time (in seconds since the epoch)
of each of the files.
.SH SOURCE
.B /usr/local/plan9/src/cmd/fsize.c
.br
.B /usr/local/plan9/src/cmd/mtime.c
.SH BUGS
The output formats of the two programs are different.

View file

@ -404,7 +404,7 @@ copy thru / circle at $1,$2 /
.B /sys/lib/grap.defines .B /sys/lib/grap.defines
definitions of standard plotting characters, e.g., bullet definitions of standard plotting characters, e.g., bullet
.SH SOURCE .SH SOURCE
.B /sys/src/cmd/grap .B /usr/local/plan9/src/cmd/grap
.SH "SEE ALSO" .SH "SEE ALSO"
.IR pic (1), .IR pic (1),
.IR troff (1) .IR troff (1)

View file

@ -135,7 +135,7 @@ If a specified lower limit exceeds the upper limit,
the axis the axis
is reversed. is reversed.
.SH SOURCE .SH SOURCE
.B /sys/src/cmd/graph .B /usr/local/plan9/src/cmd/graph
.SH "SEE ALSO" .SH "SEE ALSO"
.IR plot (1), .IR plot (1),
.IR grap (1) .IR grap (1)

View file

@ -1,6 +1,6 @@
.TH GREP 1 .TH GREP 1
.SH NAME .SH NAME
grep \- search a file for a pattern grep, g \- search a file for a pattern
.SH SYNOPSIS .SH SYNOPSIS
.B grep .B grep
[ [
@ -10,6 +10,14 @@ grep \- search a file for a pattern
[ [
.I file ... .I file ...
] ]
.B g
[
.I option ...
]
.I pattern
[
.I file ...
]
.SH DESCRIPTION .SH DESCRIPTION
.I Grep\^ .I Grep\^
searches the input searches the input
@ -18,7 +26,7 @@ searches the input
for lines that match the for lines that match the
.IR pattern , .IR pattern ,
a regular expression as defined in a regular expression as defined in
.IR regexp (6) .IR regexp (7)
with the addition of a newline character as an alternative with the addition of a newline character as an alternative
(substitute for (substitute for
.BR | ) .BR | )
@ -90,14 +98,26 @@ in single quotes
An expression starting with '*' An expression starting with '*'
will treat the rest of the expression will treat the rest of the expression
as literal characters. as literal characters.
.PP
.I G
invokes grep with
.B -n
and forces tagging of output lines by file name.
If no files are listed, it searches all files matching
.IP
.EX
*.C *.b *.c *.h *.m *.cc *.java *.py *.tex *.ms
.EE
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/grep .B /usr/local/plan9/src/cmd/grep
.br
.B /usr/local/plan9/bin/g
.SH SEE ALSO .SH SEE ALSO
.IR ed (1), .IR ed (1),
.IR awk (1), .IR awk (1),
.IR sed (1), .IR sed (1),
.IR sam (1), .IR sam (1),
.IR regexp (6) .IR regexp (7)
.SH DIAGNOSTICS .SH DIAGNOSTICS
Exit status is null if any lines are selected, Exit status is null if any lines are selected,
or non-null when no lines are selected or an error occurs. or non-null when no lines are selected or an error occurs.

160
man/man1/gzip.1 Normal file
View file

@ -0,0 +1,160 @@
.TH GZIP 1
.SH NAME
gzip, gunzip, bzip2, bunzip2, zip, unzip, \- compress and expand data
.SH SYNOPSIS
.B gzip
.RB [ -cvD [ 1-9 ]]
.RI [ file
.BR ... ]
.PP
.B gunzip
.RB [ -ctTvD ]
.RI [ file
.BR ... ]
.PP
.B bzip2
.RB [ -cvD [ 1-9 ]]
.RI [ file
.BR ... ]
.PP
.B bunzip2
.RB [ -cvD ]
.RI [ file
.BR ... ]
.PP
.B zip
.RB [ -vD [ 1-9 ]]
.RB [ -f
.IR zipfile ]
.I file
.RB [ ... ]
.PP
.B unzip
.RB [ -cistTvD ]
.RB [ -f
.IR zipfile ]
.IR [ file
.BR ... ]
.SH DESCRIPTION
.PP
.I Gzip
encodes files with a hybrid Lempel-Ziv 1977 and Huffman compression algorithm
known as
.BR deflate .
Most of the time, the resulting file is smaller,
and will never be much bigger.
Output files are named by taking the last path element of each file argument
and appending
.BR .gz ;
if the resulting name ends with
.BR .tar.gz ,
it is converted to
.B .tgz
instead.
.I Gunzip
reverses the process.
Its output files are named by taking the last path element of each file argument,
converting
.B .tgz
to
.BR .tar.gz ,
and stripping any
.BR .gz ;
the resulting name must be different from the original name.
.PP
.I Bzip2
and
.I bunzip2
are similar in interface to
.I gzip
and
.IR gunzip ,
but use a modified Burrows-Wheeler block sorting
compression algorithm.
The default suffix for output files is
.BR .bz2 ,
with
.B .tar.bz2
becoming
.BR .tbz .
.I Bunzip2
recognizes the extension
.B .tbz2
as a synonym for
.BR .tbz .
.PP
.I Zip
encodes the named files and places the results into the archive
.IR zipfile ,
or the standard output if no file is given.
.I Unzip
extracts files from an archive created by
.IR zip .
If no files are named as arguments, all of files in the archive are extracted.
A directory's name implies all recursively contained files and subdirectories.
.PP
None of these programs removes the original files.
If the process fails, the faulty output files are removed.
.PP
The options are:
.TP 1i
.B -c
Write to standard output rather than creating an output file.
.TP
.B -i
Convert all archive file names to lower case.
.TP
.B -s
Streaming mode. Looks at the file data adjacent to each compressed file
rather than seeking in the central file directory.
This is the mode used by
.I unzip
if no
.I zipfile
is specified.
If
.B -s
is given,
.B -T
is ignored.
.TP
.B -t
List matching files in the archive rather than extracting them.
.TP
.B -T
Set the output time to that specified in the archive.
.TP
.BR -1 " .. " -9
Sets the compression level.
.B -1
is tuned for speed,
.B -9
for minimal output size.
The best compromise is
.BR -6 ,
the default.
.TP
.B -v
Produce more descriptive output.
With
.BR -t ,
adds the uncompressed size in bytes and the modification time to the output.
Without
.BR -t ,
prints the names of files on standard error as they are compressed or decompressed.
.TP
.B -D
Produce debugging output.
.SH SOURCE
.B /usr/local/plan9/src/cmd/gzip
.br
.B /usr/local/plan9/src/cmd/bzip2
.SH SEE ALSO
.IR tar (1),
.IR compress (1)
.SH BUGS
.I Unzip
can only extract files which are uncompressed or compressed
with the
.B deflate
compression scheme. Recent zip files fall into this category.

View file

@ -106,21 +106,21 @@ in a line is significant.
.SH EXAMPLES .SH EXAMPLES
.TP .TP
.L .L
sort -t: +1 /adm/users | join -t: -1 2 -a 1 -e "" - bdays sort /etc/passwd | join -t: -1 1 -a 1 -e "" - bdays
Add birthdays to the Add birthdays to the
.B /adm/users .B /etc/passwd
file, leaving unknown file, leaving unknown
birthdays empty. birthdays empty.
The layout of The layout of
.B /adm/users .B /adm/users
is given in is given in
.IR users (6); .IR passwd (5);
.B bdays .B bdays
contains sorted lines like contains sorted lines like
.LR "ken:Feb\ 4,\ 1953" . .LR "ken:Feb\ 4,\ 1953" .
.TP .TP
.L .L
tr : ' ' </adm/users | sort -k 3 3 >temp tr : ' ' </etc/passwd | sort -k 3 3 >temp
.br .br
.ns .ns
.TP .TP
@ -145,4 +145,3 @@ the sequence is that of
.BI -k y , y\f1. .BI -k y , y\f1.
.br .br
One of the files must be randomly accessible. One of the files must be randomly accessible.

243
man/man1/jpg.1 Normal file
View file

@ -0,0 +1,243 @@
.TH JPG 1
.SH NAME
jpg, gif, png, ppm, bmp, yuv, ico, togif, toppm, topng, toico \- view and convert pictures
.SH SYNOPSIS
.B jpg
[
.B -39cdefFkJrtv
] [
.I file ...
]
.br
.B gif
[
.B -39cdektv
] [
.I file ...
]
.br
.B png
[
.B -39cdektv
] [
.I file ...
]
.br
.B ppm
[
.B -39cdektv
] [
.I file ...
]
.br
.B bmp
[
.I file
]
.br
.B yuv
[
.I file
]
.PP
.B togif
[
.B -c
.I comment
] [
.B -l
.I loopcount
] [
.B -d
.I msec
] [
.B -t
.I transindex
] [
.I file ...
[
.B -d
.I msec
]
.I file ...
]
.br
.B toppm
[
.B -c
.I comment
] [
.I file
]
.br
.B topng
[
.B -c
.I comment
] [
[
.B -g
.I gamma
] [
.I file
]
.PP
.B ico
[
.I file
]
.br
.B toico
[
.I file ...
]
.SH DESCRIPTION
These programs read, display, and write image files in public formats.
.IR Jpg ,
.IR gif ,
.IR png ,
.IR ppm ,
.IR bmp ,
and
.IR yuv .
read files in the corresponding formats and, by default, display
them in the current window; options cause them instead to convert the images
to Plan 9 image format and write them to standard output.
.IR Togif ,
.IR Toppm ,
and
.I topng
read Plan 9 images files, convert them to GIF, PPM, or PNG, and write them to standard output.
.PP
The default behavior of
.IR jpg ,
.IR gif ,
and
.IR ppm
is to display the
.IR file ,
or standard input if no file is named.
Once a file is displayed, typing a character causes the program to display the next image.
Typing a
.BR q ,
DEL, or control-D exits the program.
For a more user-friendly interface, use
.IR page (1),
which invokes these programs to convert the images to standard format,
displays them, and offers scrolling, panning, and menu-driven navigation among the files.
.PP
These programs share many options:
.TP
.B -e
Disable Floyd-Steinberg error diffusion, which is used to improve the appearance
of images on color-mapped displays, typically with 8 bits per pixel.
Primarily useful for debugging; if the display has true RGB color, the image
will be displayed in full glory.
.TP
.B -k
Convert and display the image as a black and white (really grey-scale) image.
.TP
.B -v
Convert the image to an RGBV color-mapped image, even if the
display has true RGB color.
.TP
.B -d
Suppress display of the image; this is set automatically by
any of the following options:
.TP
.B -c
Convert the image to a Plan 9 representation, as defined by
.IR image (7),
and write it to standard output.
.TP
.B -9
Like
.BR -c ,
but produce an uncompressed image.
This saves processing time, particularly when the output is
being piped to another program such as
.IR page (1),
since it avoids compression and decompression.
.TP
.B -t
Convert the image, if it is in color, to a true color RGB image.
.TP
.B -3
Like
.BR -t ,
but force the image to RGB even if it is originally grey-scale.
.PD
.PP
.I Jpg
has two extra options used to process the output of the LML
video card:
.TP
.B -f
Merge two adjacent images, which represent the two fields of a video picture,
into a single image.
.TP
.B -F
The input is a motion JPEG file, with multiple images representing frames of the movie. Sets
.BR -f .
.PD
.PP
The
.IR togif
and
.IR toppm
programs go the other way: they convert from Plan 9 images to GIF and PPM,
and have no display capability.
Both accept an option
.B -c
to set the comment field of the resulting file.
If there is only one input picture,
.I togif
converts the image to GIF format.
If there are many
.IR files ,
though, it will assemble them into an animated GIF file.
The options control this process:
.TP
.BI -l loopcount
By default, the animation will loop forever;
.I loopcount
specifies how many times to loop.
A value of zero means loop forever and a negative value means
to stop after playing the sequence once.
.TP
.BI -d msec
By default, the images are displayed as fast as they can be rendered.
This option specifies the time, in milliseconds, to pause while
displaying the next named
.IR file .
.PP
.I Gif
translates files that contain a `transparency' index by attaching
an alpha channel to the converted image.
.PP
.I Ico
displays a Windows icon (.ico) file. If no file is
specified,
.I ico
reads from standard input.
Icon files
contain sets of icons represeted by an image and a mask.
Clicking the right button pops up a menu that lets you
write any icon's image as a Plan 9 image (\fIwidth\fBx\fIheight\fB.image),
write any icon's mask as a Plan 9 image (\fIwidth\fBx\fIheight\fB.mask),
or exit. Selecting one of the write menu items yields a sight cursor.
Move the sight over the icon and right click again to write.
.PP
.I Toico
takes a list of Plan 9 image files (or standard input) and creates
a single icon file. The masks in the icon file will be the white
space in the image. The icon file is written to standard output.
.SH SOURCE
.B /usr/local/plan9/src/cmd/jpg
.SH "SEE ALSO"
.IR page (1),
.IR image (7).
.SH BUGS
Writing an animated GIF using
.I togif
is a clumsy undertaking.

69
man/man1/kill.1 Normal file
View file

@ -0,0 +1,69 @@
.TH KILL 1
.SH NAME
kill, slay, start, stop \- print commands to manipulate processes
.SH SYNOPSIS
.B kill
.I name ...
.PP
.B slay
.I name ...
.PP
.B start
.I name ...
.PP
.B stop
.I name ...
.PP
.B broke
[
.I user
]
.SH DESCRIPTION
.I Kill
prints commands that will cause all processes with
.I name
and owned by the current user to be terminated.
Each command is commented with an output line from
.IR ps (1)
describing the process that would be killed.
Use the
.B send
command of
.IR 9term (1),
or pipe the output of
.I kill
into
.IR rc (1)
or
.IR sh (1)
to execute the commands.
.PP
.I Kill
suggests sending a Unix
.B TERM
signal to the process;
sending a
.B KILL
signal is a surer, if heavy handed, kill,
but is necessary if the offending process is
ignoring signals.
The
.I slay
command prints commands to do this.
.PP
.I Stop
prints commands to pause execution of processes
by sending them the
.B STOP
signal.
.PP
.I Start
prints commands to restart stopped processes by sending them
the
.B CONT
signal.
.SH SOURCE
.B /usr/local/plan9/bin
.SH "SEE ALSO"
.IR ps (1),
.IR notify (3)

71
man/man1/label.1 Normal file
View file

@ -0,0 +1,71 @@
.TH LABEL 1
.SH NAME
label, awd \- set window label
.SH SYNOPSIS
.B label
.I string
.br
.B awd
.SH DESCRIPTION
.I Label
sets the label of the current
.I win
(see
.IR acme (1))
or X terminal window
.RI ( e.g.,
.IR 9term (1)
or
.IR xterm (1))
by echoing a special control sequence to standard output.
.PP
.I Acme
and
.I 9term
windows assume the label is a directory name.
When unrooted file names are plumbed in the window,
they are evaluated relative to the directory named in the label.
.SH EXAMPLE
One can use the following
.IR sh (1)
function to keep the label up-to-date in response to
.I cd
commands:
.IP
.EX
_cd () {
\ecd "$@" &&
case $- in
*i*)
awd
esac
}
alias cd=_cd
cd .
.EE
.PP
.IR Rc (1)
installs a similar
.B fn
.B cd
at startup if there is not already a function named
.BR cd :
.IP
.EX
fn cd {
builtin cd $1 && flag i && awd
}
.EE
.SH SOURCE
.B /usr/local/plan9/bin/label
.br
.B /usr/local/plan9/bin/awd
.SH BUGS
.I Awd
is also documented in
.IR acme (1).
.PP
.I Awd
does not append the
.BI - label
suffix that it does on Plan 9.

81
man/man1/lex.1 Normal file
View file

@ -0,0 +1,81 @@
.TH LEX 1
.SH NAME
lex \- generator of lexical analysis programs
.SH SYNOPSIS
.B lex
[
.B -tvn9
]
[
.I file ...
]
.SH DESCRIPTION
.I Lex
generates programs to be used in simple lexical analysis of text.
The input
.I files
(standard input default)
contain regular expressions
to be searched for and actions written in C to be executed when
expressions are found.
.PP
A C source program,
.B lex.yy.c
is generated.
This program, when run, copies unrecognized portions of
the input to the output,
and executes the associated
C action for each regular expression that is recognized.
.PP
The options have the following meanings.
.TP
.B -t
Place the result on the standard output instead of in file
.BR lex.yy.c .
.TP
.B -v
Print a one-line summary of statistics of the generated analyzer.
.TP
.B -n
Opposite of
.BR -v ;
.B -n
is default.
.TP
.B -9
Adds code to be able to compile through the native C compilers.
.SH EXAMPLES
This program converts upper case to lower,
removes blanks at the end of lines,
and replaces multiple blanks by single blanks.
.PP
.EX
%%
[A-Z] putchar(yytext[0]+\'a\'-\'A\');
[ ]+$
[ ]+ putchar(\' \');
.EE
.SH FILES
.TF /sys/lib/lex/ncform
.TP
.B lex.yy.c
output
.TP
.B /sys/lib/lex/ncform
template
.SH "SEE ALSO"
.IR yacc (1),
.IR sed (1)
.br
M. E. Lesk and E. Schmidt,
`LEX\(emLexical Analyzer Generator',
.I
Unix Research System Programmer's Manual,
Tenth Edition, Volume 2.
.SH SOURCE
.B /usr/local/plan9/src/cmd/lex
.SH BUGS
Cannot handle
.SM UTF.
.br
The asteroid to kill this dinosaur is still in orbit.

86
man/man1/look.1 Normal file
View file

@ -0,0 +1,86 @@
.TH LOOK 1
.SH NAME
look \- find lines in a sorted list
.SH SYNOPSIS
.B look
[
.BI -dfnixt c
]
[
.I string
]
[
.I file
]
.SH DESCRIPTION
.I Look
consults a sorted
.I file
and prints all lines that begin with
.IR string .
It uses binary search.
.PP
The following options are recognized.
Options
.B dfnt
affect comparisons as in
.IR sort (1).
.TP
.B -i
Interactive.
There is no
.I string
argument; instead
.I look
takes lines from the standard input as strings to be looked up.
.TP
.B -x
Exact.
Print only lines of the file whose key matches
.I string
exactly.
.TP
.B -d
`Directory' order:
only letters, digits,
tabs and blanks participate in comparisons.
.TP
.B -f
Fold.
Upper case letters compare equal to lower case.
.TP
.B -n
Numeric comparison with initial string of digits, optional minus sign,
and optional decimal point.
.TP
.BR -t [ \f2c\f1 ]
Character
.I c
terminates the sort key in the
.IR file .
By default, tab terminates the key. If
.I c
is missing the entire line comprises the key.
.PP
If no
.I file
is specified,
.B /lib/words
is assumed, with collating sequence
.BR df .
.SH FILES
.B /lib/words
.SH SOURCE
.B /usr/local/plan9/src/cmd/look.c
.SH "SEE ALSO"
.IR sort (1),
.IR grep (1)
.SH DIAGNOSTICS
The exit status is
.B \&"not found"
if no match is found, and
.B \&"no dictionary"
if
.I file
or the default dictionary cannot be opened.

View file

@ -10,7 +10,7 @@ ls, lc \- list contents of directory
.PP .PP
.B lc .B lc
[ [
.B -dlmnqrstuFQ .B -dlmnpqrstuFQ
] ]
.I name ... .I name ...
.SH DESCRIPTION .SH DESCRIPTION
@ -60,7 +60,7 @@ Print only the final path element of each file name.
List the List the
.I qid .I qid
(see (see
.IR stat (2)) .IR stat (3))
of each file; the printed fields are in the order of each file; the printed fields are in the order
path, version, and type. path, version, and type.
.TP .TP
@ -157,6 +157,6 @@ if none of the above permissions is granted.
.br .br
.B /usr/local/plan9/bin/lc .B /usr/local/plan9/bin/lc
.SH SEE ALSO .SH SEE ALSO
.IR stat (2) .IR stat (3)
.IR mc (1) .IR mc (1)

105
man/man1/man.1 Normal file
View file

@ -0,0 +1,105 @@
.TH MAN 1
.SH NAME
man, lookman \- print or find pages of this manual
.SH SYNOPSIS
.B man
[
.I option ...
]
[
.I section ...
]
.I title ...
.PP
.B lookman
.I key ...
.PP
.B sig
.I function ...
.SH DESCRIPTION
.I Man
locates and prints pages of this manual named
.I title
in the specified
.IR sections .
.I Title
is given in lower case.
Each
.I section
is a number;
pages marked (2S), for example,
belong to chapter 2.
If no
.I section
is specified, pages
in all sections are printed.
Any name from the
.SM NAME
section at the top of the page will serve as a
.IR title .
.PP
The options are:
.TP
.B -p
Run
.IR proof (1)
on the specified man pages.
.TP
.B -P
Run
.IR page (1)
on the specified man pages.
.TP
.B -t
Run
.I troff
and send its output
to standard output.
.TP
.B -n
(Default)
Print the pages on the standard output using
.IR nroff .
.PP
.B Lookman
prints the names of all manual sections that contain
all of the
.I key
words given on the command line.
.PP
.B Sig
prints the signature (i.e. C definition) of the
.IR function 's
given on the command line.
.SH FILES
.TF /sys/lib/man/lookman/index
.TP
.B /sys/man/?/*
.I troff
source for manual; this page is
.B /sys/man/1/man
.TP
.B /sys/man/?/INDEX
indices searched to find pages corresponding to titles
.TP
.B /sys/lib/man/secindex
command to make an index for a given section
.TP
.B /sys/lib/man/lookman/index
index for
.I lookman
.SH SOURCE
.B /usr/local/plan9/bin/9man
.br
.B /usr/local/plan9/bin/lookman
.SH "SEE ALSO"
.IR proof (1)
.SH BUGS
The manual was intended to be typeset; some detail is sacrificed on text terminals.
.br
There is no automatic mechanism to keep the indices up to date.
.br
Except for special cases, it doesn't recognize things that should be run through
.I tbl
and/or
.IR eqn .

675
man/man1/map.1 Normal file
View file

@ -0,0 +1,675 @@
.TH MAP 1
.SH NAME
map, mapdemo \- draw maps on various projections
.SH SYNOPSIS
.B map
.I projection
[
.I option ...
]
.PP
.B mapdemo
.PP
.SH DESCRIPTION
.I Map
prepares on the standard output a
map suitable for display by any
plotting filter described in
.IR plot (1).
A menu of projections is produced in response to an unknown
.IR projection .
.I Mapdemo
is a short course in mapping.
.PP
The default data for
.I map
are world shorelines.
Option
.B -f
accesses more detailed data
classified by feature.
.TP
.BR -f " [ \fIfeature\fR ... ]"
Features are ranked 1 (default) to 4 from major to minor.
Higher-numbered ranks include all lower-numbered ones.
Features are
.RS
.TF country[1-3]
.TP
.BR shore [ 1 - 4 ]
seacoasts, lakes, and islands; option
.B -f
always shows
.B shore1
.TP
.BR ilake [ 1 - 2 ]
intermittent lakes
.TP
.BR river [ 1 - 4 ]
rivers
.TP
.BR iriver [ 1 - 3 ]
intermittent rivers
.TP
.BR canal [ 1 - 3 ]
.BR 3 =irrigation
canals
.TP
.BR glacier
.TP
.BR iceshelf [ 12 ]
.TP
.BR reef
.TP
.BR saltpan [ 12 ]
.TP
.BR country [ 1 - 3 ]
.BR 2 =disputed
boundaries,
.BR 3 =indefinite
boundaries
.TP
.BR state
states and provinces (US and Canada only)
.PD
.RE
.PP
In other options
coordinates are in degrees, with north latitude
and west longitude counted as positive.
.TP 0
.BI -l " S N E W"
Set the southern and northern latitude
and the eastern and western longitude limits.
Missing arguments are filled out from the list
\-90, 90, \-180, 180,
or lesser limits suitable to the
projection at hand.
.TP
.BI -k " S N E W
Set the scale as if for a map with limits
.B -l
.I "S N E W"\f1.
Do not consider any
.B -l
or
.B -w
option in setting scale.
.TP
.BI -o " lat lon rot"
Orient the map in a nonstandard position.
Imagine a transparent gridded sphere around the globe.
Turn the overlay about the North Pole
so that the Prime Meridian (longitude 0)
of the overlay coincides with meridian
.I lon
on the globe.
Then tilt the North Pole of the
overlay along its Prime Meridian to latitude
.I lat
on the globe.
Finally again turn the
overlay about its `North Pole' so
that its Prime Meridian coincides with the previous position
of meridian
.IR rot .
Project the map in
the standard form appropriate to the overlay, but presenting
information from the underlying globe.
Missing arguments are filled out from the list
90, 0, 0.
In the absence of
.BR - o ,
the orientation is 90, 0,
.IR m ,
where
.I m
is the middle of the longitude range.
.TP
.BI -w " S N E W"
Window the map by the specified latitudes
and longitudes in the tilted, rotated coordinate system.
Missing arguments are filled out from the list \-90, 90, \-180, 180.
(It is wise to give an encompassing
.B -l
option with
.BR -w .
Otherwise for small windows computing time
varies inversely with area!)
.TP
.BI -d " n"
For speed, plot only every
.IR n th
point.
.TP
.B -r
Reverse left and right
(good for star charts and inside-out views).
.ns
.TP
.B -v
Verso.
Switch to a normally suppressed sheet of the map, such as the
back side of the earth in orthographic projection.
.TP
.B -s1
.br
.ns
.TP
.B -s2
Superpose; outputs for a
.B -s1
map (no closing) and a
.B -s2
map (no opening) may be concatenated.
.TP
.BI -g " dlat dlon res"
Grid spacings are
.IR dlat ,
.IR dlon .
Zero spacing means no grid.
Missing
.I dlat
is taken to be zero.
Missing
.I dlon
is taken the same as
.IR dlat .
Grid lines are drawn to a resolution of
.I res
(2° or less by default).
In the absence of
.BR - g ,
grid spacing is 10°.
.TP
.BI -p " lat lon extent"
Position the point
.I lat, lon
at the center of the plotting area.
Scale the map so that the height (and width) of the
nominal plotting area is
.I extent
times the size of one degree of latitude
at the center.
By default maps are scaled and positioned
to fit within the plotting area.
An
.I extent
overrides option
.BR -k .
.TP
.BI -c " x y rot"
After all other positioning and scaling operations
have been performed, rotate the image
.I rot
degrees counterclockwise about the center
and move the center to position
.IR x ,
.IR y ,
where the nominal plotting area is
.RI \-1 x ≤1,
.RI \-1 y ≤1.
Missing arguments are taken to be 0.
.BR -x
Allow the map to extend outside the nominal plotting area.
.TP
.BR -m " [ \fIfile\fP ... ]"
Use
map data from named files.
If no files are named, omit map data.
Names that do not exist as pathnames are looked up in
a standard directory, which contains, in addition to the
data for
.BR -f ,
.RS
.LP
.TF counties
.TP
.B world
World Data Bank I (default)
.TP
.B states
US map from Census Bureau
.TP
.B counties
US map from Census Bureau
.PD
.RE
.IP
The environment variables
.B MAP
and
.B MAPDIR
change the default
map and default directory.
.TP
.BI -b " \fR[\fPlat0 lon0 lat1 lon1\fR... ]"
Suppress the drawing of the normal boundary
(defined by options
.BR -l
and
.BR -w ).
Coordinates, if present, define the vertices of a
polygon to which the map is clipped.
If only two vertices are given, they are taken to be the
diagonal of a rectangle.
To draw the polygon, give its vertices as a
.B -u
track.
.TP
.BI -t " file ..."
The
.I files
contain lists of points,
given as latitude-longitude pairs in degrees.
If the first file is named
.LR - ,
the standard input is taken instead.
The points of each list are plotted as connected `tracks'.
.IP
Points in a track file may be followed by label strings.
A label breaks the track.
A label may be prefixed by
\fL"\fR,
.LR : ,
or
.L !
and is terminated by a newline.
An unprefixed string or a string prefixed with
.L
"
is displayed at the designated point.
The first word of a
.L :
or
.L !
string names a special symbol (see option
.BR -y ).
An optional numerical second word is a scale factor
for the size of the symbol, 1 by default.
A
.L :
symbol is aligned with its top to the north; a
.L !
symbol is aligned vertically on the page.
.TP
.BI -u " file ..."
Same as
.BR -t ,
except the tracks are
unbroken lines.
.RB ( -t
tracks appear as dot-dashed lines if the plotting filter supports them.)
.TP
.BI -y " file
The
.I file
contains
.IR plot (7)-style
data for
.L :
or
.L !
labels in
.B -t
or
.B -u
files.
Each symbol is defined by a comment
.BI : name
then a sequence of
.L m
and
.L v
commands.
Coordinates (0,0) fall on the plotting point.
Default scaling is as if the nominal plotting range were
.LR "ra -1 -1 1 1" ;
.L ra
commands in
.I file
change the scaling.
.SS Projections
Equatorial projections centered on the Prime Meridian
(longitude 0).
Parallels are straight horizontal lines.
.PP
.PD 0
.TP 1.5i
.B mercator
equally spaced straight meridians, conformal,
straight compass courses
.TP
.B sinusoidal
equally spaced parallels,
equal-area, same as
.LR "bonne 0" .
.TP
.BI cylequalarea " lat0"
equally spaced straight meridians, equal-area,
true scale on
.I lat0
.TP
.B cylindrical
central projection on tangent cylinder
.TP
.BI rectangular " lat0"
equally spaced parallels, equally spaced straight meridians, true scale on
.I lat0
.TP
.BI gall " lat0"
parallels spaced stereographically on prime meridian, equally spaced straight
meridians, true scale on
.I lat0
.TP
.B mollweide
(homalographic) equal-area, hemisphere is a circle
.br
.B gilbert()
sphere conformally mapped on hemisphere and viewed orthographically
.TP
.B gilbert
globe mapped conformally on hemisphere, viewed orthographically
.PD
.PP
Azimuthal projections centered on the North Pole.
Parallels are concentric circles.
Meridians are equally spaced radial lines.
.PP
.PD 0
.TP 1.5i
.B azequidistant
equally spaced parallels,
true distances from pole
.TP
.B azequalarea
equal-area
.TP
.B gnomonic
central projection on tangent plane,
straight great circles
.TP
.BI perspective " dist"
viewed along earth's axis
.I dist
earth radii from center of earth
.TP
.B orthographic
viewed from infinity
.TP
.B stereographic
conformal, projected from opposite pole
.TP
.B laue
.IR radius " = tan(2\(mu" colatitude ),
used in X-ray crystallography
.TP
.BI fisheye " n"
stereographic seen from just inside medium with refractive index
.I n
.TP
.BI newyorker " r"
.IR radius " = log(" colatitude / r ):
.I New Yorker
map from viewing pedestal of radius
.I r
degrees
.PD
.PP
Polar conic projections symmetric about the Prime Meridian.
Parallels are segments of concentric circles.
Except in the Bonne projection,
meridians are equally spaced radial
lines orthogonal to the parallels.
.PP
.PD 0
.TP 1.5i
.BI conic " lat0"
central projection on cone tangent at
.I lat0
.TP
.BI simpleconic " lat0 lat1"
equally spaced parallels, true scale on
.I lat0
and
.I lat1
.TP
.BI lambert " lat0 lat1"
conformal, true scale on
.I lat0
and
.I lat1
.TP
.BI albers " lat0 lat1"
equal-area, true scale on
.I lat0
and
.I lat1
.TP
.BI bonne " lat0"
equally spaced parallels, equal-area,
parallel
.I lat0
developed from tangent cone
.PD
.PP
Projections with bilateral symmetry about
the Prime Meridian
and the equator.
.PP
.PD 0
.TP 1.5i
.B polyconic
parallels developed from tangent cones,
equally spaced along Prime Meridian
.TP
.B aitoff
equal-area projection of globe onto 2-to-1
ellipse, based on
.I azequalarea
.TP
.B lagrange
conformal, maps whole sphere into a circle
.TP
.BI bicentric " lon0"
points plotted at true azimuth from two
centers on the equator at longitudes
.IR ±lon0 ,
great circles are straight lines
(a stretched
.IR gnomonic
)
.TP
.BI elliptic " lon0"
points plotted at true distance from
two centers on the equator at longitudes
.I ±lon0
.TP
.B globular
hemisphere is circle,
circular arc meridians equally spaced on equator,
circular arc parallels equally spaced on 0- and 90-degree meridians
.TP
.B vandergrinten
sphere is circle,
meridians as in
.IR globular ,
circular arc parallels resemble
.I mercator
.PD
.PP
Doubly periodic conformal projections.
.PP
.TP 1.5i
.B guyou
W and E hemispheres are square
.PD 0
.TP
.B square
world is square with Poles
at diagonally opposite corners
.TP
.B tetra
map on tetrahedron with edge
tangent to Prime Meridian at S Pole,
unfolded into equilateral triangle
.TP
.B hex
world is hexagon centered
on N Pole, N and S hemispheres are equilateral
triangles
.PD
.PP
Miscellaneous projections.
.PP
.PD 0
.TP 1.5i
.BI harrison " dist angle"
oblique perspective from above the North Pole,
.I dist
earth radii from center of earth, looking
along the Date Line
.I angle
degrees off vertical
.TP
.BI trapezoidal " lat0 lat1"
equally spaced parallels,
straight meridians equally spaced along parallels,
true scale at
.I lat0
and
.I lat1
on Prime Meridian
.PD
.br
.B lune(lat,angle)
conformal, polar cap above latitude
.I lat
maps to convex lune with given
.I angle
at 90\(deE and 90\(deW
.PP
Retroazimuthal projections.
At every point the angle between vertical and a straight line to
`Mecca', latitude
.I lat0
on the prime meridian,
is the true bearing of Mecca.
.PP
.PD 0
.TP 1.5i
.BI mecca " lat0"
equally spaced vertical meridians
.TP
.BI homing " lat0"
distances to Mecca are true
.PD
.PP
Maps based on the spheroid.
Of geodetic quality, these projections do not make sense
for tilted orientations.
For descriptions, see corresponding maps above.
.PP
.PD 0
.TP 1.5i
.B sp_mercator
.TP
.BI sp_albers " lat0 lat1"
.SH EXAMPLES
.TP
.L
map perspective 1.025 -o 40.75 74
A view looking down on New York from 100 miles
(0.025 of the 4000-mile earth radius) up.
The job can be done faster by limiting the map so as not to `plot'
the invisible part of the world:
.LR "map perspective 1.025 -o 40.75 74 -l 20 60 30 100".
A circular border can be forced by adding option
.LR "-w 77.33" .
(Latitude 77.33° falls just inside a polar cap of
opening angle arccos(1/1.025) = 12.6804°.)
.TP
.L
map mercator -o 49.25 -106 180
An `equatorial' map of the earth
centered on New York.
The pole of the map is placed 90\(de away (40.75+49.25=90)
on the
other side of the earth.
A 180° twist around the pole of the map arranges that the
`Prime Meridian' of the map runs from the pole of the
map over the North Pole to New York
instead of down the back side of the earth.
The same effect can be had from
.L
map mercator -o 130.75 74
.TP
.L
map albers 28 45 -l 20 50 60 130 -m states
A customary curved-latitude map of the United States.
.TP
.L
map harrison 2 30 -l -90 90 120 240 -o 90 0 0
A fan view covering 60° on either
side of the Date Line, as seen from one earth radius
above the North Pole gazing at the
earth's limb, which is 30° off vertical.
The
.B -o
option overrides the default
.BR "-o 90 0 180" ,
which would rotate
the scene to behind the observer.
.SH FILES
.TF /lib/map/[1-4]??
.TP
.B /lib/map/[1-4]??
World Data Bank II, for
.B -f
.TP
.B /lib/map/*
maps for
.B -m
.TP
.B /lib/map/*.x
map indexes
.TP
.B /bin/aux/mapd
Map driver program
.SH SOURCE
.B /usr/local/plan9/src/cmd/map
.SH "SEE ALSO"
.IR map (7),
.IR plot (1)
.SH DIAGNOSTICS
`Map seems to be empty'\(ema coarse survey found
zero extent within the
.B -l
and
.BR -w
bounds; for maps of limited extent
the grid resolution,
.IR res ,
or the limits may have to be refined.
.SH BUGS
Windows (option
.BR -w )
cannot cross the Date Line.
No borders appear along edges arising from
visibility limits.
Segments that cross a border are dropped, not clipped.
Excessively large scale or
.B -d
setting may cause long line segments to be dropped.
.I Map
tries to draw grid lines dotted and
.B -t
tracks dot-dashed.
As very few plotting filters properly support
curved textured lines, these lines are likely to
appear solid.
The west-longitude-positive convention
betrays Yankee chauvinism.
.I Gilbert
should be a map from sphere to sphere, independent of
the mapping from sphere to plane.

View file

@ -18,7 +18,10 @@ splits the input into as many columns as will fit in
.I N .I N
print positions. print positions.
If run in a If run in a
.IR rio (1) .IR 9term (1),
.IR xterm (1),
or
.IR acme (1)
window, the default window, the default
.I N .I N
is the number of blanks that will fit across the window; is the number of blanks that will fit across the window;
@ -31,9 +34,12 @@ each input line ending in a colon
.L : .L :
is printed separately. is printed separately.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/mc.c .B /usr/local/plan9/src/cmd/draw/mc.c
.SH "SEE ALSO" .SH "SEE ALSO"
.IR rio (1), .IR 9term (1),
.IR acme (1),
.IR acme (4),
.IR xterm (1),
.IR pr (1), .IR pr (1),
.I lc .I lc
in in

682
man/man1/mk.1 Normal file
View file

@ -0,0 +1,682 @@
.TH MK 1
.de EX
.nf
.ft B
..
.de EE
.fi
.ft R
..
.de LR
.if t .BR \\$1 \\$2
.if n .RB ` \\$1 '\\$2
..
.de L
.nh
.if t .B \\$1
.if n .RB ` \\$1 '
..
.SH NAME
mk, membername \- maintain (make) related files
.SH SYNOPSIS
.B mk
[
.B -f
.I mkfile
] ...
[
.I option ...
]
[
.I target ...
]
.PP
.B membername
.IR lib ( object )
\&...
.SH DESCRIPTION
.I Mk
uses the dependency rules specified in
.I mkfile
to control the update (usually by compilation) of
.I targets
(usually files)
from the source files upon which they depend.
The
.I mkfile
(default
.LR mkfile )
contains a
.I rule
for each target that identifies the files and other
targets upon which it depends and an
.IR sh (1)
script, a
.IR recipe ,
to update the target.
The script is run if the target does not exist
or if it is older than any of the files it depends on.
.I Mkfile
may also contain
.I meta-rules
that define actions for updating implicit targets.
If no
.I target
is specified, the target of the first rule (not meta-rule) in
.I mkfile
is updated.
.PP
The environment variable
.B $NPROC
determines how many targets may be updated simultaneously;
Some operating systems, e.g., Plan 9, set
.B $NPROC
automatically to the number of CPUs on the current machine.
.PP
Options are:
.TP \w'\fL-d[egp]\ 'u
.B -a
Assume all targets to be out of date.
Thus, everything is updated.
.PD 0
.TP
.BR -d [ egp ]
Produce debugging output
.RB ( p
is for parsing,
.B g
for graph building,
.B e
for execution).
.TP
.B -e
Explain why each target is made.
.TP
.B -i
Force any missing intermediate targets to be made.
.TP
.B -k
Do as much work as possible in the face of errors.
.TP
.B -n
Print, but do not execute, the commands
needed to update the targets.
.TP
.B -s
Make the command line arguments sequentially rather than in parallel.
.TP
.B -t
Touch (update the modified date of) file targets, without
executing any recipes.
.TP
.BI -w target1 , target2,...
Pretend the modify time for each
.I target
is the current time; useful in conjunction with
.B -n
to learn what updates would be triggered by
modifying the
.IR targets .
.PD
.SS The \fLmkfile\fP
A
.I mkfile
consists of
.I assignments
(described under `Environment') and
.IR rules .
A rule contains
.I targets
and a
.IR tail .
A target is a literal string
and is normally a file name.
The tail contains zero or more
.I prerequisites
and an optional
.IR recipe ,
which is an
.B shell
script.
Each line of the recipe must begin with white space.
A rule takes the form
.IP
.EX
target: prereq1 prereq2
\f2recipe using\fP prereq1, prereq2 \f2to build\fP target
.EE
.PP
When the recipe is executed,
the first character on every line is elided.
.PP
After the colon on the target line, a rule may specify
.IR attributes ,
described below.
.PP
A
.I meta-rule
has a target of the form
.IB A % B
where
.I A
and
.I B
are (possibly empty) strings.
A meta-rule acts as a rule for any potential target whose
name matches
.IB A % B
with
.B %
replaced by an arbitrary string, called the
.IR stem .
In interpreting a meta-rule,
the stem is substituted for all occurrences of
.B %
in the prerequisite names.
In the recipe of a meta-rule, the environment variable
.B $stem
contains the string matched by the
.BR % .
For example, a meta-rule to compile a C program using
.IR 9c (1)
might be:
.IP
.EX
%: %.c
9c -c $stem.c
9l -o $stem $stem.o
.EE
.PP
Meta-rules may contain an ampersand
.B &
rather than a percent sign
.BR % .
A
.B %
matches a maximal length string of any characters;
an
.B &
matches a maximal length string of any characters except period
or slash.
.PP
The text of the
.I mkfile
is processed as follows.
Lines beginning with
.B <
followed by a file name are replaced by the contents of the named
file.
Lines beginning with
.B "<|"
followed by a file name are replaced by the output
of the execution of the named
file.
Blank lines and comments, which run from unquoted
.B #
characters to the following newline, are deleted.
The character sequence backslash-newline is deleted,
so long lines in
.I mkfile
may be folded.
Non-recipe lines are processed by substituting for
.BI `{ command }
the output of the
.I command
when run by
.IR sh .
References to variables are replaced by the variables' values.
Special characters may be quoted using single quotes
.BR \&''
as in
.IR sh (1).
.PP
Assignments and rules are distinguished by
the first unquoted occurrence of
.B :
(rule)
or
.B =
(assignment).
.PP
A later rule may modify or override an existing rule under the
following conditions:
.TP
\-
If the targets of the rules exactly match and one rule
contains only a prerequisite clause and no recipe, the
clause is added to the prerequisites of the other rule.
If either or both targets are virtual, the recipe is
always executed.
.TP
\-
If the targets of the rules match exactly and the
prerequisites do not match and both rules
contain recipes,
.I mk
reports an ``ambiguous recipe'' error.
.TP
\-
If the target and prerequisites of both rules match exactly,
the second rule overrides the first.
.SS Environment
Rules may make use of
shell
environment variables.
A legal reference of the form
.B $OBJ
or
.B ${name}
is expanded as in
.IR sh (1).
A reference of the form
.BI ${name: A % B = C\fL%\fID\fL}\fR,
where
.I A, B, C, D
are (possibly empty) strings,
has the value formed by expanding
.B $name
and substituting
.I C
for
.I A
and
.I D
for
.I B
in each word in
.B $name
that matches pattern
.IB A % B\f1.
.PP
Variables can be set by
assignments of the form
.I
var\fL=\fR[\fIattr\fL=\fR]\fIvalue\fR
.br
Blanks in the
.I value
break it into words.
Such variables are exported
to the environment of
recipes as they are executed, unless
.BR U ,
the only legal attribute
.IR attr ,
is present.
The initial value of a variable is
taken from (in increasing order of precedence)
the default values below,
.I mk's
environment, the
.IR mkfiles ,
and any command line assignment as an argument to
.IR mk .
A variable assignment argument overrides the first (but not any subsequent)
assignment to that variable.
The variable
.B MKFLAGS
contains all the option arguments (arguments starting with
.L -
or containing
.LR = )
and
.B MKARGS
contains all the targets in the call to
.IR mk .
.PP
Dynamic information may be included in the mkfile by using a line of the form
.IP
\fR<|\fIcommand\fR \fIargs\fR
.LP
This runs the command
.I command
with the given arguments
.I args
and pipes its standard output to
.I mk
to be included as part of the mkfile. For instance, the Inferno kernels
use this technique
to run a shell command with an awk script and a configuration
file as arguments in order for
the
.I awk
script to process the file and output a set of variables and their values.
.SS Execution
.PP
During execution,
.I mk
determines which targets must be updated, and in what order,
to build the
.I names
specified on the command line.
It then runs the associated recipes.
.PP
A target is considered up to date if it has no prerequisites or
if all its prerequisites are up to date and it is newer
than all its prerequisites.
Once the recipe for a target has executed, the target is
considered up to date.
.PP
The date stamp
used to determine if a target is up to date is computed
differently for different types of targets.
If a target is
.I virtual
(the target of a rule with the
.B V
attribute),
its date stamp is initially zero; when the target is
updated the date stamp is set to
the most recent date stamp of its prerequisites.
Otherwise, if a target does not exist as a file,
its date stamp is set to the most recent date stamp of its prerequisites,
or zero if it has no prerequisites.
Otherwise, the target is the name of a file and
the target's date stamp is always that file's modification date.
The date stamp is computed when the target is needed in
the execution of a rule; it is not a static value.
.PP
Nonexistent targets that have prerequisites
and are themselves prerequisites are treated specially.
Such a target
.I t
is given the date stamp of its most recent prerequisite
and if this causes all the targets which have
.I t
as a prerequisite to be up to date,
.I t
is considered up to date.
Otherwise,
.I t
is made in the normal fashion.
The
.B -i
flag overrides this special treatment.
.PP
Files may be made in any order that respects
the preceding restrictions.
.PP
A recipe is executed by supplying the recipe as standard input to
the command
.BR /bin/sh .
(Note that unlike
.IR make ,
.I mk
feeds the entire recipe to the shell rather than running each line
of the recipe separately.)
The environment is augmented by the following variables:
.TP 14
.B $alltarget
all the targets of this rule.
.TP
.B $newprereq
the prerequisites that caused this rule to execute.
.TP
.B $newmember
the prerequisites that are members of an aggregate
that caused this rule to execute.
When the prerequisites of a rule are members of an
aggregate,
.B $newprereq
contains the name of the aggregate and out of date
members, while
.B $newmember
contains only the name of the members.
.TP
.B $nproc
the process slot for this recipe.
It satisfies
.RB 0 $nproc < $NPROC .
.TP
.B $pid
the process id for the
.I mk
executing the recipe.
.TP
.B $prereq
all the prerequisites for this rule.
.TP
.B $stem
if this is a meta-rule,
.B $stem
is the string that matched
.B %
or
.BR & .
Otherwise, it is empty.
For regular expression meta-rules (see below), the variables
.LR stem0 ", ...,"
.L stem9
are set to the corresponding subexpressions.
.TP
.B $target
the targets for this rule that need to be remade.
.PP
These variables are available only during the execution of a recipe,
not while evaluating the
.IR mkfile .
.PP
Unless the rule has the
.B Q
attribute,
the recipe is printed prior to execution
with recognizable environment variables expanded.
Commands returning error status
cause
.I mk
to terminate.
.PP
Recipes and backquoted
.B rc
commands in places such as assignments
execute in a copy of
.I mk's
environment; changes they make to
environment variables are not visible from
.IR mk .
.PP
Variable substitution in a rule is done when
the rule is read; variable substitution in the recipe is done
when the recipe is executed. For example:
.IP
.EX
bar=a.c
foo: $bar
$CC -o foo $bar
bar=b.c
.EE
.PP
will compile
.B b.c
into
.BR foo ,
if
.B a.c
is newer than
.BR foo .
.SS Aggregates
Names of the form
.IR a ( b )
refer to member
.I b
of the aggregate
.IR a .
Currently, the only aggregates supported are
.I 9ar
(see
.IR 9c (1))
archives.
.PP
.I Membername
echoes just the member names of a list of aggregate names.
It is useful in recipes like:
.EX
OFILES=a.o b.o
libc.a(%):N: %
libc.a: ${OFILES:%=libc.a(%)}
9ar rvc libc.a `membername $newprereq`
.EE
which re-archives only the new object files.
.SS Attributes
The colon separating the target from the prerequisites
may be
immediately followed by
.I attributes
and another colon.
The attributes are:
.TP
.B D
If the recipe exits with a non-null status, the target is deleted.
.TP
.B E
Continue execution if the recipe draws errors.
.TP
.B N
If there is no recipe, the target has its time updated.
.TP
.B n
The rule is a meta-rule that cannot be a target of a virtual rule.
Only files match the pattern in the target.
.TP
.B P
The characters after the
.B P
until the terminating
.B :
are taken as a program name.
It will be invoked as
.B "sh -c prog 'arg1' 'arg2'"
and should return a zero exit status
if and only if arg1 is up to date with respect to arg2.
Date stamps are still propagated in the normal way.
.TP
.B Q
The recipe is not printed prior to execution.
.TP
.B R
The rule is a meta-rule using regular expressions.
In the rule,
.B %
has no special meaning.
The target is interpreted as a regular expression as defined in
.IR regexp (7).
The prerequisites may contain references
to subexpressions in form
.BI \e n\f1,
as in the substitute command of
.IR sed (1).
.TP
.B U
The targets are considered to have been updated
even if the recipe did not do so.
.TP
.B V
The targets of this rule are marked as virtual.
They are distinct from files of the same name.
.PD
.SH EXAMPLES
A simple mkfile to compile a program:
.IP
.EX
.ta 8n +8n +8n +8n +8n +8n +8n
</$objtype/mkfile
prog: a.$O b.$O c.$O
$LD $LDFLAGS -o $target $prereq
%.$O: %.c
$CC $CFLAGS $stem.c
.EE
.PP
Override flag settings in the mkfile:
.IP
.EX
% mk target 'CFLAGS=-S -w'
.EE
.PP
Maintain a library:
.IP
.EX
libc.a(%.$O):N: %.$O
libc.a: libc.a(abs.$O) libc.a(access.$O) libc.a(alarm.$O) ...
ar r libc.a $newmember
.EE
.PP
String expression variables to derive names from a master list:
.IP
.EX
NAMES=alloc arc bquote builtins expand main match mk var word
OBJ=${NAMES:%=%.$O}
.EE
.PP
Regular expression meta-rules:
.IP
.EX
([^/]*)/(.*)\e.$O:R: \e1/\e2.c
cd $stem1; $CC $CFLAGS $stem2.c
.EE
.PP
A correct way to deal with
.IR yacc (1)
grammars.
The file
.B lex.c
includes the file
.B x.tab.h
rather than
.B y.tab.h
in order to reflect changes in content, not just modification time.
.IP
.EX
lex.$O: x.tab.h
x.tab.h: y.tab.h
cmp -s x.tab.h y.tab.h || cp y.tab.h x.tab.h
y.tab.c y.tab.h: gram.y
$YACC -d gram.y
.EE
.PP
The above example could also use the
.B P
attribute for the
.B x.tab.h
rule:
.IP
.EX
x.tab.h:Pcmp -s: y.tab.h
cp y.tab.h x.tab.h
.EE
.SH SEE ALSO
.IR sh (1),
.IR regexp9 (7)
.PP
A. Hume,
``Mk: a Successor to Make''
(Tenth Edition Research Unix Manuals).
.PP
Andrew G. Hume and Bob Flandrena,
``Maintaining Files on Plan 9 with Mk''.
DOCPREFIX/doc/mk.pdf
.SH HISTORY
Andrew Hume wrote
.I mk
for Tenth Edition Research Unix.
It was later ported to Plan 9.
This software is a port of the Plan 9 version back to Unix.
.SH BUGS
Identical recipes for regular expression meta-rules only have one target.
.br
Seemingly appropriate input like
.B CFLAGS=-DHZ=60
is parsed as an erroneous attribute; correct it by inserting
a space after the first
.LR = .
.br
The recipes printed by
.I mk
before being passed to
.I sh
for execution are sometimes erroneously expanded
for printing. Don't trust what's printed; rely
on what
.I sh
does.

14
man/man1/namespace.1 Normal file
View file

@ -0,0 +1,14 @@
.TH NAMESPACE 1
.SH NAME
namespace \- print name space directory
.SH SYNOPSIS
.B namespace
.SH DESCRIPTION
.I Namespace
prints the directory representing the current name space.
See
.IR intro (4).
.SH SOURCE
.B /usr/local/plan9/src/cmd/namespace.c
.SH SEE ALSO
.IR getns (3)

63
man/man1/news.1 Normal file
View file

@ -0,0 +1,63 @@
.TH NEWS 1
.SH NAME
news \- print news items
.SH SYNOPSIS
.B news
[
.B -a
]
[
.B -n
]
[
.I item ...
]
.SH DESCRIPTION
When invoked without options,
this simple local news service
prints files that have appeared in
.BR /lib/news
since last reading, most recent first,
with each preceded by an appropriate header.
The time of reading is recorded.
The options are
.TP
.B -a
Print all items, regardless of currency.
The recorded time is not changed.
.TP
.B -n
Report the names of the current items without
printing their contents, and without changing
the recorded time.
.PP
Other arguments
select particular news items.
.PP
To post a news item, create a file in
.BR /lib/news .
.PP
You may arrange to receive news automatically by
registering your mail address in
.BR /sys/lib/subscribers .
A daemon mails recent news
to all addresses on the list.
.PP
Empty news items, and news items named
.B core
or
.B dead.letter
are ignored.
.SH FILES
.TF /sys/lib/subscribers
.TP
.B /lib/news/*
articles
.TP
.B $HOME/lib/newstime
modify time is time news was last read
.TP
.B /sys/lib/subscribers
who gets news mailed to them
.SH SOURCE
.B /usr/local/plan9/src/cmd/news.c

33
man/man1/p.1 Normal file
View file

@ -0,0 +1,33 @@
.TH P 1
.SH NAME
p \- paginate
.SH SYNOPSIS
.B p
[
.BI - number
]
[
.I file ...
]
.SH DESCRIPTION
.I P
copies its standard input, or the named files if given,
to its standard output,
stopping at the end of every 22nd line, and between files,
to wait for a newline from the user.
The option sets the
.I number
of lines on a page.
.PP
While waiting for a newline,
.I p
interprets the commands:
.TP
.B !
Pass the rest of the line to the shell as a command.
.TP
.B q
Quit.
.PP
.SH SOURCE
.B /usr/local/plan9/src/cmd/p.c

56
man/man1/page.1 Normal file
View file

@ -0,0 +1,56 @@
.TH PAGE 1
.SH NAME
img, psv \- view
FAX,
image, graphic, PostScript, PDF, and
typesetter output
files
.SH SYNOPSIS
.B page
[
.B -abirPRvVw
]
[
.B -p
.I ppi
]
[
.IR file ...
]
.PP
.B img
.I file.bit
.PP
.B psv
.I file.ps
.PP
.B psv
.I file.pdf
.SH DESCRIPTION
Plan 9's
.IR page (1)
is not ported.
.PP
.I Img
is a simple image viewer for Plan 9 images
(see
.IR image (7)).
.PP
.I Psv
is a PostScript and PDF viewer.
It is a streamlined interface to
.IR gv (1).
.PP
To view troff output, use
.IR proof (1).
.SH "SEE ALSO
.IR gs (1),
.IR gv (1)
.IR jpg (1),
.IR proof (1),
.IR tex (1),
.IR troff (1)
.SH SOURCE
.B /usr/local/plan9/src/cmd/draw/img.c
.br
.B /usr/local/plan9/bin/psv

View file

@ -331,7 +331,7 @@ A: ellipse
for i = 1 to 10 do { line from A.s+.025*i,.01*i down i/50 } for i = 1 to 10 do { line from A.s+.025*i,.01*i down i/50 }
.PE .PE
.SH SOURCE .SH SOURCE
.B /sys/src/cmd/pic .B /usr/local/plan9/src/cmd/pic
.SH "SEE ALSO" .SH "SEE ALSO"
.IR grap (1), .IR grap (1),
.IR doctype (1), .IR doctype (1),

View file

@ -9,7 +9,7 @@ plot \- graphics filter
.SH DESCRIPTION .SH DESCRIPTION
.I Plot .I Plot
interprets plotting instructions (see interprets plotting instructions (see
.IR plot (6)) .IR plot (7))
from the from the
.I files .I files
or standard input, or standard input,
@ -31,7 +31,7 @@ Erase the screen.
.TP .TP
.BI -c " col" .BI -c " col"
Set the foreground color (see Set the foreground color (see
.IR plot (6) .IR plot (7)
for color names). for color names).
.TP .TP
.BI -f " fill" .BI -f " fill"
@ -55,7 +55,7 @@ Specify the bounding rectangle of plot's window.
By default it uses a 512×512 window in the By default it uses a 512×512 window in the
middle of the screen. middle of the screen.
.SH SOURCE .SH SOURCE
.B /sys/src/cmd/plot .B /usr/local/plan9/src/cmd/plot
.SH "SEE ALSO" .SH "SEE ALSO"
.IR rio (1), .IR rio (1),
.IR plot (6) .IR plot (7)

View file

@ -87,6 +87,6 @@ mount point for
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/plumb .B /usr/local/plan9/src/cmd/plumb
.SH "SEE ALSO" .SH "SEE ALSO"
.IR plumb (2), .IR plumb (3),
.IR plumber (4), .IR plumber (4),
.IR plumb (6) .IR plumb (7)

110
man/man1/pr.1 Normal file
View file

@ -0,0 +1,110 @@
.TH PR 1
.SH NAME
pr \- print file
.SH SYNOPSIS
.B pr
[
.I option ...
]
[
.I file ...
]
.SH DESCRIPTION
.I Pr
produces a printed listing of one or more
.I files
on its standard output.
The output is separated into pages headed by a date,
the name of the file or a specified header, and the page number.
With no file arguments,
.I pr
prints its standard input.
.PP
Options apply to all following files but may be reset
between files:
.TP
.BI - n
Produce
.IR n -column
output.
.TP
.BI + n
Begin printing with page
.IR n .
.TP
.B -b
Balance columns on last page, in case of multi-column output.
.TP
.B -d
Double space.
.TP
.BI -e n
Set the tab stops for input text every
.I n
spaces.
.TP
.B -h
Take the next argument as a page header
.RI ( file
by default).
.TP
.BI -i n
Replace sequences of blanks in the output
by tabs, using tab stops set every
.I n
spaces.
.TP
.BI -f
Use form feeds to separate pages.
.TP
.BI -l n
Take the length of the page to be
.I n
lines instead of the default 66.
.TP
.B -m
Print all
.I files
simultaneously,
each in one column.
.TP
.BI -n m
Number the lines of each
.IR file .
The numeric argument
.IR m ,
default 5,
sets the width of the line-number field.
.TP
.BI -o n
Offset the left margin
.I n
character positions.
.TP
.BI -p
Pad each file printed to an odd number of pages.
For two-sided printers,
this will ensure each file will start a new page.
.TP
.BI -s c
Separate columns by the single character
.I c
instead of aligning them with white space.
A missing
.I c
is taken to be a tab.
.TP
.B -t
Do not print the 5-line header or the
5-line trailer normally supplied for each page.
.TP
.BI -w n
For multi-column output,
take the width of the page to be
.I n
characters instead of the default 72.
.SH SOURCE
.B /usr/local/plan9/src/cmd/pr.c
.SH "SEE ALSO"
.IR cat (1),
.IR lp (1)

134
man/man1/proof.1 Normal file
View file

@ -0,0 +1,134 @@
.TH PROOF 1
.SH NAME
proof \- troff output interpreter
.SH SYNOPSIS
.B proof
[
.BI -m mag
]
[
.BI -/ nview
]
[
.B -F
.I dir
]
[
.B -d
]
[
.I file
]
.SH DESCRIPTION
.I Proof
reads
.IR troff (1)
intermediate language from
.I file
or standard input
and simulates the resulting pages on the screen.
.PP
After a page of text is displayed,
.I proof
pauses for a command from the keyboard.
The typed commands are:
.TP \w'newline\ \ \ 'u
newline
Go on to next page of text.
.TP
.B -
Go back to the previous page.
.TP
.B q
Quit.
.TP
.BI p n
Print page
.IR n .
An out-of-bounds page number means the end nearer to that number;
a missing number means the current page;
a signed number means an offset to the current page.
.TP
.I n
Same as
.BI p n\f1.
.TP
.B c
Clear the screen, then wait for another command.
.TP
.BI m mag
Change the magnification at which the output is printed.
Normally it is printed with magnification .9;
.IR mag "=.5"
shrinks it to half size;
.IR mag "=2"
doubles the size.
.TP
.BI x val
Move everything
.I val
screen pixels to the right (left, if
.I val
is negative).
.TP
.BI y val
Move everything
.I val
screen pixels down (up, if
.I val
is negative).
.TP
.BI / nview
Split the window into
.I nview
pieces. The current page goes into the rightmost, bottommost piece,
and previous pages are shown in the other pieces.
.TP
.BI "-F " dir
Use
.I dir
for fonts instead of
.BR /lib/font/bit .
.TP
.B d
Toggle the debug flag.
.PD
.PP
These commands are also available, under slightly different form,
from a menu on button 3. The
.B pan
menu item allows arbitrary positioning of the page:
after selecting
.BR pan ,
press the mouse button again and hold it down while moving
the page to the desired location. The page will be redisplayed
in its entirety when the button is released.
Mouse button 1 also pans, without the need for selecting from a menu.
.PP
The
.BR m ,
.BR x ,
.BR y ,
.BR F ,
.BR / ,
and
.B d
commands are also available as command line options.
.SH FILES
.TF /lib/font/bit/MAP
.TP
.B /lib/font/bit/*
fonts
.TP
.B /lib/font/bit/MAP
how to convert troff output fonts and character names
into screen fonts and character numbers
.SH SOURCE
.B /usr/local/plan9/src/cmd/proof
.SH SEE ALSO
.IR lp (1),
.IR gs (1),
.IR page (1)
.br
J. F. Ossanna and B. W. Kernighan,
``Troff User's Manual''

107
man/man1/ps.1 Normal file
View file

@ -0,0 +1,107 @@
.TH PS 1
.SH NAME
ps, psu \- process status
.SH SYNOPSIS
.B ps
[
.B -pa
]
.PP
.B psu
[
.B -pa
]
[
.I user
]
.SH DESCRIPTION
.I Ps
prints information about processes.
.I Psu
prints only information about processes started by
.I user
(default
.BR $USER ).
.PP
For each process reported,
the user,
process id,
user time,
system time,
size,
state,
and command name are printed.
State is one of the following:
.TP \w'\fLno\ \fIresource\ \ \ 'u
.B Moribund
Process has exited and is about to have its
resources reclaimed.
.TP
.B Ready
on the queue of processes ready to be run.
.TP
.B Scheding
about to be run.
.TP
.B Running
running.
.TP
.B Queueing
waiting on a queue for a resource.
.TP
.B Wakeme
waiting for I/O or some other kernel event to wake it up.
.TP
.B Broken
dead of unnatural causes; lingering
so that it can be examined.
.TP
.B Stopped
stopped.
.TP
.B Stopwait
waiting for another process to stop.
.TP
.B Fault
servicing a page fault.
.TP
.B Idle
waiting for something to do (kernel processes only).
.TP
.B New
being created.
.TP
.B Pageout
paging out some other process.
.TP
.I Syscall
performing the named system call.
.TP
.BI no " resource
waiting for more of a critical
.IR resource .
.TP
.BI wchan
waiting on the named wait channel
(on a Unix kernel).
.PD
.PP
With the
.B -p
flag,
.I ps
also prints, after the system time, the baseline and current priorities of each process.
.PP
The
.B -a
flag causes
.I ps
to print the arguments for the process. Newlines in arguments will be translated to spaces for display.
.SH SOURCE
.B /usr/local/plan9/bin/ps
.br
.B /usr/local/plan9/bin/psu
.SH "SEE ALSO"
.IR acid (1),
.IR db (1),
.IR kill (1)

125
man/man1/psfonts.1 Normal file
View file

@ -0,0 +1,125 @@
.TH PSFONTS 1
.SH NAME
psfonts, psdownload \- add necessary fonts to PostScript document for printing
.SH SYNOPSIS
.B psfonts
[
.I files ...
]
.PP
.B psdownload
[
.B options
]
[
.I files ...
]
.SH DESCRIPTION
Plan 9's
.IR troff (1)
and
.IR tr2post (1)
use non-standard PostScript fonts
(found in
.BR /usr/local/plan9/postscript/font ).
Before sending PostScript output from
.I tr2post
to a standard printer, code implementing
the non-standard fonts must be added to the PostScript.
.PP
.I Psfonts
copies
.I files
(or standard input)
to standard output, adding necessary PostScript fonts.
.PP
.I Psdownload
is the more general program used to implement
.IR psfonts .
The options are:
.TP
.BI -c " comment
Expect the fonts used in the document to be listed in
a comment beginning with this string
(default
.BR %%DocumentFonts: ).
.TP
.BI -f " atend
Expect extra fonts comments at the end of the document,
so read the entire input before starting output
(by default this only happens if a
.B %%DocumentFonts:
.B (atend)
comment is encountered).
.TP
.BI -m " mapfile
Use
.I mapfile
to translate from PostScript font names to files.
Each line in the map has two white space-separated
fields: a font name and the corresponding file.
If
.I mapfile
is not a rooted path, it is evaluated relative to the
.I fontdir
(see
.B -H
below).
.TP
.BI -p " printer
Set the name of the printer.
This option is deprecated. Its only effect is to override the
.B -r
option, causing
.IB fontdir /printers/ printer
to be used as the resident fonts list.
.TP
.BI -r " residentfonts
Read a list of fonts assumed to be on the printer
(not necessary to re-download) from the file
.IR residentfonts .
If
.I residentfonts
is not a rooted path, it is evaluated relative to the
.I fontdir
(see
.B -H
below).
.TP
.BI -H " fontdir
Set the directory that is assumed to contain the PostScript fonts
and information about printers
(see
.BR -m ,
.BR -p ,
and
.B -r
above;
default
.BR /usr/local/plan9/postscript/font ).
.TP
.BI -T " tmpdir
Use
.I tmpdir
for storing temporary files
(default
.BR /var/tmp ).
.B
.TP
.BI -D
Produce copious amounts of debugging information on standard error.
.TP
.BI -I
Continue running even after fatal errors occur.
.PD
.SH EXAMPLE
See
.IR tr2post (1)
for an example.
.SH SOURCE
.B /usr/local/plan9/bin/psfonts
.br
.B /usr/local/plan9/src/cmd/postscript/download
.SH SEE ALSO
.IR troff (1),
.IR tr2post (1)

26
man/man1/pwd.1 Normal file
View file

@ -0,0 +1,26 @@
.TH PWD 1
.SH NAME
pwd, pbd \- working directory
.SH SYNOPSIS
.B pwd
.br
.B pbd
.SH DESCRIPTION
.I Pwd
prints the path name of the working (current) directory.
.PP
.I Pbd
prints the base name of the working (current) directory.
It prints no final newline and is intended for applications
such as constructing shell prompts.
.SH SOURCE
.B /usr/local/plan9/src/cmd/pbd.c
.SH SEE ALSO
.I cd
in
.IR rc (1),
.IR getwd (3)
.SH BUGS
.I Pwd
is not provided.
Unix already provides one.

View file

@ -50,7 +50,7 @@ exits or is terminated, the
variable variable
.B $status .B $status
gets the process's wait message (see gets the process's wait message (see
.IR wait (2)); .IR wait (3));
it will be the null string if the command was successful. it will be the null string if the command was successful.
.PP .PP
A long command line may be continued on subsequent lines by typing A long command line may be continued on subsequent lines by typing
@ -83,7 +83,7 @@ in a directory in
.B $path .B $path
is the program to be executed. is the program to be executed.
To be executable, the user must have execute permission (see To be executable, the user must have execute permission (see
.IR stat (2)) .IR stat (3))
and the file must be either an executable binary and the file must be either an executable binary
for the current machine's CPU type, or a shell script. for the current machine's CPU type, or a shell script.
Shell scripts begin with a line containing the full path name of a shell Shell scripts begin with a line containing the full path name of a shell
@ -349,7 +349,7 @@ or
is a previously opened file descriptor and is a previously opened file descriptor and
.I fd0 .I fd0
becomes a new copy (in the sense of becomes a new copy (in the sense of
.IR dup (2)) .IR dup (3))
of it. of it.
A file descriptor may be closed by writing A file descriptor may be closed by writing
.BI >[ fd0 =] .BI >[ fd0 =]
@ -542,7 +542,7 @@ function definition.
A function with a special name will be called when A function with a special name will be called when
.I rc .I rc
receives a corresponding note; see receives a corresponding note; see
.IR notify (2). .IR notify (3).
The valid note names (and corresponding notes) are The valid note names (and corresponding notes) are
.B sighup .B sighup
.RB ( hangup ), .RB ( hangup ),
@ -757,10 +757,7 @@ command is executed, so they need not be enclosed in quotation marks.
The The
.I environment .I environment
is a list of strings made available to executing binaries by the is a list of strings made available to executing binaries by the
.B env kernel.
device
(see
.IR env (3)).
.I Rc .I Rc
creates an environment entry for each variable whose value is non-empty, creates an environment entry for each variable whose value is non-empty,
and for each function. and for each function.
@ -768,7 +765,7 @@ The string for a variable entry has the variable's name followed by
.B = .B =
and its value. and its value.
If the value has more than one component, these If the value has more than one component, these
are separated by ctrl-a are separated by SOH
.RB ( '\e001' ) .RB ( '\e001' )
characters. characters.
The string for a function is just the The string for a function is just the
@ -824,12 +821,23 @@ for the
.B . .B .
command. command.
If not set in the environment, it is initialized by If not set in the environment, it is initialized by
parsing the
.B $PATH
variable
(as in
.IR sh (1))
or by
.BR "path=(.\ /bin)" . .BR "path=(.\ /bin)" .
Its use is discouraged; instead use The variables
.IR bind (1) .B $path
to build a and
.B /bin .B $PATH
containing what's needed. are maintained together: changes to one will be reflected in the other.
.\" Its use is discouraged; instead use
.\" .IR bind (1)
.\" to build a
.\" .B /bin
.\" containing what's needed.
.TP .TP
.B $pid .B $pid
Set during initialization to Set during initialization to

View file

@ -1,54 +1,101 @@
.if t .ds 85 8\(12
.if n .ds 85 8-1/2
.TH RIO 1 .TH RIO 1
.SH NAME .SH NAME
rio \- rio-like Window Manager for X rio \- rio-like Window Manager for X
.SH SYNOPSIS .SH SYNOPSIS
.B rio .B rio
[ [
.B \-grey
] [
.B \-version
] [
.B \-font .B \-font
.I fname .I fontname
] [ ]
[
.B \-grey
]
[
.B \-s
]
[
.B \-term .B \-term
.I termprog .I termprog
] [ ]
.BR exit | restart [
.B \-version
]
[
.B \-virtuals
.I num
]
[
.B exit
|
.B restart
] ]
.SH DESCRIPTION .SH DESCRIPTION
.if t .ds 85 8\(12
.if n .ds 85 8-1/2
.I Rio .I Rio
is a window manager for X which attempts to emulate the window management is a window manager for X which attempts to emulate the window management
policies of Plan 9's policies of Plan 9's
.I rio .I rio
window manager. window manager.
Rio is derived from David Hogan's \*(85.
.PP .PP
The The
.B \-grey .B \-grey
option makes the background light grey, as does \*(85. option makes the background stippled grey, the default X11 background,
Use this option for maximum authenticity. instead of solid grey, the Plan 9 background.
.PP
The
.B \-font .B \-font
.I fname option
sets the font in sets the font in
.IR rio 's .IR rio 's
menu to menu to
.IR fname , .IR fname ,
overriding the default. overriding the default.
Unlike the other programs in the Plan 9 ports, rio expects this
font to be an X11 font rather than a Plan 9 font.
.PP
The
.B \-term .B \-term
.I termprog option
specifies an alternative program to run when the specifies an alternative program to run when the
.I New .I New
menu item is selected. menu item is selected.
The default is to try
.IR 9term (1)
and then to fall back to
.IR xterm (1).
The
.B \-s
option causes
.I rio
to add
.B -s
to
.IR 9term 's
command-line, starting the window in scrolling mode.
.PP
The
.B \-version .B \-version
option
prints the current version on standard error, then exits. prints the current version on standard error, then exits.
.PP .PP
To make The
.B \-virtuals
option sets the number of virtual screens (the default is 1,
and the maximum is 12).
.PP
If the argument
.B exit
or
.B restart
is given,
it is sent to an already-running
.IR rio ,
causing the extant
.I rio .I rio
exit, you have to run to exit or restart.
.B "rio exit" .SS Using rio
on the command line. There is no ``exit'' menu item.
.PP .PP
One window is One window is
.IR current , .IR current ,
@ -130,7 +177,16 @@ Windows may also be arranged by dragging their borders.
Pressing button 1 or 2 over a window's border allows one to Pressing button 1 or 2 over a window's border allows one to
move the corresponding edge or corner, while button 3 move the corresponding edge or corner, while button 3
moves the whole window. moves the whole window.
.PD .PP
When the mouse cursor points to the background area
and
.I rio
has been started with multiple virtual screens using the
.B \-virtuals
option,
clicking button 2 brings up a menu to select a virtual screen to view.
Scrolling the mouse wheel while the cursor points at the background
will cycle through the virtual screens.
.SH BUGS .SH BUGS
In In
Plan 9's Plan 9's
@ -154,4 +210,4 @@ starts a particular program.)
There is a currently a compiled-in limit of 128 hidden windows. There is a currently a compiled-in limit of 128 hidden windows.
.SH "SEE ALSO" .SH "SEE ALSO"
.IR 9term (1), .IR 9term (1),
.IR xterm (1). .IR xterm (1)

View file

@ -25,4 +25,4 @@ and the directory itself.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/rm.c .B /usr/local/plan9/src/cmd/rm.c
.SH "SEE ALSO" .SH "SEE ALSO"
.IR remove (2) .IR remove (3)

View file

@ -1,7 +1,7 @@
.TH SAM 1 .TH SAM 1
.ds a \fR*\ \fP .ds a \fR*\ \fP
.SH NAME .SH NAME
sam, B, sam.save \- screen editor with structural regular expressions sam, B, E, sam.save, samterm, samsave \- screen editor with structural regular expressions
.SH SYNOPSIS .SH SYNOPSIS
.B sam .B sam
[ [
@ -17,10 +17,8 @@ sam, B, sam.save \- screen editor with structural regular expressions
.B sam.save .B sam.save
.PP .PP
.B B .B B
[ .IB file \fR[\fP: line \fR]
.BI -nnnn \&...
]
.I file ...
.SH DESCRIPTION .SH DESCRIPTION
.I Sam .I Sam
is a multi-file editor. is a multi-file editor.
@ -62,7 +60,7 @@ for debugging.
.PD .PD
.SS Regular expressions .SS Regular expressions
Regular expressions are as in Regular expressions are as in
.IR regexp (6) .IR regexp (7)
with the addition of with the addition of
.BR \en .BR \en
to represent newlines. to represent newlines.
@ -791,7 +789,7 @@ the white-space-delimited block of text is sent as a plumb message
with a with a
.B click .B click
attribute defining where the selection lies (see attribute defining where the selection lies (see
.IR plumb (6)). .IR plumb (7)).
.TP .TP
.B look .B look
Search forward for the next occurrence of the literal text in dot. Search forward for the next occurrence of the literal text in dot.
@ -838,6 +836,20 @@ If plumbing is not enabled,
the option allows a line number to be specified for the option allows a line number to be specified for
the initial position to display in the last named file the initial position to display in the last named file
(plumbing provides a more general mechanism for this ability). (plumbing provides a more general mechanism for this ability).
.PP
.I E
is a shell-level command that can be used as
.B $EDITOR
in a Unix environment.
It runs
.I B
on
.I file
and then waits to exit until
.I file
is changed, which is taken as a signal that
.I file
is done being edited.
.SS Abnormal termination .SS Abnormal termination
If If
.I sam .I sam
@ -879,7 +891,7 @@ source for the separate terminal part
.IR sed (1), .IR sed (1),
.IR grep (1), .IR grep (1),
.IR rio (1), .IR rio (1),
.IR regexp (6). .IR regexp (7).
.PP .PP
Rob Pike, Rob Pike,
``The text editor sam''. ``The text editor sam''.

View file

@ -1,4 +1,4 @@
.TH SCAT 7 .TH SCAT 1
.SH NAME .SH NAME
scat \- sky catalogue and Digitized Sky Survey scat \- sky catalogue and Digitized Sky Survey
.SH SYNOPSIS .SH SYNOPSIS
@ -10,7 +10,7 @@ outside the solar system
and implements database-like manipulations and implements database-like manipulations
on sets of such objects. on sets of such objects.
It also provides an interface to It also provides an interface to
.IR astro (7) .IR astro (1)
to plot the locations of solar system objects. to plot the locations of solar system objects.
Finally, it displays images from the Finally, it displays images from the
Space Telescope Science Institute's Space Telescope Science Institute's
@ -119,7 +119,7 @@ The names
and and
.B comet .B comet
refer to the earth's penumbra at lunar distance and the comet installed in the current refer to the earth's penumbra at lunar distance and the comet installed in the current
.IR astro (7). .IR astro (1).
The output is the planet's name, right ascension and declination, azimuth and altitude, and phase The output is the planet's name, right ascension and declination, azimuth and altitude, and phase
for the moon and sun, as shown by for the moon and sun, as shown by
.BR astro . .BR astro .
@ -182,7 +182,7 @@ collects all objects in the patches that cover the current set.
.TP .TP
.BI astro " option" .BI astro " option"
Run Run
.IR astro (7) .IR astro (1)
with the specified with the specified
.I options .I options
(to which will be appended (to which will be appended
@ -322,9 +322,9 @@ Show a pretty galaxy.
.SH FILES .SH FILES
.B /lib/sky/*.scat .B /lib/sky/*.scat
.SH SOURCE .SH SOURCE
.B /sys/src/cmd/scat .B /usr/local/plan9/src/cmd/scat
.SH SEE ALSO .SH SEE ALSO
.IR astro (7) .IR astro (1)
.br .br
.B /lib/sky/constelnames\ \ .B /lib/sky/constelnames\ \
the three-letter abbreviations of the constellation names. the three-letter abbreviations of the constellation names.

212
man/man1/secstore.1 Normal file
View file

@ -0,0 +1,212 @@
.TH SECSTORE 1
.SH NAME
aescbc, secstore, ipso \- secstore commands
.SH SYNOPSIS
.B secstore
[
.B -s
.I server
]
[
.B -(g|G)
.I getfile
]
[
.B -p
.I putfile
]
[
.B -r
.I rmfile
]
[
.B -c
]
[
.B -u
.I user
]
[
.B -v
]
[
.B -i
]
.PP
.B aescbc
-e
.I <cleartext
.I >ciphertext
.br
.B aescbc
-d
.I <ciphertext
.I >cleartext
.PP
.B ipso
[
.B -a -e -l -f -s
] [
.I file
\&...
]
.PP
.SH DESCRIPTION
.PP
.I Secstore
authenticates to the server
using a password and optionally a hardware token,
then saves or retrieves a file.
This is intended to be a credentials store (public/private keypairs,
passwords, and other secrets) for a factotum.
.PP
Option
.B -p
stores a file on the secstore.
.PP
Option
.B -g
retrieves a file to the local directory;
option
.B -G
writes it to standard output instead.
Specifying
.I getfile
of . will send to standard output
a list of remote files with dates, lengths and SHA1 hashes.
.PP
Option
.B -r
removes a file from the secstore.
.PP
Option
.B -c
prompts for a password change.
.PP
Option
.B -v
produces more verbose output, in particular providing a few
bits of feedback to help the user detect mistyping.
.PP
Option
.B -i
says that the password should be read from standard input
instead of from
.BR /dev/cons .
.PP
Option
.B -n
says that the password should be read from NVRAM
instead of from
.BR /dev/cons .
This option is unsupported.
.PP
The server is
.BR tcp!$auth!5356 ,
or the server specified by option
.BR -s .
.PP
For example, to add a secret to the file read by
.IR factotum (4)
at startup, open a new window, type
.sp
.EX
% ramfs -p; cd /tmp
% auth/secstore -g factotum
secstore password:
% echo 'key proto=apop dom=x.com user=ehg !password=hi' >> factotum
% auth/secstore -p factotum
secstore password:
% read -m factotum > /mnt/factotum/ctl
.EE
.PP
and delete the window.
The first line creates an ephemeral memory-resident workspace,
invisible to others and automatically removed when the window is deleted.
The next three commands fetch the persistent copy of the secrets,
append a new secret,
and save the updated file back to secstore.
The final command loads the new secret into the running factotum.
.PP
The
.I ipso
command packages this sequence into a convenient script to simplify editing of
.I files
stored on a secure store.
It copies the named
.I files
into a local
.IR ramfs (4)
and invokes
.IR acme (1)
on them. When the editor exits,
.I ipso
prompts the user to confirm copying modifed or newly created files back to
.I secstore.
If no
.I file
is mentioned,
.I ipso
grabs all the user's files from
.I secstore
for editing.
.PP
By default, ipso will edit the
.I secstore
files and, if
one of them is named
.BR factotum ,
flush your current keys from factotum and load
the new ones from the file.
If you supply any of the
.BR -e ,
.BR -f ,
or
.BR -l
options,
.I ipso
will just perform the operations you requested, i.e.,
edit, flush, and/or load.
.PP
The
.B -s
option of
.I ipso
invokes
.IR sam (1)
as the editor insted of
.BR acme ;
the
.B -a
option provides a similar service for files encrypted by
.I aescbc
.RI ( q.v. ).
With the
.B -a
option, the full rooted pathname of the
.I file
must be specified and all
.I files
must be encrypted with the same key.
Also with
.BR -a ,
newly created files are ignored.
.PP
.I Aescbc
encrypts and decrypts using AES (Rijndael) in cipher
block chaining (CBC) mode.
.SH SOURCE
.B /usr/local/plan9/src/cmd/secstore
.SH SEE ALSO
.IR factotum (4),
Plan 9's \fIsecstore\fR(8)
.SH BUGS
There is deliberately no backup of files on the secstore, so
.B -r
(or a disk crash) is irrevocable. You are advised to store
important secrets in a second location.
.PP
When using
.IR ipso ,
secrets will appear as plain text in the editor window,
so use the command in private.

385
man/man1/sed.1 Normal file
View file

@ -0,0 +1,385 @@
.TH SED 1
.SH NAME
9sed \- stream editor
.SH SYNOPSIS
.B 9sed
[
.B -n
]
[
.B -g
]
[
.B -e
.I script
]
[
.B -f
.I sfile
]
[
.I file ...
]
.SH DESCRIPTION
.I Sed
copies the named
.I files
(standard input default) to the standard output,
edited according to a script of commands.
The
.B -f
option causes the script to be taken from file
.IR sfile ;
these options accumulate.
If there is just one
.B -e
option and no
.BR -f 's,
the flag
.B -e
may be omitted.
The
.B -n
option suppresses the default output;
.B -g
causes all substitutions to be global, as if suffixed
.BR g .
.PP
A script consists of editing commands, one per line,
of the following form:
.IP
[\fIaddress\fR [\fL,\fI address\fR] ] \fIfunction\fR [\fIargument\fR ...]
.PP
In normal operation
.I sed
cyclically copies a line of input into a
.I pattern space
(unless there is something left after
a
.L D
command),
applies in sequence
all commands whose
.I addresses
select that pattern space,
and at the end of the script copies the pattern space
to the standard output (except under
.BR -n )
and deletes the pattern space.
.PP
An
.I address
is either a decimal number that counts
input lines cumulatively across files, a
.L $
that
addresses the last line of input, or a context address,
.BI / regular-expression / \f1,
in the style of
.IR regexp (7),
with the added convention that
.L \en
matches a
newline embedded in the pattern space.
.PP
A command line with no addresses selects every pattern space.
.PP
A command line with
one address selects each pattern space that matches the address.
.PP
A command line with
two addresses selects the inclusive range from the first
pattern space that matches the first address through
the next pattern space that matches
the second.
(If the second address is a number less than or equal
to the line number first selected, only one
line is selected.)
Thereafter the process is repeated, looking again for the
first address.
.PP
Editing commands can be applied to non-selected pattern
spaces by use of the negation function
.L !
(below).
.PP
An argument denoted
.I text
consists of one or more lines,
all but the last of which end with
.L \e
to hide the
newline.
Backslashes in text are treated like backslashes
in the replacement string of an
.L s
command,
and may be used to protect initial blanks and tabs
against the stripping that is done on
every script line.
.PP
An argument denoted
.I rfile
or
.I wfile
must terminate the command
line and must be preceded by exactly one blank.
Each
.I wfile
is created before processing begins.
There can be at most 120 distinct
.I wfile
arguments.
.TP \w'\fL!\ \fIfunction\fLXXX'u
.B a\e
.br
.ns
.TP
.I text
Append.
Place
.I text
on the output before
reading the next input line.
.TP
.BI b " label"
Branch to the
.B :
command bearing the
.IR label .
If
.I label
is empty, branch to the end of the script.
.TP
.B c\e
.br
.ns
.TP
.I text
Change.
Delete the pattern space.
With 0 or 1 address or at the end of a 2-address range, place
.I text
on the output.
Start the next cycle.
.TP
.B d
Delete the pattern space.
Start the next cycle.
.TP
.B D
Delete the initial segment of the
pattern space through the first newline.
Start the next cycle.
.TP
.B g
Replace the contents of the pattern space
by the contents of the hold space.
.TP
.B G
Append the contents of the hold space to the pattern space.
.TP
.B h
Replace the contents of the hold space by the contents of the pattern space.
.TP
.B H
Append the contents of the pattern space to the hold space.
.ne 3
.TP
.B i\e
.br
.ns
.TP
.I text
Insert.
Place
.I text
on the standard output.
.TP
.B n
Copy the pattern space to the standard output.
Replace the pattern space with the next line of input.
.TP
.B N
Append the next line of input to the pattern space
with an embedded newline.
(The current line number changes.)
.TP
.B p
Print.
Copy the pattern space to the standard output.
.TP
.B P
Copy the initial segment of the pattern space through
the first newline to the standard output.
.TP
.B q
Quit.
Branch to the end of the script.
Do not start a new cycle.
.TP
.BI r " rfile"
Read the contents of
.IR rfile .
Place them on the output before reading
the next input line.
.TP
.B s/\fIregular-expression\fP/\fIreplacement\fP/\fIflags
Substitute the
.I replacement
string for instances of the
.I regular-expression
in the pattern space.
Any character may be used instead of
.LR / .
For a fuller description see
.IR regexp (7).
.I Flags
is zero or more of
.RS
.TP
.B g
Global.
Substitute for all non-overlapping instances of the
.I regular expression
rather than just the
first one.
.TP
.B p
Print the pattern space if a replacement was made.
.TP
.BI w " wfile"
Write.
Append the pattern space to
.I wfile
if a replacement
was made.
.RE
.TP
.BI t " label"
Test.
Branch to the
.L :
command bearing the
.I label
if any
substitutions have been made since the most recent
reading of an input line or execution of a
.LR t .
If
.I label
is empty, branch to the end of the script.
.TP
.B w
.I wfile
.br
Write.
Append the pattern space to
.IR wfile .
.TP
.B x
Exchange the contents of the pattern and hold spaces.
.TP
.B y/\fIstring1\fP/\fIstring2\fP/
Transform.
Replace all occurrences of characters in
.I string1
with the corresponding character in
.IR string2 .
The lengths of
.I
string1
and
.I string2
must be equal.
.TP
.BI ! "function"
Don't.
Apply the
.I function
(or group, if
.I function
is
.LR { )
only to lines
.I not
selected by the address(es).
.TP
.BI : " label"
This command does nothing; it bears a
.I label
for
.B b
and
.B t
commands to branch to.
.TP
.B =
Place the current line number on the standard output as a line.
.TP
.B {
Execute the following commands through a matching
.L }
only when the pattern space is selected.
.TP
.B " "
An empty command is ignored.
.ne 4
.SH EXAMPLES
.TP
.B sed 10q file
Print the first 10 lines of the file.
.TP
.B sed '/^$/d'
Delete empty lines from standard input.
.TP
.B sed 's/UNIX/& system/g'
Replace every instance of
.L UNIX
by
.LR "UNIX system" .
.PP
.EX
sed 's/ *$// \fRdrop trailing blanks\fP
/^$/d \fRdrop empty lines\fP
s/ */\e \fRreplace blanks by newlines\fP
/g
/^$/d' chapter*
.EE
.ns
.IP
Print the files
.BR chapter1 ,
.BR chapter2 ,
etc. one word to a line.
.PP
.EX
nroff -ms manuscript | sed '
${
/^$/p \fRif last line of file is empty, print it\fP
}
//N \fRif current line is empty, append next line\fP
/^\en$/D' \fRif two lines are empty, delete the first\fP
.EE
.ns
.IP
Delete all but one of each group of empty lines from a
formatted manuscript.
.SH SOURCE
.B /usr/local/plan9/src/cmd/9sed.c
.SH SEE ALSO
.IR ed (1),
.IR grep (1),
.IR awk (1),
.IR lex (1),
.IR sam (1),
.IR regexp (7)
.br
L. E. McMahon,
`SED \(em A Non-interactive Text Editor',
Unix Research System Programmer's Manual, Volume 2.
.SH BUGS
If input is from a pipe, buffering may consume
characters beyond a line on which a
.L q
command is executed.

View file

@ -38,7 +38,7 @@ The options are
.TP "\w'\fL-f \fIformat\fLXX'u" .TP "\w'\fL-f \fIformat\fLXX'u"
.BI -f format .BI -f format
Use the Use the
.IR print (2)-style .IR print (3)-style
.I format .I format
.IR print .IR print
for printing each (floating point) number. for printing each (floating point) number.

View file

@ -28,4 +28,4 @@ while (){
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/sleep.c .B /usr/local/plan9/src/cmd/sleep.c
.SH "SEE ALSO" .SH "SEE ALSO"
.IR sleep (2) .IR sleep (3)

View file

@ -41,7 +41,7 @@ File divisions occur at each line
that matches a regular that matches a regular
.IR expression ; .IR expression ;
see see
.IR regexp (6). .IR regexp (7).
Multiple Multiple
.B -e .B -e
options may appear. options may appear.
@ -79,4 +79,4 @@ to lower case.
.IR sed (1), .IR sed (1),
.IR awk (1), .IR awk (1),
.IR grep (1), .IR grep (1),
.IR regexp (6) .IR regexp (7)

83
man/man1/src.1 Normal file
View file

@ -0,0 +1,83 @@
.TH SRC 1
.SH NAME
src \- find source code for executable
.SH SYNOPSIS
.B src
[
.B -n
]
[
.B -s
.I symbol
]
.I file
.B ...
.SH DESCRIPTION
.I Src
examines the named
.I files
to find the corresponding source code, which is then sent to the editor using
.B B
(see
.IR sam (1)).
If
.I file
is an
.IR rc (1)
script, the source is the file itself.
If
.I file
is an executable, the source is defined to be the single file containing the
definition of
.B main
and
.I src
will point the editor at the line that begins the definition.
.I Src
uses
.IR db (1)
to extract the symbol table information that identifies the source.
.PP
.I Src
looks for each
.I file
in the current directory, in
.BR /bin ,
and in the subdirectories of
.BR /bin ,
in that order.
.PP
The
.B -n
flag causes
.B src
to print the file name but not send it to the editor.
The
.B -s
flag identifies a
.I symbol
other than
.B main
to locate.
.SH EXAMPLES
Find the source to the
.B main
routine in
.BR /bin/ed :
.IP
.EX
src ed
.EE
.PP
Find the source for
.BR strcmp :
.IP
.EX
src -s strcmp rc
.EE
.SH SOURCE
.B /usr/local/plan9/bin/src
.SH "SEE ALSO"
.IR db (1),
.IR plumb (1),
.IR sam (1).

View file

@ -272,7 +272,7 @@ Bernardsville 2018 3.30
.if t \{.sp3 .if t \{.sp3
.1C\} .1C\}
.SH SOURCE .SH SOURCE
.B /sys/src/cmd/tbl .B /usr/local/plan9/src/cmd/tbl
.SH SEE ALSO .SH SEE ALSO
.IR troff (1), .IR troff (1),
.IR eqn (1), .IR eqn (1),

167
man/man1/tcs.1 Normal file
View file

@ -0,0 +1,167 @@
.TH TCS 1
.SH NAME
tcs \- translate character sets
.SH SYNOPSIS
.B tcs
[
.B -slcv
]
[
.B -f
.I ics
]
[
.B -t
.I ocs
]
[
.I file ...
]
.SH DESCRIPTION
.I Tcs
interprets the named
.I file(s)
(standard input default) as a stream of characters from the
.I ics
character set or format, converts them to runes,
and then converts them into a stream of characters from the
.I ocs
character set or format on the standard output.
The default value for
.I ics
and
.I ocs
is
.BR utf ,
the
.SM UTF
encoding described in
.IR utf (7).
The
.B -l
option lists the character sets known to
.IR tcs .
Processing continues in the face of conversion errors (the
.B -s
option prevents reporting of these errors).
The
.B -c
option forces the output to contain only correctly converted characters;
otherwise,
.B 0x80
characters will be substituted for
.SM UTF
encoding errors and
.B 0xFFFD
characters will substituted for unknown characters.
.PP
The
.B -v
option generates various diagnostic and summary information on standard error,
or makes the
.B -l
output more verbose.
.PP
.I Tcs
recognizes an ever changing list of character sets.
In particular, it supports a variety of Russian and Japanese encodings.
Some of the supported encodings are
.TF jis-kanji
.TP
.B utf
The Plan 9
.SM UTF
encoding, known by ISO as UTF-8
.TP
.B utf1
The deprecated original
.SM UTF
encoding from ISO 10646
.TP
.B ascii
7-bit ASCII
.TP
.B 8859-1
Latin-1 (Central European)
.TP
.B 8859-2
Latin-2 (Czech .. Slovak)
.TP
.B 8859-3
Latin-3 (Dutch .. Turkish)
.TP
.B 8859-4
Latin-4 (Scandinavian)
.TP
.B 8859-5
Part 5 (Cyrillic)
.TP
.B 8859-6
Part 6 (Arabic)
.TP
.B 8859-7
Part 7 (Greek)
.TP
.B 8859-8
Part 8 (Hebrew)
.TP
.B 8859-9
Latin-5 (Finnish .. Portuguese)
.TP
.B koi8
KOI-8 (GOST 19769-74)
.TP
.B jis-kanji
ISO 2022-JP
.TP
.B ujis
EUC-JX: JIS 0208
.TP
.B ms-kanji
Microsoft, or Shift-JIS
.TP
.B jis
(from only) guesses between ISO 2022-JP, EUC or Shift-Jis
.TP
.B gb
Chinese national standard (GB2312-80)
.TP
.B big5
Big 5 (HKU version)
.TP
.B unicode
Unicode Standard 1.0
.TP
.B tis
Thai character set plus
.SM ASCII
(TIS 620-1986)
.TP
.B msdos
IBM PC: CP 437
.TP
.B atari
Atari-ST character set
.SH EXAMPLES
.TP
.B tcs -f 8859-1
Convert 8859-1 (Latin-1) characters into
.SM UTF
format.
.TP
.B tcs -s -f jis
Convert characters encoded in one of several shift JIS encodings into
.SM UTF
format.
Unknown Kanji will be converted into
.B 0xFFFD
characters.
.TP
.B tcs -lv
Print an up to date list of the supported character sets.
.SH SOURCE
.B /usr/local/plan9/src/cmd/tcs
.SH SEE ALSO
.IR ascii (1),
.IR rune (3),
.IR utf (7).

View file

@ -28,7 +28,7 @@ is present.
.B /usr/local/plan9/src/cmd/touch.c .B /usr/local/plan9/src/cmd/touch.c
.SH SEE ALSO .SH SEE ALSO
.IR ls (1), .IR ls (1),
.IR stat (2), .IR stat (3),
.IR chmod (1) .IR chmod (1)
.SH BUGS .SH BUGS
.I Touch .I Touch

111
man/man1/tr2post.1 Normal file
View file

@ -0,0 +1,111 @@
.TH TR2POST 1
.SH NAME
tr2post \- convert troff intermediate to PostScript
.SH SYNOPSIS
.B tr2post
[
.B options
]
[
.I files ...
]
.SH DESCRIPTION
.I Tr2post
converts
.I files
(or standard input),
which should be the device-independent output of
.IR troff (1),
into the PostScript printer language.
.PP
The options are:
.TP
.BI -a " aspectratio
Set an aspect ratio
.RI ( y / x )
to stretch the PostScript output (default 1.0).
.TP
.BI -c " copies
Set a comment in the PostScript output
marking the number of copies that should be printed.
The comment is intended for ancient versions of the Unix
\fIlp\fR(1) and is not recognized by any current printer
or print spooler.
.TP
.BI -d
Emit volumes of debugging output on standard error.
.TP
.BI -m " magnification
Magnify the PostScript output (default 1.0).
.TP
.BI -n " formsperpage
Print the PostScript with
.I formsperpage
logical pages per physical page
(default 1).
Using this option emits PostScript with invalid document structuring
comments.
It will print fine but will not view correctly in
.IR gv (1)
or
.IR psv (1).
.TP
.BI -o " pagelist
Print only the pages in the
.IR pagelist ,
which is a comma-separated list of ranges.
Each range is of the form
.I p
(just page
.IR p ),
.IB p - q
(pages
.I p
through
.IR q ),
.BI - p
(pages 1 through
.IR p ),
or
.IB p -
(pages
.I p
through the end of the document).
.TP
.BI -p " " l
Print the document in landscape mode.
An argument that does not begin with
.L l
will print the document in portrait mode.
.TP
.BI -x " xoffset
Translate the page output by
.I xoffset
inches to the right.
(Negative offsets translate to the left.)
.TP
.BI -y " yoffset
Translate the page output by
.I yoffset
inches down.
(Negative offsets translate up.)
.TP
.BI -P " pscode
Emit the text
.I pscode
at the end of the usual PostScript header.
.PD
.SH EXAMPLE
Preview this manual page:
.IP
.EX
troff -man /usr/local/plan9/man/man1/tr2post.1 |
tr2post |
psfonts >/tmp/a.ps
psv /tmp/a.ps
.EE
.SH SOURCE
.B /usr/local/plan9/src/cmd/postscript/tr2post
.SH SEE ALSO
.IR troff (1),
.IR psfonts (1)

View file

@ -174,17 +174,18 @@ terminal driving tables for
font width tables for font width tables for
.I troff .I troff
.SH SOURCE .SH SOURCE
.B /sys/src/cmd/troff .B /usr/local/plan9/src/cmd/troff
.SH "SEE ALSO" .SH "SEE ALSO"
.IR lp (1), .IR lpr (1),
.IR proof (1), .IR proof (1),
.IR tr2post (1),
.IR eqn (1), .IR eqn (1),
.IR tbl (1), .IR tbl (1),
.IR pic (1), .IR pic (1),
.IR grap (1), .IR grap (1),
.IR doctype (1), .IR doctype (1),
.IR ms (6), .IR ms (7),
.IR image (6), .IR image (7),
.IR tex (1), .IR tex (1),
.IR deroff (1) .IR deroff (1)
.br .br

167
man/man1/tweak.1 Normal file
View file

@ -0,0 +1,167 @@
.TH TWEAK 1
.CT 1 graphics
.SH NAME
tweak \- edit image files, subfont files, face files, etc.
.SH SYNOPSIS
.B tweak
[
.I file ...
]
.SH DESCRIPTION
.I Tweak
edits existing files holding various forms of images.
To create original images, start from an existing image, subfont, etc.
.PP
.I Tweak
reads its argument
.I files
and displays the resulting images in a vertical column.
If the image is too wide to fit across the display, it
is folded much like a long line of text in an
.IR rio
window.
Under each image is displayed one or two lines of text
presenting its parameters.
The first line shows the image's
.BR depth ,
the number
of bits per pixel;
.BR r ,
the rectangle covered by the image;
and the name of the
.B file
from which it was read.
If the file is a subfont, a second line presents a hexadecimal 16-bit
.B offset
to be applied to character values from the subfont
(typically as stored in a font file; see
.IR font (7));
and the subfont's
.BR n ,
.BR height ,
and
.B ascent
as defined in
.IR cachechars (3).
.PP
By means described below, magnified views of portions of the images
may be displayed.
The text associated with such a view includes
.BR mag ,
the magnification.
If the view is of a single character from a subfont, the second
line of text shows the character's value (including the subfont's offset)
in hexadecimal and as a character in
.I tweak's
default font; the character's
.BR x ,
.BR top ,
.BR bottom ,
.BR left ,
and
.BR width
as defined in
.IR cachechars (3);
and
.BR iwidth ,
the physical width of the image in the subfont's image.
.PP
There are two methods to obtain a magnified view of a character from a
subfont.
The first is to click mouse button 1 over the image of the character in
the subfont. The second is to select the
.B char
entry on the button 3 menu,
point the resulting gunsight cursor at the desired subfont and click button 3,
and then type at the text prompt at the bottom of the screen the
character value, either as a multi-digit hexadecimal number or as a single
rune representing the character.
.PP
To magnify a portion of other types of image files,
click button 1 over the unmagnified file.
The cursor will switch to a cross.
Still with button 1, sweep a rectangle, as in
.BR rio ,
that encloses the portion of the image to be magnified.
(If the file is 16×16 or smaller,
.I tweak
will just magnify the entire file; no sweeping is necessary.)
.PP
Pressing buttons 1 and 2 within magnified images changes pixel values.
By default, button 1 sets the pixel to all zeros and button 2 sets the pixel
to all ones.
.PP
Across the top of the screen is a textual display of global parameters.
These values, as well as many of the textual values associated with
the images, may be edited by clicking button 1 on the displayed
value and typing a new value.
The values along the top of the screen are:
.TP
.B mag
Default magnification.
.TP
.B val(hex)
The value used to modify pixels within magnified images.
The value must be in hexadecimal, optionally preceded by a
tilde for bitwise negation.
.TP
.B but1
.TP
.B but2
The pixel value written when the corresponding button is pressed over a pixel.
.TP
.B invert-on-copy
Whether the pixel values are inverted when a
.B copy
operation is performed.
.PP
Under button 3 is a menu holding a variety of functions.
Many of these functions prompt for the image upon which to act
by switching to a gunsight cursor; click button 3 over the
selection, or click a different button to cancel the action.
.TP
.B open
Read and display a file. The name of the file is typed to the prompt
on the bottom line.
.TP
.B read
Reread a file.
.TP
.B write
Write a file.
.TP
.B copy
Use the copy function, default
.BR S ,
to transfer a rectangle of pixels from one image to another.
The program prompts with a cross cursor; sweep out a rectangle in
one image or just click button 3 to select the whole image.
The program will leave that rectangle in place and
attach another one to the cursor. Move that rectangle to the desired
place in any image and click button 3, or another button to cancel the action.
.TP
.B char
As described above, open a magnified view of a character image in a subfont.
.TP
.B pixels
Report the coordinate and value of individual pixels indicated by pressing button 3.
This is a mode of operation canceled by pressing button 1 or 2.
.TP
.B close
Close the specified image.
If the image is the unmagnified file, also close any magnified views of that file.
.TP
.B exit
Quit
.IR tweak .
The program will complain once about modified but unwritten files.
.SH SOURCE
.B /usr/local/plan9/src/cmd/draw/tweak.c
.SH "SEE ALSO"
.IR cachechars (3),
.IR image (7),
.IR font (7)
.SH BUGS
For a program written to adjust width tables in fonts,
.I tweak
has been pushed unreasonably far.

108
man/man1/units.1 Normal file
View file

@ -0,0 +1,108 @@
.TH UNITS 1
.if n .ds / /
.SH NAME
units \- conversion program
.SH SYNOPSIS
.B units
[
.B -v
]
[
.I file
]
.SH DESCRIPTION
.I Units
converts quantities expressed
in various standard scales to
their equivalents in other scales.
It works interactively in this fashion:
.IP
.EX
you have: inch
you want: cm
* 2.54
/ 0.393701
.EE
.PP
A quantity is specified as a multiplicative combination
of units and floating point numbers.
Operators have the following precedence:
.IP
.EX
.ta \w'\fLXXXXXXXXXXXXXXX'u
\fL+\fP \fL-\fP \f1add and subtract
\fL*\fP \fL/\fP \fL×\fP \fL÷\fP \f1multiply and divide
catenation multiply
\fL²\fP \fL³\fP \fL^\fP \f1exponentiation
\fL|\fP \f1divide
\fL(\fP ... \fL)\fP \f1grouping
.EE
.PP
Most familiar units,
abbreviations, and metric prefixes are recognized,
together with a generous leavening of exotica
and a few constants of nature including:
.IP
.de fq
\fL\\$1\\fP \\$2 \\$3 \\$4 \\$5 \\$6
..
.ta \w'\fLwaterXXX'u
.nf
.fq pi,\f1π\fP ratio of circumference to diameter
.fq c speed of light
.fq e charge on an electron
.fq g acceleration of gravity
.fq force same as \fLg\fP
.fq mole Avogadro's number
.fq water "pressure head per unit height of water"
.fq au astronomical unit
.fi
.PP
The
.L pound
is a unit of
mass.
Compound names are run together, e.g.
.LR lightyear .
British units that differ from their US counterparts
are prefixed thus:
.LR brgallon .
Currency is denoted
.LR belgiumfranc ,
.LR britainpound ,
etc.
.PP
The complete list of units can be found in
.BR /lib/units .
A
.I file
argument to
.I units
specifies a file to be used instead of
.BR /lib/units.
The
.B -v
flag causes
.I units
to print its entire database.
.SH EXAMPLE
.EX
you have: 15 pounds force/in²
you want: atm
* 1.02069
/ .97973
.EE
.SH FILES
.B /lib/units
.SH SOURCE
.B /usr/local/plan9/src/cmd/units.y
.SH BUGS
Since
.I units
does only multiplicative scale changes,
it can convert Kelvin to Rankine but not Centigrade to
Fahrenheit.
.br
Currency conversions are only as accurate as the last time someone
updated
.BR /lib/units .

130
man/man1/vac.1 Normal file
View file

@ -0,0 +1,130 @@
.TH VAC 1
.SH NAME
vac \- create a vac archive on Venti
.SH SYNOPSIS
.B vac
[
.B -mqsv
] [
.B -b
.I blocksize
] [
.B -d
.I oldvacfile
] [
.B -e
.I exclude
] [
.B -f
.I vacfile
] [
.B -i
.I name
] [
.B -h
.I host
]
.I file ...
.SH DESCRIPTION
.I Vac
creates an archival copy of Plan 9 file trees on Venti. It can be used
to build a simple backup system. One of the unusual properties of Venti is
that duplicate blocks are detected and coalesced. When
.I vac
is used on a file tree that shares data with an existing archive, the consumption of
storage will be approximately equal to an incremental backup.
This reduction in storage consumption occurs transparently to the user.
.PP
As an optimization, the
.B -d
and
.B -q
options, described below, can be used to explicitly create an archive relative to an existing archive.
These options do not change the resulting archive generated by
.IR vac ,
but simply reduce the number of write operations to Venti.
.PP
The output of
.I vac
is the hexadecimal representation of the Sha1 fingerprint of the root of the archive, in this format:
.IP
.EX
vac:64daefaecc4df4b5cb48a368b361ef56012a4f46
.EE
.PP
Option to
.I vac
are:
.TP
.BI -b " blocksize
Specifies the block size that data will be broken into.
The units for the size can be specified by appending
.L k
to indicate kilobytes.
The default is 8k.
The size must be in the range
of 512 bytes to 52k.
.TP
.BI -d " oldvacfile
Reduce the number of blocks written to Venti by comparing the files to be stored with
the contents of an existing
.I vac
file tree given by
.IR oldvacfile .
.TP
.BI -e " exclude
Do not include the file or directory specified by
.IR exclude .
This option may be repeated multiple times.
.TP
.BI -f " vacfile
The results of
.I vac
are place in
.IR vacfile ,
or the standard output if no file is given.
.TP
.BI -i " name
Include standard input as one of the input files, storing it in the archive
with the specified
.IR name .
.TP
.BI -h " host
The network address of the Venti server.
The default is taken from the environment variable
.BR venti .
.\" If this variable does not exist, then the default is the
.\" metaname
.\" .BR $venti ,
.\" which can be configured via
.\" .IR ndb (6).
.TP
.B -m
Expand and merge any
.I vac
archives that are found while reading the input files. This option is
useful for building an archive from a collection of existing archives. Each archive is inserted
into the new archive as if it had been unpacked in the directory in which it was found. Multiple
archives can be unpacked in a single directory and the contents will be merged. To be detected, the
archives must end in
.LR .vac .
Note, an archive is inserted by simply copying the root fingerprint and does not require
the archive to be unpacked.
.TP
.B -q
Increase the performance of the
.B -d
option by detecting unchanged files based on a match of the files name and other meta data,
rather than examining the contents of the files.
.TP
.B -s
Print out various statistics on standard error.
.TP
.B -v
Produce more verbose output on standard error, including the name of the files added to the archive
and the vac archives that are expanded and merged.
.SH SOURCE
.B /usr/local/plan9/src/cmd/vac
.SH "SEE ALSO"
Plan 9's \fIvacfs\fR(4) and \fIventi\fR(8)

75
man/man1/web.1 Normal file
View file

@ -0,0 +1,75 @@
.TH WEB 1
.SH NAME
web, wmail \- handle web page, mail message for plumber
.SH SYNOPSIS
.B web
.I url
\&...
.br
.B wmail
.I address
.SH DESCRIPTION
.I Web
opens each of the named
.I urls
in a new web browser window.
Any of the
.I urls
may be relative paths to files in the file system;
they will be translated into
.B file://
URLs before being passed to the web browser.
.PP
.I Web
uses the
web browser's
.B -remote
option command-line option,
which requires an instance of the web browser
to be already running.
The choice of browser is determined by the
.B $BROWSER
environment variable, which should be the name of
the executable for your choice of web browser.
Since the various browsers all use different syntaxes
in their
.B -remote
options, the executable name is inspected to determine
the type of browser.
The supported browsers are Opera, Mozilla Firefox, Mozilla Firebird, and Mozilla.
When possible,
.I web
opens each URL in a new tab rather than a new window.
.PP
.I Wmail
starts the composition of a new mail message to
.IR address .
.PP
The choice of mailer is determined by the
.B $MAILER
environment variable.
The supported mailers are:
.TP browser
invoke the mailer via a
.B mailto://
URL passed to
.I web
.PD
.PP
.I Web
and
.I wmail
are invoked as start commands in the
.IR plumber (4)'s
rules for opening web pages and writing mail messages.
.SH FILES
.TP
.B /usr/local/plan9/plumb/basic
plumbing rules using
.I web
and
.I wmail
.SH SOURCE
.B /usr/local/plan9/bin
.SH SEE ALSO
.IR plumber (4)

98
man/man1/wintext.1 Normal file
View file

@ -0,0 +1,98 @@
.TH WINTEXT 1
.SH NAME
wintext, ", "" \- access text in current window
.SH SYNOPSIS
.B wintext
.br
.B \C'"'\
[
.I prefix
]
.br
.B \C'"'\C'"'\
[
.I prefix
]
.SH DESCRIPTION
.I Wintext
prints the text of the current
.I win
(see
.IR acme (1))
or
.IR 9term (1)
window to standard output.
.PP
.I \C'"'
searches the window text for commands typed with a particular prefix
and prints them, indented, to standard output.
.I Prefix
is a regular expression that is matched against the beginning of the command-line.
If
.I prefix
is omitted,
.I \C'"'
prints the last command executed.
.I \C'"'\C'"'
prints the last command that
.I \C'"'
would print and then executes it by piping it into
.IR rc (1).
.PP
Both
.I \C'"'
and
.I \C'"'\C'"'
identify commands in the window text by looking for lines
beginning with a shell prompt.
Prompts are assumed to be an unindented sequence of
non-whitespace characters followed by one of the
characters
.BR % ,
.BR ; ,
.BR $ ,
or
.BR # .
.SH EXAMPLES
Print the
.IR ls (1)
and
.I lc
commands executed in this window:
.IP
.EX
.ta +4n
% \C'"' 'l[sc]'
% ls -l /tmp/qq*
# ls -lrt /etc
% lc r*
%
.EE
.PP
Execute the most recent
.I lc
command again:
.IP
.EX
.ta +4n
% \C'"'\C'"' lc
% lc r*
ramfs rc read rio rm
%
.EE
.SH SEE ALSO
.IR 9term (1),
.IR acme (1)
.SH SOURCE
.B /usr/local/plan9/bin
.SH BUGS
.I \C'"'
and
.I \C'"'\C'"'
are hard to type in shells other than
.IR rc (1).
.\" and in troff!
.PP
Don't run
.I \C'"'\C'"'
twice in a row.

View file

@ -106,7 +106,7 @@ option reverses this.
The parser accepts The parser accepts
.SM UTF .SM UTF
input text (see input text (see
.IR utf (6)), .IR utf (7)),
which has a couple of effects. which has a couple of effects.
First, the return value of First, the return value of
.B yylex() .B yylex()
@ -145,7 +145,7 @@ parser prototype
.B /usr/local/plan9/lib/yaccpars .B /usr/local/plan9/lib/yaccpars
parser prototype using stdio parser prototype using stdio
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/cmd/yacc.c .B /usr/local/plan9/src/cmd/9yacc.c
.SH "SEE ALSO" .SH "SEE ALSO"
.IR lex (1) .IR lex (1)
.br .br

View file

@ -10,8 +10,9 @@ postmountsrv,
readbuf, readbuf,
readstr, readstr,
respond, respond,
srv,
threadpostmountsrv, threadpostmountsrv,
srv \- 9P file service walkandclone \- 9P file service
.SH SYNOPSIS .SH SYNOPSIS
.ft L .ft L
.nf .nf
@ -176,9 +177,7 @@ as
.BI /srv/ name . .BI /srv/ name .
.IP .IP
Fork a child process via Fork a child process via
.I rfork .IR rfork (3)
(see
.IR fork (3))
or or
.I procrfork .I procrfork
(see (see
@ -214,9 +213,7 @@ The parent returns to the caller.
.LP .LP
If any error occurs during If any error occurs during
this process, the entire process is terminated by calling this process, the entire process is terminated by calling
.I sysfatal .IR sysfatal (3).
(see
.IR perror (3)).
.SS Service functions .SS Service functions
The functions in a The functions in a
.B Srv .B Srv
@ -603,12 +600,12 @@ consults
in changing the metadata for in changing the metadata for
.IB r -> fid .IB r -> fid
as described in as described in
.IR stat (5). .IR stat (9p).
When using file trees, When using file trees,
.I srv .I srv
will take care to check that the request satisfies will take care to check that the request satisfies
the permissions outlined in the permissions outlined in
.IR stat (5). .IR stat (9p).
Otherwise Otherwise
.I wstat .I wstat
should take care to enforce permissions should take care to enforce permissions
@ -720,19 +717,16 @@ accept the
option to increment option to increment
.BR chatty9p . .BR chatty9p .
.SH EXAMPLES .SH EXAMPLES
.IR Archfs (4), /usr/local/plan9/src/lib9p/ramfs.c
.IR cdfs (4), is an example of simple single-threaded file servers.
.IR nntpfs (4), On Plan 9, see
.IR snap (4), .IR archfs ,
and .IR cdfs ,
.B /usr/local/plan9/src/lib9p/ramfs.c .IR nntpfs ,
are good examples of simple single-threaded file servers. .IR webfs ,
.IR Webfs (4)
and and
.I sshnet .I sshnet
(see for more examples.
.IR ssh (1))
are good examples of multithreaded file servers.
.PP .PP
In general, the In general, the
.B File .B File
@ -752,9 +746,4 @@ or is maintained elsewhere.
.SH SEE ALSO .SH SEE ALSO
.IR 9pfid (3), .IR 9pfid (3),
.IR 9pfile (3), .IR 9pfile (3),
.IR srv (3), .IR intro (9p)
.IR intro (5)
.SH BUGS
The switch to 9P2000 was taken as an opportunity to tidy
much of the interface; we promise to avoid such gratuitous change
in the future.

342
man/man3/9pclient.3 Normal file
View file

@ -0,0 +1,342 @@
.TH 9PCLIENT 3
.SH NAME
CFid, CFsys, fsinit, fsmount, fsroot, fssetroot, fsunmount, nsmount, fsversion, fsauth, fsattach, fsclose, fscreate, fsdirread, fsdirreadall, fsdirstat, fsdirfstat, fsdirwstat, fsdirfwstat, fsopen, fsopenfd, fspread, fspwrite, fsread, fsreadn, fswrite \- 9P client library
.SH SYNOPSIS
.B #include <u.h>
.PP
.B #include <libc.h>
.PP
.B #include <fcall.h>
.PP
.B #include <9pclient.h>
.PP
.ta +'\fLCFsys* 'u
.B
CFsys* fsmount(int fd, char *aname)
.PP
.B
CFsys* nsmount(char *name, char *aname)
.PP
.B
CFid* fsroot(CFsys *fsys)
.PP
.B
void fsunmount(CFsys *fsys)
.PP
.B
CFsys* fsinit(int fd)
.PP
.B
int fsversion(CFsys *fsys, int msize, char *version, int nversion)
.PP
.B
CFid *fsauth(CFsys *fsys, char *uname, char *aname)
.PP
.B
CFid *fsattach(CFsys *fsys, CFid *afid, char *uname, char *aname)
.PP
.B
void fssetroot(CFsys *fsys, CFid *fid)
.PP
.B
void fsclose(CFid *fid)
.PP
.B
CFid *fscreate(CFsys *fs, char *path, int mode, ulong perm)
.PP
.B
CFid* fsopen(CFsys *fs, char *path, int mode)
.PP
.B
long fspread(CFid *fid, void *buf, long n, vlong offset)
.PP
.B
long fspwrite(CFid *fid, void *buf, long n, vlong offset)
.PP
.B
long fsread(CFid *fid, void *buf, long n)
.PP
.B
long fsreadn(CFid *fid, void *buf, long n)
.PP
.B
long fswrite(CFid *fid, void *buf, long n)
.PP
.B
long fsdirread(CFid *fid, Dir **d)
.PP
.B
long fsdirreadall(CFid *fid, Dir **d)
.PP
.B
Dir* fsdirstat(CFsys *fs, char *path)
.PP
.B
Dir* fsdirfstat(CFid *fid)
.PP
.B
int fsdirwstat(CFsys *fs, char *path, Dir *d)
.PP
.B
int fsdirfwstat(CFid *fid, Dir *d)
.PP
.B
int fsopenfd(CFsys *fs, char *path, int mode)
.SH DESCRIPTION
The
.I 9pclient
library helps client programs interact with 9P servers.
.PP
A
.B CFsys*
represents a connection to a 9P server.
A
.B CFid*
represents an active fid on some connection;
see
.IR intro (9p).
.PP
A new connection to a 9P server is typically established by
.I fsmount
or
.IR nsmount .
.I Fsmount
initializes a new 9P conversation on the open file descriptor
.IR fd ;
.I nsmount
connects to a service named
.I name
in the current name space directory
(see
.IR intro (4)).
Both attach to the root of the file system
using the attach name
.IR aname .
.I Fsroot
returns the
.B CFid*
corresponding to this root.
.PP
.IR Fsinit ,
.IR fsversion ,
.IR fsauth ,
.IR fsattach ,
and
.I fssetroot
provide more detailed control over the file system connection
than
.I fsmount
and
.IR nsmount .
.I Fsinit
allocates a new
.B CFsys*
corresponding to a 9P conversation on the file descriptor
.IR fd .
.I Fsversion
executes a
.IR version (9p)
transaction to establish
maximum message size and 9P version.
.I Fsauth
executes an
.IR auth (9p)
transaction, returning the new auth fid.
.RI ( Fsread
and
.I fswrite
can then be used to run the authentication protocol over the fid.)
.I Fsattach
executes an
.IR attach (9p)
transaction to connect to the root of a file tree served by the server.
It presents
.I afid
(which may be nil)
to establish identity.
.I Fssetroot
sets the root fid used by
.IR fsopen ,
.IR fsopenfd ,
.IR fsdirstat ,
and
.IR fsdirwstat ,
which evaluate rooted path names.
.PP
When a fid
is no longer needed, it should be clunked by calling
.I fsclose
and then considered freed.
Similarly, when the connection to the server is no longer needed,
it should be closed by calling
.IR fsunmount ,
which will take care of calling
.I fsclose
on the current root fid.
Once all fids have been clunked
.I and
the connection has been closed
(the order is not important),
the allocated structures will be freed and the
file descriptor corresponding to the connection
will be closed
(see
.IR close (2)).
Fids are not reference counted: when
.I fsclose
is called, the clunk transaction and freeing of storage
happen immediately.
.PP
.I Fscreate
and
.I fsopen
establish new fids using the
.IR walk ,
.I create
and
.I open
transactions
(see
.IR walk (9p)
and
.IR open (9p)).
The
.I path
argument is evaluated relative to the
.B CFsys
root
(see
.I fsroot
and
.I fssetroot
above).
The path is parsed as a slash-separated sequence of path elements,
as on Unix and Plan 9.
Elements that are empty or
dot
.B ( . )
are ignored.
.PP
Once opened, these fids can be read and written using
.I fspread
and
.IR fspwrite ,
which execute
.I read
and
.I write
transactions
(see
.IR read (9p)).
The library maintains an offset for each fid,
analagous to the offset maintained by the kernel for each open file descriptor.
.I Fsread
and
.I fswrite
read and write from this offset, and update it after successful calls.
Calling
.I fspread
or
.I fspwrite
with an
.I offset
of \-1
is identical to calling
.I fsread
or
.IR fswrite .
.I Fsreadn
calls
.I fsread
repeatedly to obtain exactly
.I n
bytes of data, unless it encounters end-of-file or an error.
.PP
Reading an open a directory returns directory entries encoded as described in
.IR stat (9p).
.I Fsdirread
calls
.I fsread
and then parses the encoded entries into an array of
.B Dir*
data structures,
storing a pointer to the array in
.BI *d
and returning the number of entries.
.I Fsdirreadall
is similar but reads the entire directory.
The returned pointer should be freed with
.I free
(see
.IR malloc (3))
when no longer needed.
.PP
.I Fsdirfstat
and
.I fsdirfwstat
execute
.I stat
and
.I wstat
(see
.IR stat (9p))
transactions.
The
.B Dir
structure returned by
.I fsdirfstat
should be freed with
.I free
(see
.IR malloc (3))
when no longer needed.
.PP
.I Fsdirstat
and
.I fsdirwstat
are similar to
.I fsdirfstat
and
.I fsdirfwstat
but operate on paths relative to the file system root
(see
.I fsopen
and
.I fscreate
above).
.PP
.I Fsopenfd
opens a file on the 9P server
for reading or writing but returns a Unix file descriptor
instead of a fid structure.
The file descriptor is actually one end of a
.IR pipe (2).
A proxy process on the other end is ferrying data
between the pipe and the 9P fid.
Because of the implementation as a pipe,
the only signal of a read or write error is the closing of the pipe.
The file descriptor remains valid even after the
.B CFsys
is unmounted.
.SH SOURCE
.B /usr/local/plan9/src/lib9pclient
.SH SEE ALSO
.IR intro (4),
.IR intro (9p)
.SH BUGS
The implementation
should use a special version string to distinguish between
servers that support
.IR openfd (9p)
and servers that do not.
.PP
The interface does not provide access to the
.IR walk (9p)
transaction, or to
.I open
and
.I create
on already-established fids.
.PP
There is no
.IR fsseek .

View file

@ -42,7 +42,9 @@ bytes at
.I p .I p
(which need not be NUL-terminated) as a UTF string and splits it (which need not be NUL-terminated) as a UTF string and splits it
using using
.IR tokenize (3). .I tokenize
(see
.IR getfields (3)).
It returns a It returns a
.B Cmdbuf .B Cmdbuf
structure holding pointers to each field in the message. structure holding pointers to each field in the message.

View file

@ -94,7 +94,7 @@ and the permissions of
.I dir .I dir
are used to calculate the permission bits for are used to calculate the permission bits for
the file as described in the file as described in
.IR open (5). .IR open (9p).
It is permissible for It is permissible for
.I name .I name
to be a slash-separated path rather than a single element. to be a slash-separated path rather than a single element.
@ -162,7 +162,7 @@ consume the passed reference.
.PP .PP
Directories may be read, yielding a directory entry structure Directories may be read, yielding a directory entry structure
(see (see
.IR stat (5)) .IR stat (9p))
for each file in the directory. for each file in the directory.
In order to allow concurrent reading of directories, In order to allow concurrent reading of directories,
clients must obtain a clients must obtain a

1163
man/man3/INDEX Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,33 +0,0 @@
.TH ABS 3
.SH NAME
abs, labs \- integer absolute values
.SH SYNOPSIS
.B #include <u.h>
.br
.B #include <libc.h>
.PP
.B
int abs(int a)
.PP
.B
long labs(long a)
.SH DESCRIPTION
.I Abs
returns
the absolute value of integer
.IR a ,
and
.I labs
does the same for a long.
.SH SOURCE
.B /usr/local/plan9/src/libc/port/abs.c
.SH SEE ALSO
.IR floor (3)
for
.I fabs
.SH DIAGNOSTICS
.I Abs
and
.I labs
return
the most negative integer or long when the true result is unrepresentable.

View file

@ -148,7 +148,7 @@ The
field will be set to the number of bits per pixel specified field will be set to the number of bits per pixel specified
by the channel descriptor by the channel descriptor
(see (see
.IR image (6)). .IR image (7)).
.I Allocimage .I Allocimage
returns 0 if the server has run out of image memory. returns 0 if the server has run out of image memory.
.PP .PP
@ -214,7 +214,7 @@ values between image and user space or external files.
There is a fixed format for the exchange and storage of There is a fixed format for the exchange and storage of
image data image data
(see (see
.IR image (6)). .IR image (7)).
.PP .PP
.I Unloadimage .I Unloadimage
reads a rectangle of pixels from image reads a rectangle of pixels from image
@ -271,7 +271,7 @@ but for
bytes of compressed image bytes of compressed image
.I data .I data
(see (see
.IR image (6)). .IR image (7)).
On each call to On each call to
.IR cloadimage, .IR cloadimage,
the the
@ -289,7 +289,7 @@ return the number of bytes copied.
.PP .PP
.I Readimage .I Readimage
creates an image from data contained in an external file (see creates an image from data contained in an external file (see
.IR image (6) .IR image (7)
for the file format); for the file format);
.I fd .I fd
is a file descriptor obtained by opening such a file for reading. is a file descriptor obtained by opening such a file for reading.
@ -336,7 +336,7 @@ To allocate a single-pixel replicated image that may be used to paint a region r
.IR graphics (3), .IR graphics (3),
.IR draw (3), .IR draw (3),
.IR draw (3), .IR draw (3),
.IR image (6) .IR image (7)
.SH DIAGNOSTICS .SH DIAGNOSTICS
These functions return pointer 0 or integer \-1 on failure, usually due to insufficient These functions return pointer 0 or integer \-1 on failure, usually due to insufficient
memory. memory.

View file

@ -121,4 +121,4 @@ prog -bffile1 -r -f file2 arg1 arg2
prog -b -f(file1) badflag('r') -f(file2) 2 args: 'arg1' 'arg2' prog -b -f(file1) badflag('r') -f(file2) 2 args: 'arg1' 'arg2'
.PP .PP
.SH SOURCE .SH SOURCE
.B /sys/include/libc.h .B /usr/local/plan9/include/libc.h

269
man/man3/arith3.3 Normal file
View file

@ -0,0 +1,269 @@
.TH ARITH3 3
.SH NAME
add3, sub3, neg3, div3, mul3, eqpt3, closept3, dot3, cross3, len3, dist3, unit3, midpt3, lerp3, reflect3, nearseg3, pldist3, vdiv3, vrem3, pn2f3, ppp2f3, fff2p3, pdiv4, add4, sub4 \- operations on 3-d points and planes
.SH SYNOPSIS
.PP
.B
#include <draw.h>
.PP
.B
#include <geometry.h>
.PP
.B
Point3 add3(Point3 a, Point3 b)
.PP
.B
Point3 sub3(Point3 a, Point3 b)
.PP
.B
Point3 neg3(Point3 a)
.PP
.B
Point3 div3(Point3 a, double b)
.PP
.B
Point3 mul3(Point3 a, double b)
.PP
.B
int eqpt3(Point3 p, Point3 q)
.PP
.B
int closept3(Point3 p, Point3 q, double eps)
.PP
.B
double dot3(Point3 p, Point3 q)
.PP
.B
Point3 cross3(Point3 p, Point3 q)
.PP
.B
double len3(Point3 p)
.PP
.B
double dist3(Point3 p, Point3 q)
.PP
.B
Point3 unit3(Point3 p)
.PP
.B
Point3 midpt3(Point3 p, Point3 q)
.PP
.B
Point3 lerp3(Point3 p, Point3 q, double alpha)
.PP
.B
Point3 reflect3(Point3 p, Point3 p0, Point3 p1)
.PP
.B
Point3 nearseg3(Point3 p0, Point3 p1, Point3 testp)
.PP
.B
double pldist3(Point3 p, Point3 p0, Point3 p1)
.PP
.B
double vdiv3(Point3 a, Point3 b)
.PP
.B
Point3 vrem3(Point3 a, Point3 b)
.PP
.B
Point3 pn2f3(Point3 p, Point3 n)
.PP
.B
Point3 ppp2f3(Point3 p0, Point3 p1, Point3 p2)
.PP
.B
Point3 fff2p3(Point3 f0, Point3 f1, Point3 f2)
.PP
.B
Point3 pdiv4(Point3 a)
.PP
.B
Point3 add4(Point3 a, Point3 b)
.PP
.B
Point3 sub4(Point3 a, Point3 b)
.SH DESCRIPTION
These routines do arithmetic on points and planes in affine or projective 3-space.
Type
.B Point3
is
.IP
.EX
.ta 6n
typedef struct Point3 Point3;
struct Point3{
double x, y, z, w;
};
.EE
.PP
Routines whose names end in
.B 3
operate on vectors or ordinary points in affine 3-space, represented by their Euclidean
.B (x,y,z)
coordinates.
(They assume
.B w=1
in their arguments, and set
.B w=1
in their results.)
.TF reflect3
.TP
Name
Description
.TP
.B add3
Add the coordinates of two points.
.TP
.B sub3
Subtract coordinates of two points.
.TP
.B neg3
Negate the coordinates of a point.
.TP
.B mul3
Multiply coordinates by a scalar.
.TP
.B div3
Divide coordinates by a scalar.
.TP
.B eqpt3
Test two points for exact equality.
.TP
.B closept3
Is the distance between two points smaller than
.IR eps ?
.TP
.B dot3
Dot product.
.TP
.B cross3
Cross product.
.TP
.B len3
Distance to the origin.
.TP
.B dist3
Distance between two points.
.TP
.B unit3
A unit vector parallel to
.IR p .
.TP
.B midpt3
The midpoint of line segment
.IR pq .
.TP
.B lerp3
Linear interpolation between
.I p
and
.IR q .
.TP
.B reflect3
The reflection of point
.I p
in the segment joining
.I p0
and
.IR p1 .
.TP
.B nearseg3
The closest point to
.I testp
on segment
.IR "p0 p1" .
.TP
.B pldist3
The distance from
.I p
to segment
.IR "p0 p1" .
.TP
.B vdiv3
Vector divide \(em the length of the component of
.I a
parallel to
.IR b ,
in units of the length of
.IR b .
.TP
.B vrem3
Vector remainder \(em the component of
.I a
perpendicular to
.IR b .
Ignoring roundoff, we have
.BR "eqpt3(add3(mul3(b, vdiv3(a, b)), vrem3(a, b)), a)" .
.PD
.PP
The following routines convert amongst various representations of points
and planes. Planes are represented identically to points, by duality;
a point
.B p
is on a plane
.B q
whenever
.BR p.x*q.x+p.y*q.y+p.z*q.z+p.w*q.w=0 .
Although when dealing with affine points we assume
.BR p.w=1 ,
we can't make the same assumption for planes.
The names of these routines are extra-cryptic. They contain an
.B f
(for `face') to indicate a plane,
.B p
for a point and
.B n
for a normal vector.
The number
.B 2
abbreviates the word `to.'
The number
.B 3
reminds us, as before, that we're dealing with affine points.
Thus
.B pn2f3
takes a point and a normal vector and returns the corresponding plane.
.TF reflect3
.TP
Name
Description
.TP
.B pn2f3
Compute the plane passing through
.I p
with normal
.IR n .
.TP
.B ppp2f3
Compute the plane passing through three points.
.TP
.B fff2p3
Compute the intersection point of three planes.
.PD
.PP
The names of the following routines end in
.B 4
because they operate on points in projective 4-space,
represented by their homogeneous coordinates.
.TP
pdiv4
Perspective division. Divide
.B p.w
into
.IR p 's
coordinates, converting to affine coordinates.
If
.B p.w
is zero, the result is the same as the argument.
.TP
add4
Add the coordinates of two points.
.PD
.TP
sub4
Subtract the coordinates of two points.
.SH SOURCE
.B /usr/local/plan9/src/libgeometry
.SH "SEE ALSO
.IR matrix (3)

View file

@ -127,7 +127,7 @@ Therefore, it may be necessary to back up the input stream one character
after calling after calling
.IR charstod . .IR charstod .
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/libc/port .B /usr/local/plan9/src/lib9
.SH SEE ALSO .SH SEE ALSO
.IR fscanf (3) .IR fscanf (3)
.SH DIAGNOSTICS .SH DIAGNOSTICS

View file

@ -1,395 +0,0 @@
.TH AUTH 3
.SH NAME
amount, newns, addns, login, noworld, auth_proxy, fauth_proxy, auth_allocrpc, auth_freerpc, auth_rpc, auth_getkey, amount_getkey, auth_freeAI, auth_chuid, auth_challenge, auth_response, auth_freechal, auth_respond, auth_userpasswd, auth_getuserpasswd, auth_getinfo\- routines for authenticating users
.SH SYNOPSIS
.nf
.PP
.ft L
#include <u.h>
#include <libc.h>
#include <auth.h>
.fi
.ta 11n +4n +4n +4n +4n +4n +4n
.PP
.B
int newns(char *user, char *nsfile);
.PP
.B
int addns(char *user, char *nsfile);
.PP
.B
int amount(int fd, char *old, int flag, char *aname);
.PP
.B
int login(char *user, char *password, char *namespace);
.PP
.B
int noworld(char *user);
.PP
.B
AuthInfo* auth_proxy(int fd, AuthGetkey *getkey, char *fmt, ...);
.PP
.B
AuthInfo* fauth_proxy(int fd, AuthRpc *rpc, AuthGetkey *getkey,
.br
.B char *params);
.PP
.B
AuthRpc* auth_allocrpc(int afd);
.PP
.B
void auth_freerpc(AuthRpc *rpc);
.PP
.B
uint auth_rpc(AuthRpc *rpc, char *verb, void *a, int n);
.PP
.B
int auth_getkey(char *proto, char *dom);
.PP
.B
int (*amount_getkey)(char*, char*);
.PP
.B
void auth_freeAI(AuthInfo *ai);
.PP
.B
int auth_chuid(AuthInfo *ai, char *ns);
.PP
.B
Chalstate* auth_challenge(char *fmt, ...);
.PP
.B
AuthInfo* auth_response(Chalstate*);
.PP
.B
void auth_freechal(Chalstate*);
.PP
.B
int auth_respond(void *chal, uint nchal, char *user, uint nuser, void *resp, uint nresp, AuthGetkey *getkey, char *fmt, ...);
.PP
.B
AuthInfo* auth_userpasswd(char*user, char*password);
.PP
.B
UserPasswd* auth_getuserpasswd(AuthGetkey *getkey, char*fmt, ...);
.PP
.B
AuthInfo* auth_getinfo(int fd);
.SH DESCRIPTION
.PP
This library, in concert with
.IR factotum (4),
is used to authenticate users.
It provides the primary interface to
.IR factotum .
.PP
.I Newns
builds a name space for
.IR user .
It opens the file
.I nsfile
.RB ( /lib/namespace
is used if
.I nsfile
is null),
copies the old environment, erases the current name space,
sets the environment variables
.B user
and
.BR home ,
and interprets the commands in
.IR nsfile .
The format of
.I nsfile
is described in
.IR namespace (6).
.PP
.I Addns
also interprets and executes the commands in
.IR nsfile .
Unlike
.I newns
it applies the command to the current name space
rather than starting from scratch.
.PP
.I Amount
is like
.I mount
but performs any authentication required.
It should be used instead of
.I mount
whenever the file server being mounted requires authentication.
See
.IR bind (3)
for a definition of the arguments to
.I mount
and
.IR amount .
.PP
.I Login
changes the user id of the process
.I user
and recreates the namespace using the file
.I namespace
(default
.BR /lib/nnamespace ).
It uses
.I auth_userpassword
and
.IR auth_chuid .
.PP
.I Noworld
returns 1 if the user is in the group
.B noworld
in
.BR /adm/users .
Otherwise, it returns 0.
.I Noworld
is used by telnetd and ftpd to provide sandboxed
access for some users.
.PP
The following routines use the
.B AuthInfo
structure returned after a successful authentication by
.IR factotum (4).
.PP
.ne 8
.EX
.ta 4n +4n +4n +4n +4n +4n +4n +4n +4n
typedef struct
{
char *cuid; /* caller id */
char *suid; /* server id */
char *cap; /* capability */
int nsecret; /* length of secret */
uchar *secret; /* secret */
} AuthInfo;
.EE
.sp
The fields
.B cuid
and
.B suid
point to the authenticated ids of the client and server.
.B Cap
is a capability returned only to the server.
It can be passed to the
.IR cap (3)
device to change the user id of the process.
.B Secret
is an
.BR nsecret -byte
shared secret that can be used by the client and server to
create encryption and hashing keys for the rest of the
conversation.
.PP
.I Auth_proxy
proxies an authentication conversation between a remote
server reading and writing
.I fd
and a
.I factotum
file. The
.I factotum
file used is
.BR /mnt/factotum/rpc .
An
.B sprint
(see
.IR print (3))
of
.I fmt
and the variable arg list yields a key template (see
.IR factotum (4))
specifying the key to use.
The template must specify at least the protocol (
.BI proto= xxx )
and the role (either
.B role=client
or
.BR role=server ).
.I Auth_proxy
either returns an allocated
.B AuthInfo
structure, or sets the error string and
returns nil.
.PP
.I Fauth_proxy
can be used instead of
.I auth_proxy
if a single connection to
.I factotum
will be used for multiple authentications.
This is necessary, for example, for
.I newns
which must open the
.I factotum
file before wiping out the namespace.
.I Fauth_proxy
takes as an argument a pointer to an
.B AuthRPC
structure which contains an fd for an open connection to
.I factotum
in addition to storage and state information for
the protocol.
An
.B AuthRPC
structure is obtained by calling
.I auth_allocrpc
with the fd of an open
.I factotum
connection.
It is freed using
.IR auth_freerpc .
Individual commands can be sent to
.IR factotum (4)
by invoking
.IR auth_rpc .
.PP
Both
.I auth_proxy
and
.I fauth_proxy
take a pointer to a routine,
.IR getkey ,
to invoke should
.I factotum
not posess a key for the authentication. If
.I getkey
is nil, the authentication fails.
.I Getkey
is called with a key template for the desired
key.
We have provided a generic routine,
.IR auth_getkey ,
which queries the user for
the key information and passes it to
.IR factotum .
This is the default for the global variable,
.IR amount_getkey ,
which holds a pointer to the key prompting routine used by
.IR amount .
.PP
.I Auth_chuid
uses the
.B cuid
and
.B cap
fields of an
.B AuthInfo
structure to change the user id of the current
process and uses
.IR ns ,
default
.BR /lib/namespace ,
to build it a new name space.
.PP
.I Auth_challenge
and
.I auth_response
perform challenge/response protocols with
.IR factotum .
State between the challenge and response phase are
kept in the
.B Chalstate
structure:
.sp
.EX
struct Chalstate
{
char *user;
char chal[MAXCHLEN];
int nchal;
void *resp;
int nresp;
/* for implementation only */
int afd;
AuthRpc *rpc;
char userbuf[MAXNAMELEN];
int userinchal;
};
.EE
.sp
.I Auth_challenge
requires a key template generated by an
.B sprint
of
.I fmt
and the variable arguments. It must contain the protocol
(\fBproto=\fIxxx\fR)
and depending on the protocol, the user name (
.BI user= xxx \fR).\fP
.B P9cr
and
.B vnc
expect the user specified as an attribute in
the key template and
.BR apop ,
.BR cram ,
and
.BR chap
expect it in the
.B user
field of the arg to
.IR auth_response .
For all protocols, the response is returned
to
.I auth_response
in the
.I resp
field of the
.BR Chalstate .
.I Chalstate.nresp
must be the length of the response.
.PP
Supply to
.I auth_respond
a challenge string and the fmt and args specifying a key,
and it will use
.I factotum
to return the proper user and response.
.PP
.I Auth_userpasswd
verifies a simple user/password pair.
.I Auth_getuserpasswd
retrieves a user/password pair from
.I factotum
if permitted.
.PP
.I Auth_getinfo
reads an
.B AuthInfo
message from
.I fd
and converts it into a structure. It is only
used by the other routines in this library when
communicating with
.IR factotum .
.PP
.ne 8
.EX
.ta 4n +4n +4n +4n +4n +4n +4n +4n +4n
typedef struct UserPasswd {
char *user;
char *passwd;
} UserPasswd;
.EE
.sp
.PP
.I Auth_freeAI
is used to free an
.B AuthInfo
structure returned by one of these routines.
Similary
.I auth_freechal
frees a challenge/response state.
.SH SOURCE
.B /usr/local/plan9/src/libauth
.SH SEE ALSO
.IR factotum (4),
.IR authsrv (3),
.IR bind (3)
.SH DIAGNOSTICS
These routines set
.IR errstr .

View file

@ -1,223 +0,0 @@
.TH AUTHSRV 3
.SH NAME
authdial, passtokey, nvcsum, readnvram, convT2M, convM2T, convTR2M, convM2TR, convA2M, convM2A, convPR2M, convM2PR, _asgetticket, _asrdresp \- routines for communicating with authentication servers
.SH SYNOPSIS
.nf
.PP
.ft L
#include <u.h>
#include <libc.h>
#include <authsrv.h>
.fi
.ta 8n +4n +4n +4n +4n +4n +4n
.PP
.B
int authdial(char *netroot, char *ad);
.PP
.B
int passtokey(char key[DESKEYLEN], char *password)
.PP
.B
uchar nvcsum(void *mem, int len)
.PP
.B
int readnvram(Nvrsafe *nv, int flag);
.PPP
.B
int convT2M(Ticket *t, char *msg, char *key)
.PP
.B
void convM2T(char *msg, Ticket *t, char *key)
.PP
.B
int convA2M(Authenticator *a, char *msg, char *key)
.PP
.B
void convM2A(char *msg, Authenticator *a, char *key)
.PP
.B
int convTR2M(Ticketreq *tr, char *msg)
.PP
.B
void convM2TR(char *msg, Ticketreq *tr)
.PP
.B
int convPR2M(Passwordreq *pr, char *msg, char *key)
.PP
.B
void convM2PR(char *msg, Passwordreq *pr, char *key)
.PP
.B
int _asgetticket(int fd, char *trbuf, char *tbuf);
.PP
.B
int _asrdresp(int fd, char *buf, int len);
.SH DESCRIPTION
.PP
.I Authdial
dials an authentication server over the
network rooted at
.IR net ,
default
.BR /net .
The authentication domain,
.IR ad ,
specifies which server to call.
If
.I ad
is non-nil,
the connection server
.B cs
(see
.IR ndb (8))
is queried for an entry which contains
.B authdom=\fIad\fP
or
.BR dom=\fIad\fP ,
the former having precedence,
and which also contains an
.B auth
attribute.
The string dialed is then
.I netroot\fP!\fIserver\fP!ticket
where
.I server
is the value of the
.B auth
attribute.
If no entry is found, the error string is
set to ``no authentication server found''
and -1 is returned.
If
.I authdom
is nil, the string
.IB netroot !$auth! ticket
is used to make the call.
.PP
.I Passtokey
converts
.I password
into a DES key and stores the result in
.IR key .
It returns 0 if
.I password
could not be converted,
and 1 otherwise.
.PP
.I Readnvram
reads authentication information into the structure:
.EX
.ta 4n +4n +8n +4n +4n +4n +4n
struct Nvrsafe
{
char machkey[DESKEYLEN];
uchar machsum;
char authkey[DESKEYLEN];
uchar authsum;
char config[CONFIGLEN];
uchar configsum;
char authid[ANAMELEN];
uchar authidsum;
char authdom[DOMLEN];
uchar authdomsum;
};
.EE
.PP
On Sparc, MIPS, and SGI machines this information is
in non-volatile ram, accessible in the file
.BR #r/nvram .
On x86s and Alphas
.I readnvram
successively opens the following areas stopping with the
first to succeed:
.PP
\- the partition named by the
.B $nvram
environment variable
(commonly set via
.IR plan9.ini (8))
.br
\- the partition
.B #S/sdC0/nvram
.br
\- a file called
.B plan9.nvr
in the partition
.B #S/sdC0/9fat
.br
\- the partition
.B #S/sd00/nvram
.br
\- a file called
.B plan9.nvr
in the partition
.B #S/sd00/9fat
.br
\- a file called
.B plan9.nvr
on a DOS floppy in drive 0
.br
\- a file called
.B plan9.nvr
on a DOS floppy in drive 1
.PP
The
.IR nvcsum s
of the fields
.BR machkey ,
.BR authid ,
and
.B authdom
must match their respective checksum or that field is zeroed.
If
.I flag
is
.B NVwrite
or at least one checksum fails and
.I flag
is
.BR NVwriteonerr ,
.I readnvram
will prompt for new values on
.B #c/cons
and then write them back to the storage area.
.PP
.IR ConvT2M ,
.IR convA2M ,
.IR convTR2M ,
and
.I convPR2M
convert tickets, authenticators, ticket requests, and password change request
structures into transmittable messages.
.IR ConvM2T ,
.IR convM2A ,
.IR convM2TR ,
and
.I convM2PR
are used to convert them back.
.I Key
is used for encrypting the message before transmission and decrypting
after reception.
.PP
The routine
.I _asgetresp
receives either a character array or an error string.
On error, it sets errstr and returns -1. If successful,
it returns the number of bytes received.
.PP
The routine
.I _asgetticket
sends a ticket request message and then uses
.I _asgetresp
to recieve an answer.
.SH SOURCE
.B /usr/local/plan9/src/libauthsrv
.SH SEE ALSO
.IR passwd (1),
.IR cons (3),
.IR dial (3),
.IR authsrv (6),
.SH DIAGNOSTICS
These routines set
.IR errstr .
Integer-valued functions return -1 on error.

View file

@ -1,6 +1,6 @@
.TH BIO 3 .TH BIO 3
.SH NAME .SH NAME
Bopen, Binit, Binits, Brdline, Brdstr, Bgetc, Bgetrune, Bgetd, Bungetc, Bungetrune, Bread, Bseek, Boffset, Bfildes, Blinelen, Bputc, Bputrune, Bprint, Bvprint, Bwrite, Bflush, Bterm, Bbuffered \- buffered input/output Bopen, Bfdopen, Binit, Binits, Brdline, Brdstr, Bgetc, Bgetrune, Bgetd, Bungetc, Bungetrune, Bread, Bseek, Boffset, Bfildes, Blinelen, Bputc, Bputrune, Bprint, Bvprint, Bwrite, Bflush, Bterm, Bbuffered \- buffered input/output
.SH SYNOPSIS .SH SYNOPSIS
.ta \w'Biobuf* 'u .ta \w'Biobuf* 'u
.B #include <u.h> .B #include <u.h>
@ -10,7 +10,10 @@ Bopen, Binit, Binits, Brdline, Brdstr, Bgetc, Bgetrune, Bgetd, Bungetc, Bungetru
.B #include <bio.h> .B #include <bio.h>
.PP .PP
.B .B
Biobuf* Bopen(char *file, int mode) Biobuf* Bopen(char *file, int mode)
.PP
.B
Biobuf* Bfdopen(int fd, int mode)
.PP .PP
.B .B
int Binit(Biobuf *bp, int fd, int mode) int Binit(Biobuf *bp, int fd, int mode)
@ -93,6 +96,17 @@ It calls
.IR malloc (3) .IR malloc (3)
to allocate a buffer. to allocate a buffer.
.PP .PP
.I Bfdopen
allocates a buffer for the already-open file descriptor
.I fd
for mode
.B OREAD
or
.BR OWRITE .
It calls
.IR malloc (3)
to allocate a buffer.
.PP
.I Binit .I Binit
initializes a standard size buffer, type initializes a standard size buffer, type
.IR Biobuf , .IR Biobuf ,
@ -312,7 +326,7 @@ written.
.IR open (3), .IR open (3),
.IR print (3), .IR print (3),
.IR exits (3), .IR exits (3),
.IR utf (6), .IR utf (7),
.SH DIAGNOSTICS .SH DIAGNOSTICS
.I Bio .I Bio
routines that return integers yield routines that return integers yield

View file

@ -4,7 +4,7 @@ cachechars, agefont, loadchar, Subfont, Fontchar, Font \- font utilities
.SH SYNOPSIS .SH SYNOPSIS
.B #include <u.h> .B #include <u.h>
.br .br
.B #include <draw.h> .B #include <libc.h>
.br .br
.B #include <draw.h> .B #include <draw.h>
.PP .PP
@ -127,7 +127,7 @@ A
.B Font .B Font
consists of an overall height and ascent consists of an overall height and ascent
and a collection of subfonts together with the ranges of runes (see and a collection of subfonts together with the ranges of runes (see
.IR utf (6)) .IR utf (7))
they represent. they represent.
Fonts are described by the following structures. Fonts are described by the following structures.
.IP .IP
@ -306,8 +306,8 @@ for replacement when the cache is full.
.IR allocimage (3), .IR allocimage (3),
.IR draw (3), .IR draw (3),
.IR subfont (3), .IR subfont (3),
.IR image (6), .IR image (7),
.IR font (6) .IR font (7)
.SH DIAGNOSTICS .SH DIAGNOSTICS
All of the functions use the graphics error function (see All of the functions use the graphics error function (see
.IR graphics (3)). .IR graphics (3)).

View file

@ -29,6 +29,6 @@ Therefore
.I filename .I filename
must contain room for at least two bytes. must contain room for at least two bytes.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/libc/port/cleanname.c .B /usr/local/plan9/src/lib9/cleanname.c
.SH SEE ALSO .SH SEE ALSO
.IR cleanname (1) .IR cleanname (1)

View file

@ -19,7 +19,7 @@ int cmap2rgba(int col)
.SH DESCRIPTION .SH DESCRIPTION
These routines convert between `true color' red/green/blue triples and the Plan 9 color map. These routines convert between `true color' red/green/blue triples and the Plan 9 color map.
See See
.IR color (6) .IR color (7)
for a description of RGBV, the standard color map. for a description of RGBV, the standard color map.
.PP .PP
.I Rgb2cmap .I Rgb2cmap
@ -52,5 +52,5 @@ take colors as arguments.
.IR graphics (3), .IR graphics (3),
.IR allocimage (3), .IR allocimage (3),
.IR draw (3), .IR draw (3),
.IR image (6), .IR image (7),
.IR color (6) .IR color (7)

View file

@ -1,6 +1,6 @@
.TH COMPLETE 3 .TH COMPLETE 3
.SH NAME .SH NAME
complete \- file name completion complete, freecompletion \- file name completion
.SH SYNOPSIS .SH SYNOPSIS
.B #include <u.h> .B #include <u.h>
.br .br

View file

@ -24,11 +24,5 @@ child processes in user code, and child processes in system calls.
returns the sum of those same times, converted to seconds. returns the sum of those same times, converted to seconds.
.I Times .I Times
returns the elapsed real time, in milliseconds, that the process has been running. returns the elapsed real time, in milliseconds, that the process has been running.
.PP
These functions read
.BR /dev/cputime ,
opening that file when they are first called.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/libc/9sys .B /usr/local/plan9/src/lib9/time.c
.SH SEE ALSO
.IR cons (3)

98
man/man3/ctime.3 Normal file
View file

@ -0,0 +1,98 @@
.TH CTIME 3
.SH NAME
ctime, localtime, gmtime, asctime, tm2sec, timezone \- convert date and time
.SH SYNOPSIS
.B #include <u.h>
.br
.B #include <libc.h>
.PP
.ta \w'\fLchar* 'u
.B
char* ctime(long clock)
.PP
.B
Tm* localtime(long clock)
.PP
.B
Tm* gmtime(long clock)
.PP
.B
char* asctime(Tm *tm)
.PP
.B
long tm2sec(Tm *tm)
.SH DESCRIPTION
.I Ctime
converts a time
.I clock
such as returned by
.IR time (3)
into
.SM ASCII
(sic)
and returns a pointer to a
30-byte string
in the following form.
All the fields have constant width.
.PP
.B
Wed Aug 5 01:07:47 EST 1973\en\e0
.PP
.I Localtime
and
.I gmtime
return pointers to structures containing
the broken-down time.
.I Localtime
corrects for the time zone and possible daylight savings time;
.I gmtime
converts directly to GMT.
.I Asctime
converts a broken-down time to
.SM ASCII
and returns a pointer
to a 30-byte string.
.IP
.EX
.ta 6n +\w'char 'u +\w'zone[4]; 'u
typedef
struct {
int sec; /* seconds (range 0..59) */
int min; /* minutes (0..59) */
int hour; /* hours (0..23) */
int mday; /* day of the month (1..31) */
int mon; /* month of the year (0..11) */
int year; /* year A.D. \- 1900 */
int wday; /* day of week (0..6, Sunday = 0) */
int yday; /* day of year (0..365) */
char zone[4]; /* time zone name */
int tzoff; /* time zone delta from GMT */
} Tm;
.EE
.PP
.I Tm2sec
converts a broken-down time to
seconds since the start of the epoch.
It ignores
.BR wday ,
and assumes the local time zone
if
.B zone
is not
.BR GMT .
.SH SOURCE
.B /usr/local/plan9/src/lib9/date.c
.br
.B /usr/local/plan9/src/lib9/ctime.c
.SH "SEE ALSO"
.IR date (1),
.IR time (3)
.SH BUGS
The return values point to static data
whose content is overwritten by each call.
.br
Daylight Savings Time is ``normal'' in the Southern hemisphere.
.br
These routines are not equipped to handle non-\c
.SM ASCII
text, and are provincial anyway.

View file

@ -1,6 +1,6 @@
.TH DIAL 3 .TH DIAL 3
.SH NAME .SH NAME
dial, hangup, announce, listen, accept, reject, netmkaddr, setnetmtpt, getnetconninfo, freenetconninfo \- make and break network connections dial, hangup, announce, listen, accept, reject, netmkaddr, dialparse \- make and break network connections
.SH SYNOPSIS .SH SYNOPSIS
.B #include <u.h> .B #include <u.h>
.br .br
@ -10,9 +10,6 @@ dial, hangup, announce, listen, accept, reject, netmkaddr, setnetmtpt, getnetcon
int dial(char *addr, char *local, char *dir, int *cfdp) int dial(char *addr, char *local, char *dir, int *cfdp)
.PP .PP
.B .B
int hangup(int ctl)
.PP
.B
int announce(char *addr, char *dir) int announce(char *addr, char *dir)
.PP .PP
.B .B
@ -26,15 +23,18 @@ int reject(int ctl, char *dir, char *cause)
.PP .PP
.B .B
char* netmkaddr(char *addr, char *defnet, char *defservice) char* netmkaddr(char *addr, char *defnet, char *defservice)
.\" .PP
.\" .B
.\" void setnetmtpt(char *to, int tolen, char *from)
.\" .PP
.\" .B
.\" NetConnInfo* getnetconninfo(char *conndir, int fd)
.\" .PP
.\" .B
.\" void freenetconninfo(NetConnINfo*)
.PP .PP
.B .B
void setnetmtpt(char *to, int tolen, char *from) int dialparse(char *addr, char **net, char **unix, u32int *host, int *port)
.PP
.B
NetConnInfo* getnetconninfo(char *conndir, int fd)
.PP
.B
void freenetconninfo(NetConnINfo*)
.SH DESCRIPTION .SH DESCRIPTION
For these routines, For these routines,
.I addr .I addr
@ -44,8 +44,10 @@ is a network address of the form
or simply or simply
.IR netaddr . .IR netaddr .
.I Network .I Network
is any directory listed in is
.B /net .BR tcp ,
.BR udp ,
.BR unix ,
or the special token, or the special token,
.BR net . .BR net .
.B Net .B Net
@ -53,45 +55,28 @@ is a free variable that stands for any network in common
between the source and the host between the source and the host
.IR netaddr . .IR netaddr .
.I Netaddr .I Netaddr
can be a host name, a domain name, a network address, can be a host name, a domain name, or a network address.
or a meta-name of the form .\" or a meta-name of the form
.BI $ attribute\f1, .\" .BI $ attribute\f1,
which .\" which
is replaced by .\" is replaced by
.I value .\" .I value
from the value-attribute pair .\" from the value-attribute pair
.IB attribute = value .\" .IB attribute = value
most closely associated with the source host in the .\" most closely associated with the source host in the
network data base (see .\" network data base (see
.IR ndb (6)). .\" .IR ndb (6)).
.PP .PP
If a connection attempt is successful and On Plan 9, the
.I dir .I dir
is non-zero, argument is a path name to a
the path name of a
.I line directory .I line directory
that has files for accessing the connection that has files for accessing the connection.
is copied into To keep the same function signatures,
.IR dir . the Unix port of these routines uses strings of the form
The path name is guaranteed to be less than 40 .BI /dev/fd/ n
bytes long. instead of line directory paths.
One line directory exists for each possible connection. These strings should be treated as opaque data and ignored.
The
.B data
file in the line directory should be used to communicate with the destination.
The
.B ctl
file in the line directory can be used to send commands to the line.
See
.IR ip (3)
for messages that can be written to the
.B ctl
file.
The last close of the
.B data
or
.B ctl
file will close the connection.
.PP .PP
.I Dial .I Dial
makes a call to destination makes a call to destination
@ -111,26 +96,19 @@ file in the line directory.
The The
.B addr .B addr
file in the line directory contains the address called. file in the line directory contains the address called.
If the network allows the local address to be set, .\" If the network allows the local address to be set,
as is the case with UDP and TCP port numbers, and .\" as is the case with UDP and TCP port numbers, and
.IR local .\" .IR local
is non-zero, the local address will be set to .\" is non-zero, the local address will be set to
.IR local . .\" .IR local .
If .IR Dial 's
.I cfdp .IR local ,
is non-zero, .IR dir ,
.BI * cfdp
is set to a file descriptor open for reading and
writing the control file.
.PP
.I Hangup
is a means of forcing a connection to hang up without
closing the
.B ctl
and and
.B data .I cfdp
files. arguments
.P are not supported and must be zero.
.PP
.I Announce .I Announce
and and
.I listen .I listen
@ -181,73 +159,78 @@ It takes an address along with a default network and service to use
if they are not specified in the address. if they are not specified in the address.
It returns a pointer to static data holding the actual address to use. It returns a pointer to static data holding the actual address to use.
.PP .PP
.I Getnetconninfo .I Dialparse
returns a structure containing information about a parses a network address as described above
network connection. The structure is: into a network name, a Unix domain socket address,
.EX an IPv4 host address, and an IPv4 port number.
typedef struct NetConnInfo NetConnInfo; .\" .PP
struct NetConnInfo .\" .I Getnetconninfo
{ .\" returns a structure containing information about a
char *dir; /* connection directory */ .\" network connection. The structure is:
char *root; /* network root */ .\" .EX
char *spec; /* binding spec */ .\" typedef struct NetConnInfo NetConnInfo;
char *lsys; /* local system */ .\" struct NetConnInfo
char *lserv; /* local service */ .\" {
char *rsys; /* remote system */ .\" char *dir; /* connection directory */
char *rserv; /* remote service */ .\" char *root; /* network root */
}; .\" char *spec; /* binding spec */
.EE .\" char *lsys; /* local system */
.PP .\" char *lserv; /* local service */
The information is obtained from the connection directory, .\" char *rsys; /* remote system */
.IR conndir . .\" char *rserv; /* remote service */
If .\" };
.I conndir .\" .EE
is nil, the directory is obtained by performing .\" .PP
.IR fd2path (3) .\" The information is obtained from the connection directory,
on .\" .IR conndir .
.IR fd . .\" If
.I Getnetconninfo .\" .I conndir
returns either a completely specified structure, or .\" is nil, the directory is obtained by performing
nil if either the structure can't be allocated or the .\" .IR fd2path (3)
network directory can't be determined. .\" on
The structure .\" .IR fd .
is freed using .\" .I Getnetconninfo
.IR freenetconninfo . .\" returns either a completely specified structure, or
.PP .\" nil if either the structure can't be allocated or the
.I Setnetmtpt .\" network directory can't be determined.
copies the name of the network mount point into .\" The structure
the buffer .\" is freed using
.IR to , .\" .IR freenetconninfo .
whose length is .\" .PP
.IR tolen . .\" .I Setnetmtpt
It exists to merge two pre-existing conventions for specifying .\" copies the name of the network mount point into
the mount point. .\" the buffer
Commands that take a network mount point as a parameter .\" .IR to ,
(such as .\" whose length is
.BR dns , .\" .IR tolen .
.BR cs .\" It exists to merge two pre-existing conventions for specifying
(see .\" the mount point.
.IR ndb (8)), .\" Commands that take a network mount point as a parameter
and .\" (such as
.IR ipconfig (8)) .\" .BR dns ,
should now call .\" .BR cs
.IR setnetmtpt . .\" (see
If .\" .IR ndb (8)),
.I from .\" and
is .\" .IR ipconfig (8))
.BR nil , .\" should now call
the mount point is set to the default, .\" .IR setnetmtpt .
.BR /net . .\" If
If .\" .I from
.I from .\" is
points to a string starting with a slash, .\" .BR nil ,
the mount point is that path. .\" the mount point is set to the default,
Otherwise, the mount point is the string pointed to by .\" .BR /net .
.I from .\" If
appended to the string .\" .I from
.BR /net . .\" points to a string starting with a slash,
The last form is obsolete and is should be avoided. .\" the mount point is that path.
It exists only to aid in conversion. .\" Otherwise, the mount point is the string pointed to by
.\" .I from
.\" appended to the string
.\" .BR /net .
.\" The last form is obsolete and is should be avoided.
.\" It exists only to aid in conversion.
.SH EXAMPLES .SH EXAMPLES
Make a call and return an open file descriptor to Make a call and return an open file descriptor to
use for communications: use for communications:
@ -259,12 +242,13 @@ int callkremvax(void)
} }
.EE .EE
.PP .PP
Call the local authentication server: Connect to a Unix socket served by
.IR acme (4):
.IP .IP
.EX .EX
int dialauth(char *service) int dialacme(void)
{ {
return dial(netmkaddr("$auth", 0, service), 0, 0, 0); return dial("unix!/tmp/ns.ken.:0/acme", 0, 0, 0);
} }
.EE .EE
.PP .PP
@ -315,17 +299,14 @@ bekremvax(void)
} }
.EE .EE
.SH SOURCE .SH SOURCE
.BR /usr/local/plan9/src/libc/9sys , .B /usr/local/plan9/src/lib9/dial.c
.B /usr/local/plan9/src/libc/port .br
.SH "SEE ALSO" .B /usr/local/plan9/src/lib9/announce.c
.IR auth (3), .br
.IR ip (3), .B /usr/local/plan9/src/lib9/_p9dialparse.c
.IR ndb (8)
.SH DIAGNOSTICS .SH DIAGNOSTICS
.IR Dial , .IR Dial ,
.IR announce , .IR announce ,
and and
.I listen .I listen
return \-1 if they fail. return \-1 if they fail.
.I Hangup
returns nonzero if it fails.

View file

@ -62,7 +62,7 @@ always returns complete
.B Dir .B Dir
structures. structures.
See See
.IR read (5) .IR read (9p)
for more information. for more information.
.PP .PP
The constant The constant
@ -83,7 +83,7 @@ structures filled in
.BR buf . .BR buf .
The file offset is advanced by the number of bytes actually read. The file offset is advanced by the number of bytes actually read.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/libc/9sys/dirread.c .B /usr/local/plan9/src/lib9/dirread.c
.SH SEE ALSO .SH SEE ALSO
.IR intro (3), .IR intro (3),
.IR open (3), .IR open (3),

177
man/man3/disk.3 Normal file
View file

@ -0,0 +1,177 @@
.TH DISK 3
.SH NAME
opendisk, Disk \- generic disk device interface
.SH SYNOPSIS
.nf
.ft L
#include <u.h>
#include <libc.h>
#include <disk.h>
.ft
.PP
.ft L
typedef struct Disk {
char *prefix;
char part[NAMELEN];
int fd, wfd, ctlfd, rdonly;
int type;
vlong secs, secsize, size, offset;
int c, h, s;
} Disk;
.ft
.PP
.B
Disk* opendisk(char *file, int rdonly, int noctl)
.SH DESCRIPTION
These routines provide a simple way to gather
and use information about
disks and disk partitions,
as well as plain files.
.PP
.I Opendisk
opens
.I file
for reading and stores the file descriptor in
the
.B fd
field of the
.B Disk
structure.
If
.I rdonly
is not set,
.I opendisk
also opens
.I file
for writing and stores that file descriptor in
.BR wfd .
The two file descriptors are kept separate to
help prevent accidents.
.PP
If
.I noctl
is not set,
.I opendisk
looks for a
.B ctl
file in the same directory as the
disk file;
if it finds one, it declares
the disk to be
an
.I sd
device,
setting the
.B type
field in the
.B Disk
structure
to
.BR Tsd .
If the passed
.I file
is named
.BI fd n disk \fR,
it looks for a file
.BI fd n ctl \fR,
and if it finds that,
declares the disk to be
a floppy disk, of type
.BR Tfloppy .
If either
control
file is found, it is opened for reading
and writing, and the resulting file descriptor
is saved as
.BR ctlfd .
Otherwise the returned disk
has type
.BR Tfile .
.PP
.I Opendisk
then stats the file and stores its length in
.BR size .
If the disk is an
.I sd
partition,
.I opendisk
reads the sector size from the
control
file and stores it in
.BR secsize ;
otherwise the sector size is assumed to be 512,
as is the case for floppy disks.
.I Opendisk
then stores the disk size measured in sectors in
.BR secs .
.PP
If the disk is an
.I sd
partition,
.I opendisk
parses the
control
file to find the partition's offset
within its disk;
otherwise it sets
.B offset
to zero.
If the disk is an ATA disk,
.I opendisk
reads
the disk geometry (number of cylinders, heads, and sectors)
from the
.B geometry
line in the
.I sd
control file;
otherwise it sets these to zero as well.
.B Name
is initialized with the base name of
the disk partition, and is useful for forming messages to the
.I sd
control file.
.B Prefix
is set to the passed filename without
the
.B name
suffix.
.PP
The IBM PC BIOS interface allocates
10 bits for the number of cylinders, 8 for
the number of heads, and 6 for the number of sectors per track.
Disk geometries are not quite so simple
anymore, but to keep the interface useful,
modern disks and BIOSes present geometries
that still fit within these constraints.
These numbers are still used when partitioning
and formatting disks.
.I Opendisk
employs a number of heuristics to discover this
supposed geometry and store it in the
.BR c ,
.BR h ,
and
.B s
fields.
Disk offsets in partition tables and
in FAT descriptors are stored in a form
dependent upon these numbers, so
.I opendisk
works hard to report numbers that
agree with those used by other operating
systems; the numbers bear little or no resemblance
to reality.
.SH SOURCE
.B /usr/local/plan9/src/libdisk/disk.c
.SH SEE ALSO
Plan 9's
\fIfloppy\fR(3) and \fIsd\fR(3)
.SH BUGS
Disks on Unix systems do not present the interface
that
.I opendisk
expects, so
.I opendisk
will give them type
.BR Tfile .

View file

@ -1,10 +1,14 @@
.TH DRAW 3 .TH DRAW 3
.SH NAME .SH NAME
Image, draw, gendraw, drawreplxy, drawrepl, Image, draw, drawop, gendraw, gendrawop, drawreplxy, drawrepl,
replclipr, line, poly, fillpoly, bezier, bezspline, fillbezier, fillbezspline, ellipse, replclipr, line, lineop, poly, polyop, fillpoly, fillpolyop, bezier, bezierop,
fillellipse, arc, fillarc, icossin, icossin2, border, string, stringn, bezspline, bezsplineop, bezsplinepts, fillbezier, fillbezierop,
runestring, runestringn, stringbg, stringnbg, runestringbg, fillbezspline, fillbezsplineop, ellipse, ellipseop,
runestringnbg, _string, ARROW, drawsetdebug \- graphics functions fillellipse, fillellipseop, arc, arcop, fillarc, fillarcop,
icossin, icossin2, border, string, stringop, stringn, stringnop,
runestring, runestringop, runestringn, runestringnop, stringbg,
stringbgop, stringnbg, stringnbgop, runestringbg, runestringbgop,
runestringnbg, runestringnbgop, _string, ARROW, drawsetdebug \- graphics functions
.de PB .de PB
.PP .PP
.ft L .ft L
@ -252,7 +256,7 @@ The clipping region may be modified dynamically using
.TP .TP
.B chan .B chan
The pixel channel format descriptor, as described in The pixel channel format descriptor, as described in
.IR image (6). .IR image (7).
The value should not be modified after the image is created. The value should not be modified after the image is created.
.TP .TP
.B depth .B depth
@ -805,8 +809,8 @@ is non-zero.
.SH SEE ALSO .SH SEE ALSO
.IR graphics (3), .IR graphics (3),
.IR stringsize (3), .IR stringsize (3),
.IR color (6), .IR color (7),
.IR utf (6), .IR utf (7),
.IR addpt (3) .IR addpt (3)
.PP .PP
T. Porter, T. Duff. T. Porter, T. Duff.

View file

@ -79,7 +79,9 @@ a key is created using a new
and and
.B q .B q
generated by generated by
.IR DSAprimes (3). .IR DSAprimes
(see
.IR prime (3)).
Otherwise, Otherwise,
.B p .B p
and and

View file

@ -25,18 +25,14 @@ will use
for the new file descriptor for the new file descriptor
(closing any old file associated with (closing any old file associated with
.IR newfd ). .IR newfd ).
File descriptors are allocated dynamically,
so to prevent unwarranted growth of the file descriptor table,
.I dup
requires that
.I newfd
be no greater than 20 more than the highest file descriptor ever used by
the program.
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/libc/9syscall .B /usr/local/plan9/src/lib9/dup.c
.SH SEE ALSO
.IR intro (3),
.IR dup (3)
.SH DIAGNOSTICS .SH DIAGNOSTICS
Sets Sets
.IR errstr . .IR errstr .
.SH BUGS
.I Dup
is a macro for
.I p9dup
to avoid name conflicts with the Unix function; see
.IR intro (3).

View file

@ -80,6 +80,6 @@ For example, to display a 15 byte array as hex:
.EE .EE
.SH SOURCE .SH SOURCE
.B /usr/local/plan9/src/libc/port/u32.c .B /usr/local/plan9/src/lib9/u32.c
.br .br
.B /usr/local/plan9/src/libc/port/u64.c .B /usr/local/plan9/src/lib9/u64.c

View file

@ -1,76 +0,0 @@
.TH ENCRYPT 3
.SH NAME
encrypt, decrypt, netcrypt \- DES encryption
.SH SYNOPSIS
.B #include <u.h>
.br
.B #include <libc.h>
.PP
.B
int encrypt(void *key, void *data, int len)
.PP
.B
int decrypt(void *key, void *data, int len)
.PP
.B
int netcrypt(void *key, void *data)
.SH DESCRIPTION
.I Encrypt
and
.I decrypt
perform DES encryption and decryption.
.I Key
is an array of
.B DESKEYLEN
(defined as 7 in
.BR <auth.h> )
bytes containing the encryption key.
.I Data
is an array of
.I len
bytes;
it must be at least 8 bytes long.
The bytes are encrypted or decrypted in place.
.PP
The DES algorithm encrypts an individual 8-byte block of data.
.I Encrypt
uses the following method to encrypt data longer than 8 bytes.
The first 8 bytes are encrypted as usual.
The last byte of the encrypted result
is prefixed to the next 7 unencrypted bytes to make the next 8
bytes to encrypt.
This is repeated until fewer than 7 bytes remain unencrypted.
Any remaining unencrypted bytes are encrypted with enough of the preceding
encrypted bytes to make a full 8-byte block.
.I Decrypt
uses the inverse algorithm.
.PP
.I Netcrypt
performs the same encryption as a SecureNet Key.
.I Data
points to an
.SM ASCII
string of decimal digits with numeric value between 0 and 10000.
These digits are copied into an 8-byte buffer with trailing binary zero fill
and encrypted as one DES block.
The first four bytes are each formatted as two digit
.SM ASCII
hexadecimal numbers,
and the string is copied into
.IR data .
.SH SOURCE
.B /usr/local/plan9/src/libc/port
.SH DIAGNOSTICS
These routines return 1 if the data was encrypted,
and 0 if the encryption fails.
.I Encrypt
and
.I decrypt
fail if the data passed is less than 8 bytes long.
.I Netcrypt
can fail if it is passed invalid data.
.SH SEE ALSO
.IR securenet (8)
.SH BUGS
The implementation is broken in a way that makes
it unsuitable for anything but authentication.

Some files were not shown because too many files have changed in this diff Show more