                    Plug-Ins Technical Documentation
                    --------------------------------


This is the documentation file for Socket Script Plug-Ins implementation 
and is provided for developers.

1 - Plug-Ins description
2 - Supported plug-ins
3 - Including plug-ins
4 - License for third-parties plug-ins
5 - The future of plug-ins

------------------------------------------------------------------------
1                       Plug-Ins description

SScript comes with a lot of native commands. Of course, like any
scripting language, SScript isn't complete. It has the ability to add
plugs-ins. The Socket Script distribution comes with a few, and you can
also add your own plug-ins.

------------------------------------------------------------------------
2                        Supported plug-ins

SScript currently supports 2 types of plugins: Custom Libraries (CL) and
Perl scripts. CLs are included within the code, while Perl scripts are
part a script.

------------------------------------------------------------------------
3                        Including plug-ins

First, you must decide what kind of plug-ins you want to include. If you
need direct access to the code, you might want to add CLs. Custom
Libraries are C files added to the SScript binary. Simply write a C file
containing your code, and load it in sscript.c. For example, here is how
to add a custom library that writes "hello world". First, make an
hello.c file with your code in a function called hello_world. Then, you
can add a command in sscript.c like "cl hello" (note that all CLs
functions should be added with the cl keyword). Here is how the
sscript.c code you must add:

if(!cas_cmp(lindex(temp,1),"hello"))
{
 hello_world(sockfd,in);
}

You should add this code after the banner saying 'ADD CUSTOM LIBRARIES
HERE'. Then, you need to add your hello.c file to the Makefile after the
list of other C files.

If you only need a Perl plug-in, you can add it directly to a script.
You can either add it to the main script, or to a separate file and call
this file from the main script with the $remote command. In your code,
you can add Perl commands with the 'cl utils perl' keywords. See the
sscript.doc file for syntax.

------------------------------------------------------------------------
4                 License for third-parties plug-ins

When you add plug-ins to your code, you are free to use it for anything
you like. If you want to distribute your plug-ins with SScript, please
contact me first and maybe we could add it as part of the original
SScript distribution.

------------------------------------------------------------------------
5                      The future of plug-ins

In a future version, Java and TK plug-ins should be available, as well
as advanced networking plug-ins. If you have any comments, feel free to
mail me.



Drow@FastEthernet.net
---------------------
Jan 1998
