/************************************************************************
 *                                                                      *
 * fpl.library - A shared library interpreting script langauge.         *
 * Copyright (C) 1992-1994 FrexxWare                                    *
 * Author: Daniel Stenberg                                              *
 *                                                                      *
 * This program is free software; you may redistribute for non          *
 * commercial purposes only. Commercial programs must have a written    *
 * permission from the author to use FPL. FPL is *NOT* public domain!   *
 * Any provided source code is only for reference and for assurance     *
 * that users should be able to compile FPL on any operating system     *
 * he/she wants to use it in!                                           *
 *                                                                      *
 * You may not change, resource, patch files or in any way reverse      *
 * engineer anything in the FPL package.                                *
 *                                                                      *
 * This program is distributed in the hope that it will be useful,      *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                 *
 *                                                                      *
 * Daniel Stenberg                                                      *
 * Ankdammsgatan 36, 4tr                                                *
 * S-171 43 Solna                                                       *
 * Sweden                                                               *
 *                                                                      *
 * FidoNet 2:201/328    email:dast@sth.frontec.se                       *
 *                                                                      *
 ************************************************************************/

COMPILING
=========

 All versions:
 -------------
   FPL has been developed on Amiga and under AIX (IBM's UNIX version) using
 SAS/C development system version 6 and the internal AIX `cc' compiler combined
 with the `xcdb' debugger.

   The FPL source code is highly portable. Source code packages I've received
 during my life with programming, have often turned out to be hard to compile,
 contained innumerous errors and the only conclusion you do is that the
 distributed source code is not the same one that created the executable. This
 is *NOT* a source code package like that. FPL is written in ANSI C and the
 source code distributed is the only source used when FPL was compiled. Using
 SAS/C on Amiga and the standard `cc' (or perhaps `gcc') under UNIX will
 compile error free! Use 'ANSI' option with any other compiler to achieve best
 possible result!

   If you add or change anything major when porting, please send a copy of that
 to me to apply in the original FPL package.

   All versions are easily tested. Try running `SFPL demo.FPL' and if that
 works, you know that _most_ of FPL is working.

   Using the `DEBUG' define activates a lot of extra checking and debugging
 possibilities. Combined with the MEMORY_COOKIE define in "script.h", a good
 piece of memory writing checks is performed. The `MEMORY_QUEUE' enbles the
 memory queuing system.

   FPL runs and depends a lot on eight bit characters. Other character sets is
 easily supported by changing the defines in "script.h", but modifying it to
 other than eight bit characters will give you hard and boring work!

   Compilers not supporting ANSI C will have a hard time compiling this!

 Amiga version:
 --------------
   Assign FPL: to the FPL directory before compiling.

   You can make two version of the fpl.library, or more specificly one
 library version and one standard executable file version.

 The development of this started using SAS/C v5.10 and since that lacked proper
 library debugging features, I inserted some `#ifdef's and `#define's in the
 source so that I could create both a library version and a version done as
 a common executable for debugging. As you can see in the Makefile, the
 define `SHARED' constructs the library.  Just a 'make' will create the
 library, while a 'make FPL' will create the executable.

   The library version is using low level assembler routines for stack
 allocating/expanding/swapping (coded by Kjell Ericson/Daniel Stenberg).

   Some people have experienced troubles when trying to compile this. I can't
 understand why, but am searching for the answer.

   Compiling the executable file version will visualize a warning 205
 (`macro may have side effects' or something like that), but don't bother,
 the macro it warns about is perfectly safe.

   Compiling generates warning 183 `inlined function declared but not used',
 ignore it!

   __inline has been used in a few places to make the `Global Optimizer' inline
 those functions in the code.

 In the file "script.c", I do two calls to the function InitStack() and
 EndStack(). These are the two assembler functions that take care of the stack
 swapping. Make absolutely sure the stack pointer isn't changed in any way
 between those two function calls. The second function has been fixed to use
 A0 and D0 as parameter registers just to force SAS/C *not* to preserve any
 registers just before the function invoke.

 UNIX versions:
 --------------
   I spent many hours on this project writing the program under UNIX. The
 source features a small number of `#ifdef's to make this possible.
 The UNIX version I use is AIX, which is a mix of BSD and SVR4, OSF/1
 builts heavily upon it. The code is easily ported into other UNIX
 environments. The UNIX version can also be compiled into a shared library! I
 just don't know if it will work with anything but AIX, or not, but do try!
 'make' will create the shared library 'libfpl.a' (in good old UNIX naming
 standard) while 'make FPL' will build the executable version.

   (I ported FPL to SunOS v4.1.1 and Dell Unix v4.0. The SUN `cc' compiler
 promptly refuses some things (like the Data structure members which are
 function pointers, DaSt's note), so I used the GNU `gcc' compiler instead.
 The Dell Unix (SVR4) works like a charm, but will give a silly little warning
 for the '\a'. You can safely ignore it. / BjSt)

 OS/2 version:
 -------------
   There has been successful compilings under OS/2, but this package doen not
 includes proper handlings of OS/2 special cases. If you're experiencing
 trouble trying to compile this under OS/2, get in touch!
   Since the 12th of February 1994, I include makefile.os2 and "FPL.def" file
 in the FPL package to enable compiling FPL into a DLL (shared library) under
 OS/2. The IBM C-Set/2 compiler does complain a *LOT* on using bitwise
 operators on signed integers, but what can I do? I want bitwise operators on
 signed integers!!

 DOS version:
 ------------
   I actually thought of making one. Then I tried Turbo C and discovered that
 it doesn't look upon a single byte 10 as a newline character. That, plus the
 fact that DOS compilers too often think in terms of 16-bit made me skip all
 further efforts. Later modifications of FPL such as turning `int' into `long'
 throughout the entire source code has enhanced DOS porting possibilities, but
 is there really anyone who can do anything _serious_ with MS-DOS?!?.

 New versions:
 -------------
   Use `#ifdef's extensively and do not modify any part of the source code
 that do not affect the system you're fixing it to run under.

MAKEFILE
========

   This package's 'makefile' comes with the AIX options not commented.
 'smakefile' is the Amiga SAS/C makefile. To compile under another OS, comment
 the AIX lines in 'makefile' and uncomment the proper lines. Add other
 makefile stuff by commenting current uncommented lines and add your own.

SOURCE CODES
============

   The source has been coded with great thought of program performance. It's
 not easy to understand but I have done my best adding comments all over the
 place.

INCLUDE FILES
=============

   The "FPL.h" is in two places in the archive, but that is because of the
 convinience of having it in the source directory and I really couldn't
 leave it out of the include directory tree!
   When using the Amiga version you have to copy the files from the include
 directory to INCLUDE:. If you're using any other system, those files won't be
 needed.