@DATABASE RI STC Lib V2.5
@Author Conversion program
@NODE OVERVIEW "Overview of RI STC Lib V2.5"

                                  @{b}@{u}Overview@{ub}@{uu}

This command allows people who have the Stone Cracker packing program to
handle packed data files inside their programs. Used in conjunction with
the RISTCDecrunchLib this library gives you everything you need to handle
crunched data files. It does, however, not allow you to actually crunch the
files yourself, nor does it support executables.

The shorthand STC is used in place of 'Stone Cracker' inside this document.

@ENDNODE OVERVIEW

@NODE STCLength "RI STC Lib V2.5"

@{fg shine}Function: STCLength@{fg text}
-----------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: unpackedsize.l=STCLength(address)

  This command returns the unpacked length of an stc crunched file held in
memory. The length will be in bytes. The address should be the address of
the stc'ed file in memory.

If this command returns 0 then 'address' does not point to a valid STC
packed file.

@ENDNODE STCLength

@NODE STCStart  "RI STC Lib V2.5"

@{fg shine}Function: STCStart @{fg text}
-----------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: address.l=STCStart(address)

  When unpacking an STC file over itself using @{" STCDecrunch " link "Bliz2:RedHelp/REDBlitzLibs/STCDecrunchLib.guide/STCDecrunch"} 
only one argument this command should be used to return the address of the
unpacked data. When unpacking an STC file over itself the data is unpacked
at a slight offset to the source data - thus this command is provided so
that you can always locate the unpacked data.

If this command returns 0 then 'address' does not point to a valid STC
packed file.

@ENDNODE STCStart 

@NODE STCSafeLen  "RI STC Lib V2.5"

@{fg shine}Function: STCSafeLen @{fg text}
-----------------------------------------------------------------------------
Modes : Amiga/Blitz
Syntax: safelen.l=STCSafeLen (address)

  This command returns the minimum memory buffer size that the given STC file
can be unpacked into. Unpacking into a buffer smaller than this size will
cause memory corruption and a possible crash.

This command should only be used when unpacking an STC file over itself.
Thus you need to ensure that you reserve a big enough block of memory for
the deallocation to occur properly.

If this command returns 0 then 'address' does not point to a valid STC
packed file.

@ENDNODE STCSafeLen 

@NODE STCLoad "RI STC Lib V2.5"

@{fg shine}Statement/Function: STCLoad@{fg text}
-----------------------------------------------------------------------------
Modes : Amiga
Syntax: [suc=]STCLoad(filename$,address)

  This command allows the loading of an STC file into the given memory
address. The file is then unpacked over itself in memory. You must provide
the memory to use for the load (plus ensure that it will be large enough to
hold the unpacked file).

If this command returns 0 then the file could not be loaded properly or was
not a valid packed file.

@ENDNODE STCLoad

@NODE MAIN "RI STC Lib V2.5"
.---------------------------------------------------------------------------.
|                              @{b}RI STC Lib V2.5@{ub}                              |
`---------------------------------------------------------------------------'

                         ©1996 Red When Excited Ltd

                             @{"     Overview     " link OVERVIEW}

                               Command Index                                

                               @{" STCLength    " link STCLength}
                               @{" STCLoad      " link STCLoad}
                               @{" STCSafeLen   " link STCSafeLen }
                               @{" STCStart     " link STCStart }

                                @{" Examples " LINK Examples}

                              @{" Main Document " LINK "Blitz2:RedHelp/REDBlitzLibs/REDBLITZLIBS.GUIDE/MAIN"}
                              @{" Library Index " LINK "Blitz2:RedHelp/REDBlitzLibs/REDBLITZLIBS.GUIDE/LIBRARYLIST"}

@ENDNODE MAIN

@NODE Examples "Example Programs"

                             @{b}@{u}Example Programs@{ub}@{uu}

@{fg shine}EXAMPLE 1@{fg text} -  A font sensitive Encrypter for data files :

           @{" Load Example 1 " system "run >NIL: BLITZ2:REDHelp/ShowExample File=Blitz2:RedHelp/REDBlitzLibs/Examples/RISTCLib1.bb"}
           @{" Compile It!    " system "run >NIL: BLITZ2:REDHelp/ShowExample File=COMPILE"}

@ENDNODE Examples
