plan9port/src/cmd/sam
Russ Cox 1f098efb73 all: a few more #define tricks for AIX
This should make the AIX build finally work.

Fixes #400.
2020-08-15 20:46:23 -04:00
..
_libc.h
address.c
buff.c Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. 2006-04-01 19:24:03 +00:00
cmd.c Trivial changes: whitespace and modes. 2020-01-10 14:54:30 +00:00
disk.c acme, sam: handle >1GB files correctly 2014-03-13 18:46:28 -04:00
err
error.c sam: freetmpstr instead of free 2018-03-27 15:03:12 +02:00
errors.h Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. 2006-04-01 19:24:03 +00:00
file.c fix clang warnings reported by Tuncer Ayaz 2012-10-21 11:25:08 -04:00
io.c sam: report close error 2019-12-19 15:00:58 -05:00
list.c 64-bit fixes 2006-04-20 20:49:00 +00:00
mesg.c Trivial changes: whitespace and modes. 2020-01-10 14:54:30 +00:00
mesg.h Trivial changes: whitespace and modes. 2020-01-10 14:54:30 +00:00
mkfile Goodbye SHORTLIB 2005-01-04 22:10:29 +00:00
moveto.c Trivial changes: whitespace and modes. 2020-01-10 14:54:30 +00:00
multi.c 64-bit fixes 2006-04-20 20:49:00 +00:00
parse.h Use gcc -ansi -pedantic in 9c. Fix many non-C89-isms. 2006-04-01 19:24:03 +00:00
plan9.c Many small edits. 2005-01-13 04:49:19 +00:00
plumb.h Trivial changes: whitespace and modes. 2020-01-10 14:54:30 +00:00
rasp.c Trivial changes: whitespace and modes. 2020-01-10 14:54:30 +00:00
README
regexp.c acme, sam: fix regexp code for bigger Runemax 2010-07-14 11:10:59 -07:00
sam.c Trivial changes: whitespace and modes. 2020-01-10 14:54:30 +00:00
sam.h all: a few more #define tricks for AIX 2020-08-15 20:46:23 -04:00
shell.c sam: add $% as an alias for $samfile 2012-09-17 14:53:11 -04:00
string.c
sys.c sam: report close error 2019-12-19 15:00:58 -05:00
unix.c Trivial changes: whitespace and modes. 2020-01-10 14:54:30 +00:00
util.c
xec.c

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