plan9port/src/cmd/sam
rsc 8538a66037 allow
sam -r machine filelist...

from presotto
2004-05-14 18:25:49 +00:00
..
_libc.h Initial import. 2003-09-30 17:47:42 +00:00
address.c Reorg 2003-09-30 19:05:50 +00:00
buff.c Reorg 2003-09-30 19:05:50 +00:00
cmd.c Reorg 2003-09-30 19:05:50 +00:00
disk.c Reorg 2003-09-30 19:05:50 +00:00
err Initial import. 2003-09-30 17:47:42 +00:00
error.c Initial revision 2003-09-30 17:47:42 +00:00
errors.h Initial revision 2003-09-30 17:47:42 +00:00
file.c Reorg 2003-09-30 19:05:50 +00:00
io.c allow 2004-05-14 18:25:49 +00:00
list.c Initial revision 2003-09-30 17:47:42 +00:00
mesg.c Reorg 2003-09-30 19:05:50 +00:00
mesg.h Initial revision 2003-09-30 17:47:42 +00:00
mkfile clean up when finished. 2004-04-19 23:04:36 +00:00
moveto.c Reorg 2003-09-30 19:05:50 +00:00
multi.c Initial revision 2003-09-30 17:47:42 +00:00
parse.h Initial revision 2003-09-30 17:47:42 +00:00
plan9.c Initial revision 2003-09-30 17:47:42 +00:00
plumb.c Initial revision 2003-09-30 17:47:42 +00:00
plumb.h Initial import. 2003-09-30 17:47:42 +00:00
rasp.c Reorg 2003-09-30 19:05:50 +00:00
README Initial import. 2003-09-30 17:47:42 +00:00
regexp.c Reorg 2003-09-30 19:05:50 +00:00
sam.c allow 2004-05-14 18:25:49 +00:00
sam.h allow 2004-05-14 18:25:49 +00:00
shell.c Initial revision 2003-09-30 17:47:42 +00:00
string.c Initial import. 2003-09-30 17:47:42 +00:00
sys.c Initial import. 2003-09-30 17:47:42 +00:00
unix.c SunOS can rot in hell. 2004-03-26 01:59:35 +00:00
util.c Initial import. 2003-09-30 17:47:42 +00:00
xec.c Reorg 2003-09-30 19:05:50 +00:00

This is sam (not including samterm) from the 4th edition of Plan 9,
with changes so that it can be compiled under unix.
(Tested on Solaris 7 and Debian 3.0r1.)

Some extra libraries are needed.  First, fetch libutf-2.0 and libfmt-2.0
from
	http://pdos.lcs.mit.edu/~rsc/software/

(Beware that in libfmt/fmt.c there is a line that says:
        'u',    __ifmt,         /* in Plan 9, __flagfmt */
Thus, sam will have to fmtinstall the other thing.  Other ported programs
may have to do the same.  The fmt library should probably print messages
about bad format characters to stderr, since no one seems to check the
return codes.)

Compile and install those two libraries.  
Set PREFIX in the Makefile to match, then compile sam.

Your C compiler will emit many complaints of the form:
  sam.c:496: warning: passing arg 1 of `bufread' from incompatible pointer type

This is because the Plan 9 compiler has a slightly different (better,
ala Oberon) type system than ISO C.  Popular compilers generate the right
code, so in an act of civil disobediance I changed just enough to get
it to compile, but left the type errors in.  Now the next C standard can
adopt this extension, because at least one important C program uses it!

-- Scott Schwartz,  4 July 2003