








      PPoorrttiinngg TThhee MMaaccrroo IImmpplleemmeennttaattiioonn ooff SSNNOOBBOOLL44 iinn CC


                      _P_h_i_l_i_p _L_. _B_u_d_n_e
                         Consultant




11..  WWhhoo nneeeeddss ttoo rreeaadd tthhiiss??


     You should read this document if you are trying to port
The Macro Implementation of SNOBOL4 in C (CSNOBOL4) to a new
system, or you are interested in understanding how it works!



22..  RReeqquuiirreemmeennttss


     The Macro Implementation of  SNOBOL4  is  the  original
Bell Labs implementatiton of the SNOBOL4 language, with many
SPITBOL and SNOBOL4+ extensions.  As the title suggests, the
target  machine is anything that has a C compiler and a good
C library.  The target machine should have;


+o    A large address space (allowing for  approx  300K  code
     and 300K data).  Virtual memory is desirable.


+o    An  industrial  strength  optimizing  C compiler; GNU C
     (gcc) is preferred, but no ANSI C features are required
     (a traditional "K&R" C compiler will do).  Some propri-
     etary C compilers produce code  which  performs  better
     than gcc.


+o    A  reasonably  complete  C  library,  including  stdio.
     POSIX and ANSI C89 features will be  used  when  avail-
     able, but are not required.


     System  dependencies  are  all isolated in library rou-
tines and a few C preprocessor macros (for inline  implemen-
tation  of  SIL  operations).   The  supplied code should be
machine independent, and a binary of snobol4 should  not  be
needed to bootstrap the system.











                             -2-


33..  DDaattaa mmooddeellss


     CSNOBOL4  has  been run under both the ILP32 data model
(32-bit int/long and pointer data types) common on Unix sys-
tems,  as  well  as  the LP64 data model (32-bit int, 64-bit
long and pointer data  types)  available  as  an  option  on
recent  versions of commercial Unix systems, and the default
on Alpha (and the as-yet largely mythical) IA64  and  x86-64
architectures.


     It  may be possible to compile CSNOBOL4 on an LP32 sys-
tem (16-bit int, 32-bit long and pointer  types),  but  such
environments  are  uncommon (Win3.1 and old Macintosh C com-
pilers may use the LP32 data model).   Some  work  would  be
required  to  find  places  where "int" was assumed to be 32
bits.


     An experimental feature of the 1.0 release of  CSNOBOL4
is  to  use the "long long" datatype (available as an exten-
sion or with C99 support) to represent 64-bit SNOBOL4  INTE-
GERs  in  ILP32 environments, by using the configure --long-
long option.  If C99 library features are not available, ad-
hoc support will be used.


44..  CCoonnffiigguurraattiioonn ffiilleess


     The  configure  script  determines  which  include  and
library routines are available, and which suppplied  library
routines  to  use.   The outputs of configure are config.m4,
which is included into Makefile2.m4 using the m4 macro  pro-
cessor,   and   contains   make  variable  assignments  (ie;
VAR=VALUE) and m4 macro invocations, and config.h  which  is
included by all C sources.


     If  the file "local-config" exists, it will be interpo-
lated at the end of config.m4.  If the file  "local-defines"
exists, it will be interpolated at the end of config.h


44..11..  mmaakkee vvaarriiaabblleess


     The following are variables which may need to be set in
some environments;













                             -3-


44..11..11..  CCCC


     The path for the C compiler to use.

44..11..22..  CCCCMM


     The command to use to create "make depend" output.  The
default value is "./cc-M" If your C compiler (see CC, above)
supports this function directly, CCM can be reset in  local-
config.

44..11..33..  MMAATTHHLLIIBB


     The  flags/path  to  use  to link a C program with math
routines (may be needed for the  pow()  function,  or  other
implementation of exp.c.  The default value is '-lm'.

44..11..44..  OOPPTT


     Optimization, debug, and profiling flags to pass to the
C compiler.  The default is "-O".

44..11..55..  SSNNOOBBOOLL44


     Name of the main source file to make and  use.   Should
be  either  isnobol4  (the  default),  which  has  functions
reordered so that your C compilers can inline functions more
effectively.  If  your C compiler does not perform inlining,
and gcc is not available you can use  the  value  "snobol4".
This  may  be  useful  if you are doing development and, for
some reason you cannot build isnobol4.c


44..11..66..  PPMMLL__OOBBJJSS


     Object files not in snolib.a for  functions  referenced
from pml.h (see load.doc).

44..11..77..  SSoouurrccee ffiillee ppaatthh vvaarriiaabblleess..


     All library source file paths are defined in variables,
so that alternate  versions  may  be  substituted.   Typical
variables of this type are LOAD_C, EXP_C, MSTIME_C.  See the
section on library functions for descriptions of the  files,
and the alternate versions included in the distribution.











                             -4-


44..22..  mm44 mmaaccrrooss


     Each  of  the following macros can be used to add files
or flags to a make variable  (in  place  of  the  +=  syntax
available  in  some  make programs).  The m4 quote start and
end characters have been changed from accent grave and apos-
trophe  to open and close brackets.  Values passed to the m4
macros should be quoted for safety.

44..22..11..  AADDDD__CCPPPPFFLLAAGGSS


     Add argument to CPPFLAGS (used in make depend, .c  file
compilation).

44..22..22..  AADDDD__OOPPTT


     Add argument to flags used to compile .c files.

44..22..33..  AADDDD__SSRRCCSS


     Add argument to list of source files processed in "make
depend".

44..22..44..  AADDDD__OOBBJJSS


     Add argument to list of object files used to  construct
snolib.a

44..22..55..  AADDDD__LLDDFFLLAAGGSS


     Add  argument  to  flags passed to "cc" command used to
link snobol4 executable.


55..  CC PPrree--PPrroocceessssoorr MMaaccrroo nnaammeess


     The following are cpp  macro  names  which  can  be  by
adding #define lines to local-defines.


55..11..  ##iiffddeeff''ss

TThhee  ffoolllloowwiinngg  ccpppp  mmaaccrroo nnaammeess aarree ##iiffddeeff''eedd iinn ssoouurrccee aanndd
hheeaaddeerr ffiilleess;;












                             -5-


55..11..11..  HHAAVVEE__BBUUIILLDD__VVAARRSS


     Variables from the Makefile generated build.c,  includ-
ing build_file, build_date, build_dir are available

55..11..22..  HHAAVVEE__DDXXEE22


     The  MS-DOS/DJGPP  DXE2  dynamic  loading  facility  is
available.

55..11..33..  HHAAVVEE__FFSSEEEEKKOO


     The  system  provides  the  "large   file   extensions"
fseeko() function which takes an off_t instead of a long.

55..11..44..  HHAAVVEE__OOSS__IINNIITT


     Define  if  you need to supply an Operating System spe-
cific initialization routine named os_init to be  called  on
startup.

55..11..55..  HHAAVVEE__SSOOCCKKAADDDDRR__IINN66


     The system provides struct sockaddr_in6 for IPv6 inter-
net addresses.  Some systems define AF_INET6 without provid-
ing this structure!

55..11..66..  HHAAVVEE__SSTTDDLLIIBB__HH


     The system provides the ANSI stdlib.h header file

55..11..77..  HHAAVVEE__SSTTRRIINNGGSS__HH


     The  system  provides the V7/BSD strings.h header file.
This  file  is  expected  to  provide  definitions  for  the
bcopy(), bzero(), index() and rindex() functions.

55..11..88..  HHAAVVEE__SSTTRRIINNGG__HH


     The system provides the ANSI/SVID string.h header file.

55..11..99..  HHAAVVEE__WWIINNSSOOCCKK__HH


     The system provides the Win32 winsock.h header file.










                             -6-


55..11..1100..  HHAAVVEE__WWAATTTTCCPP


     The MS-DOS WATTCP TCP/IP library is available.

55..11..1111..  HHZZ


     Used with lib/generic/mstime.c;  Number  of  ticks  per
second,  as  returned  by times() system call (default: 60).
Common values are 50 and 100.

55..11..1122..  IINNTT__TT


     If INT_T is defined, it should be the C type to use for
integer values and addresses.  INT_T must be large enough to
hold a pointer. The default type used for int_t  is  "long",
except  when  the  configure --longlong option is given, and
then int_t is "long long".  See also REAL_T.

55..11..1133..  NNEEEEDD__BBCCOOPPYY


     Prototype for bcopy() routine needed.

55..11..1144..  NNEEEEDD__BBZZEERROO


     Prototype for bzero() routine needed.

55..11..1155..  NNEEEEDD__BBIINNDDRREESSVVPPOORRTT


     bindresvport() function and prototype needed.

55..11..1166..  NNEEEEDD__BBIINNDDRREESSVVPPOORRTT__SSAA


     bindresvport_sa() function and prototype needed.

55..11..1177..  NNOO__BBIITTFFIIEELLDDSS


     If NO_BITFIELDS is defined, disable use of a C bitfield
to  store  the  descriptor "v" (size) field.  Some compilers
have problems with bitfields, or cause  servere  performance
penalties  for  their  use.   Bitfields  are used to fit the
8-bit flags and 24-bit size fields into one 32-bit word.  In
LP64 environments (or when configure --longlong is used) the
"a" field is 64-bits long; Since the combined  "f"  and  "v"
fields  will  be padded to 64-bits for alignment there is no
benefit to using bitfields  in  this  situation.   See  also
VFLD_T.









                             -7-


55..11..1188..  NNOO__FFDDOOPPEENN


     Disable  use  of  the  fdopen()  stdio function.  Magic
pathname /dev/fd/n will not be available.

55..11..1199..  NNEEEEDD__OOFFFF__TT


     Should be set on systems where there is no system  sup-
plied  "off_t"  typedef available in either <sys/types.h> or
<unistd.h>.  The "long" datatype will be used for file  off-
sets in this case.


55..11..2200..  NNOO__PPMMLL__DDEELLEETTEE


     Prevents  "poor-mans  loading" of the SITBOL compatible
DELETE() function.

55..11..2211..  NNOO__PPMMLL__EEXXIITT


     Prevents "poor-mans loading" of SPITBOL EXIT() function
emulation.  There is a dummy function available for addition
to snolib for the  execute()  function  (ie;  ADD_OBJS([exe-
cute.o]))  in  case  execl()  is not available.  This may be
preferable to eliminating EXIT() altogether for  compatibil-
ity reasons.

55..11..2222..  NNOO__PPMMLL__FFIILLEE


     Prevents  "poor-mans  loading" of the SITBOL compatible
FILE() predicate.

55..11..2233..  NNOO__PPMMLL__HHOOSSTT


     Prevents "poor-mans loading" of SPITBOL HOST() function
emulation.  There are dummy functions available for addition
to snolib for  the  system()  and  getenv()  functions  (ie;
ADD_OBJS([system.o]))  in  case either or both functions are
not available.

55..11..2244..  NNOO__PPMMLL__RREEAALL


     Prevents "poor-mans loading"  of  the  following  func-
tions;  SQRT(), EXP(), LOG(), CHOP(), The functions can also
be eliminated individually by setting  one  of  NO_PML_SQRT,
NO_PML_EXP, NO_PML_LOG, or NO_PML_CHOP.  Setting NO_PML_TRIG
eliminates SIN(), COS() and TAN().









                             -8-


55..11..2255..  NNOO__PPMMLL__RREENNAAMMEE


     Prevents "poor-mans loading" of the  SITBOL  compatible
RENAME() function.


55..11..2266..  NNOO__UUNNBBUUFF__RRWW


     Disable  direct  use of read(), write() and lseek() for
unbuffered binary I/O.  The  stdio  fread(),  fwrite()  plus
fflush(),  and fseek() functions will be used for all binary
I/O.


55..11..2277..  OOSSDDEEPP__OOPPEENN


     If  defined,  I/O   code   calls   a   function   named
osdep_open()  with a filename string, a mode string (as used
by fopen()) and a pointer to a FILE *.  If the  local  envi-
ronment  wishes  to  intercept  the  named  file,  it should
attempt (if necessary) to open the  necessary  file(s),  and
fill  in the FILE pointer pointer with either NULL (on fail-
ure), or a FILE *.  In either  case  the  osdep_open()  call
should  return  TRUE  (meaning  the filename has been inter-
cepted), if filename  interception  is  not  attempted,  the
function should return FALSE.


55..11..2288..  PPMMLL__SSEERRVV


     Enable  "poor-mans  loading" of SERV_LISTEN() function,
which can used to create  Internet  servers.   SERV_LISTEN()
requires  a working fork() call, which completely replicates
the state of the system in a new process.


55..11..2299..  RREEAALL__TT


     If REAL_T is defined, it should be the C  type  to  use
for SNOBOL4 REAL values. The default type used for real_t is
"float". In LP64 environments (or when configure  --longlong
is  used)  the "a" field will be 64-bits (to hold pointers),
so REAL_T is declared as a C "double" to take  advantage  of
the available space.


     Example:   ADD_CPPFLAGS([-DREAL_T=double]).   See  also
INT_T.










                             -9-


55..11..3300..  SSIIGGFFUUNNCC__TT


     Return type  for  signal  handler  functions  (default:
void).

55..11..3311..  SSIIZZLLIIMM


     May  be  redefined  when  when NO_BITFIELDS is defined.
The maximum object size  that  can  be  represented  in  the
VFLD_T  data  type.   When  NO_BITFIELDS  is defined, SIZLIM
defaults  to  0x7fffffff  (maximum  positive  32-bit   int).
SIZLIM  must  NOT  appear  to  be negative when stored in an
"int_t".  When int_t  is  known  to  be  64-bits,  configure
defines  SIZLIM as 0xffffffff. See also INT_T, NO_BITFIELDS,
VFLD_T.


55..11..3322..  SSOOCCKKLLEENN__TT


     Must be defined to be the datatype used by the  operat-
ing system to return the length of socket address structures
written by the accept(),  getsockaddr(),  and  getpeeraddr()
system calls.  Typical values: socklen_t, int, unsigned int.


     Return type  for  signal  handler  functions  (default:
void).

55..11..3333..  TTMMPP__DDIIRR


     Used  in lib/bsd/load.c; Directory to use for temporary
files (default "/tmp").

55..11..3344..  TTTTYY__RREEAADD__CCOOOOKKEEDD


     Call tty_read() function (see tty.c below)  to  perform
"cooked" (non-binary) reads of terminal devices.

55..11..3355..  TTTTYY__RREEAADD__RRAAWW


     Call  tty_read()  function (see tty.c below) to perform
"raw" (binary) reads of terminal devices. May  be  necessary
on  systems  where character at a time terminal I/O requires
special calls.













                            -10-


55..11..3366..  VVFFLLDD__TT


     The descriptor "v" field is used to hold  the  size  of
objects in bytes.  When NO_BITFIELDS is not defined, the "v"
field is always a 24-bit unsigned  bitfield.   When  NO_BIT-
FIELDS  is defined VFLD_T is used (and defaults to "unsigned
int"). See also SIZLIM.


66..  MMaaccrrooss


     The are macros defined in macros.h which call may  call
library functions.


66..11..  DDCCMMPP mmaaccrroo


     DCMP  compares two descriptors.  By default it compares
the members one at a time.   On  systems  where  int_t  (see
INT_T)  does not access the entire "a" field, DCMP_BYTES may
need to be defined, in which case DCMP  calls  the  "bcmp()"
library function.


66..22..  MMOOVVBBLLKK mmaaccrroo


     Uses  bcopy() to move blocks of descriptors. The source
and destination may overlap, a situation which many versions
of memcpy() will not deal with correctly!!


     ANSI  C  memmove()  handles overlap, but may be ineffi-
cient.


     A portable, efficient C bcopy routine  is  provided  in
lib/auxil/bcopy.c


66..33..  AAPPDDSSPP mmaaccrroo


     Uses bcopy() to append strings.  See MOVBLK macro.


66..44..  ZZEERRBBLLKK mmaaccrroo


     Uses bzero() to clear blocks of descriptors.










                            -11-


     A generic C bzero routine is provided lib/auxil/bzero.c


77..  LLiibbrraarryy ffiilleess


     The remainder of this file describes the  various  sys-
tem-dependent library files, the functions they provide, and
the C library functions they require.


77..11..  bbccooppyy..cc


     auxil/bcopy.c contains a fast but  generic  version  of
the  bcopy function, used to copy blocks of memory which may
overlap.


77..22..  bbiinnddrreessvvppoorrtt..cc


     auxil/bindresvport.c contains generic versions  of  the
bindresvport() and bindresvport_sa() library functions (cre-
ated by Sun and BSD Unix respectively) used to bind internet
sockets local addresses to reserved ports.


77..33..  bbzzeerroo..cc


     auxil/bzero.c  contains  a  fast but generic version of
the bzero function, used to zero blocks of memory.


77..44..  ddaattee..cc


     Contains date() for formatting  the  current  data  and
time  for the SNOBOL4 DATE() function.  Calls time(), local-
time() and sprintf().


77..55..  ddyynnaammiicc..cc


     Allocate dynamic storage region, and forewarn the oper-
ating  system  that  access  behavior  may be non-sequential
(particularly during storage regeneration).  Three  versions
are provided:


lib/posix/dynamic.c
     Uses malloc and madvise()









                            -12-


lib/bsd/dynamic.c
     Uses malloc and vadvise()


lib/generic/dynamic.c
     Uses malloc()


77..66..  eennddeexx..cc


     Contains  endex()  which  is  called  to end execution.
Calls exit() for normal termination and abort() for abnormal
termination!


77..77..  eexxeeccuuttee..cc


     Provides  execute() function for SPITBOL HOST() simula-
tion.


lib/generic/execute.c
     Uses execl() and /bin/sh or /usr/bin/sh to pass execute
     to a shell command.


lib/dummy/execute.c
     Provides dummy execute() function.


77..88..  eexxiissttss..cc


     Test for file existance.


lib/generic/exists.c
     Uses POSIX stat() function.


lib/vms/exists.c
     Currently uses stat() function; use native call?


lib/win32/exists.c
     Uses WIN32 GetFileAttributesA() call.


77..99..  eexxpp..cc












                            -13-


     Perform  integer  and  real  exponentiation for SNOBOL4
exponentiation  operator.   Two   versions   are   provided:
generic/exp.c  (which  uses  the  pow() library function for
reals and repeated multiplies for integers), and dummy/exp.c
which  causes fatal errors (as specified by the SIL language
manual) to be used if suitable  library  functions  are  not
available (or if the size of the library functions is objec-
tionable).


     pow(x,y) is a venerable function and should  be  widely
available.   If  it  is  not,  it could be simulated (ie; in
pow.c) using exp() and log(), or similar functions (such  as
expm1() and log1p()).


77..1100..  ffiinniittee..cc


     provide finite() function for systems which do not sup-
ply a function to detect abnormal floating point numbers.


lib/dummy/finite.c
     Returns false.


77..1111..  iinneett..cc


     Provides tcp_open() and udp_open() functions for commu-
nications with to internet servers.


lib/bsd/inet.c
     Uses traditional BSD style sockets for IPv4 only opera-
     tion.


lib/bsd/inet6.c
     Uses RFC2553 and IEEE 1003.1g extensions to  BSD  style
     sockets for IPv4/IPv6 independent operation.


lib/dummy/inet.c
     Provides dummy entry points for systems with no TCP/IP


77..1122..  iinniitt..cc


     Initialization   functions   init_args()   and  init().
init_args() is called from  main()  to  parse  command  line
arguments, using getopt() and sscanf().  A version of getopt









                            -14-


is available in lib/auxil/getopt.c.


     init() is called from by the SIL INIT macro (first line
of  v311.sil)  to  initialize  storage  and signal handling.
init() calls bzero() and signal().


77..1133..  iinnttssppcc..cc


     Convert integers from binary to  strings.   Three  ver-
sions are provided;


lib/generic/intspc.c
     Uses sprintf() "%ld" format


lib/c99/intspc.c
     Uses sprintf() "%lld" format.


lib/longlong/intspc.c
     Ad-hoc formatting.


77..1144..  iioo..cc


     Provide  I/O  support (io_xxx) using the C standard I/O
package.  Calls:  fopen,  fclose,  fgets,  fprintf,  rewind,
bzero  (see  above),  malloc,  free,  exit, strcpy, strncpy,
strlen.


77..1155..  llooaadd..cc


     Provides functions load(),  link()  and  unload()  (SIL
macros  LOAD,  LINK,  UNLOAD)  for  the  SNOBOL4  LOAD() and
UNLOAD() functions.


dummy/load.c
     causes fatal errors as specified in  the  SIL  language
     reference.


bsd/load.c
     Uses  ld  to provide a portable implementation for sys-
     tems using a.out object format.











                            -15-


unix98/load.c
     Uses  sun/unix98  dlopen()  call   to   attach   shared
     libraries.


lib/hpux/load.c
     Use   HP-UX   shl_load()   function  to  attach  shared
     libraries.


lib/vms/load.c
     Use  VMS  LIB$FIND_IMAGE_SYMBOL()  function  to  attach
     dynamic libraries.


lib/win32/load.c
     Use  Win32  LoadLibrary()  function  to  attach dynamic
     libraries.


77..1166..  mmssttiimmee..cc


     Provides user runtime in milliseconds.  Six  (!!)  ver-
sions of mstime.c are provided:


bsd/mstime.c
     uses  getrusage()  to provide accuracy up to (or better
     than) a millisecond.   Use  this  version  when  native
     getrusage()  is  available  (ie;  under  SunOS 4.1), as
     sysconf() usually return a number smaller than 1000!


posix/mstime.c
     uses times() and  sysconf().   Use  this  version  when
     sysconf() is available.


generic/mstime.c
     uses   times()   and  #define'ed  HZ  (defaults  to  60
     ticks/sec, but may be overridden).


ansi/mstime.c
     uses  clock(),   and   CLK_TCK,   if   present.    Uses
     CLOCKS_PER_SEC,  if  present,  else defaults to 1000000
     (may be overridden by defining CLK_TCK).


borland/mstime.c
     Uses clock() returning a wall-clock time not zeroed  at
     program start.










                            -16-


vms/mstime.c
     Uses VMS version of times().


win32/mstime.c
     Uses  Win32 GetProcessTimes() or GetSystemTime() calls.


dummy/mstime.c
     if none of getrusage(), times() or  clock()  is  avail-
     able.


77..1177..  ppooppeenn..cc


     Provide popen() and pclose() functions on systems where
these  functions  are  not  included  in  the   C   library.
NEED_POPEN  should be defined, to declare prototypes for the
functions.


lib/generic/popen.c
     Uses system() function and ">" and "<" style  redirect-
     ion to simulate popen() functionality.


lib/vms/popen.c
     Uses  VMS  mailbox and LIB$SPAWN to provide functional-
     ity.  Recent versions of the DECC RTL provide  popen().


lib/dummy/popen.c
     Dummy functions, always fails.


77..1188..  rreeaallsstt..cc


     Convert  from  binary  floating  point to string.  Uses
"%g" format, and will append trailing dot if needed.


     Better results may be possible by using fconvert(), and
gconvert() (or fcvt() and gcvt()) when available, along with
a modicum of intelligence and/or post-processing.


77..1199..  ssppcciinntt..cc


     Convert from strings to binary integers.  Four versions
are provided;










                            -17-


lib/ansi/spcint.c
     Uses strtol()


lib/generic/spcint.c
     Uses sscanf()


lib/c99/spcint.c
     Uses  strtoll()  for support of long long on ILP32 sys-
     tems.


lib/longlong/spcint.c
     Ad hoc support of long long on ILP32 systems.


77..2200..  sspprreeaall..cc


     Convert from strings to floating point.   Two  versions
are provided;


lib/ansi/spreal.c
     Uses strtod()


lib/generic/spreal.c
     Uses sscanf()


77..2211..  ssuussppeenndd..cc


     Cause  the  current  process  to  suspend  itself after
reciept of a SIGTSTP signal.


lib/posix/suspend.c
     Use sigprocmask() to unblock SIGTSTP.


lib/bsd/dynamic.c
     Use sigsetmask() to unblock SIGTSTP.


lib/generic/suspend.c
     Use SIGSTOP.














                            -18-


77..2222..  tteerrmm..cc


     Provides term_input() function which  returns  a  stdio
stream (FILE *) connected to the terminal (typically via the
stderr file descriptor) for read. Three  versions  are  pro-
vided;


lib/posix/term.c
     uses STDERR_FILENO from <unistd.h> and fdopen().


lib/generic/term.c
     uses fdopen() on file descriptor 2.


lib/vms/term.c
     performs fopen() on SYS$COMMAND:.


77..2233..  ttttyy..cc


     Provides  fisatty(), tty_mode() and tty_suspend() func-
tions for saving and manipulating terminal  mode  and  echo.
May   optionally   declare   a   tty_read()   function  (see
TTY_READ_RAW and TTY_READ_COOKED ifdefs) to perform reads on
terminal devices.


lib/posix/tty.c
     Uses   termios.h   (or   SVID  termio.h  if  USE_TERMIO
     defined).


lib/bsd/tty.c
     Uses sgtty.h


lib/borland/tty.c
     Provide tty_read() using getch() and getche().


lib/vms/term.c
     Declares tty_read() function using VMS SYS$QIOW to per-
     form raw tty reads.


lib/win32/term.c
     Implements tty_mode and tty_read using SetConsoleMode()
     and ReadFile().











                            -19-


lib/dummy/term.c
     Dummy functions, if none of the above facilities avail-
     able.


77..2244..  ssyyss..cc


     provides  hwname()  and  osname()  functions for use by
SPITBOL HOST() function emulation.


lib/posix/sys.c
     Uses <sys/utsname.h> and uname(2) function.  Checks for
     HWNAME and OSNAME defines.


lib/vms/sys.c
     Use SYS$GETSYIW() calls.


lib/win32/sys.c
     Use GetSystemInfo() and GetVersionEx() calls.


lib/generic/sys.c
     Use HWNAME and OSNAME defines.


88..  UUnnddeerrssttaannddiinngg tthhee SSIILL ssoouurrccee


     You  should  not  need to look at or understand the SIL
(SNOBOL Implementation Language) sources to port  the  pack-
age.   Documentation for the original macros can be found in
memo     s4d58     which      can      be      found      in
ftp://ftp.snobol4.org/snobol/doc/























